Add ability to pass agents to python

Offen
#2 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
35/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
python, scala
Bereich
api

Rechercherichtung

Es werden keine Dateien oder Tests genannt. Beginne damit, das bestehende Verhalten von py:set und py:runresult nachzuverfolgen, und lege dann fest, wie Agentenvariablen zu schreibgeschützten, dict-ähnlichen Python-Objekten werden. Als erledigt gilt die Aufgabe, wenn Agenten an Python übergeben werden können und die Dokumentation klar festhält, dass Werte nach Änderungen in NetLogo veraltet sein können.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

I think they should be represented as dict-like objects, where keys are agent variables.

For a first pass, they should be read-only.

One tricky thing is keeping them in sync with NetLogo. For instance:

py:set "t" turtle 0
ask turtle 0 [ set color red ]
print py:runresult "t['color']" ;; This will be out of date

I think just not caring is good enough for a first pass, as long as it's clear in the docs. Otherwise, we'd have to track and sync all agent-objects on every call, which sounds awful.

I think they should be represented as dict-like objects, where keys are agent variables.

For a first pass, they should be read-only.

One tricky thing is keeping them in sync with NetLogo. For instance:

py:set "t" turtle 0
ask turtle 0 [ set color red ]
print py:runresult "t['color']" ;; This will be out of date

I think just not caring is good enough for a first pass, as long as it's clear in the docs. Otherwise, we'd have to track and sync all agent-objects on every call, which sounds awful.

Copied from https://github.com/qiemem/PythonExtension/issues/2

Vorherrschende Sprache
Scala
Sterne
31
Forks
16
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus NetLogo/Python-Extension

Alle Issues in NetLogo/Python-Extension

Ähnliche Issues

Weitere Issues zu Scala

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.