Package org.graphwalker.core.model
Class Edge
- All Implemented Interfaces:
Builder<Edge.RuntimeEdge>
Edge
The Edge holds the information for a transition in a model. The edge represents an action performed by a test, which takes the system under test, from a state to another. The edge has a source and target vertex. If the vertices are identical, the edge is a self loop. The source vertex is not mandatory, but in a model, there should be only one such instance. Also, the target vertex is not mandatory, but again, in a model, there should be only one such instance.- Author:
- Nils Olsson
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds an action to the edge, which represents a piece of code that will be executed each time the edge is being traversed.addActions(List<Action> actions) addActions(Action... actions) protected Edge.RuntimeEdgeCreates an immutable edge from this edge.Gets the lists of actions of the edge.Gets the dependency of the edge.getGuard()Gets the guard of the edge.Gets the source vertex.Gets the target vertex of the edge.Gets the weight of the edge.setActions(List<Action> actions) Adds a list of actions to the edge, which represents a pieces of code that will be executed each time the edge is being traversed.setDependency(Integer dependency) The dependency shows how much targetVertex depends on sourceVertex.Sets the guard of the edge.setSourceVertex(Vertex vertex) Sets the source vertex of the edge.setTargetVertex(Vertex vertex) Sets the target vertex of the edge.The weight is used as probability when using theWeightedRandomPath.Methods inherited from class org.graphwalker.core.model.CachedBuilder
addRequirement, build, invalidateCache, setId, setName, setProperties, setProperty, setRequirementsMethods inherited from class org.graphwalker.core.model.BuilderBase
getId, getName, getProperties, getProperty, getRequirements, hasProperty
-
Constructor Details
-
Edge
public Edge()
-
-
Method Details
-
setSourceVertex
Sets the source vertex of the edge.- Parameters:
vertex- The source vertex.- Returns:
- The edge.
-
getSourceVertex
Gets the source vertex.- Returns:
- The source vertex.
- See Also:
-
setTargetVertex
Sets the target vertex of the edge.- Parameters:
vertex- The target vertex.- Returns:
- The edge.
-
getTargetVertex
Gets the target vertex of the edge.- Returns:
- The vertex.
- See Also:
-
setGuard
Sets the guard of the edge. The code in the guard is by default interpreted as javascript. The guard works like an 'if-statement'. It controls the accessibility of the edge. During execution, the guard evaluates to a boolean expression. If true, the edge is accessible, else it's not.- Parameters:
guard- The guard.- Returns:
- The edge.
-
getGuard
Gets the guard of the edge.- Returns:
- The guard.
- See Also:
-
addAction
Adds an action to the edge, which represents a piece of code that will be executed each time the edge is being traversed. The code is by default interpreted as javascript.- Parameters:
action- The action.- Returns:
- The edge.
-
addActions
-
addActions
-
setActions
Adds a list of actions to the edge, which represents a pieces of code that will be executed each time the edge is being traversed. The code snippets is by default interpreted as javascript.- Parameters:
actions- The actions.- Returns:
- The edge.
- See Also:
-
getActions
Gets the lists of actions of the edge.- Returns:
- The actions
- See Also:
-
getWeight
Gets the weight of the edge.- Returns:
- The weight as double.
- See Also:
-
setWeight
The weight is used as probability when using theWeightedRandomPath. Weight means the probability for the edge to be selected.- Parameters:
weight- a double between 0 and 1- Returns:
- The edge
-
createCache
Creates an immutable edge from this edge.- Specified by:
createCachein classCachedBuilder<Edge,Edge.RuntimeEdge> - Returns:
- An immutable edge as a RuntimeEdge
-
getDependency
Gets the dependency of the edge.- Returns:
- The dependency as double.
- See Also:
-
setDependency
The dependency shows how much targetVertex depends on sourceVertex. One way to obtain the dependency is by using process mining to generate a model out of log files.- Parameters:
dependency- a double between 0 and 1- Returns:
- The edge
-