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
4e2f73fd
Commit
4e2f73fd
authored
May 28, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
now corrected in globals. Also env is defined there
parent
676e5b9f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
dream/simulation/Globals.py
dream/simulation/Globals.py
+6
-5
No files found.
dream/simulation/Globals.py
View file @
4e2f73fd
...
@@ -32,7 +32,7 @@ from Repairman import Repairman
...
@@ -32,7 +32,7 @@ from Repairman import Repairman
import
xlwt
import
xlwt
import
xlrd
import
xlrd
from
random
import
Random
,
expovariate
,
gammavariate
,
normalvariate
from
random
import
Random
,
expovariate
,
gammavariate
,
normalvariate
from
SimPy.Simulation
import
now
import
simpy
# ===========================================================================
# ===========================================================================
# globals
# globals
...
@@ -126,6 +126,7 @@ class G:
...
@@ -126,6 +126,7 @@ class G:
# entities that just finished processing in a station
# entities that just finished processing in a station
# and have to enter the next machine
# and have to enter the next machine
pendingEntities
=
[]
pendingEntities
=
[]
env
=
simpy
.
Environment
()
# =======================================================================
# =======================================================================
...
@@ -192,7 +193,7 @@ def setWIP(entityList):
...
@@ -192,7 +193,7 @@ def setWIP(entityList):
if
entity
.
type
==
'Part'
or
entity
.
type
==
'Batch'
or
entity
.
type
==
'SubBatch'
:
if
entity
.
type
==
'Part'
or
entity
.
type
==
'Batch'
or
entity
.
type
==
'SubBatch'
:
object
=
entity
.
currentStation
#identify the object
object
=
entity
.
currentStation
#identify the object
object
.
getActiveObjectQueue
().
append
(
entity
)
#append the entity to its Queue
object
.
getActiveObjectQueue
().
append
(
entity
)
#append the entity to its Queue
entity
.
schedule
.
append
([
object
,
now
()
])
#append the time to schedule so that it can be read in the result
entity
.
schedule
.
append
([
object
,
G
.
env
.
now
])
#append the time to schedule so that it can be read in the result
# if the entity is of type Job/OrderComponent/Order/Mould
# if the entity is of type Job/OrderComponent/Order/Mould
...
@@ -225,7 +226,7 @@ def setWIP(entityList):
...
@@ -225,7 +226,7 @@ def setWIP(entityList):
object
.
next
.
append
(
nextObject
)
object
.
next
.
append
(
nextObject
)
entity
.
remainingRoute
.
pop
(
0
)
# remove data from the remaining route.
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
.
schedule
.
append
([
object
,
G
.
env
.
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
entity
.
currentStation
=
object
# update the current station of the entity
# if the currentStation of the entity is of type Machine then the entity
# if the currentStation of the entity is of type Machine then the entity
# must be processed first and then added to the pendingEntities list
# must be processed first and then added to the pendingEntities list
...
@@ -259,7 +260,7 @@ from Queue import Queue
...
@@ -259,7 +260,7 @@ from Queue import Queue
def
countQueueMetrics
(
argumentDict
=
{}):
def
countQueueMetrics
(
argumentDict
=
{}):
for
obj
in
G
.
ObjList
:
for
obj
in
G
.
ObjList
:
if
isinstance
(
obj
,
Queue
):
if
isinstance
(
obj
,
Queue
):
obj
.
wip_stat_list
.
append
((
now
()
,
len
(
obj
.
Res
.
activeQ
)))
obj
.
wip_stat_list
.
append
((
G
.
env
.
now
,
len
(
obj
.
Res
.
activeQ
)))
# =======================================================================
# =======================================================================
...
@@ -285,7 +286,7 @@ def getConfidenceIntervals(value_list):
...
@@ -285,7 +286,7 @@ def getConfidenceIntervals(value_list):
# def printTrace(entity='',station='', **kw):
# def printTrace(entity='',station='', **kw):
# assert len(kw)==1, 'only one phrase per printTrace supported for the moment'
# assert len(kw)==1, 'only one phrase per printTrace supported for the moment'
# from Globals import G
# from Globals import G
# time=
now()
# time=
G.env.now
# charLimit=60
# charLimit=60
# remainingChar=charLimit-len(entity)-len(str(time))
# remainingChar=charLimit-len(entity)-len(str(time))
# if(G.console=='Yes'):
# if(G.console=='Yes'):
...
...
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