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
acc2fa6f
Commit
acc2fa6f
authored
Aug 22, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CapacityStationController to read in new way
parent
833e4c02
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
32 additions
and
53 deletions
+32
-53
dream/simulation/CapacityStationController.py
dream/simulation/CapacityStationController.py
+2
-2
dream/simulation/JSONInputs/CapacityStationAssembly1.json
dream/simulation/JSONInputs/CapacityStationAssembly1.json
+1
-4
dream/simulation/JSONInputs/CapacityStationAssembly2.json
dream/simulation/JSONInputs/CapacityStationAssembly2.json
+0
-1
dream/simulation/JSONInputs/CapacityStationEDDThreshold1.json
...m/simulation/JSONInputs/CapacityStationEDDThreshold1.json
+0
-1
dream/simulation/JSONInputs/CapacityStationEDDThreshold2.json
...m/simulation/JSONInputs/CapacityStationEDDThreshold2.json
+0
-1
dream/simulation/JSONInputs/CapacityStationEDDThreshold3.json
...m/simulation/JSONInputs/CapacityStationEDDThreshold3.json
+0
-1
dream/simulation/JSONInputs/CapacityStationEDDThreshold4.json
...m/simulation/JSONInputs/CapacityStationEDDThreshold4.json
+0
-1
dream/simulation/JSONInputs/CapacityStationEDDThreshold5.json
...m/simulation/JSONInputs/CapacityStationEDDThreshold5.json
+0
-1
dream/simulation/JSONInputs/CapacityStationEarliestStart1.json
.../simulation/JSONInputs/CapacityStationEarliestStart1.json
+2
-3
dream/simulation/JSONInputs/CapacityStationEarliestStart2.json
.../simulation/JSONInputs/CapacityStationEarliestStart2.json
+1
-2
dream/simulation/JSONInputs/CapacityStationPrioritizeIfCanFinish1.json
...ion/JSONInputs/CapacityStationPrioritizeIfCanFinish1.json
+0
-1
dream/simulation/JSONInputs/CapacityStationPrioritizeIfCanFinish2.json
...ion/JSONInputs/CapacityStationPrioritizeIfCanFinish2.json
+0
-1
dream/simulation/JSONInputs/CapacityStationPrioritizeIfCanFinish3.json
...ion/JSONInputs/CapacityStationPrioritizeIfCanFinish3.json
+0
-1
dream/simulation/JSONInputs/CapacityStationSharedResources1.json
...imulation/JSONInputs/CapacityStationSharedResources1.json
+0
-1
dream/simulation/JSONInputs/CapacityStationSharedResources2.json
...imulation/JSONInputs/CapacityStationSharedResources2.json
+0
-1
dream/simulation/JSONInputs/CapacityStationSharedResources3.json
...imulation/JSONInputs/CapacityStationSharedResources3.json
+0
-1
dream/simulation/JSONInputs/CapacityStationSpace1.json
dream/simulation/JSONInputs/CapacityStationSpace1.json
+0
-1
dream/simulation/JSONInputs/CapacityStationSpace2.json
dream/simulation/JSONInputs/CapacityStationSpace2.json
+0
-1
dream/simulation/JSONInputs/CapacityStationSpace3.json
dream/simulation/JSONInputs/CapacityStationSpace3.json
+0
-1
dream/simulation/JSONInputs/Topology77.json
dream/simulation/JSONInputs/Topology77.json
+2
-3
dream/simulation/LineGenerationJSON.py
dream/simulation/LineGenerationJSON.py
+24
-24
No files found.
dream/simulation/CapacityStationController.py
View file @
acc2fa6f
...
...
@@ -32,8 +32,8 @@ from CapacityEntity import CapacityEntity
from
Globals
import
G
class
CapacityStationController
(
EventGenerator
):
def
__init__
(
self
,
id
=
id
,
name
=
None
,
start
=
None
,
stop
=
None
,
interval
=
None
,
duration
=
None
,
method
=
None
,
argumentDict
=
None
,
dueDateThreshold
=
float
(
'inf'
),
prioritizeIfCanFinish
=
False
):
def
__init__
(
self
,
id
=
id
,
name
=
None
,
start
=
0
,
stop
=
float
(
'inf'
),
interval
=
1
,
duration
=
0
,
method
=
None
,
argumentDict
=
None
,
dueDateThreshold
=
float
(
'inf'
),
prioritizeIfCanFinish
=
False
):
EventGenerator
.
__init__
(
self
,
id
,
name
,
start
,
stop
,
interval
,
duration
,
method
,
argumentDict
)
# attribute used by optimization in calculateWhatIsToBeProcessed
...
...
dream/simulation/JSONInputs/CapacityStationAssembly1.json
View file @
acc2fa6f
...
...
@@ -197,9 +197,6 @@
"CSC"
:
{
"_class"
:
"Dream.CapacityStationController"
,
"name"
:
"CSC"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
}
"interval"
:
"1"
}
}
}
\ No newline at end of file
dream/simulation/JSONInputs/CapacityStationAssembly2.json
View file @
acc2fa6f
...
...
@@ -161,7 +161,6 @@
"name"
:
"CSC"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
,
"prioritizeIfCanFinish"
:
1
,
"dueDateThreshold"
:
7
}
...
...
dream/simulation/JSONInputs/CapacityStationEDDThreshold1.json
View file @
acc2fa6f
...
...
@@ -200,7 +200,6 @@
"name"
:
"CSC"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
,
"dueDateThreshold"
:
7
}
}
...
...
dream/simulation/JSONInputs/CapacityStationEDDThreshold2.json
View file @
acc2fa6f
...
...
@@ -200,7 +200,6 @@
"name"
:
"CSC"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
,
"dueDateThreshold"
:
7
}
}
...
...
dream/simulation/JSONInputs/CapacityStationEDDThreshold3.json
View file @
acc2fa6f
...
...
@@ -200,7 +200,6 @@
"name"
:
"CSC"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
,
"dueDateThreshold"
:
14
}
}
...
...
dream/simulation/JSONInputs/CapacityStationEDDThreshold4.json
View file @
acc2fa6f
...
...
@@ -100,7 +100,6 @@
"name"
:
"CSC"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
,
"dueDateThreshold"
:
7
}
}
...
...
dream/simulation/JSONInputs/CapacityStationEDDThreshold5.json
View file @
acc2fa6f
...
...
@@ -100,7 +100,6 @@
"name"
:
"CSC"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
,
"dueDateThreshold"
:
7
}
}
...
...
dream/simulation/JSONInputs/CapacityStationEarliestStart1.json
View file @
acc2fa6f
...
...
@@ -201,8 +201,7 @@
"_class"
:
"Dream.CapacityStationController"
,
"name"
:
"CSC"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
}
"interval"
:
"1"
}
}
}
\ No newline at end of file
dream/simulation/JSONInputs/CapacityStationEarliestStart2.json
View file @
acc2fa6f
...
...
@@ -204,8 +204,7 @@
"_class"
:
"Dream.CapacityStationController"
,
"name"
:
"CSC"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
"interval"
:
"1"
}
}
}
\ No newline at end of file
dream/simulation/JSONInputs/CapacityStationPrioritizeIfCanFinish1.json
View file @
acc2fa6f
...
...
@@ -100,7 +100,6 @@
"name"
:
"CSC"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
,
"prioritizeIfCanFinish"
:
1
,
"dueDateThreshold"
:
7
}
...
...
dream/simulation/JSONInputs/CapacityStationPrioritizeIfCanFinish2.json
View file @
acc2fa6f
...
...
@@ -100,7 +100,6 @@
"name"
:
"CSC"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
,
"prioritizeIfCanFinish"
:
1
,
"dueDateThreshold"
:
7
}
...
...
dream/simulation/JSONInputs/CapacityStationPrioritizeIfCanFinish3.json
View file @
acc2fa6f
...
...
@@ -100,7 +100,6 @@
"name"
:
"CSC"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
,
"prioritizeIfCanFinish"
:
1
,
"dueDateThreshold"
:
7
}
...
...
dream/simulation/JSONInputs/CapacityStationSharedResources1.json
View file @
acc2fa6f
...
...
@@ -123,7 +123,6 @@
"name"
:
"CSC"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
,
"prioritizeIfCanFinish"
:
1
,
"dueDateThreshold"
:
7
}
...
...
dream/simulation/JSONInputs/CapacityStationSharedResources2.json
View file @
acc2fa6f
...
...
@@ -131,7 +131,6 @@
"name"
:
"CSC"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
,
"prioritizeIfCanFinish"
:
1
,
"dueDateThreshold"
:
7
}
...
...
dream/simulation/JSONInputs/CapacityStationSharedResources3.json
View file @
acc2fa6f
...
...
@@ -124,7 +124,6 @@
"name"
:
"CSC"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
,
"prioritizeIfCanFinish"
:
1
,
"dueDateThreshold"
:
7
}
...
...
dream/simulation/JSONInputs/CapacityStationSpace1.json
View file @
acc2fa6f
...
...
@@ -138,7 +138,6 @@
"name"
:
"CSC"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
,
"prioritizeIfCanFinish"
:
1
,
"dueDateThreshold"
:
7
}
...
...
dream/simulation/JSONInputs/CapacityStationSpace2.json
View file @
acc2fa6f
...
...
@@ -137,7 +137,6 @@
"name"
:
"CSC"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
,
"prioritizeIfCanFinish"
:
1
,
"dueDateThreshold"
:
7
}
...
...
dream/simulation/JSONInputs/CapacityStationSpace3.json
View file @
acc2fa6f
...
...
@@ -133,7 +133,6 @@
"name"
:
"CSC"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
,
"prioritizeIfCanFinish"
:
1
,
"dueDateThreshold"
:
7
}
...
...
dream/simulation/JSONInputs/Topology77.json
View file @
acc2fa6f
...
...
@@ -198,8 +198,7 @@
"_class"
:
"Dream.CapacityStationController"
,
"name"
:
"CSC"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
}
"interval"
:
"1"
}
}
}
\ No newline at end of file
dream/simulation/LineGenerationJSON.py
View file @
acc2fa6f
...
...
@@ -704,33 +704,33 @@ def createObjectInterruptions():
# from CoreObject import CoreObject
# if issubclass(objectType, CoreObject):
if
objClass
==
'Dream.EventGenerator'
:
# check the object type
inputDict
=
dict
(
element
)
# create the
CoreObject
if
objClass
in
[
'Dream.EventGenerator'
,
'Dream.CapacityStationController'
]:
# check the object type
inputDict
=
dict
(
element
)
# create the
ObjectInterruption
objectInterruption
=
objectType
(
**
inputDict
)
G
.
ObjectInterruptionList
.
append
(
objectInterruption
)
elif
objClass
==
'Dream.CapacityStationController'
:
# check the object type
id
=
element
.
get
(
'id'
,
'not found'
)
# get the id of the element / default 'not_found'
name
=
element
.
get
(
'name'
,
'not found'
)
# get the name of the element / default 'not_found'
start
=
float
(
element
.
get
(
'start'
)
or
0
)
stop
=
float
(
element
.
get
(
'stop'
)
or
-
1
)
# infinity (had to be done to make it as float)
if
stop
<
0
:
stop
=
float
(
'inf'
)
interval
=
float
(
element
.
get
(
'interval'
)
or
1
)
duration
=
float
(
element
.
get
(
'duration'
)
or
0
)
dueDateThreshold
=
float
(
element
.
get
(
'dueDateThreshold'
)
or
float
(
'inf'
))
prioritizeIfCanFinish
=
bool
(
element
.
get
(
'prioritizeIfCanFinish'
,
0
))
argumentDict
=
(
element
.
get
(
'argumentDict'
,
{}))
# get the arguments of the method as a dict / default {}
# create the CapacityStationController object
CSC
=
CapacityStationController
(
id
,
name
,
start
=
start
,
stop
=
stop
,
interval
=
interval
,
duration
=
duration
,
argumentDict
=
argumentDict
,
dueDateThreshold
=
dueDateThreshold
,
prioritizeIfCanFinish
=
prioritizeIfCanFinish
)
G
.
EventGeneratorList
.
append
(
CSC
)
G
.
CapacityStationControllerList
.
append
(
CSC
)
G
.
ObjectInterruptionList
.
append
(
CSC
)
#
elif objClass=='Dream.CapacityStationController': # check the object type
#
id = element.get('id', 'not found') # get the id of the element / default 'not_found'
#
name = element.get('name', 'not found') # get the name of the element / default 'not_found'
#
start = float(element.get('start') or 0)
#
stop = float(element.get('stop') or -1)
#
# infinity (had to be done to make it as float)
#
if stop<0:
#
stop=float('inf')
#
interval = float(element.get('interval') or 1)
#
duration = float(element.get('duration') or 0)
#
dueDateThreshold = float(element.get('dueDateThreshold') or float('inf'))
#
prioritizeIfCanFinish = bool(element.get('prioritizeIfCanFinish', 0))
#
argumentDict=(element.get('argumentDict', {})) # get the arguments of the method as a dict / default {}
#
#
# create the CapacityStationController object
#
CSC = CapacityStationController(id, name, start=start, stop=stop, interval=interval,
#
duration=duration, argumentDict=argumentDict, dueDateThreshold=dueDateThreshold,
#
prioritizeIfCanFinish=prioritizeIfCanFinish)
#
G.EventGeneratorList.append(CSC)
#
G.CapacityStationControllerList.append(CSC)
#
G.ObjectInterruptionList.append(CSC)
# for the elements in the nodes dict
for
(
element_id
,
element
)
in
nodes
.
iteritems
():
...
...
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