-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexeInput.py
127 lines (112 loc) · 5.78 KB
/
exeInput.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
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
121
122
123
124
125
126
127
# 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
def main():
# set of testing matricies
matricies = []
# keep the selected parameters for reuse
print("===============================================================")
print("Campaign title and name ")
print("===============================================================")
campaignName = input("Name of campaign : ")
campaignUser = input("Your Name : ")
print("===============================================================")
print("Seed ")
print("===============================================================")
seedForce = None
sSeedForce = input("Force seed ? (None default): ")
if sSeedForce:
seedForce = int(sSeedForce)
# END IF
print("===============================================================")
print("Job Set size ")
print("===============================================================")
nN = int(input("Jobs number (begin) : "))
sNe = input("Jobs number (end) ("+str(nN)+" default) : ")
N_NumberBegin = nN
N_NumberEnd = nN
if sNe:
if int(sNe) > nN:
N_NumberEnd = int(sNe)
# END IF
# END IF
print("===============================================================")
print("Machines number ")
print("===============================================================")
nMmachineNumber = int(input("Machines number (begin) : "))
sMmachineNumbere = input("Machines number (end) ("+str(nMmachineNumber)+"default) : ")
M_NumberBegin = nMmachineNumber
M_NumberEnd = nMmachineNumber
if sMmachineNumbere:
if int(sMmachineNumbere) > nMmachineNumber:
M_NumberEnd = int(sMmachineNumbere)
# END IF
# END IF
print("===============================================================")
print("Job set generation methods ")
print("===============================================================")
matUniformNumber = int(input("How many uniform matricies to generate : "))
matNonUniformNumber = int(input("How many non uniform matricies to generate : "))
matGammaNumber = int(input("How many Gamma matricies to generate : "))
matBetaNumber = int(input("How many Beta matricies to generate : "))
matExponentialNumber= int(input("How many Exponential matricies to generate : "))
print("===============================================================")
print("From Parallel WorkLoad Archive ")
print("===============================================================")
matRealFiles = pwa.pwaFileChoice()
print("===============================================================")
print("Properties of generation ")
print("===============================================================")
nAb = 1.0
nBb = 100.0
nAlpah = 1.0
nBeta = 1.0
nLambda = 1.0
filename=""
if (matUniformNumber > 0 or matNonUniformNumber > 0):
nAb = float(input("a parameter : "))
nBb = float(input("b parameter : "))
if (matGammaNumber > 0 or matBetaNumber > 0):
nAlpah = float(input("alpha parameter (for gamma and beta) : "))
if (matGammaNumber > 0):
nBeta = float(input("beta parameter (for gamma) : "))
if (matExponentialNumber>0):
nLambda = float(input("lambda parameter (for ecxponential) : "))
print("===============================================================")
print("Algorithms ")
print("===============================================================")
useLPT = int(input("Use LPT rule ? : (1 yes, 0 no) : "))
useSLACK = int(input("UParamFilese Slack ? : (1 yes, 0 no) : "))
useLDM = int(input("Use LDM ? : (1 yes, 0 no) : "))
useCOMBINE = int(input("Use COMBINE ? : (1 yes, 0 no) : "))
useMULTIFIT = int(input("Use MULTIFIT ? : (1 yes, 0 no) : "))
#======================================================================
# Parameters file (json)
#======================================================================
if s.EXP_PARAMETERS:
fileSetup = s.ParamFile()
fileSetup.create(campaignName,campaignUser,
seedForce,N_NumberBegin,N_NumberEnd,M_NumberBegin,M_NumberEnd,
matUniformNumber,matNonUniformNumber,matGammaNumber,matBetaNumber,matExponentialNumber,
matRealFiles,
nAb, nBb,nAlpah,nBeta,nLambda,
useLPT,useSLACK,useLDM,useCOMBINE,useMULTIFIT)
# END IF
print("===============================================================")
print("Results computation ")
print("===============================================================")
c = cp.Campaign(campaignName, campaignUser, N_NumberBegin, N_NumberEnd, M_NumberBegin, M_NumberEnd, 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()