next up previous
Next: Adding probes to entities Up: Entities and Events Previous: Querying an entity's class

Access to the detailed internal structure of an entity

The basic Entity class includes minimal state, but user types of entity may include complex state information. The query interface allows this information to be accessed from another entity. For example: what is the structure of an entity, then what's the calcium concentration of a particular dendrite?

--- ( in script reader ) ---
  class GetStructure extends EntityQuery { 
    Object query(NeosimEntity e) { 
       return ((CompartmentalEntity)e).getStructure();
    }
  }
  class GetCaConc extends EntityQuery { 
     GetCaConc( int CompartmentID );
     Object query(NeosimEntity e) { 
       return ((CompartmentalEntity)e).getCaConc( CompartmentID );
     }
  }
  // e = lookup entity to query
  Structure struct = (Structure)queryEntity( e, new GetStructure() );
  int compartmentID = struct.lookupCompartment(...);
  GetCaConc getca = new GetCaConc( compartmentID );
  Object caconc = queryEntity( e, getca );
Section 6 has more details on this approach.



Fred Howell
8/15/1999