farmgym.v2.field.Field

class farmgym.v2.field.Field(localization, shape, entity_managers: list)[source]

Bases: object

Instanciate 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_to_next_day()

Update internal variables of the field after an increment of 1 day.

distance_to_edge

get_neighbors(plot)[source]

NW N NE,W,E,SW,S,SE

reset()[source]

Reset to initial values

update_to_next_day()[source]

Update internal variables of the field after an increment of 1 day.