public class RelSet<M,N extends IEntity> extends Object implements IEntityModel<N>
| Modifier and Type | Field and Description |
|---|---|
protected List<N> |
entities
The relations are defined over a dedicated set of entities
of the model, e.g., only transitions of a Petri net or only
labelled transitions of a Petri net.
|
protected int |
lookAhead |
protected RelSetType[][] |
matrix
The matrix that captures the actual relations
for the Cartesian product of the respective entities.
|
protected M |
model
The model (e.g., Petri net) for which this class captures
the set of behavioural relations.
|
static int |
RELATION_FAR_LOOKAHEAD |
| Constructor and Description |
|---|
RelSet(int size)
Creates a relation set for a given number of entities.
|
RelSet(M model,
Collection<N> entities)
Creates a relation set for a given model and
a dedicated collection of entities of the model.
|
RelSet(M model,
Collection<N> entities,
int lookAhead) |
RelSet(M model,
List<N> entities)
Creates a relation set for a given model and
a dedicated list of entities of the model.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
areExclusive(N n1,
N n2)
Checks whether two given entities are exclusive.
|
boolean |
areInOrder(N n1,
N n2)
Checks whether two given entities are ordered.
|
boolean |
areInterleaving(N n1,
N n2)
Checks whether two given entities are interleaving.
|
boolean |
equals(RelSet<M,N> relationSet)
Checks equality for two relation sets.
|
boolean |
equalsForSharedEntities(RelSet<M,N> relationSet)
Checks equality for two relation sets only for the
shared entities.
|
RelSet<M,N> |
getComplement()
Returns the complement of the relation set .
|
static RelSetType |
getComplementRelation(RelSetType rel)
Returns the complementary relation for a relation.
|
List<N> |
getEntities() |
Collection<N> |
getEntitiesInRelation(N n,
RelSetType relationType)
Returns all entities that are in a given behavioural relation with a given entity.
|
int |
getLookAhead() |
RelSetType[][] |
getMatrix() |
M |
getModel() |
RelSetType |
getRelationForEntities(N n1,
N n2)
Returns the behavioural relation for two given entities.
|
RelSetType |
getRelationForIndex(int index1,
int index2)
Returns the type of the behavioural relation for the two entities that are identified
by their index in the list of entities for which the relation set is defined.
|
HashMap<RelSetType,HashSet<String>> |
getRelationsByType(Set<RelSetType> relationTypes) |
static RelSetType |
getReverseRelation(RelSetType rel)
Returns the reverse relation for a relation, if defined.
|
static String |
getSymbolForRelation(RelSetType rel)
Returns a short string representation for a behavioural relation.
|
boolean |
isEmpty()
Checks emptiness of a relation set.
|
void |
printAllEntities(RelSetType relationType)
Dumps all entities in a given behavioural relation to the standard output.
|
void |
setLookAhead(int lookAhead) |
void |
setMatrix(RelSetType[][] matrix) |
String |
toString() |
public static final int RELATION_FAR_LOOKAHEAD
protected int lookAhead
protected M model
protected List<N extends IEntity> entities
protected RelSetType[][] matrix
public RelSet(M model, List<N> entities)
model, - a modelentities, - a list of entities of the modelpublic RelSet(M model, Collection<N> entities)
model, - a modelentities, - a list of entities of the modelpublic RelSet(M model, Collection<N> entities, int lookAhead)
public RelSet(int size)
size, - i.e., number of entities over which the relations are definedpublic static RelSetType getReverseRelation(RelSetType rel)
relation - typepublic static RelSetType getComplementRelation(RelSetType rel)
relation - typepublic RelSetType[][] getMatrix()
public void setMatrix(RelSetType[][] matrix)
public List<N> getEntities()
getEntities in interface IEntityModel<N extends IEntity>public M getModel()
public int getLookAhead()
public void setLookAhead(int lookAhead)
public static String getSymbolForRelation(RelSetType rel)
type - of the behavioural relationpublic boolean areInterleaving(N n1, N n2)
n1 - n2 - public boolean areExclusive(N n1, N n2)
n1 - n2 - public boolean areInOrder(N n1, N n2)
n1 - n2 - public RelSetType getRelationForEntities(N n1, N n2)
n1 - n2 - public RelSetType getRelationForIndex(int index1, int index2)
index1 - index2 - public Collection<N> getEntitiesInRelation(N n, RelSetType relationType)
an - entitya - behavioural relation typepublic void printAllEntities(RelSetType relationType)
a - behavioural relation typepublic boolean equals(RelSet<M,N> relationSet)
profile - that should be comparedpublic boolean equalsForSharedEntities(RelSet<M,N> relationSet)
profile - that should be comparedpublic boolean isEmpty()
public RelSet<M,N> getComplement()
public HashMap<RelSetType,HashSet<String>> getRelationsByType(Set<RelSetType> relationTypes)
Copyright © 2017. All rights reserved.