Skip to content

Commit dabb446

Browse files
committed
fix: Remove unused time imports and add type hint for connect function
fix: Remove init parameter from KMeans instantiation in create_cluster method fix: Remove unused import of time in k_means_clustering.py fix: Remove unused time imports and add type hint for connect function
1 parent 0e7f894 commit dabb446

File tree

4 files changed

+3
-7
lines changed

4 files changed

+3
-7
lines changed

adf_core_python/core/agent/platoon/platoon.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import time
21
from threading import Event
32

43
from adf_core_python.core.agent.action.action import Action

adf_core_python/core/component/module/abstract_module.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from abc import ABC, abstractmethod
55
from typing import TYPE_CHECKING
66

7-
from adf_core_python.core.logger.logger import get_agent_logger, get_logger
7+
from adf_core_python.core.logger.logger import get_agent_logger
88

99
if TYPE_CHECKING:
1010
from adf_core_python.core.agent.communication.message_manager import MessageManager

adf_core_python/core/launcher/agent_launcher.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import importlib
22
import threading
3-
import time
43

54
from adf_core_python.core.component.abstract_loader import AbstractLoader
65
from adf_core_python.core.config.config import Config
@@ -69,7 +68,7 @@ def launch(self) -> None:
6968
threads = connector.connect(component_launcher, self.config, self.loader)
7069
self.agent_thread_list.extend(threads)
7170

72-
def connect():
71+
def connect() -> None:
7372
for thread, event in threads.items():
7473
thread.daemon = True
7574
thread.start()

adf_core_python/implement/module/algorithm/k_means_clustering.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import time
2-
31
import numpy as np
42
from rcrs_core.connection.URN import Entity as EntityURN
53
from rcrs_core.entities.ambulanceCenter import AmbulanceCentre
@@ -114,7 +112,7 @@ def prepare(self) -> Clustering:
114112
def create_cluster(
115113
self, cluster_number: int, entities: list[Entity]
116114
) -> list[list[Entity]]:
117-
kmeans = KMeans(n_clusters=cluster_number, random_state=0, init="k-means++")
115+
kmeans = KMeans(n_clusters=cluster_number, random_state=0)
118116
entity_positions: np.ndarray = np.array([])
119117
for entity in entities:
120118
location1_x, location1_y = entity.get_location()

0 commit comments

Comments
 (0)