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
2fd6c80b
Commit
2fd6c80b
authored
Nov 11, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
capacity stations to be able to consider only entities within threshold
parent
24bfa80b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
dream/simulation/applications/CapacityStations/CapacityStation.py
...mulation/applications/CapacityStations/CapacityStation.py
+3
-1
dream/simulation/applications/CapacityStations/CapacityStationController.py
...pplications/CapacityStations/CapacityStationController.py
+5
-5
No files found.
dream/simulation/applications/CapacityStations/CapacityStation.py
View file @
2fd6c80b
...
@@ -40,7 +40,8 @@ class CapacityStation(Queue):
...
@@ -40,7 +40,8 @@ class CapacityStation(Queue):
# the __init__ method of the CapacityStation
# the __init__ method of the CapacityStation
#===========================================================================
#===========================================================================
def
__init__
(
self
,
id
,
name
,
capacity
=
float
(
"inf"
),
intervalCapacity
=
[],
schedulingRule
=
"FIFO"
,
gatherWipStat
=
False
,
def
__init__
(
self
,
id
,
name
,
capacity
=
float
(
"inf"
),
intervalCapacity
=
[],
schedulingRule
=
"FIFO"
,
gatherWipStat
=
False
,
sharedResources
=
{},
intervalCapacityStart
=
0
,
intervalCapacityExceptions
=
{},
**
kw
):
sharedResources
=
{},
intervalCapacityStart
=
0
,
intervalCapacityExceptions
=
{},
notProcessOutsideThreshold
=
False
,
**
kw
):
Queue
.
__init__
(
self
,
id
,
name
,
capacity
=
capacity
)
Queue
.
__init__
(
self
,
id
,
name
,
capacity
=
capacity
)
# a list that holds the capacity (manhours) that is available in each interval
# a list that holds the capacity (manhours) that is available in each interval
self
.
intervalCapacity
=
intervalCapacity
self
.
intervalCapacity
=
intervalCapacity
...
@@ -52,6 +53,7 @@ class CapacityStation(Queue):
...
@@ -52,6 +53,7 @@ class CapacityStation(Queue):
self
.
sharedResources
=
sharedResources
self
.
sharedResources
=
sharedResources
self
.
intervalCapacityStart
=
intervalCapacityStart
self
.
intervalCapacityStart
=
intervalCapacityStart
self
.
intervalCapacityExceptions
=
intervalCapacityExceptions
self
.
intervalCapacityExceptions
=
intervalCapacityExceptions
self
.
notProcessOutsideThreshold
=
int
(
notProcessOutsideThreshold
)
def
initialize
(
self
):
def
initialize
(
self
):
Queue
.
initialize
(
self
)
Queue
.
initialize
(
self
)
...
...
dream/simulation/applications/CapacityStations/CapacityStationController.py
View file @
2fd6c80b
...
@@ -230,7 +230,6 @@ class CapacityStationController(EventGenerator):
...
@@ -230,7 +230,6 @@ class CapacityStationController(EventGenerator):
# if the buffer was considered before (due to shared resources) continue
# if the buffer was considered before (due to shared resources) continue
if
buffer
in
alreadyConsideredBuffers
:
if
buffer
in
alreadyConsideredBuffers
:
continue
continue
alreadyConsideredBuffers
.
append
(
buffer
)
alreadyConsideredBuffers
.
append
(
buffer
)
sharedBuffers
=
[]
sharedBuffers
=
[]
station
=
buffer
.
next
[
0
]
# get the station
station
=
buffer
.
next
[
0
]
# get the station
...
@@ -271,7 +270,6 @@ class CapacityStationController(EventGenerator):
...
@@ -271,7 +270,6 @@ class CapacityStationController(EventGenerator):
for
entity
in
entitiesNotAllocated
:
for
entity
in
entitiesNotAllocated
:
if
EDD
>
entity
.
capacityProject
.
dueDate
:
if
EDD
>
entity
.
capacityProject
.
dueDate
:
EDD
=
entity
.
capacityProject
.
dueDate
EDD
=
entity
.
capacityProject
.
dueDate
# put the entities in the corresponding list according to their due date
# put the entities in the corresponding list according to their due date
for
entity
in
entitiesNotAllocated
:
for
entity
in
entitiesNotAllocated
:
if
entity
.
capacityProject
.
dueDate
-
EDD
<=
self
.
dueDateThreshold
:
if
entity
.
capacityProject
.
dueDate
-
EDD
<=
self
.
dueDateThreshold
:
...
@@ -338,6 +336,8 @@ class CapacityStationController(EventGenerator):
...
@@ -338,6 +336,8 @@ class CapacityStationController(EventGenerator):
# if we have more entities break
# if we have more entities break
if
not
haveMoreEntitiesToAllocate
:
if
not
haveMoreEntitiesToAllocate
:
break
break
if
station
.
notProcessOutsideThreshold
:
break
# else calculate the capacity for every entity and create the entities
# else calculate the capacity for every entity and create the entities
else
:
else
:
...
...
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