Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
b449a727
Commit
b449a727
authored
Aug 06, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
earliest start to be considered also in assembly stations. Branch NOT stable yet
parent
675ebbbb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
dream/simulation/CapacityStationController.py
dream/simulation/CapacityStationController.py
+6
-3
No files found.
dream/simulation/CapacityStationController.py
View file @
b449a727
...
@@ -228,12 +228,14 @@ class CapacityStationController(EventGenerator):
...
@@ -228,12 +228,14 @@ class CapacityStationController(EventGenerator):
# note that only the assembled projects do request capacity
# note that only the assembled projects do request capacity
totalRequestedCapacity
=
0
totalRequestedCapacity
=
0
for
entity
in
buffer
.
getActiveObjectQueue
():
for
entity
in
buffer
.
getActiveObjectQueue
():
if
self
.
checkIfProjectAssembledInBuffer
(
entity
.
capacityProject
,
buffer
):
if
self
.
checkIfProjectAssembledInBuffer
(
entity
.
capacityProject
,
buffer
)
and
\
self
.
checkIfProjectCanStartInStation
(
entity
.
capacityProject
,
station
):
totalRequestedCapacity
+=
entity
.
requiredCapacity
totalRequestedCapacity
+=
entity
.
requiredCapacity
# if there is enough capacity for all the assembled entities set them that they all should move
# if there is enough capacity for all the assembled entities set them that they all should move
if
totalRequestedCapacity
<=
totalAvailableCapacity
:
if
totalRequestedCapacity
<=
totalAvailableCapacity
:
for
entity
in
buffer
.
getActiveObjectQueue
():
for
entity
in
buffer
.
getActiveObjectQueue
():
if
self
.
checkIfProjectAssembledInBuffer
(
entity
.
capacityProject
,
buffer
):
if
self
.
checkIfProjectAssembledInBuffer
(
entity
.
capacityProject
,
buffer
)
and
\
self
.
checkIfProjectCanStartInStation
(
entity
.
capacityProject
,
station
):
entity
.
shouldMove
=
True
entity
.
shouldMove
=
True
# else calculate the capacity for every entity and create the entities
# else calculate the capacity for every entity and create the entities
else
:
else
:
...
@@ -241,7 +243,8 @@ class CapacityStationController(EventGenerator):
...
@@ -241,7 +243,8 @@ class CapacityStationController(EventGenerator):
# loop through the entities
# loop through the entities
for
entity
in
entitiesInBuffer
:
for
entity
in
entitiesInBuffer
:
# break only the assembled projects
# break only the assembled projects
if
self
.
checkIfProjectAssembledInBuffer
(
entity
.
capacityProject
,
buffer
):
if
self
.
checkIfProjectAssembledInBuffer
(
entity
.
capacityProject
,
buffer
)
and
\
self
.
checkIfProjectCanStartInStation
(
entity
.
capacityProject
,
station
):
# calculate what is the capacity that should proceed and what that should remain
# calculate what is the capacity that should proceed and what that should remain
capacityToMove
=
totalAvailableCapacity
*
(
entity
.
requiredCapacity
)
/
float
(
totalRequestedCapacity
)
capacityToMove
=
totalAvailableCapacity
*
(
entity
.
requiredCapacity
)
/
float
(
totalRequestedCapacity
)
capacityToStay
=
entity
.
requiredCapacity
-
capacityToMove
capacityToStay
=
entity
.
requiredCapacity
-
capacityToMove
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment