behaviorsim-rs 0.7.0

Domain-agnostic specification for modeling individual psychology and social dynamics
Documentation
//! Observable demand characteristics used in ecological interpretation.

use serde::{Deserialize, Serialize};

/// Apparent gender presentation as perceived by others.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ApparentGender {
    /// Perceived as female.
    Female,
    /// Perceived as male.
    Male,
    /// Perceived as non-binary or gender nonconforming.
    NonBinary,
    /// Not specified or not perceived.
    Unknown,
}

impl Default for ApparentGender {
    fn default() -> Self {
        ApparentGender::Unknown
    }
}

/// Apparent racialization as perceived by others.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ApparentRace {
    /// Socially privileged majority status in the current context.
    Privileged,
    /// Socially marginalized status in the current context.
    Marginalized,
    /// Not specified or not perceived.
    Unknown,
}

impl Default for ApparentRace {
    fn default() -> Self {
        ApparentRace::Unknown
    }
}

/// Visible traits that can affect social responses.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum VisibleTrait {
    /// Visible marker that tends to trigger stigma in many contexts.
    StigmatizedAppearance,
    /// Visible marker associated with attractiveness or positive bias.
    AttractivePresentation,
    /// Visible marker associated with physical disability.
    VisibleDisability,
    /// Visible marker associated with economic hardship.
    ApparentPoverty,
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn apparent_gender_default_is_unknown() {
        assert_eq!(ApparentGender::default(), ApparentGender::Unknown);
    }

    #[test]
    fn apparent_race_default_is_unknown() {
        assert_eq!(ApparentRace::default(), ApparentRace::Unknown);
    }
}