Commit 0c461654 authored by Jérome Perrin's avatar Jérome Perrin

add a trace output button and introduce title & description on properties

parent a4dba098
...@@ -64,8 +64,8 @@ ...@@ -64,8 +64,8 @@
if (previous_value.length > 0 || typeof previous_value == "number") { if (previous_value.length > 0 || typeof previous_value == "number") {
previous_value = ' value="' + previous_value + '"'; previous_value = ' value="' + previous_value + '"';
} }
fieldset.append("<label>" + property.id + "</label>" + fieldset.append("<label>" + (property.name || property.id) + "</label>" +
'<input type="text" name="' + prefix + property.id + '"' + '<input title="' + (property.description || '') + '" type="text" name="' + prefix + property.id + '"' +
previous_value + ' id="' + prefix + property.id + '"' + previous_value + ' id="' + prefix + property.id + '"' +
' class="text ui-widget-content ui-corner-all"/>'); ' class="text ui-widget-content ui-corner-all"/>');
} }
...@@ -109,12 +109,13 @@ ...@@ -109,12 +109,13 @@
} }
$.each(property_list, function (key, property) { $.each(property_list, function (key, property) {
if (property._class === "Dream.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") { if (previous_value.length > 0 || typeof previous_value == "number") {
previous_value = ' value="' + previous_value + '"'; previous_value = ' value="' + previous_value + '"';
} }
fieldset.append("<label>" + prefix + property.id + "</label>" + fieldset.append("<label>" + (property.name || property.id) + "</label>" +
'<input type="text" name="' + prefix + property.id + '"' + '<input title="' + (property.description || '') + '" type="text" name="' + prefix + property.id + '"' +
previous_value + previous_value +
' id="' + prefix + property.id + '"' + ' id="' + prefix + property.id + '"' +
' class="text ui-widget-content ui-corner-all"/>'); ' class="text ui-widget-content ui-corner-all"/>');
......
...@@ -44,14 +44,20 @@ class Simulation(ShiftsSimulation): ...@@ -44,14 +44,20 @@ class Simulation(ShiftsSimulation):
conf["Dream-Configuration"]["gui"]["exit_stat"] = 1 conf["Dream-Configuration"]["gui"]["exit_stat"] = 1
conf["Dream-Configuration"]["gui"]["debug_json"] = 1 conf["Dream-Configuration"]["gui"]["debug_json"] = 1
conf["Dream-Configuration"]["gui"]["shift_spreadsheet"] = 1 conf["Dream-Configuration"]["gui"]["shift_spreadsheet"] = 1
# some more global properties # some more global properties
conf["Dream-Configuration"]["property_list"].append( { conf["Dream-Configuration"]["property_list"].append( {
"id": "throughputTarget", "id": "throughputTarget",
"name": "Daily Throughput Target",
"description": "The daily throughput target in units.",
"type": "number", "type": "number",
"_class": "Dream.Property", "_class": "Dream.Property",
"_default": 10 }) "_default": 10 })
conf["Dream-Configuration"]["property_list"].append( { conf["Dream-Configuration"]["property_list"].append( {
"id": "desiredPercentageOfSuccess", "id": "desiredPercentageOfSuccess",
"name": "Desired Percentage Of Success",
"description": "The desired percentage of success to determine if daily"
" throughput target has been met.",
"type": "number", "type": "number",
"_class": "Dream.Property", "_class": "Dream.Property",
"_default": 0.85 }) "_default": 0.85 })
......
import json import json
import datetime
from dream.simulation.LineGenerationJSON import main as simulate_line_json from dream.simulation.LineGenerationJSON import main as simulate_line_json
from dream.simulation.Queue import Queue
# describe type for properties # describe type for properties
schema = { schema = {
"entity": { "entity": {
"id": "entity", "id": "entity",
"name": "Entity Class",
"description": "The Class of entity created",
"type": "string", "type": "string",
"_class": "Dream.Property", "_class": "Dream.Property",
"_default": "Dream.Part" "_default": "Dream.Part"
...@@ -12,11 +16,15 @@ schema = { ...@@ -12,11 +16,15 @@ schema = {
"mean": { "mean": {
"id": "mean", "id": "mean",
"type": "number", "type": "number",
"name": "Mean",
"description": "Mean value of fixed processing time.",
"_class": "Dream.Property", "_class": "Dream.Property",
"_default": 0.9 "_default": 0.9
}, },
"distributionType": { "distributionType": {
"id": "distributionType", "id": "distributionType",
"name": "Distribution Type",
"description": "The distribution type, one of Fixed, Exp, Normal",
"type": "string", "type": "string",
"_class": "Dream.Property", "_class": "Dream.Property",
"_default": "Fixed" "_default": "Fixed"
...@@ -24,36 +32,42 @@ schema = { ...@@ -24,36 +32,42 @@ schema = {
"stdev": { "stdev": {
"id": "stdev", "id": "stdev",
"type": "number", "type": "number",
"name": "Normal distribution standard deviation",
"_class": "Dream.Property", "_class": "Dream.Property",
"_default": 0.1 "_default": 0.1
}, },
"min": { "min": {
"id": "min", "id": "min",
"type": "number", "type": "number",
"name": "Normal distribution minimum value",
"_class": "Dream.Property", "_class": "Dream.Property",
"_default": 0.1 "_default": 0.1
}, },
"max": { "max": {
"id": "max", "id": "max",
"type": "number", "type": "number",
"name": "Normal distribution maximum value",
"_class": "Dream.Property", "_class": "Dream.Property",
"_default": 1 "_default": 1
}, },
"failureDistribution": { "failureDistribution": {
"id": "failureDistribution", "id": "failureDistribution",
"type": "string", "type": "string",
"name": "Failures Distribution",
"_class": "Dream.Property", "_class": "Dream.Property",
"_default": "No" "_default": "No"
}, },
"MTTF": { "MTTF": {
"id": "MTTF", "id": "MTTF",
"type": "number", "type": "number",
"description": "Mean time to failure",
"_class": "Dream.Property", "_class": "Dream.Property",
"_default": 40 "_default": 40
}, },
"MTTR": { "MTTR": {
"id": "MTTR", "id": "MTTR",
"type": "number", "type": "number",
"description": "Mean time to repair",
"_class": "Dream.Property", "_class": "Dream.Property",
"_default": 10 "_default": 10
}, },
...@@ -72,17 +86,22 @@ schema = { ...@@ -72,17 +86,22 @@ schema = {
"schedulingRule": { "schedulingRule": {
"id": "schedulingRule", "id": "schedulingRule",
"type": "string", "type": "string",
"name": "Scheduling Rule",
"description": "Scheduling Rule, one of %s" % (" ".join(
Queue.getSupportedSchedulingRules())),
"_class": "Dream.Property", "_class": "Dream.Property",
"_default": "FIFO" "_default": "FIFO"
}, },
"capacity": { "capacity": {
"id": "capacity", "id": "capacity",
"type": "number", "type": "number",
"name": "Capacity",
"_class": "Dream.Property", "_class": "Dream.Property",
"_default": 1 "_default": 1
}, },
"numberOfReplications": { "numberOfReplications": {
"id": "numberOfReplications", "id": "numberOfReplications",
"name": "Number of replications",
"type": "number", "type": "number",
"_class": "Dream.Property", "_class": "Dream.Property",
"_default": 10 "_default": 10
...@@ -90,30 +109,39 @@ schema = { ...@@ -90,30 +109,39 @@ schema = {
"maxSimTime": { "maxSimTime": {
"id": "maxSimTime", "id": "maxSimTime",
"type": "number", "type": "number",
"name": "Length of experiment",
"_class": "Dream.Property", "_class": "Dream.Property",
"_default": 100 "_default": 100
}, },
"confidenceLevel": { "confidenceLevel": {
"id": "confidenceLevel", "id": "confidenceLevel",
"type": "number", "type": "number",
"name": "Confidence level",
"description": "Confidence level for statiscal analysis of stochastic experiments",
"_class": "Dream.Property", "_class": "Dream.Property",
"_default": 0.5 "_default": 0.5
}, },
"processTimeout": { "processTimeout": {
"id": "processTimeout", "id": "processTimeout",
"type": "number", "type": "number",
"name": "Process Timeout",
"description": "Number of seconds before the calculation process is interrupted",
"_class": "Dream.Property", "_class": "Dream.Property",
"_default": 10 "_default": 10
}, },
"batchNumberOfUnits": { "batchNumberOfUnits": {
"id": "batchNumberOfUnits", "id": "batchNumberOfUnits",
"type": "number", "type": "number",
"name": "Number of Units",
"description": "Number of units of the created batch",
"_class": "Dream.Property", "_class": "Dream.Property",
"_default": 10 "_default": 10
}, },
"numberOfSubBatches": { "numberOfSubBatches": {
"id": "numberOfSubBatches", "id": "numberOfSubBatches",
"type": "number", "type": "number",
"name": "Number of sub batches",
"description": "Number of sub batches that the batch is split to",
"_class": "Dream.Property", "_class": "Dream.Property",
"_default": 10 "_default": 10
}, },
...@@ -121,7 +149,7 @@ schema = { ...@@ -121,7 +149,7 @@ schema = {
"id": "method", "id": "method",
"type": "string", "type": "string",
"_class": "Dream.Property", "_class": "Dream.Property",
"_default": "" "_default": "Globals.countIntervalThroughput"
}, },
"start": { "start": {
"id": "start", "id": "start",
...@@ -155,9 +183,19 @@ schema = { ...@@ -155,9 +183,19 @@ schema = {
}, },
"currentDate": { "currentDate": {
"id": "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", "_class": "Dream.Property",
"_default": "" "_default": "Yes"
}, },
} }
...@@ -165,16 +203,16 @@ schema = { ...@@ -165,16 +203,16 @@ schema = {
schema["interarrivalTime"] = { schema["interarrivalTime"] = {
"id": "interarrivalTime", "id": "interarrivalTime",
"property_list": [ "property_list": [
schema["mean"], schema["distributionType"],
schema["distributionType"]], schema["mean"]],
"_class": "Dream.PropertyList" "_class": "Dream.PropertyList"
} }
schema["processingTime"] = { schema["processingTime"] = {
"id": "processingTime", "id": "processingTime",
"property_list": [ "property_list": [
schema["mean"],
schema["distributionType"], schema["distributionType"],
schema["mean"],
schema["stdev"], schema["stdev"],
schema["min"], schema["min"],
schema["max"] schema["max"]
...@@ -241,6 +279,7 @@ class Simulation(object): ...@@ -241,6 +279,7 @@ class Simulation(object):
schema["confidenceLevel"], schema["confidenceLevel"],
schema["processTimeout"], schema["processTimeout"],
schema["currentDate"], schema["currentDate"],
schema["trace"],
], ],
"gui": { "gui": {
'debug_json': 0, 'debug_json': 0,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment