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
0eafc667
Commit
0eafc667
authored
Jun 06, 2014
by
Georgios Dagkakis
Committed by
Jérome Perrin
Jun 10, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Topology76 added as a first test. Not working yet
parent
93f92611
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
134 additions
and
4 deletions
+134
-4
dream/simulation/CapacityStationController.py
dream/simulation/CapacityStationController.py
+17
-4
dream/simulation/JSONInputs/Topology76.json
dream/simulation/JSONInputs/Topology76.json
+117
-0
No files found.
dream/simulation/CapacityStationController.py
View file @
0eafc667
...
...
@@ -57,11 +57,10 @@ class CapacityStationController(EventGenerator):
print
1
# unlock all the capacity station exits
for
exit
in
G
.
CapacityStationExitList
:
exit
.
isLocked
=
=
False
exit
.
isLocked
=
False
# Send canDispose to all the Stations
print
2
for
station
in
G
.
CapacityStationList
:
print
station
.
id
station
.
canDispose
.
succeed
()
# give control until all the Stations become empty
print
3
...
...
@@ -70,7 +69,7 @@ class CapacityStationController(EventGenerator):
print
4
# Lock all StationExits canAccept
for
exit
in
G
.
CapacityStationExitList
:
exit
.
isLocked
=
=
True
exit
.
isLocked
=
True
# Calculate from the last moves in Station->StationExits
# what should be created in StationBuffers and create it
print
5
...
...
@@ -91,6 +90,10 @@ class CapacityStationController(EventGenerator):
print
9
while
not
self
.
checkIfBuffersFinished
():
yield
self
.
env
.
timeout
(
0
)
print
10
# for every station update the remaining interval capacity so that it is ready for next loop
for
station
in
G
.
CapacityStationList
:
station
.
remainingIntervalCapacity
.
pop
(
0
)
self
.
stepsAreComplete
.
succeed
()
def
checkIfStationsEmpty
(
self
):
...
...
@@ -103,7 +106,17 @@ class CapacityStationController(EventGenerator):
pass
def
calculateWhatIsToBeProcessed
(
self
):
pass
# loop through the capacity station buffers
for
buffer
in
G
.
CapacityStationBufferList
:
totalRequestedCapacity
=
0
print
buffer
.
next
totalAvailableCapacity
=
buffer
.
next
[
0
].
remainingIntervalCapacity
[
0
]
for
entity
in
buffer
.
getActiveObjectQueue
():
totalRequestedCapacity
+=
entity
.
requiredCapacity
if
totalRequestedCapacity
<=
totalAvailableCapacity
:
for
entity
in
buffer
.
getActiveObjectQueue
():
pass
#entity.shouldMove=True
def
checkIfBuffersFinished
(
self
):
for
buffer
in
G
.
CapacityStationBufferList
:
...
...
dream/simulation/JSONInputs/Topology76.json
0 → 100644
View file @
0eafc667
{
"_class"
:
"Dream.Simulation"
,
"edges"
:
{
"0"
:
[
"CB1"
,
"CS1"
,
{}
],
"1"
:
[
"CS1"
,
"CE1"
,
{}
],
"2"
:
[
"CB2"
,
"CS2"
,
{}
],
"3"
:
[
"CS2"
,
"CE2"
,
{}
]
},
"general"
:
{
"_class"
:
"Dream.Configuration"
,
"confidenceLevel"
:
"0.95"
,
"maxSimTime"
:
"2.1"
,
"numberOfReplications"
:
"1"
,
"trace"
:
"Yes"
},
"nodes"
:
{
"CB1"
:
{
"_class"
:
"Dream.CapacityStationBuffer"
,
"name"
:
"SMFBuffer"
,
"wip"
:
[
{
"_class"
:
"Dream.CapacityEntity"
,
"capacityProjectId"
:
"P1"
,
"name"
:
"P1_SMF_100"
,
"requiredCapacity"
:
100
},
{
"_class"
:
"Dream.CapacityEntity"
,
"capacityProjectId"
:
"P2"
,
"name"
:
"P2_SMF_50"
,
"requiredCapacity"
:
50
}
]
},
"CS1"
:
{
"_class"
:
"Dream.CapacityStation"
,
"name"
:
"SMF"
,
"intervalCapacity"
:
[
100
,
200
,
300
]
},
"CE1"
:
{
"_class"
:
"Dream.CapacityStationExit"
,
"nextCapacityStationBufferId"
:
"CB2"
,
"name"
:
"SMFExit"
},
"CB2"
:
{
"_class"
:
"Dream.CapacityStationBuffer"
,
"name"
:
"WELDBuffer"
},
"CS2"
:
{
"_class"
:
"Dream.CapacityStation"
,
"name"
:
"WELD"
,
"intervalCapacity"
:
[
150
,
60
,
350
]
},
"CE2"
:
{
"_class"
:
"Dream.CapacityStationExit"
,
"nextCapacityStationBufferId"
:
"CB2"
,
"name"
:
"WELDExit"
},
"QD"
:
{
"_class"
:
"Dream.Queue"
,
"capacity"
:
"-1"
,
"id"
:
"QD"
,
"name"
:
"DUMMY"
,
"wip"
:
[
{
"_class"
:
"Dream.CapacityProject"
,
"id"
:
"P1"
,
"name"
:
"P1"
,
"capacityRequirementDict"
:
{
"CS1"
:
100
,
"CS2"
:
50
}
},
{
"_class"
:
"Dream.CapacityProject"
,
"id"
:
"P2"
,
"name"
:
"P2"
,
"capacityRequirementDict"
:
{
"CS1"
:
50
,
"CS2"
:
100
}
}
]
},
"CSC"
:
{
"_class"
:
"Dream.CapacityStationController"
,
"name"
:
"CSC"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
}
}
}
\ No newline at end of file
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