public class SyncProductImpl extends java.lang.Object implements SyncProduct
Modifier and Type | Field and Description |
---|---|
protected int[] |
cost |
protected int[][] |
eventNumbers |
protected byte[] |
finalMarking |
protected byte[] |
initMarking |
protected int[][] |
input |
protected java.lang.String |
label |
protected int[][] |
output |
protected java.lang.String[] |
places |
protected int[] |
ranks |
protected java.lang.String[] |
transitions |
LOG_MOVE, MAXTRANS, MODEL_MOVE, NOEVENT, NORANK, SYNC_MOVE, TAU_MOVE
Constructor and Description |
---|
SyncProductImpl(java.lang.String label,
int numClasses,
java.lang.String[] transitions,
java.lang.String[] places,
int[][] eventNumbers,
int[] ranks,
int[] pathLengths,
byte[] types,
int[] cost) |
Modifier and Type | Method and Description |
---|---|
void |
addToFinalMarking(int... places) |
void |
addToInitialMarking(int... places) |
void |
addToInput(int t,
int... p) |
void |
addToOutput(int t,
int... p) |
int |
getCost(int t)
returns the cost of firing t.
|
int[] |
getEventOf(int transition)
returns the sequence of event numbers associated with this transition.
|
byte[] |
getFinalMarking()
Return the final marking
|
byte[] |
getInitialMarking()
Return the initial marking as an array where each byte represents the marking
of that specific place in the interval 0..3
|
int[] |
getInput(int transition)
Returns a sorted array of places serving as input to transition t
|
java.lang.String |
getLabel()
Returns the label of the synchronous product
|
int[] |
getOutput(int transition)
Returns a sorted array of places serving as output to transition t
|
java.lang.String |
getPlaceLabel(int p)
Return the label of a place
|
int |
getRankOf(int transition)
returns the rank of the transition.
|
java.lang.String |
getTransitionLabel(int t)
Returns the label of transition t
|
int |
getTransitionPathLength(int transition)
Returns the path length of firing this transition in the graph.
|
byte |
getTypeOf(int transition)
returns the type of the transion as a byte equal to one of the constants
defined in this class: LOG_MOVE, SYNC_MOVE, MODEL_MOVE, TAU_MOVE
|
boolean |
isFinalMarking(byte[] marking)
for full alignments: return Arrays.equals(marking, finalMarking);
for prefix alignments: check only if a specific place is marked.
|
int |
numEventClasses()
returns the number of event classes known to this product
|
int |
numEvents()
The number of events in the trace
|
int |
numModelMoves()
returns the number of model moves in this product
|
int |
numPlaces()
The number of places is in principle bounded Integer.MAX_VALUE
|
int |
numTransitions()
Returns the number of transitions.
|
void |
setEventOf(int transition,
int[] event) |
void |
setFinalMarking(byte[] marking) |
void |
setFinalMarking(int... places) |
void |
setInitialMarking(byte[] marking) |
void |
setInitialMarking(int... places) |
void |
setInput(int t,
int... plist) |
void |
setOutput(int t,
int... plist) |
void |
setPlaceLabel(int p,
java.lang.String label) |
void |
setRankOf(int transition,
int rank) |
void |
setTransitionLabel(int t,
java.lang.String label) |
protected final java.lang.String[] transitions
protected final int[][] eventNumbers
protected final int[] ranks
protected final java.lang.String[] places
protected final int[] cost
protected final int[][] input
protected final int[][] output
protected byte[] initMarking
protected byte[] finalMarking
protected final java.lang.String label
public SyncProductImpl(java.lang.String label, int numClasses, java.lang.String[] transitions, java.lang.String[] places, int[][] eventNumbers, int[] ranks, int[] pathLengths, byte[] types, int[] cost)
public int numTransitions()
SyncProduct
numTransitions
in interface SyncProduct
public int numPlaces()
SyncProduct
numPlaces
in interface SyncProduct
public void setInput(int t, int... plist)
public void setOutput(int t, int... plist)
public void addToOutput(int t, int... p)
public void addToInput(int t, int... p)
public int[] getInput(int transition)
SyncProduct
getInput
in interface SyncProduct
public int[] getOutput(int transition)
SyncProduct
getOutput
in interface SyncProduct
public byte[] getInitialMarking()
SyncProduct
getInitialMarking
in interface SyncProduct
public byte[] getFinalMarking()
SyncProduct
getFinalMarking
in interface SyncProduct
public void setInitialMarking(byte[] marking)
public void setFinalMarking(byte[] marking)
public void setInitialMarking(int... places)
public void addToInitialMarking(int... places)
public void setFinalMarking(int... places)
public void addToFinalMarking(int... places)
public int getCost(int t)
SyncProduct
getCost
in interface SyncProduct
public java.lang.String getTransitionLabel(int t)
SyncProduct
getTransitionLabel
in interface SyncProduct
public java.lang.String getPlaceLabel(int p)
SyncProduct
getPlaceLabel
in interface SyncProduct
public void setTransitionLabel(int t, java.lang.String label)
public void setPlaceLabel(int p, java.lang.String label)
public boolean isFinalMarking(byte[] marking)
isFinalMarking
in interface SyncProduct
public java.lang.String getLabel()
SyncProduct
getLabel
in interface SyncProduct
public int[] getEventOf(int transition)
SyncProduct
getEventOf
in interface SyncProduct
public void setEventOf(int transition, int[] event)
public byte getTypeOf(int transition)
SyncProduct
getTypeOf
in interface SyncProduct
public int numEvents()
SyncProduct
numEvents
in interface SyncProduct
public int getRankOf(int transition)
SyncProduct
getRankOf
in interface SyncProduct
public void setRankOf(int transition, int rank)
public int numEventClasses()
SyncProduct
numEventClasses
in interface SyncProduct
public int numModelMoves()
SyncProduct
numModelMoves
in interface SyncProduct
public int getTransitionPathLength(int transition)
SyncProduct
getTransitionPathLength
in interface SyncProduct