Coder Social home page Coder Social logo

Comments (2)

t-wolfeadam avatar t-wolfeadam commented on June 16, 2024

Hello! You are unable to drag it into the experiments because, under the hood, the PyCommunicator object is an agent. It's for this same reason that you cannot drag in your own agent types or discrete event blocks into the experiment window.

To create an agent in the experiment window, you need to programmatically create the PyCommunicator object. I've written the object to be constructed using whatever settings you run your PyCommunicator object with normally.

However, when you do create it, you need to have access to a "live" Agent type - i.e., the code to construct it will only work in the "Before Simulation Run" and "After Simulation Run" callbacks, where you have access to your top-level agent.

Below is an example of a model which collects data across a Parameter Variation experiment, saves it to a Collection object, and after the last iteration, it will dump the data to a JSON file in the model directory (via the toJson function). Let me know if you have any follow-up Qs about it.

Python In Experiment Screen Example.zip

from anylogic-pypeline.

t-wolfeadam avatar t-wolfeadam commented on June 16, 2024

I'm closing it, but again, feel free to ask follow-ups.

from anylogic-pypeline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.