swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Probes in Java (subclass)


From: Marie-Edith Bissey
Subject: Probes in Java (subclass)
Date: Wed, 27 Jun 2001 10:46:36 +0200 (MEST)

Salve!

I have a problem with the creation of probes for objects from a
subclass of one of the classes in my simulation.

To set the problem as clearly as possible: in my simulation, I have
two classes of agents, Player and IntelligentPlayer,
IntelligentPlayer being derived (extended) from Player:

public class Player extends SwarmObjectImpl
        {
        ...
        }
public class IntelligentPlayer extends Player
        {
        ...
        }

As a consequence, in IntelligentPlayer, I declared only the variables
and the methods that differed from the ones in Player.  The problem
occurs when trying to make the probes for the two types of players. I
cannot probe the IntelligentPlayer for the variables declared only in
Player (as public variables) and which are common to the two types of
players. 
The message I get, at runtime, is:

*** event raised for warning: WarningMessage
*** function: _i_ProbeMap__addProbe_(), file:
/src/Swarm/swarm/src/objectbase/ProbeMap.m, line: 589
Attempt to add null probe
*** execution continuing...

I do not get this message if I declare the variables at the beginning
of IntelligentPlayer (but then I have to repeat a lot of the functions
existing in Player and common to the two types to get the simulation
to work properly, which does not seem very logical).

The problem seems to be only with the probes, the rest of the
simulation functions correctly.

What do I need to tell the IntelligentPlayer to recognise that the
variables I want to probe are defined in the constructor for Player?

Thank you in advance for your help,

Marie-Edith. 
__________________________________________________________________

Marie-Edith Bissey
Universita` del Piemonte Orientale "Amedeo Avogadro"
Facolta` di Science Politiche         email: address@hidden
Corso Borsalino 50                    tel: +39-0131-283700
15 100 Alessandria -- ITALIA          fax: +39-0131-263030
http://polis.unipmn.it/doc/bis/hp.htm


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]