Class Abstract1DGrid

java.lang.Object
  extended byAbstract1DGrid
Direct Known Subclasses:
CA, Fitnesses, Rules

public abstract class Abstract1DGrid
extends java.lang.Object

This grid is used as a superclass for some array-like classes. It is 1 dimensional.
Spatially periodic boundary conditions are applied, meaning that the grid is viewed as a circle, with the leftmost and rightmost cells each acting as the others neighbour.

Since:
1.0
Version:
1.0, 2007-05-29
Author:
TineL

Field Summary
private  int size
           
 
Constructor Summary
Abstract1DGrid(int size)
          Creates Abstract1DGrid with the specified size.
 
Method Summary
 int getLeftIndex(int index)
           
 int getRightIndex(int index)
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

size

private int size
Constructor Detail

Abstract1DGrid

public Abstract1DGrid(int size)
Creates Abstract1DGrid with the specified size.

Parameters:
size - the grid size.
Since:
1.0
Method Detail

size

public int size()
Returns:
the grid size.
Since:
1.0

getLeftIndex

public int getLeftIndex(int index)
Parameters:
index - the index of the element in the grid.
Returns:
the index of the left element (periodic boundary).
Since:
1.0

getRightIndex

public int getRightIndex(int index)
Parameters:
index - the index of the element in the grid.
Returns:
the index of the right element (periodic boundary).
Since:
1.0