Class SimCountry

java.lang.Object
  |
  +--Country
        |
        +--SimCountry

public class SimCountry
extends Country

Simulated Country object. This object knows the state of Country Object and it can produce the necessary state update messages for required attributes to the RTI so that other interested federates can receive these updates.


Field Summary
(package private)  HelloWorld boss
           
(package private)  double grRate
           
(package private)  boolean nameChanged
           
(package private)  boolean popuChanged
           
(package private)  RTIcap.RTIambassador rtiAmb
           
(package private)  boolean sendNameUpdateFlag
           
(package private)  boolean sendPopuUpdateFlag
           
 
Fields inherited from class Country
currentTime, myCountryName, myPopulation, ObjectID
 
Constructor Summary
SimCountry(RTIcap.RTIambassador _rtiAmb, HelloWorld _father, int _ObjectID)
           
SimCountry(RTIcap.RTIambassador _rtiAmb, HelloWorld _father, java.lang.String _name, double _initialPopulation, int _ObjectID)
           
 
Method Summary
 boolean isNameChanged()
           
 boolean isPopuChanged()
           
 void resetNameChanged()
           
 void resetPopuChanged()
           
 void setNameChanged()
           
 void setPopuChanged()
           
 void UpdateControls(boolean status, short[] theAttributes)
          turnUpdates[On/Off]ForObjectInstance in HwFederateAmbassador uses this method to tell this object to start sending attribute updates.
 void UpdateName(java.lang.String cntName)
           
 void UpdatePopulation(double newPop)
           
 void UpdateTime(double time)
          After each time adavancement in the Main simulation loop, this method will be invoked.
 
Methods inherited from class Country
getCurrentTime, getName, getObjectID, getPopulation, setCurrentTime, setName, setObjectID, setPopulation
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

grRate

double grRate

rtiAmb

RTIcap.RTIambassador rtiAmb

boss

HelloWorld boss

sendNameUpdateFlag

boolean sendNameUpdateFlag

sendPopuUpdateFlag

boolean sendPopuUpdateFlag

nameChanged

boolean nameChanged

popuChanged

boolean popuChanged
Constructor Detail

SimCountry

public SimCountry(RTIcap.RTIambassador _rtiAmb,
                  HelloWorld _father,
                  int _ObjectID)

SimCountry

public SimCountry(RTIcap.RTIambassador _rtiAmb,
                  HelloWorld _father,
                  java.lang.String _name,
                  double _initialPopulation,
                  int _ObjectID)
Method Detail

UpdateTime

public final void UpdateTime(double time)
After each time adavancement in the Main simulation loop, this method will be invoked. So that object can update its state, and broadcast its updates if it is necessary.

UpdateName

public final void UpdateName(java.lang.String cntName)

UpdatePopulation

public final void UpdatePopulation(double newPop)

UpdateControls

public final void UpdateControls(boolean status,
                                 short[] theAttributes)
turnUpdates[On/Off]ForObjectInstance in HwFederateAmbassador uses this method to tell this object to start sending attribute updates.

setNameChanged

public final void setNameChanged()

resetNameChanged

public final void resetNameChanged()

isNameChanged

public final boolean isNameChanged()

setPopuChanged

public final void setPopuChanged()

resetPopuChanged

public final void resetPopuChanged()

isPopuChanged

public final boolean isPopuChanged()