Wildfire Agent Creation

1. Place the agent container in the VRML Scene. This container can be controlled using the translation and scale fields of the container either by manually editing the fields or using a JAVA program. (Example 1)

2. Set the correct fuel model by editing the SFString scene type field of the Agent Dispatcher Script Node. The 5 available types are southern rough, oak, light logging, medium logging, and heavy logging. (Example 2)

3. Ensure the URL field of this Agent Consultant script node points to the correct Agent Consultant class for your scene type. (Example 3)

Example 1. Controlling the agent container from java

// gets the agent container from te VRML scene

SFNode node = (SFNode) getField("node");;

Node t = = (Node) node.getValue();

// gets the scenetype you are using from the vrml world (One of Rothermels predefined fuel models)

String scenetype = (SFString)t.getExposedField("scenetype");


// get the agents current location in the world

trans = (SFVec3f)t.getExposedField("translation");
scale = (SFVec3f)t.getExposedField("scale"

/// creates a coordinates object to hold the agents new coordinates

Coordinates coord = new Coordinates();;

//Set the agents current location

coord.setX(trans.getX() );
coord.setY((float)(trans.getY()));
coord.setZ(trans.getZ() );

// send the coordinates into the agent dispatcher, The new coordinates and scale are returned dependent on what model you used.

coord = fire.agentDispatcher(coord);

Example 2. Ensuring the scenetype

#####################################################################################################################
# This is the script that determines the movent ofthe agent
#####################################################################################################################

DEF Agent_Dispatcher Script {
directOutput TRUE
field SFNode node USE Agent_Container
field SFFloat windspeed 0
field SFFloat winddirection 0
field SFFloat moisture 0
field SFString scenetype "lightlogging" <----------- field that needs to be changed for differing scenethypes
url "AgentDispatcher.class"
eventIn SFFloat start
eventIn SFVec3f params

field SFBool firstime TRUE
eventOut SFBool moveable

eventOut SFVec3f scale_changed


Example 3. Ensuring the Agent Consultant is pointing to the correct Java Class

#####################################################################################################################
# The script that handles the object to object collision detection for VRML
#####################################################################################################################

# This is an abridged version for example purposes

DEF Agent_Consultant Script {
directOutput TRUE
# objects in the scene you want to check if they are collideded with. In this case its trees.


field SFNode collide1 USE dad_Group03
field SFNode collide2 USE dad_Group04


#objects you want to replace with when a collision occurs


field SFNode burnt_tree2 USE burnt2
field SFNode burnt_tree3 USE burnt3

* objects you want to replace with when it is collided with

field SFNode node USE Agent_Container
field SFNode bt USE Burning_Tree


eventOut SFBool start_ani
eventOut SFVec3f fire_translation
url "AgentController.class" <----- Here is the user that should be pointing to the correct agent_consultant interface for the scenetype
eventIn SFFloat start

}