Closed TomGeorge1234 closed 1 year ago
RatInABox now supports any-polygon-shaped environments and adding holes into environments. These are handled when a class is initialised by passing them as lists of corners:
Env = Environment(params={'boundary':[[0,-0.2],[0,0.2],[1.5,0.5],[1.5,-0.5]]})
Env = Environment(params={
'aspect':1.8,
'holes' : [[[0.2,0.2],[0.8,0.2],[0.8,0.8],[0.2,0.8]],
[[1,0.2],[1.6,0.2],[1.6,0.8],[1,0.8]]]
})
Nb. polygons must be "simple" (not self intersecting, no holes) and holes must be non-intersecting.
An upgrade is planned to allow non-rectangular environments in RiaB.
Users would (optionally) pass, at initialisation, coordinates defining a simple polygon which would then make up the boundaries of the arena.
Whenever the
Agent
s position, or the location of aNeuron
etc. is selected it would be guaranteed to fall within this polygon. Plotting rate maps etc. would also be updated too so they still look elegant.This may require adding in the
shapely
package as a requirement.