Hi,

You can do that by specifying a port number for your agent and then
attach your agent to the nodes through that port. That way, an agent
can communicate with any other agent by specifying its address and
port id.
Example :

- In .h and .cc files:

#define CLUSTERING_PORT 113
struct hdr_ip *ih = HDR_IP(p);
ihpk->daddr() = dest;     // destination node address
ihpk->saddr() = index;
ihpk->sport() = CLUSTERING_PORT;
ihpk->dport() = CLUSTERING_PORT;

- In .tcl script :

#creating clustering agents and attaching them to nodes through port 113.
    for {set j 0} {$j < $opt(nn) } {incr j} {
        set clagent_($j) [new Agent/Clustering [$node_($j) node-addr] ]
        $node_($j) attach $clagent_($j) 113
        }

Hope it helps.
Regards.

On 5/2/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> I am currently trying to develop a simulation in which a wireless sensor
> network with sleeping nodes has an ad-hoc "backbone" of nodes with a higher
> duty cycle to reduce latency.  In order for this scenario to work, however,
> nodes must be able to negotiate with logical children and neighboring nodes
> in order to nominate backbone nodes.  I have implemented this logic as an
> Agent subclass; however, I am now realizing that Agents seem to have only a
> one-to-one relationship.  Is there a workaround for this (so that an Agent
> may have multiple agents it can communicate with?) I have tried calls
> through the OTCL linkage directly to the interpreter to try and reconnect
> nodes on the fly, but this does not seem to work.  Does anyone have any
> suggestions?
>
>

Reply via email to