Skip to content
This repository was archived by the owner on Nov 13, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ geolocation:
cluster_estimation:
min_activation_threshold: 25
min_new_points_to_run: 5
max_num_components: 10
random_state: 0

communications:
Expand Down
3 changes: 2 additions & 1 deletion main_2024.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ def main() -> int:

MIN_ACTIVATION_THRESHOLD = config["cluster_estimation"]["min_activation_threshold"]
MIN_NEW_POINTS_TO_RUN = config["cluster_estimation"]["min_new_points_to_run"]
MAX_NUM_COMPONENTS = config["cluster_estimation"]["max_num_components"]
RANDOM_STATE = config["cluster_estimation"]["random_state"]

COMMUNICATIONS_TIMEOUT = config["communications"]["timeout"]
Expand Down Expand Up @@ -303,7 +304,7 @@ def main() -> int:
result, cluster_estimation_worker_properties = worker_manager.WorkerProperties.create(
count=1,
target=cluster_estimation_worker.cluster_estimation_worker,
work_arguments=(MIN_ACTIVATION_THRESHOLD, MIN_NEW_POINTS_TO_RUN, RANDOM_STATE),
work_arguments=(MIN_ACTIVATION_THRESHOLD, MIN_NEW_POINTS_TO_RUN, MAX_NUM_COMPONENTS, RANDOM_STATE),
input_queues=[geolocation_to_cluster_estimation_queue],
output_queues=[cluster_estimation_to_communications_queue],
controller=controller,
Expand Down
12 changes: 9 additions & 3 deletions modules/cluster_estimation/cluster_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ class ClusterEstimation:
min_new_points_to_run: int
Minimum number of new data points that must be collected before running model.

max_num_components: int
Max number of real landing pads.

random_state: int
Seed for randomizer, to get consistent results.

Expand Down Expand Up @@ -62,8 +65,8 @@ class ClusterEstimation:
__MEAN_PRECISION_PRIOR = 1e-6
__MAX_MODEL_ITERATIONS = 1000

# Real-world scenario Hyperparameters
__MAX_NUM_COMPONENTS = 10 # assumed maximum number of real landing pads
# # Real-world scenario Hyperparameters
# __MAX_NUM_COMPONENTS = 10 # assumed maximum number of real landing pads

# Hyperparameters to clean up model outputs
__WEIGHT_DROP_THRESHOLD = 0.1
Expand All @@ -74,6 +77,7 @@ def create(
cls,
min_activation_threshold: int,
min_new_points_to_run: int,
max_num_components: int,
random_state: int,
local_logger: logger.Logger,
) -> "tuple[bool, ClusterEstimation | None]":
Expand All @@ -92,6 +96,7 @@ def create(
cls.__create_key,
min_activation_threshold,
min_new_points_to_run,
max_num_components,
random_state,
local_logger,
)
Expand All @@ -101,6 +106,7 @@ def __init__(
class_private_create_key: object,
min_activation_threshold: int,
min_new_points_to_run: int,
max_num_components: int,
random_state: int,
local_logger: logger.Logger,
) -> None:
Expand All @@ -112,7 +118,7 @@ def __init__(
# Initializes VGMM
self.__vgmm = sklearn.mixture.BayesianGaussianMixture(
covariance_type=self.__COVAR_TYPE,
n_components=self.__MAX_NUM_COMPONENTS,
n_components = max_num_components,
init_params=self.__MODEL_INIT_PARAM,
weight_concentration_prior=self.__WEIGHT_CONCENTRATION_PRIOR,
mean_precision_prior=self.__MEAN_PRECISION_PRIOR,
Expand Down
5 changes: 5 additions & 0 deletions modules/cluster_estimation/cluster_estimation_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
def cluster_estimation_worker(
min_activation_threshold: int,
min_new_points_to_run: int,
max_num_components: int,
random_state: int,
input_queue: queue_proxy_wrapper.QueueProxyWrapper,
output_queue: queue_proxy_wrapper.QueueProxyWrapper,
Expand All @@ -30,6 +31,9 @@ def cluster_estimation_worker(
min_new_points_to_run: int
Minimum number of new data points that must be collected before running model.

max_num_components: int
Max number of real landing pads.

random_state: int
Seed for randomizer, to get consistent results.

Expand All @@ -56,6 +60,7 @@ def cluster_estimation_worker(
result, estimator = cluster_estimation.ClusterEstimation.create(
min_activation_threshold,
min_new_points_to_run,
max_num_components,
random_state,
local_logger,
)
Expand Down
Loading