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
c15a0ee3
Commit
c15a0ee3
authored
Nov 28, 2013
by
Georgios Dagkakis
Committed by
Jérome Perrin
Dec 02, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
getObjecctById is moved to be a global method
parent
65102d52
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
23 deletions
+15
-23
dream/simulation/Globals.py
dream/simulation/Globals.py
+7
-1
dream/simulation/LineGenerationJSON.py
dream/simulation/LineGenerationJSON.py
+2
-7
dream/simulation/MachineJobShop.py
dream/simulation/MachineJobShop.py
+3
-9
dream/simulation/QueueJobShop.py
dream/simulation/QueueJobShop.py
+3
-6
No files found.
dream/simulation/Globals.py
View file @
c15a0ee3
...
...
@@ -68,4 +68,10 @@ class G:
outputJSON
=
{}
outputJSONFile
=
None
numberOfEntities
=
0
\ No newline at end of file
numberOfEntities
=
0
def
findObjectById
(
id
):
for
obj
in
G
.
ObjList
:
if
obj
.
id
==
id
:
return
obj
return
None
\ No newline at end of file
dream/simulation/LineGenerationJSON.py
View file @
c15a0ee3
...
...
@@ -574,17 +574,12 @@ def setWIP():
if
obj
.
id
==
objectId
:
object
=
obj
# find the object in the 'G.ObjList
object
.
getActiveObjectQueue
().
append
(
entity
)
# append the entity to its Queue
object
.
receiver
=
findObjectById
(
entity
.
remainingRoute
[
1
][
0
])
import
Globals
object
.
receiver
=
Globals
.
findObjectById
(
entity
.
remainingRoute
[
1
][
0
])
entity
.
remainingRoute
.
pop
(
0
)
# remove data from the remaining route.
entity
.
schedule
.
append
([
object
,
now
()])
#append the time to schedule so that it can be read in the result
entity
.
currentStation
=
object
# update the current station of the entity
def
findObjectById
(
id
):
from
Globals
import
G
for
obj
in
G
.
ObjList
:
if
obj
.
id
==
id
:
return
obj
# ===========================================================================
# the main script that is ran
# ===========================================================================
...
...
dream/simulation/MachineJobShop.py
View file @
c15a0ee3
...
...
@@ -42,7 +42,8 @@ class MachineJobShop(Machine):
def
getEntity
(
self
):
activeEntity
=
Machine
.
getEntity
(
self
)
#run the default code
self
.
procTime
=
activeEntity
.
remainingRoute
[
0
][
1
]
#read the processing time from the entity
self
.
receiver
=
self
.
findObjectById
(
activeEntity
.
remainingRoute
[
1
][
0
])
#read the next station
import
Globals
self
.
receiver
=
Globals
.
findObjectById
(
activeEntity
.
remainingRoute
[
1
][
0
])
#read the next station
activeEntity
.
remainingRoute
.
pop
(
0
)
#remove data from the remaining route of the entity
return
activeEntity
...
...
@@ -117,13 +118,6 @@ class MachineJobShop(Machine):
#else if there is a giver return it
elif
self
.
giver
:
return
self
.
giver
return
None
def
findObjectById
(
self
,
id
):
from
Globals
import
G
for
obj
in
G
.
ObjList
:
if
obj
.
id
==
id
:
return
obj
return
None
\ No newline at end of file
dream/simulation/QueueJobShop.py
View file @
c15a0ee3
...
...
@@ -90,7 +90,8 @@ class QueueJobShop(Queue):
#gets an entity from the predecessor that the predecessor index points to
def
getEntity
(
self
):
activeEntity
=
Queue
.
getEntity
(
self
)
self
.
receiver
=
self
.
findObjectById
(
activeEntity
.
remainingRoute
[
1
][
0
])
#read the next station
import
Globals
self
.
receiver
=
Globals
.
findObjectById
(
activeEntity
.
remainingRoute
[
1
][
0
])
#read the next station
activeEntity
.
remainingRoute
.
pop
(
0
)
#remove data from the remaining route of the entity
return
activeEntity
...
...
@@ -115,9 +116,5 @@ class QueueJobShop(Queue):
return
self
.
giver
return
None
def
findObjectById
(
self
,
id
):
from
Globals
import
G
for
obj
in
G
.
ObjList
:
if
obj
.
id
==
id
:
return
obj
\ 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