Class MarkovBuilder
- java.lang.Object
-
- org.palladiosimulator.solver.reliability.pcm2markov.MarkovBuilder
-
public class MarkovBuilder extends Object
This class provides methods for building Markov Chains.
-
-
Constructor Summary
Constructors Constructor Description MarkovBuilder(boolean recordTraces)
The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendFailureHandlingMarkovChain(org.palladiosimulator.reliability.markov.MarkovChain aggregateChain, org.palladiosimulator.reliability.markov.MarkovChain handlingChain, List<String> handledFailureTypeIds, boolean optimize)
Incorporates one Markov Chain into another.void
appendFailureHandlingMarkovChains(org.palladiosimulator.reliability.markov.MarkovChain aggregateChain, List<org.palladiosimulator.reliability.markov.MarkovChain> handlingChains, List<List<String>> handledFailureTypeIdLists, boolean optimize)
Incorporates multiple Markov Chains into one aggregate chain.org.palladiosimulator.reliability.markov.MarkovChain
copyMarkovChain(org.palladiosimulator.reliability.markov.MarkovChain originalMarkovChain)
Creates a copy of a Markov Chain.List<org.palladiosimulator.reliability.markov.State>
getFailureStates(org.palladiosimulator.reliability.markov.MarkovChain markovChain)
Gets all failure states out of a given Markov chain.String
getFailureTypeId(org.palladiosimulator.reliability.markov.State state)
Gets the failure type annotation of a Markov failure state.String
getFailureTypeName(org.palladiosimulator.reliability.markov.State state)
Gets the failure type annotation of a Markov failure state.org.palladiosimulator.reliability.markov.State
getStartState(org.palladiosimulator.reliability.markov.MarkovChain markovChain)
Gets the start state out of a given Markov chain.org.palladiosimulator.reliability.markov.State
getSuccessState(org.palladiosimulator.reliability.markov.MarkovChain markovChain)
Gets the success state out of a given Markov chain.void
incorporateMarkovChain(org.palladiosimulator.reliability.markov.MarkovChain parentChain, org.palladiosimulator.reliability.markov.MarkovChain specificMarkovChain, org.palladiosimulator.reliability.markov.State aggregateState, boolean optimize, boolean appendPrefixes)
Incorporates one Markov Chain into another.int
indexOf(org.palladiosimulator.reliability.markov.MarkovChain markovChain, org.palladiosimulator.reliability.markov.State state)
Retrieves the index of a given State within a given Markov Chain.org.palladiosimulator.reliability.markov.MarkovChain
initBasicMarkovChain(List<String> prefixes)
Initializes a new Markov Chain.org.palladiosimulator.reliability.markov.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.org.palladiosimulator.reliability.markov.MarkovChain
initBehaviourMarkovChainByAction(List<String> prefixes, List<org.palladiosimulator.pcm.seff.AbstractAction> actions, List<org.palladiosimulator.reliability.markov.State> statesOut)
Creates a Markov Chain that represents an execution of a ScenarioBehaviour or ResourceDemandingBehaviour.org.palladiosimulator.reliability.markov.MarkovChain
initBranchMarkovChain(List<String> prefixes, ArrayList<Double> branchProbabilities)
Creates a Markov Chain for a branch with solved branch probabilities.org.palladiosimulator.reliability.markov.MarkovChain
initForkMarkovChain(List<String> prefixes, ArrayList<org.palladiosimulator.pcm.seff.ForkedBehaviour> behaviours, ArrayList<org.palladiosimulator.reliability.markov.State> statesOut)
Creates a Markov Chain for a fork action with a list of forked behaviours.org.palladiosimulator.reliability.markov.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.org.palladiosimulator.reliability.markov.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.org.palladiosimulator.reliability.markov.MarkovChain
initSequentialMarkovChain(List<String> prefixes, List<String> stateNames, List<org.palladiosimulator.reliability.markov.State> statesOut)
Creates a Markov Chain that represents a sequential execution path.
-
-
-
Method Detail
-
appendFailureHandlingMarkovChain
public void appendFailureHandlingMarkovChain(org.palladiosimulator.reliability.markov.MarkovChain aggregateChain, org.palladiosimulator.reliability.markov.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(org.palladiosimulator.reliability.markov.MarkovChain aggregateChain, List<org.palladiosimulator.reliability.markov.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
public org.palladiosimulator.reliability.markov.MarkovChain copyMarkovChain(org.palladiosimulator.reliability.markov.MarkovChain originalMarkovChain)
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
public List<org.palladiosimulator.reliability.markov.State> getFailureStates(org.palladiosimulator.reliability.markov.MarkovChain markovChain)
Gets all failure states out of a given Markov chain.- Parameters:
markovChain
- the Markov chain- Returns:
- the list of failure states
-
getFailureTypeId
public String getFailureTypeId(org.palladiosimulator.reliability.markov.State state)
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
public String getFailureTypeName(org.palladiosimulator.reliability.markov.State state)
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
public org.palladiosimulator.reliability.markov.State getStartState(org.palladiosimulator.reliability.markov.MarkovChain markovChain)
Gets the start state out of a given Markov chain.- Parameters:
markovChain
- the Markov chain- Returns:
- the start state
-
getSuccessState
public org.palladiosimulator.reliability.markov.State getSuccessState(org.palladiosimulator.reliability.markov.MarkovChain markovChain)
Gets the success state out of a given Markov chain.- Parameters:
markovChain
- the Markov Chain- Returns:
- the Success State
-
incorporateMarkovChain
public void incorporateMarkovChain(org.palladiosimulator.reliability.markov.MarkovChain parentChain, org.palladiosimulator.reliability.markov.MarkovChain specificMarkovChain, org.palladiosimulator.reliability.markov.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
public int indexOf(org.palladiosimulator.reliability.markov.MarkovChain markovChain, org.palladiosimulator.reliability.markov.State state)
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
public org.palladiosimulator.reliability.markov.MarkovChain initBasicMarkovChain(List<String> prefixes)
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 org.palladiosimulator.reliability.markov.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 org.palladiosimulator.reliability.markov.MarkovChain initBehaviourMarkovChainByAction(List<String> prefixes, List<org.palladiosimulator.pcm.seff.AbstractAction> actions, List<org.palladiosimulator.reliability.markov.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 org.palladiosimulator.reliability.markov.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 org.palladiosimulator.reliability.markov.MarkovChain initForkMarkovChain(List<String> prefixes, ArrayList<org.palladiosimulator.pcm.seff.ForkedBehaviour> behaviours, ArrayList<org.palladiosimulator.reliability.markov.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 org.palladiosimulator.reliability.markov.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 org.palladiosimulator.reliability.markov.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 org.palladiosimulator.reliability.markov.MarkovChain initSequentialMarkovChain(List<String> prefixes, List<String> stateNames, List<org.palladiosimulator.reliability.markov.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
-
-