[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Swarm-Support] swarm
From: |
Gregoire Boutonnet |
Subject: |
[Swarm-Support] swarm |
Date: |
Tue, 06 May 2003 15:04:58 +0100 |
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
- [Swarm-Support] swarm,
Gregoire Boutonnet <=