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 theSeffVisitorand adds the calculation of execution frequencies. Uses theAggregatedContextExternalCallActionHandlerinstead 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 ObjectcaseExternalCallAction(org.palladiosimulator.pcm.seff.ExternalCallAction call)Overwrites theSeffVisitor.caseExternalCallAction(ExternalCallAction).ObjectcaseInternalAction(org.palladiosimulator.pcm.seff.InternalAction action)ObjectcaseResourceDemandingBehaviour(org.palladiosimulator.pcm.seff.ResourceDemandingBehaviour behaviour)Gets the frequency to execute thisResourceDemandingBehaviourby checking the container.ObjectcaseResourceDemandingSEFF(org.palladiosimulator.pcm.seff.ResourceDemandingSEFF seff)ExtendsSeffVisitor.caseResourceDemandingSEFF(ResourceDemandingSEFF): stores the described SEFF in theComputedAggregatedUsage.doublegetCurrentFrequency()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:
caseResourceDemandingSEFFin 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 anAggregatedContextExternalCallActionHandlerto handle the call, which in turn will instantiate anAggregatedContextSEFFVisitorfor the next SEFF.- Overrides:
caseExternalCallActionin 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:
caseInternalActionin 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 thisResourceDemandingBehaviourby checking the container. If it is aBranchTransitionorAbstractLoopAction, 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:
caseResourceDemandingBehaviourin 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.
-
-