#include <portion.h>
Inheritance diagram for portion:

Public Methods | |
| portion (double *coordinates, int index) | |
| bool | belongsPoint (double x, double y, double z) |
| Checks wether a point belong to this portion. | |
| virtual | ~portion () |
| virtual void | update (long int updateStamp)=0 |
| The code that makes the world evolve to its next iteration. | |
| void | displayAnt (bool printNames) |
| The OpenGL/Glut code that draws the ants located on the portion, if any. More... | |
| void | displayPlant () |
| The OpenGL/Glut code that draws the plant located on the portion, if any. | |
| void | setColor () |
| Resets the current OpenGL color. More... | |
| virtual double | getFood () |
| Returns how much food has been stored on the portion so far. More... | |
| virtual double | modifyFood (double modifier) |
| Changes the amount of food which has been stored by ants on this portion. More... | |
| virtual bool | isColony ()=0 |
| Is this portion a colony ? | |
| virtual void | displayPheromones (char pheromoneType) |
| The OpenGL/Glut code that displays the pheromones located on the portion, if any. More... | |
| void | move (ant *myAnt, portion *to) |
| Moves the ant myAnt to the portion to, without cheking if the to portion is walkable. | |
| portion * | sensePheromones (char type, char antHemisphere, portion *previousPortion) |
| Returns the portion that contains the most pheromone of type "type" laid by ants from the hemisphere antHemisphere. More... | |
| portion * | senseBasicInstinct (portion *previousPortion) |
| Returns a random portion meeting the walkable condition. More... | |
Public Attributes | |
| char | hemisphere |
| 1 for North, 0 for South. | |
| bool | walkable |
| Is the portion walkable ? | |
| double | coordinates [9] |
| x,y,z coordinates for 3 points of the triangle. | |
| int | foundNeighbors |
| used during the initiating sequence of the program to check the consistency of the list. | |
| portion ** | neighbors |
| pointers array to the 3 neighbors. | |
| int | index |
| Each portion is given a unique number. | |
| plant * | thisPlant |
| A pointer to the plant which could be located on the portion. | |
| pheromone * | pheromones [2] |
| Pointers to the north and south portions. | |
Protected Methods | |
| void | updateP (long int updateStamp) |
| common update code to all portions. | |
Protected Attributes | |
| GLfloat | antColor [4] |
| color of the ant when looking for food. | |
| GLfloat | antColorAlt [4] |
| color of the ant when going back home. | |
| GLfloat | portionColor [4] |
| color of the portion. | |
| GLfloat | treeColor [4] |
| color of the trunk. | |
| GLfloat | leavesColor [4] |
| color of the leaves of the tree. | |
| GLfloat | antRadius |
| radius of the sphere representing the ant. | |
| antList * | firstAnt |
| points to the first element of the local ant list. | |
|
||||||||||||
|
|
|
|
The OpenGL/Glut code that draws the ants located on the portion, if any.
|
|
|
The OpenGL/Glut code that displays the pheromones located on the portion, if any.
Reimplemented in land. |
|
|
Returns how much food has been stored on the portion so far. 0 if the portion is NOT a colony. Reimplemented in colony. |
|
|
Changes the amount of food which has been stored by ants on this portion. Does nothing if the portion is not a colony.
Reimplemented in colony. |
|
|
Returns a random portion meeting the walkable condition.
|
|
||||||||||||||||
|
Returns the portion that contains the most pheromone of type "type" laid by ants from the hemisphere antHemisphere.
|
|
|
Resets the current OpenGL color. This method could be used before displaying the triangle for example |
1.2.15