New container appears - agent doesn't?


Subject: New container appears - agent doesn't?
dnb@csd.abdn.ac.uk
Date: Sat Feb 15 2003 - 16:54:34 MET


Hi,

i'm using the wrapper class to create a new agent, but only the container
appears. The agent doesn't, for reasons i can only dream about, though I have
a feeling it's to do with staleproxyexceptions i was getting earlier.

here is my code to create the agent etc.:

                // Get a hold on JADE runtime
                System.out.println("Get a hold on JADE runtime...");
                Runtime rt = Runtime.instance();
                // Create a default profile
                System.out.println("Create a default profile...");
                Profile p = new ProfileImpl();
                // Create a new non-main container, connecting to the default
                System.out.println("Create new non-main container...");
                AgentContainer ac = rt.createAgentContainer(p);

                String[] stArgs = {"-c",myAgent.agentName};

                Object args[] = new Object[1];
                args[0] = (Object) stArgs;
                System.out.println("Create/Try to create new Agent...");
                Agent IntAgent = (Agent) ac.createNewAgent
( "angus", "InterAgentAS.interAgentAS", args);
                System.out.println("Starting up a InterAgent ...");
                IntAgent.start();
                State = 2;

i have to cast the createNewAgent like Fabio said but is this the right way
to ?

any thoughts much appreciated

doug.



This archive was generated by hypermail 2a22 : Sat Feb 15 2003 - 16:51:56 MET