The HTML-Parameter Syntax

There are two groups of parameters read by the applet: Those used by World and those used by each individual Environment.

Quick Navigation:

[World parameters ] [Environment constructor parameter syntax ] [Environment parameters ] [Navigation ]

World parameters

Name
This parameter sets the World's name.

NumOfEnv
Number of Environments.

FPS
Maximum Frames per second.
Note: Environments often have built-in delays, thus overriding this world parameter.

Environment parameters:
Each Environment parameter has got the Environments number attached to its name, i.e. EnvName1, EnvName2 and so on.

EnvType#
Defines the type of environment used. Each Environment has got to have an unique type string for identifier.

EnvName#
The name of the Environment.

EnvParm#
This HTML parameter consisting of a (big) string including all constructor paramters for the Environment. For easy reuseabilty, a universal parameter syntax has been defined.

The Environment constructor parameter syntax

This section shows how parameters for single environments are formated in the EnvParam# HTML parameter. Each parameter uses the following system:

ParameterName : Value 1, .... , Value n;

First in order is the parametername, telling the environment which type of parameter is to be expected. After a ':', all values, parted by ',', are listed, ending with a ';'. The type of parameter is of no consequence, as all parameternames and values are forwarded to the Environment constructor by World as strings (using a two-dimensional array). All parsing of parameters is left to the environment.

The Environment parameters

The constructor parameter for the Environment is gotten from the HTML file after being divided into arrays by the World (World.java). All parameters pertaining to the environment are comma separated and each parameter type is terminated by a semicolon. Which means it has the following structure:
  <Constants.FIELDS: integer width, integer height,
         Constants.WALL,
         ... Constants.SPACE,
         ...,  Constants.WALL;
 .
 .
 Constants.GOLD: integer xcoordinate, integer ycoordinate;
 .
 .
 Constants.WUMPUS: integer xcoordinate, integer ycoordinate;
 .
 .
 Constants.AGENT: String AgentClassName, String AgentName,
                         integer no_of_arrows,
                         String imagename (optional);
 .
 .
 ...>
NOTE: integer xyz means xyz should be an integer value, ditto for Strings and here a real example:
<PARAM NAME=envparam1 VALUE="28: 5,4,
                     61,61,61,61,61,
                     61,67,63,62,61,
                     61,63,63,63,61,
                     61,61,61,61,61; 
    20:Wumpy, 3, 2;
    24:ArrayDepthIteratedWumpus, Bogzboni, 3, pict.gif;
    22:Goldy, 2, 2;">

The numbers are defined in the file called Constants.java as follows:


Navigation:


Last modified June 97