Public Member Functions | Protected Attributes

automobile_network Class Reference
[DSim Models]

Automobile network. More...

#include <automobile_network.h>

List of all members.

Public Member Functions

 automobile_network (dsim_model_setup *setup)
 Constructor.
void initialization_complete ()
 Finish initialization.
void initialize_data ()
 Initialize outlets and output variables.
void initialize_timestep ()
 Computation done prior to beginning of timestep.
void pre_calculate ()
 Computation done prior to numerical integration.
void post_calculate ()
 Computation done after numerical integration.
dsim_value handle_message (const std::string &sender_path, const std::string &message_name, const dsim_value &argument)
 Process incoming messages.

Protected Attributes

dsim_variable parent_yaw_matrix_dsim
 Parent quaternion.
dsim_variable parent_position_dsim
 Parent position.
dsim_variable transmit_dsim
 Transmit.
dsim_variable message_outgoing_dsim
 Message outgoing - a matrix.
dsim_variable message_incoming_dsim
 Message incoming - a matrix.
dsim_variable position_dsim
 Position of parent (m)
ml_matrix r
ml_matrix v
ml_matrix message_incoming

Detailed Description

Automobile network.

Models an automotive network.

This module demonstrates the use of targets and messaging. It can both send and receive messages. When the transmit command is set to 1 it sends the range to the target vehicle(s). Targets are added in the xml file.

Messages are sent in the method pre_calculate(). The handle_message method receives incoming messages.

Definition at line 23 of file automobile_network.h.


Member Function Documentation

dsim_value automobile_network::handle_message ( const std::string &  sender_path,
const std::string &  message_name,
const dsim_value &  argument 
)

Process incoming messages.

automobile_network supports the following messages: 'automobile_network_message' !

Definition at line 129 of file automobile_network.cc.

{
    if (message_name == "automobile_network_message")
    {
                ml_matrix temp  = argument.matrix_value();
        message_incoming.stack(temp);
        message_incoming_dsim.set_value_as_matrix(message_incoming);
                
                return dsim_value();
    }
        
    else return dsim_model::handle_message(sender_path,message_name,argument);
        
}

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables