From GridLAB-D Wiki
Jump to: navigation, search

Searching for objects and defining object groups both use the same syntax.

Search criteria

Object searches are usually expressed using a search criteria, such as

object class {
  group "property op value";
  // ..

where class is the class of object that uses the group property (e.g., collector, histogram), property is the object property to match against (e.g., name, class, parent), op is the comparison operator (e.g., =, <, !~), and value the value to match against.

The following properties are always recognized, in addition to all the properties defined by the class:

the name of class which implements the object
the name of the module which implements the class
the id number of the object
the name of the object
the parent of the object (matches the name of the parent)
the object's rank
the object's latitude
the object's longitude
the object's clock
the object's in-service date/time
the object's out-of-service date.time
the object's flags (see Object header properties )

Compound criteria

Multiple search criteria can be indicated using and/or as appropriate. Parenthetical operators are not supported.

See regarding the OR functionality which is not implemented prior to Hassayampa (Version 3.0). Resolution is planned in Hassayampa (Version 3.0).

The implementation of the and and or operators is incomplete and not mathematically correct. Any logical statement joined with an and will remove all objects not identified with that operation from the working set. Any logical statement joined with an or will add all objects that match that operation to the working set. There is no sense of operator precedence, and operators are processed from left to right.

For example, to build the set 'all triplex_meters with groupid blue or groupid red', the set must be 'groupid=red OR groupid=blue AND class=triplex_meter'. First the set is populated with all objects with a red or blue groupid, then is filtered for only the triplex meters in that set.

The set 'all triplex_meters with groupid blue, plus all meters with groupid red' cannot be generated with the existing system. 'groupid=red AND class=triplex_meter OR groupid=blue AND class=meter' will only return meters with the blue groupid.

Date/time values

Date and time values must be fully qualified absolute date/time stamps using the appropriate timezone. Relative time can also be given using s, m, h, d, or w suffixes as desired, e.g., 1800s to indicate 30 minutes.


Not equal, e.g., property!=number
Less than or equal, e.g., property<=number
Greater than or equal, e.g., property>=number
Not like, e.g., property<=string
Equal, e.g., property=number
Less than, e.g., property<=number
Greater than, e.g., property>=number
Like, e.g., property<=string