Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## pipe.modules.gspn
Class GSPN

    java.lang.Object
      pipe.modules.classification.Classification
          pipe.modules.gspn.GSPN

All Implemented Interfaces:
  Module

public class GSPN
extends Classification
implements Module

Author:
  Matthew Cook

Field Summary
`private static java.lang.String` | `MODULE_NAME`
`private ResultsHTMLPane` | `results`
`(package private) java.awt.event.ActionListener` | `runAnalysis` Analyse button click handler
`private PetriNetChooserPanel` | `sourceFilePanel`

Fields inherited from class pipe.modules.classification.Classification
``

Constructor Summary
`GSPN()`

Method Summary
`private double[]` | `calcMeanCycleTimes(double[] embeddedMarkovChain, double xHat)`
`private jama.Matrix` | `calcMeanNumVisits(double[] embeddedMarkovProcess)` This function calculates the mean number of visits at a particular transition, given a particular embedded Markov Process
`private double[]` | `calcSojournTime(DataLayer pnmldata, StateList tangibleStates)` This function determines the sojourn time for each state in a specified set of states.
`private double[]` | `getEmbeddedMarkovChainSteadyStateDistribution(jama.Matrix c, jama.Matrix d, jama.Matrix e, jama.Matrix f)`
`private int[]` | `getMarking(DataLayer pnmlData)` Get the initial marking of the supplied net
`java.lang.String` | `getName()`
`private double` | `getRateForSpecificStateChange(DataLayer pnmlData, int[] marking1, int[] marking2)`
`private StateList` | `getReachabilitySet(DataLayer pnmlData)` Generate the reachability set using myTree function Add each marking to an arraylist, testing to see if the marking is already present before adding.
`private double[]` | `getSteadyStateDistribution(double[] meanCycleTimes, double[] sojournTimes)`
`private boolean[]` | `getTangibleTransitionEnabledStatusArray(DataLayer pnmlData, int[] marking)`
`private boolean` | `getTransitionEnabledStatus(DataLayer pnmlData, int[] marking, int transition)` Caluculate whether a transition is enabled given a specific marking
`private boolean[]` | `getTransitionEnabledStatusArray(DataLayer pnmlData, int[] marking)` Caluculate which transitions are enabled given a specific marking
`private double[][]` | `getTransitionProbabilityMatrix(DataLayer pnmlData, StateList reachabilitySet)` Constructs a matrix of probabilities of changing from one marking to another.
`private double[]` | `getTransitionThroughput(DataLayer pnmldata, StateList vanishing, StateList tangible, jama.Matrix rateForSpecificChange, double[] steadyStateDistribution)`
`private double` | `getTransitionThroughputSPN(DataLayer pnmldata, StateList list, double[] steadyStateDistrib, int transitionNumber)`
`private void` | `getVanishingAndTangible(DataLayer pnmlData, StateList reachabilitySet, StateList vanishing, StateList tangible)` This function takes a reachability set and splits it into subsets of tangible and vanishing states
`private double` | `getVanishingStateThroughput(DataLayer pnmldata, StateList list1, int transitionNumber, jama.Matrix rateForSpecificState)`
`private boolean` | `hasImmediateTransitions(DataLayer pnmldata)` See if the supplied net has any timed transitions.
`private boolean` | `hasTimedTransitions(DataLayer pnmldata)` See if the supplied net has any timed transitions.
`private boolean` | `isEFCGSPN(DataLayer pnmlData)` Qualitative analysis - see if the supplied GSPN is an EFC-GSPN.
`private boolean` | `isTangibleState(DataLayer pnmlData, int[] marking)` Work out if a specified marking describes a tangible state.
`private void` | `multiplyRow(jama.Matrix input, int row, double factor)`
`private void` | `print(boolean[] transitions)`
`private void` | `printMarking(int[] marking)`
`private void` | `printMatrix(double[][] input)`
`private void` | `printMatrix(int[][] input)`
`private double[][]` | `probabilityMatrix(DataLayer pnmldata, StateList list1, StateList list2)`
`private double` | `probMarkingAToMarkingB(DataLayer pnmlData, int[] marking1, int[] marking2)` Calculate the probability of changing from one marking to another Works out the intersection of transitions enabled to fire at a particular marking, transitions that can be reached from a particular marking and the intersection of the two.
`private double[][]` | `rateMatrix(DataLayer pnmlData, StateList list1, StateList list2)`
`private double[]` | `reduction(jama.Matrix input)` This function performs a Gaussian reduction on a given Matrix, returning an array of values representing the solution.
`private java.lang.String` | `renderLists(double[] data, StateList list)`
`private java.lang.String` | `renderProbabilities(double[][] probabilities, StateList list1, StateList list2)`
`private java.lang.String` | `renderStateSpace(DataLayer pnmldata, StateList data)`
`private java.lang.String` | `renderStateSpaceLinked(DataLayer pnmldata, StateList data)`
`private java.lang.String` | `renderThroughput(DataLayer pnmldata, double[] data)`
`void` | `run(DataLayer pnmlData)`
`private void` | `subtractRow(jama.Matrix input, int row1, int row2)`
`private void` | `swapRows(jama.Matrix input, int row1, int row2)`
`private boolean` | `testEqualConflict(DataLayer pnmlData)` Test for condition Equal Conflict.
`private double` | `xHat(double[] piBar, double[] sojournTimes)`

Methods inherited from class pipe.modules.classification.Classification
`extendedFreeChoiceNet, extendedSimpleNet, freeChoiceNet, intersectionBetweenSets, markedGraph, simpleNet, stateMachine`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### MODULE_NAME

    private static final java.lang.String MODULE_NAME

See Also:
  Constant Field Values

### sourceFilePanel

    private PetriNetChooserPanel sourceFilePanel

### results

    private ResultsHTMLPane results

### runAnalysis

    java.awt.event.ActionListener runAnalysis

  Analyse button click handler

Constructor Detail

### GSPN

    public GSPN()

Method Detail

### run

    public void run(DataLayer pnmlData)

  Specified by:
    `run` in interface `Module`
  Overrides:
    `run` in class `Classification`

### renderStateSpace

    private java.lang.String renderStateSpace(DataLayer pnmldata,
                                              StateList data)

### renderStateSpaceLinked

    private java.lang.String renderStateSpaceLinked(DataLayer pnmldata,
                                                    StateList data)

### renderThroughput

    private java.lang.String renderThroughput(DataLayer pnmldata,
                                              double[] data)

### renderProbabilities

    private java.lang.String renderProbabilities(double[][] probabilities,
                                                 StateList list1,
                                                 StateList list2)

### renderLists

    private java.lang.String renderLists(double[] data,
                                         StateList list)

### isEFCGSPN

    private boolean isEFCGSPN(DataLayer pnmlData)

  Qualitative analysis - see if the supplied GSPN is an EFC-GSPN. This is a necessary precondition for quantitative analysis.

### getReachabilitySet

    private StateList getReachabilitySet(DataLayer pnmlData)
                                  throws TreeTooBigException

  Generate the reachability set using myTree function Add each marking to an arraylist, testing to see if the marking is already present before adding.

  Returns:
  Throws:
    `TreeTooBigException`

### getMarking

    private int[] getMarking(DataLayer pnmlData)

  Get the initial marking of the supplied net

  Parameters:
    `pnmlData` -
  Returns:

### getTransitionEnabledStatus

    private boolean getTransitionEnabledStatus(DataLayer pnmlData,
                                               int[] marking,
                                               int transition)

  Caluculate whether a transition is enabled given a specific marking

  Returns:
    boolean - an array of booleans specifying which transitions are enabled in the specified marking

### getTransitionEnabledStatusArray

    private boolean[] getTransitionEnabledStatusArray(DataLayer pnmlData,
                                                      int[] marking)

  Caluculate which transitions are enabled given a specific marking

  Returns:
    boolean[] - an array of booleans specifying which transitions are enabled in the specified marking

### getTangibleTransitionEnabledStatusArray

    private boolean[] getTangibleTransitionEnabledStatusArray(DataLayer pnmlData,
                                                              int[] marking)

### isTangibleState

    private boolean isTangibleState(DataLayer pnmlData,
                                    int[] marking)

  Work out if a specified marking describes a tangible state. A state is either tangible (all enabled transitions are timed) or vanishing (there exists at least one enabled state that is transient, i.e. untimed). If an immediate transition exists, it will automatically fire before a timed transition.

  Returns:
    boolean - is it tangible or not

### getVanishingAndTangible

    private void getVanishingAndTangible(DataLayer pnmlData,
                                         StateList reachabilitySet,
                                         StateList vanishing,
                                         StateList tangible)

  This function takes a reachability set and splits it into subsets of tangible and vanishing states

### calcMeanNumVisits

    private jama.Matrix calcMeanNumVisits(double[] embeddedMarkovProcess)

  This function calculates the mean number of visits at a particular transition, given a particular embedded Markov Process

  Returns:
    Matrix

### calcSojournTime

    private double[] calcSojournTime(DataLayer pnmldata,
                                     StateList tangibleStates)

  This function determines the sojourn time for each state in a specified set of states.

  Returns:
    double[] - the array of sojourn times for each specific state

### xHat

    private double xHat(double[] piBar,
                        double[] sojournTimes)

### calcMeanCycleTimes

    private double[] calcMeanCycleTimes(double[] embeddedMarkovChain,
                                        double xHat)

### getSteadyStateDistribution

    private double[] getSteadyStateDistribution(double[] meanCycleTimes,
                                                double[] sojournTimes)

### testEqualConflict

    private boolean testEqualConflict(DataLayer pnmlData)

  Test for condition Equal Conflict. I.E., for all t1, t2 in the set of transitions, where t1<>t2, that share the same input place, either t1, t2 are both in the set of timed transitions (T1) or t1, t2 are both in the set of immediate transitions (T2).

  Returns:
    boolean

### probMarkingAToMarkingB

    private double probMarkingAToMarkingB(DataLayer pnmlData,
                                          int[] marking1,
                                          int[] marking2)

  Calculate the probability of changing from one marking to another Works out the intersection of transitions enabled to fire at a particular marking, transitions that can be reached from a particular marking and the intersection of the two. Then sums the firing rates of the intersection and divides it by the sum of the firing rates of the enabled transitions.

  Returns:
    double - the probability

### getRateForSpecificStateChange

    private double getRateForSpecificStateChange(DataLayer pnmlData,
                                                 int[] marking1,
                                                 int[] marking2)

### rateMatrix

    private double[][] rateMatrix(DataLayer pnmlData,
                                  StateList list1,
                                  StateList list2)

### getVanishingStateThroughput

    private double getVanishingStateThroughput(DataLayer pnmldata,
                                               StateList list1,
                                               int transitionNumber,
                                               jama.Matrix rateForSpecificState)

### getTransitionThroughputSPN

    private double getTransitionThroughputSPN(DataLayer pnmldata,
                                              StateList list,
                                              double[] steadyStateDistrib,
                                              int transitionNumber)

### getTransitionThroughput

    private double[] getTransitionThroughput(DataLayer pnmldata,
                                             StateList vanishing,
                                             StateList tangible,
                                             jama.Matrix rateForSpecificChange,
                                             double[] steadyStateDistribution)

### getTransitionProbabilityMatrix

    private double[][] getTransitionProbabilityMatrix(DataLayer pnmlData,
                                                      StateList reachabilitySet)

  Constructs a matrix of probabilities of changing from one marking to another. Uses the reachability set to determine all markings, and applies the probMarkingAToMarkingB function to calculate probability for each pair of markings

  Parameters:
    `pnmlData` -
  Returns:

### print

    private void print(boolean[] transitions)

### getName

    public java.lang.String getName()

  Specified by:
    `getName` in interface `Module`
  Overrides:
    `getName` in class `Classification`

### getEmbeddedMarkovChainSteadyStateDistribution

    private double[] getEmbeddedMarkovChainSteadyStateDistribution(jama.Matrix c,
                                                                   jama.Matrix d,
                                                                   jama.Matrix e,
                                                                   jama.Matrix f)

  Returns:
    double[] - the steady state distributions for Markov chain embedded in tangible states This function produces a solution for the following equations: P' = F + E*((I-C)^-1)*D π bar * P' = π bar Σ (π bar (i)) ∀ i == 1 where π bar is the vector of the embedded Markov chain steady state distribution. See Falko Bause - Stochastic Petri Nets - An Introduction to the Theory p181.

### hasTimedTransitions

    private boolean hasTimedTransitions(DataLayer pnmldata)

  See if the supplied net has any timed transitions.

  Returns:
    boolean

### hasImmediateTransitions

    private boolean hasImmediateTransitions(DataLayer pnmldata)

  See if the supplied net has any timed transitions.

  Returns:
    boolean

### reduction

    private double[] reduction(jama.Matrix input)

  This function performs a Gaussian reduction on a given Matrix, returning an array of values representing the solution.

  Returns:
    double[] - the array of solutions

### swapRows

    private void swapRows(jama.Matrix input,
                          int row1,
                          int row2)

### multiplyRow

    private void multiplyRow(jama.Matrix input,
                             int row,
                             double factor)

### subtractRow

    private void subtractRow(jama.Matrix input,
                             int row1,
                             int row2)

### probabilityMatrix

    private double[][] probabilityMatrix(DataLayer pnmldata,
                                         StateList list1,
                                         StateList list2)

### printMatrix

    private void printMatrix(double[][] input)

### printMatrix

    private void printMatrix(int[][] input)

### printMarking

    private void printMarking(int[] marking)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD