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
Show 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
...
@@ -32,8 +32,8 @@ from CapacityEntity import CapacityEntity
from
Globals
import
G
from
Globals
import
G
class
CapacityStationController
(
EventGenerator
):
class
CapacityStationController
(
EventGenerator
):
def
__init__
(
self
,
id
=
id
,
name
=
None
,
start
=
None
,
stop
=
None
,
interval
=
None
,
def
__init__
(
self
,
id
=
id
,
name
=
None
,
start
=
0
,
stop
=
float
(
'inf'
),
interval
=
1
,
duration
=
None
,
method
=
None
,
argumentDict
=
None
,
dueDateThreshold
=
float
(
'inf'
),
prioritizeIfCanFinish
=
False
):
duration
=
0
,
method
=
None
,
argumentDict
=
None
,
dueDateThreshold
=
float
(
'inf'
),
prioritizeIfCanFinish
=
False
):
EventGenerator
.
__init__
(
self
,
id
,
name
,
start
,
stop
,
interval
,
EventGenerator
.
__init__
(
self
,
id
,
name
,
start
,
stop
,
interval
,
duration
,
method
,
argumentDict
)
duration
,
method
,
argumentDict
)
# attribute used by optimization in calculateWhatIsToBeProcessed
# attribute used by optimization in calculateWhatIsToBeProcessed
...
...
dream/simulation/JSONInputs/CapacityStationAssembly1.json
View file @
acc2fa6f
...
@@ -197,9 +197,6 @@
...
@@ -197,9 +197,6 @@
"CSC"
:
{
"CSC"
:
{
"_class"
:
"Dream.CapacityStationController"
,
"_class"
:
"Dream.CapacityStationController"
,
"name"
:
"CSC"
,
"name"
:
"CSC"
,
"start"
:
"0"
,
"interval"
:
"1"
}
"interval"
:
"1"
,
"method"
:
"Dream.None"
}
}
}
}
}
\ No newline at end of file
dream/simulation/JSONInputs/CapacityStationAssembly2.json
View file @
acc2fa6f
...
@@ -161,7 +161,6 @@
...
@@ -161,7 +161,6 @@
"name"
:
"CSC"
,
"name"
:
"CSC"
,
"start"
:
"0"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
,
"prioritizeIfCanFinish"
:
1
,
"prioritizeIfCanFinish"
:
1
,
"dueDateThreshold"
:
7
"dueDateThreshold"
:
7
}
}
...
...
dream/simulation/JSONInputs/CapacityStationEDDThreshold1.json
View file @
acc2fa6f
...
@@ -200,7 +200,6 @@
...
@@ -200,7 +200,6 @@
"name"
:
"CSC"
,
"name"
:
"CSC"
,
"start"
:
"0"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
,
"dueDateThreshold"
:
7
"dueDateThreshold"
:
7
}
}
}
}
...
...
dream/simulation/JSONInputs/CapacityStationEDDThreshold2.json
View file @
acc2fa6f
...
@@ -200,7 +200,6 @@
...
@@ -200,7 +200,6 @@
"name"
:
"CSC"
,
"name"
:
"CSC"
,
"start"
:
"0"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
,
"dueDateThreshold"
:
7
"dueDateThreshold"
:
7
}
}
}
}
...
...
dream/simulation/JSONInputs/CapacityStationEDDThreshold3.json
View file @
acc2fa6f
...
@@ -200,7 +200,6 @@
...
@@ -200,7 +200,6 @@
"name"
:
"CSC"
,
"name"
:
"CSC"
,
"start"
:
"0"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
,
"dueDateThreshold"
:
14
"dueDateThreshold"
:
14
}
}
}
}
...
...
dream/simulation/JSONInputs/CapacityStationEDDThreshold4.json
View file @
acc2fa6f
...
@@ -100,7 +100,6 @@
...
@@ -100,7 +100,6 @@
"name"
:
"CSC"
,
"name"
:
"CSC"
,
"start"
:
"0"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
,
"dueDateThreshold"
:
7
"dueDateThreshold"
:
7
}
}
}
}
...
...
dream/simulation/JSONInputs/CapacityStationEDDThreshold5.json
View file @
acc2fa6f
...
@@ -100,7 +100,6 @@
...
@@ -100,7 +100,6 @@
"name"
:
"CSC"
,
"name"
:
"CSC"
,
"start"
:
"0"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
,
"dueDateThreshold"
:
7
"dueDateThreshold"
:
7
}
}
}
}
...
...
dream/simulation/JSONInputs/CapacityStationEarliestStart1.json
View file @
acc2fa6f
...
@@ -201,8 +201,7 @@
...
@@ -201,8 +201,7 @@
"_class"
:
"Dream.CapacityStationController"
,
"_class"
:
"Dream.CapacityStationController"
,
"name"
:
"CSC"
,
"name"
:
"CSC"
,
"start"
:
"0"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"interval"
:
"1"
"method"
:
"Dream.None"
}
}
}
}
}
}
\ No newline at end of file
dream/simulation/JSONInputs/CapacityStationEarliestStart2.json
View file @
acc2fa6f
...
@@ -204,8 +204,7 @@
...
@@ -204,8 +204,7 @@
"_class"
:
"Dream.CapacityStationController"
,
"_class"
:
"Dream.CapacityStationController"
,
"name"
:
"CSC"
,
"name"
:
"CSC"
,
"start"
:
"0"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"interval"
:
"1"
"method"
:
"Dream.None"
}
}
}
}
}
}
\ No newline at end of file
dream/simulation/JSONInputs/CapacityStationPrioritizeIfCanFinish1.json
View file @
acc2fa6f
...
@@ -100,7 +100,6 @@
...
@@ -100,7 +100,6 @@
"name"
:
"CSC"
,
"name"
:
"CSC"
,
"start"
:
"0"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
,
"prioritizeIfCanFinish"
:
1
,
"prioritizeIfCanFinish"
:
1
,
"dueDateThreshold"
:
7
"dueDateThreshold"
:
7
}
}
...
...
dream/simulation/JSONInputs/CapacityStationPrioritizeIfCanFinish2.json
View file @
acc2fa6f
...
@@ -100,7 +100,6 @@
...
@@ -100,7 +100,6 @@
"name"
:
"CSC"
,
"name"
:
"CSC"
,
"start"
:
"0"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
,
"prioritizeIfCanFinish"
:
1
,
"prioritizeIfCanFinish"
:
1
,
"dueDateThreshold"
:
7
"dueDateThreshold"
:
7
}
}
...
...
dream/simulation/JSONInputs/CapacityStationPrioritizeIfCanFinish3.json
View file @
acc2fa6f
...
@@ -100,7 +100,6 @@
...
@@ -100,7 +100,6 @@
"name"
:
"CSC"
,
"name"
:
"CSC"
,
"start"
:
"0"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
,
"prioritizeIfCanFinish"
:
1
,
"prioritizeIfCanFinish"
:
1
,
"dueDateThreshold"
:
7
"dueDateThreshold"
:
7
}
}
...
...
dream/simulation/JSONInputs/CapacityStationSharedResources1.json
View file @
acc2fa6f
...
@@ -123,7 +123,6 @@
...
@@ -123,7 +123,6 @@
"name"
:
"CSC"
,
"name"
:
"CSC"
,
"start"
:
"0"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
,
"prioritizeIfCanFinish"
:
1
,
"prioritizeIfCanFinish"
:
1
,
"dueDateThreshold"
:
7
"dueDateThreshold"
:
7
}
}
...
...
dream/simulation/JSONInputs/CapacityStationSharedResources2.json
View file @
acc2fa6f
...
@@ -131,7 +131,6 @@
...
@@ -131,7 +131,6 @@
"name"
:
"CSC"
,
"name"
:
"CSC"
,
"start"
:
"0"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
,
"prioritizeIfCanFinish"
:
1
,
"prioritizeIfCanFinish"
:
1
,
"dueDateThreshold"
:
7
"dueDateThreshold"
:
7
}
}
...
...
dream/simulation/JSONInputs/CapacityStationSharedResources3.json
View file @
acc2fa6f
...
@@ -124,7 +124,6 @@
...
@@ -124,7 +124,6 @@
"name"
:
"CSC"
,
"name"
:
"CSC"
,
"start"
:
"0"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
,
"prioritizeIfCanFinish"
:
1
,
"prioritizeIfCanFinish"
:
1
,
"dueDateThreshold"
:
7
"dueDateThreshold"
:
7
}
}
...
...
dream/simulation/JSONInputs/CapacityStationSpace1.json
View file @
acc2fa6f
...
@@ -138,7 +138,6 @@
...
@@ -138,7 +138,6 @@
"name"
:
"CSC"
,
"name"
:
"CSC"
,
"start"
:
"0"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
,
"prioritizeIfCanFinish"
:
1
,
"prioritizeIfCanFinish"
:
1
,
"dueDateThreshold"
:
7
"dueDateThreshold"
:
7
}
}
...
...
dream/simulation/JSONInputs/CapacityStationSpace2.json
View file @
acc2fa6f
...
@@ -137,7 +137,6 @@
...
@@ -137,7 +137,6 @@
"name"
:
"CSC"
,
"name"
:
"CSC"
,
"start"
:
"0"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
,
"prioritizeIfCanFinish"
:
1
,
"prioritizeIfCanFinish"
:
1
,
"dueDateThreshold"
:
7
"dueDateThreshold"
:
7
}
}
...
...
dream/simulation/JSONInputs/CapacityStationSpace3.json
View file @
acc2fa6f
...
@@ -133,7 +133,6 @@
...
@@ -133,7 +133,6 @@
"name"
:
"CSC"
,
"name"
:
"CSC"
,
"start"
:
"0"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"interval"
:
"1"
,
"method"
:
"Dream.None"
,
"prioritizeIfCanFinish"
:
1
,
"prioritizeIfCanFinish"
:
1
,
"dueDateThreshold"
:
7
"dueDateThreshold"
:
7
}
}
...
...
dream/simulation/JSONInputs/Topology77.json
View file @
acc2fa6f
...
@@ -198,8 +198,7 @@
...
@@ -198,8 +198,7 @@
"_class"
:
"Dream.CapacityStationController"
,
"_class"
:
"Dream.CapacityStationController"
,
"name"
:
"CSC"
,
"name"
:
"CSC"
,
"start"
:
"0"
,
"start"
:
"0"
,
"interval"
:
"1"
,
"interval"
:
"1"
"method"
:
"Dream.None"
}
}
}
}
}
}
\ No newline at end of file
dream/simulation/LineGenerationJSON.py
View file @
acc2fa6f
...
@@ -704,33 +704,33 @@ def createObjectInterruptions():
...
@@ -704,33 +704,33 @@ def createObjectInterruptions():
# from CoreObject import CoreObject
# from CoreObject import CoreObject
# if issubclass(objectType, CoreObject):
# if issubclass(objectType, CoreObject):
if
objClass
==
'Dream.EventGenerator'
:
# check the object type
if
objClass
in
[
'Dream.EventGenerator'
,
'Dream.CapacityStationController'
]:
# check the object type
inputDict
=
dict
(
element
)
inputDict
=
dict
(
element
)
# create the
CoreObject
# create the
ObjectInterruption
objectInterruption
=
objectType
(
**
inputDict
)
objectInterruption
=
objectType
(
**
inputDict
)
G
.
ObjectInterruptionList
.
append
(
objectInterruption
)
G
.
ObjectInterruptionList
.
append
(
objectInterruption
)
elif
objClass
==
'Dream.CapacityStationController'
:
# check the object type
#
elif objClass=='Dream.CapacityStationController': # check the object type
id
=
element
.
get
(
'id'
,
'not found'
)
# get the id of the element / default 'not_found'
#
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'
#
name = element.get('name', 'not found') # get the name of the element / default 'not_found'
start
=
float
(
element
.
get
(
'start'
)
or
0
)
#
start = float(element.get('start') or 0)
stop
=
float
(
element
.
get
(
'stop'
)
or
-
1
)
#
stop = float(element.get('stop') or -1)
# infinity (had to be done to make it as float)
#
# infinity (had to be done to make it as float)
if
stop
<
0
:
#
if stop<0:
stop
=
float
(
'inf'
)
#
stop=float('inf')
interval
=
float
(
element
.
get
(
'interval'
)
or
1
)
#
interval = float(element.get('interval') or 1)
duration
=
float
(
element
.
get
(
'duration'
)
or
0
)
#
duration = float(element.get('duration') or 0)
dueDateThreshold
=
float
(
element
.
get
(
'dueDateThreshold'
)
or
float
(
'inf'
))
#
dueDateThreshold = float(element.get('dueDateThreshold') or float('inf'))
prioritizeIfCanFinish
=
bool
(
element
.
get
(
'prioritizeIfCanFinish'
,
0
))
#
prioritizeIfCanFinish = bool(element.get('prioritizeIfCanFinish', 0))
argumentDict
=
(
element
.
get
(
'argumentDict'
,
{}))
# get the arguments of the method as a dict / default {}
#
argumentDict=(element.get('argumentDict', {})) # get the arguments of the method as a dict / default {}
#
# create the CapacityStationController object
#
# create the CapacityStationController object
CSC
=
CapacityStationController
(
id
,
name
,
start
=
start
,
stop
=
stop
,
interval
=
interval
,
#
CSC = CapacityStationController(id, name, start=start, stop=stop, interval=interval,
duration
=
duration
,
argumentDict
=
argumentDict
,
dueDateThreshold
=
dueDateThreshold
,
#
duration=duration, argumentDict=argumentDict, dueDateThreshold=dueDateThreshold,
prioritizeIfCanFinish
=
prioritizeIfCanFinish
)
#
prioritizeIfCanFinish=prioritizeIfCanFinish)
G
.
EventGeneratorList
.
append
(
CSC
)
#
G.EventGeneratorList.append(CSC)
G
.
CapacityStationControllerList
.
append
(
CSC
)
#
G.CapacityStationControllerList.append(CSC)
G
.
ObjectInterruptionList
.
append
(
CSC
)
#
G.ObjectInterruptionList.append(CSC)
# for the elements in the nodes dict
# for the elements in the nodes dict
for
(
element_id
,
element
)
in
nodes
.
iteritems
():
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