Configure Model Architecture
Build hybrid models in Yano Simulator from the same Stocks, Flows, equations, and Modules used for system dynamics. Select an object to configure its behavior in the Inspector. Open Model > Model Architecture when you need shared definitions, exchanges, or a whole-model setup check.
Start with the modeling task
- Draw the quantities that accumulate and the Flows that move them. Leave ordinary SD objects unchanged.
- Use a Queue Stock when individual entities wait, a Processing Stock when they receive service, and a Resource Pool Stock for reusable units. These remain Stocks with familiar Flow connections.
- Select an Arrival, Service, Discrete Flow, or Departure and configure its activation and quantity. The endpoints define the path; no separate routing object is required.
- Add an Agent Module only when individuals need their own fields, continuous state, decisions, space, or network. Share its population with the DES process to preserve individual identity.
- Use a statechart for mutually exclusive modes, event reactions, and timeouts. Keep physical accumulation in Per-Agent States and Flows.
- Open Model Architecture > Queues & Resources, resolve the linked setup checks, then simulate and inspect queues, resource intervals, agent fields, and statechart transitions.
The Modeling Presets disclosure in the palette is available in an ordinary SD project. Using a preset enables the required capability automatically. Queue Stocks show a small queue mark, Resource Stocks a unit-grid mark, and Processing Stocks a timer; DES Flow marks sit inside the center of their existing valves when no run is active or displayed, and move beside the valves when displaying a run. These marks supplement the primitive shape.
Find shared configuration
Model Architecture uses a direct sidebar with Overview, Modules, Shared Values, Clocks, Continuous Solvers, Populations, Space & Networks, Ports & Couplings, Events & Payloads, Queues & Resources, Outputs, and Advanced Kernels. Select a section to edit it directly. Queues & Resources includes linked setup checks.
Use Population Fields or Edit Shared Event & Payload… in an Inspector to open only the relevant shared definition. Apply commits a focused edit; Cancel leaves the model unchanged. Unrelated changes from another editor are retained. Conflicting changes are reported without overwriting the live model; reopen the editor to work from the current definition.
Choose a module role
A Module can remain a visual group or become an executable module:
- SD Submodel for a system-dynamics subsystem
- Agent Population for a dynamic population of agents
- DES Process for discrete-event behavior
- Hybrid Orchestrator for coordinated multi-method models
Executable modules display their method and clock on the canvas. An SD Submodel starts with the global page size, time mode and unit, DT, start and stop times, and integration method shown directly in its Inspector. Editing any of them changes that module only. Start Time and Stop Time can also reference a model variable through their + actions. Continuous modules can use Euler, RK2, or RK4 and set a local integration step.
Selecting a Module opens the Module Inspector. Its Behavior tab assigns the Module role without repeating run settings; enter the Module to edit those settings. Use the Module Inspector's Details tab to assign tags and documentation to the Module itself.
Configure clocks and ports
Clocks
Give every independent clock a stable name and choose one timing rule:
- Fixed cadence
- Explicit activation times
- Calendar dates
Ports and exchanges
Use ports to expose a variable, array element, population value, event value, or shared value. Connect ports with an exchange time and a resampling policy such as sample-and-hold, linear interpolation, interval sum, or interval mean.
Configure an Agent Population
An Agent Population Module owns a dynamic Agent dimension. Configure it in the contextual inspector.
- Set the initial count and capacity. The initial count defaults to
0; leave capacity empty for unlimited growth. The Agent Clock controls recurring per-agent flows and rules. - Add child Stocks for persistent state and child Auxiliaries for derived fields.
- Select a child Stock, Auxiliary, or connected Per-Agent Flow to write its Equation.
- Add initialization or recurring behavior only when an equation is not the right model representation.
- Configure optional space, networks, and an appearance graphic.
Fields and flows
Child Stock equations provide per-agent initial values. Child Auxiliary equations provide derived attributes. A Per-Agent Flow must target a State Stock in the same module; its Equation is the net change applied at each Agent Clock activation.
Connect fields on the canvas to make their dependencies explicit. Connected Attributes refresh in dependency order before advanced rules, and Per-Agent Flows commit afterward.
Initialization and behavior
Use Add Initialization for one-time work, such as creating links, moving agents, or scheduling events. Use Add Behavior Rule for recurring movement, spawn/remove actions, events, and network mutation.
Each field has an Initial value expression. Choose a uniform value, random uniform or normal distribution, agent index, agent count, or an index-based linear expression. Random uniform and normal distributions accept an optional Seed beside their numeric parameters; leave it empty for a fresh sequence or set it for repeatable per-agent values. The same expression rules apply to agents created during a run.
AGENTINDEX
UNIFORM(min, max)
NORMAL(mean, stddev)
Without an initializer seed, each run uses a fresh random sequence. Set a seed when you need repeatable assignments.
Categories, space, and networks
For categorical fields, Randomized category percentages and Randomized category counts assign exact quotas after a deterministic shuffle. The category table keeps each percentage or count beside its stored numeric value and display label, making the mapping explicit. Percentages must total 1; counts must total the initial population. The optional Seed sits beside Number of categories.
Array element labels have a different purpose: they name positions inside one multi-value field, such as Front, Rear, and do not define category mappings. Category display labels appear in Agent Map legends and hover details.
Space can be continuous 2D or a grid with clamp, wrap, reflect, or remove boundaries. Choose a random, grid, ring, or clustered initial layout. Networks can be directed or undirected, weighted, static or dynamic, and start empty, ring, lattice, random, scale-free, small-world, or spatial-radius topology.
Appearance and Agent Maps
Use Create Agent Appearance or choose an existing Graphic in the Module’s Appearance picker. The Graphic remains reusable on the canvas while its shape or image, aspect ratio, fill, stroke, border, and opacity become the Agent Map symbol.
Choose Color by field to tint the symbol from captured agent state. Enable Show Hover Tooltip to inspect position and attributes; enable stable IDs when needed. Click an agent on an Agent Map, or select its stable ID in the plot inspector, to open Individual Agent details at the current playhead.
Add an Agent Statechart
Select an Agent Module and choose Open Statechart…. Add states, choose the initial root state, then add transitions. Drag states to arrange the graph; dashed lines show parent membership. The transition picker identifies the source and target.
- An Atomic state represents one mode. A Compound state chooses one initial child. A Parallel state activates all its child regions.
- A Final state completes a region. Shallow history restores its parent's last direct child; Deep history restores the previous nested configuration.
- Transitions respond to a shared event, a timeout since entry, a condition, child completion, or a continuous crossing. Lower priorities win; deeper states take precedence over ancestors. Conflicting transitions do not run together.
- Entry, exit, and transition actions update mutable population fields. Expressions use those field names, model variable names, and time.
- A transition can send a shared event to the current agent, all agents in its population, nearby agents, or network neighbors. Messages address stable individual identities and can have a delay.
The statechart stays with each individual as it moves through queues and processing. Exiting a state cancels its timeout. Immediate transition loops stop with an error after the bounded stabilization limit. After simulation, expand Latest run transitions to inspect agent IDs and exact transition times; the full log is retained with the run.
For Continuous crossing, enter a numeric residual such as Charge - 0.8 and choose Rising, Falling, or Either. The solver locates a bracketed sign change between integration boundaries and restarts after the transition. The residual must be a supported continuous deterministic expression. Tangencies and multiple crossings inside one interval are not guaranteed; shorten DT when needed. Models with random SD equations must use ordinary event/clock conditions instead. A condition transition is checked at synchronization boundaries rather than root-located.
Configure discrete-event behavior
Stocks and Flows retain their familiar canvas shapes while taking optional Queue, Resource, Processing, Arrival, Service, Discrete Flow, or Departure roles.
Build the process on the canvas first: connect an Arrival Flow into its Queue or Processing Stock and connect Service, Discrete Flow, or Departure Flows from their source Stock. In the selected Stock or Flow's Behavior > Discrete Event inspector:
- A Queue Stock's Queue Parameters card controls only queue ordering and optional admission rules (capacity, balking, and reneging). The selected Stock is the Queue; its name and entity population are therefore not repeated as settings.
- A Resource Pool Stock's Resource Parameters card uses that Stock's ordinary Equation as its sole live whole-unit capacity rule. The equation can use normal model variables and built-ins, and a value of zero makes the resource unavailable. Select a Unit population for individual stations, servers, or vehicles; its Population Fields are the resource-unit attributes. Every Population Field starts with its Model Architecture initial value and remains constant unless an explicit expression, State/Flow structure, or other model action updates it.
- Arrival, Service, Discrete Flow, and Departure Flows share the same Activation card: Event, Schedule, and expression-based Priority, followed by payload information and the focused shared event editor. Priority expressions can use standard numeric functions, model globals without connectors, the current entity's fields, and named payload fields. Write
EVENTFLOW("Event", quantity)in the Flow Equation below the cards; it remains the authoritative quantity transferred at an activation.
The Activation Event picker is a structured editor for the first EVENTFLOW argument, not a second Flow definition. The Inspector and Model Architecture > Events & Payloads edit the same UUID-backed event; use Model Architecture for payload schemas, shared events, initial seeds, and advanced behavior triggers. At each event timestamp, Native Fast v2 evaluates the visible quantity argument and applies it to the connected Stock endpoints. Queue, processing, and resource-pool Stocks cannot be driven below zero. Missing EVENTFLOW references or required canvas endpoints are reported as model-validation errors. A scheduled event needs no custom kernel when its behavior is fully expressed by connected Flows.
An Arrival Flow's left-aligned Optional Configuration selects a Unit population. None uses a fieldless homogeneous entity schema; selecting a population initializes and carries its Fields through subsequent queues and services. A Service Flow has no duplicate Process Parameters selectors: its source Stock is the input Queue, its destination Stock is the Entity Pool, and its connected (or sole in-scope) Resource Pool is resolved from the model canvas. Its Optional Configuration lists explicit Resource requirements with a quantity expression for each Resource Pool. It can restrict queued entities with an eligibility expression and rank them with a dispatch-priority expression. Edit Shared Event & Payload… opens only the selected event.
DES Stock roles follow the same layout. Numeric parameter fields use the normal equation language: enter a number, type a model-variable or built-in name and choose from the live suggestions, or compose an expression. No connector is required for a referenced model variable. Queue Parameters contain Discipline and an expression-based capacity, including deterministic-seeded Random selection; balking and expression-based reneging delay are in the left-aligned Optional Configuration. Processing Parameters choose either a Duration or Condition completion rule and require maximum concurrent Service capacity; a missing Service capacity prevents simulation. A completion condition is evaluated separately for every entity in service after its Per-Agent Flows update, and any nonzero result completes that entity through the normal completion event. Service capacity is the sole concurrency limit: enter a number or reference a Resource Pool Stock or another model variable explicitly. Resource Pools associated with a Service provide unit identities and Fields, not an implicit fallback capacity. Optional Fill time and Clean time expressions extend duration-based service cycles. Resource Parameters contain the unit population without a duplicate capacity heading because the Stock Equation remains authoritative; its Optional Configuration contains preemption and expression-based Arrest capacity. An empty optional expression means None or zero, as appropriate, and remains visually empty.
For a state-dependent service rate authored as a continuous or stepped Graphical Function, an Processing Stock service duration can use INTEGRAL_RECIPROCAL(curve, current_state, target_state, scale). It evaluates scale * integral(1 / curve(state)) directly across the Graphical Function's breakpoints. This schedules completion without advancing the model one time step at a time; the current and target bounds, as well as the scale, may reference the dispatched entity and its seized Resource unit.
- Named events can have typed numeric payloads and one-time, interval, explicit, or distribution schedules.
- Queues support FIFO, LIFO, and priority ordering, finite capacity, balking, and reneging.
- A Resource Pool Stock is the authoritative nonnegative whole-unit capacity. Its initial equation sets starting capacity, and connected Flows can change capacity over time. Resource definitions retain allocation and preemption policy without maintaining a second runtime capacity value.
- Processes configure required resources and conditional or weighted destinations. The connected Processing Stock owns the service-duration expression. A duration can read the selected entity’s fields and its primary Resource unit population Fields using
resource_<field>(for example,battery_needed / resource_charge_rate). Duration evaluation reads the pre-service state first; mutable Resource-unit start updates are then committed to the selected unit.
Routing, blocking, and identity
Use the same connected Discrete Flow for a fixed transfer or a branch. In Routing, choose Independent transfer, First eligible branch, or Weighted branch. Branches sharing a source Stock and activation event must use the same mode. Conditions determine eligibility; lower priorities select first; positive weights determine weighted selection. A selected destination is retained while blocked, so repeated attempts do not redraw or switch branches. Old Route and Transfer models remain readable and appear as Discrete Flow.
A Processing Stock owns duration or completion condition and concurrency. A duration can be sampled separately for each service with random built-ins such as NORMAL(mean, standard_deviation), UNIFORM(minimum, maximum), or EXPRND(mean); each argument may be an expression using available model variables and entity Fields. Random functions use the optional argument order shown in the Function Browser: for continuous distributions, min, max precede seed, sample. For example, NORMAL(10, 2, 0, 20) has bounds of 0 and 20; use NORMAL(10, 2, NAN, NAN, 73) to specify only a seed. DES parameters draw for each event, including when a sample argument is present; the equation time-based sample hold does not apply to events. Unseeded process random functions use the current run's random stream, so normal runs vary while runs with the same explicit seed repeat. Invalid parameter expressions are highlighted in the owning Inspector and block simulation until corrected. Resources held by a process follow its saved release policy; new processes hold them until a successful downstream transfer. A full destination leaves the completed entity in the Processing Stock. Its physical service updates stop at completion, and another successful transfer or increased downstream Queue capacity prompts a retry.
When a completion condition is a supported simple continuous comparison, Locate completion threshold between steps uses the same isolated solver trials as continuous statechart crossings. Other conditions remain boundary checks. Existing saved processes keep their former timing until this option is enabled.
An Arrival normally creates an individual. Enable Admit an existing agent for a targeted event from the same population; an individual already queued or processing is not admitted twice. A Departure normally removes the individual. Keep agent alive after leaving removes it from the DES path while retaining its fields, identity, and statechart for later behavior.
Entity attributes and cycle times
Select a DES Process Module to work with its configured Entity Population. To update an entity attribute visibly during service, create a Stock and assign Per-Agent State, then select the Entity field it represents. For a physical calculator that should keep its own State (for example, battery energy in kWh), place an Agent Population child Module inside the DES Process Module and assign it the same population. Connect one or more Per-Agent Flow objects to that State. Every Per-Agent Flow shows an Activation card. In an Agent Population module, leave Event at Agent Clock (Default) for ordinary agent-clock integration, or select a Service-start event to make the Flow active only for the entity receiving that Service. A Per-Agent Flow placed directly in a DES Process has no independent Agent Clock and therefore requires its Service-start event. Its Equation defines the signed rate using entity fields, model inputs, time, and selected Resource-unit fields. Native Fast v2 integrates each service-activated co-flow at model boundaries only for the stable entity handles currently in that Flow's selected Service, then evaluates that Service's completion condition for the same entity. When true, the ordinary completion event can copy a derived calculator result to a durable Entity field, release resources, route the entity, and dispatch the next eligible queue member. Queued, completed, and departed entities are unaffected. Child-module State and Attribute slots remain module-local and do not appear as editable Model Architecture fields.
Every executable module uses the project's global Time Unit, DT, Start Time, Stop Time, and Integration Method. Opening a module shows the same Model Settings, Data Manager, playhead, progress range, and time captions as the top-level canvas. Partial-simulation Mode is the explicit exception for running only selected modules. A cross-module shadow remains an identity-preserving view of its source.
For a nonlinear rate, add a Per-Agent Attribute, enable its Graphical Function, use the bound State as its input, and reference that Attribute anywhere inside the connected Per-Agent Flow expression. The curve can be multiplied by entity, Resource-unit, or model factors while remaining visible on the canvas.
After simulation, a child Agent Module displays the latest captured service cycle for each Per-Agent State, Attribute, and connected Flow directly on its canvas. The same primitives are available in ordinary plot Series / Data pickers through the project Data Manager. These process-scoped results also retain one element series per service cycle. A plot can use its array-series selector to show all cycles from the current run; with Comparative Across Runs, all captured service cycles from the selected runs are plotted with run, cycle, and agent labels.
This canvas structure is the primary Entity Attribute Update workflow. Older projects containing saved implicit start/completion field assignments remain readable and executable for compatibility, but new updates are authored as tangible Per-Agent States and Flows.
Lifecycle timing is automatic: entering the population records a birth timestamp and removal records one completed cycle. Queue entry and completed dequeue times are tracked independently. Create ordinary model variables with the Discrete Event Function Browser category:
When a Queue Stock selects a Queue definition with an Entity Population, connected semantic Flows keep both representations synchronized: Arrival creates and enqueues entities, Service or Departure dequeues and disposes them when there is no managed destination, and Discrete Flow moves them to a managed destination. The accepted whole-entity quantity remains the value reported by the Flow and applied to its connected Stocks.
ENTITYCOUNT("Entity Population")
ENTITYMEAN("Entity Population", "Attribute", "Element")
ENTITYMIN("Entity Population", "Attribute", "Element")
ENTITYMAX("Entity Population", "Attribute", "Element")
ENTITYSUM("Entity Population", "Attribute", "Element")
ENTITYEXITCOUNT("Entity Population")
ENTITYCYCLETIMELAST("Start Event Flow", "End Event Flow", [initial, run])
ENTITYCYCLETIMEMEAN("Start Event Flow", "End Event Flow", [initial, run])
ENTITYCYCLETIMEMIN("Start Event Flow", "End Event Flow", [initial, run])
ENTITYCYCLETIMEMAX("Start Event Flow", "End Event Flow", [initial, run])
QUEUEENTRYCOUNT("Queue")
QUEUEBALKCOUNT("Queue")
QUEUEEXITCOUNT("Queue")
QUEUEWAITLAST("Queue")
QUEUEWAITMEAN("Queue")
QUEUEWAITMIN("Queue")
QUEUEWAITMAX("Queue")
Cycle-time functions require a Start Event Flow and End Event Flow. They measure elapsed time for each entity between those events and aggregate completed intervals across entity populations. ENTITYCYCLETIMEMEAN("Car Arrival", "Charging Complete") starts with an output value of zero; supply an optional numeric initial value to choose a different starting output, for example ENTITYCYCLETIMEMEAN("Car Arrival", "Charging Complete", 5). A quoted run name can follow initial to read the retained final result from that Data Manager run, for example ENTITYCYCLETIMEMEAN("Car Arrival", "Charging Complete", 5, "Baseline"). To select a saved run without an initial override, pass the quoted run name as the third argument. The model variable containing the function must have been retained in that run; otherwise the result is NAN. Queue wait measures accepted enqueue through completed dequeue; balked or reneged entities are not counted as completed waits.
Lower priority numbers execute first.
Expose results through model variables
Create an Auxiliary, Stock, or Flow and use a methodology query in its equation. These scalar variables use the ordinary Series editor and can be combined with other equations before plotting.
AGENTCOUNT("Agent Module")
AGENTMEAN("Agent Module", "Field", "Element")
EVENTCOUNT("Event")
QUEUELENGTH("Queue")
QUEUEWAITMEAN("Queue")
ENTITYCYCLETIMEMEAN("Start Event Flow", "End Event Flow")
RESOURCEUTILIZATION("Resource")
CLOCKCOUNT("Clock")
PORTVALUE("Module.Port")
SHAREDVALUE("Shared Value")
NETWORKMEANDEGREE("Network")
Use AGENT for Agent Modules and ENTITY for DES Process Modules. Both read the same managed field storage; POPULATION* remains available only for compatibility with older Native Fast v2 projects.
Choose structured views when needed
Use scalar model variables for ordinary Canvas and Interface plots. Select methodology data directly only for structured views:
- Agent Maps and density views use agent snapshots.
- Event-log and queue tables use records.
- Network views use graph frames.
- Timeline uses clock, event, queue, or resource intervals.
These plot settings appear as Methodology Data Source, not as scalar Series.
Run and inspect the model
Action buttons can step to the next activation or event, run to a timestamp, schedule an event, inject a payload, spawn an agent or entity, and reset a module.
Runs with Agent Modules retain complete timestamped agent, event, network, queue, and resource history independently of configured plots. Visual previews may reduce on-screen samples for responsiveness without changing the saved source history.
Related topics
Yano Simulator Help — Version 0.3.0, Build 20260929