hari_plotter.model module
- class hari_plotter.model.ActivityDrivenModel(params: dict[str, Any])[source]
Bases:
Model
Model representing the ActivityDriven dynamics.
- get_influence(G: Graph) ndarray [source]
Compute and return the influence values for the ActivityDriven model.
- Parameters:
G – The graph on which the influence values are to be computed.
- Returns:
Array containing the computed influence values.
- get_tension(G: Graph, norm_type: str = 'squared') float [source]
Compute and return the tension for the ActivityDriven model.
- Parameters:
G – The graph on which the tension is to be computed.
norm_type – The type of norm used to compute the tension. Can be either ‘abs’ or ‘squared’.
- Returns:
The computed tension value.
- property load_request: dict[str, Any]
Results will be sent to Graph.from_network on setup
- class hari_plotter.model.DeGrootModel(params: dict[str, Any])[source]
Bases:
Model
Model representing the DeGroot dynamics.
- get_influence(G: Graph) ndarray [source]
Compute and return the influence values for the DeGroot model.
- Parameters:
G – The graph on which the influence values are to be computed.
- Returns:
Array containing the computed influence values.
- get_tension(G: Graph, norm_type: str = 'squared') float [source]
Compute and return the tension for the DeGroot model.
- Parameters:
G – The graph on which the tension is to be computed.
norm_type – The type of norm used to compute the tension. Can be either ‘abs’ or ‘squared’.
- Returns:
The computed tension value.
- class hari_plotter.model.DeffuantModel(params: dict[str, Any])[source]
Bases:
Model
- class hari_plotter.model.Model(params: dict[str, Any])[source]
Bases:
ABC
Base abstract class for different types of models.
- property dt
- abstract get_influence() ndarray [source]
Abstract method to compute and return the influence values.
- property load_request: dict[str, Any]
Results will be sent to Graph.from_network on setup
- property model_type: str
- class hari_plotter.model.ModelFactory[source]
Bases:
object
- classmethod create_model(model_type: str, params: dict[str, Any]) Model [source]
Create a model instance based on the model type and parameters.
- Parameters:
model_type – The type of the model to create.
params – Parameters for the model.
- Returns:
An instance of the requested model type.
- classmethod from_toml(filename: str) Model [source]
Create a model instance from a TOML configuration file.
- Parameters:
filename – Path to the TOML file.
- Returns:
An instance of the model defined in the TOML file.