-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexeLoadInstance.py
More file actions
120 lines (98 loc) · 5.02 KB
/
exeLoadInstance.py
File metadata and controls
120 lines (98 loc) · 5.02 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# homemade
import campaign as cp
import matrix as cm
import algorithms as cmm
import ScheduleManagment as sm
import setup as s
import pwa as pwa
# Python
import tkinter as tk
from tkinter.filedialog import askopenfilename
def main():
# #######################################################################
# #
# PARAMETERS TO BE MODIFIED #
# #
# Modify the desired values #
# save py file (ctrl+s) #
# then press F5 to execute #
# #
# #######################################################################
#Campaign title and name ==============================================
campaignName = "dCroce_1_10000_50_10-50-100-500-1000" # string
campaignUser = "FCO" # string
#Algorithms ==========================================================
useLPT = 1 # 1 or 0
useSLACK = 1 # 1 or 0
useLDM = 1 # 1 or 0
useCOMBINE = 1 # 1 or 0
useMULTIFIT = 0 # 1 or 0
# #######################################################################
# #
# APPLICATION PART #
# do not change anything here #
# #
# #######################################################################
root = tk.Tk()
root.withdraw() # pour ne pas afficher la fenêtre Tk
name = askopenfilename(initialdir=s.folder(s.FOLDER_RESULTS), filetypes=[("json instance files","*.json")])
if not name: return
ifile = s.InstanceFile()
d = ifile.read(name) # D is a dictionnary with keys parameters
print("===============================================================")
print("Retrieve instance informations")
print("===============================================================")
#Campaign title and name ==============================================
campaignName = d["campaignName"]
campaignUser = d["campaignUser"]
campaignDate = d["campaignDate"]
# Generation ==========================================================
seed = d["seed"]
genrationMethod = d["generateMethode"]
a = d["a"]
b = d["b"]
alpha = d["alpha"]
beta = d["beta"]
lambd = d["lambda"]
pwafileName = d["reelFileName"]
# properties ==========================================================
genType = d["type"]
n = d["n"]
m = d["m"]
indicators = d["indicators"]
# Time List ==========================================================
timeList = d["timeList"]
# Alogrithm result ==================================================
result = []
print("Campaign ================")
print("Date . . . . . . . . . : ",campaignDate)
print("User . . . . . . . . . : ",campaignUser)
print("Name . . . . . . . . . : ",campaignDate)
print("Generation =============")
print("Seed . . . . . . . . : ", seed)
print("Method. . . . . . . . : ", genrationMethod)
print("a . . . . . . . . . . : ", a)
print("b . . . . . . . . . . : ", b)
print("alpĥa . . . . . . . . : ", alpha)
print("beta. . . . . . . . . : ", beta)
print("lambda. . . . . . . . : ", lambd)
print("pwa file name . . . . : ", pwafileName)
print("Properties ============")
print("type native/completed : ", genType)
print("n : time jobs number : ",n)
print("m : machines number : ",m)
print("Time List ============")
print(timeList)
pRes = cmm.combine(timeList, m, verbose=True) # pRes is a (ScheduleManagment) sm.PSched
pRes.printResult()
## c = cp.Campaign(campaignName, campaignUser, N_NumberBegin, N_NumberEnd, N_List, M_NumberBegin, M_NumberEnd, M_List, matUniformNumber, matNonUniformNumber, matGammaNumber, matBetaNumber, matExponentialNumber, matRealFiles, nAb, nBb, nAlpah, nBeta, nLambda, seedForce)
## #
## if useLPT==1: c.runAlgorithm(cmm.lpt)
## if useSLACK==1: c.runAlgorithm(cmm.slack)
## if useLDM==1: c.runAlgorithm(cmm.ldm)
## if useCOMBINE==1: c.runAlgorithm(cmm.combine)
## if useMULTIFIT==1: c.runAlgorithm(cmm.multifit)
##
## c.exportCSV()
if __name__ == "__main__":
main()