Class AggregatedContextSEFFVisitor
- java.lang.Object
-
- org.eclipse.emf.ecore.util.Switch<T>
-
- org.palladiosimulator.pcm.seff.util.SeffSwitch
-
- org.palladiosimulator.solver.visitors.SeffVisitor
-
- org.palladiosimulator.solver.visitors.AggregatedContextSEFFVisitor
-
public class AggregatedContextSEFFVisitor extends SeffVisitor
Visitor that builds up the context model including the aggregated usage context. Extends theSeffVisitor
and adds the calculation of execution frequencies. Uses theAggregatedContextExternalCallActionHandler
instead of theExternalCallActionHandler
.
-
-
Field Summary
-
Fields inherited from class org.palladiosimulator.solver.visitors.SeffVisitor
contextWrapper
-
-
Constructor Summary
Constructors Constructor Description AggregatedContextSEFFVisitor(ContextWrapper ctxWrp, double frequency, org.palladiosimulator.pcm.seff.ServiceEffectSpecification seff, org.palladiosimulator.pcm.usagemodel.UsageScenario currentScenario)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
caseExternalCallAction(org.palladiosimulator.pcm.seff.ExternalCallAction call)
Overwrites theSeffVisitor.caseExternalCallAction(ExternalCallAction)
.Object
caseInternalAction(org.palladiosimulator.pcm.seff.InternalAction action)
Object
caseResourceDemandingBehaviour(org.palladiosimulator.pcm.seff.ResourceDemandingBehaviour behaviour)
Gets the frequency to execute thisResourceDemandingBehaviour
by checking the container.Object
caseResourceDemandingSEFF(org.palladiosimulator.pcm.seff.ResourceDemandingSEFF seff)
ExtendsSeffVisitor.caseResourceDemandingSEFF(ResourceDemandingSEFF)
: stores the described SEFF in theComputedAggregatedUsage
.double
getCurrentFrequency()
Get the current frequency of this object.-
Methods inherited from class org.palladiosimulator.solver.visitors.SeffVisitor
caseAbstractInternalControlFlowAction, caseAcquireAction, caseBranchAction, caseCollectionIteratorAction, caseForkAction, caseGuardedBranchTransition, caseLoopAction, caseProbabilisticBranchTransition, caseReleaseAction, caseSetVariableAction, caseStartAction, caseStopAction, getContextWrapper, setContextWrapper
-
Methods inherited from class org.palladiosimulator.pcm.seff.util.SeffSwitch
caseAbstractAction, caseAbstractBranchTransition, caseAbstractLoopAction, caseCallAction, caseCallReturnAction, caseEmitEventAction, caseEntity, caseFailureHandlingEntity, caseForkedBehaviour, caseIdentifier, caseInternalCallAction, caseNamedElement, caseResourceDemandingInternalBehaviour, caseServiceEffectSpecification, caseSynchronisationPoint, defaultCase, doSwitch, isSwitchFor
-
-
-
-
Constructor Detail
-
AggregatedContextSEFFVisitor
public AggregatedContextSEFFVisitor(ContextWrapper ctxWrp, double frequency, org.palladiosimulator.pcm.seff.ServiceEffectSpecification seff, org.palladiosimulator.pcm.usagemodel.UsageScenario currentScenario)
-
-
Method Detail
-
caseResourceDemandingSEFF
public Object caseResourceDemandingSEFF(org.palladiosimulator.pcm.seff.ResourceDemandingSEFF seff)
ExtendsSeffVisitor.caseResourceDemandingSEFF(ResourceDemandingSEFF)
: stores the described SEFF in theComputedAggregatedUsage
. Then callsSeffVisitor.caseResourceDemandingSEFF(ResourceDemandingSEFF)
. Handles resource demanding seffs. Goes to the first action within the seff..- Overrides:
caseResourceDemandingSEFF
in classSeffVisitor
- Parameters:
seff
- the resource demanding seff- Returns:
- the resource demanding seff
-
caseExternalCallAction
public Object caseExternalCallAction(org.palladiosimulator.pcm.seff.ExternalCallAction call)
Overwrites theSeffVisitor.caseExternalCallAction(ExternalCallAction)
. Does the same, but uses anAggregatedContextExternalCallActionHandler
to handle the call, which in turn will instantiate anAggregatedContextSEFFVisitor
for the next SEFF.- Overrides:
caseExternalCallAction
in classSeffVisitor
- Parameters:
call
- the external call action- Returns:
- the external call action
-
caseInternalAction
public Object caseInternalAction(org.palladiosimulator.pcm.seff.InternalAction action)
ExtendsSeffVisitor.caseInternalAction(InternalAction)
. Adds the calculation of a mean resource demand weighted by frequency of execution. Adds this information to theAggregatedResourceDemand
. Then callsSeffVisitor.caseInternalAction(InternalAction)
. Handles internal actions. Invokes the internalActionHandler, then goes to the next action.- Overrides:
caseInternalAction
in classSeffVisitor
- Parameters:
action
- the internal action- Returns:
- the internal action
-
caseResourceDemandingBehaviour
public Object caseResourceDemandingBehaviour(org.palladiosimulator.pcm.seff.ResourceDemandingBehaviour behaviour)
Gets the frequency to execute thisResourceDemandingBehaviour
by checking the container. If it is aBranchTransition
orAbstractLoopAction
, update the frequency before callingSeffVisitor.caseExternalCallAction(ExternalCallAction)
. Then resets the frequency for the next action or trasition. Then callsSeffVisitor.caseResourceDemandingBehaviour(ResourceDemandingBehaviour)
. Handles resource demanding behaviours. Goes to the first action within the behaviour..- Overrides:
caseResourceDemandingBehaviour
in classSeffVisitor
- Parameters:
behaviour
- the resource demanding behaviour- Returns:
- the resource demanding behaviour
-
getCurrentFrequency
public double getCurrentFrequency()
Get the current frequency of this object. This is not equal to the frequency of thisServiceEffectSpecification
, because the current frequency reflects the frequency of the currently handledAbstractAction
.
-
-