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
80b89fe2
Commit
80b89fe2
authored
Nov 06, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rolling capacity can start not from beginning and also have exceptions
parent
d329564c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
dream/simulation/applications/CapacityStations/CapacityStation.py
...mulation/applications/CapacityStations/CapacityStation.py
+5
-1
dream/simulation/applications/CapacityStations/CapacityStationController.py
...pplications/CapacityStations/CapacityStationController.py
+4
-1
No files found.
dream/simulation/applications/CapacityStations/CapacityStation.py
View file @
80b89fe2
...
@@ -40,7 +40,7 @@ class CapacityStation(Queue):
...
@@ -40,7 +40,7 @@ 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
=
{},
**
kw
):
sharedResources
=
{},
intervalCapacityStart
=
0
,
intervalCapacityExceptions
=
{},
**
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
...
@@ -50,6 +50,8 @@ class CapacityStation(Queue):
...
@@ -50,6 +50,8 @@ class CapacityStation(Queue):
self
.
isLocked
=
True
self
.
isLocked
=
True
# dict that holds information if station shares workpower with some other station
# dict that holds information if station shares workpower with some other station
self
.
sharedResources
=
sharedResources
self
.
sharedResources
=
sharedResources
self
.
intervalCapacityStart
=
intervalCapacityStart
self
.
intervalCapacityExceptions
=
intervalCapacityExceptions
def
initialize
(
self
):
def
initialize
(
self
):
Queue
.
initialize
(
self
)
Queue
.
initialize
(
self
)
...
@@ -64,6 +66,8 @@ class CapacityStation(Queue):
...
@@ -64,6 +66,8 @@ class CapacityStation(Queue):
break
break
# initialize variables
# initialize variables
self
.
remainingIntervalCapacity
=
list
(
self
.
intervalCapacity
)
self
.
remainingIntervalCapacity
=
list
(
self
.
intervalCapacity
)
for
i
in
range
(
self
.
intervalCapacityStart
):
self
.
remainingIntervalCapacity
.
pop
(
0
)
self
.
isLocked
=
True
self
.
isLocked
=
True
self
.
utilisationDict
=
[]
# a list of dicts for the utilization results
self
.
utilisationDict
=
[]
# a list of dicts for the utilization results
self
.
detailedWorkPlan
=
[]
# a list of dicts to keep detailed data
self
.
detailedWorkPlan
=
[]
# a list of dicts to keep detailed data
...
...
dream/simulation/applications/CapacityStations/CapacityStationController.py
View file @
80b89fe2
...
@@ -162,7 +162,10 @@ class CapacityStationController(EventGenerator):
...
@@ -162,7 +162,10 @@ class CapacityStationController(EventGenerator):
# if remainingIntervalCapacity is empty reset it (to obtain rolling capacity)
# if remainingIntervalCapacity is empty reset it (to obtain rolling capacity)
if
len
(
station
.
remainingIntervalCapacity
)
==
0
:
if
len
(
station
.
remainingIntervalCapacity
)
==
0
:
station
.
remainingIntervalCapacity
=
list
(
station
.
intervalCapacity
)
station
.
remainingIntervalCapacity
=
list
(
station
.
intervalCapacity
)
# ig the next interval is in the exceptions update the capacity accordingly
if
str
((
self
.
env
.
now
)
+
1.0
)
in
station
.
intervalCapacityExceptions
.
keys
():
station
.
remainingIntervalCapacity
[
0
]
=
station
.
intervalCapacityExceptions
[
str
((
self
.
env
.
now
)
+
1
)]
# invoked after entities have exited one station to create
# invoked after entities have exited one station to create
# the corresponding entities to the following buffer
# the corresponding entities to the following buffer
def
createInCapacityStationBuffers
(
self
):
def
createInCapacityStationBuffers
(
self
):
...
...
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