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
47f3ba06
Commit
47f3ba06
authored
Feb 22, 2014
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update Assembly
parent
022211c8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
18 deletions
+13
-18
dream/simulation/Assembly.py
dream/simulation/Assembly.py
+11
-8
dream/simulation/LineGenerationJSON.py
dream/simulation/LineGenerationJSON.py
+2
-10
No files found.
dream/simulation/Assembly.py
View file @
47f3ba06
...
...
@@ -37,21 +37,24 @@ from CoreObject import CoreObject
class
Assembly
(
CoreObject
):
#initialize the object
def
__init__
(
self
,
id
,
name
,
distribution
=
'Fixed'
,
mean
=
1
,
stdev
=
0.1
,
min
=
0
,
max
=
5
,
**
kw
):
def
__init__
(
self
,
id
,
name
,
processingTime
=
None
,
**
kw
):
if
not
processingTime
:
processingTime
=
{
'distributionType'
:
'Fixed'
,
'mean'
:
0
,
'stdev'
:
0
,
'min'
:
0
,
'max'
:
0
,}
CoreObject
.
__init__
(
self
,
id
,
name
)
self
.
type
=
"Assembly"
#String that shows the type of object
self
.
distType
=
distribution
#the distribution that the procTime follows
self
.
rng
=
RandomNumberGenerator
(
self
,
self
.
distType
)
self
.
rng
.
mean
=
mean
self
.
rng
.
stdev
=
stdev
self
.
rng
.
min
=
min
self
.
rng
.
max
=
max
self
.
rng
=
RandomNumberGenerator
(
self
,
**
processingTime
)
self
.
next
=
[]
#list with the next objects in the flow
self
.
previous
=
[]
#list with the previous objects in the flow
self
.
previousPart
=
[]
#list with the previous objects that send parts
self
.
previousFrame
=
[]
#list with the previous objects that send frames
self
.
nextIds
=
[]
#list with the ids of the next objects in the flow
self
.
previousIds
=
[]
#list with the ids of the previous objects in the flow
# XXX previousFrameIds and previousPartIds are not used
self
.
previousPartIds
=
[]
#list with the ids of the previous objects in the flow that bring parts
self
.
previousFrameIds
=
[]
#list with the ids of the previous objects in the flow that bring frames
...
...
@@ -304,7 +307,7 @@ class Assembly(CoreObject):
#so for each output value we check if there was difference in the runs' results
#if yes we output the Confidence Intervals. if not we output just the fix value
json
=
{}
json
[
'_class'
]
=
'Dream.Assembly'
;
json
[
'_class'
]
=
'Dream.Assembly'
;
# TODO: this is the only diff with Machine implementation of this method
json
[
'id'
]
=
str
(
self
.
id
)
json
[
'results'
]
=
{}
json
[
'results'
][
'working_ratio'
]
=
{}
...
...
dream/simulation/LineGenerationJSON.py
View file @
47f3ba06
...
...
@@ -617,16 +617,8 @@ def createObjects():
G
.
ObjList
.
append
(
Q
)
elif
objClass
==
'Dream.Assembly'
:
id
=
element
.
get
(
'id'
,
'not found'
)
name
=
element
.
get
(
'name'
,
'not found'
)
processingTime
=
element
.
get
(
'processingTime'
,
{})
distributionType
=
processingTime
.
get
(
'distributionType'
,
'not found'
)
mean
=
float
(
processingTime
.
get
(
'mean'
)
or
0
)
stdev
=
float
(
processingTime
.
get
(
'stdev'
)
or
0
)
min
=
float
(
processingTime
.
get
(
'min'
)
or
0
)
max
=
float
(
processingTime
.
get
(
'max'
)
or
mean
+
5
*
stdev
)
A
=
Assembly
(
id
,
name
,
distribution
=
distributionType
,
mean
=
mean
,
stdev
=
stdev
,
min
=
min
,
max
=
max
)
A
.
nextIds
=
getSuccessorList
(
id
)
A
=
Assembly
(
**
element
)
A
.
nextIds
=
getSuccessorList
(
element
[
'id'
])
G
.
AssemblyList
.
append
(
A
)
G
.
ObjList
.
append
(
A
)
...
...
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