pipe.modules.invariantAnalysis
Class InvariantAnalysis

java.lang.Object
  extended bypipe.modules.invariantAnalysis.InvariantAnalysis
All Implemented Interfaces:
Module

public class InvariantAnalysis
extends java.lang.Object
implements Module


Field Summary
(package private)  java.awt.event.ActionListener analyseButtonClick
          Classify button click handler
private  PNMatrix IncidenceMatrix
           
private static java.lang.String MODULE_NAME
           
private  PNMatrix PInvariants
           
private  ResultsHTMLPane results
           
private  PetriNetChooserPanel sourceFilePanel
           
private  PNMatrix TInvariants
           
 
Constructor Summary
InvariantAnalysis()
           
 
Method Summary
 int[] alphaCoef(int k, int[] j)
          adjust linear combination coefficients according to sign if sign(j) <> sign(k) then alpha = abs(j) beta = abs(k) if sign(j) == sign(k) then alpha = -abs(j) beta = abs(k)
private  java.lang.String analyse(DataLayer pnmlData)
           
 int[] betaCoef(int chk, int n)
          adjust linear combination coefficients according to sign if sign(j) <> sign(k) then alpha = abs(j) beta = abs(k) if sign(j) == sign(k) then alpha = -abs(j) beta = abs(k)
 int effectiveSetLength(int[] pSet)
          find the number of non-zero elements in a set
 java.lang.String findNetInvariants(int[] M0)
          Find the net invariants.
 java.lang.String findPEquations(int[] initialMarking)
          Find the P equations of the net.
 PNMatrix findVectors(PNMatrix C)
          Transform a matrix to obtain the minimal generating set of vectors.
 java.lang.String getName()
           
 boolean isEmptySet(int[] pSet)
          check if an array is empty (only zeros)
 java.lang.String reportPInvariants(int[] M0)
          Reports on the P invariants.
 java.lang.String reportTInvariants(int[] M0)
          Reports on the T invariants.
 void resetArray(int[] a)
           
 void run(DataLayer pnmlData)
          Call the methods that find the net invariants.
 int[] uniteSets(int[] A, int[] B)
          Unite two sets (arrays of integers) so that if there is a common entry in the arrays it appears only once, and all the entries of each array appear in the union.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IncidenceMatrix

private PNMatrix IncidenceMatrix

PInvariants

private PNMatrix PInvariants

TInvariants

private PNMatrix TInvariants

MODULE_NAME

private static final java.lang.String MODULE_NAME
See Also:
Constant Field Values

sourceFilePanel

private PetriNetChooserPanel sourceFilePanel

results

private ResultsHTMLPane results

analyseButtonClick

java.awt.event.ActionListener analyseButtonClick
Classify button click handler

Constructor Detail

InvariantAnalysis

public InvariantAnalysis()
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface Module
Returns:
The module name

run

public void run(DataLayer pnmlData)
Call the methods that find the net invariants.

Specified by:
run in interface Module

analyse

private java.lang.String analyse(DataLayer pnmlData)

findNetInvariants

public java.lang.String findNetInvariants(int[] M0)
Find the net invariants.

Parameters:
M0 - An array containing the initial marking of the net.
Returns:
A string containing the resulting matrices of P and T Invariants or "None" in place of one of the matrices if it does not exist.

reportPInvariants

public java.lang.String reportPInvariants(int[] M0)
Reports on the P invariants.

Parameters:
M0 - An array containing the initial marking of the net.
Returns:
A string containing the resulting matrix of P Invariants, the P equations and some analysis

reportTInvariants

public java.lang.String reportTInvariants(int[] M0)
Reports on the T invariants.

Parameters:
M0 - An array containing the initial marking of the net.
Returns:
A string containing the resulting matrix of T Invariants and some analysis of it

findPEquations

public java.lang.String findPEquations(int[] initialMarking)
Find the P equations of the net.

Parameters:
initialMarking - An array containing the initial marking of the net.
Returns:
A string containing the resulting P equations, empty string if the equations do not exist.

findVectors

public PNMatrix findVectors(PNMatrix C)
Transform a matrix to obtain the minimal generating set of vectors.

Parameters:
C - The matrix to transform.
Returns:
A matrix containing the vectors.

effectiveSetLength

public int effectiveSetLength(int[] pSet)
find the number of non-zero elements in a set

Parameters:
pSet - The set count the number of non-zero elements.
Returns:
The number of non-zero elements.

alphaCoef

public int[] alphaCoef(int k,
                       int[] j)
adjust linear combination coefficients according to sign if sign(j) <> sign(k) then alpha = abs(j) beta = abs(k) if sign(j) == sign(k) then alpha = -abs(j) beta = abs(k)

Parameters:
k - The column index of the first coefficient
j - The column indices of the remaining coefficients
Returns:
The adjusted alpha coefficients

betaCoef

public int[] betaCoef(int chk,
                      int n)
adjust linear combination coefficients according to sign if sign(j) <> sign(k) then alpha = abs(j) beta = abs(k) if sign(j) == sign(k) then alpha = -abs(j) beta = abs(k)

Parameters:
chk - The first coefficient
n - The length of one row
Returns:
The adjusted beta coefficients

resetArray

public void resetArray(int[] a)

uniteSets

public int[] uniteSets(int[] A,
                       int[] B)
Unite two sets (arrays of integers) so that if there is a common entry in the arrays it appears only once, and all the entries of each array appear in the union. The resulting array size is the same as the 2 arrays and they are both equal. We are only interested in non-zero elements. One of the 2 input arrays is always full of zeros.

Parameters:
A - The first set to unite.
B - The second set to unite.
Returns:
The union of the two input sets.

isEmptySet

public boolean isEmptySet(int[] pSet)
check if an array is empty (only zeros)

Parameters:
pSet - The set to check if it is empty.
Returns:
True if the set is empty.