Beispiel #1
0
    }
}, {
    "stationIdsList": ["Q3"]
}, {
    "stationIdsList": ["M3"],
    "processingTime": {
        'Fixed': {
            'mean': 3
        }
    }
}, {
    "stationIdsList": ["E"],
}]

# define the Jobs
J1 = Job('J1', 'Job1', route=J1Route, priority=1, dueDate=100)
J2 = Job('J2', 'Job2', route=J2Route, priority=1, dueDate=90)
J3 = Job('J3', 'Job3', route=J3Route, priority=0, dueDate=110)


def main():
    # add all the objects in a list
    objectList = [M1, M2, M3, Q1, Q2, Q3, E, J1, J2, J3]
    # set the length of the experiment
    maxSimTime = float('inf')
    # call the runSimulation giving the objects and the length of the experiment
    runSimulation(objectList, maxSimTime)

    # print the results
    for job in [J1, J2, J3]:
        for record in job.schedule:
Beispiel #2
0
Q3=QueueJobShop('Q3','Queue3', capacity=float("inf"))
M1=MachineJobShop('M1','Machine1')
M2=MachineJobShop('M2','Machine2')
M3=MachineJobShop('M3','Machine3')
E=ExitJobShop('E','Exit')  

#define the route of the Job in the system
route=[{"stationIdsList": ["Q1"]},
         {"stationIdsList": ["M1"],"processingTime":{'Fixed':{'mean':1}}},
         {"stationIdsList": ["Q3"]},
         {"stationIdsList": ["M3"],"processingTime":{'Fixed':{'mean':3}}},
         {"stationIdsList": ["Q2"]},
         {"stationIdsList": ["M2"],"processingTime":{'Fixed':{'mean':2}}},
         {"stationIdsList": ["E"],}]
#define the Jobs
J=Job('J1','Job1',route=route)
   
def main():
    # add all the objects in a list
    objectList=[M1,M2,M3,Q1,Q2,Q3,E,J]  
    # set the length of the experiment  
    maxSimTime=float('inf')
    # call the runSimulation giving the objects and the length of the experiment
    runSimulation(objectList, maxSimTime, trace='Yes')
      
    #loop in the schedule to print the results
    schedule=[]
    for record in J.schedule:
        schedule.append([record["station"].objName,record["entranceTime"]])
        print J.name, "got into", record["station"].objName, "at", record["entranceTime"] 
    ExcelHandler.outputTrace('TRACE')
Beispiel #3
0
M3=MachineJobShop('M3','Machine3')
E=ExitJobShop('E','Exit')    

#define the route of the Job in the system
route1=[{"stationIdsList": ["Q1"]},
         {"stationIdsList": ["M1"],"processingTime":{"Fixed":{"mean": "1"}}},
         {"stationIdsList": ["Q3"]},
         {"stationIdsList": ["M3"],"processingTime":{"Fixed":{"mean": "3"}}},
         {"stationIdsList": ["Q2"]},
         {"stationIdsList": ["M2"],"processingTime":{"Fixed":{"mean": "2"}}},
         {"stationIdsList": ["E"],}]
route2=[{"stationIdsList": ["Q1"]},
         {"stationIdsList": ["M1"],"processingTime":{"Fixed":{"mean": "4"}}},
         {"stationIdsList": ["E"],}]
#define the Jobs
J1=Job('J1','J1',route=route1, dueDate=8)
J2=Job('J2','J1',route=route2, dueDate=7)

def main(test=0):
    # loop through the scheduling rules
    for schedulingRule in ['EDD','RPC']:
        totalDelay=0
        # set the scheduline rule of Q1
        Q1.schedulingRule=schedulingRule
        # call the runSimulation giving the objects and the length of the experiment
        runSimulation(objectList=[M1,M2,M3,Q1,Q2,Q3,E,J1,J2], maxSimTime=float('inf'))
        # loop through the moulds and if they are delayed add to the total delay
        for job in [J1,J2]:
            totalDelay+=max([job.schedule[-1]['entranceTime']-job.dueDate,0])        
        if test:
            return totalDelay