Skip to content

add_site

Syntax

add_site(place, site_id, latitude, longitude, elevation)

Parameters

place
A valid place name.
site_id
The ID for the new site.
latitude
The latitude for the new site.
longitude
The longitude for the new site.
elevation
The elevation for the new site.

Description

This action adds a new site to the place parameter, assigning the site the values specified by the site_id, latitude, longitude, and elevation parameters.

The agent creating a site with this action becomes a member of the new site.

Sites can alternatively be defined for a given place type in the place block. For example:

place my_place {
    site = 1, 48.8566, 2.3522, 0
    site = 2, 51.5072, 0.1276, 0
}

Examples

Suppose a place called Stadium exists to represent American football stadiums, and we want to add sites for the Pittsburgh Steelers' stadium and the Baltimore Ravens' stadium. The following lines would add these sites, and make the agent performing the action a member (or attendee) of the two stadiums.

# Add the actual locations for the Steelers' and Ravens' stadiums.
add_site(Stadium, 100, 40.446686, -80.015851, 725.0)
add_site(Stadium, 200, 39.273498, -76.620330, 185.0)

See Also