Rendering#

After a growing season is completed, gym-DSSAT provides a visualization interface both for raw state variables or rewards.

State#

To vizualise the time of state variables of a trajectory, you can call:

env.render(type='ts',  # time series mode
        feature_name_1='nstres',  # mandatory first raw state variable, here the nitrogen stress factor (unitless)
        feature_name_2='grnwt')  # optional second raw state variable, here the grain weight (kg/ha)
../_images/nstresGrnwt.png

Nitrogen stress (unitless) and grain yield (kg/ha) against Day Of Year (DOY)#

Hint

All variables in env._state are available for rendering. You can find the list and agronomical meaning in gym environment’s yaml configuration file in the state key.

Reward#

Raw reward#

For quick reward inspection, you can use:

env.render(type='reward')  # plot reward time series (DOY for Day Of Year)
../_images/rewards.png

Reward for a single trajectory against Day Of Year (DOY)#

Cumulated reward#

Simply adding the cumsum=True argument, you can visualize the (undiscounted) cumulated reward.

env.render(type='reward', cumsum=True)  # if you want cumulated rewards
../_images/cumsumRewards.png

Cumulated reward for a single trajectory against Day Of Year (DOY)#