Skip to content

Commit 04b630c

Browse files
committed
FIX README RESOURCES WITH 3 different client
1 parent 2f8a9e2 commit 04b630c

File tree

1 file changed

+23
-28
lines changed
  • agents/matlab/matlab_agent/resources

1 file changed

+23
-28
lines changed

agents/matlab/matlab_agent/resources/README.md

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ This Python module provides a simple RabbitMQ client to send simulation requests
1414
- [Steps to run an example](#steps-to-run-an-example)
1515
- [Where to find the API payload files](#where-to-find-the-api-payload-files)
1616
- [Example usage](#example-usage)
17-
- [Control Commands](#control-commands)
1817

1918
## Installation
2019

@@ -26,13 +25,15 @@ pip install pika pyyaml
2625

2726
## Clients
2827

29-
Two Python scripts are provided:
28+
Three Python scripts are provided, each matching a different simulation mode:
3029

31-
- **use_matlab_agent.py** – Simple client that sends a simulation request and
32-
waits for results. Use this for _batch_ and _streaming_ simulations.
33-
- **use_matlab_agent_interactive.py** – Async client for _interactive_
34-
simulations. It streams input frames to MATLAB and prints outputs as they
35-
arrive.
30+
- **use_matlab_agent_batch.py** – Executes a _batch_ simulation and waits until
31+
the final results are returned before terminating.
32+
- **use_matlab_agent_streaming.py** – Starts a _streaming_ simulation where
33+
outputs are continuously printed as they arrive.
34+
- **use_matlab_agent_interactive.py** – Asynchronous client for
35+
_interactive_ simulations. It streams input frames to MATLAB and handles
36+
real-time results.
3637

3738
## Configuration
3839

@@ -52,6 +53,12 @@ rabbitmq:
5253
simulation_request: ../api/simulation.yaml # Default path to the simulation YAML payload
5354
```
5455
56+
The MATLAB wrapper classes also read their configuration from a
57+
`config/default.yaml` file. A template named `default.yaml.template` is
58+
distributed with the agent under `config/`. When you run
59+
`matlab-agent --generate-project`, this template is copied to
60+
`config/default.yaml`, which the wrappers use at runtime.
61+
5562
## Usage
5663

5764
Run the module as a standalone script to send simulation requests to the MATLAB agent and listen asynchronously for the results.
@@ -68,8 +75,9 @@ If this option is omitted, the script will look for a file named `simulation.yam
6875
- **With CLI option:**
6976
You can override the default by specifying a custom path to the simulation payload YAML file using the `--api-payload` option.
7077

71-
For interactive simulations, use `use_matlab_agent_interactive.py` with the same
72-
`--api-payload` flag. This client streams input frames based on the
78+
For streaming simulations use `use_matlab_agent_streaming.py`. For interactive
79+
simulations run `use_matlab_agent_interactive.py`; both scripts accept the same
80+
`--api-payload` flag. The interactive client streams input frames based on the
7381
`inputs.stream_source` field and prints outputs as they arrive.
7482

7583
## Example
@@ -91,9 +99,12 @@ you will find several folders containing practical examples. Each example folder
9199
2. **Run the MATLAB agent**
92100
Start the MATLAB agent so it is ready to receive simulation requests.
93101

94-
3. **Send a simulation request using the Python client**
95-
Execute the Python client with the appropriate API payload file:
96-
python use_matlab_agent.py --api-payload "path_to_api_payload"
102+
3. **Send a simulation request using the Python client**
103+
Execute the client that matches your simulation type with the appropriate
104+
API payload file:
105+
`python use_matlab_agent_batch.py --api-payload "path_to_api_payload"`,
106+
`python use_matlab_agent_streaming.py --api-payload "path_to_api_payload"`,
107+
or `python use_matlab_agent_interactive.py --api-payload "path_to_api_payload"`.
97108

98109
> **Note:** It is recommended to use absolute paths when specifying the `--api-payload` argument to avoid path resolution issues. It is a good practice to place the path in single quotes.
99110

@@ -120,19 +131,3 @@ To run the batch simulation example, specify the full absolute path to the paylo
120131
```bash
121132
python use_matlab_agent_batch.py --api-payload "/Users/foo/simulation-bridge/agents/matlab/matlab_agent/docs/examples/batch-simulation/api/simulation_batch.yaml.example"
122133
```
123-
124-
## Control Commands
125-
126-
During a simulation you can remotely control the MATLAB agent by sending simple
127-
command messages via RabbitMQ. Supported commands are:
128-
129-
- `RUN` – clear any previous stop request and allow the simulation to run.
130-
- `STOP` – request the currently running simulation to terminate gracefully.
131-
- `CHECK` – query the agent status (returns `running` or `stopped`).
132-
133-
To issue a command, publish a YAML message containing a `command` field to the
134-
agent input exchange:
135-
136-
```yaml
137-
command: STOP
138-
```

0 commit comments

Comments
 (0)