#include <world.h>
Collaboration diagram for World:
Public Methods | |
World (CommCenter *_commCenter, BoundingBox _bbox=BoundingBox()) | |
Creates a world that is contained in the bounding box. | |
void | newAgent (Cylinder *cyl, const char *creationMessage, unsigned long int messageSize) |
Creates and adds a new agent to the world. | |
void | newAgent (Agent *) |
Adds a existing agent to this world. | |
void | clientOut (Client *) |
Delete the agents that depend on this client. | |
void | setQuit () |
Make this world disappear. | |
bool | getQuit () |
Do I wanna quit? | |
Agent * | getAgent (unsigned long int agentId) |
Get an Agent. | |
vector< Agent * > | getAgents (BoundingBox box=BoundingBox()) |
Get agents in this area. | |
string | getStats () |
Get a string with stats about the world. | |
void | step () |
Run a time step (move objects...). | |
void | step (double lowerLimit, double upperLimit) |
Seccond part of step, this is the collision detection/response part. | |
void | addCylinder (Cylinder *) |
Adds a new cylinder to the cylinders in the world. | |
void | delCylinder (Cylinder *) |
Deletes a new cylinder to the cylinders in the world. | |
void | addMessage (const char *data, unsigned long int size, Agent *agent) |
Adds a message to the air. | |
unsigned long int | getNumCylinders () |
Number of world owned cylinders. | |
Cylinder * | getCylinder (unsigned long int i) |
Get a world cylinder. | |
Static Public Methods | |
Get some constant properties of the world | |
double | getGravity () |
Get the gravitation of this world. | |
double | getLinearDragCoefficient () |
Get the linear drag coefficient of this world. | |
double | getAngularDragCoefficient () |
Get the angular drag coefficient of this world. | |
double | getGroundRestitutionCoefficient () |
Get the coefficient of restitution of ground of this world. | |
double | getGroundFrictionCoefficient () |
Get the coefficient of friction of ground of this world. | |
double | getSpringCoefficient () |
Get the coefficient spring (glue). | |
double | getDamperCoefficient () |
Get the coefficient of damper (resistance to motion in glue). | |
Public Attributes | |
ost::AtomicCounter | numClients |
Number of clients to wait for. | |
Protected Attributes | |
vector< Agent * > | agents |
The agents that are in this world. | |
vector< Cylinder * > | cylinders |
BoundingBox | bbox |
The limits of this world. | |
bool | quit |
If I want to destroy this world. | |
CommCenter * | commCenter |
The commCenter that communicates this world. | |
vector< MessageAir > | messages |
The messages that are in the air in current cycle. | |
Static Protected Attributes | |
some constants of this universe | |
double | gravity = -0.0005 |
gravity of this world | |
double | linearDragCoefficient = 0.20 |
Linear drag coefficient. | |
double | angularDragCoefficient = 0.20 |
Angular drag coefficient. | |
double | groundRestitutionCoefficient = 0.02 |
Ground restitution coefficient. | |
double | groundFrictionCoefficient = 0.09 |
Ground friction coefficient. | |
double | springCoefficient = 10 |
Spring coefficient (glue). | |
double | damperCoefficient = 2 |
Damper coefficient (resistance to union/separation in glue). |
Definition at line 58 of file world.h.
|
Creates a world that is contained in the bounding box. creates a world that comprehen this bounding box Definition at line 52 of file world.cc. References bbox, commCenter, log, quit, and BoundingBox::toString(). |
|
Adds a new cylinder to the cylinders in the world. Add a new cylinder. All cylinders are in this vector, and are here until they finally dissapear. Definition at line 241 of file world.cc. References cylinders. Referenced by Cylinder::Cylinder(). |
|
Adds a message to the air.
Definition at line 125 of file world.h. References messages. Referenced by Cylinder::sendMessage(). |
|
Delete the agents that depend on this client. When a client go out it's agents are deleted. They should be drop to the world. FIXME Definition at line 101 of file world.cc. References agents. Referenced by Client::~Client(). |
|
Deletes a new cylinder to the cylinders in the world. Add a new cylinder. All cylinders are in this vector, and are here until they finally dissapear. Definition at line 249 of file world.cc. References cylinders. Referenced by Cylinder::~Cylinder(). |
|
Get an Agent. Gets and agents given a agentId. If none is found returns a NULL pointer. Definition at line 115 of file world.cc. References agents. Referenced by Client::dropCylinder(), Client::grow(), Client::move(), Client::newCylinder(), Client::sendEnergy(), Cylinder::sendMessage(), and Client::sendMessage(). |
|
Get agents in this area. Get a vector of agents that it's center is into the bounding box Definition at line 127 of file world.cc. References agents. |
|
Get the angular drag coefficient of this world.
Definition at line 141 of file world.h. References angularDragCoefficient. Referenced by Cylinder::newCycle(). |
|
Get a world cylinder.
Definition at line 130 of file world.h. References cylinders. Referenced by Cylinder::checkCollisions(), and GraphicClient::Run(). |
|
Get the coefficient of damper (resistance to motion in glue).
Definition at line 149 of file world.h. References damperCoefficient. Referenced by Cylinder::newCycle(). |
|
Get the gravitation of this world.
Definition at line 137 of file world.h. References gravity. Referenced by Cylinder::newCycle(). |
|
Get the coefficient of friction of ground of this world.
Definition at line 145 of file world.h. References groundFrictionCoefficient. Referenced by Collision::resolveGroundCollision(). |
|
Get the coefficient of restitution of ground of this world.
Definition at line 143 of file world.h. References groundRestitutionCoefficient. |
|
Get the linear drag coefficient of this world.
Definition at line 139 of file world.h. References linearDragCoefficient. Referenced by Cylinder::newCycle(). |
|
Number of world owned cylinders.
Definition at line 128 of file world.h. References cylinders. Referenced by Cylinder::checkCollisions(), and GraphicClient::Run(). |
|
Do I wanna quit?
Definition at line 109 of file world.h. References quit. Referenced by CommCenter::loop(). |
|
Get the coefficient spring (glue).
Definition at line 147 of file world.h. References springCoefficient. Referenced by Cylinder::newCycle(). |
|
Get a string with stats about the world. Prints several stats about the world. Each one is a variable with an equal (=) between the variable and the value. Semicolon (;) is used as separator. Definition at line 145 of file world.cc. References agents, cylinders, and sTime(). Referenced by ControlClient::Run(). |
|
Adds a existing agent to this world. Is simply adds the agent to the list of agents |
|
Creates and adds a new agent to the world. It searchs for a suitable client and creates the agent for that client Definition at line 73 of file world.cc. References agents, commCenter, Cylinder::getAgent(), Agent::getClient(), CommCenter::getClientForMigration(), Client::getName(), log, newAgent(), and Cylinder::setNewAgent(). Referenced by Cylinder::drop(), Client::initialize(), and newAgent(). |
|
Make this world disappear.
Definition at line 107 of file world.h. References quit. Referenced by ControlClient::Run(). |
|
Seccond part of step, this is the collision detection/response part. Runs a collision detection/reponse step of upper-lower time units. This is so to detect correctly all collisions. Definition at line 191 of file world.cc. References COLLISION_TIME_EPSILUM, cylinders, penetrating, and step(). |
|
Run a time step (move objects...). Runs a time step; first tell all cylinders to acomplish intentions, and later move according to forces, velocities and collisions. Definition at line 159 of file world.cc. References agents, cylinders, and messages. Referenced by CommCenter::makeMovements(), and step(). |
|
The agents that are in this world.
Definition at line 61 of file world.h. Referenced by clientOut(), getAgent(), getAgents(), getStats(), newAgent(), and step(). |
|
Angular drag coefficient.
Definition at line 38 of file world.cc. Referenced by getAngularDragCoefficient(). |
|
The limits of this world.
Definition at line 66 of file world.h. Referenced by World(). |
|
The commCenter that communicates this world.
|
|
Some cylinders are not attached to agents, as the energy cylinders, and those on the ground Definition at line 64 of file world.h. Referenced by addCylinder(), delCylinder(), getCylinder(), getNumCylinders(), getStats(), and step(). |
|
Damper coefficient (resistance to union/separation in glue).
Definition at line 46 of file world.cc. Referenced by getDamperCoefficient(). |
|
gravity of this world
Definition at line 34 of file world.cc. Referenced by getGravity(). |
|
Ground friction coefficient.
Definition at line 42 of file world.cc. Referenced by getGroundFrictionCoefficient(). |
|
Ground restitution coefficient.
Definition at line 40 of file world.cc. Referenced by getGroundRestitutionCoefficient(). |
|
Linear drag coefficient.
Definition at line 36 of file world.cc. Referenced by getLinearDragCoefficient(). |
|
The messages that are in the air in current cycle.
Definition at line 72 of file world.h. Referenced by addMessage(), and step(). |
|
Number of clients to wait for.
Definition at line 153 of file world.h. Referenced by CommCenter::checkForDeadClients(), baseClient::dontWalk(), and CommCenter::waitForClients(). |
|
If I want to destroy this world.
|
|
Spring coefficient (glue).
Definition at line 44 of file world.cc. Referenced by getSpringCoefficient(). |