package fehu

  1. Overview
  2. Docs
Reinforcement learning framework for OCaml

Install

dune-project
 Dependency

Authors

Maintainers

Sources

raven-1.0.0.alpha1.tbz
sha256=8e277ed56615d388bc69c4333e43d1acd112b5f2d5d352e2453aef223ff59867
sha512=369eda6df6b84b08f92c8957954d107058fb8d3d8374082e074b56f3a139351b3ae6e3a99f2d4a4a2930dd950fd609593467e502368a13ad6217b571382da28c

doc/fehu/Fehu/Metadata/index.html

Module Fehu.MetadataSource

Environment metadata describing properties and capabilities.

Metadata includes supported render modes, environment version, author information, and tags.

Environment metadata for discovery and configuration.

Metadata describes environment properties like supported render modes, version information, and authorship. It follows Gymnasium's metadata convention, enabling environment registries and documentation generation.

Usage

Create metadata for a custom environment:

  let metadata =
    Metadata.default
    |> Metadata.with_version (Some "1.0.0")
    |> Metadata.with_description (Some "CartPole balancing task")
    |> Metadata.add_render_mode "human"
    |> Metadata.add_render_mode "rgb_array"
    |> Metadata.with_render_fps (Some 50)

Check render mode support:

  if Metadata.supports_render_mode "human" metadata then
    (* render in human mode *)
Sourcetype t = {
  1. render_modes : string list;
    (*

    Available rendering modes (e.g., "human", "rgb_array")

    *)
  2. render_fps : int option;
    (*

    Frames per second for rendering, if applicable

    *)
  3. authors : string list;
    (*

    Environment authors or contributors

    *)
  4. description : string option;
    (*

    Brief environment description

    *)
  5. version : string option;
    (*

    Version string (e.g., "1.0.0")

    *)
  6. supported_vector_modes : string list;
    (*

    Supported vectorization modes

    *)
  7. tags : string list;
    (*

    Classification tags (e.g., "control", "atari")

    *)
  8. extra : Yojson.Safe.t option;
    (*

    Additional custom metadata as JSON

    *)
}

Environment metadata record.

Sourceval default : t

default is the default metadata with all fields empty or None.

Sourceval add_render_mode : string -> t -> t

add_render_mode mode metadata adds mode to supported render modes.

Common modes: "human" (display for humans), "rgb_array" (pixel array), "ansi" (text representation).

Sourceval supports_render_mode : string -> t -> bool

supports_render_mode mode metadata checks if mode is supported.

Sourceval with_render_fps : int option -> t -> t

with_render_fps fps metadata sets the rendering frame rate.

Sourceval with_description : string option -> t -> t

with_description desc metadata sets the environment description.

Sourceval with_version : string option -> t -> t

with_version version metadata sets the version string.

Sourceval add_author : string -> t -> t

add_author name metadata adds name to the authors list.

Sourceval add_tag : string -> t -> t

add_tag tag metadata adds tag to the tags list.

Sourceval set_tags : string list -> t -> t

set_tags tags metadata replaces all tags with tags.

Sourceval to_yojson : t -> Yojson.Safe.t

to_yojson metadata serializes metadata to JSON.

Sourceval of_yojson : Yojson.Safe.t -> (t, string) result

of_yojson json deserializes metadata from JSON.

Returns Error msg if the JSON structure is invalid.

On This Page
  1. Usage