// ----------------------------------------------------------------------
    void
        RandomDropTransmissionModel::
        send_message( TransmissionModel::MessageInfo& mi )
        throw() 
    {
        received_++;
        
        // TODO: What should be done if there are several transmission models in use?
        const Message* m = mi.msg_.get();
		if (m->has_sender_proc())
        	(m->sender_proc_w()).process_sent_indication( ConstMessageHandle(mi.msg_), shawn::Processor::SHAWN_TX_STATE_SUCCESS, 1 );
        
        if( drop_message(mi) )
            dropped_++;
        else
            pass_to_chain(mi);
    }
Exemple #2
0
    // ----------------------------------------------------------------------
    void
        AlohaTransmissionModel::
        deliver_one_message( msg_delivery* msg )
        throw()
    {
		if( msg->pmi_->msg_->is_unicast() )
        {
            ABORT_INCONSISTENT_CONFIGURATION("Unicast is not supported by the aloha transmission model. Implement it -> NOW.");
        }

		bool no_destination = true;
		for( std::vector<msg_delivery::msg_destination*>::iterator it=msg->destinations_.begin();
			it!=msg->destinations_.end();
			it++ )
		{
			if( (*it)->valid_ ){
				(*it)->dest_node_->receive( ConstMessageHandle( msg->pmi_->msg_) );
				no_destination = false;
			}
		}
		dropped_ = no_destination? dropped_+1 : dropped_;
    }