Share
 
 

About the switch configuration script language

Ruby scripts are written to define when switch objects are to be used based on weather feed data and date.

An example of a script is shown below:

The following class names and member functions are currently implemented:

  • IWLCalendar - general use
  • IWLBaseline - general use
  • UKMetOfficeWCF - used for UK Met Office World Cities Five Day Forecast
  • UKMetOfficeDWF - used for UK Met Office UK Cities Forecast and UK Met Office World Cities Forecast

Class IWLCalendar

This class is for general use.

Member function Description
bool is_holiday()

Returns true if the current simulation date is a holiday (as defined by the calendar)

bool is_holiday(string name)

Returns true if the current simulation date is the named holiday (as defined by the calendar)

bool is_weekday()

Returns true if the current simulation date is a weekday (as defined by the calendar)

bool is_weekend()

Returns true if the current simulation date is a weekend (as defined by the calendar)

NB: The simulation date is single-state. In other words, the date can be only one of the following: holiday, weekday or weekend.

Class IWLBaseline

This class is for general use.

Member function Description
switch(type, id)

Sets the specified model object type* and id as a switch object.

switch(type, name)

Sets the specified model object type* and name as a switch object.

switch(type, guid)

Sets the specified model object type* and guid as a switch object.

* The type argument is the scripting type name, which in most cases is the same as the model object description:

Type argument Object description

Control

Control

Demand Diagram

Demand Diagram

Demand Scaling

Demand Scaling

Electricity Tariff

Electricity Tariff

Energy GHG Factors

Energy CO2 Factors

RTC Scenario

UPC Scenario

Class UKMetOfficeWCF

This class is for use by the UK Met Office World Cities Five Day Forecast.

Member function Description
double weather_code()

Returns a weather code.

Visit the Met Office for documentation for details on how to interpret the weather code.

double max_temperature()

Returns the maximum forecast temperature for the current forecast.

double max_temperature()

Returns minimum forecast temperature for the current forecast.

Class UKMetOfficeDWF

This class is for use by the UK Met Office UK Cities Forecast and UK Met Office World Cities Forecast.

Member function Description
double day_weather_code()

Returns a weather code that describes daytime significant weather for the current forecast.

double night_weather_code()

Returns a weather code that describes nighttime significant weather for the current forecast.

double max_temperature()

Returns the maximum forecast temperature for the current forecast.

double mix_temperature()

Returns minimum forecast temperature for the current forecast.

Was this information helpful?