pub trait ObservableEnvironment {
    // Required methods
    fn get_graph(&self) -> &RailwayGraph;
    fn get_objects(&self) -> Vec<&dyn SimulationObject>;
    fn get_object(&self, id: &RailwayObjectId) -> Option<&dyn SimulationObject>;
}
Expand description

A trait representing an environment that can be observed by decision agents.

Implementations of this trait should provide access to the railway graph and simulation objects.

Required Methods§

source

fn get_graph(&self) -> &RailwayGraph

Returns a reference to the railway graph.

source

fn get_objects(&self) -> Vec<&dyn SimulationObject>

Returns a vector of references to the simulation objects.

source

fn get_object(&self, id: &RailwayObjectId) -> Option<&dyn SimulationObject>

This function takes a reference to self (which in this case is an ObservableEnvironment struct) and a reference to a RailwayObjectId object.

Implementors§