-
Notifications
You must be signed in to change notification settings - Fork 0
/
MachineBoss.py
33 lines (29 loc) · 961 Bytes
/
MachineBoss.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
__author__ = 'max'
import Machine
class MachineBoss:
def __init__(self, numberOfMachines):
self.numberOfMachines = numberOfMachines
self.machines = []
for i in range(numberOfMachines):
self.machines.append(Machine.Machine())
next = (i for i in self.machines)
def __str__(self):
string = "Loads on Machines: \n"
for each in self.machines:
string += "Machine Load: " + str(each) + "\n"
return string
def __iter__(self):
for i in self.machines:
yield i
def minMachine(self):
minSize = self.machines[0]
for i in self.machines:
if minSize.getMakeSpan() > i.getMakeSpan():
minSize = i
return minSize
def maxMachine(self):
maxSize = self.machines[0]
for i in self.machines:
if maxSize.getMakeSpan() < i.getMakeSpan():
maxSize = i
return maxSize