|
From: <fhe...@is...> - 2005-07-06 19:19:58
|
Hi All,
I have been trying to run experiments not using xml files to define the
experiment settings.
For this I created an Experiment object and used Experiment.setSimulator
method, passing a DEVSSimulator object as parameter. This worked while I
did'nt create a DSOLApplication object.
To do animation, I had to create my own DSOLApplication and used the same
setExperiment() method as defined in DSOLApplication (not using xml files,
nor URLs), but I got a Typecast error in the ControlPanel.notify()
method, line:
if (event.getType().equals(Experiment.SIMULATOR_CHANGED_EVENT)
&& event.getSource() instanceof Experiment)
{
if (event.getContent() != null)
{
AnimatorInterface simulator = (AnimatorInterface) event.getContent();
I solved the error by passing an Animator object instead of DEVSSimulator
in experiment.setSimulator.
Should the method Experiment.setSimulator(SimulatorInterface
simulator)have a Animator type parameter instead of SimulatorInterface or
the type-casting should be made to SimulatorInterface in
ControlPanel.notify()?
Thanks,
Francisco
|