Commit 4239ba05 authored by Jérome Perrin's avatar Jérome Perrin

CapacityStationController: use same keys than job shop for output schedule

parent b9843a8d
...@@ -74,8 +74,8 @@ class CapacityStationController(EventGenerator): ...@@ -74,8 +74,8 @@ class CapacityStationController(EventGenerator):
project=entity.capacityProject project=entity.capacityProject
# output the finish time of the project. This will updated every time, so in the end it should be correct # output the finish time of the project. This will updated every time, so in the end it should be correct
for entry in project.projectSchedule: for entry in project.projectSchedule:
if entry['station']==station.id: if entry['stationId']==station.id:
entry['finish']=self.env.now entry['exitTime']=self.env.now
# lock the exit again # lock the exit again
exit.isLocked=True exit.isLocked=True
...@@ -124,7 +124,10 @@ class CapacityStationController(EventGenerator): ...@@ -124,7 +124,10 @@ class CapacityStationController(EventGenerator):
'allocation':entity.requiredCapacity}) 'allocation':entity.requiredCapacity})
capacityAllocated+=entity.requiredCapacity capacityAllocated+=entity.requiredCapacity
if self.checkIfProjectJustStartsInStation(project, station): if self.checkIfProjectJustStartsInStation(project, station):
project.projectSchedule.append({"station": station.id,"start": self.env.now}) project.projectSchedule.append({
"stationId": station.id,
"entranceTime": self.env.now})
# lock the station # lock the station
station.isLocked=True station.isLocked=True
# calculate the utilization # calculate the utilization
...@@ -250,7 +253,7 @@ class CapacityStationController(EventGenerator): ...@@ -250,7 +253,7 @@ class CapacityStationController(EventGenerator):
# checks if a project is just starting in station # checks if a project is just starting in station
def checkIfProjectJustStartsInStation(self, project, station): def checkIfProjectJustStartsInStation(self, project, station):
for entry in project.projectSchedule: for entry in project.projectSchedule:
if entry['station']==station.id: if entry['stationId']==station.id:
return False return False
return True return True
\ No newline at end of file
...@@ -9,15 +9,6 @@ ...@@ -9,15 +9,6 @@
"_class": "Dream.CapacityStationBuffer", "_class": "Dream.CapacityStationBuffer",
"id": "CB2" "id": "CB2"
}, },
{
"_class": "Dream.Exit",
"id": "CE1",
"results": {
"lifespan": 1.5,
"takt_time": 0.5,
"throughput": 4
}
},
{ {
"_class": "Dream.Exit", "_class": "Dream.Exit",
"id": "CE2", "id": "CE2",
...@@ -135,14 +126,14 @@ ...@@ -135,14 +126,14 @@
"results": { "results": {
"schedule": [ "schedule": [
{ {
"finish": 2.0, "entranceTime": 0.0,
"start": 0.0, "exitTime": 2.0,
"station": "CS1" "stationId": "CS1"
}, },
{ {
"finish": 3.0, "entranceTime": 1.0,
"start": 1.0, "exitTime": 3.0,
"station": "CS2" "stationId": "CS2"
} }
] ]
} }
...@@ -153,14 +144,14 @@ ...@@ -153,14 +144,14 @@
"results": { "results": {
"schedule": [ "schedule": [
{ {
"finish": 2.0, "entranceTime": 0.0,
"start": 0.0, "exitTime": 2.0,
"station": "CS1" "stationId": "CS1"
}, },
{ {
"finish": 3.0, "entranceTime": 1.0,
"start": 1.0, "exitTime": 3.0,
"station": "CS2" "stationId": "CS2"
} }
] ]
} }
......
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