Ver código fonte

adjustments to algorithm (still not finished)

Cláudio Gomes 8 anos atrás
pai
commit
2515149784

+ 3 - 0
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation/examples/algorithm.txt

@@ -1,4 +1,7 @@
 code AdaptedFMU:
+
+	var condition_executed;
+
 	function instantiate()
 		// We are abstracting away the instances. This needs to be changed to accomodate for that.
 		for each fmu in original_fmus do

+ 14 - 3
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation/examples/sample.BASE.sa

@@ -15,9 +15,19 @@ For now, this is fine.
 */
 semantic adaptation controller_sa
 
-// How is the input/output feedthrough calculated?
-// canInterpolateInputs flag
-// I/O feedthrough
+/*
+How is the input/output feedthrough calculated?
+canInterpolateInputs flag
+I/O feedthrough
+
+I think these may have to be declared here in the model.
+Later they can be generated from some analysis, but for now, it is declared explicitly.
+A possible syntax is to replace the above instruction by
+	semantic adaptation reactive mealy controller_sa
+	semantic adaptation delayed mealy controller_sa
+	semantic adaptation reactive moore controller_sa
+	...
+*/
 
 /*
 Declares the set of original FMUs to be adapted.
@@ -66,6 +76,7 @@ The state of the SA FMU should contain:
 	the values of the computed variables (such as the elapsed time for each FMU)
 */
 in var stored_down := 10;
+control var some_control_var;
 out var some_var := some_expression;
 
 /*

+ 20 - 0
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation/examples/scenario.sa

@@ -1,5 +1,20 @@
 module PowerWindowModel
 
+/*
+Each of these fmu descriptions has to include more information about the FMU.
+Namely:
+	environment must refer to the name of the instance of the FMU. Therefore, the name of the FMU to be instantiated is missing.
+	The location of the .fmu file is also missing.
+	The "type discrete event" no longer serves any purpose, so should be removed.
+	The "full internal dependencies" is not needed once you have the file to parse.
+	The "output ports" can be specified here, for syntax completion purposes, but they can be retrieved from the *.fmu file.
+
+If you agree with these changes, you should have the following:
+	fmu Environent environment // declares the instance name environment of the FMU environment.
+	./path/to/Environment.fmu
+	output ports passenger_up, passenger_down, driver_up, driver_down
+*/
+
 fmu environment
 type discrete event
 output ports passenger_up, passenger_down, driver_up, driver_down
@@ -29,4 +44,9 @@ input ports height (m)
 output ports reaction_force (N)
 full internal dependencies
 
+/*
+The dotted syntax will have to be supported.
+According the Casper and Kenneth, it is very common to have variables with the same name, but that should not be connected. So it is better to not assume implicit connections in this description.
+*/
+
 armature_current -> obj_detected // only ports that change names need to be connected

+ 7 - 2
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation/examples/sketch.BASE.sa

@@ -23,6 +23,11 @@ in var 	iv1 := init_iv1,
 		...
 		;
 
+control var 	cv1 := init_cv1
+				cv2 := init_cv2
+				...
+				;
+
 out var ov1 := init_ov1,
 		ov2 := init_ov2,
 		...
@@ -30,9 +35,9 @@ out var ov1 := init_ov1,
 
 in rules {
 	in_condition_1 -> {
-		sa_in_1 //function with write access to invars with no read access to any vars except input.
+		sa_in_1
 	} --> { 
-		update_in_1 //read all (except out vars) and write access to all invars
+		update_in_1
 	}; 
 	in_condition_2 -> {
 		sa_in_2