[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Swarm-Support] swarm
From: |
Ivan Lazarevic |
Subject: |
RE: [Swarm-Support] swarm |
Date: |
Tue, 6 May 2003 16:44:05 +0200 |
Maybe you didn't instantiate modelSchedule before calling its method?
Ivan Lazarevic
-----Original Message-----
From: address@hidden [mailto:address@hidden Behalf
Of Gregoire Boutonnet
Sent: Tuesday, May 06, 2003 4:05 PM
To: address@hidden
Subject: [Swarm-Support] swarm
Hi,
I program in java language.
I have read the tutorial and I try to make a programme but I have an error
that I can`t correct.
I explain my trouble :
I have a file "ModelSwarm.java" in which I have written the fonction
"activateIn(Swarm swarmContext)"
the code is :
public Activity activateIn(Swarm swarmContext)
{
// Use the parent class to activate ourselves in the context passed to
us
super.activateIn(swarmContext);
// Then activate the schedule in ourselves
modelSchedule.activateIn(this); // line 172 of ModelSwarm.java
// Finally return the activity we have built
return getActivity();
}
Like in heatBugs
and in another file "StartSimulation.java" I call this method :
modelSwarm.activateIn(null); (line 31)
This request is in the main method.
When I compile I have no error
But when I want to run the program I have this error :
Exception in thread "main" java.lang.NullPointerException
at ModelSwarm.activateIn(ModelSwarm.java:172)
at StartSimulation.main(StartSimulation.java:31)
And I don`t understand why.
Maybe can you help me.
Thanks a lot
Regards
BOUTONNET Gregoire
_______________________________________________
Support mailing list
address@hidden
http://www.swarm.org/mailman/listinfo/support