farmgym.v2.field.Field¶
- class farmgym.v2.field.Field(localization, shape, entity_managers: list)[source]¶
Bases:
objectInstanciate a Field. One or several fields are included in a farm and one field includes several plants.
- Parameters:
- localization: (latitude, longitude, altitude)
localisation of the field
- shape: (length (int), width (int), scale (multiples of 1 unit in meter))
Shape of the field. Each field of shape (width,length,scale) contains width × length many plots each of size scale
- entity_managers: list
list of couples (entity, name) used to construct the field.
Examples
>>> from farmgym.v2.field import Field >>> from farmgym.v2.entities.Weather import Weather >>> from farmgym.v2.entities.Soil import Soil >>> from farmgym.v2.entities.Plant import Plant >>> entities = [(Weather, "lille"), (Soil, "clay"), (Plant, "bean")] >>> field1 = Field(localization={"latitude#°": 43, "longitude#°": 4, "altitude#m": 150}, >>> shape={"length#nb": 1, "width#nb": 1, "scale#m": 1.0}, >>> entity_managers=entities)
Methods
get_neighbors(plot)NW N NE,W,E,SW,S,SE
reset()Reset to initial values
Update internal variables of the field after an increment of 1 day.
distance_to_edge