question

Damini C2 avatar image
0 Likes"
Damini C2 asked Jeanette F commented

can i configure flexsim model with bonsai

i want to configure model with bonsai to create AI brain? is it possible in this ?

FlexSim 21.1.2
aiconfigureautonomous
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Damini C2, was Phil BoBo's answer helpful? If so, please click the red "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

Phil BoBo avatar image
1 Like"
Phil BoBo answered Phil BoBo commented

Microsoft Bonsai does not currently have native support for integrating with FlexSim. You can use Bonsai's Simulator API to integrate a custom simulator like FlexSim.

You can use FlexSim's Module SDK to add functionality to FlexSim that controls the simulation from custom implementations of functions such as init, reset, and step from the Bonsai Simulator API.

If you don't want to develop this yourself, you can contact your local FlexSim distributor or FlexSim's consulting services group to hire FlexSim experts to help you with the integration for your project.

· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Damini C2 avatar image Damini C2 commented ·
which function should create for bonsai simulation in flexsim?
-2 Likes -2 ·
Phil BoBo avatar image Phil BoBo ♦♦ Damini C2 commented ·

See Bonsai's API samples documentation for which functions need to be implemented. They have examples in C#, Java, Python, and TypeScript. Using any of those languages, you can implement inter-process communication (IPC) with FlexSim.

See Automatically Configure and Run a FlexSim Model for an example of spawning a FlexSim instance programmatically. Any of the above languages are able to spawn a FlexSim instance, pass it parameters, and execute FlexScript to run the model and return results.

For additional communication with FlexSim during the model run, I would suggest using the Module SDK to implement functions in C++ on the FlexSim side, but you could also use FlexScript for certain IPC approaches, such as sockets, files, or Windows messaging.

Bonsai's documentation also has examples of implementing their Simulator API with other custom simulators.

The primary callback functions for Bonsai AI are init(), reset(), and step(). See Connect an unmanaged simulator to Bonsai.

1 Like 1 ·