File size: 1,327 Bytes
54c8522
4d0ffdd
 
54c8522
4d0ffdd
6a28f91
4d0ffdd
 
 
 
 
 
6a28f91
4d0ffdd
 
 
 
f6c65ef
4d0ffdd
 
 
f6c65ef
4d0ffdd
 
 
f6c65ef
4d0ffdd
 
 
f6c65ef
4d0ffdd
 
 
 
f6c65ef
4d0ffdd
 
 
 
f6c65ef
4d0ffdd
 
 
f6c65ef
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""Base scheduler policy interface for the core algorithm.

This module defines the abstract interface that all scheduling policies must implement.
Moved to core to avoid circular dependency between core.algorithm and simulation.policies.
"""

from __future__ import annotations

from abc import ABC, abstractmethod
from datetime import date
from typing import List

from src.core.case import Case


class SchedulerPolicy(ABC):
    """Abstract base class for scheduling policies.

    All scheduling policies must implement the `prioritize` method which
    ranks cases for scheduling on a given day.
    """

    @abstractmethod
    def prioritize(self, cases: List[Case], current_date: date) -> List[Case]:
        """Prioritize cases for scheduling on the given date.

        Args:
            cases: List of eligible cases (already filtered for readiness, not disposed)
            current_date: Current simulation date

        Returns:
            Sorted list of cases in priority order (highest priority first)
        """
        pass

    @abstractmethod
    def get_name(self) -> str:
        """Get the policy name for logging/reporting."""
        pass

    @abstractmethod
    def requires_readiness_score(self) -> bool:
        """Return True if this policy requires readiness score computation."""
        pass