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
e44d4d21
Commit
e44d4d21
authored
Jan 06, 2014
by
Georgios Dagkakis
Committed by
Jérome Perrin
Jan 20, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OrderDecomposition updated so that it passes to the components certain attributes of the order
parent
fd35367c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
dream/simulation/OrderDecomposition.py
dream/simulation/OrderDecomposition.py
+12
-10
No files found.
dream/simulation/OrderDecomposition.py
View file @
e44d4d21
...
...
@@ -54,6 +54,7 @@ class OrderDecomposition(CoreObject):
self
.
Res
=
Resource
(
infinity
)
# initialize the Internal resource (Queue) functionality. This is a dummy object so
# infinite capacity is assumed
self
.
newlyCreatedComponents
=
[]
self
.
orderToBeDecomposed
=
None
#run just waits until there is something to get and gets it
def
run
(
self
):
...
...
@@ -118,22 +119,21 @@ class OrderDecomposition(CoreObject):
#loop in the internal Queue. Decompose only if an Entity is of type order
for
entity
in
activeObjectQueue
:
if
entity
.
type
==
'Order'
:
self
.
orderToBeDecomposed
=
entity
activeObjectQueue
.
remove
(
entity
)
#remove the order from the internal Queue
#append the components in the internal queue
for
component
in
entity
.
componentsList
:
self
.
createOrderComponent
(
component
)
import
Globals
Globals
.
setWIP
(
self
.
newlyCreatedComponents
)
self
.
newlyCreatedComponents
=
[]
if
self
.
orderToBeDecomposed
:
import
Globals
Globals
.
setWIP
(
self
.
newlyCreatedComponents
)
self
.
orderToBeDecomposed
=
None
self
.
newlyCreatedComponents
=
[]
def
createOrderComponent
(
self
,
component
):
id
=
component
.
get
(
'id'
,
'not found'
)
name
=
component
.
get
(
'name'
,
'not found'
)
priority
=
int
(
component
.
get
(
'priority'
,
'0'
))
dueDate
=
float
(
component
.
get
(
'dueDate'
,
'0'
))
orderDate
=
float
(
component
.
get
(
'orderDate'
,
'0'
))
isCritical
=
bool
(
int
(
component
.
get
(
'isCritical'
,
'0'
)))
JSONRoute
=
component
.
get
(
'route'
,
[])
# dummy variable that holds the routes of the jobs
# the route from the JSON file
# is a sequence of dictionaries
...
...
@@ -174,8 +174,10 @@ class OrderDecomposition(CoreObject):
route
.
append
([
exitId
,
0
])
# initiate the OrderComponent
OC
=
OrderComponent
(
id
,
name
,
route
,
priority
=
priority
,
dueDate
=
dueDate
,
orderDate
=
orderDate
,
extraPropertyDict
=
extraPropertyDict
,
isCritical
=
isCritical
)
OC
=
OrderComponent
(
id
,
name
,
route
,
priority
=
self
.
orderToBeDecomposed
.
priority
,
dueDate
=
self
.
orderToBeDecomposed
.
dueDate
,
order
=
self
.
orderToBeDecomposed
,
orderDate
=
self
.
orderToBeDecomposed
.
orderDate
,
extraPropertyDict
=
extraPropertyDict
,
isCritical
=
self
.
orderToBeDecomposed
.
isCritical
)
G
.
OrderComponentList
.
append
(
OC
)
G
.
JobList
.
append
(
OC
)
G
.
WipList
.
append
(
OC
)
...
...
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