File size: 1,118 Bytes
a241478
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from abc import abstractmethod

class Scenario_reducer():
    '''
    Abstract class for a scenario reducer that,
    given a fixed n, reduces an original set of scenarios
    with cardinality N to a smaller one of cardinality n.

    Different strategies can vary w.r.t.:
    -The metrics (Wass 1,2,inf..)
    -The selection order (Fast forward, backward, simultaneous backward)

    We assume a discrete uniform initial distribution on the scenarios.
    It can be generalized by appending a new value in the init of another sub-class

    For further details, please refer to:
    [1] Heitsch, Holger, and Werner Römisch. "Scenario reduction algorithms in stochastic programming." Computational optimization and applications 24.2-3 (2003): 187-206.
    '''
    @abstractmethod
    def __init__(self, initialSet):
        """
        The initial set is assumed to have a dimension d x N,
        where N is the number of the initial set of scenarios
        """    
    @abstractmethod
    def reduce(self, n_scenarios: int = 1):
        """
        reduces the initial set of scenarios
        """   
        pass