Skip to content

HIGHLIGHT hook to self scheduling or trigger attribute

esseff edited this page Jun 1, 2025 · 2 revisions

Home > Model Development Topics > Highlight Topic

Self-scheduling and trigger derived attributes can be very convenient in model code. For example, self_scheduling_int(time) implicitly creates a hidden event which implements an annual calendar clock which updates the attribute.

OpenmM++ takes self-scheduling and trigger attributes to another level by allowing hooks to them.

So, for example, one can do

entity Person {
   hook NewYear, self_scheduling_int(time);
};

to call the model-specific entity function Person::NewYear() when time crosses an integer boundary, without having to explicitly code a clock-like event in model code.

Here's another example which outputs microdata at age 65 using the built-in entity function write_microdata.

entity Person {
   int integer_age = self_scheduling_int(age);
   hook write_microdata, trigger_entrances(integer_age, 65);
};

For a bit more on this, see the Entity Function Hooks wiki topic.

Home

Getting Started

Model development in OpenM++

Using OpenM++

Model Development Topics

OpenM++ web-service: API and cloud setup

Using OpenM++ from Python and R

Docker

OpenM++ Development

OpenM++ Design, Roadmap and Status

OpenM++ web-service API

GET Model Metadata

GET Model Extras

GET Model Run results metadata

GET Model Workset metadata: set of input parameters

Read Parameters, Output Tables or Microdata values

GET Parameters, Output Tables or Microdata values

GET Parameters, Output Tables or Microdata as CSV

GET Modeling Task metadata and task run history

Update Model Profile: set of key-value options

Update Model Workset: set of input parameters

Update Model Runs

Update Modeling Tasks

Run Models: run models and monitor progress

Download model, model run results or input parameters

Upload model runs or worksets (input scenarios)

Download and upload user files

User: manage user settings

Model run jobs and service state

Administrative: manage web-service state

Clone this wiki locally