diff --git a/edu.kit.ipd.descartes.mm.adaptation.sta/misc/StaLangExample.stalang b/edu.kit.ipd.descartes.mm.adaptation.sta/misc/StaLangExample.stalang index 7d50acd6e339e2497a8ec45e57c73e49fdb9ce7d..9b318484891a19d785af275f4161f3e77a8804f1 100644 --- a/edu.kit.ipd.descartes.mm.adaptation.sta/misc/StaLangExample.stalang +++ b/edu.kit.ipd.descartes.mm.adaptation.sta/misc/StaLangExample.stalang @@ -3,60 +3,71 @@ // place imports here, e.g. // import uri +// Summary of operators +// '=' is an assignment +// ':' starts a list (e.g.: elementA, elementB, elementC) + AdaptationProcess ExampleProcessName { goal - description "A verbose description of the goal of the adaptation process so that + // '=' is an assignment, i.e., a text is assigned to myDescription + Description myDescription = "A verbose description of the goal of the adaptation process so that anyone can understand the purpose of the modeled adaptation process" - objectives: - Objective Objective1Name specification "A string specifying the objective 1" - Objective Objective2Name specification "A string specifying the objective 2" + objectives: // ':' starts a list + Objective Objective1Name = "A string specifying the objective 1", + Objective Objective2Name = "A string specifying the objective 2" actions: Action Action1Name operationType SCALE_OUT { // optional input output parameters - input param1Name, param3Name - output param3Name - referredAdaptationPoint ref:xyz1 // I have no clue so far how to refer to external model instances + input: param1Name, param2Name + output: param3Name + referredAdaptationPoint ref:xyz1 THIS INCREASE // I have no clue so far how to refer to external model instances + // THIS and INCREASE are values for AdaptationScope and AdaptationDirection } + // Alternative notation for an Action (possible in Xtext?): + // param3Name Action1Name(param1Name, param2Name) {referredAdaptationPoint ref:xyz1, THIS, SCALE_UP} + Action Action2Name operationType SCALE_IN { // optional parameters - referredAdaptationPoint ref:xyz2 // I have no clue so far how to refer to external model instances + referredAdaptationPoint ref:xyz2 RANDOM MIGRATE// I have no clue so far how to refer to external model instances } tactics: Tactic Tactic1Name { // optional input output parameters - input param1Name, param3Name - output param3Name - implementedPlan{StartAction, Action1Name, ... Action2Name, StopAction} + input: param1Name, param2Name + output: param3Name + implementedPlan: StartAction, Action1Name, ... Action2Name, StopAction } + // Alternative notation for a Tactic: + // param3Name Tactic1Name(param1Name, param2Name) {StartAction, Action1Name, ... Action2Name, StopAction} + Tactic Tactic2Name { // optional input output parameters - implementedPlan{ - StartAction, - // Some other actions - StopAction - } + implementedPlan: + StartAction, + // Some other actions + StopAction } strategies: Strategy Strategy1Name { - objective Objective1Name - triggeringEvents Event EventXYName - tactics { - WeightedTactic usedTactic Tactic1Name 1.3 1.0 ref:LastImpactXY1, - WeightedTactic usedTactic Tactic2Name 2.1 2.0 ref:LastImpactXY2 - } + objective=Objective1Name + triggeringEvents=EventXYName + tactics: + WeightedTactic1Name=Tactic1Name 1.3 1.0 ref:LastImpactXY1, + WeightedTactic2Name=Tactic2Name 2.1 2.0 ref:LastImpactXY2 + weightingFunction WeightingFunction1Name { - WeightedMetric 1.9 ref:ResponseTimeMetric1 - WeightedMetric 2.3 ref:UtilizationMetric1 + WeightedMetric1Name = 1.9 ref:ResponseTimeMetric1 + WeightedMetric2Name = 2.3 ref:UtilizationMetric1 } } // definition of parameters should be optional parameters: - Parameter param1Name - Parameter param2Name - Parameter param3Name + ParamTypeA param1Name, + ParamTypeB param2Name, + ParamTypeC param3Name } \ No newline at end of file