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
60c58500
Commit
60c58500
authored
Feb 24, 2014
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update Source, the key in JSON is "entity", not "item"
parent
22b26c67
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
18 additions
and
18 deletions
+18
-18
dream/simulation/BatchSource.py
dream/simulation/BatchSource.py
+2
-2
dream/simulation/Examples/AssemblyLine.py
dream/simulation/Examples/AssemblyLine.py
+2
-2
dream/simulation/Examples/ClearBatchLines.py
dream/simulation/Examples/ClearBatchLines.py
+1
-1
dream/simulation/Examples/DecompositionOfBatches.py
dream/simulation/Examples/DecompositionOfBatches.py
+2
-2
dream/simulation/Examples/ParallelServers1.py
dream/simulation/Examples/ParallelServers1.py
+1
-1
dream/simulation/Examples/ParallelServers2.py
dream/simulation/Examples/ParallelServers2.py
+1
-1
dream/simulation/Examples/ParallelServers3.py
dream/simulation/Examples/ParallelServers3.py
+1
-1
dream/simulation/Examples/SerialBatchProcessing.py
dream/simulation/Examples/SerialBatchProcessing.py
+1
-1
dream/simulation/Examples/SingleServer.py
dream/simulation/Examples/SingleServer.py
+1
-1
dream/simulation/Examples/TwoServers.py
dream/simulation/Examples/TwoServers.py
+2
-2
dream/simulation/Examples/TwoServersPlots.py
dream/simulation/Examples/TwoServersPlots.py
+1
-1
dream/simulation/Examples/TwoServersStochastic.py
dream/simulation/Examples/TwoServersStochastic.py
+1
-1
dream/simulation/Source.py
dream/simulation/Source.py
+2
-2
No files found.
dream/simulation/BatchSource.py
View file @
60c58500
...
@@ -31,9 +31,9 @@ from RandomNumberGenerator import RandomNumberGenerator
...
@@ -31,9 +31,9 @@ from RandomNumberGenerator import RandomNumberGenerator
class
BatchSource
(
Source
):
class
BatchSource
(
Source
):
def
__init__
(
self
,
id
,
name
,
interarrivalTime
=
None
,
def
__init__
(
self
,
id
,
name
,
interarrivalTime
=
None
,
item
=
'Dream.Batch'
,
batchNumberOfUnits
=
1
,
**
kw
):
entity
=
'Dream.Batch'
,
batchNumberOfUnits
=
1
,
**
kw
):
Source
.
__init__
(
self
,
id
=
id
,
name
=
name
,
Source
.
__init__
(
self
,
id
=
id
,
name
=
name
,
interarrivalTime
=
interarrivalTime
,
item
=
item
,
**
kw
)
interarrivalTime
=
interarrivalTime
,
entity
=
entity
,
**
kw
)
self
.
numberOfUnits
=
batchNumberOfUnits
self
.
numberOfUnits
=
batchNumberOfUnits
...
...
dream/simulation/Examples/AssemblyLine.py
View file @
60c58500
...
@@ -3,8 +3,8 @@ from dream.simulation.imports import simulate, activate, initialize
...
@@ -3,8 +3,8 @@ from dream.simulation.imports import simulate, activate, initialize
#define the objects of the model
#define the objects of the model
Frame
.
capacity
=
4
Frame
.
capacity
=
4
Sp
=
Source
(
'SP'
,
'Parts'
,
mean
=
0.5
,
item
=
Part
)
Sp
=
Source
(
'SP'
,
'Parts'
,
mean
=
0.5
,
entity
=
'Dream.Part'
)
Sf
=
Source
(
'SF'
,
'Frames'
,
mean
=
2
,
item
=
Frame
)
Sf
=
Source
(
'SF'
,
'Frames'
,
mean
=
2
,
entity
=
'Dream.Frame'
)
M
=
Machine
(
'M'
,
'Machine'
,
mean
=
0.25
)
M
=
Machine
(
'M'
,
'Machine'
,
mean
=
0.25
)
A
=
Assembly
(
'A'
,
'Assembly'
,
mean
=
2
)
A
=
Assembly
(
'A'
,
'Assembly'
,
mean
=
2
)
E
=
Exit
(
'E1'
,
'Exit'
)
E
=
Exit
(
'E1'
,
'Exit'
)
...
...
dream/simulation/Examples/ClearBatchLines.py
View file @
60c58500
...
@@ -5,7 +5,7 @@ from dream.simulation.imports import simulate, activate, initialize
...
@@ -5,7 +5,7 @@ from dream.simulation.imports import simulate, activate, initialize
# choose to output trace or not
# choose to output trace or not
G
.
trace
=
'Yes'
G
.
trace
=
'Yes'
# define the objects of the model
# define the objects of the model
S
=
BatchSource
(
'S'
,
'Source'
,
mean
=
1.5
,
item
=
Batch
,
batchNumberOfUnits
=
100
)
S
=
BatchSource
(
'S'
,
'Source'
,
mean
=
1.5
,
entity
=
'Dream.Batch'
,
batchNumberOfUnits
=
100
)
Q
=
Queue
(
'Q'
,
'StartQueue'
,
capacity
=-
1
)
Q
=
Queue
(
'Q'
,
'StartQueue'
,
capacity
=-
1
)
BD
=
BatchDecomposition
(
'BC'
,
'BatchDecomposition'
,
numberOfSubBatches
=
4
,
mean
=
1
)
BD
=
BatchDecomposition
(
'BC'
,
'BatchDecomposition'
,
numberOfSubBatches
=
4
,
mean
=
1
)
M1
=
Machine
(
'M1'
,
'Machine1'
,
mean
=
0.5
)
M1
=
Machine
(
'M1'
,
'Machine1'
,
mean
=
0.5
)
...
...
dream/simulation/Examples/DecompositionOfBatches.py
View file @
60c58500
...
@@ -2,7 +2,7 @@ from dream.simulation.imports import Machine, BatchSource, Exit, Batch, BatchDec
...
@@ -2,7 +2,7 @@ from dream.simulation.imports import Machine, BatchSource, Exit, Batch, BatchDec
from
dream.simulation.imports
import
simulate
,
activate
,
initialize
from
dream.simulation.imports
import
simulate
,
activate
,
initialize
# define the objects of the model
# define the objects of the model
S
=
BatchSource
(
'S'
,
'Source'
,
mean
=
0.5
,
item
=
Batch
,
batchNumberOfUnits
=
4
)
S
=
BatchSource
(
'S'
,
'Source'
,
mean
=
0.5
,
entity
=
'Dream.Batch'
,
batchNumberOfUnits
=
4
)
Q
=
Queue
(
'Q'
,
'StartQueue'
,
capacity
=
100000
)
Q
=
Queue
(
'Q'
,
'StartQueue'
,
capacity
=
100000
)
BD
=
BatchDecomposition
(
'BC'
,
'BatchDecomposition'
,
numberOfSubBatches
=
4
,
mean
=
1
)
BD
=
BatchDecomposition
(
'BC'
,
'BatchDecomposition'
,
numberOfSubBatches
=
4
,
mean
=
1
)
M
=
Machine
(
'M'
,
'Machine'
,
mean
=
0.5
)
M
=
Machine
(
'M'
,
'Machine'
,
mean
=
0.5
)
...
@@ -34,4 +34,4 @@ for object in G.ObjList:
...
@@ -34,4 +34,4 @@ for object in G.ObjList:
print
"the system produced"
,
E
.
numOfExits
,
"parts"
print
"the system produced"
,
E
.
numOfExits
,
"parts"
print
"the working ratio of"
,
M
.
objName
,
"is"
,
(
M
.
totalWorkingTime
/
G
.
maxSimTime
)
*
100
print
"the working ratio of"
,
M
.
objName
,
"is"
,
(
M
.
totalWorkingTime
/
G
.
maxSimTime
)
*
100
print
"the blockage ratio of"
,
M
.
objName
,
'is'
,
(
M
.
totalBlockageTime
/
G
.
maxSimTime
)
*
100
print
"the blockage ratio of"
,
M
.
objName
,
'is'
,
(
M
.
totalBlockageTime
/
G
.
maxSimTime
)
*
100
print
"the waiting ratio of"
,
M
.
objName
,
'is'
,
(
M
.
totalWaitingTime
/
G
.
maxSimTime
)
*
100
print
"the waiting ratio of"
,
M
.
objName
,
'is'
,
(
M
.
totalWaitingTime
/
G
.
maxSimTime
)
*
100
\ No newline at end of file
dream/simulation/Examples/ParallelServers1.py
View file @
60c58500
...
@@ -2,7 +2,7 @@ from dream.simulation.imports import Machine, Source, Exit, Part, Queue, G, Fail
...
@@ -2,7 +2,7 @@ from dream.simulation.imports import Machine, Source, Exit, Part, Queue, G, Fail
from
dream.simulation.imports
import
simulate
,
activate
,
initialize
,
infinity
from
dream.simulation.imports
import
simulate
,
activate
,
initialize
,
infinity
#define the objects of the model
#define the objects of the model
S
=
Source
(
'S'
,
'Source'
,
mean
=
0.5
,
item
=
Part
)
S
=
Source
(
'S'
,
'Source'
,
mean
=
0.5
,
entity
=
'Dream.Part'
)
Q
=
Queue
(
'Q'
,
'Queue'
,
capacity
=
infinity
)
Q
=
Queue
(
'Q'
,
'Queue'
,
capacity
=
infinity
)
M1
=
Machine
(
'M1'
,
'Milling1'
,
mean
=
0.25
)
M1
=
Machine
(
'M1'
,
'Milling1'
,
mean
=
0.25
)
M2
=
Machine
(
'M2'
,
'Milling2'
,
mean
=
0.25
)
M2
=
Machine
(
'M2'
,
'Milling2'
,
mean
=
0.25
)
...
...
dream/simulation/Examples/ParallelServers2.py
View file @
60c58500
...
@@ -15,7 +15,7 @@ class SelectiveQueue(Queue):
...
@@ -15,7 +15,7 @@ class SelectiveQueue(Queue):
return
len
(
self
.
getActiveObjectQueue
())
>
0
and
(
not
(
M1
.
canAccept
()))
return
len
(
self
.
getActiveObjectQueue
())
>
0
and
(
not
(
M1
.
canAccept
()))
#define the objects of the model
#define the objects of the model
S
=
Source
(
'S'
,
'Source'
,
mean
=
0.5
,
item
=
Part
)
S
=
Source
(
'S'
,
'Source'
,
mean
=
0.5
,
entity
=
'Dream.Part'
)
Q
=
SelectiveQueue
(
'Q'
,
'Queue'
,
capacity
=
infinity
)
Q
=
SelectiveQueue
(
'Q'
,
'Queue'
,
capacity
=
infinity
)
M1
=
Machine
(
'M1'
,
'Milling1'
,
mean
=
0.25
)
M1
=
Machine
(
'M1'
,
'Milling1'
,
mean
=
0.25
)
M2
=
Machine
(
'M2'
,
'Milling2'
,
mean
=
0.25
)
M2
=
Machine
(
'M2'
,
'Milling2'
,
mean
=
0.25
)
...
...
dream/simulation/Examples/ParallelServers3.py
View file @
60c58500
...
@@ -34,7 +34,7 @@ class CountingExit(Exit):
...
@@ -34,7 +34,7 @@ class CountingExit(Exit):
return
activeEntity
#return the entity obtained
return
activeEntity
#return the entity obtained
#define the objects of the model
#define the objects of the model
S
=
Source
(
'S'
,
'Source'
,
mean
=
0.5
,
item
=
Part
)
S
=
Source
(
'S'
,
'Source'
,
mean
=
0.5
,
entity
=
'Dream.Part'
)
Q
=
SelectiveQueue
(
'Q'
,
'Queue'
,
capacity
=
infinity
)
Q
=
SelectiveQueue
(
'Q'
,
'Queue'
,
capacity
=
infinity
)
M1
=
Milling
(
'M1'
,
'Milling1'
,
mean
=
0.25
)
M1
=
Milling
(
'M1'
,
'Milling1'
,
mean
=
0.25
)
M2
=
Milling
(
'M2'
,
'Milling2'
,
mean
=
0.25
)
M2
=
Milling
(
'M2'
,
'Milling2'
,
mean
=
0.25
)
...
...
dream/simulation/Examples/SerialBatchProcessing.py
View file @
60c58500
...
@@ -2,7 +2,7 @@ from dream.simulation.imports import Machine, BatchSource, Exit, Batch, BatchDec
...
@@ -2,7 +2,7 @@ from dream.simulation.imports import Machine, BatchSource, Exit, Batch, BatchDec
from
dream.simulation.imports
import
simulate
,
activate
,
initialize
from
dream.simulation.imports
import
simulate
,
activate
,
initialize
# define the objects of the model
# define the objects of the model
S
=
BatchSource
(
'S'
,
'Source'
,
mean
=
1.5
,
item
=
Batch
,
batchNumberOfUnits
=
100
)
S
=
BatchSource
(
'S'
,
'Source'
,
mean
=
1.5
,
entity
=
'Dream.Batch'
,
batchNumberOfUnits
=
100
)
Q
=
Queue
(
'Q'
,
'StartQueue'
,
capacity
=
100000
)
Q
=
Queue
(
'Q'
,
'StartQueue'
,
capacity
=
100000
)
BD
=
BatchDecomposition
(
'BC'
,
'BatchDecomposition'
,
numberOfSubBatches
=
4
,
mean
=
1
)
BD
=
BatchDecomposition
(
'BC'
,
'BatchDecomposition'
,
numberOfSubBatches
=
4
,
mean
=
1
)
M1
=
Machine
(
'M1'
,
'Machine1'
,
mean
=
0.5
)
M1
=
Machine
(
'M1'
,
'Machine1'
,
mean
=
0.5
)
...
...
dream/simulation/Examples/SingleServer.py
View file @
60c58500
...
@@ -2,7 +2,7 @@ from dream.simulation.imports import Machine, Source, Exit, Part, G
...
@@ -2,7 +2,7 @@ from dream.simulation.imports import Machine, Source, Exit, Part, G
from
dream.simulation.imports
import
simulate
,
activate
,
initialize
from
dream.simulation.imports
import
simulate
,
activate
,
initialize
#define the objects of the model
#define the objects of the model
S
=
Source
(
'S1'
,
'Source'
,
distribution
=
'Fixed'
,
mean
=
0.5
,
item
=
Part
)
S
=
Source
(
'S1'
,
'Source'
,
distribution
=
'Fixed'
,
mean
=
0.5
,
entity
=
'Dream.Part'
)
M
=
Machine
(
'M1'
,
'Machine'
,
mean
=
0.25
)
M
=
Machine
(
'M1'
,
'Machine'
,
mean
=
0.25
)
E
=
Exit
(
'E1'
,
'Exit'
)
E
=
Exit
(
'E1'
,
'Exit'
)
...
...
dream/simulation/Examples/TwoServers.py
View file @
60c58500
...
@@ -3,7 +3,7 @@ from dream.simulation.imports import simulate, activate, initialize
...
@@ -3,7 +3,7 @@ from dream.simulation.imports import simulate, activate, initialize
#define the objects of the model
#define the objects of the model
R
=
Repairman
(
'R1'
,
'Bob'
)
R
=
Repairman
(
'R1'
,
'Bob'
)
S
=
Source
(
'S1'
,
'Source'
,
mean
=
0.5
,
item
=
Part
)
S
=
Source
(
'S1'
,
'Source'
,
mean
=
0.5
,
entity
=
'Dream.Part'
)
M1
=
Machine
(
'M1'
,
'Machine1'
,
mean
=
0.25
)
M1
=
Machine
(
'M1'
,
'Machine1'
,
mean
=
0.25
)
Q
=
Queue
(
'Q1'
,
'Queue'
)
Q
=
Queue
(
'Q1'
,
'Queue'
)
M2
=
Machine
(
'M2'
,
'Machine2'
,
mean
=
1.5
)
M2
=
Machine
(
'M2'
,
'Machine2'
,
mean
=
1.5
)
...
@@ -55,4 +55,4 @@ R.postProcessing()
...
@@ -55,4 +55,4 @@ R.postProcessing()
#print the results
#print the results
print
"the system produced"
,
E
.
numOfExits
,
"parts"
print
"the system produced"
,
E
.
numOfExits
,
"parts"
print
"the blockage ratio of"
,
M1
.
objName
,
"is"
,
(
M1
.
totalBlockageTime
/
G
.
maxSimTime
)
*
100
,
"%"
print
"the blockage ratio of"
,
M1
.
objName
,
"is"
,
(
M1
.
totalBlockageTime
/
G
.
maxSimTime
)
*
100
,
"%"
print
"the working ratio of"
,
R
.
objName
,
"is"
,
(
R
.
totalWorkingTime
/
G
.
maxSimTime
)
*
100
,
"%"
print
"the working ratio of"
,
R
.
objName
,
"is"
,
(
R
.
totalWorkingTime
/
G
.
maxSimTime
)
*
100
,
"%"
\ No newline at end of file
dream/simulation/Examples/TwoServersPlots.py
View file @
60c58500
...
@@ -6,7 +6,7 @@ from dream.KnowledgeExtraction.Plots import Graphs
...
@@ -6,7 +6,7 @@ from dream.KnowledgeExtraction.Plots import Graphs
#define the objects of the model
#define the objects of the model
R
=
Repairman
(
'R1'
,
'Bob'
)
R
=
Repairman
(
'R1'
,
'Bob'
)
S
=
Source
(
'S1'
,
'Source'
,
mean
=
0.5
,
item
=
Part
)
S
=
Source
(
'S1'
,
'Source'
,
mean
=
0.5
,
entity
=
'Dream.Part'
)
M1
=
Machine
(
'M1'
,
'Machine1'
,
mean
=
0.25
,
failureDistribution
=
'Fixed'
,
MTTF
=
60
,
MTTR
=
5
,
repairman
=
R
)
M1
=
Machine
(
'M1'
,
'Machine1'
,
mean
=
0.25
,
failureDistribution
=
'Fixed'
,
MTTF
=
60
,
MTTR
=
5
,
repairman
=
R
)
Q
=
Queue
(
'Q1'
,
'Queue'
)
Q
=
Queue
(
'Q1'
,
'Queue'
)
M2
=
Machine
(
'M2'
,
'Machine2'
,
mean
=
1.5
,
failureDistribution
=
'Fixed'
,
MTTF
=
40
,
MTTR
=
10
,
repairman
=
R
)
M2
=
Machine
(
'M2'
,
'Machine2'
,
mean
=
1.5
,
failureDistribution
=
'Fixed'
,
MTTF
=
40
,
MTTR
=
10
,
repairman
=
R
)
...
...
dream/simulation/Examples/TwoServersStochastic.py
View file @
60c58500
...
@@ -3,7 +3,7 @@ from dream.simulation.imports import simulate, activate, initialize
...
@@ -3,7 +3,7 @@ from dream.simulation.imports import simulate, activate, initialize
#define the objects of the model
#define the objects of the model
R
=
Repairman
(
'R1'
,
'Bob'
)
R
=
Repairman
(
'R1'
,
'Bob'
)
S
=
Source
(
'S1'
,
'Source'
,
mean
=
0.5
,
item
=
Part
)
S
=
Source
(
'S1'
,
'Source'
,
mean
=
0.5
,
entity
=
'Dream.Part'
)
M1
=
Machine
(
'M1'
,
'Machine1'
,
distribution
=
'Normal'
,
mean
=
0.25
,
stdev
=
0.1
,
min
=
0.1
,
max
=
1
)
M1
=
Machine
(
'M1'
,
'Machine1'
,
distribution
=
'Normal'
,
mean
=
0.25
,
stdev
=
0.1
,
min
=
0.1
,
max
=
1
)
Q
=
Queue
(
'Q1'
,
'Queue'
)
Q
=
Queue
(
'Q1'
,
'Queue'
)
M2
=
Machine
(
'M2'
,
'Machine2'
,
distribution
=
'Normal'
,
mean
=
1.5
,
stdev
=
0.3
,
min
=
0.5
,
max
=
5
)
M2
=
Machine
(
'M2'
,
'Machine2'
,
distribution
=
'Normal'
,
mean
=
1.5
,
stdev
=
0.3
,
min
=
0.5
,
max
=
5
)
...
...
dream/simulation/Source.py
View file @
60c58500
...
@@ -35,7 +35,7 @@ import Globals
...
@@ -35,7 +35,7 @@ import Globals
# The Source object is a Process
# The Source object is a Process
#============================================================================
#============================================================================
class
Source
(
CoreObject
):
class
Source
(
CoreObject
):
def
__init__
(
self
,
id
,
name
,
interarrivalTime
=
None
,
item
=
'Dream.Part'
,
**
kw
):
def
__init__
(
self
,
id
,
name
,
interarrivalTime
=
None
,
entity
=
'Dream.Part'
,
**
kw
):
# Default values
# Default values
if
not
interarrivalTime
:
if
not
interarrivalTime
:
interarrivalTime
=
{
'distributionType'
:
'Fixed'
,
'mean'
:
1
}
interarrivalTime
=
{
'distributionType'
:
'Fixed'
,
'mean'
:
1
}
...
@@ -53,7 +53,7 @@ class Source(CoreObject):
...
@@ -53,7 +53,7 @@ class Source(CoreObject):
self
.
rng
=
RandomNumberGenerator
(
self
,
**
interarrivalTime
)
self
.
rng
=
RandomNumberGenerator
(
self
,
**
interarrivalTime
)
self
.
item
=
Globals
.
getClassFromName
(
item
)
#the type of object that the Source will generate
self
.
item
=
Globals
.
getClassFromName
(
entity
)
#the type of object that the Source will generate
def
initialize
(
self
):
def
initialize
(
self
):
# using the Process __init__ and not the CoreObject __init__
# using the Process __init__ and not the CoreObject __init__
...
...
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