Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Commit

Permalink
First commit of the tfsmandactivity operator
Browse files Browse the repository at this point in the history
  • Loading branch information
MatiasVara committed Feb 19, 2016
1 parent b131f68 commit aaa4861
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/gemoc-gen/
17 changes: 17 additions & 0 deletions official_samples/bcool_TFSMAndActivity/language_workbench/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.gemoc.sample.bcool.tfsmandactivity</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.gemoc.bcool.model.xtext.bcoolbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.gemoc.bcool.model.xtext.bcoolnature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
TfsmAndActivities

ImportLib "platform:/resource/org.gemoc.sample.bcool.tfsmandactivity/operator/facilities.bcoollib"
ImportLib "platform:/resource/org.gemoc.sample.bcool.tfsmandactivity/operator/facilities.moccml"

ImportInterface "platform:/resource/org.modelexecution.operationalsemantics.ad.concurrent.ecl/model/ActivitiyDiagramV2.ecl" as activity
ImportInterface "platform:/resource/org.gemoc.sample.tfsm.eclmoc2as/ecl/TFSM.ecl" as tfsm


Operator SyncFSMEventsAndActions (FSMEvents : tfsm::occurs, ActionExecute : activity::executeIt)
when FSMEvents.name = ActionExecute.name;
CoordinationRule:
facilities.RendezVous(FSMEvents, ActionExecute )
end operator;
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
BCoolLibrary facilities{


relationDeclarations {
RelationDeclaration RendezVous {}
, RelationDeclaration Causality {}
}


expressionDeclarations {
ExpressionDeclaration SampledBy{}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
AutomataConstraintLibrary ModeAutomataCoordination{
import "platform:/plugin/fr.inria.aoste.timesquare.ccslkernel.model/ccsllibrary/kernel.ccslLib" as kernel;
import "platform:/plugin/fr.inria.aoste.timesquare.ccslkernel.model/ccsllibrary/CCSL.ccslLib" as CCSLLib;


RelationLibrary CCSLBasedRelations {

RelationDefinition RendezVousDef[RendezVous]{
Relation RendezVousrelat[Coincides]( Clock1->ClockA, Clock2->ClockB)
}

RelationDefinition CausalityDef[Causality]{
Relation Causalityrelat[Causes]( LeftClock->ClockLeft, RightClock->ClockRight)
}

RelationDefinition RendezVouswithGlobalClockDef[RendezVouswithGlobalClock]{
Expression sampledStartAction = SampledBy (Sampled -> globalClock, Trigger-> startAction)
Expression sampledOccurs = SampledBy (Sampled -> globalClock, Trigger-> occurs)

Relation RendezVousSamples[Coincides]( Clock2-> sampledStartAction , Clock1-> sampledOccurs )
}

AutomataRelationDefinition RendenVousAfterTwoDef[RendenVousAfterTwo]{
init: initState

from initState to firstOccurs : initStateTofirstOccurs
-> ( )

from firstOccurs to secondOccurs : firstOccurstoSecondOccurs
-> ( when eventA )

from secondOccurs to firstOccurs : secondOccurstoFirstOccurs
-> ( when eventA , eventB)

State initState( out : initStateTofirstOccurs )
State firstOccurs ( in : initStateTofirstOccurs, secondOccurstoFirstOccurs out : firstOccurstoSecondOccurs)
State secondOccurs ( in : firstOccurstoSecondOccurs out : secondOccurstoFirstOccurs)
}

RelationDeclaration RendezVous (ClockA:clock, ClockB:clock)
RelationDeclaration Causality (ClockLeft:clock, ClockRight:clock)
RelationDeclaration RendezVouswithGlobalClock (startAction: clock , occurs: clock, globalClock: clock )

RelationDeclaration RendenVousAfterTwo(
eventA:clock,
eventB:clock
)
}

ExpressionLibrary BCOolfilters{
ExpressionDefinition FilterNDef [FilterN]{
root=filterN_result
Expression filterN_result = Periodic
( PeriodicBaseClock->WaitingClock, PeriodicPeriod -> WaitingValue, PeriodicOffset -> four)
}

ExpressionDefinition SampledDef [SampledBy]{
root=Sample_result
Expression Sample_result = SampledOn(SampledOnTrigger -> Trigger, SampledOnSampledClock ->Sampled)
}

ExpressionDeclaration SampledBy(Trigger: clock, Sampled: clock):clock
ExpressionDeclaration FilterN(WaitingClock: clock, WaitingValue: int):clock

}


}

0 comments on commit aaa4861

Please sign in to comment.