Class MarkovSeffVisitor
- java.lang.Object
-
- org.eclipse.emf.ecore.util.Switch<T>
-
- org.palladiosimulator.pcm.seff.util.SeffSwitch<org.palladiosimulator.reliability.markov.MarkovChain>
-
- org.palladiosimulator.solver.reliability.pcm2markov.MarkovSeffVisitor
-
public class MarkovSeffVisitor extends org.palladiosimulator.pcm.seff.util.SeffSwitch<org.palladiosimulator.reliability.markov.MarkovChain>
This class represents a visitor for an RDSEFF within a PCM instance. The visitor is used in the transformation from PCM with solved dependencies into a Markov Chain Model for reliability prediction.
-
-
Constructor Summary
Constructors Constructor Description MarkovSeffVisitor(MarkovTransformationSource transformationState, ContextWrapper wrapper, List<String> prefixes, org.palladiosimulator.reliability.MarkovEvaluationType evaluationType, boolean simplifiedStateHandling, boolean optimize, boolean recordTraces)
The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.palladiosimulator.reliability.markov.MarkovChain
caseAbstractInternalControlFlowAction(org.palladiosimulator.pcm.seff.AbstractInternalControlFlowAction controlFlowAction)
Handles RecoveryActions.org.palladiosimulator.reliability.markov.MarkovChain
caseAcquireAction(org.palladiosimulator.pcm.seff.AcquireAction acquireAction)
An Acquire Action returns a trivial Markov Chain.org.palladiosimulator.reliability.markov.MarkovChain
caseBranchAction(org.palladiosimulator.pcm.seff.BranchAction branchAction)
For a BranchAction, first the Markov Chain of each of the transition behaviours is built.org.palladiosimulator.reliability.markov.MarkovChain
caseCollectionIteratorAction(org.palladiosimulator.pcm.seff.CollectionIteratorAction collectionIteratorAction)
A collection iterator action is handled the same way as an ordinary loop.org.palladiosimulator.reliability.markov.MarkovChain
caseExternalCallAction(org.palladiosimulator.pcm.seff.ExternalCallAction externalCallAction)
Handles an ExternalCallAction.org.palladiosimulator.reliability.markov.MarkovChain
caseForkAction(org.palladiosimulator.pcm.seff.ForkAction forkAction)
Handles fork actions.org.palladiosimulator.reliability.markov.MarkovChain
caseInternalAction(org.palladiosimulator.pcm.seff.InternalAction internalAction)
An InternalAction is an actual possible point of failure, either because a software failure might happen, or because a required physical resource may be currently unavailable.org.palladiosimulator.reliability.markov.MarkovChain
caseLoopAction(org.palladiosimulator.pcm.seff.LoopAction loopAction)
For a LoopAction, first the Markov Chain of the body behaviour is built.org.palladiosimulator.reliability.markov.MarkovChain
caseReleaseAction(org.palladiosimulator.pcm.seff.ReleaseAction releaseAction)
A Release Action returns a trivial Markov Chain.org.palladiosimulator.reliability.markov.MarkovChain
caseResourceDemandingBehaviour(org.palladiosimulator.pcm.seff.ResourceDemandingBehaviour behaviour)
Evaluates a resource demanding behaviour by considering all actions in the behaviour.org.palladiosimulator.reliability.markov.MarkovChain
caseResourceDemandingSEFF(org.palladiosimulator.pcm.seff.ResourceDemandingSEFF seff)
Evaluates a resource demanding SEFF.org.palladiosimulator.reliability.markov.MarkovChain
caseSetVariableAction(org.palladiosimulator.pcm.seff.SetVariableAction setVariableAction)
A SetVariableAction returns a trivial Markov Chain.org.palladiosimulator.reliability.markov.MarkovChain
caseStartAction(org.palladiosimulator.pcm.seff.StartAction startAction)
A StartAction returns a trivial Markov Chain.org.palladiosimulator.reliability.markov.MarkovChain
caseStopAction(org.palladiosimulator.pcm.seff.StopAction stopAction)
A StopAction returns a trivial Markov Chain.-
Methods inherited from class org.palladiosimulator.pcm.seff.util.SeffSwitch
caseAbstractAction, caseAbstractBranchTransition, caseAbstractLoopAction, caseCallAction, caseCallReturnAction, caseEmitEventAction, caseEntity, caseFailureHandlingEntity, caseForkedBehaviour, caseGuardedBranchTransition, caseIdentifier, caseInternalCallAction, caseNamedElement, caseProbabilisticBranchTransition, caseResourceDemandingInternalBehaviour, caseServiceEffectSpecification, caseSynchronisationPoint, defaultCase, doSwitch, isSwitchFor
-
-
-
-
Constructor Detail
-
MarkovSeffVisitor
public MarkovSeffVisitor(MarkovTransformationSource transformationState, ContextWrapper wrapper, List<String> prefixes, org.palladiosimulator.reliability.MarkovEvaluationType evaluationType, boolean simplifiedStateHandling, boolean optimize, boolean recordTraces)
The constructor.- Parameters:
transformationState
- the Markov transformation statewrapper
- the ContextWrapper provides easy access to the decorations of the solved PCM instanceprefixes
- the list of prefixes for state namesevaluationType
- the degree of differentiation between failure typessimplifiedStateHandling
- controls the handling of physical resource statesoptimize
- controls if Markov Chain reduction is performed during transformationrecordTraces
- controls if traces shall be recorded during transformation
-
-
Method Detail
-
caseAbstractInternalControlFlowAction
public org.palladiosimulator.reliability.markov.MarkovChain caseAbstractInternalControlFlowAction(org.palladiosimulator.pcm.seff.AbstractInternalControlFlowAction controlFlowAction)
Handles RecoveryActions. This is a workaround using the case for AbstractInternalControlFlowActions, because RecoveryActions are not directly contained in the SEFF package, and thus there is no case for them. First, for each RecoveryActionBehaviour a specific Markov chain is built. Then, specific chains are appended to each other according to the specification of handled failure types.- Overrides:
caseAbstractInternalControlFlowAction
in classorg.palladiosimulator.pcm.seff.util.SeffSwitch<org.palladiosimulator.reliability.markov.MarkovChain>
- Parameters:
controlFlowAction
- the control flow action- Returns:
- the resulting Markov Chain.
-
caseAcquireAction
public org.palladiosimulator.reliability.markov.MarkovChain caseAcquireAction(org.palladiosimulator.pcm.seff.AcquireAction acquireAction)
An Acquire Action returns a trivial Markov Chain.- Overrides:
caseAcquireAction
in classorg.palladiosimulator.pcm.seff.util.SeffSwitch<org.palladiosimulator.reliability.markov.MarkovChain>
- Parameters:
acquireAction
- the acquire action- Returns:
- the resulting Markov Chain.
-
caseBranchAction
public org.palladiosimulator.reliability.markov.MarkovChain caseBranchAction(org.palladiosimulator.pcm.seff.BranchAction branchAction)
For a BranchAction, first the Markov Chain of each of the transition behaviours is built. The results are then inserted into a new Markov Chain that has one State for each of the possible branches.- Overrides:
caseBranchAction
in classorg.palladiosimulator.pcm.seff.util.SeffSwitch<org.palladiosimulator.reliability.markov.MarkovChain>
- Parameters:
branchAction
- the BranchAction- Returns:
- the resulting Markov Chain
-
caseCollectionIteratorAction
public org.palladiosimulator.reliability.markov.MarkovChain caseCollectionIteratorAction(org.palladiosimulator.pcm.seff.CollectionIteratorAction collectionIteratorAction)
A collection iterator action is handled the same way as an ordinary loop.- Overrides:
caseCollectionIteratorAction
in classorg.palladiosimulator.pcm.seff.util.SeffSwitch<org.palladiosimulator.reliability.markov.MarkovChain>
- Parameters:
collectionIteratorAction
- the CollectionIteratoraction- Returns:
- the resulting Markov Chain
-
caseExternalCallAction
public org.palladiosimulator.reliability.markov.MarkovChain caseExternalCallAction(org.palladiosimulator.pcm.seff.ExternalCallAction externalCallAction)
Handles an ExternalCallAction. Generates a Markov Chain of the executing behavior. The Markov Chain is generated byMarkovSeffVisitor.createExternalCallActionChain
. If an retry count is set in the internal action, the chain is repeatedly appended to the main chains failure state.- Overrides:
caseExternalCallAction
in classorg.palladiosimulator.pcm.seff.util.SeffSwitch<org.palladiosimulator.reliability.markov.MarkovChain>
- Parameters:
externalCallAction
- the ExternalCallAction- Returns:
- the resulting Markov Chain.
-
caseForkAction
public org.palladiosimulator.reliability.markov.MarkovChain caseForkAction(org.palladiosimulator.pcm.seff.ForkAction forkAction)
Handles fork actions. All forked behaviours are handled sequentially.- Overrides:
caseForkAction
in classorg.palladiosimulator.pcm.seff.util.SeffSwitch<org.palladiosimulator.reliability.markov.MarkovChain>
-
caseInternalAction
public org.palladiosimulator.reliability.markov.MarkovChain caseInternalAction(org.palladiosimulator.pcm.seff.InternalAction internalAction)
An InternalAction is an actual possible point of failure, either because a software failure might happen, or because a required physical resource may be currently unavailable. A Markov chain is returned that reflects all possible outcomes and their probabilities.- Overrides:
caseInternalAction
in classorg.palladiosimulator.pcm.seff.util.SeffSwitch<org.palladiosimulator.reliability.markov.MarkovChain>
- Parameters:
internalAction
- the InternalAction- Returns:
- the resulting Markov Chain
-
caseLoopAction
public org.palladiosimulator.reliability.markov.MarkovChain caseLoopAction(org.palladiosimulator.pcm.seff.LoopAction loopAction)
For a LoopAction, first the Markov Chain of the body behaviour is built. The result is then inserted into a new Markov Chain that has one State for each of the possible iteration counts of the loop.- Overrides:
caseLoopAction
in classorg.palladiosimulator.pcm.seff.util.SeffSwitch<org.palladiosimulator.reliability.markov.MarkovChain>
- Parameters:
loopAction
- the LoopAction- Returns:
- the resulting Markov Chain
-
caseReleaseAction
public org.palladiosimulator.reliability.markov.MarkovChain caseReleaseAction(org.palladiosimulator.pcm.seff.ReleaseAction releaseAction)
A Release Action returns a trivial Markov Chain.- Overrides:
caseReleaseAction
in classorg.palladiosimulator.pcm.seff.util.SeffSwitch<org.palladiosimulator.reliability.markov.MarkovChain>
- Parameters:
releaseAction
- the release action- Returns:
- the resulting Markov Chain.
-
caseResourceDemandingBehaviour
public org.palladiosimulator.reliability.markov.MarkovChain caseResourceDemandingBehaviour(org.palladiosimulator.pcm.seff.ResourceDemandingBehaviour behaviour)
Evaluates a resource demanding behaviour by considering all actions in the behaviour. Returns a corresponding Markov chain.- Overrides:
caseResourceDemandingBehaviour
in classorg.palladiosimulator.pcm.seff.util.SeffSwitch<org.palladiosimulator.reliability.markov.MarkovChain>
- Parameters:
behaviour
- the ResourceDemandingBehaviour- Returns:
- the resulting Markov Chain
-
caseResourceDemandingSEFF
public org.palladiosimulator.reliability.markov.MarkovChain caseResourceDemandingSEFF(org.palladiosimulator.pcm.seff.ResourceDemandingSEFF seff)
Evaluates a resource demanding SEFF. In addition to the behavioural evaluation, also the availability of the executing resource container is checked. Returns a corresponding Markov chain.- Overrides:
caseResourceDemandingSEFF
in classorg.palladiosimulator.pcm.seff.util.SeffSwitch<org.palladiosimulator.reliability.markov.MarkovChain>
- Parameters:
seff
- the ResourceDemandingSEFF- Returns:
- the resulting Markov Chain
-
caseSetVariableAction
public org.palladiosimulator.reliability.markov.MarkovChain caseSetVariableAction(org.palladiosimulator.pcm.seff.SetVariableAction setVariableAction)
A SetVariableAction returns a trivial Markov Chain.- Overrides:
caseSetVariableAction
in classorg.palladiosimulator.pcm.seff.util.SeffSwitch<org.palladiosimulator.reliability.markov.MarkovChain>
- Parameters:
setVariableAction
- the SetVariableAction- Returns:
- the resulting Markov Chain
-
caseStartAction
public org.palladiosimulator.reliability.markov.MarkovChain caseStartAction(org.palladiosimulator.pcm.seff.StartAction startAction)
A StartAction returns a trivial Markov Chain.- Overrides:
caseStartAction
in classorg.palladiosimulator.pcm.seff.util.SeffSwitch<org.palladiosimulator.reliability.markov.MarkovChain>
- Parameters:
startAction
- the StartAction- Returns:
- the resulting trivial Markov Chain
-
caseStopAction
public org.palladiosimulator.reliability.markov.MarkovChain caseStopAction(org.palladiosimulator.pcm.seff.StopAction stopAction)
A StopAction returns a trivial Markov Chain.- Overrides:
caseStopAction
in classorg.palladiosimulator.pcm.seff.util.SeffSwitch<org.palladiosimulator.reliability.markov.MarkovChain>
- Parameters:
stopAction
- the StopAction- Returns:
- the resulting trivial Markov Chain
-
-