|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdk.brics.bisimulationGame.model.GrappaModel
public class GrappaModel
A local data model holding a Grappa graph.
Field Summary | |
---|---|
private att.grappa.Node |
currentNode
|
private att.grappa.Graph |
graph
|
private java.lang.String |
initialNodeName
|
private java.util.HashMap<att.grappa.Node,java.util.Vector<Successor>> |
successorMap
|
private att.grappa.Node |
toNode
|
Constructor Summary | |
---|---|
GrappaModel(java.lang.String initialNodeName)
Constructs a Grappa model given the name of the initial node in the graph. |
Method Summary | |
---|---|
att.grappa.Node |
getCurrentNode()
|
java.lang.String |
getEdgeAction(att.grappa.Edge edge)
Called when an edge has been clicked by the attacker. |
private java.util.Vector<java.lang.String> |
getEdgeLabels(java.util.Vector<Successor> toMap,
att.grappa.Node to)
Get the labels of in-edges of node 'to'. |
att.grappa.Graph |
getGraph()
|
att.grappa.Node |
getInitialNode()
|
boolean |
getMatchingEdgeAction(att.grappa.Edge edge,
java.lang.String otherAction)
Called when an edge has been clicked by the defender. |
boolean |
getMatchingNodeAction(att.grappa.Node node,
java.lang.String attackersAction)
Called when a node has been clicked by the defender. |
int |
getNumberOfStrongChoices()
Return the number of outgoing edges from the current node. |
java.util.Vector<Successor> |
getStrongChoices()
Used by an attacker to get all choices from the current node that are not weak. |
private java.util.HashMap<att.grappa.Node,java.util.Vector<Successor>> |
getStrongSuccessorMap()
Makes a map from each node to its direct successors. |
java.util.HashMap<att.grappa.Node,java.util.Vector<Successor>> |
getSuccessorMap()
|
java.lang.String |
getUniqueNodeAction(att.grappa.Node node)
Called when a node has been clicked by the attacker. |
private java.util.HashMap<att.grappa.Node,java.util.Vector<Successor>> |
getWeakSuccessorMap()
Makes a map from each node to its weak successors. |
boolean |
isActionEnabled(java.lang.String action)
Check to see if there exists an outgoing edge from current node that has label = action. |
private void |
layoutGraph(java.lang.String dotPath)
Attempts to layout a graph using the Graphviz dot program. |
boolean |
makeGrappaPanelFromGraph(java.lang.String dot,
java.lang.String dotPath,
int bisimulation)
First construct a dot graph, then pass it to Grappa and try to make a Graph. |
boolean |
noActionEnabled()
|
void |
reset()
Reset the displayed automaton to its initial state. |
private void |
step()
|
void |
stepTo(java.lang.String nodeName)
Step to a given node in the graph. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private att.grappa.Graph graph
private att.grappa.Node currentNode
private att.grappa.Node toNode
private java.lang.String initialNodeName
private java.util.HashMap<att.grappa.Node,java.util.Vector<Successor>> successorMap
Constructor Detail |
---|
public GrappaModel(java.lang.String initialNodeName)
initialNodeName
- The name of the initial nodeMethod Detail |
---|
public boolean makeGrappaPanelFromGraph(java.lang.String dot, java.lang.String dotPath, int bisimulation)
dot
- String representation of a dot-filedotPath
- Path to dot programbisimulation
- Bisimulation type, used for creating a successor map
private void layoutGraph(java.lang.String dotPath)
dotPath
- Path to the dot executablepublic att.grappa.Graph getGraph()
public att.grappa.Node getCurrentNode()
public java.lang.String getEdgeAction(att.grappa.Edge edge)
edge
- Edge that has been mouse-clicked
public boolean getMatchingEdgeAction(att.grappa.Edge edge, java.lang.String otherAction)
edge
- Edge that has been mouse-clickedotherAction
- Other action that must be matched
public java.lang.String getUniqueNodeAction(att.grappa.Node node)
node
- The node clicked.
public boolean getMatchingNodeAction(att.grappa.Node node, java.lang.String attackersAction)
node
- The node clickedattackersAction
- Other action that must be matched
private void step()
public void reset()
public void stepTo(java.lang.String nodeName)
nodeName
- The name of the node to step topublic boolean isActionEnabled(java.lang.String action)
action
- Name of edge label to match
public boolean noActionEnabled()
public int getNumberOfStrongChoices()
public java.util.Vector<Successor> getStrongChoices()
public att.grappa.Node getInitialNode()
private java.util.HashMap<att.grappa.Node,java.util.Vector<Successor>> getStrongSuccessorMap()
private java.util.HashMap<att.grappa.Node,java.util.Vector<Successor>> getWeakSuccessorMap()
private java.util.Vector<java.lang.String> getEdgeLabels(java.util.Vector<Successor> toMap, att.grappa.Node to)
toMap
- to
-
public java.util.HashMap<att.grappa.Node,java.util.Vector<Successor>> getSuccessorMap()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |