Run a multi-method simulation document (A1)
curl --request POST \
--url https://api.eddy.engineer/v1/multisim.run \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"agent_type": "<string>",
"document": {},
"document_key": "<string>",
"experiment": "<string>",
"frames_every": 123,
"include_log": true,
"parameters": {},
"seed": 123,
"stop_time": 123,
"warm_up": 123
}
'import requests
url = "https://api.eddy.engineer/v1/multisim.run"
payload = {
"agent_type": "<string>",
"document": {},
"document_key": "<string>",
"experiment": "<string>",
"frames_every": 123,
"include_log": True,
"parameters": {},
"seed": 123,
"stop_time": 123,
"warm_up": 123
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent_type: '<string>',
document: {},
document_key: '<string>',
experiment: '<string>',
frames_every: 123,
include_log: true,
parameters: {},
seed: 123,
stop_time: 123,
warm_up: 123
})
};
fetch('https://api.eddy.engineer/v1/multisim.run', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eddy.engineer/v1/multisim.run",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agent_type' => '<string>',
'document' => [
],
'document_key' => '<string>',
'experiment' => '<string>',
'frames_every' => 123,
'include_log' => true,
'parameters' => [
],
'seed' => 123,
'stop_time' => 123,
'warm_up' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eddy.engineer/v1/multisim.run"
payload := strings.NewReader("{\n \"agent_type\": \"<string>\",\n \"document\": {},\n \"document_key\": \"<string>\",\n \"experiment\": \"<string>\",\n \"frames_every\": 123,\n \"include_log\": true,\n \"parameters\": {},\n \"seed\": 123,\n \"stop_time\": 123,\n \"warm_up\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.eddy.engineer/v1/multisim.run")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agent_type\": \"<string>\",\n \"document\": {},\n \"document_key\": \"<string>\",\n \"experiment\": \"<string>\",\n \"frames_every\": 123,\n \"include_log\": true,\n \"parameters\": {},\n \"seed\": 123,\n \"stop_time\": 123,\n \"warm_up\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/multisim.run")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_type\": \"<string>\",\n \"document\": {},\n \"document_key\": \"<string>\",\n \"experiment\": \"<string>\",\n \"frames_every\": 123,\n \"include_log\": true,\n \"parameters\": {},\n \"seed\": 123,\n \"stop_time\": 123,\n \"warm_up\": 123\n}"
response = http.request(request)
puts response.read_body{
"agent_type": "<string>",
"confidence": 123,
"document_key": "<string>",
"experiment_key": "<string>",
"frames_key": "<string>",
"kind": "<string>",
"little_max_error": 123,
"log": "<array>",
"log_key": "<string>",
"log_truncated": true,
"metrics": {},
"name": "<string>",
"outputs": [
{}
],
"replications": 123,
"result_key": "<string>",
"run": {},
"run_key": "<string>",
"seed": 123,
"stop_time": 123,
"version": "<string>",
"warm_up": 123
}{}ProcessSim
Run a multi-method simulation document (A1)
SP8.b: a GIS environment may name `terrain_key` (an SP2 raster) and `volumes_key` (an SP4 volume document) — the engine resolves them into the run (the answer names them), the agents read the ground through `ss.agent.ground()` and their violations through `ss.agent.violation()` / `ss.agent.violated_by()`, and the stored frames carry each agent's altitude and violations. The A track (multisim-track.md): discrete events, agents and stocks-and-flows on one calendar - the AnyLogic-class engine. Runs one experiment of the document (by name, or the inline settings) on the Process Modeling Library launch subset (Source, Sink, Delay, Queue, ResourcePool, Seize, Release, Service, SelectOutput/5/In/Out, Hold, Match, Split, Combine, Batch, Unbatch, Enter, Exit, Wait, TimeMeasureStart/End, RestrictedAreaStart/End, PlainTransfer). A run is a PURE FUNCTION of (document key, experiment key): f64 model time totally ordered by (time, priority, sequence); every random draw from a named stream seeded BLAKE3(seed | replication | name) so adding a block moves nothing it does not touch; no wall clock; the dialect (ss-lab) is the expression and action language. The summary, event log and frames are stored by content address; Little's law is checked on every block. Staged blocks (Assembler, Downtime, MoveTo, Conveyor, ...) refuse `unimplemented` naming their rung; unknown ids and ports refuse `undefined`; unsupported combinations refuse `out_of_envelope` naming what is supported. A4: an agent type's stocks and flows run on the same calendar (the grid step before the discrete events of the same time); the trajectory is sampled at the grid (run.trajectory; metrics sd.<name>.final / min / max); the solver section of the document names the method (euler | rk4 | rk4_anylogic | bdf1 | bdf2) and dt.
POST
/
v1
/
multisim.run
Run a multi-method simulation document (A1)
curl --request POST \
--url https://api.eddy.engineer/v1/multisim.run \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"agent_type": "<string>",
"document": {},
"document_key": "<string>",
"experiment": "<string>",
"frames_every": 123,
"include_log": true,
"parameters": {},
"seed": 123,
"stop_time": 123,
"warm_up": 123
}
'import requests
url = "https://api.eddy.engineer/v1/multisim.run"
payload = {
"agent_type": "<string>",
"document": {},
"document_key": "<string>",
"experiment": "<string>",
"frames_every": 123,
"include_log": True,
"parameters": {},
"seed": 123,
"stop_time": 123,
"warm_up": 123
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent_type: '<string>',
document: {},
document_key: '<string>',
experiment: '<string>',
frames_every: 123,
include_log: true,
parameters: {},
seed: 123,
stop_time: 123,
warm_up: 123
})
};
fetch('https://api.eddy.engineer/v1/multisim.run', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eddy.engineer/v1/multisim.run",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agent_type' => '<string>',
'document' => [
],
'document_key' => '<string>',
'experiment' => '<string>',
'frames_every' => 123,
'include_log' => true,
'parameters' => [
],
'seed' => 123,
'stop_time' => 123,
'warm_up' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eddy.engineer/v1/multisim.run"
payload := strings.NewReader("{\n \"agent_type\": \"<string>\",\n \"document\": {},\n \"document_key\": \"<string>\",\n \"experiment\": \"<string>\",\n \"frames_every\": 123,\n \"include_log\": true,\n \"parameters\": {},\n \"seed\": 123,\n \"stop_time\": 123,\n \"warm_up\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.eddy.engineer/v1/multisim.run")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agent_type\": \"<string>\",\n \"document\": {},\n \"document_key\": \"<string>\",\n \"experiment\": \"<string>\",\n \"frames_every\": 123,\n \"include_log\": true,\n \"parameters\": {},\n \"seed\": 123,\n \"stop_time\": 123,\n \"warm_up\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/multisim.run")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_type\": \"<string>\",\n \"document\": {},\n \"document_key\": \"<string>\",\n \"experiment\": \"<string>\",\n \"frames_every\": 123,\n \"include_log\": true,\n \"parameters\": {},\n \"seed\": 123,\n \"stop_time\": 123,\n \"warm_up\": 123\n}"
response = http.request(request)
puts response.read_body{
"agent_type": "<string>",
"confidence": 123,
"document_key": "<string>",
"experiment_key": "<string>",
"frames_key": "<string>",
"kind": "<string>",
"little_max_error": 123,
"log": "<array>",
"log_key": "<string>",
"log_truncated": true,
"metrics": {},
"name": "<string>",
"outputs": [
{}
],
"replications": 123,
"result_key": "<string>",
"run": {},
"run_key": "<string>",
"seed": 123,
"stop_time": 123,
"version": "<string>",
"warm_up": 123
}{}Body
application/json
The model document (MultisimDoc): name, main, time_unit, agent_types[] (parameters, variables, functions, events, blocks[] {id, kind, params, actions, stream}, connectors[] {from, to}), experiments[] {name, kind: simulation | replications, stop_time, seed, warm_up, replications, confidence, frames_every, outputs[] {name, metric}, parameters}. Parsed tolerantly; its canonical bytes are the document key.
TL13: the model by its document key instead of document (give one of the two): the document_key multisim.import or a run answered, or an episode's final_key, so a model read from a file runs and is edited without travelling through the caller. An unknown key answers 404 MULTISIM_DOCUMENT_UNKNOWN.
Response
OK