Thanks Javi :)
Eric, yes I noticed that as well, I'm not sure why that happens. I
remember it worked fine a few versions ago. Can you reproduce this,
Javi?
All the best,
M.
On 12/5/13, EriCSN Chang <
eric...@gmail.com> wrote:
> Oops. That's my bad... The informer works fine now.
> Receiver gets the msg now, thanks for your replies. :)
>
> But there's still a problem, the receiver will block the action no matter
> how many 10 secs passed until getting new message...
>
> Markus Schatten於 2013年12月5日星期四UTC+8上午4時27分51秒寫道:
>>
>> Hi,
>>
>> I had some more time now to take a better look, the problem is in the
>> sending agent, e.g. the line:
>>
>> self.myAgent.send(send.msg)
>>
>> should be:
>>
>> self.myAgent.send(self.msg)
>>
>> All the best,
>>
>> M.
>> --
>> Markus Schatten, PhD
>> Assistant professor and head of Artificial Intelligence Lab
>> University of Zagreb
>> Faculty of Organization and Informatics
>> Pavlinska 2, 42000 Varazdin, Croatia
>>
http://www.foi.hr/nastavnici/schatten.markus/index.html
>>
http://www.researchgate.net/profile/Markus_Schatten1
>>
http://ai.foi.hr
>>
>>
>> On Wed, Dec 4, 2013 at 3:40 PM, EriCSN Chang
>> <
eric...@gmail.com<javascript:>>
>> wrote:
>> > It's almost as same as the sample:
>> >
>> > import spade
>> >
>> > class MyAgent(spade.Agent.Agent):
>> > class InformBehav(spade.Behaviour.OneShotBehaviour):
>> > def onStart(self):
>> > print "Starting behaviour..."
>> > def _process(self):
>> > #First, form the receiver AID
>> > receiver = spade.AID.aid(name="
rece...@127.0.0.1 <javascript:>",
>> addresses =
>> > ["xmpp://
rece...@127.0.0.1 <javascript:>"])
>> > #Second, build the message
>> > self.msg = spade.ACLMessage.ACLMessage()
>> > self.msg.setPerformative("inform")
>> > self.msg.setOntology("myOntology")
>> > self.msg.setLanguage("OWL=S")
>> > self.msg.addReceiver(receiver)
>> > self.msg.setContent("Hello World")
>> >
>> > #Third, send the message withthe "send" method of the agent
>> > self.myAgent.send(send.msg)
>> >
>> > def onEnd(self):
>> > print "Ending..."
>> >
>> >
>> > def _setup(self):
>> > print "MyAgent starting..."
>> > b = self.InformBehav()
>> > self.addBehaviour(b, None)
>> >
>> >
>> > if __name__ == "__main__":
>> > a = MyAgent("
ag...@127.0.0.1 <javascript:>", "secret")
>> > email to
spade-users...@googlegroups.com <javascript:>.
>> > To post to this group, send email to
>> >
spade...@googlegroups.com<javascript:>.
>>
>> > For more options, visit
https://groups.google.com/groups/opt_out.
>>
>
> Markus Schatten於 2013年12月5日星期四UTC+8上午4時27分51秒寫道:
>>
>> Hi,
>>
>> I had some more time now to take a better look, the problem is in the
>> sending agent, e.g. the line:
>>
>> self.myAgent.send(send.msg)
>>
>> should be:
>>
>> self.myAgent.send(self.msg)
>>
>> All the best,
>>
>> M.
>> --
>> Markus Schatten, PhD
>> Assistant professor and head of Artificial Intelligence Lab
>> University of Zagreb
>> Faculty of Organization and Informatics
>> Pavlinska 2, 42000 Varazdin, Croatia
>>
http://www.foi.hr/nastavnici/schatten.markus/index.html
>>
http://www.researchgate.net/profile/Markus_Schatten1
>>
http://ai.foi.hr
>>
>>
>> On Wed, Dec 4, 2013 at 3:40 PM, EriCSN Chang
>> <
eric...@gmail.com<javascript:>>
>> wrote:
>> > It's almost as same as the sample:
>> >
>> > import spade
>> >
>> > class MyAgent(spade.Agent.Agent):
>> > class InformBehav(spade.Behaviour.OneShotBehaviour):
>> > def onStart(self):
>> > print "Starting behaviour..."
>> > def _process(self):
>> > #First, form the receiver AID
>> > receiver = spade.AID.aid(name="
rece...@127.0.0.1 <javascript:>",
>> addresses =
>> > ["xmpp://
rece...@127.0.0.1 <javascript:>"])
>> > #Second, build the message
>> > self.msg = spade.ACLMessage.ACLMessage()
>> > self.msg.setPerformative("inform")
>> > self.msg.setOntology("myOntology")
>> > self.msg.setLanguage("OWL=S")
>> > self.msg.addReceiver(receiver)
>> > self.msg.setContent("Hello World")
>> >
>> > #Third, send the message withthe "send" method of the agent
>> > self.myAgent.send(send.msg)
>> >
>> > def onEnd(self):
>> > print "Ending..."
>> >
>> >
>> > def _setup(self):
>> > print "MyAgent starting..."
>> > b = self.InformBehav()
>> > self.addBehaviour(b, None)
>> >
>> >
>> > if __name__ == "__main__":
>> > a = MyAgent("
ag...@127.0.0.1 <javascript:>", "secret")
>> > email to
spade-users...@googlegroups.com <javascript:>.
>> > To post to this group, send email to
>> >
spade...@googlegroups.com<javascript:>.