k.Actors behaviors

Use k.Actors for work that happens in response to a message, event or user action. A behavior is a program. An agent is a running instance. Examples include an application in a project and a behavior associated with an observer in a digital twin.

behavior examples.clock
    "Report the time supplied by the timer."
    version 1.0
    using
        core.timer as timer,
        core.console as console

action main:
    timer.in(15.s):
        time -> console.format("The timer supplied %s", time)

The preamble names the behavior and imports two actors. The main action schedules the timer. The match action binds the value supplied by that timer to time, then forwards it to the console. A semantic literal such as {{ earth:Elevation }} can carry an observable meaning in a behavior value or match.

The language registration uses .kactor. Project storage recognizes both .kactor and .kactors, and Modeler uses the plural suffix for generated behavior files. Use the project's creation command to obtain the corresponding document type and location.

Exercise a behavior with a local operational Runtime and the actors it imports. When working on a project application, save and synchronize the intended version before rerunning it. A behavior can request observations through its host, while model eligibility and scientific outputs still follow the declared semantics. Run behaviors and applications

For a complete interaction, bind a field observer to a k.IM definition, subscribe its coordinator to the start of a storm, and exchange a warning and an acknowledgement. Agent-based modeling

Full language guide ยท KActors grammar