This reverts commit 89d7463e85f42a815ef9a6cead60c40c40a9d49f, reversing changes made to bc352bbc828e158fde841e58e2fa1784664e69f1.
@@ -21,59 +21,36 @@ Element function generic_compile(code : String, port : String):
return read_root()!
Element function compile_code(code : String):
- if (code == "__LOCAL__"):
- Element list
- Integer length
+ String port
+ port = ""
+ while (port == ""):
+ port = comm_connect("compiler")
- list = list_create()
- length = input()
+ comm_set(port, "code")
- while (list_len(list) < length):
- list_append(list, input())
-
- return construct_function_list(list)!
- else:
- String port
- port = ""
- while (port == ""):
- port = comm_connect("compiler")
+ Element list
+ list = generic_compile(code, port)
- comm_set(port, "code")
- list = generic_compile(code, port)
+ if (element_eq(list, read_root())):
+ return read_root()!
- if (element_eq(list, read_root())):
- return read_root()!
+ else:
+ return construct_function_list(list)!
Element function compile_model(code : String, metamodel : Element):
+ sleep(0.5)
+ comm_set(port, "model")
- return construct_model_list(instantiate_model(metamodel), list)!
- sleep(0.5)
- comm_set(port, "model")
+ return construct_model_list(instantiate_model(metamodel), list)!
@@ -893,14 +893,12 @@ Void function enact_PM(pm : Element, mapping : Element):
output("Success")
- log("Prepare for PM enactment...")
// For all entries in the signature, not in the mapping, we add a mock location
Element signature
String mock_location
Element mock_locations
mock_locations = set_create()
signature = PM_signature(pm)
- log("Got signature: " + dict_to_string(signature))
keys = dict_keys(signature)
while (set_len(keys) > 0):
key = set_pop(keys)
@@ -908,23 +906,15 @@ Void function enact_PM(pm : Element, mapping : Element):
// Add mock location
mock_location = ""
while (get_entry_id(mock_location) != ""):
- log("Try to generate")
mock_location = ".tmp/" + random_string(10)
- log("Mock location: " + mock_location)
- log("Got mock location: " + mock_location)
dict_add(mapping, key, mock_location)
- log("Model add...")
cmd_model_add(signature[key], mapping[key], "")
- log("Added model...")
set_add(mock_locations, mock_location)
- log("Got mock location")
- log("Init join")
// Initialize Join counters
counters = dict_create()
join_nodes = allInstances(pm, "Join")
while (set_len(join_nodes) > 0):
- log("Increment counters")
dict_add(counters, set_pop(join_nodes), 0)
// Initialize activity to task dictionary with empty sets
@@ -932,22 +922,18 @@ Void function enact_PM(pm : Element, mapping : Element):
Element task_to_activity
Element task_to_result
- log("Initializing dicts")
activity_to_task = dict_create()
task_to_activity = dict_create()
task_to_result = dict_create()
exec_nodes = allInstances(pm, "Exec")
while (set_len(exec_nodes) > 0):
dict_add(activity_to_task, set_pop(exec_nodes), set_create())
- log("Adding activity to task for node")
// Create the worklist with the Start instance as first element
worklist = set_create()
- log("Fetching all starts")
set_add(worklist, set_pop(allInstances(pm, "Start")))
// Keep on iterating until we reach finish
- log("Prepare done!")
while (True):
// Check if there are PM elements to expand
if (set_len(worklist) > 0):
@@ -957,7 +943,6 @@ Void function enact_PM(pm : Element, mapping : Element):
// Find the type (to see what to do with it)
// this does not yet yield the type of transformation, if it is an Execution
type = read_type(pm, element)
- log("Check element " + element + " of type " + type)
// Some types have nothing to do, such as start and fork
// Therefore, they are not mentioned in the following conditional
@@ -1124,10 +1109,7 @@ String function cmd_model_add(type : String, name : String, code : String):
if (element_eq(mm, read_root())):
return "Type is not typed by formalisms/SimpleClassDiagrams: " + type!
- if (code == ""):
- new_model = instantiate_model(mm)
- new_model = compile_model(code, mm)
+ new_model = compile_model(code, mm)
if (element_eq(new_model, read_root())):
return "Compilation error"!
@@ -1145,7 +1127,6 @@ String function cmd_process_execute(process : String, mapping : Element):
// Execute a process model until it reaches termination
String process_id
- log("Process execute start")
process_id = get_entry_id(process)
if (process_id != ""):
if (allow_read(current_user_id, process_id)):
@@ -1616,15 +1597,6 @@ String function cmd_model_modify(model_name : String, metamodel_name : String):
type_id = set_pop(allAssociationDestinations(core, model_id, "instanceOf"))
if (allow_read(current_user_id, type_id)):
Element new_model
- if (metamodel_name == ""):
- // Try to find the metamodel ourselves, assuming there to be only one!
- Element types
- types = allAssociationDestinations(core, model_id, "instanceOf")
- while (set_len(types) > 0):
- metamodel_name = full_name(set_pop(types))
- break!
new_model = get_full_model(model_id, get_entry_id(metamodel_name))
return "No conformance relation can be found between these models"!
@@ -2386,7 +2358,6 @@ Void function user_function_skip_init(user_id : String):
cmd = input()
- log("Processing cmd " + cmd)
if (cmd == "help"):
output(cmd_help())
elif (cmd == "model_add"):
@@ -2463,8 +2434,7 @@ Void function user_function_skip_init(user_id : String):
return !
elif (cmd == "user_logout"):
// TODO
- output("Success")
- return !
+ cmd = "FAIL"
elif (cmd == "exit"):
// Exit by actually removing the user and decoupling it from all of its models
// Restarting with the same user name will NOT grant you access to anything of the previous user with that same name
@@ -2487,8 +2457,6 @@ Void function user_function_skip_init(user_id : String):
cmd = "FAIL"
elif (cmd == "model_types"):
output(cmd_model_types(single_input("Model name?")))
- elif (cmd == "echo"):
- output(input())
else:
output("Unknown command: " + cmd)
@@ -1,18 +0,0 @@
- read_root: 0.00000286102294922
- read_dict: 0.00000111572760438
- read_dict_keys: 0.00000804585451241
- read_value: 0.00000034615233937
- read_dict_node: 0.00000179092252642
- rule_generation: 0.00000655349476756
- read_dict_edge: 0.00000289815230939
- create_node: 0.00000068492153396
- create_nodevalue: 0.00000092757548643
- create_dict: 0.00000452244578806
- delete_edge: 0.00000288573306975
- delete_node: 0.00000854612362978
- read_reverse_dict: 0.00001803564576967
- create_edge: 0.00000184485407698
- read_outgoing: 0.00000150604374452
- read_incoming: 0.00000178369373520
- read_edge: 0.00000039638876172
- purge: 0.88014233679998488
@@ -1,67 +0,0 @@
-import sys
-operations = {}
-with open(sys.argv[1] if len(sys.argv) > 1 else "calibration/result", 'r') as f:
- for l in f:
- try:
- op, t = l.split(": ")
- if "LOG" in op:
- continue
- t = float(t)
- operations.setdefault(op, []).append(t)
- except:
- pass
-fancy = {"read_root": "read root ID",
- "read_dict": "read dictionary",
- "read_dict_keys": "read dictionary keys",
- "read_value": "read node value",
- "read_dict_node": "read dictionary by node",
- "rule_generation": "rule generation",
- "read_dict_edge": "read dictionary edge",
- "create_node": "create node",
- "create_edge": "create edge",
- "create_nodevalue": "create value",
- "create_dict": "create dictionary",
- "delete_edge": "delete edge",
- "delete_node": "delete node",
- "purge": "garbage collect",
- "read_reverse_dict": "dictionary key lookup",
- "read_outgoing": "read outgoing edges",
- "read_incoming": "read incoming edges",
- "read_edge": "read edge",
- "read_dict_node_edge": "read dictionary edge by node",
- }
-s = 0.0
-with open("calibration/averages", 'w') as averages:
- with open("calibration/plot", 'w') as plot:
- for op in operations:
- avg = sum(operations[op]) / len(operations[op])
- op_max = avg * 3
- new_list = []
- with open("calibration/distribution_%s" % op, 'w') as f:
- for t in operations[op]:
- f.write("%.17f\n" % float(t))
- averages.write("%20s: %.17f\n" % (op, avg))
- plot.write("set terminal postscript enhanced colour portrait size 6,6\n")
- plot.write("set xtics rotate by -45\n")
- plot.write("n = 20\n")
- plot.write("max=%s\n" % op_max)
- plot.write("width=max/n\n")
- plot.write("set boxwidth width absolute\n")
- plot.write("set style fill solid 1.0 noborder\n")
- plot.write("rounded(x)=width*floor(x/width)+width/2\n")
- plot.write("set out 'calibration/plot_%s.eps'\n" % op)
- plot.write("set ylabel 'Frequency (time)'\n")
- plot.write("set xlabel 'Duration (s)'\n")
- plot.write("set title 'Operation %s'\n" % op.replace("_", "\\_"))
- plot.write("plot 'calibration/distribution_%s' u (rounded($1)):(1) smooth freq w boxes title ''\n" % op)
- #print("%s: %s x %s = %s" % (op, avg, len(operations[op]), avg * len(operations[op])))
- print("% -23s&% -23s& %.8f\\\\" % (fancy[op], "{:,}".format(len(operations[op])), avg))
- s += avg * len(operations[op])
-#print("TOTAL: " + str(s))
@@ -1,234 +0,0 @@
-set terminal postscript enhanced colour portrait size 6,6
-set xtics rotate by -45
-n = 20
-max=8.58306884766e-06
-width=max/n
-set boxwidth width absolute
-set style fill solid 1.0 noborder
-rounded(x)=width*floor(x/width)+width/2
-set out 'calibration/plot_read_root.eps'
-set ylabel 'Frequency (time)'
-set xlabel 'Duration (s)'
-set title 'Operation read\_root'
-plot 'calibration/distribution_read_root' u (rounded($1)):(1) smooth freq w boxes title ''
-max=3.34718281313e-06
-set out 'calibration/plot_read_dict.eps'
-set title 'Operation read\_dict'
-plot 'calibration/distribution_read_dict' u (rounded($1)):(1) smooth freq w boxes title ''
-max=2.41375635372e-05
-set out 'calibration/plot_read_dict_keys.eps'
-set title 'Operation read\_dict\_keys'
-plot 'calibration/distribution_read_dict_keys' u (rounded($1)):(1) smooth freq w boxes title ''
-max=1.03845701811e-06
-set out 'calibration/plot_read_value.eps'
-set title 'Operation read\_value'
-plot 'calibration/distribution_read_value' u (rounded($1)):(1) smooth freq w boxes title ''
-max=5.37276757927e-06
-set out 'calibration/plot_read_dict_node.eps'
-set title 'Operation read\_dict\_node'
-plot 'calibration/distribution_read_dict_node' u (rounded($1)):(1) smooth freq w boxes title ''
-max=1.96604843027e-05
-set out 'calibration/plot_rule_generation.eps'
-set title 'Operation rule\_generation'
-plot 'calibration/distribution_rule_generation' u (rounded($1)):(1) smooth freq w boxes title ''
-max=8.69445692818e-06
-set out 'calibration/plot_read_dict_edge.eps'
-set title 'Operation read\_dict\_edge'
-plot 'calibration/distribution_read_dict_edge' u (rounded($1)):(1) smooth freq w boxes title ''
-max=2.05476460188e-06
-set out 'calibration/plot_create_node.eps'
-set title 'Operation create\_node'
-plot 'calibration/distribution_create_node' u (rounded($1)):(1) smooth freq w boxes title ''
-max=2.78272645929e-06
-set out 'calibration/plot_create_nodevalue.eps'
-set title 'Operation create\_nodevalue'
-plot 'calibration/distribution_create_nodevalue' u (rounded($1)):(1) smooth freq w boxes title ''
-max=1.35673373642e-05
-set out 'calibration/plot_create_dict.eps'
-set title 'Operation create\_dict'
-plot 'calibration/distribution_create_dict' u (rounded($1)):(1) smooth freq w boxes title ''
-max=8.65719920925e-06
-set out 'calibration/plot_delete_edge.eps'
-set title 'Operation delete\_edge'
-plot 'calibration/distribution_delete_edge' u (rounded($1)):(1) smooth freq w boxes title ''
-max=2.56383708893e-05
-set out 'calibration/plot_delete_node.eps'
-set title 'Operation delete\_node'
-plot 'calibration/distribution_delete_node' u (rounded($1)):(1) smooth freq w boxes title ''
-max=5.4106937309e-05
-set out 'calibration/plot_read_reverse_dict.eps'
-set title 'Operation read\_reverse\_dict'
-plot 'calibration/distribution_read_reverse_dict' u (rounded($1)):(1) smooth freq w boxes title ''
-max=5.53456223095e-06
-set out 'calibration/plot_create_edge.eps'
-set title 'Operation create\_edge'
-plot 'calibration/distribution_create_edge' u (rounded($1)):(1) smooth freq w boxes title ''
-max=4.51813123356e-06
-set out 'calibration/plot_read_outgoing.eps'
-set title 'Operation read\_outgoing'
-plot 'calibration/distribution_read_outgoing' u (rounded($1)):(1) smooth freq w boxes title ''
-max=5.35108120561e-06
-set out 'calibration/plot_read_incoming.eps'
-set title 'Operation read\_incoming'
-plot 'calibration/distribution_read_incoming' u (rounded($1)):(1) smooth freq w boxes title ''
-max=1.18916628515e-06
-set out 'calibration/plot_read_edge.eps'
-set title 'Operation read\_edge'
-plot 'calibration/distribution_read_edge' u (rounded($1)):(1) smooth freq w boxes title ''
-max=2.6404270104
-set out 'calibration/plot_purge.eps'
-set title 'Operation purge'
-plot 'calibration/distribution_purge' u (rounded($1)):(1) smooth freq w boxes title ''
@@ -1,792 +0,0 @@
-%!PS-Adobe-2.0
-%%Title: calibration/plot_create_dict.eps
-%%Creator: gnuplot 5.0 patchlevel 6 (Gentoo revision r0)
-%%CreationDate: Mon Dec 18 14:16:34 2017
-%%DocumentFonts: (atend)
-%%BoundingBox: 50 50 482 482
-%%Orientation: Portrait
-%%Pages: (atend)
-%%EndComments
-%%BeginProlog
-/gnudict 256 dict def
-gnudict begin
-%
-% The following true/false flags may be edited by hand if desired.
-% The unit line width and grayscale image gamma correction may also be changed.
-/Color true def
-/Blacktext false def
-/Solid false def
-/Dashlength 1 def
-/Landscape false def
-/Level1 false def
-/Level3 false def
-/Rounded false def
-/ClipToBoundingBox false def
-/SuppressPDFMark false def
-/TransparentPatterns false def
-/gnulinewidth 5.000 def
-/userlinewidth gnulinewidth def
-/Gamma 1.0 def
-/BackgroundColor {-1.000 -1.000 -1.000} def
-/vshift -46 def
-/dl1 {
- 10.0 Dashlength userlinewidth gnulinewidth div mul mul mul
- Rounded { currentlinewidth 0.75 mul sub dup 0 le { pop 0.01 } if } if
-} def
-/dl2 {
- Rounded { currentlinewidth 0.75 mul add } if
-/hpt_ 31.5 def
-/vpt_ 31.5 def
-/hpt hpt_ def
-/vpt vpt_ def
-/doclip {
- ClipToBoundingBox {
- newpath 50 50 moveto 482 50 lineto 482 482 lineto 50 482 lineto closepath
- clip
- } if
-% Gnuplot Prolog Version 5.1 (Oct 2015)
-%/SuppressPDFMark true def
-/M {moveto} bind def
-/L {lineto} bind def
-/R {rmoveto} bind def
-/V {rlineto} bind def
-/N {newpath moveto} bind def
-/Z {closepath} bind def
-/C {setrgbcolor} bind def
-/f {rlineto fill} bind def
-/g {setgray} bind def
-/Gshow {show} def % May be redefined later in the file to support UTF-8
-/vpt2 vpt 2 mul def
-/hpt2 hpt 2 mul def
-/Lshow {currentpoint stroke M 0 vshift R
- Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def
-/Rshow {currentpoint stroke M dup stringwidth pop neg vshift R
-/Cshow {currentpoint stroke M dup stringwidth pop -2 div vshift R
-/UP {dup vpt_ mul /vpt exch def hpt_ mul /hpt exch def
- /hpt2 hpt 2 mul def /vpt2 vpt 2 mul def} def
-/DL {Color {setrgbcolor Solid {pop []} if 0 setdash}
- {pop pop pop 0 setgray Solid {pop []} if 0 setdash} ifelse} def
-/BL {stroke userlinewidth 2 mul setlinewidth
- Rounded {1 setlinejoin 1 setlinecap} if} def
-/AL {stroke userlinewidth 2 div setlinewidth
-/UL {dup gnulinewidth mul /userlinewidth exch def
- dup 1 lt {pop 1} if 10 mul /udl exch def} def
-/PL {stroke userlinewidth setlinewidth
-3.8 setmiterlimit
-% Classic Line colors (version 5.0)
-/LCw {1 1 1} def
-/LCb {0 0 0} def
-/LCa {0 0 0} def
-/LC0 {1 0 0} def
-/LC1 {0 1 0} def
-/LC2 {0 0 1} def
-/LC3 {1 0 1} def
-/LC4 {0 1 1} def
-/LC5 {1 1 0} def
-/LC6 {0 0 0} def
-/LC7 {1 0.3 0} def
-/LC8 {0.5 0.5 0.5} def
-% Default dash patterns (version 5.0)
-/LTB {BL [] LCb DL} def
-/LTw {PL [] 1 setgray} def
-/LTb {PL [] LCb DL} def
-/LTa {AL [1 udl mul 2 udl mul] 0 setdash LCa setrgbcolor} def
-/LT0 {PL [] LC0 DL} def
-/LT1 {PL [2 dl1 3 dl2] LC1 DL} def
-/LT2 {PL [1 dl1 1.5 dl2] LC2 DL} def
-/LT3 {PL [6 dl1 2 dl2 1 dl1 2 dl2] LC3 DL} def
-/LT4 {PL [1 dl1 2 dl2 6 dl1 2 dl2 1 dl1 2 dl2] LC4 DL} def
-/LT5 {PL [4 dl1 2 dl2] LC5 DL} def
-/LT6 {PL [1.5 dl1 1.5 dl2 1.5 dl1 1.5 dl2 1.5 dl1 6 dl2] LC6 DL} def
-/LT7 {PL [3 dl1 3 dl2 1 dl1 3 dl2] LC7 DL} def
-/LT8 {PL [2 dl1 2 dl2 2 dl1 6 dl2] LC8 DL} def
-/SL {[] 0 setdash} def
-/Pnt {stroke [] 0 setdash gsave 1 setlinecap M 0 0 V stroke grestore} def
-/Dia {stroke [] 0 setdash 2 copy vpt add M
- hpt neg vpt neg V hpt vpt neg V
- hpt vpt V hpt neg vpt V closepath stroke
- Pnt} def
-/Pls {stroke [] 0 setdash vpt sub M 0 vpt2 V
- currentpoint stroke M
- hpt neg vpt neg R hpt2 0 V stroke
- } def
-/Box {stroke [] 0 setdash 2 copy exch hpt sub exch vpt add M
- 0 vpt2 neg V hpt2 0 V 0 vpt2 V
- hpt2 neg 0 V closepath stroke
-/Crs {stroke [] 0 setdash exch hpt sub exch vpt add M
- hpt2 vpt2 neg V currentpoint stroke M
- hpt2 neg 0 R hpt2 vpt2 V stroke} def
-/TriU {stroke [] 0 setdash 2 copy vpt 1.12 mul add M
- hpt neg vpt -1.62 mul V
- hpt 2 mul 0 V
- hpt neg vpt 1.62 mul V closepath stroke
-/Star {2 copy Pls Crs} def
-/BoxF {stroke [] 0 setdash exch hpt sub exch vpt add M
- hpt2 neg 0 V closepath fill} def
-/TriUF {stroke [] 0 setdash vpt 1.12 mul add M
- hpt neg vpt 1.62 mul V closepath fill} def
-/TriD {stroke [] 0 setdash 2 copy vpt 1.12 mul sub M
- hpt neg vpt 1.62 mul V
- hpt neg vpt -1.62 mul V closepath stroke
-/TriDF {stroke [] 0 setdash vpt 1.12 mul sub M
- hpt neg vpt -1.62 mul V closepath fill} def
-/DiaF {stroke [] 0 setdash vpt add M
- hpt vpt V hpt neg vpt V closepath fill} def
-/Pent {stroke [] 0 setdash 2 copy gsave
- translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
- closepath stroke grestore Pnt} def
-/PentF {stroke [] 0 setdash gsave
- closepath fill grestore} def
-/Circle {stroke [] 0 setdash 2 copy
- hpt 0 360 arc stroke Pnt} def
-/CircleF {stroke [] 0 setdash hpt 0 360 arc fill} def
-/C0 {BL [] 0 setdash 2 copy moveto vpt 90 450 arc} bind def
-/C1 {BL [] 0 setdash 2 copy moveto
- 2 copy vpt 0 90 arc closepath fill
- vpt 0 360 arc closepath} bind def
-/C2 {BL [] 0 setdash 2 copy moveto
- 2 copy vpt 90 180 arc closepath fill
-/C3 {BL [] 0 setdash 2 copy moveto
- 2 copy vpt 0 180 arc closepath fill
-/C4 {BL [] 0 setdash 2 copy moveto
- 2 copy vpt 180 270 arc closepath fill
-/C5 {BL [] 0 setdash 2 copy moveto
- 2 copy vpt 0 90 arc
- 2 copy moveto
- vpt 0 360 arc} bind def
-/C6 {BL [] 0 setdash 2 copy moveto
- 2 copy vpt 90 270 arc closepath fill
-/C7 {BL [] 0 setdash 2 copy moveto
- 2 copy vpt 0 270 arc closepath fill
-/C8 {BL [] 0 setdash 2 copy moveto
- 2 copy vpt 270 360 arc closepath fill
-/C9 {BL [] 0 setdash 2 copy moveto
- 2 copy vpt 270 450 arc closepath fill
-/C10 {BL [] 0 setdash 2 copy 2 copy moveto vpt 270 360 arc closepath fill
-/C11 {BL [] 0 setdash 2 copy moveto
-/C12 {BL [] 0 setdash 2 copy moveto
- 2 copy vpt 180 360 arc closepath fill
-/C13 {BL [] 0 setdash 2 copy moveto
-/C14 {BL [] 0 setdash 2 copy moveto
- 2 copy vpt 90 360 arc closepath fill
-/C15 {BL [] 0 setdash 2 copy vpt 0 360 arc closepath fill
-/Rec {newpath 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto
- neg 0 rlineto closepath} bind def
-/Square {dup Rec} bind def
-/Bsquare {vpt sub exch vpt sub exch vpt2 Square} bind def
-/S0 {BL [] 0 setdash 2 copy moveto 0 vpt rlineto BL Bsquare} bind def
-/S1 {BL [] 0 setdash 2 copy vpt Square fill Bsquare} bind def
-/S2 {BL [] 0 setdash 2 copy exch vpt sub exch vpt Square fill Bsquare} bind def
-/S3 {BL [] 0 setdash 2 copy exch vpt sub exch vpt2 vpt Rec fill Bsquare} bind def
-/S4 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt Square fill Bsquare} bind def
-/S5 {BL [] 0 setdash 2 copy 2 copy vpt Square fill
- exch vpt sub exch vpt sub vpt Square fill Bsquare} bind def
-/S6 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt vpt2 Rec fill Bsquare} bind def
-/S7 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt vpt2 Rec fill
- 2 copy vpt Square fill Bsquare} bind def
-/S8 {BL [] 0 setdash 2 copy vpt sub vpt Square fill Bsquare} bind def
-/S9 {BL [] 0 setdash 2 copy vpt sub vpt vpt2 Rec fill Bsquare} bind def
-/S10 {BL [] 0 setdash 2 copy vpt sub vpt Square fill 2 copy exch vpt sub exch vpt Square fill
- Bsquare} bind def
-/S11 {BL [] 0 setdash 2 copy vpt sub vpt Square fill 2 copy exch vpt sub exch vpt2 vpt Rec fill
-/S12 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill Bsquare} bind def
-/S13 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill
-/S14 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill
- 2 copy exch vpt sub exch vpt Square fill Bsquare} bind def
-/S15 {BL [] 0 setdash 2 copy Bsquare fill Bsquare} bind def
-/D0 {gsave translate 45 rotate 0 0 S0 stroke grestore} bind def
-/D1 {gsave translate 45 rotate 0 0 S1 stroke grestore} bind def
-/D2 {gsave translate 45 rotate 0 0 S2 stroke grestore} bind def
-/D3 {gsave translate 45 rotate 0 0 S3 stroke grestore} bind def
-/D4 {gsave translate 45 rotate 0 0 S4 stroke grestore} bind def
-/D5 {gsave translate 45 rotate 0 0 S5 stroke grestore} bind def
-/D6 {gsave translate 45 rotate 0 0 S6 stroke grestore} bind def
-/D7 {gsave translate 45 rotate 0 0 S7 stroke grestore} bind def
-/D8 {gsave translate 45 rotate 0 0 S8 stroke grestore} bind def
-/D9 {gsave translate 45 rotate 0 0 S9 stroke grestore} bind def
-/D10 {gsave translate 45 rotate 0 0 S10 stroke grestore} bind def
-/D11 {gsave translate 45 rotate 0 0 S11 stroke grestore} bind def
-/D12 {gsave translate 45 rotate 0 0 S12 stroke grestore} bind def
-/D13 {gsave translate 45 rotate 0 0 S13 stroke grestore} bind def
-/D14 {gsave translate 45 rotate 0 0 S14 stroke grestore} bind def
-/D15 {gsave translate 45 rotate 0 0 S15 stroke grestore} bind def
-/DiaE {stroke [] 0 setdash vpt add M
- hpt vpt V hpt neg vpt V closepath stroke} def
-/BoxE {stroke [] 0 setdash exch hpt sub exch vpt add M
- hpt2 neg 0 V closepath stroke} def
-/TriUE {stroke [] 0 setdash vpt 1.12 mul add M
- hpt neg vpt 1.62 mul V closepath stroke} def
-/TriDE {stroke [] 0 setdash vpt 1.12 mul sub M
- hpt neg vpt -1.62 mul V closepath stroke} def
-/PentE {stroke [] 0 setdash gsave
- closepath stroke grestore} def
-/CircE {stroke [] 0 setdash
- hpt 0 360 arc stroke} def
-/Opaque {gsave closepath 1 setgray fill grestore 0 setgray closepath} def
-/DiaW {stroke [] 0 setdash vpt add M
- hpt vpt V hpt neg vpt V Opaque stroke} def
-/BoxW {stroke [] 0 setdash exch hpt sub exch vpt add M
- hpt2 neg 0 V Opaque stroke} def
-/TriUW {stroke [] 0 setdash vpt 1.12 mul add M
- hpt neg vpt 1.62 mul V Opaque stroke} def
-/TriDW {stroke [] 0 setdash vpt 1.12 mul sub M
- hpt neg vpt -1.62 mul V Opaque stroke} def
-/PentW {stroke [] 0 setdash gsave
- Opaque stroke grestore} def
-/CircW {stroke [] 0 setdash
- hpt 0 360 arc Opaque stroke} def
-/BoxFill {gsave Rec 1 setgray fill grestore} def
-/Density {
- /Fillden exch def
- currentrgbcolor
- /ColB exch def /ColG exch def /ColR exch def
- /ColR ColR Fillden mul Fillden sub 1 add def
- /ColG ColG Fillden mul Fillden sub 1 add def
- /ColB ColB Fillden mul Fillden sub 1 add def
- ColR ColG ColB setrgbcolor} def
-/BoxColFill {gsave Rec PolyFill} def
-/PolyFill {gsave Density fill grestore grestore} def
-/h {rlineto rlineto rlineto gsave closepath fill grestore} bind def
-% PostScript Level 1 Pattern Fill routine for rectangles
-% Usage: x y w h s a XX PatternFill
-% x,y = lower left corner of box to be filled
-% w,h = width and height of box
-% a = angle in degrees between lines and x-axis
-% XX = 0/1 for no/yes cross-hatch
-/PatternFill {gsave /PFa [ 9 2 roll ] def
- PFa 0 get PFa 2 get 2 div add PFa 1 get PFa 3 get 2 div add translate
- PFa 2 get -2 div PFa 3 get -2 div PFa 2 get PFa 3 get Rec
- TransparentPatterns {} {gsave 1 setgray fill grestore} ifelse
- currentlinewidth 0.5 mul setlinewidth
- /PFs PFa 2 get dup mul PFa 3 get dup mul add sqrt def
- 0 0 M PFa 5 get rotate PFs -2 div dup translate
- 0 1 PFs PFa 4 get div 1 add floor cvi
- {PFa 4 get mul 0 M 0 PFs V} for
- 0 PFa 6 get ne {
- {PFa 4 get mul 0 2 1 roll M PFs 0 V} for
- stroke grestore} def
-/languagelevel where
- {pop languagelevel} {1} ifelse
-dup 2 lt
- {/InterpretLevel1 true def
- /InterpretLevel3 false def}
- {/InterpretLevel1 Level1 def
- 2 gt
- {/InterpretLevel3 Level3 def}
- {/InterpretLevel3 false def}
- ifelse }
- ifelse
-% PostScript level 2 pattern fill definitions
-/Level2PatternFill {
-/Tile8x8 {/PaintType 2 /PatternType 1 /TilingType 1 /BBox [0 0 8 8] /XStep 8 /YStep 8}
- bind def
-/KeepColor {currentrgbcolor [/Pattern /DeviceRGB] setcolorspace} bind def
-<< Tile8x8
- /PaintProc {0.5 setlinewidth pop 0 0 M 8 8 L 0 8 M 8 0 L stroke}
->> matrix makepattern
-/Pat1 exch def
- /PaintProc {0.5 setlinewidth pop 0 0 M 8 8 L 0 8 M 8 0 L stroke
- 0 4 M 4 8 L 8 4 L 4 0 L 0 4 L stroke}
-/Pat2 exch def
- /PaintProc {0.5 setlinewidth pop 0 0 M 0 8 L
- 8 8 L 8 0 L 0 0 L fill}
-/Pat3 exch def
- /PaintProc {0.5 setlinewidth pop -4 8 M 8 -4 L
- 0 12 M 12 0 L stroke}
-/Pat4 exch def
- /PaintProc {0.5 setlinewidth pop -4 0 M 8 12 L
- 0 -4 M 12 8 L stroke}
-/Pat5 exch def
- /PaintProc {0.5 setlinewidth pop -2 8 M 4 -4 L
- 0 12 M 8 -4 L 4 12 M 10 0 L stroke}
-/Pat6 exch def
- /PaintProc {0.5 setlinewidth pop -2 0 M 4 12 L
- 0 -4 M 8 12 L 4 -4 M 10 8 L stroke}
-/Pat7 exch def
- /PaintProc {0.5 setlinewidth pop 8 -2 M -4 4 L
- 12 0 M -4 8 L 12 4 M 0 10 L stroke}
-/Pat8 exch def
- /PaintProc {0.5 setlinewidth pop 0 -2 M 12 4 L
- -4 0 M 12 8 L -4 4 M 8 10 L stroke}
-/Pat9 exch def
-/Pattern1 {PatternBgnd KeepColor Pat1 setpattern} bind def
-/Pattern2 {PatternBgnd KeepColor Pat2 setpattern} bind def
-/Pattern3 {PatternBgnd KeepColor Pat3 setpattern} bind def
-/Pattern4 {PatternBgnd KeepColor Landscape {Pat5} {Pat4} ifelse setpattern} bind def
-/Pattern5 {PatternBgnd KeepColor Landscape {Pat4} {Pat5} ifelse setpattern} bind def
-/Pattern6 {PatternBgnd KeepColor Landscape {Pat9} {Pat6} ifelse setpattern} bind def
-/Pattern7 {PatternBgnd KeepColor Landscape {Pat8} {Pat7} ifelse setpattern} bind def
-%End of PostScript Level 2 code
-/PatternBgnd {
-% Substitute for Level 2 pattern fill codes with
-% grayscale if Level 2 support is not selected.
-/Level1PatternFill {
-/Pattern1 {0.250 Density} bind def
-/Pattern2 {0.500 Density} bind def
-/Pattern3 {0.750 Density} bind def
-/Pattern4 {0.125 Density} bind def
-/Pattern5 {0.375 Density} bind def
-/Pattern6 {0.625 Density} bind def
-/Pattern7 {0.875 Density} bind def
-% Now test for support of Level 2 code
-Level1 {Level1PatternFill} {Level2PatternFill} ifelse
-/Symbol-Oblique /Symbol findfont [1 0 .167 1 0 0] makefont
-dup length dict begin {1 index /FID eq {pop pop} {def} ifelse} forall
-currentdict end definefont pop
-/MFshow {
- { dup 5 get 3 ge
- { 5 get 3 eq {gsave} {grestore} ifelse }
- {dup dup 0 get findfont exch 1 get scalefont setfont
- [ currentpoint ] exch dup 2 get 0 exch R dup 5 get 2 ne {dup dup 6
- get exch 4 get {textshow} {stringwidth pop 0 R} ifelse }if dup 5 get 0 eq
- {dup 3 get {2 get neg 0 exch R pop} {pop aload pop M} ifelse} {dup 5
- get 1 eq {dup 2 get exch dup 3 get exch 6 get stringwidth pop -2 div
- dup 0 R} {dup 6 get stringwidth pop -2 div 0 R 6 get
- textshow 2 index {aload pop M neg 3 -1 roll neg R pop pop} {pop pop pop
- pop aload pop M} ifelse }ifelse }ifelse }
- forall} def
-/Gswidth {dup type /stringtype eq {stringwidth} {pop (n) stringwidth} ifelse} def
-/MFwidth {0 exch { dup 5 get 3 ge { 5 get 3 eq { 0 } { pop } ifelse }
- {dup 3 get{dup dup 0 get findfont exch 1 get scalefont setfont
- 6 get Gswidth pop add} {pop} ifelse} ifelse} forall} def
-/MLshow { currentpoint stroke M
- 0 exch R
- Blacktext {gsave 0 setgray MFshow grestore} {MFshow} ifelse } bind def
-/MRshow { currentpoint stroke M
- exch dup MFwidth neg 3 -1 roll R
-/MCshow { currentpoint stroke M
- exch dup MFwidth -2 div 3 -1 roll R
-/XYsave { [( ) 1 2 true false 3 ()] } bind def
-/XYrestore { [( ) 1 2 true false 4 ()] } bind def
-Level1 SuppressPDFMark or
-{} {
-/SDict 10 dict def
-systemdict /pdfmark known not {
- userdict /pdfmark systemdict /cleartomark get put
-} if
-SDict begin [
- /Title (calibration/plot_create_dict.eps)
- /Subject (gnuplot plot)
- /Creator (gnuplot 5.0 patchlevel 6 (Gentoo revision r0))
- /Author (yentl)
-% /Producer (gnuplot)
-% /Keywords ()
- /CreationDate (Mon Dec 18 14:16:34 2017)
- /DOCINFO pdfmark
-end
-} ifelse
-% Support for boxed text - Ethan A Merritt May 2005
-/InitTextBox { userdict /TBy2 3 -1 roll put userdict /TBx2 3 -1 roll put
- userdict /TBy1 3 -1 roll put userdict /TBx1 3 -1 roll put
- /Boxing true def } def
-/ExtendTextBox { Boxing
- { gsave dup false charpath pathbbox
- dup TBy2 gt {userdict /TBy2 3 -1 roll put} {pop} ifelse
- dup TBx2 gt {userdict /TBx2 3 -1 roll put} {pop} ifelse
- dup TBy1 lt {userdict /TBy1 3 -1 roll put} {pop} ifelse
- dup TBx1 lt {userdict /TBx1 3 -1 roll put} {pop} ifelse
- grestore } if } def
-/PopTextBox { newpath TBx1 TBxmargin sub TBy1 TBymargin sub M
- TBx1 TBxmargin sub TBy2 TBymargin add L
- TBx2 TBxmargin add TBy2 TBymargin add L
- TBx2 TBxmargin add TBy1 TBymargin sub L closepath } def
-/DrawTextBox { PopTextBox stroke /Boxing false def} def
-/FillTextBox { gsave PopTextBox 1 1 1 setrgbcolor fill grestore /Boxing false def} def
-0 0 0 0 InitTextBox
-/TBxmargin 20 def
-/TBymargin 20 def
-/Boxing false def
-/textshow { ExtendTextBox Gshow } def
-% redundant definitions for compatibility with prologue.ps older than 5.0.2
-%%EndProlog
-%%Page: 1 1
-gsave
-doclip
-50 50 translate
-0.100 0.100 scale
-0 setgray
-newpath
-(Helvetica) findfont 140 scalefont setfont
-BackgroundColor 0 lt 3 1 roll 0 lt exch 0 lt or or not {gsave BackgroundColor C clippath fill grestore} if
-1.000 UL
-LTb
-LCb setrgbcolor
-854 783 M
-63 0 V
-3150 0 R
--63 0 V
-stroke
-770 783 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 0)]
-] -46.7 MRshow
-854 1173 M
-770 1173 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 5000)]
-854 1562 M
-770 1562 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 10000)]
-854 1952 M
-770 1952 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 15000)]
-854 2341 M
-770 2341 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 20000)]
-854 2731 M
-770 2731 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 25000)]
-854 3120 M
-770 3120 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 30000)]
-854 3510 M
-770 3510 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 35000)]
-854 3899 M
-770 3899 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 40000)]
-0 63 V
-0 3053 R
-0 -63 V
-854 699 M
-currentpoint gsave translate -45 rotate 0 0 moveto
-] -46.7 MLshow
-grestore
-1390 783 M
-1390 699 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 5x10)]
-[(Helvetica) 112.0 70.0 true true 0 (-6)]
-] -60.7 MLshow
-1925 783 M
-1925 699 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 1x10)]
-[(Helvetica) 112.0 70.0 true true 0 (-5)]
-2461 783 M
-2461 699 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 1.5x10)]
-2996 783 M
-2996 699 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 2x10)]
-3531 783 M
-3531 699 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 2.5x10)]
-4067 783 M
-4067 699 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 3x10)]
-LTB
-854 3899 N
-854 783 L
-3213 0 V
-0 3116 V
--3213 0 V
-Z stroke
-1.000 UP
-112 2341 M
-currentpoint gsave translate -270 rotate 0 0 moveto
-[ [(Helvetica) 140.0 0.0 true true 0 (Frequency \(time\))]
-] -46.7 MCshow
-2460 98 M
-[ [(Helvetica) 140.0 0.0 true true 0 (Duration \(s\))]
-2460 4109 M
-[ [(Helvetica) 140.0 0.0 true true 0 (Operation create_dict)]
-% Begin plot #1
-0.58 0.00 0.83 C 1.000 998 783 146 6 BoxColFill
-1.000 1143 783 145 533 BoxColFill
-1.000 1287 783 146 2887 BoxColFill
-1.000 1432 783 145 1591 BoxColFill
-1.000 1576 783 146 739 BoxColFill
-1.000 1721 783 145 178 BoxColFill
-1.000 1865 783 145 32 BoxColFill
-1.000 2009 783 146 31 BoxColFill
-1.000 2154 783 145 16 BoxColFill
-1.000 2298 783 146 20 BoxColFill
-1.000 2443 783 145 43 BoxColFill
-1.000 2587 783 146 25 BoxColFill
-1.000 2732 783 145 26 BoxColFill
-1.000 2876 783 145 25 BoxColFill
-1.000 3020 783 146 18 BoxColFill
-1.000 3165 783 145 43 BoxColFill
-1.000 3309 783 146 47 BoxColFill
-1.000 3454 783 145 31 BoxColFill
-1.000 3598 783 145 51 BoxColFill
-% End plot #1
-2.000 UL
-showpage
-%%Trailer
-%%DocumentFonts: Helvetica
-%%Pages: 1
@@ -1,782 +0,0 @@
-%%Title: calibration/plot_create_edge.eps
- /Title (calibration/plot_create_edge.eps)
-854 1302 M
-770 1302 M
-854 1822 M
-770 1822 M
-854 2860 M
-770 2860 M
-854 3380 M
-770 3380 M
-1313 783 M
-1313 699 M
-1772 783 M
-1772 699 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 4x10)]
-2231 783 M
-2231 699 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 6x10)]
-2690 783 M
-2690 699 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 8x10)]
-3149 783 M
-3149 699 M
-3608 783 M
-3608 699 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 1.2x10)]
-[ [(Helvetica) 140.0 0.0 true true 0 ( 1.4x10)]
-[ [(Helvetica) 140.0 0.0 true true 0 (Operation create_edge)]
-0.58 0.00 0.83 C 1.000 1010 783 157 171 BoxColFill
-1.000 1166 783 156 2473 BoxColFill
-1.000 1321 783 157 1516 BoxColFill
-1.000 1477 783 157 2880 BoxColFill
-1.000 1633 783 157 844 BoxColFill
-1.000 1945 783 157 163 BoxColFill
-1.000 2101 783 156 34 BoxColFill
-1.000 2256 783 157 7 BoxColFill
-1.000 2412 783 157 26 BoxColFill
-1.000 2568 783 157 24 BoxColFill
-1.000 2724 783 157 7 BoxColFill
-1.000 2880 783 156 26 BoxColFill
-1.000 3035 783 157 69 BoxColFill
-1.000 3347 783 157 23 BoxColFill
-1.000 3503 783 157 17 BoxColFill
-1.000 3659 783 157 8 BoxColFill
-1.000 3815 783 156 8 BoxColFill
@@ -1,791 +0,0 @@
-%%Title: calibration/plot_create_node.eps
- /Title (calibration/plot_create_node.eps)
-854 664 M
-770 664 M
-854 1203 M
-770 1203 M
-854 1742 M
-770 1742 M
-854 2282 M
-770 2282 M
-854 2821 M
-770 2821 M
-854 3360 M
-770 3360 M
-0 3172 R
-854 580 M
-1256 664 M
-1256 580 M
-1657 664 M
-1657 580 M
-2059 664 M
-2059 580 M
-2461 664 M
-2461 580 M
-2862 664 M
-2862 580 M
-3264 664 M
-3264 580 M
-3665 664 M
-3665 580 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 7x10)]
-4067 664 M
-4067 580 M
-854 664 L
-0 3235 V
-112 2281 M
-[ [(Helvetica) 140.0 0.0 true true 0 (Operation create_node)]
-0.58 0.00 0.83 C 1.000 1138 664 143 1710 BoxColFill
-1.000 1280 664 143 433 BoxColFill
-1.000 1564 664 142 2989 BoxColFill
-1.000 1705 664 143 1953 BoxColFill
-1.000 1989 664 143 490 BoxColFill
-1.000 2273 664 143 9 BoxColFill
-1.000 2415 664 143 28 BoxColFill
-1.000 2699 664 143 2 BoxColFill
-1.000 2841 664 143 16 BoxColFill
-1.000 3124 664 143 8 BoxColFill
-1.000 3266 664 143 2 BoxColFill
-1.000 3550 664 143 5 BoxColFill
@@ -1,754 +0,0 @@
-%%Title: calibration/plot_create_nodevalue.eps
- /Title (calibration/plot_create_nodevalue.eps)
-854 1406 M
-770 1406 M
-854 2029 M
-770 2029 M
-854 2653 M
-770 2653 M
-854 3276 M
-770 3276 M
-3532 783 M
-3532 699 M
-[ [(Helvetica) 140.0 0.0 true true 0 (Operation create_nodevalue)]
-0.58 0.00 0.83 C 1.000 992 783 138 208 BoxColFill
-1.000 1129 783 139 56 BoxColFill
-1.000 1267 783 139 2914 BoxColFill
-1.000 1405 783 138 1929 BoxColFill
-1.000 1542 783 139 714 BoxColFill
-1.000 1680 783 139 1033 BoxColFill
-1.000 1818 783 138 126 BoxColFill
-1.000 2093 783 139 17 BoxColFill
-1.000 2368 783 139 9 BoxColFill
-1.000 2506 783 139 3 BoxColFill
-1.000 2644 783 138 7 BoxColFill
-1.000 2919 783 139 10 BoxColFill
-1.000 3194 783 139 11 BoxColFill
-1.000 3470 783 138 25 BoxColFill
@@ -1,812 +0,0 @@
-%%Title: calibration/plot_delete_edge.eps
- /Title (calibration/plot_delete_edge.eps)
-[ [(Helvetica) 140.0 0.0 true true 0 ( 2000)]
-[ [(Helvetica) 140.0 0.0 true true 0 ( 4000)]
-[ [(Helvetica) 140.0 0.0 true true 0 ( 6000)]
-[ [(Helvetica) 140.0 0.0 true true 0 ( 8000)]
-[ [(Helvetica) 140.0 0.0 true true 0 ( 12000)]
-1211 783 M
-1211 699 M
-1568 783 M
-1568 699 M
-2282 783 M
-2282 699 M
-2639 783 M
-2639 699 M
-3353 783 M
-3353 699 M
-3710 783 M
-3710 699 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 1.6x10)]
-[ [(Helvetica) 140.0 0.0 true true 0 ( 1.8x10)]
-[ [(Helvetica) 140.0 0.0 true true 0 (Operation delete_edge)]
-0.58 0.00 0.83 C 1.000 1008 783 155 1652 BoxColFill
-1.000 1162 783 155 2942 BoxColFill
-1.000 1316 783 155 2660 BoxColFill
-1.000 1470 783 155 3099 BoxColFill
-1.000 1624 783 155 1228 BoxColFill
-1.000 1778 783 154 336 BoxColFill
-1.000 1931 783 155 71 BoxColFill
-1.000 2085 783 155 111 BoxColFill
-1.000 2239 783 155 79 BoxColFill
-1.000 2393 783 155 110 BoxColFill
-1.000 2547 783 155 153 BoxColFill
-1.000 2701 783 155 126 BoxColFill
-1.000 2855 783 155 81 BoxColFill
-1.000 3009 783 155 83 BoxColFill
-1.000 3163 783 155 40 BoxColFill
-1.000 3317 783 155 103 BoxColFill
-1.000 3471 783 155 123 BoxColFill
-1.000 3625 783 154 80 BoxColFill
-1.000 3778 783 155 64 BoxColFill
@@ -1,789 +0,0 @@
-%%Title: calibration/plot_delete_node.eps
- /Title (calibration/plot_delete_node.eps)
-686 783 M
-3318 0 R
-602 783 M
-686 1302 M
-602 1302 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 50)]
-686 1822 M
-602 1822 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 100)]
-686 2341 M
-602 2341 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 150)]
-686 2860 M
-602 2860 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 200)]
-686 3380 M
-602 3380 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 250)]
-686 3899 M
-602 3899 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 300)]
-686 699 M
-1109 783 M
-1109 699 M
-1531 783 M
-1531 699 M
-1954 783 M
-1954 699 M
-2377 783 M
-2377 699 M
-2799 783 M
-2799 699 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 0.0001)]
-3222 783 M
-3222 699 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 0.00012)]
-3644 783 M
-3644 699 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 0.00014)]
-[ [(Helvetica) 140.0 0.0 true true 0 ( 0.00016)]
-686 3899 N
-686 783 L
-3381 0 V
--3381 0 V
-2376 98 M
-2376 4109 M
-[ [(Helvetica) 140.0 0.0 true true 0 (Operation delete_node)]
-0.58 0.00 0.83 C 1.000 849 783 164 333 BoxColFill
-1.000 1012 783 164 873 BoxColFill
-1.000 1175 783 165 1943 BoxColFill
-1.000 1339 783 164 3013 BoxColFill
-1.000 1502 783 164 1320 BoxColFill
-1.000 1665 783 164 323 BoxColFill
-1.000 1828 783 164 261 BoxColFill
-1.000 1991 783 164 209 BoxColFill
-1.000 2154 783 165 167 BoxColFill
-1.000 2318 783 164 63 BoxColFill
-1.000 2481 783 164 32 BoxColFill
-1.000 2644 783 164 22 BoxColFill
-1.000 3296 783 165 11 BoxColFill
-1.000 3623 783 164 11 BoxColFill
@@ -1,865 +0,0 @@
-%%Title: calibration/plot_read_dict.eps
-%%CreationDate: Mon Dec 18 14:16:33 2017
- /Title (calibration/plot_read_dict.eps)
- /CreationDate (Mon Dec 18 14:16:33 2017)
-938 664 M
-3066 0 R
-938 988 M
-854 988 M
-938 1311 M
-854 1311 M
-938 1635 M
-854 1635 M
-938 1958 M
-854 1958 M
-938 2282 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 50000)]
-938 2605 M
-854 2605 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 60000)]
-938 2929 M
-854 2929 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 70000)]
-938 3252 M
-854 3252 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 80000)]
-938 3575 M
-854 3575 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 90000)]
-938 3899 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 100000)]
-938 580 M
-1251 664 M
-1251 580 M
-1564 664 M
-1564 580 M
-1877 664 M
-1877 580 M
-2190 664 M
-2190 580 M
-2503 664 M
-2503 580 M
-2815 664 M
-2815 580 M
-3128 664 M
-3128 580 M
-3441 664 M
-3441 580 M
-3754 664 M
-3754 580 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 9x10)]
-938 3899 N
-938 664 L
-3129 0 V
--3129 0 V
-2502 98 M
-2502 4109 M
-[ [(Helvetica) 140.0 0.0 true true 0 (Operation read_dict)]
-0.58 0.00 0.83 C 1.000 1090 664 154 313 BoxColFill
-1.000 1243 664 153 78 BoxColFill
-1.000 1395 664 154 3152 BoxColFill
-1.000 1548 664 153 2022 BoxColFill
-1.000 1700 664 154 1595 BoxColFill
-1.000 1853 664 153 2228 BoxColFill
-1.000 2005 664 154 194 BoxColFill
-1.000 2158 664 153 672 BoxColFill
-1.000 2310 664 153 8 BoxColFill
-1.000 2462 664 154 209 BoxColFill
-1.000 2767 664 154 56 BoxColFill
-1.000 3072 664 154 24 BoxColFill
-1.000 3377 664 153 18 BoxColFill
-1.000 3682 664 153 14 BoxColFill
@@ -1,842 +0,0 @@
-%%Title: calibration/plot_read_dict_edge.eps
- /Title (calibration/plot_read_dict_edge.eps)
-854 1095 M
-770 1095 M
-854 1718 M
-770 1718 M
-854 2964 M
-770 2964 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 14000)]
-[ [(Helvetica) 140.0 0.0 true true 0 ( 16000)]
-854 3587 M
-770 3587 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 18000)]
-1256 783 M
-1256 699 M
-1657 783 M
-1657 699 M
-2059 783 M
-2059 699 M
-2862 783 M
-2862 699 M
-3264 783 M
-3264 699 M
-3665 783 M
-3665 699 M
-[ [(Helvetica) 140.0 0.0 true true 0 (Operation read_dict_edge)]
-0.58 0.00 0.83 C 1.000 1006 783 152 325 BoxColFill
-1.000 1157 783 153 3047 BoxColFill
-1.000 1309 783 152 790 BoxColFill
-1.000 1460 783 153 1099 BoxColFill
-1.000 1612 783 152 437 BoxColFill
-1.000 1763 783 153 94 BoxColFill
-1.000 1915 783 152 31 BoxColFill
-1.000 2066 783 153 8 BoxColFill
-1.000 2218 783 152 33 BoxColFill
-1.000 2369 783 153 29 BoxColFill
-1.000 2521 783 152 10 BoxColFill
-1.000 2672 783 153 33 BoxColFill
-1.000 2824 783 152 31 BoxColFill
-1.000 2975 783 153 19 BoxColFill
-1.000 3127 783 152 17 BoxColFill
-1.000 3278 783 153 9 BoxColFill
-1.000 3430 783 152 69 BoxColFill
-1.000 3581 783 153 90 BoxColFill
-1.000 3733 783 152 67 BoxColFill
@@ -1,799 +0,0 @@
-%%Title: calibration/plot_read_dict_keys.eps
- /Title (calibration/plot_read_dict_keys.eps)
-686 664 M
-602 664 M
-686 1068 M
-602 1068 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 20)]
-686 1473 M
-602 1473 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 40)]
-686 1877 M
-602 1877 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 60)]
-686 2282 M
-602 2282 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 80)]
-686 2686 M
-602 2686 M
-686 3090 M
-602 3090 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 120)]
-686 3495 M
-602 3495 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 140)]
-[ [(Helvetica) 140.0 0.0 true true 0 ( 160)]
-686 580 M
-1169 664 M
-1169 580 M
-1652 664 M
-1652 580 M
-2135 664 M
-2135 580 M
-2618 664 M
-2618 580 M
-3101 664 M
-3101 580 M
-3584 664 M
-3584 580 M
-686 664 L
-[ [(Helvetica) 140.0 0.0 true true 0 (Operation read_dict_keys)]
-0.58 0.00 0.83 C 1.000 1016 664 166 183 BoxColFill
-1.000 1181 664 166 365 BoxColFill
-1.000 1346 664 166 2104 BoxColFill
-1.000 1511 664 166 3196 BoxColFill
-1.000 1676 664 166 1821 BoxColFill
-1.000 1841 664 167 264 BoxColFill
-1.000 2007 664 166 62 BoxColFill
-1.000 2172 664 166 82 BoxColFill
-1.000 2337 664 166 21 BoxColFill
-1.000 2502 664 166 21 BoxColFill
-1.000 3162 664 166 41 BoxColFill
-1.000 3657 664 166 21 BoxColFill
@@ -1,770 +0,0 @@
-%%Title: calibration/plot_read_dict_node.eps
- /Title (calibration/plot_read_dict_node.eps)
-3234 0 R
-[ [(Helvetica) 140.0 0.0 true true 0 ( 400)]
-[ [(Helvetica) 140.0 0.0 true true 0 ( 600)]
-[ [(Helvetica) 140.0 0.0 true true 0 ( 800)]
-[ [(Helvetica) 140.0 0.0 true true 0 ( 1000)]
-[ [(Helvetica) 140.0 0.0 true true 0 ( 1200)]
-770 699 M
-1320 783 M
-1320 699 M
-1869 783 M
-1869 699 M
-2419 783 M
-2419 699 M
-2968 783 M
-2968 699 M
-3517 783 M
-3517 699 M
-770 3899 N
-770 783 L
-3297 0 V
--3297 0 V
-2418 98 M
-2418 4109 M
-[ [(Helvetica) 140.0 0.0 true true 0 (Operation read_dict_node)]
-0.58 0.00 0.83 C 1.000 916 783 147 518 BoxColFill
-1.000 1062 783 147 2948 BoxColFill
-1.000 1208 783 147 1349 BoxColFill
-1.000 1354 783 146 94 BoxColFill
-1.000 1499 783 147 17 BoxColFill
-1.000 1645 783 147 17 BoxColFill
-1.000 1791 783 147 6 BoxColFill
-1.000 1937 783 147 40 BoxColFill
-1.000 2083 783 147 146 BoxColFill
-1.000 2229 783 147 292 BoxColFill
-1.000 2375 783 147 455 BoxColFill
-1.000 2521 783 146 554 BoxColFill
-1.000 2666 783 147 154 BoxColFill
-1.000 2812 783 147 84 BoxColFill
-1.000 2958 783 147 128 BoxColFill
-1.000 3104 783 147 58 BoxColFill
-1.000 3250 783 147 107 BoxColFill
-1.000 3396 783 147 71 BoxColFill
-1.000 3542 783 147 22 BoxColFill
@@ -1,805 +0,0 @@
-%%Title: calibration/plot_read_edge.eps
- /Title (calibration/plot_read_edge.eps)
-686 1203 M
-686 1742 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 3000)]
-686 2821 M
-686 3360 M
-770 580 M
-1136 664 M
-1136 580 M
-1503 664 M
-1503 580 M
-1869 664 M
-1869 580 M
-2235 664 M
-2235 580 M
-2602 664 M
-2602 580 M
-2968 664 M
-2968 580 M
-3334 664 M
-3334 580 M
-3701 664 M
-3701 580 M
-770 664 L
-[ [(Helvetica) 140.0 0.0 true true 0 (Operation read_edge)]
-0.58 0.00 0.83 C 1.000 1084 664 158 1558 BoxColFill
-1.000 1398 664 158 3234 BoxColFill
-1.000 1555 664 159 2049 BoxColFill
-1.000 1713 664 158 147 BoxColFill
-1.000 1870 664 158 230 BoxColFill
-1.000 2027 664 158 3 BoxColFill
-1.000 2184 664 158 9 BoxColFill
-1.000 2498 664 158 151 BoxColFill
-1.000 2812 664 158 60 BoxColFill
-1.000 2969 664 158 16 BoxColFill
-1.000 3283 664 158 5 BoxColFill
-1.000 3598 664 158 11 BoxColFill
@@ -1,855 +0,0 @@
-%%Title: calibration/plot_read_incoming.eps
- /Title (calibration/plot_read_incoming.eps)
-686 1095 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 500)]
-686 1406 M
-686 1718 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 1500)]
-686 2029 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 2500)]
-686 2653 M
-686 2964 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 3500)]
-686 3276 M
-686 3587 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 4500)]
-1136 783 M
-1136 699 M
-1503 783 M
-1503 699 M
-2235 783 M
-2235 699 M
-2602 783 M
-2602 699 M
-3334 783 M
-3334 699 M
-3701 783 M
-3701 699 M
-[ [(Helvetica) 140.0 0.0 true true 0 (Operation read_incoming)]
-0.58 0.00 0.83 C 1.000 920 783 151 58 BoxColFill
-1.000 1070 783 151 3029 BoxColFill
-1.000 1220 783 151 2167 BoxColFill
-1.000 1370 783 151 150 BoxColFill
-1.000 1670 783 151 15 BoxColFill
-1.000 1820 783 151 10 BoxColFill
-1.000 1970 783 151 5 BoxColFill
-1.000 2120 783 151 11 BoxColFill
-1.000 2270 783 151 13 BoxColFill
-1.000 2420 783 150 44 BoxColFill
-1.000 2569 783 151 66 BoxColFill
-1.000 2719 783 151 25 BoxColFill
-1.000 2869 783 151 17 BoxColFill
-1.000 3019 783 151 6 BoxColFill
-1.000 3169 783 151 7 BoxColFill
-1.000 3319 783 151 7 BoxColFill
-1.000 3469 783 151 5 BoxColFill
-1.000 3619 783 151 3 BoxColFill
-%%Title: calibration/plot_read_outgoing.eps
- /Title (calibration/plot_read_outgoing.eps)
-854 1068 M
-770 1068 M
-854 1473 M
-770 1473 M
-854 1877 M
-770 1877 M
-854 2686 M
-770 2686 M
-854 3090 M
-770 3090 M
-854 3495 M
-770 3495 M
-1175 664 M
-1175 580 M
-1497 664 M
-1497 580 M
-1818 664 M
-1818 580 M
-2139 664 M
-2139 580 M
-2782 664 M
-2782 580 M
-3103 664 M
-3103 580 M
-3424 664 M
-3424 580 M
-3746 664 M
-3746 580 M
-[ [(Helvetica) 140.0 0.0 true true 0 (Operation read_outgoing)]
-0.58 0.00 0.83 C 1.000 1153 664 150 67 BoxColFill
-1.000 1452 664 150 3219 BoxColFill
-1.000 1751 664 150 2386 BoxColFill
-1.000 2050 664 150 279 BoxColFill
-1.000 2349 664 150 28 BoxColFill
-1.000 2648 664 150 7 BoxColFill
-1.000 2797 664 151 2 BoxColFill
-1.000 2947 664 150 4 BoxColFill
-1.000 3096 664 151 2 BoxColFill
-1.000 3246 664 150 1 BoxColFill
-1.000 3395 664 151 2 BoxColFill
-1.000 3545 664 150 1 BoxColFill
-1.000 3694 664 151 1 BoxColFill
-%%Title: calibration/plot_read_reverse_dict.eps
- /Title (calibration/plot_read_reverse_dict.eps)
-686 1126 M
-602 1126 M
-686 1588 M
-602 1588 M
-686 2050 M
-602 2050 M
-686 2513 M
-602 2513 M
-686 2975 M
-602 2975 M
-686 3437 M
-602 3437 M
-[ [(Helvetica) 140.0 0.0 true true 0 (Operation read_reverse_dict)]
-0.58 0.00 0.83 C 1.000 1233 664 184 24 BoxColFill
-1.000 1416 664 183 1526 BoxColFill
-1.000 1598 664 183 2866 BoxColFill
-1.000 1780 664 184 2381 BoxColFill
-1.000 1963 664 183 1734 BoxColFill
-1.000 2145 664 184 694 BoxColFill
-1.000 2328 664 183 486 BoxColFill
-1.000 2510 664 183 163 BoxColFill
-1.000 2692 664 184 140 BoxColFill
-1.000 2875 664 183 24 BoxColFill
-1.000 3057 664 184 47 BoxColFill
-1.000 3422 664 183 47 BoxColFill
-1.000 3604 664 184 24 BoxColFill
@@ -1,750 +0,0 @@
-%%Title: calibration/plot_read_root.eps
-%%CreationDate: Mon Dec 18 14:16:32 2017
- /Title (calibration/plot_read_root.eps)
- /CreationDate (Mon Dec 18 14:16:32 2017)
-854 842 M
-770 842 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 0.99)]
-854 1606 M
-770 1606 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 0.995)]
-854 2371 M
-770 2371 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 1)]
-854 3135 M
-770 3135 M
-[ [(Helvetica) 140.0 0.0 true true 0 ( 1.005)]
-[ [(Helvetica) 140.0 0.0 true true 0 ( 1.01)]
-0 2994 R
-854 758 M
-[ [(Helvetica) 140.0 0.0 true true 0 (0.0000045)]
-1256 842 M
-1256 758 M
-[ [(Helvetica) 140.0 0.0 true true 0 (0.0000046)]
-1657 842 M
-1657 758 M
-[ [(Helvetica) 140.0 0.0 true true 0 (0.0000047)]
-2059 842 M
-2059 758 M
-[ [(Helvetica) 140.0 0.0 true true 0 (0.0000048)]
-2460 842 M
-2460 758 M
-[ [(Helvetica) 140.0 0.0 true true 0 (0.0000049)]
-2862 842 M
-2862 758 M
-[ [(Helvetica) 140.0 0.0 true true 0 (0.0000050)]
-3264 842 M
-3264 758 M
-[ [(Helvetica) 140.0 0.0 true true 0 (0.0000051)]
-3665 842 M
-3665 758 M
-[ [(Helvetica) 140.0 0.0 true true 0 (0.0000052)]
-4067 842 M
-4067 758 M
-[ [(Helvetica) 140.0 0.0 true true 0 (0.0000053)]
-854 842 L
-0 3057 V
-112 2370 M
-[ [(Helvetica) 140.0 0.0 true true 0 (Operation read_root)]
-0.58 0.00 0.83 C 1.000 879 842 3017 1530 BoxColFill
@@ -1,809 +0,0 @@
-%%Title: calibration/plot_read_value.eps
- /Title (calibration/plot_read_value.eps)
-854 1023 M
-770 1023 M
-854 1383 M
-770 1383 M
-854 2102 M
-770 2102 M
-854 2461 M
-770 2461 M
-854 3180 M
-770 3180 M
-854 3540 M
-770 3540 M
-1313 664 M
-1313 580 M
-1772 664 M
-1772 580 M
-2231 664 M
-2231 580 M
-2690 664 M
-2690 580 M
-3149 664 M
-3149 580 M
-3608 664 M
-3608 580 M
-[ [(Helvetica) 140.0 0.0 true true 0 (Operation read_value)]
-0.58 0.00 0.83 C 1.000 1162 664 155 1550 BoxColFill
-1.000 1316 664 155 371 BoxColFill
-1.000 1624 664 155 3203 BoxColFill
-1.000 1778 664 155 2024 BoxColFill
-1.000 2086 664 155 172 BoxColFill
-1.000 2240 664 155 238 BoxColFill
-1.000 2548 664 155 5 BoxColFill
-1.000 2702 664 155 14 BoxColFill
-1.000 3010 664 156 12 BoxColFill
-1.000 3473 664 155 6 BoxColFill
-1.000 3627 664 155 2 BoxColFill
@@ -1,763 +0,0 @@
-%%Title: plot_rule_generation.eps
-%%CreationDate: Thu Jan 11 11:56:32 2018
- /Title (plot_rule_generation.eps)
- /CreationDate (Thu Jan 11 11:56:32 2018)
-938 1203 M
-[(Helvetica) 112.0 70.0 true true 0 (6)]
-] -60.7 MRshow
-938 1742 M
-938 2821 M
-938 3360 M
-[(Helvetica) 112.0 70.0 true true 0 (7)]
-[ [(Helvetica) 140.0 0.0 true true 0 (Operation rule_generation)]
-0.58 0.00 0.83 C 1.000 938 664 157 395 BoxColFill
-1.000 1094 664 158 2838 BoxColFill
-1.000 1251 664 157 681 BoxColFill
-1.000 1407 664 158 804 BoxColFill
-1.000 1564 664 157 504 BoxColFill
-1.000 1720 664 158 286 BoxColFill
-1.000 1877 664 157 400 BoxColFill
-1.000 2033 664 158 128 BoxColFill
-1.000 2190 664 157 445 BoxColFill
-1.000 2346 664 158 16 BoxColFill
-1.000 2503 664 157 506 BoxColFill
-1.000 2659 664 157 323 BoxColFill
-1.000 2815 664 158 65 BoxColFill
-1.000 2972 664 157 151 BoxColFill
-1.000 3128 664 158 86 BoxColFill
-1.000 3285 664 157 71 BoxColFill
-1.000 3441 664 158 88 BoxColFill
-1.000 3598 664 157 35 BoxColFill
-1.000 3754 664 158 104 BoxColFill
-1.000 3911 664 157 6 BoxColFill
@@ -29,7 +29,6 @@ class ModelverseKernel(object):
#
self.request_handlers = {}
self.allow_compiled = True
- self.success = True
#self.allow_compiled = False
# Set `self.suggest_function_names` to True to associate global function names
@@ -133,10 +132,12 @@ class ModelverseKernel(object):
elif inst_v is None:
raise Exception("%s: error understanding command (%s, %s)" % (self.debug_info[taskname], inst_v, self.phase_v))
+ #print("%-30s(%s) -- %s" % (inst_v["value"], self.phase_v, taskname))
gen = self.get_inst_phase_generator(inst_v, self.phase_v, task_root)
elif inst_v["value"] == "call":
+ #print("%-30s(%s)" % ("call", "param"))
gen = self.call_param(task_root)
@@ -1,70 +0,0 @@
-from subprocess import call, check_output
-import time
-def run_real(samples):
- with open("model/results_real", 'w') as f:
- for _ in range(samples):
- start = time.time()
- call(["pypy", "-m", "pytest", "integration/test_powerwindow.py", "-k", "fast", "-x"])
- print("Time to execute: " + str(time.time() - start))
- f.write(str(time.time() - start))
- f.write("\n")
- f.flush()
-def run_simulation(latency):
- import sys
- sys.path.append("model")
- from model import simulate
- print("SIMULATE for " + str(latency))
- params = ["pypy", "model/model.py"]
- for k, v in latency.items():
- params.extend([k, str(v)])
- output = check_output(params)
- lines = output.split("\n")
- for l in lines:
- if l.startswith("Execution time "):
- exec_time = float(l.split("Execution time ", 1)[1].strip())
- elif l.startswith("Simulation time "):
- sim_time = float(l.split("Simulation time ", 1)[1].strip())
- result = (exec_time, sim_time)
- print(result)
- return result
-def benchmark(parallel, to_run):
- if parallel:
- from multiprocessing import Pool
- pool = Pool(processes=4)
- results = pool.map(run_simulation, to_run)
- results = map(run_simulation, to_run)
- return results
-def benchmark_mvs(parallel, latency_range):
- to_run = [{"mvk2mvs_latency": i, "mvs2mvk_latency": i} for i in latency_range]
- results = benchmark(parallel, to_run)
- print(results)
- with open("model/results_mvs_latency", 'w') as f:
- for latency, result in zip(to_run, results):
- sim, exe = result
- f.write("%s %s %s\n" % (latency*1000, sim, exe))
-def benchmark_mvi(parallel, latency_range):
- to_run = [{"mvi2mvk_latency": i, "mvk2mvi_latency": i} for i in latency_range]
- with open("model/results_mvi_latency", 'w') as f:
-if __name__ == "__main__":
- benchmark_mvs(parallel = False, latency_range=[0.0, 0.5])
- benchmark_mvi(parallel = False, latency_range=[0.0, 0.5])
- run_real(samples = 2)
- #benchmark_mvs(parallel = False, latency_range=[0.0, 0.0017, 0.012, 0.02, 0.1, 0.5])
- #benchmark_mvi(parallel = False, latency_range=[0.0, 0.0017, 0.012, 0.02, 0.1, 0.5])
- #run_real(samples = 10)
@@ -1,46 +1,34 @@
import sys
-import uuid
sys.path.append("kernel/")
sys.path.append("state/")
sys.path.append("interface/HUTN")
from modelverse_state.main import ModelverseState as MvS
from modelverse_kernel.main import ModelverseKernel as MvK
-from modelverse_kernel.primitives import SleepKernel
-import modelverse_jit.jit as jit
from hutn_compiler.compiler import main as do_compile
+from hutn_compiler.linker import link
-from pypdevs.minimal import AtomicDEVS, CoupledDEVS, Simulator
-PROFILE = False
+from pypdevs.DEVS import AtomicDEVS, CoupledDEVS
+from pypdevs.simulator import Simulator
import json
import random
-COMPILER_PATH = "interface/HUTN"
+random.seed(1)
+max_used_id = 0
-sys.path.append(COMPILER_PATH)
-from hutn_compiler.compiler import main as do_compile
-import os
-def clean_code(code):
- if code == "":
- return code
- code_fragments = code.split("\n")
- code_fragments = [i.rstrip() for i in code_fragments if i.strip() != ""]
- code_fragments = [i.replace(" ", "\t") for i in code_fragments]
- initial_tabs = min([len(i) - len(i.lstrip("\t")) for i in code_fragments])
- code_fragments = [i[initial_tabs:] for i in code_fragments]
- code_fragments.append("")
- code = "\n".join(code_fragments)
- return code.encode('ascii', 'replace')
-def compile_model(temp_file):
- compiled = do_compile(temp_file, COMPILER_PATH + "/grammars/modelling.g", "M")
- return ["__LOCAL__"] + compiled
-trans_map = {
+def get_object_constructor(code, filename):
+ with open(".code.alc", "w") as f:
+ f.write(code)
+ f.flush()
+ constructors = do_compile(".code.alc", "interface/HUTN/grammars/actionlanguage.g", "CS")
+ constructors = [3, "upload", filename, str(random.random()), True] + constructors + [False]
+ return constructors
+
+def link_code(main_function, taskname, objects):
+ return [3, "link_and_load"] + objects + ["", main_function]
+def translate(operation):
+ return {
"CN": "create_node",
"CE": "create_edge",
"CNV": "create_nodevalue",
@@ -58,11 +46,7 @@ trans_map = {
"RDK": "read_dict_keys",
"DE": "delete_edge",
"DN": "delete_node",
- "GC": "purge",
-def translate(operation):
- return trans_map[operation]
+ }[operation]
class MvSState(object):
def __init__(self):
@@ -89,8 +73,7 @@ class ModelverseState(AtomicDEVS):
read_dict_node_edge,
read_reverse_dict,
delete_node,
- delete_edge,
- purge):
+ delete_edge):
AtomicDEVS.__init__(self, "MvS")
self.timings = {
"read_root": read_root,
@@ -110,7 +93,6 @@ class ModelverseState(AtomicDEVS):
"read_reverse_dict": read_reverse_dict,
"delete_node": delete_node,
"delete_edge": delete_edge,
- "purge": purge,
}
self.state = MvSState()
@@ -128,12 +110,8 @@ class ModelverseState(AtomicDEVS):
self.state.output = []
self.state.timer = 0.0
for v in self.state.queue[0]:
- f = getattr(self.state.mvs, translate(v[0]))
- self.state.output.append(f(*v[1]))
- if PROFILE:
- print("%s: %.17f" % (translate(v[0]), time.time() - start))
- self.state.timer += self.timings[translate(v[0])]
+ self.state.output.append(getattr(self.state.mvs, translate(v[0]))(*v[1]))
+ self.state.timer += self.timings[translate(v[0])]()
# Just append the message to process
pass
@@ -150,12 +128,8 @@ class ModelverseState(AtomicDEVS):
# Value contains a list of operations to do
# So do them and calculate how long it takes
+ self.state.output.append(getattr(self.state.mvs, translate(v[0]))(*v[1])[0])
self.state.timer = float("inf")
@@ -165,7 +139,7 @@ class ModelverseState(AtomicDEVS):
return self.state.timer
class MvKState(object):
- def __init__(self, rule_generation):
+ def __init__(self):
self.mvk = None
self.waiting = False
self.inputs = {}
@@ -178,10 +152,7 @@ class MvKState(object):
self.current_task = None
self.loaded_primitives = False
self.execution_counter = 0
- self.rule_generation = rule_generation
- self.current_time = 0.0
- self.start_task_time = 0.0
- self.execution_rounds = 0
+ self.all_failed = True
def __str__(self):
return "\nMvK: %s\n" % self.mvk + \
@@ -197,19 +168,18 @@ class MvKState(object):
"execution counter: %s\n"
class ModelverseKernel(AtomicDEVS):
- def __init__(self, time_per_phase, rule_generation):
+ def __init__(self, rules_per_phase):
AtomicDEVS.__init__(self, "MvK")
- self.state = MvKState(rule_generation)
+ self.state = MvKState()
self.from_mvi = self.addInPort("from_MvI")
self.from_mvs = self.addInPort("from_MvS")
self.to_mvi = self.addOutPort("to_MvI")
self.to_mvs = self.addOutPort("to_MvS")
- self.time_per_phase = time_per_phase
+ self.rules_per_phase = rules_per_phase
def extTransition(self, inputs):
- self.state.current_time += self.elapsed
if self.from_mvi in inputs:
# Got input from MvI, so we queue it
for inp in inputs[self.from_mvi]:
@@ -223,27 +193,23 @@ class ModelverseKernel(AtomicDEVS):
if self.from_mvs in inputs:
# Got input from MvS, so we can continue processing
for mvs_input in inputs[self.from_mvs]:
+ mvs_stripped = [i[0] for i in mvs_input]
if self.state.mvk is None:
# No MvK, so set it with the root we have just received (or should have received)
- self.state.root = mvs_input[0]
+ self.state.root = mvs_stripped[0]
self.state.mvk = MvK(self.state.root)
- self.state.mvk.jit.set_function_body_compiler(jit.compile_function_body_fast)
- self.state.reply = mvs_input
+ self.state.reply = mvs_stripped
self.state.waiting = False
return self.state
def intTransition(self):
- self.state.current_time += self.timeAdvance()
was_empty = len(self.state.tasks) == 0
if self.state.commands is not None:
self.state.commands = None
- if self.state.mvk is not None:
- self.state.mvk.returnvalue = None
# Initializing
self.state.waiting = True
@@ -260,11 +226,7 @@ class ModelverseKernel(AtomicDEVS):
if len(self.state.tasks) == 0:
# Read out new set of tasks first
if self.state.reply is None:
- self.state.execution_rounds += 1
commands = [("RDK", [self.state.root])]
- if self.state.execution_rounds > 1000:
- commands.append(("GC", []))
- self.state.execution_rounds = 0
self.state.tasks = self.state.reply[0]
commands = None
@@ -273,7 +235,6 @@ class ModelverseKernel(AtomicDEVS):
commands = [("RV", [self.state.tasks[0]])]
self.state.current_task = self.state.reply[0]
- self.state.start_task_time = self.state.current_time
if self.state.current_task.startswith("__"):
# Don't process this task and force termination of task
self.state.phase = "output"
@@ -281,41 +242,17 @@ class ModelverseKernel(AtomicDEVS):
elif self.state.phase == "input":
# Process inputs
if self.state.inputs.get(self.state.current_task, None):
- value = self.state.inputs[self.state.current_task][0]
- commands = self.state.mvk.execute_yields(self.state.current_task, "set_input", [value], self.state.reply)
- #print("EXECUTEYIELDSI %s %.17f" % (self.state.current_task, time.time() - start))
- #print(commands)
- print("rule_generation: %.17f" % ((time.time() - start)))
- #self.state.rule_generation = time.time() - start
+ element_type, value = self.state.inputs[self.state.current_task][0]
+ commands = self.state.mvk.execute_yields(self.state.current_task, "set_input", [element_type, value], self.state.reply)
if commands is None:
self.state.inputs[self.state.current_task].pop(0)
elif self.state.phase == "computation":
- commands = self.state.mvk.execute_yields(self.state.current_task, "execute_rule", [], self.state.reply)
- #print("EXECUTEYIELDS %s %.17f" % (self.state.current_task, time.time() - start))
- except SleepKernel:
- commands = None
- self.state.mvk.success = False
- self.state.mvk.success = True
+ commands = self.state.mvk.execute_yields(self.state.current_task, "execute_rule", [], self.state.reply)
elif self.state.phase == "output":
commands = self.state.mvk.execute_yields(self.state.current_task, "get_output", [], self.state.reply)
- #print("EXECUTEYIELDSO %s %.17f" % (self.state.current_task, time.time() - start))
raise Exception("Phase: " + str(self.state.phase))
@@ -328,8 +265,11 @@ class ModelverseKernel(AtomicDEVS):
self.state.phase = "computation"
- if (not self.state.mvk.success) or (self.state.current_time - self.state.start_task_time > self.time_per_phase):
+ if not self.state.mvk.success or (self.state.execution_counter > self.rules_per_phase):
+ self.state.execution_counter = 0
+ self.state.execution_counter += 1
self.state.tasks.pop(0)
self.state.phase = "init_task"
@@ -343,21 +283,20 @@ class ModelverseKernel(AtomicDEVS):
def outputFnc(self):
- outputs = {}
# Ask the root first
- outputs[self.to_mvs] = [[("RR", [])]]
+ return {self.to_mvs: [[("RR", [])]]}
elif self.state.waiting:
- outputs[self.to_mvs] = [self.state.commands]
- if self.state.mvk and self.state.mvk.returnvalue is not None:
- outputs[self.to_mvi] = [(self.state.current_task, self.state.mvk.returnvalue)]
+ return {self.to_mvs: [self.state.commands]}
- return outputs
+ return {}
def timeAdvance(self):
+ if self.state.phase == "init_task" and self.state.all_failed:
+ # Make this a parameter
+ return 200
- return self.state.rule_generation
+ return 0
return float("inf")
elif self.state.mvk is None:
@@ -368,134 +307,48 @@ class ModelverseKernel(AtomicDEVS):
class MvIState():
self.operations = []
- self.additional_operations = []
- self.keyed_operations = {}
- self.task_to_spawner = {}
- self.task_to_operation = {}
- self.output = {}
- self.blocked = True
- self.finished = False
- self.send_operations = {}
+ self.output = []
+ self.processing = []
+ self.memory = {}
+ self.init = True
class ModelverseInterface(AtomicDEVS):
- def __init__(self, taskname, operations, finish_on, additional_operations=[], keyed_operations={}):
+ def __init__(self, taskname, operations):
AtomicDEVS.__init__(self, "MvI_%s" % taskname)
self.state = MvIState()
- if taskname == "task_manager":
- self.state.blocked = False
self.state.operations = operations
- self.state.additional_operations = additional_operations
- self.state.keyed_operations = keyed_operations
- self.state.create_additional_task = []
self.taskname = taskname
- self.finish_on = finish_on
self.to_mvk = self.addOutPort("to_MvK")
self.from_mvk = self.addInPort("from_MvK")
- if not self.state.send_operations:
- if self.state.operations[0] is not None:
- self.state.operations.pop(0)
- for k in self.state.send_operations.keys():
- if self.state.send_operations[k]:
- self.state.send_operations[k][0] = None
- self.state.blocked = True
+ self.state.init = False
+ while self.state.operations:
+ i = self.state.operations[0]
+ if isinstance(i, int) and i not in self.state.memory:
+ break
+ self.state.operations.pop(0)
for inp in inputs[self.from_mvk]:
- print(inp)
- self.state.output.setdefault(inp[0], []).append(inp[1])
- if inp[0] == self.taskname and inp[1] == self.finish_on:
- self.state.finished = True
- elif inp[0] == self.taskname and self.state.operations[0] is None:
- # We have to block for now, and modify a model first...
- prev_output = self.state.output[inp[0]][-1]
- if prev_output.startswith("Please edit this model before sending next input: "):
- _, model_name = prev_output.split("Please edit this model before sending next input: ", 1)
- new_taskname = str(uuid.uuid4())
- self.state.send_operations[new_taskname] = [[], ["admin"], ["admin"], ["quiet"], ["model_modify", model_name, ""]] + self.state.additional_operations[0] + [["exit"], ["exit"]]
- self.state.create_additional_task.append(new_taskname)
- self.state.task_to_operation[new_taskname] = None
- self.state.task_to_spawner[new_taskname] = None
- elif prev_output.startswith("Spawned activity on task: "):
- _, task_name = prev_output.split("Spawned activity on task: ", 1)
- self.state.task_to_spawner[task_name] = None
- elif prev_output.startswith("Finished task: "):
- elif " : " in prev_output:
- task_name, _ = prev_output.split(" : ", 1)
- self.state.operations.insert(0, None)
- elif prev_output == "Success":
- self.state.operations = [["echo", "FINISHED"]]
- elif inp[0] != self.taskname:
- # Got some output on another task
- # If the task is not registered yet, it is likely not important to communicate with it, so ignore it
- #print("Send operations: " + str(self.state.send_operations))
- if inp[0] in self.state.send_operations:
- self.state.send_operations[inp[0]].pop(0)
- if inp[1].startswith("Please edit this model before sending next input: "):
- _, model_name = inp[1].split("Please edit this model before sending next input: ", 1)
- self.state.send_operations[new_taskname] = [[], ["admin"], ["admin"], ["quiet"], ["model_modify", model_name, ""]] + self.state.keyed_operations.get(self.state.task_to_operation[inp[0]], []) + [["exit"], ["exit"]]
- #print("DO EXIT2")
- self.state.task_to_spawner[new_taskname] = inp[0]
- elif inp[1].startswith("Please perform manual operation "):
- _, op_name = inp[1].split("Please perform manual operation ", 1)
- self.state.task_to_operation[inp[0]] = op_name[1:-1]
- if inp[0] in self.state.send_operations and len(self.state.send_operations[inp[0]]) == 0:
- del self.state.send_operations[inp[0]]
- # At the end of these operations, so finish up!
- if inp[0] in self.state.task_to_spawner:
- if self.state.task_to_spawner[inp[0]] is not None:
- self.state.keyed_operations.pop(self.state.task_to_operation[self.state.task_to_spawner[inp[0]]], None)
- self.state.additional_operations.insert(0, [])
- self.state.send_operations[self.state.task_to_spawner[inp[0]]] = ["__continue__"]
- self.state.additional_operations.pop(0)
+ if inp["value"] == "None" and isinstance(self.state.processing[0], int) and self.state.processing[0] not in self.state.memory:
+ self.state.memory[self.state.processing.pop(0)] = int(inp["id"])
+ self.state.output.append(inp)
- if self.state.send_operations:
- outp = []
- if self.state.create_additional_task:
- outp.append(('task_manager', self.state.create_additional_task))
- for k, v in self.state.send_operations.items():
- if v and v[0] is not None:
- outp.append((k, v[0]))
- if outp:
- print("SEND " + str(outp))
- return {self.to_mvk: outp}
- return {}
- elif self.state.operations and self.state.operations[0] is not None:
- print("SEND " + str([(self.taskname, self.state.operations[0])]))
- return {self.to_mvk: [(self.taskname, self.state.operations[0])]}
+ return {self.to_mvk: [(self.taskname, self.state.operations)]}
- if self.state.blocked:
- return float("inf")
+ if self.state.init:
+ elif self.state.processing and (not isinstance(self.state.processing[0], int) or self.state.processing[0] in self.state.memory):
- return 0.0
+ return float("inf")
class NetworkState(object):
@@ -516,7 +369,7 @@ class Network(AtomicDEVS):
self.state.processing.pop(0)
if self.state.processing:
- self.state.timer = (len(json.dumps(self.state.processing[0])) * 8 / float(self.bandwidth) + self.latency)
+ self.state.timer = int(len(self.state.processing[0]) / float(self.bandwidth) + self.latency)
@@ -526,14 +379,13 @@ class Network(AtomicDEVS):
if self.state.timer == float("inf"):
self.state.timer = 0
for v in inputs[self.input_port]:
- self.state.processing.append(v)
- # NOTE data is in bytes, while bandwidth is in bits, so multiply by 8
+ self.state.processing.append(json.dumps(v))
if len(self.state.processing) > 0:
- return {self.output_port: [self.state.processing[0]]}
+ return {self.output_port: [json.loads(self.state.processing[0])]}
@@ -542,11 +394,7 @@ class System(CoupledDEVS):
def __init__(self,
taskname,
operations,
- mvi_additional,
- mvi_keyed,
- finish_on,
- rule_generation,
- time_per_phase,
+ rules_per_phase,
mvi2mvk_latency,
mvi2mvk_bandwidth,
mvk2mvs_latency,
@@ -571,25 +419,19 @@ class System(CoupledDEVS):
CoupledDEVS.__init__(self, "System")
self.mvi_manager = self.addSubModel(ModelverseInterface(\
taskname = "task_manager",
- operations = [[taskname]],
- finish_on = None,
+ operations = [taskname],
))
self.mvi = self.addSubModel(ModelverseInterface(\
taskname = taskname,
- operations = operations,
- finish_on = finish_on,
- additional_operations = mvi_additional,
- keyed_operations = mvi_keyed,
+ operations = operations
self.mvk = self.addSubModel(ModelverseKernel(\
- time_per_phase = time_per_phase,
- rule_generation = rule_generation,
+ rules_per_phase = rules_per_phase
self.mvs = self.addSubModel(ModelverseState(\
read_root = read_root,
@@ -608,28 +450,27 @@ class System(CoupledDEVS):
read_dict_node_edge = read_dict_node_edge,
read_reverse_dict = read_reverse_dict,
delete_node = delete_node,
- delete_edge = delete_edge,
- purge = purge,
+ delete_edge = delete_edge
self.mvi2mvk = self.addSubModel(Network(\
name = "mvi2mvk",
latency = mvi2mvk_latency,
- bandwidth = mvi2mvk_bandwidth,
+ bandwidth = mvi2mvk_bandwidth
self.mvk2mvs = self.addSubModel(Network(\
name = "mvk2mvs",
latency = mvk2mvs_latency,
- bandwidth = mvk2mvs_bandwidth,
+ bandwidth = mvk2mvs_bandwidth
self.mvs2mvk = self.addSubModel(Network(\
name = "mvs2mvk",
latency = mvs2mvk_latency,
- bandwidth = mvs2mvk_bandwidth,
+ bandwidth = mvs2mvk_bandwidth
self.mvk2mvi = self.addSubModel(Network(\
name = "mvk2mvi",
latency = mvk2mvi_latency,
- bandwidth = mvk2mvi_bandwidth,
+ bandwidth = mvk2mvi_bandwidth
self.connectPorts(self.mvi_manager.to_mvk, self.mvk.from_mvi)
@@ -642,101 +483,57 @@ class System(CoupledDEVS):
self.connectPorts(self.mvk.to_mvi, self.mvk2mvi.input_port)
self.connectPorts(self.mvk2mvi.output_port, self.mvi.from_mvk)
-def simulate(supplied_args):
- random.seed(1)
- taskname = "test_task"
- operations = json.loads(open("model/operations", 'r').read())
- #operations = json.loads(open("model/operations_simple", 'r').read())
- additional_operations = [[], # revise_req
- [], # revise_environment
- [], # revise_plant
- [], # revise_control
- [], # revise_query
- [], # revise_architecture
- [], # make_initial_models
- [["instantiate_edge", "Association", "PLANT2EPN_link", "PW_Plant/State", "Encapsulated_PetriNet/Place"], ["instantiate_edge", "Association", "PLANT2EPN_tlink", "PW_Plant/Transition", "Encapsulated_PetriNet/Transition"]], # plant_to_EPN
- [["instantiate_edge", "Association", "CTRL2EPN_link", "PW_Control/State", "Encapsulated_PetriNet/Place"], ["instantiate_edge", "Association", "CTRL2EPN_tlink", "PW_Control/Transition", "Encapsulated_PetriNet/Transition"]], # control_to_EPN
- [["instantiate_edge", "Association", "ENV2EPN_link", "PW_Environment/Event", "Encapsulated_PetriNet/Place"]], # environment_to_EPN
- [["instantiate_edge", "Association", "EPN2PN_place_link", "Encapsulated_PetriNet/Place", "PetriNet/Place"], ["instantiate_edge", "Association", "EPN2PN_transition_link", "Encapsulated_PetriNet/Transition", "PetriNet/Transition"]], # EPN_to_PN
- [], # match
- [], # reachability
- [], # bfs
- [], # merge
- ]
- #additional_operations = [[]]
- keyed_operations = {"models/revise_req": [["upload"], compile_model("models/requirements_model.mvc")],
- "models/revise_plant": [["upload"], compile_model("models/plant_model.mvc")],
- "models/revise_environment": [["upload"], compile_model("models/environment_model.mvc")],
- "models/revise_control": [["upload"], compile_model("models/control_model.mvc")],
- "models/revise_query": [["upload"], compile_model("models/query_model.mvc")],
- "models/revise_architecture": [["upload"], compile_model("models/architecture_model.mvc")],
- #keyed_operations = {"models/modify_lang": [["instantiate_node", "PN/Class", ""]]}
- finish_on = "FINISHED"
- args = {
- "taskname": taskname,
- "operations": operations,
- "finish_on": finish_on,
- "mvi_additional": additional_operations,
- "mvi_keyed": keyed_operations,
- "mvi2mvk_latency": 0.0000001,
- "mvi2mvk_bandwidth": 50000000000,
- "mvk2mvs_latency": 0.0000001,
- "mvk2mvs_bandwidth": 50000000000,
- "mvs2mvk_latency": 0.0000001,
- "mvs2mvk_bandwidth": 50000000000,
- "mvk2mvi_latency": 0.0000001,
- "mvk2mvi_bandwidth": 50000000000,
- "time_per_phase": 0.05,
- # Automatically filled in from calibration results, just here to prevent crashes (results for my UA desktop)
- "read_root": 0.00001406669616699,
- "create_node": 0.00000379181167487,
- "create_edge": 0.00000601282282066,
- "create_nodevalue": 0.00000501364247391,
- "create_dict": 0.00001028065706205,
- "read_value": 0.00000388661630500,
- "read_outgoing": 0.00000520600098073,
- "read_incoming": 0.00000645903181994,
- "read_edge": 0.00000449162172644,
- "read_dict": 0.00000460127038355,
- "read_dict_keys": 0.00001678063432883,
- "read_dict_node": 0.00001020808859528,
- "read_dict_edge": 0.00000642558526942,
- "read_dict_node_edge": 0.0,
- "read_reverse_dict": 0.00002557890755790,
- "delete_node": 0.00004755891187096,
- "delete_edge": 0.00000683382081240,
- "rule_generation": 0.00001543215873893,
- "purge": 7.0,
- with open("calibration/averages", 'r') as param_file:
- for l in param_file:
- op = op.strip()
- args[op] = float(t)
- local_args = dict(args)
- local_args.update(supplied_args)
- model = System(**local_args)
- sim = Simulator(model)
- sim.setTerminationCondition(lambda t, m: m.mvi.state.finished)
- #sim.setVerbose()
- tn = sim.simulate()
- return (tn, time.time() - start)
- args = {}
- i = 1
- while i < len(sys.argv):
- args[sys.argv[i]] = float(sys.argv[i+1])
- i += 2
- ts, te = simulate(args)
- print("Execution time %s" % ts)
- print("Simulation time %s" % te)
+files = ["bootstrap/primitives.alc"]
+code = \
+ """
+include "primitives.alh"
+Void function main():
+\tlog("Executed the code!")
+\treturn !
+taskname = "test_task"
+operations = [get_object_constructor(open(f, 'r').read(), str(f)) for f in files] + \
+ get_object_constructor(code, "main") + \
+ link_code("main", taskname, files + ["code.alc"])
+print("Generated operations:")
+print(operations)
+args = {
+ "taskname": taskname,
+ "operations": operations,
+ "mvi2mvk_latency": 1,
+ "mvi2mvk_bandwidth": 2000,
+ "mvk2mvs_latency": 1,
+ "mvk2mvs_bandwidth": 2000,
+ "mvs2mvk_latency": 1,
+ "mvs2mvk_bandwidth": 2000,
+ "mvk2mvi_latency": 1,
+ "mvk2mvi_bandwidth": 2000,
+ "read_root": lambda: 1,
+ "create_node": lambda: 1,
+ "create_edge": lambda: 1,
+ "create_nodevalue": lambda: 1,
+ "create_dict": lambda: 1,
+ "read_value": lambda: 1,
+ "read_outgoing": lambda: 1,
+ "read_incoming": lambda: 1,
+ "read_edge": lambda: 1,
+ "read_dict": lambda: 1,
+ "read_dict_keys": lambda: 1,
+ "read_dict_node": lambda: 1,
+ "read_dict_edge": lambda: 1,
+ "read_dict_node_edge": lambda: 1,
+ "read_reverse_dict": lambda: 1,
+ "delete_node": lambda: 1,
+ "delete_edge": lambda: 1,
+ "rules_per_phase": 200,
+ }
+model = System(**args)
+sim = Simulator(model)
+sim.setTerminationTime(900000)
+#sim.setVerbose()
+sim.simulate()
@@ -1,43 +0,0 @@
-reset
-set terminal postscript enhanced colour portrait size 6,4
-set out 'model/mvs_latency_sweep.eps'
-set title "MvK to MvS latency simulation"
-set xlabel "Latency (ms)"
-set ylabel "Execution time (s)"
-set key off
-set logscale y
-set style histogram
-set style data histograms
-set boxwidth 0.9 relative
-set style fill solid 1.0 border -1
-set xtics rotate
-plot 'model/results_mvs_latency' u 2:xtic(1) title "Execution time"
-set out 'model/mvi_latency_sweep.eps'
-set title "MvI to MvK latency simulation"
-plot 'model/results_mvi_latency' u 2:xtic(1) title "Execution time"
-set out 'model/mvs_latency_performance.eps'
-set title "MvK to MvS latency influence"
-set key top left
-plot 'model/results_mvs_latency' u 2:xtic(1) title "Execution time", '' u 3:xtic(1) title "Simulation time" linecolor rgb "#00FF00"
-set out 'model/mvi_latency_performance.eps'
-set title "MvI to MvK latency influence"
-set yrange [100:1200]
-plot 'model/results_mvi_latency' u 2:xtic(1) title "Execution time", '' u 3:xtic(1) title "Simulation time" linecolor rgb "#00FF00"
-set out 'model/execution_jitter.eps'
-set title "Execution time jitter"
-set xlabel "Execution time (s)"
-set ylabel "Samples"
-bin_width = 2.0;
-set boxwidth bin_width absolute
-bin_number(x) = floor(x/bin_width)
-rounded(x) = bin_width * (bin_number(x) + 0.5)
-plot 'model/results_real' u (rounded($1)):(1) smooth frequency with boxes
@@ -1,6 +0,0 @@
-0 292.109931617 687.586576939
-0.85 296.482015311 710.436285973
-6 304.150488218 705.886978149
-10 310.165107566 702.304213047
-50 363.198107076 796.335119963
-500 509.838712965 900.826931953
-0 287.089157728 682.32207799
-0.85 74247.9788747 1345.15017915
-6 781500.860442 2527.91798186
-10 1223318.65876 2419.65163016
-50 6208491.94807 2557.9531641
-500 62065229.7857 2572.83656693
@@ -1,45 +0,0 @@
-280.637567043
-296.603248835
-292.454334974
-285.996268988
-293.921952963
-283.71339798
-293.266798973
-283.485968113
-295.018666983
-283.898438931
-285.388226986
-293.035602093
-294.636198997
-294.183022022
-285.786120892
-298.210355997
-294.114370108
-294.55457902
-281.625012875
-281.878963947
-287.908139944
-294.755314112
-294.155758142
-284.547976971
-294.172923088
-296.046543837
-293.35966301
-287.99435091
-281.050395966
-270.317679882
-277.531784058
-293.629886866
-288.316046
-284.567144871
-282.679445028
-294.466975927
-284.337308884
-293.572304964
-274.568242788
-296.396967888
-287.289237976
-294.616616011
-283.87115407
-282.592723131
-274.511307955
@@ -17,6 +17,7 @@ try:
subprocess.check_call([sys.executable, "-m", "sccd.compiler.sccdc", "-p", "threads", "server.xml"])
os.chdir("..")
# Start up all services with auto-detection
import glob
service_paths = glob.glob("services/*/main.py")
@@ -28,7 +29,6 @@ try:
os.chdir("hybrid_server")
program_to_execute = [sys.executable, "run_mvk_server.py", port]
- program_to_execute = [sys.executable, "run_mvk_server.py", port, "--kernel=fast-jit"]
#program_to_execute = [sys.executable, "run_mvk_server.py", port, "--kernel=generated"]
server = subprocess.Popen(program_to_execute)
@@ -11,7 +11,8 @@
self.current_ID = action["ID"]
self.action_name = action["name"]
</body>
- </method>
+ </method>
<method name="dict_to_list">
<parameter name="d"/>
<body>
@@ -96,7 +97,6 @@
self.registered_metamodel = {}
self.finish_output_thread = False
- self.input_log = []
</constructor>
@@ -144,9 +144,6 @@
<parameter expr='urllib.urlencode({"op": "set_input", "data": json.dumps(value), "taskname": self.taskname})'/>
<parameter expr='None'/>
</raise>
- <script>
- self.input_log.append(value)
- </script>
</transition>
<transition event="request" cond="not isinstance(value, type([]))" target=".">
@@ -155,9 +152,6 @@
<parameter expr='urllib.urlencode({"op": "set_input", "value": json.dumps(value), "taskname": self.taskname})'/>
- self.input_log.append([value])
<transition event="request_raw" target=".">
@@ -344,7 +338,7 @@
<state id="send_metadata">
<onentry>
<raise event="request">
- <parameter expr="['model_add', self.parameters[1], self.parameters[0]] + ([self.parameters[2]] if not COMPILE_LOCAL else compile_model(self.parameters[2]))"/>
+ <parameter expr="['model_add', self.parameters[1], self.parameters[0], self.parameters[2]]"/>
</onentry>
@@ -452,7 +446,7 @@
<state id="send_model">
- <parameter expr="self.parameters[1] if not COMPILE_LOCAL else compile_model(self.parameters[1])"/>
+ <parameter expr="self.parameters[1]"/>
@@ -480,10 +474,6 @@
<state id="user_logout">
- import json
- print(json.dumps(self.input_log))
<parameter expr="'user_logout'"/>
@@ -610,7 +600,6 @@
<transition cond="self.expect_response_partial('Please edit this model before sending next input: ', pop=False)" target="../wait_for_user">
<script>
model = self.responses.pop(0).split(": ", 1)[1]
- self.input_log.append(None)
</script>
<raise event="result">
<parameter expr="model"/>
@@ -618,12 +607,11 @@
<transition cond="self.expect_response('Waiting for code constructors...')" target="../upload_changes">
- <!-- TODO Is this ever executed? -->
<parameter expr="None"/>
- <parameter expr="self.parameters[3] if not COMPILE_LOCAL else compile_code(self.parameters[3])"/>
+ <parameter expr="self.parameters[3]"/>
</state>
@@ -642,13 +630,13 @@
<state id="upload_changes">
<transition cond="self.expect_response('Waiting for code constructors...')" target=".">
<transition cond="self.expect_response('Waiting for model constructors...')" target=".">
- <parameter expr="self.parameters[3] if not COMPILE_LOCAL else compile_model(self.parameters[3])"/>
@@ -1450,9 +1438,6 @@
<parameter expr="self.responses.pop(0).split(': ')[1]"/>
<transition cond="None in self.inputs and self.inputs[None]" target="../../../history">
@@ -12,38 +12,6 @@
import urllib
- COMPILE_LOCAL = True
- if COMPILE_LOCAL:
- sys.path.append("interface/HUTN")
- from hutn_compiler.compiler import main as do_compile
- def clean_code(code):
- def compile_model(model):
- temp_file = ".model_%s" % str(uuid.uuid4())
- with open(temp_file, 'w') as f:
- f.write(model)
- compiled = do_compile(temp_file, "interface/HUTN/grammars/modelling.g", "M")
- def compile_code(code):
- temp_file = ".code_%s" % str(uuid.uuid4())
- f.write(code)
- compiled = do_compile(temp_file, "interface/HUTN/grammars/actionlanguage.g", "CS")
</top>
<inport name="socket_in"/>