Kinds-of-Intelligence-CFI / animal-ai

Animal-AI supports interdisciplinary research to help better understand human, animal, and artificial cognition.
https://sites.google.com/csah.cam.ac.uk/animalai/
Apache License 2.0
59 stars 9 forks source link

Multiple Arenas in a single config #33

Closed kozzy97 closed 1 year ago

kozzy97 commented 1 year ago

There is a problem with the experimental build when there are multiple arenas in a single file. I have tested the following config:

!ArenaConfig
arenas:
  0: !Arena
    pass_mark: 1
    t: 500
    items:
    - !Item
      name: Agent
      positions:
      - !Vector3 {x: 20, y: 0, z: 20}
      rotations: [0]
    - !Item
      name: GoodGoal
      positions:
      - !Vector3 {x: 20, y: 0, z: 24}
      sizes:
      - !Vector3 { x: 2, y: 2, z: 2 }
  1: !Arena
    pass_mark: 1
    t: 500
    items:
    - !Item
      name: Agent
      positions:
      - !Vector3 {x: 20, y: 0, z: 20}
      rotations: [0]
    - !Item
      name: GoodGoalMulti
      positions:
      - !Vector3 {x: 20, y: 0, z: 24}
      sizes:
      - !Vector3 { x: 2, y: 2, z: 2 }
  2: !Arena
    pass_mark: 1
    t: 500
    items:
    - !Item
      name: Agent
      positions:
      - !Vector3 {x: 20, y: 0, z: 20}
      rotations: [0]
    - !Item
      name: BadGoal
      positions:
      - !Vector3 {x: 20, y: 0, z: 24}
      sizes:
      - !Vector3 { x: 2, y: 2, z: 2 }

I get only the GoodGoalMulti and BadGoal instances, not the GoodGoal instance when I run play.py with v3.1.2.exp. It works with the current stable build v3.1.1.

kozzy97 commented 1 year ago

@alhasacademy96 Just to flag here that @rppc 's workaround of specifying every configuration twice in the config file (so that there is an even and an odd index) works well. Using -1 indices did not solve the problem.

At least now we have a workable solution, but it would be good to get proper arena cycling working as intended.

alhasacademy96 commented 1 year ago

I can confirm that the bug has been fixed!!!!!!!! (finallyyyyyyyyyyyyy this was very confusing and tedious :(