#include <world.h>


Public Types | |
| typedef SkipNullIterator < const Node, NodeVector, NodeVector::const_iterator > | const_node_iterator |
| typedef SkipNullIterator< Node, NodeVector, NodeVector::iterator > | node_iterator |
| typedef EdgeModel::adjacency_iterator | adjacency_iterator |
| typedef EdgeModel::const_adjacency_iterator | const_adjacency_iterator |
| typedef std::list < SimulationTaskHandle > | SimulationTaskList |
| typedef std::set < NodeChangeListener * > | NodeChangeListenerSet |
Public Member Functions | |
| virtual bool | can_communicate_bidi (const Node &, const Node &) const throw () |
| virtual bool | can_communicate_uni (const Node &, const Node &) const throw () |
| EventScheduler & | scheduler_w (void) throw () |
| const EventScheduler & | scheduler (void) const throw () |
| virtual void | add_pre_step_task (const SimulationTaskHandle &) throw () |
| virtual void | add_post_step_task (const SimulationTaskHandle &) throw () |
construction / destruction | |
| World () | |
| virtual | ~World () |
| virtual void | init (void) throw () |
World setup | |
| virtual void | add_node (Node &) throw (std::logic_error) |
| virtual void | remove_node (Node &) throw (std::logic_error) |
| virtual void | add_default_processor (const std::string &) throw () |
| New nodes will get the processors defined with this method attached when they are added to this world instance. | |
| virtual void | set_edge_model (EdgeModel &) throw () |
| world cares for model deletion | |
| virtual void | set_transmission_model (TransmissionModel &) throw () |
| Set the transmission model that will be used for further messages exchanges. World cares for model deletion. | |
| virtual void | set_communication_model (CommunicationModel &) throw () |
| world cares for model deletion | |
| virtual const EdgeModel & | edge_model (void) const throw () |
| virtual EdgeModel & | edge_model_w (void) throw () |
| virtual const TransmissionModel & | transmission_model (void) const throw () |
| Returns the transmission model that is currently used in the world. | |
| virtual TransmissionModel & | transmission_model_w (void) throw () |
| Returns the (writable, non const) transmission model that is currently used in the world. | |
| virtual const CommunicationModel & | communication_model (void) const throw () |
| virtual CommunicationModel & | communication_model_w (void) throw () |
| virtual void | set_simulation_controller (SimulationController &) throw () |
| virtual SimulationController & | simulation_controller_w (void) throw () |
| virtual const SimulationController & | simulation_controller (void) const throw () |
| virtual void | set_movement_controller (MovementController *) throw () |
| virtual MovementController & | movement_controller_w (void) throw () |
| virtual const MovementController & | movement_controller (void) const throw () |
| const Vec & | lower_left (void) const throw () |
| const Vec & | upper_right (void) const throw () |
| virtual void | add_edge (Node &, Node &) throw () |
| virtual void | clear (void) throw () |
| virtual void | set_size_hint (double hint) throw (std::logic_error) |
| virtual const std::string & | uuid (void) const throw () |
Status query | |
| virtual int | active_nodes_count (void) const throw () |
| virtual int | sleeping_nodes_count (void) const throw () |
| virtual int | inactive_nodes_count (void) const throw () |
| virtual bool | is_done (void) const throw () |
| returns whether simulation is done, i.e., all nodes are inactive | |
| virtual int | simulation_round (void) const throw () |
| virtual double | current_time (void) const throw () |
| virtual bool | has_size_hint (void) const throw () |
| Checks whether size_hint() would return a value or throws a std::runtime_error. | |
| virtual double | size_hint (void) const throw (std::runtime_error) |
Simulation | |
| virtual void | step (void) throw () |
| virtual void | send_message (const Node &source, const MessageHandle &mh) throw () |
| virtual void | reset (void) throw () |
| resets the simulation (ie, nodes are not deleted) | |
NodeChangeListener s | |
| virtual void | add_node_change_listener (NodeChangeListener &) throw () |
| virtual void | remove_node_change_listener (NodeChangeListener &) throw () |
| removes a NodeChangeListener | |
Access to nodes | |
| int | node_count (void) const throw () |
| int | node_id_space_size (void) const throw () |
| node_iterator | begin_nodes_w (void) throw () |
| node_iterator | end_nodes_w (void) throw () |
| Node * | find_node_by_id_w (int) throw () |
| returns NULL if none found | |
| Node * | find_node_by_label_w (const std::string &) throw () |
| returns NULL if none found, does *not* check for duplicates! | |
| const_node_iterator | begin_nodes (void) const throw () |
| const_node_iterator | end_nodes (void) const throw () |
| const Node * | find_node_by_id (int) const throw () |
| returns NULL if none found | |
| const Node * | find_node_by_label (const std::string &) const throw () |
| returns NULL if none found, does *not* check for duplicates! | |
| const_adjacency_iterator | begin_adjacent_nodes (const Node &v, EdgeModel::CommunicationDirection d=EdgeModel::CD_BIDI) const throw () |
| const_adjacency_iterator | end_adjacent_nodes (const Node &v) const throw () |
| adjacency_iterator | begin_adjacent_nodes_w (Node &v, EdgeModel::CommunicationDirection d=EdgeModel::CD_BIDI) throw () |
| adjacency_iterator | end_adjacent_nodes_w (Node &v) throw () |
Protected Member Functions | |
| virtual void | pre_step (void) throw () |
| virtual void | run_nodes (void) throw () |
| virtual void | post_step (void) throw () |
NodeChangeListener protected stuff | |
| virtual void | invalidate_node_change_listeners (void) throw () |
| typedef SkipNullIterator<const Node,NodeVector,NodeVector::const_iterator> shawn::World::const_node_iterator |
| typedef SkipNullIterator<Node,NodeVector,NodeVector::iterator> shawn::World::node_iterator |
| typedef std::list<SimulationTaskHandle> shawn::World::SimulationTaskList |
| typedef std::set<NodeChangeListener*> shawn::World::NodeChangeListenerSet |
| shawn::World::World | ( | ) |
| virtual shawn::World::~World | ( | ) | [virtual] |
| virtual void shawn::World::init | ( | void | ) | throw () [virtual] |
| virtual void shawn::World::add_node | ( | Node & | ) | throw (std::logic_error) [virtual] |
| virtual void shawn::World::remove_node | ( | Node & | ) | throw (std::logic_error) [virtual] |
Removes a node from the world. First, the observers are informed that the node will no longer be available. Then, the associated members of the NodeChangeListenerSet are informed. At last, the node is destroyed and marked as deleted in the internal representation.
| Node& | The node that is ought to be deleted. |
| virtual void shawn::World::add_default_processor | ( | const std::string & | ) | throw () [virtual] |
New nodes will get the processors defined with this method attached when they are added to this world instance.
| virtual void shawn::World::set_edge_model | ( | EdgeModel & | ) | throw () [virtual] |
world cares for model deletion
| virtual void shawn::World::set_transmission_model | ( | TransmissionModel & | ) | throw () [virtual] |
Set the transmission model that will be used for further messages exchanges. World cares for model deletion.
| virtual void shawn::World::set_communication_model | ( | CommunicationModel & | ) | throw () [virtual] |
world cares for model deletion
| virtual const EdgeModel& shawn::World::edge_model | ( | void | ) | const throw () [virtual] |

| virtual EdgeModel& shawn::World::edge_model_w | ( | void | ) | throw () [virtual] |

| virtual const TransmissionModel& shawn::World::transmission_model | ( | void | ) | const throw () [virtual] |
Returns the transmission model that is currently used in the world.
| virtual TransmissionModel& shawn::World::transmission_model_w | ( | void | ) | throw () [virtual] |
Returns the (writable, non const) transmission model that is currently used in the world.
| virtual const CommunicationModel& shawn::World::communication_model | ( | void | ) | const throw () [virtual] |
| virtual CommunicationModel& shawn::World::communication_model_w | ( | void | ) | throw () [virtual] |
| virtual void shawn::World::set_simulation_controller | ( | SimulationController & | ) | throw () [virtual] |
| virtual SimulationController& shawn::World::simulation_controller_w | ( | void | ) | throw () [virtual] |
| virtual const SimulationController& shawn::World::simulation_controller | ( | void | ) | const throw () [virtual] |
| virtual void shawn::World::set_movement_controller | ( | MovementController * | ) | throw () [virtual] |
| virtual MovementController& shawn::World::movement_controller_w | ( | void | ) | throw () [virtual] |
| virtual const MovementController& shawn::World::movement_controller | ( | void | ) | const throw () [virtual] |
| const Vec& shawn::World::lower_left | ( | void | ) | const throw () |
| const Vec& shawn::World::upper_right | ( | void | ) | const throw () |
| virtual void shawn::World::clear | ( | void | ) | throw () [virtual] |
| virtual void shawn::World::set_size_hint | ( | double | hint | ) | throw (std::logic_error) [virtual] |
You can provide a hint to the world what a "proper" communication distance in this world could be. This is NO information about the actual communication range of single nodes. This is just a hint. This hint can only be set once before any node has been created. This hint will be propagated to the communication model.
| virtual const std::string& shawn::World::uuid | ( | void | ) | const throw () [virtual] |
| virtual int shawn::World::active_nodes_count | ( | void | ) | const throw () [virtual] |
| virtual int shawn::World::sleeping_nodes_count | ( | void | ) | const throw () [virtual] |
| virtual int shawn::World::inactive_nodes_count | ( | void | ) | const throw () [virtual] |
| virtual bool shawn::World::is_done | ( | void | ) | const throw () [virtual] |
returns whether simulation is done, i.e., all nodes are inactive
| virtual int shawn::World::simulation_round | ( | void | ) | const throw () [virtual] |
| virtual double shawn::World::current_time | ( | void | ) | const throw () [virtual] |
| virtual bool shawn::World::has_size_hint | ( | void | ) | const throw () [virtual] |
Checks whether size_hint() would return a value or throws a std::runtime_error.
| virtual double shawn::World::size_hint | ( | void | ) | const throw (std::runtime_error) [virtual] |
Returns a hint what a "proper" communication distance in this world could be. This is NO information about the actual communication range of single nodes. This is just a hint. Check has_size_hint() before you access this method if a size hint has been set.
| std::runtime_error | Thrown if no size hint has been set on this world instance |
| virtual void shawn::World::step | ( | void | ) | throw () [virtual] |
| virtual void shawn::World::send_message | ( | const Node & | source, | |
| const MessageHandle & | mh | |||
| ) | throw () [virtual] |
| virtual void shawn::World::reset | ( | void | ) | throw () [virtual] |
resets the simulation (ie, nodes are not deleted)
| virtual void shawn::World::add_node_change_listener | ( | NodeChangeListener & | ) | throw () [virtual] |

| virtual void shawn::World::remove_node_change_listener | ( | NodeChangeListener & | ) | throw () [virtual] |
| virtual bool shawn::World::can_communicate_bidi | ( | const Node & | , | |
| const Node & | ||||
| ) | const throw () [virtual] |
| virtual bool shawn::World::can_communicate_uni | ( | const Node & | , | |
| const Node & | ||||
| ) | const throw () [virtual] |
| int shawn::World::node_count | ( | void | ) | const throw () [inline] |
| int shawn::World::node_id_space_size | ( | void | ) | const throw () [inline] |
returns the size of the node ID space, i.e., all nodes have an ID in the range [0...node_id_space_size()-1] used in DynamicNodeArray and StaticNodeArray

| node_iterator shawn::World::begin_nodes_w | ( | void | ) | throw () |
| node_iterator shawn::World::end_nodes_w | ( | void | ) | throw () |
| Node* shawn::World::find_node_by_id_w | ( | int | ) | throw () |
returns NULL if none found
| Node* shawn::World::find_node_by_label_w | ( | const std::string & | ) | throw () |
returns NULL if none found, does *not* check for duplicates!
| const_node_iterator shawn::World::begin_nodes | ( | void | ) | const throw () |
| const_node_iterator shawn::World::end_nodes | ( | void | ) | const throw () |
| const Node* shawn::World::find_node_by_id | ( | int | ) | const throw () |
returns NULL if none found
| const Node* shawn::World::find_node_by_label | ( | const std::string & | ) | const throw () |
returns NULL if none found, does *not* check for duplicates!
| const_adjacency_iterator shawn::World::begin_adjacent_nodes | ( | const Node & | v, | |
| EdgeModel::CommunicationDirection | d = EdgeModel::CD_BIDI | |||
| ) | const throw () [inline] |

| const_adjacency_iterator shawn::World::end_adjacent_nodes | ( | const Node & | v | ) | const throw () [inline] |

| adjacency_iterator shawn::World::begin_adjacent_nodes_w | ( | Node & | v, | |
| EdgeModel::CommunicationDirection | d = EdgeModel::CD_BIDI | |||
| ) | throw () [inline] |

| adjacency_iterator shawn::World::end_adjacent_nodes_w | ( | Node & | v | ) | throw () [inline] |

| EventScheduler& shawn::World::scheduler_w | ( | void | ) | throw () |
| const EventScheduler& shawn::World::scheduler | ( | void | ) | const throw () |
| virtual void shawn::World::add_pre_step_task | ( | const SimulationTaskHandle & | ) | throw () [virtual] |
| virtual void shawn::World::add_post_step_task | ( | const SimulationTaskHandle & | ) | throw () [virtual] |
| virtual void shawn::World::pre_step | ( | void | ) | throw () [protected, virtual] |
| virtual void shawn::World::run_nodes | ( | void | ) | throw () [protected, virtual] |
| virtual void shawn::World::post_step | ( | void | ) | throw () [protected, virtual] |
| virtual void shawn::World::invalidate_node_change_listeners | ( | void | ) | throw () [protected, virtual] |
1.5.6