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
e5a772d1
Commit
e5a772d1
authored
Aug 22, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
capacity entities to be defined in new way
parent
b883d170
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
30 deletions
+16
-30
dream/simulation/CapacityEntity.py
dream/simulation/CapacityEntity.py
+2
-0
dream/simulation/CapacityProject.py
dream/simulation/CapacityProject.py
+2
-0
dream/simulation/LineGenerationJSON.py
dream/simulation/LineGenerationJSON.py
+12
-30
No files found.
dream/simulation/CapacityEntity.py
View file @
e5a772d1
...
...
@@ -40,6 +40,8 @@ class CapacityEntity(Entity):
self
.
capacityProject
=
None
# the project that the capacity Entity is part of. It is defined in initialize
self
.
requiredCapacity
=
requiredCapacity
# the capacity that the capacity entity requires from the following station
self
.
shouldMove
=
False
from
Globals
import
G
G
.
CapacityEntityList
.
append
(
self
)
def
initialize
(
self
):
Entity
.
initialize
(
self
)
...
...
dream/simulation/CapacityProject.py
View file @
e5a772d1
...
...
@@ -43,6 +43,8 @@ class CapacityProject(Entity):
self
.
earliestStartDict
=
earliestStartDict
# the assembly space the project requires
self
.
assemblySpaceRequirement
=
assemblySpaceRequirement
from
Globals
import
G
G
.
CapacityProjectList
.
append
(
self
)
def
initialize
(
self
):
self
.
projectSchedule
=
[]
# a list of dicts to keep the schedule
...
...
dream/simulation/LineGenerationJSON.py
View file @
e5a772d1
...
...
@@ -361,7 +361,7 @@ def createWIP():
# entities that just finished processing in a station
# and have to enter the next machine
G
.
pendingEntities
=
[]
import
Globals
json_data
=
G
.
JSONData
#Read the json data
nodes
=
json_data
[
'nodes'
]
# read from the dictionary the dicts with key 'nodes'
...
...
@@ -370,8 +370,17 @@ def createWIP():
wip
=
element
.
get
(
'wip'
,
[])
for
entity
in
wip
:
entityClass
=
entity
.
get
(
'_class'
,
None
)
entityType
=
Globals
.
getClassFromName
(
entityClass
)
inputDict
=
dict
(
entity
)
inputDict
.
pop
(
'_class'
)
if
entityClass
in
[
'Dream.CapacityEntity'
,
'Dream.CapacityProject'
]:
entity
=
entityType
(
**
inputDict
)
G
.
EntityList
.
append
(
entity
)
object
=
Globals
.
findObjectById
(
element
[
'id'
])
entity
.
currentStation
=
object
if
entityClass
==
'Dream.OrderComponent'
:
el
if
entityClass
==
'Dream.OrderComponent'
:
id
=
entity
.
get
(
'id'
,
'not found'
)
name
=
entity
.
get
(
'name'
,
'not found'
)
priority
=
int
(
entity
.
get
(
'priority'
,
'0'
))
...
...
@@ -500,7 +509,6 @@ def createWIP():
#have to talk about it with NEX
exitAssigned
=
False
for
element
in
route
:
# elementId=element[0]
elementIds
=
element
.
get
(
'stationIdsList'
,[])
for
obj
in
G
.
ObjList
:
for
elementId
in
elementIds
:
...
...
@@ -611,7 +619,6 @@ def createWIP():
#have to talk about it with NEX
odAssigned
=
False
for
element
in
route
:
# elementId=element[0]
elementIds
=
element
.
get
(
'stationIdsList'
,[])
for
obj
in
G
.
ObjList
:
for
elementId
in
elementIds
:
...
...
@@ -647,31 +654,6 @@ def createWIP():
G
.
EntityList
.
append
(
OD
)
G
.
JobList
.
append
(
OD
)
if
entityClass
==
'Dream.CapacityProject'
:
id
=
entity
.
get
(
'id'
,
'not found'
)
name
=
entity
.
get
(
'name'
,
'not found'
)
capacityRequirementDict
=
entity
.
get
(
'capacityRequirementDict'
,
{})
earliestStartDict
=
entity
.
get
(
'earliestStartDict'
,
{})
dueDate
=
float
(
entity
.
get
(
'dueDate'
,
0
))
assemblySpaceRequirement
=
float
(
entity
.
get
(
'assemblySpaceRequirement'
,
0
))
CP
=
CapacityProject
(
id
=
id
,
name
=
name
,
capacityRequirementDict
=
capacityRequirementDict
,
earliestStartDict
=
earliestStartDict
,
dueDate
=
dueDate
,
assemblySpaceRequirement
=
assemblySpaceRequirement
)
G
.
EntityList
.
append
(
CP
)
G
.
CapacityProjectList
.
append
(
CP
)
if
entityClass
==
'Dream.CapacityEntity'
:
id
=
entity
.
get
(
'id'
,
'not found'
)
name
=
entity
.
get
(
'name'
,
'not found'
)
requiredCapacity
=
entity
.
get
(
'requiredCapacity'
,
10
)
capacityProjectId
=
entity
.
get
(
'capacityProjectId'
,
None
)
CE
=
CapacityEntity
(
id
=
id
,
name
=
name
,
requiredCapacity
=
requiredCapacity
,
capacityProjectId
=
capacityProjectId
)
G
.
CapacityEntityList
.
append
(
CE
)
G
.
EntityList
.
append
(
CE
)
object
=
Globals
.
findObjectById
(
element
[
'id'
])
CE
.
currentStation
=
object
# ===========================================================================
# reads the interruptions of the stations
# ===========================================================================
...
...
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