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
0c461654
Commit
0c461654
authored
Feb 25, 2014
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a trace output button and introduce title & description on properties
parent
a4dba098
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
11 deletions
+57
-11
dream/platform/static/src/dream.js
dream/platform/static/src/dream.js
+6
-5
dream/simulation/GUI/Batches.py
dream/simulation/GUI/Batches.py
+6
-0
dream/simulation/GUI/Default.py
dream/simulation/GUI/Default.py
+45
-6
No files found.
dream/platform/static/src/dream.js
View file @
0c461654
...
...
@@ -64,8 +64,8 @@
if
(
previous_value
.
length
>
0
||
typeof
previous_value
==
"
number
"
)
{
previous_value
=
'
value="
'
+
previous_value
+
'
"
'
;
}
fieldset
.
append
(
"
<label>
"
+
property
.
id
+
"
</label>
"
+
'
<input type="text" name="
'
+
prefix
+
property
.
id
+
'
"
'
+
fieldset
.
append
(
"
<label>
"
+
(
property
.
name
||
property
.
id
)
+
"
</label>
"
+
'
<input t
itle="
'
+
(
property
.
description
||
''
)
+
'
" t
ype="text" name="
'
+
prefix
+
property
.
id
+
'
"
'
+
previous_value
+
'
id="
'
+
prefix
+
property
.
id
+
'
"
'
+
'
class="text ui-widget-content ui-corner-all"/>
'
);
}
...
...
@@ -109,12 +109,13 @@
}
$
.
each
(
property_list
,
function
(
key
,
property
)
{
if
(
property
.
_class
===
"
Dream.Property
"
)
{
previous_value
=
previous_data
[
property
.
id
]
||
""
;
previous_value
=
previous_data
[
property
.
id
]
==
undefined
?
""
:
previous_data
[
property
.
id
];
if
(
previous_value
.
length
>
0
||
typeof
previous_value
==
"
number
"
)
{
previous_value
=
'
value="
'
+
previous_value
+
'
"
'
;
}
fieldset
.
append
(
"
<label>
"
+
prefix
+
property
.
id
+
"
</label>
"
+
'
<input type="text" name="
'
+
prefix
+
property
.
id
+
'
"
'
+
fieldset
.
append
(
"
<label>
"
+
(
property
.
name
||
property
.
id
)
+
"
</label>
"
+
'
<input t
itle="
'
+
(
property
.
description
||
''
)
+
'
" t
ype="text" name="
'
+
prefix
+
property
.
id
+
'
"
'
+
previous_value
+
'
id="
'
+
prefix
+
property
.
id
+
'
"
'
+
'
class="text ui-widget-content ui-corner-all"/>
'
);
...
...
dream/simulation/GUI/Batches.py
View file @
0c461654
...
...
@@ -44,14 +44,20 @@ class Simulation(ShiftsSimulation):
conf
[
"Dream-Configuration"
][
"gui"
][
"exit_stat"
]
=
1
conf
[
"Dream-Configuration"
][
"gui"
][
"debug_json"
]
=
1
conf
[
"Dream-Configuration"
][
"gui"
][
"shift_spreadsheet"
]
=
1
# some more global properties
conf
[
"Dream-Configuration"
][
"property_list"
].
append
(
{
"id"
:
"throughputTarget"
,
"name"
:
"Daily Throughput Target"
,
"description"
:
"The daily throughput target in units."
,
"type"
:
"number"
,
"_class"
:
"Dream.Property"
,
"_default"
:
10
})
conf
[
"Dream-Configuration"
][
"property_list"
].
append
(
{
"id"
:
"desiredPercentageOfSuccess"
,
"name"
:
"Desired Percentage Of Success"
,
"description"
:
"The desired percentage of success to determine if daily"
" throughput target has been met."
,
"type"
:
"number"
,
"_class"
:
"Dream.Property"
,
"_default"
:
0.85
})
...
...
dream/simulation/GUI/Default.py
View file @
0c461654
import
json
import
datetime
from
dream.simulation.LineGenerationJSON
import
main
as
simulate_line_json
from
dream.simulation.Queue
import
Queue
# describe type for properties
schema
=
{
"entity"
:
{
"id"
:
"entity"
,
"name"
:
"Entity Class"
,
"description"
:
"The Class of entity created"
,
"type"
:
"string"
,
"_class"
:
"Dream.Property"
,
"_default"
:
"Dream.Part"
...
...
@@ -12,11 +16,15 @@ schema = {
"mean"
:
{
"id"
:
"mean"
,
"type"
:
"number"
,
"name"
:
"Mean"
,
"description"
:
"Mean value of fixed processing time."
,
"_class"
:
"Dream.Property"
,
"_default"
:
0.9
},
"distributionType"
:
{
"id"
:
"distributionType"
,
"name"
:
"Distribution Type"
,
"description"
:
"The distribution type, one of Fixed, Exp, Normal"
,
"type"
:
"string"
,
"_class"
:
"Dream.Property"
,
"_default"
:
"Fixed"
...
...
@@ -24,36 +32,42 @@ schema = {
"stdev"
:
{
"id"
:
"stdev"
,
"type"
:
"number"
,
"name"
:
"Normal distribution standard deviation"
,
"_class"
:
"Dream.Property"
,
"_default"
:
0.1
},
"min"
:
{
"id"
:
"min"
,
"type"
:
"number"
,
"name"
:
"Normal distribution minimum value"
,
"_class"
:
"Dream.Property"
,
"_default"
:
0.1
},
"max"
:
{
"id"
:
"max"
,
"type"
:
"number"
,
"name"
:
"Normal distribution maximum value"
,
"_class"
:
"Dream.Property"
,
"_default"
:
1
},
"failureDistribution"
:
{
"id"
:
"failureDistribution"
,
"type"
:
"string"
,
"name"
:
"Failures Distribution"
,
"_class"
:
"Dream.Property"
,
"_default"
:
"No"
},
"MTTF"
:
{
"id"
:
"MTTF"
,
"type"
:
"number"
,
"description"
:
"Mean time to failure"
,
"_class"
:
"Dream.Property"
,
"_default"
:
40
},
"MTTR"
:
{
"id"
:
"MTTR"
,
"type"
:
"number"
,
"description"
:
"Mean time to repair"
,
"_class"
:
"Dream.Property"
,
"_default"
:
10
},
...
...
@@ -72,17 +86,22 @@ schema = {
"schedulingRule"
:
{
"id"
:
"schedulingRule"
,
"type"
:
"string"
,
"name"
:
"Scheduling Rule"
,
"description"
:
"Scheduling Rule, one of %s"
%
(
" "
.
join
(
Queue
.
getSupportedSchedulingRules
())),
"_class"
:
"Dream.Property"
,
"_default"
:
"FIFO"
},
"capacity"
:
{
"id"
:
"capacity"
,
"type"
:
"number"
,
"name"
:
"Capacity"
,
"_class"
:
"Dream.Property"
,
"_default"
:
1
},
"numberOfReplications"
:
{
"id"
:
"numberOfReplications"
,
"name"
:
"Number of replications"
,
"type"
:
"number"
,
"_class"
:
"Dream.Property"
,
"_default"
:
10
...
...
@@ -90,30 +109,39 @@ schema = {
"maxSimTime"
:
{
"id"
:
"maxSimTime"
,
"type"
:
"number"
,
"name"
:
"Length of experiment"
,
"_class"
:
"Dream.Property"
,
"_default"
:
100
},
"confidenceLevel"
:
{
"id"
:
"confidenceLevel"
,
"type"
:
"number"
,
"name"
:
"Confidence level"
,
"description"
:
"Confidence level for statiscal analysis of stochastic experiments"
,
"_class"
:
"Dream.Property"
,
"_default"
:
0.5
},
"processTimeout"
:
{
"id"
:
"processTimeout"
,
"type"
:
"number"
,
"name"
:
"Process Timeout"
,
"description"
:
"Number of seconds before the calculation process is interrupted"
,
"_class"
:
"Dream.Property"
,
"_default"
:
10
},
"batchNumberOfUnits"
:
{
"id"
:
"batchNumberOfUnits"
,
"type"
:
"number"
,
"name"
:
"Number of Units"
,
"description"
:
"Number of units of the created batch"
,
"_class"
:
"Dream.Property"
,
"_default"
:
10
},
"numberOfSubBatches"
:
{
"id"
:
"numberOfSubBatches"
,
"type"
:
"number"
,
"name"
:
"Number of sub batches"
,
"description"
:
"Number of sub batches that the batch is split to"
,
"_class"
:
"Dream.Property"
,
"_default"
:
10
},
...
...
@@ -121,7 +149,7 @@ schema = {
"id"
:
"method"
,
"type"
:
"string"
,
"_class"
:
"Dream.Property"
,
"_default"
:
""
"_default"
:
"
Globals.countIntervalThroughput
"
},
"start"
:
{
"id"
:
"start"
,
...
...
@@ -155,9 +183,19 @@ schema = {
},
"currentDate"
:
{
"id"
:
"currentDate"
,
"type"
:
"string"
,
# date in YYYY/MM/DD format
"type"
:
"string"
,
"name"
:
"Simulation Start Time"
,
"description"
:
"The day the experiment starts, in YYYY/MM/DD format"
,
"_class"
:
"Dream.Property"
,
"_default"
:
datetime
.
datetime
.
now
().
strftime
(
'%Y/%M/%d'
)
},
"trace"
:
{
"id"
:
"trace"
,
"name"
:
"Output Trace"
,
"description"
:
"Create an excel trace file (Yes or No)"
,
"type"
:
"string"
,
"_class"
:
"Dream.Property"
,
"_default"
:
""
"_default"
:
"
Yes
"
},
}
...
...
@@ -165,16 +203,16 @@ schema = {
schema
[
"interarrivalTime"
]
=
{
"id"
:
"interarrivalTime"
,
"property_list"
:
[
schema
[
"
mean
"
],
schema
[
"
distributionType
"
]],
schema
[
"
distributionType
"
],
schema
[
"
mean
"
]],
"_class"
:
"Dream.PropertyList"
}
schema
[
"processingTime"
]
=
{
"id"
:
"processingTime"
,
"property_list"
:
[
schema
[
"mean"
],
schema
[
"distributionType"
],
schema
[
"mean"
],
schema
[
"stdev"
],
schema
[
"min"
],
schema
[
"max"
]
...
...
@@ -241,6 +279,7 @@ class Simulation(object):
schema
[
"confidenceLevel"
],
schema
[
"processTimeout"
],
schema
[
"currentDate"
],
schema
[
"trace"
],
],
"gui"
:
{
'debug_json'
:
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