FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.gui.jung.JungVisualizer Class Reference

A Visualizer using JUNG2. More...

Inheritance diagram for frodo2.gui.jung.JungVisualizer:

Public Member Functions

 JungVisualizer ()
 Constructor.
void render (DCOPProblemInterface<?, ?> problem)
boolean setCompiled (boolean compiled)
void actionPerformed (ActionEvent e)
Public Member Functions inherited from frodo2.gui.Visualizer
final void showOutgoingAgentMessage (Object fromAgent, Message msg, Object toAgent)
 Visualizes an outgoing message.
final void showIncomingAgentMessage (Message msg, Object toAgent)
 Visualizes an incoming message.

Static Public Member Functions

static String toHTML (String str)
 Converts an input string to HTML.
Static Public Member Functions inherited from frodo2.gui.Visualizer
static long getDisplayTime ()
static MsgVisualization getMsgViz (MessageType msgType)
 Looks up the visualization strategy for a given message type.
static void setMsgViz (MessageType msgType, MsgVisualization viz)
 Sets the visualization strategy for a given message type.

Protected Member Functions

void showOutgoingAgentMessage (Object fromAgent, Message msg, Object toAgent, MsgVisualization viz)
void showIncomingAgentMessage (Message msg, Object toAgent, MsgVisualization viz)
Protected Member Functions inherited from frodo2.gui.Visualizer
 Visualizer ()
 Constructor.
final void wait (MsgVisualization viz)
 Waits until the specified condition.

Private Member Functions

void init ()
 Initializes the VisualizationViewer.
void render ()
 Renders the problem instance.
void drawVertices ()
 Draws the vertices.
void drawEdges ()
 Draws the edges.

Private Attributes

Graph< String, String > graph = Graphs.synchronizedGraph(new SparseGraph<String, String>())
 The JUNG graph.
VisualizationViewer< String, String > vv
 The JUNG visualization viewer.
DCOPProblemInterface<?, ?> problem
 The problem instance to be rendered.
HashMap< String, Color > agentColors = new HashMap<String, Color> ()
 The color assigned to each agent.
LoadingCache< String, Paint > vertexColors
 The color of each vertex.
boolean compiled = false
 If true, then the nodes are the agents.
JFrame frame
 The frame.
AbstractLayout< String, String > layout
 The layout.
ConcurrentHashMap< String, MessageinMsgs = new ConcurrentHashMap<String, Message> ()
 For each agent (name), its incoming message.

Detailed Description

A Visualizer using JUNG2.

Author
Thomas Leaute
See also
"http://jung.sourceforge.net"

Constructor & Destructor Documentation

◆ JungVisualizer()

frodo2.gui.jung.JungVisualizer.JungVisualizer ( )

Constructor.

Member Function Documentation

◆ actionPerformed()

void frodo2.gui.jung.JungVisualizer.actionPerformed ( ActionEvent e)
See also
java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
Bug
Not working

References layout, and vv.

◆ drawEdges()

void frodo2.gui.jung.JungVisualizer.drawEdges ( )
private

◆ drawVertices()

void frodo2.gui.jung.JungVisualizer.drawVertices ( )
private

Draws the vertices.

References frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getVariables(), and problem.

Referenced by render().

Here is the call graph for this function:

◆ init()

void frodo2.gui.jung.JungVisualizer.init ( )
private

Initializes the VisualizationViewer.

Todo
Make the layout parameters configurable in the GUI
Todo
Update the title according to the display mode
Bug
The Reset button should scale back to layout
Bug
Keeps jumping around
Bug
Results in unnecessary edge crossings
Bug
Typically doesn't converge
Bug
Apparently experimental

References graph, layout, and vv.

Referenced by render().

◆ render() [1/2]

void frodo2.gui.jung.JungVisualizer.render ( )
private

Renders the problem instance.

Todo
Assign a color to each agent

References drawEdges(), drawVertices(), and frodo2.solutionSpaces.ProblemInterface< V extends Addable< V >, U extends Addable< U > >.getAgents().

Here is the call graph for this function:

◆ render() [2/2]

void frodo2.gui.jung.JungVisualizer.render ( DCOPProblemInterface<?, ?> problem)
See also
Visualizer#render(DCOPProblemInterface)
Todo
Update the title according to the display mode

Reimplemented from frodo2.gui.Visualizer.

References init(), problem, and render().

Referenced by render().

Here is the call graph for this function:

◆ setCompiled()

boolean frodo2.gui.jung.JungVisualizer.setCompiled ( boolean compiled)
See also
Visualizer.setCompiled(boolean)

Reimplemented from frodo2.gui.Visualizer.

References compiled.

◆ showIncomingAgentMessage()

void frodo2.gui.jung.JungVisualizer.showIncomingAgentMessage ( Message msg,
Object toAgent,
MsgVisualization viz )
protected
See also
Visualizer.showIncomingAgentMessage(Message, java.lang.Object, MsgVisualization)
Todo
Only undo when the agent is finished processing the message

Reimplemented from frodo2.gui.Visualizer.

References frodo2.gui.Visualizer.wait().

Here is the call graph for this function:

◆ showOutgoingAgentMessage()

void frodo2.gui.jung.JungVisualizer.showOutgoingAgentMessage ( Object fromAgent,
Message msg,
Object toAgent,
MsgVisualization viz )
protected
See also
Visualizer.showOutgoingAgentMessage(java.lang.Object, Message, java.lang.Object, MsgVisualization)
Todo
Set the edge label to a message image

Reimplemented from frodo2.gui.Visualizer.

References toHTML(), frodo2.communication.Message.toString(), and frodo2.gui.Visualizer.wait().

Here is the call graph for this function:

◆ toHTML()

String frodo2.gui.jung.JungVisualizer.toHTML ( String str)
static

Converts an input string to HTML.

Parameters
strthe input string
Returns
an HTML conversion of the input string

Referenced by showOutgoingAgentMessage().

Member Data Documentation

◆ agentColors

HashMap<String, Color> frodo2.gui.jung.JungVisualizer.agentColors = new HashMap<String, Color> ()
private

The color assigned to each agent.

◆ compiled

boolean frodo2.gui.jung.JungVisualizer.compiled = false
private

If true, then the nodes are the agents.

Referenced by setCompiled().

◆ frame

JFrame frodo2.gui.jung.JungVisualizer.frame
private

The frame.

◆ graph

Graph<String, String> frodo2.gui.jung.JungVisualizer.graph = Graphs.synchronizedGraph(new SparseGraph<String, String>())
private

The JUNG graph.

Referenced by init().

◆ inMsgs

ConcurrentHashMap<String, Message> frodo2.gui.jung.JungVisualizer.inMsgs = new ConcurrentHashMap<String, Message> ()
private

For each agent (name), its incoming message.

◆ layout

AbstractLayout<String, String> frodo2.gui.jung.JungVisualizer.layout
private

The layout.

Referenced by actionPerformed(), and init().

◆ problem

DCOPProblemInterface<?, ?> frodo2.gui.jung.JungVisualizer.problem
private

The problem instance to be rendered.

Referenced by drawVertices(), and render().

◆ vertexColors

LoadingCache<String, Paint> frodo2.gui.jung.JungVisualizer.vertexColors
private
Initial value:
=
CacheBuilder.newBuilder().build(
CacheLoader.from(Functions.<Paint>constant(Color.white)))

The color of each vertex.

◆ vv

VisualizationViewer<String,String> frodo2.gui.jung.JungVisualizer.vv
private

The JUNG visualization viewer.

Referenced by actionPerformed(), and init().


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