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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|