How to run a compiled .rex model from command line for fast repeated cost-function evaluation
-
Hi,
I have the following use case.My REXYGEN model contains blocks with tunable parameters. One of the model outputs represents the value of interest, for example a cost function.
I would like to run the compiled model (
*.rex) from the command line as fast as possible, ideally offline rather than in real time. For each run, I need to:- provide a specific set of parameter values,
- execute one full evaluation of the model,
- obtain the resulting value of the selected output.
More specifically, I want to call the model repeatedly from an external environment such as Python or Julia in order to tune the parameters and minimize the cost function.
Could you please advise what is the recommended workflow for this in REXYGEN?
In particular, I would like to know:
- whether this can be done with the compiled
.rexmodel directly, - how to pass parameter values from an external program,
- how to read back the value of a selected output,
- and whether Local Simulation mode is the right approach for this kind of fast offline repeated evaluation, for example with a fixed number of simulation steps or counter ticks.
Is this workflow supported, and if so, what is the simplest way to implement it?
Thanks Stepan