fix(typing): resolucion integral de advertencias de tipado, extraccion de payload con get_request_payload y limpieza de modelos

This commit is contained in:
2026-10-19 16:02:42 -03:00
parent 5ed62d5d30
commit eff5ed5ce0
13 changed files with 78 additions and 235 deletions
+3 -3
View File
@@ -177,7 +177,7 @@ class GeneticAlgorithm:
"""Run genetic algorithm with high concurrency to find optimal reservation schedule"""
import concurrent.futures
classrooms_dict = {c.id: c for c in available_classrooms}
classrooms_dict: Dict[int, Classroom] = {int(c.id): c for c in available_classrooms}
requests_dict = {r.commission_id: r for r in requests}
# Initialize population
@@ -263,7 +263,7 @@ class GeneticAlgorithm:
gene = Gene(
commission_id=request.commission_id,
classroom_id=classroom.id,
classroom_id=int(classroom.id),
start_time=start_time,
end_time=end_time,
expected_attendees=request.expected_attendees,
@@ -309,7 +309,7 @@ class GeneticAlgorithm:
# Change classroom
suitable_classrooms = [c for c in classrooms if c.capacity >= gene_to_mutate.expected_attendees]
if suitable_classrooms:
gene_to_mutate.classroom_id = random.choice(suitable_classrooms).id
gene_to_mutate.classroom_id = int(random.choice(suitable_classrooms).id)
elif mutation_type == 'time':
# Slightly adjust time