Skip to content

DER Scenario Selection Strategy

DER Scenario Selection Strategy

Module for managing deployment strategies.

CloseSelectionStrategy

Bases: SelectionStrategy

Implements close to feeder selection strategy.

Source code in emerge\scenarios\selection_strategy.py
45
46
47
48
49
50
51
52
class CloseSelectionStrategy(SelectionStrategy):
    """Implements close to feeder selection strategy."""

    def return_selection_order(
        self, list_of_customers: List[data_model.CustomerModel]
    ):
        """ Refer to base class for more details."""
        return sorted(list_of_customers, key=lambda d: d.distance)
return_selection_order(list_of_customers)

Refer to base class for more details.

Source code in emerge\scenarios\selection_strategy.py
48
49
50
51
52
def return_selection_order(
    self, list_of_customers: List[data_model.CustomerModel]
):
    """ Refer to base class for more details."""
    return sorted(list_of_customers, key=lambda d: d.distance)

FarSelectionStrategy

Bases: SelectionStrategy

Implements far from feeder selection strategy.

Source code in emerge\scenarios\selection_strategy.py
55
56
57
58
59
60
61
62
class FarSelectionStrategy(SelectionStrategy):
    """Implements far from feeder selection strategy."""

    def return_selection_order(
        self, list_of_customers: List[data_model.CustomerModel]
    ):
        """ Refer to base class for more details."""
        return sorted(list_of_customers, key=lambda d: d.distance, reverse=True)
return_selection_order(list_of_customers)

Refer to base class for more details.

Source code in emerge\scenarios\selection_strategy.py
58
59
60
61
62
def return_selection_order(
    self, list_of_customers: List[data_model.CustomerModel]
):
    """ Refer to base class for more details."""
    return sorted(list_of_customers, key=lambda d: d.distance, reverse=True)

RandomSelectionStrategy

Bases: SelectionStrategy

Implements random selection strategy.

Source code in emerge\scenarios\selection_strategy.py
34
35
36
37
38
39
40
41
42
class RandomSelectionStrategy(SelectionStrategy):
    """Implements random selection strategy."""

    def return_selection_order(
        self, list_of_customers: List[data_model.CustomerModel]
    ):
        """ Refer to base class for more details."""
        random.shuffle(list_of_customers)
        return list_of_customers
return_selection_order(list_of_customers)

Refer to base class for more details.

Source code in emerge\scenarios\selection_strategy.py
37
38
39
40
41
42
def return_selection_order(
    self, list_of_customers: List[data_model.CustomerModel]
):
    """ Refer to base class for more details."""
    random.shuffle(list_of_customers)
    return list_of_customers

SelectionStrategy

Bases: abc.ABC

Abstract class for selection strategy.

Idea is to take list of customer models and define a order in which they are to be selected for placing pvs.

Source code in emerge\scenarios\selection_strategy.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
class SelectionStrategy(abc.ABC):
    """Abstract class for selection strategy.

    Idea is to take list of customer models and define
    a order in which they are to be selected for placing
    pvs.
    """

    @abc.abstractmethod
    def return_selection_order(
        self, list_of_customers: List[data_model.CustomerModel]
    )-> List[data_model.CustomerModel]:
        """Abstract method for returning the selection order.

        Args:
            list_of_customers (List[data_model.CustomerModel]): List
                of `CustomerModel` objects.

        Returns:
            List[data_model.CustomerModel]: List
                of `CustomerModel` objects.
        """
return_selection_order(list_of_customers) abstractmethod

Abstract method for returning the selection order.

Parameters:

Name Type Description Default
list_of_customers List[data_model.CustomerModel]

List of CustomerModel objects.

required

Returns:

Type Description
List[data_model.CustomerModel]

List[data_model.CustomerModel]: List of CustomerModel objects.

Source code in emerge\scenarios\selection_strategy.py
18
19
20
21
22
23
24
25
26
27
28
29
30
31
@abc.abstractmethod
def return_selection_order(
    self, list_of_customers: List[data_model.CustomerModel]
)-> List[data_model.CustomerModel]:
    """Abstract method for returning the selection order.

    Args:
        list_of_customers (List[data_model.CustomerModel]): List
            of `CustomerModel` objects.

    Returns:
        List[data_model.CustomerModel]: List
            of `CustomerModel` objects.
    """