TrustGrapher  r52
A playabale simulator for modelling trust between agents
cu.trustGrapher.graphs.SimAbstractGraph Class Reference
Inheritance diagram for cu.trustGrapher.graphs.SimAbstractGraph:
Collaboration diagram for cu.trustGrapher.graphs.SimAbstractGraph:

List of all members.

Public Member Functions

 SimAbstractGraph (GraphConfig graphConfig, SimpleDirectedGraph innerGraph)
JungAdapterGraph getReferenceGraph ()
String getDisplayName ()
Object getAlgorithm ()
int getID ()
boolean isDisplayed ()
boolean evaluate (Context< Graph< Agent, TestbedEdge >, Object > context)
void graphConstructionEvent (TrustLogEvent event)
abstract void graphEvent (TrustLogEvent event, boolean forward)

Protected Member Functions

Agent ensureAgentExists (int id, JungAdapterGraph< Agent, TestbedEdge > caller)
TestbedEdge ensureEdgeExists (Agent src, Agent sink, JungAdapterGraph< Agent, TestbedEdge > caller)
void removeEdgeAndVertices (TestbedEdge edge)

Protected Attributes

JungAdapterGraph< Agent,
TestbedEdge
referenceGraph
GraphConfig graphConfig

Detailed Description

A graph superclass that inherits lower level Graph methods from JungAdapterGraph This classs accepts a parameter of the jGraphT SimpleDirectedGraph that this graph is to be based on. The parameter will be used to create the superclass which acts as thje dynamic graph, and also to create a field which is the full graph.

This SimAbstractGraph acts as a dynamic graph. It is not displayed, but components in the full graph will only be displayed if they exist in the dynamic graph. As events occur, they are added to the dynamic graphs through their graphEvent() method.

The full graph is a field in this graph. It is shown in the GraphViewer, but all vertices and edges that are ever shown must be on the full graph before the events start playing. Their graphConstructionEvent() method is used as the events are parsed to add all components to the graph.

Author:
Andrew O'Hara

Definition at line 32 of file SimAbstractGraph.java.


Constructor & Destructor Documentation

cu.trustGrapher.graphs.SimAbstractGraph.SimAbstractGraph ( GraphConfig  graphConfig,
SimpleDirectedGraph  innerGraph 
)

Calls superclass and initializes some fields

Parameters:
graphConfigThis object contains all of the configurations for this graph
innerGraphThe TrustTestBed graph that is to be a base graph for this graph

Definition at line 43 of file SimAbstractGraph.java.


Member Function Documentation

Agent cu.trustGrapher.graphs.SimAbstractGraph.ensureAgentExists ( int  id,
JungAdapterGraph< Agent, TestbedEdge caller 
) [protected]

Ensures that an Agent with the given ID exists in the graph If it doesn't, then it is added

Parameters:
idthe ID of the agent that must exist
callerThe graph to search in for the agent
Returns:
An instance of the Agent that is to exist in the graph

Definition at line 117 of file SimAbstractGraph.java.

Here is the caller graph for this function:

TestbedEdge cu.trustGrapher.graphs.SimAbstractGraph.ensureEdgeExists ( Agent  src,
Agent  sink,
JungAdapterGraph< Agent, TestbedEdge caller 
) [protected]

Ensures that the edge with the given agents exists in the graph. If it doesn't exist, create it and add it to the graph. Then return the edge.

Parameters:
srcThe Agent that the edge originates from
sinkThe Agent that the edge goes to
callerThe graph that is calling, so that if an edge must be created, it knows what type to make, and what graph to add it to
Returns:
The edge that is assured to be in the graph

Definition at line 138 of file SimAbstractGraph.java.

Here is the caller graph for this function:

boolean cu.trustGrapher.graphs.SimAbstractGraph.evaluate ( Context< Graph< Agent, TestbedEdge >, Object >  context)

This is the predicate for whether to show the graph entities in the GraphViewer. It is called by the GraphViewer during every repaint for every entity. If the entity exists in this dynamic Graph, return true. Otherwise false.

Parameters:
contextThe referenceGraph and element that is being checked
Returns:
Whether to display the element given by the context for the current repaint

Definition at line 98 of file SimAbstractGraph.java.

Object cu.trustGrapher.graphs.SimAbstractGraph.getAlgorithm ( )

Returns the algorithm of this Graphpair. If this GraphPair holds a SimFeedbackGraph, then it returns null.

Returns:
the algorithm of this GraphPair

Definition at line 71 of file SimAbstractGraph.java.

Here is the call graph for this function:

Here is the caller graph for this function:

String cu.trustGrapher.graphs.SimAbstractGraph.getDisplayName ( )

Gets the display name for this graph. The Display name consits of the graphID and the name of the algorithm attached to it.

Returns:
The display name

Definition at line 62 of file SimAbstractGraph.java.

Here is the call graph for this function:

int cu.trustGrapher.graphs.SimAbstractGraph.getID ( )

Returns the id of this graph. It is currently used to generate the name of the graph

Returns:
The graph id

Definition at line 79 of file SimAbstractGraph.java.

Here is the call graph for this function:

JungAdapterGraph cu.trustGrapher.graphs.SimAbstractGraph.getReferenceGraph ( )
Returns:
the full Graph attached to this graph

Definition at line 53 of file SimAbstractGraph.java.

Here is the caller graph for this function:

void cu.trustGrapher.graphs.SimAbstractGraph.graphConstructionEvent ( TrustLogEvent  event)

Called by the EventPlayer whenever a TrustLogEvent occurs. It is assumed that this is a full graph. If this is a normal event, only adds any new Agents that there might be. If it is a null event, it is to signal that there are no more events. In that case, sll the possible edges that there might be are added instead.

Parameters:
eventThe TrustLogEvent that has just occured

Reimplemented in cu.trustGrapher.graphs.SimFeedbackGraph.

Definition at line 197 of file SimAbstractGraph.java.

Here is the call graph for this function:

abstract void cu.trustGrapher.graphs.SimAbstractGraph.graphEvent ( TrustLogEvent  event,
boolean  forward 
) [pure virtual]

Called by the EventPlayer whenever a TrustLogEvent occurs. It is assumed that this graph is a dynamic graph. This method handles the addition or subtraction of edges and agents from the dynamic graph, and edge labels for both based on the event that is currently being processed.

Parameters:
eventThe TrustLogEvent that is being processed
forwardWhether or not the graph is being played forward

Implemented in cu.trustGrapher.graphs.SimReputationGraph, cu.trustGrapher.graphs.SimTrustGraph, and cu.trustGrapher.graphs.SimFeedbackGraph.

boolean cu.trustGrapher.graphs.SimAbstractGraph.isDisplayed ( )

Whether or not this graph will have a viewer built for it

Returns:
the displayed boolean

Definition at line 87 of file SimAbstractGraph.java.

Here is the call graph for this function:

void cu.trustGrapher.graphs.SimAbstractGraph.removeEdgeAndVertices ( TestbedEdge  edge) [protected]

Removes the given edge from the graph and and the Agents connected to it if they no longer have any edges after removing the given edge.

Parameters:
edgeThe edge to be removed

Definition at line 180 of file SimAbstractGraph.java.

Here is the caller graph for this function:


Member Data Documentation

Definition at line 34 of file SimAbstractGraph.java.


The documentation for this class was generated from the following file: