|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.architecture.traffic.infrastructure.Infrastructure
public class Infrastructure
The encapsulating class
| Field Summary | |
|---|---|
protected java.util.Vector |
allLanes
All the inbound lanes on all the Nodes in our Infrastructure |
protected Node[] |
allNodes
All nodes in this infrastructure, including edge nodes |
protected java.lang.String |
author
Meta-data provided by the user |
static int |
blockLength
DOCUMENT ME! |
static int |
blockWidth
DOCUMENT ME! |
protected java.lang.String |
comments
Meta-data provided by the user |
protected int |
curCycle
The current cycle we're in, manely for Nodes to have access to this data |
protected Junction[] |
junctions
All nodes that are not EdgeNodes |
static java.util.Hashtable |
laneDictionary
DOCUMENT ME! |
protected java.lang.String |
parentName
DOCUMENT ME! |
protected NumberDispenser |
signNumbers
Number dispenser for sign id's |
protected java.awt.Dimension |
size
The size of this infrastructure, in pixels |
protected SpecialNode[] |
specialNodes
All exit/entry nodes in this infrastructure |
protected java.lang.String |
title
Meta-data provided by the user |
protected int |
version
The infrastructure version of this implementation. |
| Constructor Summary | |
|---|---|
Infrastructure()
Constructor for loading |
|
Infrastructure(java.awt.Dimension dim)
Creates a new infrastructure object. |
|
Infrastructure(Node[] nodes,
SpecialNode[] special,
java.awt.Dimension new_size)
Creates a new infrastructure object. |
|
| Method Summary | |
|---|---|
protected void |
addAlphaRoads(java.util.Dictionary d,
Junction n)
DOCUMENT ME! |
protected void |
addAlphaRoads(java.util.Dictionary d,
SpecialNode n)
DOCUMENT ME! |
void |
addNode(Node node)
Adds a node to the infrastructure |
void |
cachInboundLanes()
DOCUMENT ME! |
protected void |
copyJunctions()
DOCUMENT ME! |
protected void |
copySpecialNodes()
DOCUMENT ME! |
java.util.Vector |
getAllInboundLanes()
DOCUMENT ME! |
Node[] |
getAllNodes()
Returns all nodes (including edge nodes) |
java.lang.String |
getAuthor()
Returns the author. |
java.util.Enumeration |
getChildren()
DOCUMENT ME! |
java.lang.String |
getComments()
Returns the comments. |
int |
getCurCycle()
Returns the current cycle |
EdgeNode[] |
getEdgeNodes_()
Gets the EdgeNodes in this Infrastructure. |
Node.NodeStatistics[][] |
getEdgeNodeStatistics()
Returns an array containing all statistics of all EdgeNodes. |
Junction[] |
getJunctions()
Returns the Junctions of this infrastructure. |
Node.NodeStatistics[][] |
getJunctionStatistics()
Returns an array containing all statistics of all Junctions. |
protected java.util.Dictionary |
getLaneSignDictionary()
DOCUMENT ME! |
java.util.Dictionary |
getMainDictionary()
DOCUMENT ME! |
protected java.util.Dictionary |
getNodeDictionary()
DOCUMENT ME! |
Node.NodeStatistics[][] |
getNodeStatistics()
Returns an array containing all statistics of the infrastructure. |
int |
getNumEdgeNodes_()
Gets the number of EdgeNodes in the infrastructure |
int |
getNumJunctions()
Returns the number of junctions |
int |
getNumNodes()
Returns the number of nodes |
int |
getNumSpecialNodes()
Returns the number of edgenodes |
protected java.util.Dictionary |
getRoadDictionary()
DOCUMENT ME! |
java.awt.Dimension |
getSize()
Returns the size of this infrastructure in pixels |
SpecialNode[] |
getSpecialNodes()
Returns all exit/entry nodes |
java.lang.String |
getTitle()
Returns the title. |
int |
getTotalNumSigns()
Returns the total number of signs in the infrastructure |
java.lang.String |
getXMLName()
DOCUMENT ME! |
boolean |
hasChildren()
Returns true if this Selectable has any children |
void |
load(XMLElement myElement,
XMLLoader loader)
DOCUMENT ME! |
void |
prepareSave()
|
void |
remNode(Node node)
Removes a node from the infrastructure |
void |
reset()
Resets the entire data structure to allow a new simulation to start This will remove all Roadusers and set all Signs to their default positions, as well as reset all cycleMoved and cycleAsked counters. |
void |
saveChilds(XMLSaver saver)
DOCUMENT ME! |
XMLElement |
saveSelf()
DOCUMENT ME! |
void |
setAllNodes(Node[] nodes)
Sets all nodes (including edge nodes) |
void |
setAuthor(java.lang.String s)
Sets the author. |
void |
setComments(java.lang.String s)
Sets the comments. |
void |
setCurCycle(int c)
Sets the current cycle |
void |
setJunctions(Junction[] _junctions)
Sets all junctions. |
void |
setParentName(java.lang.String parentName)
DOCUMENT ME! |
void |
setSize(java.awt.Dimension s)
Sets the size of this infrastructure in pixels |
void |
setSpecialNodes(SpecialNode[] nodes)
Sets all exit/entry nodes |
void |
setTitle(java.lang.String s)
Sets the title. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int blockLength
public static final int blockWidth
public static java.util.Hashtable laneDictionary
protected Node[] allNodes
protected SpecialNode[] specialNodes
protected Junction[] junctions
protected java.lang.String title
protected java.lang.String author
protected java.lang.String comments
protected final int version
protected java.awt.Dimension size
protected java.util.Vector allLanes
protected NumberDispenser signNumbers
protected int curCycle
protected java.lang.String parentName
| Constructor Detail |
|---|
public Infrastructure(java.awt.Dimension dim)
dim - The dimension of the new infrastructure
public Infrastructure(Node[] nodes,
SpecialNode[] special,
java.awt.Dimension new_size)
nodes - The Nodes this Infrastructure should contain.special - The exit/entry nodes this Infrastructure should contain.new_size - The size of this Infrastructure in pixels x pixelspublic Infrastructure()
| Method Detail |
|---|
public java.lang.String getTitle()
public void setTitle(java.lang.String s)
s - DOCUMENT ME!public java.lang.String getAuthor()
public void setAuthor(java.lang.String s)
s - DOCUMENT ME!public java.lang.String getComments()
public void setComments(java.lang.String s)
s - DOCUMENT ME!public SpecialNode[] getSpecialNodes()
public void setSpecialNodes(SpecialNode[] nodes)
nodes - DOCUMENT ME!public Junction[] getJunctions()
public void setJunctions(Junction[] _junctions)
_junctions - DOCUMENT ME!public Node[] getAllNodes()
public void setAllNodes(Node[] nodes)
nodes - DOCUMENT ME!public java.awt.Dimension getSize()
public void setSize(java.awt.Dimension s)
s - DOCUMENT ME!public int getNumNodes()
public int getNumSpecialNodes()
public int getNumJunctions()
public void setCurCycle(int c)
c - DOCUMENT ME!public int getCurCycle()
public int getTotalNumSigns()
public Node.NodeStatistics[][] getNodeStatistics()
public Node.NodeStatistics[][] getEdgeNodeStatistics()
public Node.NodeStatistics[][] getJunctionStatistics()
public EdgeNode[] getEdgeNodes_()
public int getNumEdgeNodes_()
public boolean hasChildren()
SelectionStarter
hasChildren in interface SelectionStarterpublic java.util.Enumeration getChildren()
getChildren in interface SelectionStarterpublic void addNode(Node node)
node - DOCUMENT ME!
public void remNode(Node node)
throws InfraException
node - DOCUMENT ME!
InfraException - DOCUMENT ME!public void reset()
Node.reset()
public void cachInboundLanes()
throws InfraException
InfraException - DOCUMENT ME!
public java.util.Vector getAllInboundLanes()
throws InfraException
InfraException - DOCUMENT ME!
public void prepareSave()
throws TrafficException
TrafficException
public void load(XMLElement myElement,
XMLLoader loader)
throws XMLTreeException,
java.io.IOException,
XMLInvalidInputException
load in interface XMLSerializablemyElement - DOCUMENT ME!loader - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
XMLInvalidInputException - DOCUMENT ME!public XMLElement saveSelf()
saveSelf in interface XMLSerializable
public void saveChilds(XMLSaver saver)
throws XMLTreeException,
java.io.IOException,
XMLCannotSaveException
saveChilds in interface XMLSerializablesaver - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
XMLCannotSaveException - DOCUMENT ME!public java.lang.String getXMLName()
getXMLName in interface XMLSerializablepublic void setParentName(java.lang.String parentName)
setParentName in interface XMLSerializableparentName - DOCUMENT ME!
public java.util.Dictionary getMainDictionary()
throws InfraException
InfraException - DOCUMENT ME!protected java.util.Dictionary getLaneSignDictionary()
protected java.util.Dictionary getNodeDictionary()
protected java.util.Dictionary getRoadDictionary()
throws InfraException
InfraException - DOCUMENT ME!protected void copySpecialNodes()
protected void copyJunctions()
protected void addAlphaRoads(java.util.Dictionary d,
SpecialNode n)
d - DOCUMENT ME!n - DOCUMENT ME!
protected void addAlphaRoads(java.util.Dictionary d,
Junction n)
d - DOCUMENT ME!n - DOCUMENT ME!
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||