Main Page   Class Hierarchy   Compound List   File List   Compound Members  

colony Class Reference

A walkable portion, on which ants are given birth, and that can store the food they gather. More...

#include <colony.h>

Inheritance diagram for colony:

portion List of all members.

Public Methods

 colony (double *coordinates, int index)
 Creates a colony with a default number (5) of ants. More...

 colony (double *coordinates, int index, unsigned int ants)
 Creates a colony letting you choose how many ants you want it to create. More...

 ~colony ()
double modifyFood (double modifier)
 Changes the amount of food which has been stored by ants on this portion. More...

double getFood ()
 Returns how much food has been stored on the portion so far. More...

bool isColony ()
 Is this portion a colony ?

void update (long int updateStamp)
 The code that makes the world evolve to its next iteration.


Detailed Description

A walkable portion, on which ants are given birth, and that can store the food they gather.


Constructor & Destructor Documentation

colony::colony double *    coordinates,
int    index
 

Creates a colony with a default number (5) of ants.

Parameters:
coordinates  A 9-double array containing the x1,y1,z1, ..., xk,yk,zk coordinates of the 3 points describing the portion triangle
index  The portion (unique) index

colony::colony double *    coordinates,
int    index,
unsigned int    ants
 

Creates a colony letting you choose how many ants you want it to create.

Parameters:
coordinates  A 9-double array containing the x1,y1,z1, ..., xk,yk,zk coordinates of the 3 points describing the portion triangle
index  The portion (unique) index
ants  how many ants are created by the colony


Member Function Documentation

double colony::getFood   [virtual]
 

Returns how much food has been stored on the portion so far.

0 if the portion is NOT a colony.

Reimplemented from portion.

double colony::modifyFood double    modifier [virtual]
 

Changes the amount of food which has been stored by ants on this portion.

Does nothing if the portion is not a colony.

Parameters:
modifier  the number that will be added to the current food store. Can be negative.

Reimplemented from portion.


The documentation for this class was generated from the following files:
Generated on Mon Jun 14 09:29:38 2004 by doxygen1.2.15