Configuration Builder
The ConfigurationBuilder is the entry point for
assembling a configuration. Use set_* methods to attach an algorithm, model
configuration, schedule, and model property; use add_* methods to register
data sources and report properties; call write_to_file() to emit
model-configuration.json.
Related pages:
Model Configuration — decision variables, objectives, constraints
Algorithms — algorithm choices
Schedule — multi-step optimisation
Data Sources — data source configurations
Reports — report properties
Model Properties — model-level UI/calculation flags
Top-level ConfigurationBuilder for assembling a Daitum model configuration.
A configuration ties an Algorithm
and a ModelConfiguration to the data sources, schedule, and
model/report properties that surround them. ConfigurationBuilder.write_to_file()
serialises the result into model-configuration.json.
- class ConfigurationBuilder[source]
Builder for a complete model configuration.
Use
set_*methods to attach the algorithm, model configuration, schedule, and model property; useadd_*methods to register data sources and report properties; callwrite_to_file()to emitmodel-configuration.json.- set_algorithm(algorithm)[source]
Set the top-level algorithm. Mutually exclusive with a schedule.
- Return type:
- set_model_configuration(model_configuration)[source]
Set the
ModelConfiguration(decision variables, objectives, constraints).- Return type:
- set_schedule_configuration(schedule_configuration)[source]
Set a multi-step schedule. Mutually exclusive with a single algorithm.
- Return type:
- set_solution_view_allowed(solution_view_allowed)[source]
Set whether the solution-view feature is permitted for this model.
- Return type:
- set_solution_view_enabled(solution_view_enabled)[source]
Set whether the solution view is enabled by default when allowed.
- Return type:
- add_report_property(key, report_property)[source]
Register a
ReportPropertyunder the given key.- Return type:
- set_model_property(calculate_on_load=True, calculation_enabled=True, ignore_formula=False, import_options=None, overlay_config=None)[source]
Construct and attach a
ModelPropertyfrom the given flags and configurations.- Return type:
- add_excel_transform(name, config)[source]
Register an Excel-transform data source and return its
DataSourcewrapper for further customisation (e.g.set_post_optimise).- Return type:
- add_model_transform(name, config)[source]
Register a model-transform data source. See
add_excel_transform()for the return value.- Return type:
- add_data_store(name, config)[source]
Register a data-store data source. See
add_excel_transform()for the return value.- Return type:
- add_batched_data_source(name, config)[source]
Register a batched data source bundling other data sources. See
add_excel_transform()for the return value.- Return type:
- add_report_data_source(name, report_name)[source]
Register a data source that feeds rows from a previously-run report. See
add_excel_transform()for the return value.- Return type:
- add_external_model_data_source(name)[source]
Register a data source that runs the model’s configured external evaluator. Input, parameter, and output mappings are declared on
ExternalModelConfiguration. Seeadd_excel_transform()for the return value.- Return type:
- add_distance_matrix(name, config)[source]
Register a distance-matrix data source. See
add_excel_transform()for the return value.- Return type:
- add_set_features(name, config)[source]
Register a feature-flag data source. See
add_excel_transform()for the return value.- Return type:
- add_geo_location(name, config)[source]
Register a geocoding data source. See
add_excel_transform()for the return value.- Return type: