Crates.io | multilinear |
lib.rs | multilinear |
version | |
source | src |
created_at | 2025-03-02 11:46:45.78093+00 |
updated_at | 2025-03-17 22:22:28.109313+00 |
description | Interactive story simulation using constrained parallel state channels |
homepage | |
repository | https://gitlab.com/porky11/multilinear |
max_upload_size | |
id | 1574530 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
A Rust library for building interactive stories with constrained parallel state channels.
Model narrative systems using:
Inspired by petri nets but designed for narrative applications.
use event_simulation::Simulation;
use multilinear::{Condition, MultilinearInfo, MultilinearSimulation};
let mut story = MultilinearInfo::new();
// Create state channels
let place = story.add_channel();
let clothes = story.add_channel();
// Define event: Move from bedroom to living room
let event_move = story
.add_event()
.with_change(&[Condition::change(place, 0, 1)])
.unwrap()
.event();
// Define event: Change clothes in bedroom
let event_clothes = story
.add_event()
.with_change(&[Condition::new(place, 0), Condition::change(clothes, 1, 0)])
.unwrap()
.event();
let mut simulation = MultilinearSimulation::new(story);
simulation.try_call(event_clothes);
simulation.try_call(event_move);
simulation.try_revert(event_move);