Commit 1bd960a2 authored by Georgios Dagkakis's avatar Georgios Dagkakis

Break object set. Not functional yet

parent 6125450c
This diff is collapsed.
......@@ -103,6 +103,7 @@ class CoreObject(ManPyObject):
self.totalFailureTime=0 #holds the total failure time
self.totalWaitingTime=0 #holds the total waiting time
self.totalWorkingTime=0 #holds the total working time
self.totalBreakTime=0 #holds the total break time
self.totalOffShiftTime=0 #holds the total off-shift time
self.completedJobs=0 #holds the number of completed jobs
# ============================== Entity related attributes =================================
......
......@@ -246,6 +246,7 @@ def createObjectInterruptions():
G.ObjectInterruptionList=[]
G.ScheduledMaintenanceList=[]
G.FailureList=[]
G.BreakList=[]
G.ShiftSchedulerList=[]
G.EventGeneratorList=[]
G.CapacityStationControllerList=[]
......@@ -285,6 +286,7 @@ def createObjectInterruptions():
from dream.simulation.Failure import Failure
from dream.simulation.PeriodicMaintenance import PeriodicMaintenance
from dream.simulation.ShiftScheduler import ShiftScheduler
from dream.simulation.Break import Break
for (element_id, element) in nodes.iteritems():
element['id'] = element_id
scheduledMaintenance=element.get('interruptions',{}).get('scheduledMaintenance', {})
......@@ -340,9 +342,17 @@ def createObjectInterruptions():
thresholdTimeIsOnShift=thresholdTimeIsOnShift)
G.ObjectInterruptionList.append(SS)
G.ShiftSchedulerList.append(SS)
br=element.get('interruptions',{}).get('break', None)
# if there are failures assigned
# initiate them
if br:
victim=Globals.findObjectById(element['id'])
endUnfinished=bool(int(br.get('endUnfinished', 1)))
deteriorationType=br.get('deteriorationType', 'constant')
BR=Break(victim=victim, distribution=br,endUnfinished=endUnfinished,deteriorationType=deteriorationType)
G.ObjectInterruptionList.append(BR)
G.FailureList.append(BR)
# ===========================================================================
# creates the entities that are wip
......
......@@ -105,6 +105,7 @@ class Operator(ObjectResource):
self.timeLastShiftStarted=0 #holds the time that the last shift of the object started
self.timeLastShiftEnded=0 #holds the time that the last shift of the object ended
self.candidateStation=None #holds the candidate receiver of the entity the resource will work on - used by router
self.totalBreakTime=0
@staticmethod
def getSupportedSchedulingRules():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment