Skip to content

UnitsAndConstantsPDF

GAMA Bot edited this page Dec 18, 2023 · 25 revisions

Units and constants


This file is automatically generated from java files. Do Not Edit It.


Introduction

Units can be used to qualify the values of numeric variables. By default, unqualified values are considered as:

  • meters for distances, lengths...
  • seconds for durations
  • cubic meters for volumes
  • kilograms for masses

So, an expression like:

float foo <- 1;

will be considered as 1 meter if foo is a distance, or 1 second if it is a duration, or 1 meter/second if it is a speed. If one wants to specify the unit, it can be done very simply by adding the unit symbol (° or #) followed by an unit name after the numeric value, like:

float foo <- 1 °centimeter;

or

float foo <- 1 #centimeter;

In that case, the numeric value of foo will be automatically translated to 0.01 (meter). It is recommended to always use float as the type of the variables that might be qualified by units (otherwise, for example in the previous case, they might be truncated to 0). Several units names are allowed as qualifiers of numeric variables. These units represent the basic metric and US units. Composed and derived units (like velocity, acceleration, special volumes or surfaces) can be obtained by combining these units using the * and / operators. For instance:

float one_kmh <- 1 °km / °h const: true;
float one_millisecond <-1 °sec / 1000;
float one_cubic_inch <- 1 °sqin * 1 °inch;
... etc ...

Table of Contents

<wiki:toc max_depth="3" />


3D

  • \#ambient, value= Ambient light, Comment: Represent the 'ambient' type of light

  • \#direction, value= Directional light, Comment: Represent the 'direction' type of light

  • \#from_above, value= From above, Comment: Represent the position of the camera, above the scene

  • \#from_front, value= From front, Comment: Represent the position of the camera, in front of the scene

  • \#from_left, value= From left, Comment: Represent the position of the camera, on the left of the scene

  • \#from_right, value= From right, Comment: Represent the position of the camera, on the right of the scene

  • \#from_up_front, value= From up front, Comment: Represent the position of the camera, in front and slightly above the scene

  • \#from_up_left, value= From up left, Comment: Represent the position of the camera, on the left, slightly above the scene

  • \#from_up_right, value= From up right, Comment: Represent the position of the camera on the right, slightly above the scene

  • \#isometric, value= Isometric, Comment: Represent the position of the camera, on the left of the scene

  • \#point, value= Point light, Comment: Represent the 'point' type of light

  • \#spot, value= Spot light, Comment: Represent the 'spot' type of light


Constants

  • \#AStar, value= AStar, Comment: AStar shortest path computation algorithm

  • \#BellmannFord, value= BellmannFord, Comment: BellmannFord shortest path computation algorithm

  • \#Bhandari, value= Bhandari, Comment: Bhandari K shortest paths computation algorithm

  • \#BidirectionalDijkstra, value= BidirectionalDijkstra, Comment: BidirectionalDijkstra shortest path computation algorithm

  • \#CHBidirectionalDijkstra, value= CHBidirectionalDijkstra, Comment: CHBidirectionalDijkstra shortest path computation algorithm

  • \#current_error, value= , Comment: The text of the last error thrown during the current execution

  • \#DeltaStepping, value= DeltaStepping, Comment: DeltaStepping shortest path computation algorithm

  • \#Dijkstra, value= Dijkstra, Comment: Dijkstra shortest path computation algorithm

  • \#e, value= 2.718281828459045, Comment: The e constant

  • \#Eppstein, value= Eppstein, Comment: Eppstein K shortest paths computation algorithm

  • \#FloydWarshall, value= FloydWarshall, Comment: FloydWarshall shortest path computation algorithm

  • \#infinity, value= Infinity, Comment: A constant holding the positive infinity of type float (Java Double.POSITIVE_INFINITY)

  • \#max_float, value= 1.7976931348623157E308, Comment: A constant holding the largest positive finite value of type float (Java Double.MAX_VALUE)

  • \#max_int, value= 2147483647, Comment: A constant holding the maximum value an int can have (Java Integer.MAX_VALUE)

  • \#min_float, value= 4.9E-324, Comment: A constant holding the smallest positive nonzero value of type float (Java Double.MIN_VALUE)

  • \#min_int, value= -2147483648, Comment: A constant holding the minimum value an int can have (Java Integer.MIN_VALUE)

  • \#nan, value= NaN, Comment: A constant holding a Not-a-Number (NaN) value of type float (Java Double.POSITIVE_INFINITY)

  • \#NBAStar, value= NBAStar, Comment: NBAStar shortest path computation algorithm

  • \#NBAStarApprox, value= NBAStarApprox, Comment: NBAStarApprox shortest path computation algorithm

  • \#pi, value= 3.141592653589793, Comment: The PI constant

  • \#Suurballe, value= Suurballe, Comment: Suurballe K shortest paths computation algorithm

  • \#to_deg, value= 57.29577951308232, Comment: A constant holding the value to convert radians into degrees

  • \#to_rad, value= 0.017453292519943295, Comment: A constant holding the value to convert degrees into radians

  • \#TransitNodeRouting, value= TransitNodeRouting, Comment: TransitNodeRouting shortest path computation algorithm

  • \#Yen, value= Yen, Comment: Yen K shortest paths computation algorithm


Graphics units

  • \#bold, value= 1, Comment: This constant allows to build a font with a bold face. Can be combined with #italic

  • \#bottom_center, value= No Default Value, Comment: Represents an anchor situated at the center of the bottom side of the text to draw

  • \#bottom_left, value= No Default Value, Comment: Represents an anchor situated at the bottom left corner of the text to draw

  • \#bottom_right, value= No Default Value, Comment: Represents an anchor situated at the bottom right corner of the text to draw

  • \#camera_location, value= No Default Value, Comment: This unit, only available when running aspects or declaring displays, returns the current position of the camera as a point

  • \#camera_orientation, value= No Default Value, Comment: This unit, only available when running aspects or declaring displays, returns the current orientation of the camera as a point

  • \#camera_target, value= No Default Value, Comment: This unit, only available when running aspects or declaring displays, returns the current target of the camera as a point

  • \#center, value= No Default Value, Comment: Represents an anchor situated at the center of the text to draw

  • \#display_height, value= 1.0, Comment: This constant is only accessible in a graphical context: display, graphics...

  • \#display_width, value= 1.0, Comment: This constant is only accessible in a graphical context: display, graphics...

  • \#flat, value= 2, Comment: This constant represents a flat line buffer end cap style

  • \#fullscreen, value= false, Comment: This unit, only available when running aspects or declaring displays, returns whether the display is currently fullscreen or not

  • \#hidpi, value= false, Comment: This unit, only available when running aspects or declaring displays, returns whether the display is currently in HiDPI mode or not

  • \#horizontal, value= 3, Comment: This constant represents a layout where all display views are aligned horizontally

  • \#italic, value= 2, Comment: This constant allows to build a font with an italic face. Can be combined with #bold

  • \#left_center, value= No Default Value, Comment: Represents an anchor situated at the center of the left side of the text to draw

  • \#none, value= 0, Comment: This constant represents the absence of a predefined layout

  • \#pixels (#px), value= 1.0, Comment: This unit, only available when running aspects or declaring displays, returns a dynamic value instead of a fixed one. px (or pixels), returns the value of one pixel on the current view in terms of model units.

  • \#plain, value= 0, Comment: This constant allows to build a font with a plain face

  • \#right_center, value= No Default Value, Comment: Represents an anchor situated at the center of the right side of the text to draw

  • \#round, value= 1, Comment: This constant represents a round line buffer end cap style

  • \#split, value= 2, Comment: This constant represents a layout where all display views are split in a grid-like structure

  • \#square, value= 3, Comment: This constant represents a square line buffer end cap style

  • \#stack, value= 1, Comment: This constant represents a layout where all display views are stacked

  • \#top_center, value= No Default Value, Comment: Represents an anchor situated at the center of the top side of the text to draw

  • \#top_left, value= No Default Value, Comment: Represents an anchor situated at the top left corner of the text to draw

  • \#top_right, value= No Default Value, Comment: Represents an anchor situated at the top right corner of the text to draw

  • \#user_location (#user_location_in_world), value= No Default Value, Comment: This unit permanently holds the mouse's location in the world's coordinates. If it is outside a display window, its last position is used.

  • \#user_location_in_display, value= No Default Value, Comment: This unit permanently holds the mouse's location in the display's coordinates. If it is outside a display window, its last position is used.

  • \#vertical, value= 4, Comment: This constant represents a layout where all display views are aligned vertically

  • \#zoom, value= 1.0, Comment: This unit, only available when running aspects or declaring displays, returns the current zoom level of the display as a positive float, where 1.0 represent the neutral zoom (100%)


Length units

  • \#µm (#micrometer,#micrometers), value= 1.0E-6, Comment: micrometer unit

  • \#cm (#centimeter,#centimeters), value= 0.01, Comment: centimeter unit

  • \#dm (#decimeter,#decimeters), value= 0.1, Comment: decimeter unit

  • \#foot (#feet,#ft), value= 0.3048, Comment: foot unit

  • \#inch (#inches), value= 0.025400000000000002, Comment: inch unit

  • \#km (#kilometer,#kilometers), value= 1000.0, Comment: kilometer unit

  • \#m (#meter,#meters), value= 1.0, Comment: meter: the length basic unit

  • \#mile (#miles), value= 1609.344, Comment: mile unit

  • \#mm (#milimeter,#milimeters), value= 0.001, Comment: millimeter unit

  • \#nm (#nanometer,#nanometers), value= 9.999999999999999E-10, Comment: nanometer unit

  • \#yard (#yards), value= 0.9144, Comment: yard unit


Math constants

  • \#AdamsBashforth, value= AdamsBashforth, Comment: AdamsBashforth solver

  • \#AdamsMoulton, value= AdamsMoulton, Comment: AdamsMoulton solver

  • \#DormandPrince54, value= DormandPrince54, Comment: DormandPrince54 solver

  • \#dp853, value= dp853, Comment: dp853 solver

  • \#Euler, value= Euler, Comment: Euler solver

  • \#Gill, value= Gill, Comment: Gill solver

  • \#GraggBulirschStoer, value= GraggBulirschStoer, Comment: GraggBulirschStoer solver

  • \#HighamHall54, value= HighamHall54, Comment: HighamHall54 solver

  • \#Luther, value= Luther, Comment: Luther solver

  • \#Midpoint, value= Midpoint, Comment: Midpoint solver

  • \#rk4, value= rk4, Comment: rk4 solver

  • \#ThreeEighthes, value= ThreeEighthes, Comment: ThreeEighthes solver


Surface units

  • \#m2, value= 1.0, Comment: square meter: the basic unit for surfaces

  • \#sqft (#square_foot,#square_feet), value= 0.09290304, Comment: square foot unit

  • \#sqin (#square_inch,#square_inches), value= 6.451600000000001E-4, Comment: square inch unit

  • \#sqmi (#square_mile,#square_miles), value= 2589988.110336, Comment: square mile unit


Time units

  • \#custom, value= CUSTOM, Comment: custom: a custom date/time pattern that can be defined in the preferences of GAMA and reused in models

  • \#cycle (#cycles), value= 1, Comment: cycle: the discrete measure of time in the simulation. Used to force a temporal expression to be expressed in terms of cycles rather than seconds

  • \#day (#d,#days), value= 86400.0, Comment: day time unit: defines an exact duration of 24 hours

  • \#epoch, value= No Default Value, Comment: The epoch default starting date as defined by the ISO format (1970-01-01T00:00Z)

  • \#h (#hour,#hours), value= 3600.0, Comment: hour time unit: defines an exact duration of 60 minutes

  • \#iso_local, value= ISO_LOCAL_DATE_TIME, Comment: iso_local: the standard ISO 8601 output / parsing format for local dates (i.e. with no time-zone information)

  • \#iso_offset, value= ISO_OFFSET_DATE_TIME, Comment: iso_offset: the standard ISO 8601 output / parsing format for dates with a time offset

  • \#iso_zoned, value= ISO_ZONED_DATE_TIME, Comment: iso_zoned: the standard ISO 8601 output / parsing format for dates with a time zone

  • \#minute (#minutes,#mn), value= 60.0, Comment: minute time unit: defined an exact duration of 60 seconds

  • \#month (#months), value= 2592000.0, Comment: month time unit: an approximate duration of 30 days. The number of days of each #month depend of course on the current_date of the model and cannot be constant

  • \#msec (#millisecond,#milliseconds,#ms), value= 0.001, Comment: millisecond time unit: defines an exact duration of 0.001 second

  • \#now, value= 1.0, Comment: This value represents the current date

  • \#sec (#second,#seconds,#s), value= 1.0, Comment: second: the time basic unit, with a fixed value of 1. All other durations are expressed with respect to it

  • \#week (#weeks), value= 604800.0, Comment: week time unit: defines an exact duration of 7 days

  • \#year (#years,#y), value= 3.1536E7, Comment: year time unit: an approximate duration of 365 days. The value of #year in number of days varies depending on leap years, etc. and is dependend on the current_date of the model


User control operators


Volume units

  • \#cl (#centiliter,#centiliters), value= 1.0E-5, Comment: centiliter unit

  • \#dl (#deciliter,#deciliters), value= 1.0E-4, Comment: deciliter unit

  • \#hl (#hectoliter,#hectoliters), value= 0.1, Comment: hectoliter unit

  • \#l (#liter,#liters,#dm3), value= 0.001, Comment: liter unit

  • \#m3, value= 1.0, Comment: cube meter: the basic unit for volumes


Weight units

  • \#gram (#grams), value= 0.001, Comment: gram unit

  • \#kg (#kilo,#kilogram,#kilos), value= 1.0, Comment: second: the basic unit for weights

  • \#longton (#lton), value= 1016.0469088000001, Comment: short ton unit

  • \#ounce (#oz,#ounces), value= 0.028349523125, Comment: ounce unit

  • \#pound (#lb,#pounds,#lbm), value= 0.45359237, Comment: pound unit

  • \#shortton (#ston), value= 907.18474, Comment: short ton unit

  • \#stone (#st), value= 6.35029318, Comment: stone unit

  • \#ton (#tons), value= 1000.0, Comment: ton unit


Colors

In addition to the previous units, GAML provides a direct access to the 147 named colors defined in CSS (see http://www.cssportal.com/css3-color-names/). E.g,

rgb my_color <- °teal;
  1. What's new (Changelog)
  1. Installation and Launching
    1. Installation
    2. Launching GAMA
    3. Updating GAMA
    4. Installing Plugins
  2. Workspace, Projects and Models
    1. Navigating in the Workspace
    2. Changing Workspace
    3. Importing Models
  3. Editing Models
    1. GAML Editor (Generalities)
    2. GAML Editor Tools
    3. Validation of Models
  4. Running Experiments
    1. Launching Experiments
    2. Experiments User interface
    3. Controls of experiments
    4. Parameters view
    5. Inspectors and monitors
    6. Displays
    7. Batch Specific UI
    8. Errors View
  5. Running Headless
    1. Headless Batch
    2. Headless Server
    3. Headless Legacy
  6. Preferences
  7. Troubleshooting
  1. Introduction
    1. Start with GAML
    2. Organization of a Model
    3. Basic programming concepts in GAML
  2. Manipulate basic Species
  3. Global Species
    1. Regular Species
    2. Defining Actions and Behaviors
    3. Interaction between Agents
    4. Attaching Skills
    5. Inheritance
  4. Defining Advanced Species
    1. Grid Species
    2. Graph Species
    3. Mirror Species
    4. Multi-Level Architecture
  5. Defining GUI Experiment
    1. Defining Parameters
    2. Defining Displays Generalities
    3. Defining 3D Displays
    4. Defining Charts
    5. Defining Monitors and Inspectors
    6. Defining Export files
    7. Defining User Interaction
  6. Exploring Models
    1. Run Several Simulations
    2. Batch Experiments
    3. Exploration Methods
  7. Optimizing Model Section
    1. Runtime Concepts
    2. Optimizing Models
  8. Multi-Paradigm Modeling
    1. Control Architecture
    2. Defining Differential Equations
  1. Manipulate OSM Data
  2. Diffusion
  3. Using Database
  4. Using FIPA ACL
  5. Using BDI with BEN
  6. Using Driving Skill
  7. Manipulate dates
  8. Manipulate lights
  9. Using comodel
  10. Save and restore Simulations
  11. Using network
  12. Headless mode
  13. Using Headless
  14. Writing Unit Tests
  15. Ensure model's reproducibility
  16. Going further with extensions
    1. Calling R
    2. Using Graphical Editor
    3. Using Git from GAMA
  1. Built-in Species
  2. Built-in Skills
  3. Built-in Architecture
  4. Statements
  5. Data Type
  6. File Type
  7. Expressions
    1. Literals
    2. Units and Constants
    3. Pseudo Variables
    4. Variables And Attributes
    5. Operators [A-A]
    6. Operators [B-C]
    7. Operators [D-H]
    8. Operators [I-M]
    9. Operators [N-R]
    10. Operators [S-Z]
  8. Exhaustive list of GAMA Keywords
  1. Installing the GIT version
  2. Developing Extensions
    1. Developing Plugins
    2. Developing Skills
    3. Developing Statements
    4. Developing Operators
    5. Developing Types
    6. Developing Species
    7. Developing Control Architectures
    8. Index of annotations
  3. Introduction to GAMA Java API
    1. Architecture of GAMA
    2. IScope
  4. Using GAMA flags
  5. Creating a release of GAMA
  6. Documentation generation

  1. Predator Prey
  2. Road Traffic
  3. 3D Tutorial
  4. Incremental Model
  5. Luneray's flu
  6. BDI Agents

  1. Team
  2. Projects using GAMA
  3. Scientific References
  4. Training Sessions

Resources

  1. Videos
  2. Conferences
  3. Code Examples
  4. Pedagogical materials
Clone this wiki locally