import sys
from pathlib import Path
from random import random
from typing import Optional

# Add framework src to path for imports
framework_src_path = Path(__file__).parent.parent.parent.parent / "src"
sys.path.insert(0, str(framework_src_path))

from demos.school_demo.src.collectives import Neighborhood
from layer1_core.entities.agent import Agent


class Student(Agent):
    """
    A student in the simulation - primarily a data/state container.
    All behavior logic is handled by services.
    """

    def __init__(self, agent_id: str, age: int, race: str, neighborhood: Optional[Neighborhood] = None):
        """
        Initialize a Student.

        Args:
            agent_id: Unique identifier for this student
            age: Age of the student in years
            race: Race/ethnicity of the student
            neighborhood: Optional neighborhood where the student lives
        """
        super().__init__(agent_id)
        # State attributes
        self.age: int = age
        self.race: str = race
        self.mood: float = 0.5
        self.disciplinaryRecord: list = []
        self.using_substance: bool = False
        self.neighborhood = neighborhood



class Teacher(Agent):
    """A teacher in the school - data container for teacher attributes.
    All behavior logic is handled by services.
    """

    def __init__(self, agent_id: str, race: str):
        super().__init__(agent_id)
        # State attributes
        self.race: str = race
        self.attitude: float = 0.5  # How strictly they enforce rules
        self.bias: float = random()  # Implicit bias level


class Counselor(Agent):
    """A counselor in the school - data container for counselor attributes.
    All behavior logic is handled by services.
    """

    def __init__(self, agent_id: str, race: str):
        super().__init__(agent_id)
        # State attributes
        self.race: str = race
        self.attitude: float = 0.5  # Effectiveness/empathy level
