Core app & interfaces

HOTS – application main process.

class hots.core.app.App(config: AppConfig)[source]

Bases: object

Application entry point for HOTS.

pre_loop()[source]

Build and solve optimization models before performing streaming loop.

run()[source]

Run the initial evaluation and streaming update loop.

shutdown(signum=None, frame=None)[source]

Handle shutdown signals gracefully.

HOTS core interfaces: plugin base classes.

class hots.core.interfaces.ClusteringPlugin[source]

Bases: ABC

Interface for clustering plugins.

abstract fit(df: DataFrame) Series[source]

Perform clustering and return labels.

class hots.core.interfaces.ConnectorPlugin[source]

Bases: ABC

Interface for connector plugins.

abstract apply_moves(moves: Any) None[source]

Apply relocation moves to the target environment.

class hots.core.interfaces.OptimizationPlugin[source]

Bases: ABC

Interface for optimization backends (Pyomo, OR-Tools, …).

abstract build(*, u_mat=None, w_mat=None, v_mat=None, dv_mat=None)[source]

Create and return a model handle (e.g., a Pyomo model wrapper).

abstract solve(*, solver=None)[source]

Solve the problem using current data.

class hots.core.interfaces.ProblemPlugin[source]

Bases: ABC

Interface for domain‑specific problem plugins (placement, allocation, etc.).

abstract adjust(solution: Any, **kwargs) Any[source]

Given an optimization solution (and any auxiliary data), return an adjusted solution.

abstract initial(labels: Series, df_indiv: DataFrame, df_host: DataFrame) list[dict[str, Any]][source]

Produce the initial problem solution if needed.

Parameters:
  • labels – cluster labels from initial clustering

  • df_indiv – individual‐level data

  • df_host – host‐level data

Returns:

list of move dicts to apply