pub struct ObsSpec {
pub entries: Vec<ObsEntry>,
}Expand description
Specification for observation extraction.
An ObsSpec is a list of entries, each describing one slice of the
output tensor. Entries are gathered in order: entry 0 fills the first
N_0 elements, entry 1 fills the next N_1, etc.
§Examples
use murk_obs::{ObsSpec, ObsEntry, ObsDtype, ObsTransform, ObsRegion};
use murk_core::FieldId;
use murk_space::RegionSpec;
let spec = ObsSpec {
entries: vec![
ObsEntry {
field_id: FieldId(0),
region: ObsRegion::Fixed(RegionSpec::All),
pool: None,
transform: ObsTransform::Identity,
dtype: ObsDtype::F32,
},
ObsEntry {
field_id: FieldId(1),
region: ObsRegion::AgentDisk { radius: 3 },
pool: None,
transform: ObsTransform::Normalize { min: 0.0, max: 100.0 },
dtype: ObsDtype::F32,
},
],
};
assert_eq!(spec.entries.len(), 2);
assert_eq!(spec.entries[0].field_id, FieldId(0));Fields§
§entries: Vec<ObsEntry>Ordered observation entries.
Trait Implementations§
impl StructuralPartialEq for ObsSpec
Auto Trait Implementations§
impl Freeze for ObsSpec
impl RefUnwindSafe for ObsSpec
impl Send for ObsSpec
impl Sync for ObsSpec
impl Unpin for ObsSpec
impl UnsafeUnpin for ObsSpec
impl UnwindSafe for ObsSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more