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
82c748bf
Commit
82c748bf
authored
Jun 13, 2014
by
Georgios Dagkakis
Committed by
Jérome Perrin
Jun 16, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change so that scrapping mean etc can be read as float
parent
022a0ba9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
dream/simulation/BatchScrapMachine.py
dream/simulation/BatchScrapMachine.py
+1
-1
dream/simulation/LineGenerationJSON.py
dream/simulation/LineGenerationJSON.py
+6
-6
No files found.
dream/simulation/BatchScrapMachine.py
View file @
82c748bf
...
@@ -75,7 +75,7 @@ class BatchScrapMachine(Machine):
...
@@ -75,7 +75,7 @@ class BatchScrapMachine(Machine):
def
removeEntity
(
self
,
entity
=
None
):
def
removeEntity
(
self
,
entity
=
None
):
activeEntity
=
Machine
.
removeEntity
(
self
,
entity
)
activeEntity
=
Machine
.
removeEntity
(
self
,
entity
)
scrapQuantity
=
self
.
scrapRng
.
generateNumber
()
scrapQuantity
=
self
.
scrapRng
.
generateNumber
()
activeEntity
.
numberOfUnits
-=
scrapQuantity
activeEntity
.
numberOfUnits
-=
int
(
scrapQuantity
)
# the scrapQuantity should be integer at whatever case
if
activeEntity
.
numberOfUnits
<
0
:
if
activeEntity
.
numberOfUnits
<
0
:
activeEntity
.
numberOfUnits
==
0
activeEntity
.
numberOfUnits
==
0
return
activeEntity
return
activeEntity
...
...
dream/simulation/LineGenerationJSON.py
View file @
82c748bf
...
@@ -356,10 +356,10 @@ def createObjects():
...
@@ -356,10 +356,10 @@ def createObjects():
processingTime
=
element
.
get
(
'processingTime'
,{})
processingTime
=
element
.
get
(
'processingTime'
,{})
scrapQuantity
=
element
.
get
(
'scrapQuantity'
,
{})
scrapQuantity
=
element
.
get
(
'scrapQuantity'
,
{})
scrapDistributionType
=
scrapQuantity
.
get
(
'distributionType'
,
'not found'
)
scrapDistributionType
=
scrapQuantity
.
get
(
'distributionType'
,
'not found'
)
scrMean
=
in
t
(
scrapQuantity
.
get
(
'mean'
)
or
0
)
scrMean
=
floa
t
(
scrapQuantity
.
get
(
'mean'
)
or
0
)
scrStdev
=
float
(
scrapQuantity
.
get
(
'stdev'
)
or
0
)
scrStdev
=
float
(
scrapQuantity
.
get
(
'stdev'
)
or
0
)
scrMin
=
in
t
(
scrapQuantity
.
get
(
'min'
)
or
0
)
scrMin
=
floa
t
(
scrapQuantity
.
get
(
'min'
)
or
0
)
scrMax
=
in
t
(
scrapQuantity
.
get
(
'max'
)
or
scrMean
+
5
*
scrStdev
)
scrMax
=
floa
t
(
scrapQuantity
.
get
(
'max'
)
or
scrMean
+
5
*
scrStdev
)
failures
=
element
.
get
(
'failures'
,
{})
failures
=
element
.
get
(
'failures'
,
{})
failureDistribution
=
failures
.
get
(
'failureDistribution'
,
'not found'
)
failureDistribution
=
failures
.
get
(
'failureDistribution'
,
'not found'
)
MTTF
=
float
(
failures
.
get
(
'MTTF'
)
or
0
)
MTTF
=
float
(
failures
.
get
(
'MTTF'
)
or
0
)
...
@@ -386,10 +386,10 @@ def createObjects():
...
@@ -386,10 +386,10 @@ def createObjects():
processingTime
=
element
.
get
(
'processingTime'
,
{})
processingTime
=
element
.
get
(
'processingTime'
,
{})
scrapQuantity
=
element
.
get
(
'scrapQuantity'
,
{})
scrapQuantity
=
element
.
get
(
'scrapQuantity'
,
{})
scrapDistributionType
=
scrapQuantity
.
get
(
'distributionType'
,
'not found'
)
scrapDistributionType
=
scrapQuantity
.
get
(
'distributionType'
,
'not found'
)
scrMean
=
in
t
(
scrapQuantity
.
get
(
'mean'
)
or
0
)
scrMean
=
floa
t
(
scrapQuantity
.
get
(
'mean'
)
or
0
)
scrStdev
=
float
(
scrapQuantity
.
get
(
'stdev'
)
or
0
)
scrStdev
=
float
(
scrapQuantity
.
get
(
'stdev'
)
or
0
)
scrMin
=
in
t
(
scrapQuantity
.
get
(
'min'
)
or
0
)
scrMin
=
floa
t
(
scrapQuantity
.
get
(
'min'
)
or
0
)
scrMax
=
in
t
(
scrapQuantity
.
get
(
'max'
)
or
scrMean
+
5
*
scrStdev
)
scrMax
=
floa
t
(
scrapQuantity
.
get
(
'max'
)
or
scrMean
+
5
*
scrStdev
)
failures
=
element
.
get
(
'failures'
,
{})
failures
=
element
.
get
(
'failures'
,
{})
failureDistribution
=
failures
.
get
(
'distributionType'
,
'not found'
)
failureDistribution
=
failures
.
get
(
'distributionType'
,
'not found'
)
MTTF
=
float
(
failures
.
get
(
'MTTF'
)
or
0
)
MTTF
=
float
(
failures
.
get
(
'MTTF'
)
or
0
)
...
...
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