Class MarkovBuilder
java.lang.Object
org.palladiosimulator.reliability.solver.pcm2markov.MarkovBuilder
This class provides methods for building Markov Chains.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
appendFailureHandlingMarkovChain
(MarkovChain aggregateChain, MarkovChain handlingChain, List<String> handledFailureTypeIds, boolean optimize) Incorporates one Markov Chain into another.void
appendFailureHandlingMarkovChains
(MarkovChain aggregateChain, List<MarkovChain> handlingChains, List<List<String>> handledFailureTypeIdLists, boolean optimize) Incorporates multiple Markov Chains into one aggregate chain.copyMarkovChain
(MarkovChain originalMarkovChain) Creates a copy of a Markov Chain.getFailureStates
(MarkovChain markovChain) Gets all failure states out of a given Markov chain.getFailureTypeId
(State state) Gets the failure type annotation of a Markov failure state.getFailureTypeName
(State state) Gets the failure type annotation of a Markov failure state.getStartState
(MarkovChain markovChain) Gets the start state out of a given Markov chain.getSuccessState
(MarkovChain markovChain) Gets the success state out of a given Markov chain.void
incorporateMarkovChain
(MarkovChain parentChain, MarkovChain specificMarkovChain, State aggregateState, boolean optimize, boolean appendPrefixes) Incorporates one Markov Chain into another.int
indexOf
(MarkovChain markovChain, State state) Retrieves the index of a given State within a given Markov Chain.initBasicMarkovChain
(List<String> prefixes) Initializes a new Markov Chain.initBasicMarkovChainWithFailures
(List<String> prefixes, List<FailureDescription> failureDescriptions) Creates a basic Markov chain with a start, success and multiple failure nodes for a given list of failure descriptions.initBehaviourMarkovChainByAction
(List<String> prefixes, List<org.palladiosimulator.pcm.seff.AbstractAction> actions, List<State> statesOut) Creates a Markov Chain that represents an execution of a ScenarioBehaviour or ResourceDemandingBehaviour.initBranchMarkovChain
(List<String> prefixes, ArrayList<Double> branchProbabilities) Creates a Markov Chain for a branch with solved branch probabilities.initForkMarkovChain
(List<String> prefixes, ArrayList<org.palladiosimulator.pcm.seff.ForkedBehaviour> behaviours, ArrayList<State> statesOut) Creates a Markov Chain for a fork action with a list of forked behaviours.initLoopMarkovChain
(List<String> prefixes, de.uka.ipd.sdq.probfunction.math.ManagedPMF pmf) Creates a Markov Chain for a loop with solved probability mass function.initResourceFailureMarkovChain
(List<String> prefixes, List<FailureDescription> failureDescriptions) Creates a Markov chain for an internal action failing with probability 1.0 because of unavailable hardware resources.Creates a Markov Chain that represents a sequential execution path.
-
Constructor Details
-
MarkovBuilder
public MarkovBuilder(boolean recordTraces) The constructor.- Parameters:
recordTraces
- controls if traces shall be recorded during transformation
-
-
Method Details
-
appendFailureHandlingMarkovChain
public void appendFailureHandlingMarkovChain(MarkovChain aggregateChain, MarkovChain handlingChain, List<String> handledFailureTypeIds, boolean optimize) Incorporates one Markov Chain into another. The specific Markov Chain is inserted into the aggregate Markov Chain replacing the failure state.- Parameters:
aggregateChain
- the Markov Chain which will incorporate the other chainhandlingChain
- the Markov Chain which will be incorporated into the other chainhandledFailureTypeIds
- the list of handled failure typesoptimize
- indicates if Markov Chain reduction shall be performed during the transformation
-
appendFailureHandlingMarkovChains
public void appendFailureHandlingMarkovChains(MarkovChain aggregateChain, List<MarkovChain> handlingChains, List<List<String>> handledFailureTypeIdLists, boolean optimize) Incorporates multiple Markov Chains into one aggregate chain. The specific Markov Chains are inserted into the aggregate Markov Chain replacing the failure states.- Parameters:
aggregateChain
- the Markov Chain which will incorporate the other chainshandlingChains
- the Markov Chains which will be incorporated into the other chainhandledFailureTypeIdLists
- the list of handled failure types per chainoptimize
- indicates if Markov Chain reduction shall be performed during the transformation
-
copyMarkovChain
Creates a copy of a Markov Chain. All States and Transitions of the original Markov Chain are copied into the new one.- Parameters:
originalMarkovChain
- the original Markov Chain- Returns:
- the new Markov Chain
-
getFailureStates
Gets all failure states out of a given Markov chain.- Parameters:
markovChain
- the Markov chain- Returns:
- the list of failure states
-
getFailureTypeId
Gets the failure type annotation of a Markov failure state.- Parameters:
state
- the state to examine- Returns:
- the failure type annotation of the state
-
getFailureTypeName
Gets the failure type annotation of a Markov failure state.- Parameters:
state
- the state to examine- Returns:
- the failure type annotation of the state
-
getStartState
Gets the start state out of a given Markov chain.- Parameters:
markovChain
- the Markov chain- Returns:
- the start state
-
getSuccessState
Gets the success state out of a given Markov chain.- Parameters:
markovChain
- the Markov Chain- Returns:
- the Success State
-
incorporateMarkovChain
public void incorporateMarkovChain(MarkovChain parentChain, MarkovChain specificMarkovChain, State aggregateState, boolean optimize, boolean appendPrefixes) Incorporates one Markov Chain into another. The specific Markov Chain is inserted into the aggregate Markov Chain replacing the given aggregate Markov State.- Parameters:
parentChain
- the Markov Chain which will incorporate the other chainspecificMarkovChain
- the Markov Chain which will be incorporated into the other chainaggregateState
- the Markov State in the aggregate Markov Chain which will be replaced by the specific Markov Chainoptimize
- indicates if Markov Chain reduction shall be performed during the transformationappendPrefixes
- indicates if prefixes of specific chain shall be appended to prefixes of aggregateChain
-
indexOf
Retrieves the index of a given State within a given Markov Chain.- Parameters:
markovChain
- the Markov Chainstate
- the state to find- Returns:
- the required index
-
initBasicMarkovChain
Initializes a new Markov Chain. The new Markov Chain has only three states: a start state, a success state and a failure state. A single transition goes from start to success with probability 1.- Parameters:
prefixes
- the prefixes of the chain name- Returns:
- the new Markov Chain
-
initBasicMarkovChainWithFailures
public MarkovChain initBasicMarkovChainWithFailures(List<String> prefixes, List<FailureDescription> failureDescriptions) Creates a basic Markov chain with a start, success and multiple failure nodes for a given list of failure descriptions. Such a chain can be used to represent an internal action with its application failure probabilities, or the sending of a message over a communication link. All failure probabilities must sum up to at most 1.0.- Parameters:
prefixes
- the prefixes of the chain namefailureDescriptions
- a list of failure descriptions- Returns:
- the resulting Markov Chain
-
initBehaviourMarkovChainByAction
public MarkovChain initBehaviourMarkovChainByAction(List<String> prefixes, List<org.palladiosimulator.pcm.seff.AbstractAction> actions, List<State> statesOut) Creates a Markov Chain that represents an execution of a ScenarioBehaviour or ResourceDemandingBehaviour.- Parameters:
prefixes
- the prefixes of the Markov Chain nameactions
- the actions of the BehaviourstatesOut
- the list of states created within the method that corresponds to the given list of actions- Returns:
- the resulting Markov Chain
-
initBranchMarkovChain
public MarkovChain initBranchMarkovChain(List<String> prefixes, ArrayList<Double> branchProbabilities) Creates a Markov Chain for a branch with solved branch probabilities.- Parameters:
prefixes
- the prefixes of the branch namebranchProbabilities
- the branch probabilities- Returns:
- the resulting Markov Chain
-
initForkMarkovChain
public MarkovChain initForkMarkovChain(List<String> prefixes, ArrayList<org.palladiosimulator.pcm.seff.ForkedBehaviour> behaviours, ArrayList<State> statesOut) Creates a Markov Chain for a fork action with a list of forked behaviours.- Parameters:
prefixes
- the prefixes of the fork namebehaviours
- the list of forked behavioursstatesOut
- the list of states created within the method- Returns:
- the resulting Markov chain
-
initLoopMarkovChain
public MarkovChain initLoopMarkovChain(List<String> prefixes, de.uka.ipd.sdq.probfunction.math.ManagedPMF pmf) Creates a Markov Chain for a loop with solved probability mass function.- Parameters:
prefixes
- the prefixes of the loop namepmf
- the probability mass function of the loop- Returns:
- the resulting Markov Chain
-
initResourceFailureMarkovChain
public MarkovChain initResourceFailureMarkovChain(List<String> prefixes, List<FailureDescription> failureDescriptions) Creates a Markov chain for an internal action failing with probability 1.0 because of unavailable hardware resources. The failure probability is divided between all unavailable resources.- Parameters:
prefixes
- the prefixes of the chain namefailureDescriptions
- a list of failure descriptions for hardware resources- Returns:
- the resulting Markov Chain
-
initSequentialMarkovChain
public MarkovChain initSequentialMarkovChain(List<String> prefixes, List<String> stateNames, List<State> statesOut) Creates a Markov Chain that represents a sequential execution path.- Parameters:
prefixes
- the prefixes of the Markov Chain namestateNames
- the names of the states to createstatesOut
- the list of states created within the method that corresponds to the given list of state names- Returns:
- the resulting Markov Chain
-