Skip to content

Documentation for Candidateselector Module

CandidateSelector

Bases: ABC

Source code in nebula/core/situationalawareness/discovery/candidateselection/candidateselector.py
 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
46
47
48
49
50
class CandidateSelector(ABC):
    @abstractmethod
    async def set_config(self, config):
        """
        Configure internal parameters for the candidate selection strategy.

        Parameters:
            config: A configuration object or dictionary with necessary parameters.
        """
        pass

    @abstractmethod
    async def add_candidate(self, candidate):
        """
        Add a new candidate to the internal pool of potential selections.

        Parameters:
            candidate: The candidate node or object to be considered for selection.
        """
        pass

    @abstractmethod
    async def select_candidates(self):
        """
        Apply the selection logic to choose the best candidates from the internal pool.

        Returns:
            list: A list of selected candidates based on the implemented strategy.
        """
        pass

    @abstractmethod
    async def remove_candidates(self):
        """
        Remove one or more candidates from the pool based on internal rules or external decisions.
        """
        pass

    @abstractmethod
    async def any_candidate(self):
        """
        Check whether there are any candidates currently available in the internal pool.

        Returns:
            bool: True if at least one candidate is available, False otherwise.
        """
        pass

add_candidate(candidate) abstractmethod async

Add a new candidate to the internal pool of potential selections.

Parameters:

Name Type Description Default
candidate

The candidate node or object to be considered for selection.

required
Source code in nebula/core/situationalawareness/discovery/candidateselection/candidateselector.py
15
16
17
18
19
20
21
22
23
@abstractmethod
async def add_candidate(self, candidate):
    """
    Add a new candidate to the internal pool of potential selections.

    Parameters:
        candidate: The candidate node or object to be considered for selection.
    """
    pass

any_candidate() abstractmethod async

Check whether there are any candidates currently available in the internal pool.

Returns:

Name Type Description
bool

True if at least one candidate is available, False otherwise.

Source code in nebula/core/situationalawareness/discovery/candidateselection/candidateselector.py
42
43
44
45
46
47
48
49
50
@abstractmethod
async def any_candidate(self):
    """
    Check whether there are any candidates currently available in the internal pool.

    Returns:
        bool: True if at least one candidate is available, False otherwise.
    """
    pass

remove_candidates() abstractmethod async

Remove one or more candidates from the pool based on internal rules or external decisions.

Source code in nebula/core/situationalawareness/discovery/candidateselection/candidateselector.py
35
36
37
38
39
40
@abstractmethod
async def remove_candidates(self):
    """
    Remove one or more candidates from the pool based on internal rules or external decisions.
    """
    pass

select_candidates() abstractmethod async

Apply the selection logic to choose the best candidates from the internal pool.

Returns:

Name Type Description
list

A list of selected candidates based on the implemented strategy.

Source code in nebula/core/situationalawareness/discovery/candidateselection/candidateselector.py
25
26
27
28
29
30
31
32
33
@abstractmethod
async def select_candidates(self):
    """
    Apply the selection logic to choose the best candidates from the internal pool.

    Returns:
        list: A list of selected candidates based on the implemented strategy.
    """
    pass

set_config(config) abstractmethod async

Configure internal parameters for the candidate selection strategy.

Parameters:

Name Type Description Default
config

A configuration object or dictionary with necessary parameters.

required
Source code in nebula/core/situationalawareness/discovery/candidateselection/candidateselector.py
 5
 6
 7
 8
 9
10
11
12
13
@abstractmethod
async def set_config(self, config):
    """
    Configure internal parameters for the candidate selection strategy.

    Parameters:
        config: A configuration object or dictionary with necessary parameters.
    """
    pass