jist.swans.field
Class Placement.Grid

java.lang.Object
  extended by jist.swans.field.Placement.Grid
All Implemented Interfaces:
Placement
Enclosing interface:
Placement

public static class Placement.Grid
extends java.lang.Object
implements Placement

Placement along a regular grid.


Nested Class Summary
 
Nested classes/interfaces inherited from interface jist.swans.field.Placement
Placement.Grid, Placement.Random
 
Field Summary
private  float fieldx
          field dimensions.
private  float fieldy
          field dimensions.
private  long i
          number of nodes already placed.
private  int nodex
          node placement array dimensions.
private  int nodey
          node placement array dimensions.
 
Constructor Summary
Placement.Grid(Location loc, int nodex, int nodey)
          Initialize grid placement model.
Placement.Grid(Location loc, java.lang.String s)
          Initialize grid placement model.
Placement.Grid(java.lang.String field, java.lang.String nodes)
          Initialize grid placement model.
 
Method Summary
 Location getNextLocation()
          Return location of next node.
private  void init(float fieldx, float fieldy, int nodex, int nodey)
          Initialize grid placement model.
private  void init(Location loc, java.lang.String s)
          Initialize grid placement model.
private  void init(java.lang.String field, java.lang.String nodes)
          Initialize grid placement model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fieldx

private float fieldx
field dimensions.


fieldy

private float fieldy
field dimensions.


nodex

private int nodex
node placement array dimensions.


nodey

private int nodey
node placement array dimensions.


i

private long i
number of nodes already placed.

Constructor Detail

Placement.Grid

public Placement.Grid(Location loc,
                      int nodex,
                      int nodey)
Initialize grid placement model.

Parameters:
loc - field dimensions (in meters)
nodex - number of nodes in x-dimension
nodey - number of nodes in y-dimension

Placement.Grid

public Placement.Grid(Location loc,
                      java.lang.String s)
Initialize grid placement model.

Parameters:
loc - field dimensions (in meters)
s - node configuration string

Placement.Grid

public Placement.Grid(java.lang.String field,
                      java.lang.String nodes)
Initialize grid placement model.

Parameters:
field - field dimensions string
nodes - node configuration string
Method Detail

init

private void init(java.lang.String field,
                  java.lang.String nodes)
Initialize grid placement model.

Parameters:
field - field dimensions string
nodes - node configuration string

init

private void init(Location loc,
                  java.lang.String s)
Initialize grid placement model.

Parameters:
loc - field dimensions (in meters)
s - node configuration string

init

private void init(float fieldx,
                  float fieldy,
                  int nodex,
                  int nodey)
Initialize grid placement model.

Parameters:
fieldx - field x-dimension (in meters)
fieldy - field y-dimension (in meters)
nodex - number of nodes in x-dimension
nodey - number of nodes in y-dimension

getNextLocation

public Location getNextLocation()
Return location of next node.

Specified by:
getNextLocation in interface Placement
Returns:
location of next node