public abstract class Map extends Layer implements java.lang.Cloneable
| Modifier and Type | Field and Description |
|---|---|
protected int |
height
The height of this map.
|
protected Link |
link
The link type of the map.
|
protected Neuron |
neuron
The neuron type of the map.
|
protected NeuronList |
neurons
All the neurons in the map.
|
protected int |
width
The width of this map.
|
| Constructor and Description |
|---|
Map()
Constructs an empty map.
|
Map(int width)
Generates a quadratic map of given width.
|
Map(int width,
int height)
Constructs a generic map with default neurons.
|
Map(Map map)
Constructs a map copy.
|
| Modifier and Type | Method and Description |
|---|---|
Map |
clone()
Returns a semi-deep clone of this map.
|
boolean |
connect(Layer other)
Connects this map with the given layer using the link type of this map.
|
protected abstract boolean |
connect(Map other)
Connects this map with the given map using the link type of this map.
|
void |
disconnect()
Disconnects the map from the previous layer.
|
int |
getDepth()
Returns the depth of this map.
|
int |
getHeight()
Returns the height of this map.
|
int |
getLinkCount()
Returns the the number of links into this map.
|
Neuron |
getNeuron(int i)
Returns the neuron with given index.
|
protected Neuron |
getNeuron(int row,
int col)
Returns the neuron with given coordinates.
|
NeuronList |
getNeurons()
Returns the neurons in this map.
|
int |
getSize()
Returns the size of this map, i.e., the number of neurons.
|
int |
getWidth()
Returns the width of this map.
|
void |
reset()
Resets the internal state of this map (does nothing here).
|
protected void |
setIOType(boolean in,
boolean out)
Sets the map neurons' IO status.
|
java.lang.String |
toString()
Returns the (width x height) of this map.
|
org.jdom2.Element |
toXML(org.jdom2.Element element)
Returns an XML element containing information on the layer.
|
protected int width
protected int height
protected Neuron neuron
protected Link link
protected NeuronList neurons
public Map()
public Map(Map map)
map - the map to be copiedpublic Map(int width)
width - the square widthpublic Map(int width,
int height)
width - the widthheight - the heightpublic Map clone()
clone in class java.lang.Objectpublic void reset()
public int getWidth()
public int getHeight()
public int getDepth()
public int getSize()
public NeuronList getNeurons()
getNeurons in class Layerpublic Neuron getNeuron(int i)
protected Neuron getNeuron(int row, int col)
row - the row of the neuron (0 to width - 1)col - the column of the neuron (0 to height - 1)public int getLinkCount()
getLinkCount in class Layerprotected void setIOType(boolean in,
boolean out)
public boolean connect(Layer other)
public void disconnect()
disconnect in class Layerpublic org.jdom2.Element toXML(org.jdom2.Element element)
public java.lang.String toString()
protected abstract boolean connect(Map other)
other - another map