You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

FEWS Game scenario configuration

What

scenario_config.xml

Description

Configuration of a scenario in the FEWS Game

schema location

scenario_config.xsd

In a scenario configuration, the start and end time of a scenario, and events for a scenario are specified. A scenario must be a directory in the scenario database in which files relevant for that scenario are collected.

Schema definition overview

The global structure of the XML-schema for the scenario configuration is as follows:

The Name-key is an optional identifier for the scenario. The start and end date/time for the scenario have to be specified using attributes date and time in the format YYYY-MM-DD and hh:mm:ss, respectively. The NextEventButton-key can be set to yes or no and indicates whether or not a button for proceeding to the next event in the scenario must be included in the user interface. The events and forecasts for a scenario are explained below.

Events

In the section Events of the scenario configuration, an arbitrary number of events can be specified according to the following schema:

Each event must have a title by specifying the Title-key. This title will be used in the list of actions that the user can invoke from the drop-down menu in the scenario window of the FEWS Game. The title can be different for various languages:

<Event>
   <Title lang="NL">Volgende activiteit</Title>
   <Title lang="GE">Nächste Veranstaltung</Title>
   <Title>Next event</Title>
</Event>

If the language attribute for Title is specified and it corresponds to the preferred language in the application configuration, then this title is used in the scenario. If no language attribute is found that corresponds the the preferred language, then the default Title for which no language attribute was specified will be used.

The Type of an event can be equal to either static, dynamic or static and dynamic. A static event will be executed at the indicated time and will be lost thereafter, i.e. the event can not be invoked again by the user. A dynamic will be available after the indicated time as an action in the drop-down menu of the scenario window and can be invoked by the user. A static and dynamic event will be executed at the indicated time, but is also available as an action in the drop-down menu.

The Time-key indicates when a static event will be executed or when a dynamic event will be available as an action to the user. The schema for this key is identical to that of dateTimeType which was presented above.

A condition can be added to an event; the event will only be executed if this condition is fulfilled. For now, the only supported condition is one based on a forecast published by the user. A condition must be specified according to:

where

  • Type must be equal to "Forecast",
  • Station is the name of the forecast station (see below),
  • Operator is one of "lt" (less than), "gt" (greater than), "le" (less than or equal to), or "ge" (greater than or equal to), and
  • Value is the reference value to compare to.

An example in which a condition is used:

<Event>
   <Title>condition</Title>
   <Type>static and dynamic</Type>
   <Time>
      <Year>2008</Year>
      <Month>3</Month>
      <Day>13</Day>
      <Hour>0</Hour>
      <Minute>1</Minute>
      <Second>0</Second>
   </Time>
   <Condition>
      <Type>Forecast</Type>
      <Station>Lowestoft</Station>
      <Operator>ge</Operator>
      <Value>300</Value>
   </Condition>
   <File>emergency_telephone_call.txt</File>
</Event>

One of the following three actions can be associated with an event:

  • File: the specified file is executed (e.g. a pdf-file that is displayed in Adobe Reader),
  • Continue: the scenario time is shifted forward to the time corresponding to the next scheduled event,
  • NewTime: the scenario time is shifted to the specified time.
    The File-key has an optional language attribute that behaves the same as for the Title-key. The NewTime-key follows the schema for the dateTimeType which was presented above.

Forecasts

Locations for which a water level forecast must be made are specified in the Forecasts-section. The schema for this section is as follows:

The time zone can be specified with the TimeZone-key; for now, only "GMT" is supported.

For each forecast in the list of forecasts, the following items must be specified:

  • Sector: the name of the sector to which the forecast station belongs,
  • Station: the name of the forecast station,
  • FewsLocation: the name of the forecast station in the FEWS configuration,
  • AstroDateTime: the date/time of the astronomical high tide for which a water level forecast must be made,
  • AstroWaterLevel: the astronomical water level of the high tide.

The AstroDateTime-key follows the schema for the dateTimeType which was presented above.

Example

A complete example of a scenario configuration is given here:

Example of scenario configuration
<Scenario xmlns="http://localhost" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://localhost ../../xml-schemas/scenario_config.xsd">
   <Name>storm surge March 10-13</Name>
   <Start>
      <Year>2008</Year>
      <Month>3</Month>
      <Day>12</Day>
      <Hour>4</Hour>
      <Minute>0</Minute>
      <Second>0</Second>
   </Start>
   <Stop>
      <Year>2008</Year>
      <Month>3</Month>
      <Day>12</Day>
      <Hour>18</Hour>
      <Minute>0</Minute>
      <Second>0</Second>
   </Stop>
   <Events>
      <Event>
         <Title lang="NL">Volgende activiteit</Title>
         <Title lang="EN">Next event</Title>
         <Type>dynamic</Type>
         <Continue/>
      </Event>
      <Event>
         <Title lang="NL">Start zitting</Title>
         <Title lang="EN">Session start</Title>
         <Type>static and dynamic</Type>
         <Time>
            <Year>2008</Year>
            <Month>3</Month>
            <Day>12</Day>
            <Hour>4</Hour>
            <Minute>0</Minute>
            <Second>5</Second>
         </Time>
         <File lang="NL">start_zitting_NL.txt</File>
         <File lang="EN">start_zitting_EN.txt</File>
      </Event>
      <Event>
         <Title lang="NL">KNMI weeranalyse 12 maart, 0:00 uur</Title>
         <Title lang="EN">KNMI analysis March 12, 12:00 midnight</Title>
         <Type>dynamic</Type>
         <Time>
            <Year>2008</Year>
            <Month>3</Month>
            <Day>12</Day>
            <Hour>4</Hour>
            <Minute>0</Minute>
            <Second>5</Second>
         </Time>
         <File lang="NL">weerkaart_12maart_00uur.pdf</File>
         <File lang="EN">weerkaart_12maart_00uur.pdf</File>
      </Event>
      <Event>
         <Title lang="NL">KNMI weeranalyse 12 maart, 12:00 uur</Title>
         <Title lang="EN">KNMI analysis March 12, 12:00 noon</Title>
         <Type>dynamic</Type>
         <Time>
            <Year>2008</Year>
            <Month>3</Month>
            <Day>12</Day>
            <Hour>4</Hour>
            <Minute>0</Minute>
            <Second>5</Second>
         </Time>
         <File lang="NL">weerkaart_12maart_12uur.pdf</File>
         <File lang="EN">weerkaart_12maart_12uur.pdf</File>
      </Event>
      <Event>
         <Title lang="NL">KNMI weeranalyse 13 maart, 0:00 uur</Title>
         <Title lang="EN">KNMI analysis March 13, 12:00 midnight</Title>
         <Type>dynamic</Type>
         <Time>
            <Year>2008</Year>
            <Month>3</Month>
            <Day>12</Day>
            <Hour>4</Hour>
            <Minute>0</Minute>
            <Second>5</Second>
         </Time>
         <File lang="NL">weerkaart_13maart_06uur.pdf</File>
         <File lang="EN">weerkaart_13maart_06uur.pdf</File>
      </Event>
      <Event>
         <Title lang="NL">Telefoon KNMI</Title>
         <Title lang="EN">Telephone call KNMI</Title>
         <Type>static and dynamic</Type>
         <Time>
            <Year>2008</Year>
            <Month>3</Month>
            <Day>12</Day>
            <Hour>4</Hour>
            <Minute>10</Minute>
            <Second>0</Second>
         </Time>
         <File lang="NL">telefoon_knmi_bericht1_NL.txt</File>
         <File lang="EN">telefoon_knmi_bericht1_EN.txt</File>
      </Event>
      <Event>
         <Title lang="NL">Opdracht 1</Title>
         <Title lang="EN">Exercise 1</Title>
         <Type>static and dynamic</Type>
         <Time>
            <Year>2008</Year>
            <Month>3</Month>
            <Day>12</Day>
            <Hour>4</Hour>
            <Minute>11</Minute>
            <Second>0</Second>
         </Time>
         <File lang="NL">opdracht1_NL.txt</File>
         <File lang="EN">opdracht1_EN.txt</File>
      </Event>
   </Events>
   <Forecasts>
      <TimeZone>GMT</TimeZone>
      <Forecast>
         <Sector>Schelde</Sector>
         <Station>Vlissingen</Station>
         <AstroDateTime>
            <Year>2008</Year>
            <Month>3</Month>
            <Day>12</Day>
            <Hour>17</Hour>
            <Minute>16</Minute>
            <Second>0</Second>
         </AstroDateTime>
         <AstroWaterLevel>237</AstroWaterLevel>
      </Forecast>
      <Forecast>
         <Sector>West Holland</Sector>
         <Station>Hoek van Holland</Station>
         <AstroDateTime>
            <Year>2008</Year>
            <Month>3</Month>
            <Day>12</Day>
            <Hour>18</Hour>
            <Minute>1</Minute>
            <Second>0</Second>
         </AstroDateTime>
         <AstroWaterLevel>122</AstroWaterLevel>
      </Forecast>
   </Forecasts>
</Scenario>
  • No labels