logo CNRS

ForeFire

logo UNIV
Class Index | File Index

Classes


Class Firesim


Defined in: forefireAPI.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Firesim(ref)
Class handling a simulation
Method Summary
Method Attributes Method Name and Description
 
action(date, domain, action, params)
Action to realize
 
addBreak(date, latP1, lngP1, latP2, lngP2)
Adds a break where fire can't burn
 
addIgnition(date, lat, lng)
Adds an ignition
<static>  
Firesim.coordsFormat(strCoords)
Format a String to an Array of coordinates in JSON format
<static>  
Firesim.dateFormat(date, ds, dts, ts, ec)
Formalize a date in UTC
<static>  
Firesim.decodePoly(encoded)
Decode a Polyline
<static>  
Firesim.encodeNumber(number)
Encode a single Number
<static>  
Firesim.encodePoly(points)
Encode a polyline
 
engage(type, fct)
Starts a simulation and executes 'fct' for each data result
 
engageInTimemap(timemap, dataset)
Starts a simulation and displays the results into a TimeMapDataset
 
getAllStates(type, fct)
Processes the results of all states
 
getAllStatesInTimemap(timemap, dataset)
Stores the results of all states into a TimeMapDataset
 
getData(element, indice, fct)
Processes the JSON results of a specific state of a specific element
 
Get the last index of available state
 
getLastState(type, fct)
Processes the results of the last state
 
getLastStateInTimemap(timemap, dataset)
Stores the results of the last state into a TimeMapDataset
 
Gets the list of state files on the server for this simulation, separated by a newline
 
Returns the number of steps
 
Returns the output interval in ms
 
Returns the working directory
 
getState(type, indice, fct)
Processes the results of a specific fire front state, uses Firesim#getData
 
getStateInTimemap(timemap, dataset, indice)
Stores the results of a specific state into a TimeMapDataset
 
init(lat, lng, date, windX, windY, fuelModel)
Initialize a simulation
 
initFromPolyline(polyline, date, windX, windY, alreadyEncoded, fuelModel)
Initialize a simulation from a Polyline
<static>  
Firesim.jsonFrontsToKML(jsonStr)
Format a JSON output (for exemple from Firesim#getState) to a KML string
 
Defines the number of steps for Firesim#engage or Firesim#engageInTimemap
 
Defines the output interval for Firesim#engage or Firesim#engageInTimemap
 
step()
Processes the next simulation step
 
windSpeed(date, windX, windY)
Changes the wind speed
Class Detail
Firesim(ref)
Class handling a simulation
Parameters:
{String} ref Optional
Reference to a working directory to reload a simulation
Method Detail
action(date, domain, action, params)
Action to realize
var fs = new Firesim();
var params = [9.2, 42.3];
fs.addAction('2012-03-22T12:14:23Z', 'WORLD', 'addIgnition', params);
// Execute : 2012-03-22T12:14:23Z;WORLD;addIgnition (9.2,42.3)
Parameters:
{Date} date
Date of the action
{String} domain
Domain of the action
{String} action
Fonction of the action
{Array} params
Array of parameters

addBreak(date, latP1, lngP1, latP2, lngP2)
Adds a break where fire can't burn
Parameters:
{Date} date
Date
{Number} latP1
Latitude of the first point
{Number} lngP1
Longitude of the first point
{Number} latP2
Latitude of the second point
{Number} lngP2
Longitude of the second point
See:
Firesim#action

addIgnition(date, lat, lng)
Adds an ignition
Parameters:
{Date} date
Date
{Number} lat
Latitude of the ignition
{Number} lng
Longitude of the ignition
See:
Firesim#action

<static> {Array} Firesim.coordsFormat(strCoords)
Format a String to an Array of coordinates in JSON format
// Exemple of input : "42,9,0 41,8.7,0"
// Exemple of output :
// [{
//     lat: 42,
//     lon: 9,
//  },
//     lat: 41,
//     lon: 8.7
// }]
Parameters:
{String} strCoords
Returns:
{Array}

<static> {String} Firesim.dateFormat(date, ds, dts, ts, ec)
Formalize a date in UTC
Firesim.dateFormat(date, "_", "T", ":", "Z")
returns date as : y_m_dTh:m:sZ
Parameters:
{Date} date
{String} ds
{String} dts
{String} ts
{String} ec
Returns:
{String} Formated date

<static> {Array} Firesim.decodePoly(encoded)
Decode a Polyline
Parameters:
{String} encoded
encoded polyline
Returns:
{Array} decoded array of coordinates

<static> {String} Firesim.encodeNumber(number)
Encode a single Number
Parameters:
{Number} number
number to encode
Returns:
{String} encoded number

<static> {String} Firesim.encodePoly(points)
Encode a polyline
Parameters:
{Array} points
Array of coordinates
Returns:
{String} encoded polyline

engage(type, fct)
Starts a simulation and executes 'fct' for each data result
Parameters:
{String} type
Returned data type ("JSON" or "KML")
{Function} fct
Function processing the results with the data as parameter
See:
Firesim#setNumberOfSteps
Firesim#setOutputInterval
Firesim#getState

engageInTimemap(timemap, dataset)
Starts a simulation and displays the results into a TimeMapDataset
Defined in: forefireTimeMapAPI.js.
Parameters:
{TimeMap} timemap
{TimeMapDataset} dataset
See:
Firesim#setNumberOfSteps
Firesim#setOutputInterval

getAllStates(type, fct)
Processes the results of all states
Parameters:
{String} type
Returned data type ("JSON" or "KML")
{Function} fct
Function processing the results with the data as parameter
See:
Firesim#getState

getAllStatesInTimemap(timemap, dataset)
Stores the results of all states into a TimeMapDataset
Defined in: forefireTimeMapAPI.js.
Parameters:
{TimeMap} timemap
{TimeMapDataset} dataset

getData(element, indice, fct)
Processes the JSON results of a specific state of a specific element
Parameters:
{String} element
Data element ("fronts")
{Number} indice
Index of the specific state
{Function} fct
Function processing the results with the data as parameter
See:
Firesim#getState

{Number} getLastAvailable()
Get the last index of available state
Returns:
{Number}

{Number} getLastState(type, fct)
Processes the results of the last state
Parameters:
{String} type
Returned data type ("JSON" or "KML")
{Function} fct
Function processing the results with the data as parameter
Returns:
{Number} Index of the last processed state
See:
Firesim#getState

{Number} getLastStateInTimemap(timemap, dataset)
Stores the results of the last state into a TimeMapDataset
Defined in: forefireTimeMapAPI.js.
Parameters:
{type} timemap
{type} dataset
Returns:
{Number} Index of the last processed state

{String} getListOfStates()
Gets the list of state files on the server for this simulation, separated by a newline
Returns:
{String}

{Number} getNumberOfSteps()
Returns the number of steps
Returns:
{Number}

{Number} getOutputInterval()
Returns the output interval in ms
Returns:
{Number}

{String} getReference()
Returns the working directory
Returns:
{String} Working Directory

getState(type, indice, fct)
Processes the results of a specific fire front state, uses Firesim#getData
inst.getState("JSON", 2, alert);
// This will show an alert reading data of the second state as a JSON string :
// {
//  "fronts": [
//      {
//          "area":"0ha",
//          "date":"2011-08-05T12:10:04Z",
//          "projection":"LAMBERT2E",
//          "coordinates":"8.99,41.99,0 8.9996,41.9994,0 8.99,41.99,0"
//      }
//  ]
// }
Parameters:
{String} type
Returned data type ("JSON" or "KML")
{Number} indice
Index of the specific state
{Function} fct
Function processing the results with the data as parameter
See:
Firesim#getLastState
Firesim#getAllStates

getStateInTimemap(timemap, dataset, indice)
Stores the results of a specific state into a TimeMapDataset
Defined in: forefireTimeMapAPI.js.
Parameters:
{TimeMap} timemap
{TimeMapDataset} dataset
{Number} indice
Index of the specific state

init(lat, lng, date, windX, windY, fuelModel)
Initialize a simulation
Parameters:
{Number} lat
Latitude
{Number} lng
Longitude
{Date} date
Date
{Number} windX
Wind on X axis
{Number} windY
Wind on Y axis
{String} fuelModel Optional
Algorithm and Threat (default: B1R4)

initFromPolyline(polyline, date, windX, windY, alreadyEncoded, fuelModel)
Initialize a simulation from a Polyline
Parameters:
{Array|String} polyline
Array of coordinates ex: [[42, 9], [42.1, 8.9]]
{Date} date
Date
{Number} windX
Wind on X axis
{Number} windY
Wind on Y axis
{Boolean} alreadyEncoded Optional
If true, the polyline is already encoded (default: false)
{String} fuelModel Optional
Algorithm and Threat (default: B1R4)

<static> {String} Firesim.jsonFrontsToKML(jsonStr)
Format a JSON output (for exemple from Firesim#getState) to a KML string
Parameters:
{String} jsonStr
JSON string
Returns:
{String} KML string

setNumberOfSteps(number)
Defines the number of steps for Firesim#engage or Firesim#engageInTimemap
Parameters:
{Number} number

setOutputInterval(millis)
Defines the output interval for Firesim#engage or Firesim#engageInTimemap
Parameters:
{Number} millis
Time in ms

step()
Processes the next simulation step

windSpeed(date, windX, windY)
Changes the wind speed
Parameters:
{Date} date
Date
{Number} windX
wind on x axis
{Number} windY
wind on y axis
See:
Firesim#action

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Oct 02 2013 15:26:17 GMT+0200 (CEST)