Example #1
0
    def __init__(self, id, name, capacity=1, schedulingRule='FIFO', skillDict={}, skills=[], available=True,ouputSchedule=False,**kw):
        ObjectResource.__init__(self,id=id, name=name)
        self.objName=name
        self.capacity=int(capacity)      # repairman is an instance of resource
        self.type="Operator"
        # lists to hold statistics of multiple runs
        self.Waiting=[]             # holds the percentage of waiting time 
        self.Working=[]             # holds the percentage of working time 
        self.OffShift=[]             # holds the percentage of working time 
        self.OnBreak=[]             # holds the percentage of break time 

    
        # the following attributes are not used by the Repairman
        self.schedulingRule=schedulingRule      #the scheduling rule that the Queue follows
        self.multipleCriterionList=[]           #list with the criteria used to sort the Entities in the Queue
        SRlist = [schedulingRule]
        if schedulingRule.startswith("MC"):     # if the first criterion is MC aka multiple criteria
            SRlist = schedulingRule.split("-")  # split the string of the criteria (delimiter -)
            self.schedulingRule=SRlist.pop(0)   # take the first criterion of the list
            self.multipleCriterionList=SRlist   # hold the criteria list in the property multipleCriterionList
            
        for scheduling_rule in SRlist:
          if scheduling_rule not in self.getSupportedSchedulingRules():
            raise ValueError("Unknown scheduling rule %s for %s" %
              (scheduling_rule, id))
        
        # the station that the operator is assigned to
        self.operatorAssignedTo=None
        # the station that the operator is dedicated to
        self.operatorDedicatedTo=None
        # the station the operator currently operating
        self.workingStation=None
        
        # variables to be used by OperatorRouter
        self.candidateEntities=[]               # list of the entities requesting the operator at a certain simulation Time
        self.candidateEntity=None               # the entity that will be chosen for processing
        self.candidateStations=[]               # list of candidateStations of the stations (those stations that can receive an entity)
        
        self.schedule=[]                        # the working schedule of the resource, the objects the resource was occupied by and the corresponding times
        # alias used by printRoute
        self.alias=self.id
        # list attribute that describes the skills of the operator in terms of stations he can operate
        self.skillsList=skills
        # skils dict (defining also if the skill is regarding different operations on the same technology)
        self.skillDict = skillDict
        # if there is a skillDict add the stations defined to the operators coreObjectIds
        if skillDict:
            for operation_data in skillDict.values():
                for station in operation_data.get("stationIdList", []):
                    if not station in self.coreObjectIds:
                        # append the station ID to the correObjectIds
                        self.coreObjectIds.append(station)
        # flag to show if the resource is available at the start of simulation
        self.available=available
        from Globals import G
        G.OperatorsList.append(self) 
        # flag to show if the operator will output his schedule in the results
        self.ouputSchedule=ouputSchedule
Example #2
0
 def initialize(self):
     ObjectResource.initialize(self)
     # flag that shows if the resource is on shift
     self.onShift=True
     self.totalWorkingTime=0         #holds the total working time
     self.totalWaitingTime=0         #holds the total waiting time
     self.totalOffShiftTime=0        #holds the total off-shift time
     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
Example #3
0
 def initialize(self):
     ObjectResource.initialize(self)
     # flag that shows if the resource is on shift
     self.onShift = True
     self.totalWorkingTime = 0  #holds the total working time
     self.totalWaitingTime = 0  #holds the total waiting time
     self.totalOffShiftTime = 0  #holds the total off-shift time
     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
Example #4
0
 def initialize(self):
     ObjectResource.initialize(self)
     # flag that shows if the resource is on shift
     self.onShift=True
     self.totalWorkingTime=0         #holds the total working time
     self.totalWaitingTime=0         #holds the total waiting time
     self.totalOffShiftTime=0        #holds the total off-shift time
     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
Example #5
0
    def __init__(self, id, name, capacity=1):
        ObjectResource.__init__(self)
        self.id=id
        self.objName=name
        self.capacity=capacity      # repairman is an instance of resource
        self.type="Repairman"
#         self.Res=Resource(self.capacity)
        # lists to hold statistics of multiple runs
        self.Waiting=[]             # holds the percentage of waiting time 
        self.Working=[]             # holds the percentage of working time 
        # list with the coreObjects IDs that the repairman repairs
        self.coreObjectIds=[]
        # list with the coreObjects that the repairman repairs
        self.coreObjects=[]
Example #6
0
    def __init__(self,
                 id,
                 name,
                 capacity=1,
                 schedulingRule='FIFO',
                 skillDict={},
                 skills=[],
                 available=True,
                 ouputSchedule=False,
                 **kw):
        ObjectResource.__init__(self, id=id, name=name)
        self.objName = name
        self.capacity = int(capacity)  # repairman is an instance of resource
        self.type = "Operator"
        # lists to hold statistics of multiple runs
        self.Waiting = []  # holds the percentage of waiting time
        self.Working = []  # holds the percentage of working time
        self.OffShift = []  # holds the percentage of working time

        # the following attributes are not used by the Repairman
        self.schedulingRule = schedulingRule  #the scheduling rule that the Queue follows
        self.multipleCriterionList = [
        ]  #list with the criteria used to sort the Entities in the Queue
        SRlist = [schedulingRule]
        if schedulingRule.startswith(
                "MC"):  # if the first criterion is MC aka multiple criteria
            SRlist = schedulingRule.split(
                "-")  # split the string of the criteria (delimiter -)
            self.schedulingRule = SRlist.pop(
                0)  # take the first criterion of the list
            self.multipleCriterionList = SRlist  # hold the criteria list in the property multipleCriterionList

        for scheduling_rule in SRlist:
            if scheduling_rule not in self.getSupportedSchedulingRules():
                raise ValueError("Unknown scheduling rule %s for %s" %
                                 (scheduling_rule, id))

        # the station that the operator is assigned to
        self.operatorAssignedTo = None
        # the station that the operator is dedicated to
        self.operatorDedicatedTo = None
        # the station the operator currently operating
        self.workingStation = None

        # variables to be used by OperatorRouter
        self.candidateEntities = [
        ]  # list of the entities requesting the operator at a certain simulation Time
        self.candidateEntity = None  # the entity that will be chosen for processing
        self.candidateStations = [
        ]  # list of candidateStations of the stations (those stations that can receive an entity)

        self.schedule = [
        ]  # the working schedule of the resource, the objects the resource was occupied by and the corresponding times
        # alias used by printRoute
        self.alias = self.id
        # list attribute that describes the skills of the operator in terms of stations he can operate
        self.skillsList = skills
        # skils dict (defining also if the skill is regarding different operations on the same technology)
        self.skillDict = skillDict
        # flag to show if the resource is available at the start of simulation
        self.available = available
        from Globals import G
        G.OperatorsList.append(self)
        # flag to show if the operator will output his schedule in the results
        self.ouputSchedule = ouputSchedule