-
Notifications
You must be signed in to change notification settings - Fork 0
/
RunModel.py
33 lines (25 loc) · 1.02 KB
/
RunModel.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
############################################################################
# Model for Optimizing Vehicle Routing problems with
# Perishable Products under Time-window and Quality Requirements
############################################################################
############ Importing Required Python Libraries ############
import json, datetime
from ModelFile import *
# Import the json file
file_no = input('Dataset file number (after \"_\"): ')
json_file = open('DataSets\\dataset_'+file_no+'.json')
data = json.load(json_file)
result_file = 'Results\\Test_Run\\Results_' + file_no + '_node_Dataset'
model = VRP_Model(data,result_file,60)
IsFeasible= model.IsFeasible
SolCount= model.SolCount
BestBound= model.BestBound
GapOptimality = model.GapOptimality
CurrObjVal = model.CurrObjVal
print('Model Run Complete.')
if IsFeasible:
print('Feasible Model: Z = ',CurrObjVal)
print('Result File Generated.')
else:
print('InFeasible Model!!!!')
print('Result File NOT Generated.')