shawn::World Class Reference

#include <world.h>

Inheritance diagram for shawn::World:

Inheritance graph
[legend]
Collaboration diagram for shawn::World:

Collaboration graph
[legend]

List of all members.

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 ()
EventSchedulerscheduler_w (void) throw ()
const EventSchedulerscheduler (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
World considers itself node owner!

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 EdgeModeledge_model (void) const throw ()
virtual EdgeModeledge_model_w (void) throw ()
virtual const TransmissionModeltransmission_model (void) const throw ()
 Returns the transmission model that is currently used in the world.
virtual TransmissionModeltransmission_model_w (void) throw ()
 Returns the (writable, non const) transmission model that is currently used in the world.
virtual const CommunicationModelcommunication_model (void) const throw ()
virtual CommunicationModelcommunication_model_w (void) throw ()
virtual void set_simulation_controller (SimulationController &) throw ()
virtual SimulationControllersimulation_controller_w (void) throw ()
virtual const
SimulationController
simulation_controller (void) const throw ()
virtual void set_movement_controller (MovementController *) throw ()
virtual MovementControllermovement_controller_w (void) throw ()
virtual const MovementControllermovement_controller (void) const throw ()
const Veclower_left (void) const throw ()
const Vecupper_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 ()
Nodefind_node_by_id_w (int) throw ()
 returns NULL if none found
Nodefind_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 Nodefind_node_by_id (int) const throw ()
 returns NULL if none found
const Nodefind_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 ()


Member Typedef Documentation

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


Constructor & Destructor Documentation

shawn::World::World (  ) 

virtual shawn::World::~World (  )  [virtual]


Member Function Documentation

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.

Parameters:
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]

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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::add_edge ( Node ,
Node  
) throw () [virtual]

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.

See also:
set_size_hint
Exceptions:
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]

Here is the caller graph for this function:

virtual void shawn::World::remove_node_change_listener ( NodeChangeListener  )  throw () [virtual]

removes a NodeChangeListener

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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]

Here is the call graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

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]


The documentation for this class was generated from the following file:

Generated on Sun Feb 5 00:01:42 2012 for Shawn by  doxygen 1.5.6