[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ns] code
Thank you Yuri, Srinivisan, ns-users for the help to get this working.
Turns out the solution was this(in the main script part, only one small
change from your solution, Srinivisan, that's no '$' before the
agentNew_ in the last line):
$ns set agentNew_($ctr_) [new Agent/Alert]
$ns attach-agent $n($ctr_) [ $ns set agentNew_($ctr_) ]
additionally, for the 'Simulator instproc init', I added an
agentNew_ variable.
Then I added this function to get the agent:
Simulator instproc get-agent-new { nodeID } {
$self instvar agentNew_
set thisNewAgent $agentNew_($nodeID)
return $thisNewAgent
}
Thanks again!
-Lori