display
Class Node

java.lang.Object
  extended by uchicago.src.sim.network.DefaultNode
      extended by uchicago.src.sim.network.DefaultDrawableNode
          extended by display.Node
All Implemented Interfaces:
uchicago.src.sim.gui.Drawable2DGridNode, uchicago.src.sim.gui.DrawableNonGridNode, uchicago.src.sim.gui.Moveable, uchicago.src.sim.gui.NonGridDrawable, uchicago.src.sim.network.Node
Direct Known Subclasses:
AgentNode, HouseholdNode

public abstract class Node
extends uchicago.src.sim.network.DefaultDrawableNode

Node class. SandboxNode extends DefaultDrawableNode and so it is both a DefaultNode and a DrawableNonGridNode. All of the important behavoir here as to do with creating new links. - This is based and with new functions on the code by Friedrich for multilayer network model ...


Nested Class Summary
 
Nested classes/interfaces inherited from class uchicago.src.sim.network.DefaultNode
uchicago.src.sim.network.DefaultNode.OrderedHashMap
 
Field Summary
private  int ID
           
(package private)  double initEdgeStrength
           
(package private)  int maxDegree
           
 
Fields inherited from class uchicago.src.sim.network.DefaultDrawableNode
item
 
Fields inherited from class uchicago.src.sim.network.DefaultNode
inEdges, inMap, label, outEdges, outMap
 
Constructor Summary
Node()
           
 
Method Summary
 void clearEdges()
          Clears all the links for this node
 void constructEdges(java.util.ArrayList<Node> nodes)
           
 void constructEdges(java.util.ArrayList<Node> nodes, java.awt.Color color)
           
abstract  boolean equals(java.lang.Object o)
           
 int getID()
           
 int getMaxDegree()
           
 void init(int x, int y)
          Initialize this saNode, this takes the place of the constructor when a SandboxNode is created from a file using its no-arg constructor.
 void makeEdgeToFrom(uchicago.src.sim.network.DefaultNode node)
          Makes an edge to the specified node and from the specifed node to this saNode if both nodes do not already have edges to each other and if adding the edge keeps their degrees less than maxDegree.
 void makeEdgeToFrom(uchicago.src.sim.network.DefaultNode node, java.awt.Color color)
          Makes an edge to the specified node and from the specifed node to this saNode if both nodes do not already have edges to each other and if adding the edge keeps their degrees less than maxDegree.
 void removeNode(uchicago.src.sim.network.DefaultNode node)
           
 void removeRandomLink()
          Remove a link randomly from this node
 void setID(int id)
           
 void setMaxDegree(int maxDegree)
           
 
Methods inherited from class uchicago.src.sim.network.DefaultDrawableNode
allowResizing, calcSize, contains, draw, getBorderColor, getBorderWidth, getColor, getFont, getHeight, getLabelColor, getNode, getWidth, getX, getY, setBorderColor, setBorderWidth, setColor, setDrawable, setDrawableNoCopy, setFont, setHeight, setLabelColor, setNodeLabel, setWidth, setX, setX, setY, setY
 
Methods inherited from class uchicago.src.sim.network.DefaultNode
addInEdge, addInEdges, addOutEdge, addOutEdges, clearInEdges, clearOutEdges, getEdgesFrom, getEdgesTo, getFromNodes, getId, getInDegree, getInEdges, getInNodes, getNodeLabel, getNumInEdges, getNumOutEdges, getOutDegree, getOutEdges, getOutNodes, getRandomFromNode, getRandomNodeIn, getRandomNodeOut, getRandomToNode, getToNodes, hasEdgeFrom, hasEdgeTo, hasEdgeToOrFrom, makeRandomInEdge, makeRandomOutEdge, removeEdgesFrom, removeEdgesTo, removeInEdge, removeOutEdge
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface uchicago.src.sim.gui.DrawableNonGridNode
getOutEdges
 
Methods inherited from interface uchicago.src.sim.gui.Drawable2DGridNode
getOutEdges
 

Field Detail

maxDegree

int maxDegree

initEdgeStrength

double initEdgeStrength

ID

private int ID
Constructor Detail

Node

public Node()
Method Detail

init

public void init(int x,
                 int y)
Initialize this saNode, this takes the place of the constructor when a SandboxNode is created from a file using its no-arg constructor.


clearEdges

public void clearEdges()
Clears all the links for this node


constructEdges

public void constructEdges(java.util.ArrayList<Node> nodes)

constructEdges

public void constructEdges(java.util.ArrayList<Node> nodes,
                           java.awt.Color color)

removeRandomLink

public void removeRandomLink()
Remove a link randomly from this node


makeEdgeToFrom

public void makeEdgeToFrom(uchicago.src.sim.network.DefaultNode node)
Makes an edge to the specified node and from the specifed node to this saNode if both nodes do not already have edges to each other and if adding the edge keeps their degrees less than maxDegree. If an edge allready exitsts, its strength is refreshed.

Parameters:
node -
maxDegree -

makeEdgeToFrom

public void makeEdgeToFrom(uchicago.src.sim.network.DefaultNode node,
                           java.awt.Color color)
Makes an edge to the specified node and from the specifed node to this saNode if both nodes do not already have edges to each other and if adding the edge keeps their degrees less than maxDegree. If an edge allready exitsts, its strength is refreshed.

Parameters:
node -
maxDegree -

getMaxDegree

public int getMaxDegree()
Returns:
Returns the maxDegree.

setMaxDegree

public void setMaxDegree(int maxDegree)
Parameters:
maxDegree - The maxDegree to set.

equals

public abstract boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

removeNode

public void removeNode(uchicago.src.sim.network.DefaultNode node)

getID

public int getID()

setID

public void setID(int id)