ams.routines.routine.RoutineBase#
- class ams.routines.routine.RoutineBase(system=None, config=None, **kwargs)[source]#
Class to hold descriptive routine models and data mapping.
- Attributes:
- systemOptional[Type]
The system object associated with the routine.
- configConfig
Configuration object for the routine.
- infoOptional[str]
Information about the routine.
- tex_namesOrderedDict
LaTeX names for the routine parameters.
- symsSymProcessor
Symbolic processor for the routine.
- _symsbool
Flag indicating whether symbols have been generated.
- rparamsOrderedDict
Registry for RParam objects.
- servicesOrderedDict
Registry for service objects.
- paramsOrderedDict
Registry for Param objects.
- varsOrderedDict
Registry for Var objects.
- constrsOrderedDict
Registry for Constraint objects.
- exprcsOrderedDict
Registry for ExpressionCalc objects.
- exprsOrderedDict
Registry for Expression objects.
- objOptional[Objective]
Objective of the routine.
- initializedbool
Flag indicating whether the routine has been initialized.
- typestr
Type of the routine.
- documRDocumenter
Documentation generator for the routine.
- map1OrderedDict
Mapping from ANDES.
- map2OrderedDict
Mapping to ANDES.
- omOModel
Optimization model for the routine.
- exec_timefloat
Execution time of the routine.
- exit_codeint
Exit code of the routine.
- convergedbool
Flag indicating whether the routine has converged.
- convertedbool
Flag indicating whether AC conversion has been performed.
- __init__(system=None, config=None, **kwargs)[source]#
Initialize the routine.
- Parameters:
- systemOptional[Type]
The system object associated with the routine.
- configOptional[dict]
Configuration dictionary for the routine.
Methods
addConstrs(name, e_str[, info])Add a Constraint to the routine at runtime.
addRParam(name[, tex_name, info, src, unit, ...])Add RParam to the routine.
addService(name, value[, tex_name, unit, ...])Add ValueService to the routine.
addVars(name[, model, shape, tex_name, ...])Add a variable to the routine.
dc2ac([kloss])Convert the DC-based results with ACOPF.
disable(name)Disable a constraint by name.
doc([max_width, export])Retrieve routine documentation as a string.
enable(name)Enable a constraint by name.
export_csv([path])Export scheduling results to a csv file.
export_json([path])Export scheduling results to a json file.
formulation_summary([return_rows])Print (or return) a per-item table of the live formulation source.
get(src, idx[, attr, horizon])Get the value of a variable or parameter.
init(**kwargs)Initialize the routine.
load_csv(path)Load scheduling results from a csv file produced by
export_csv().load_json(path)Load scheduling results from a json file.
run(**kwargs)Run the routine.
set(src, idx[, attr, value])Set the value of an attribute of a routine parameter.
solve(**kwargs)Solve the routine optimization model.
summary(**kwargs)Summary interface
unpack(res, **kwargs)Unpack the results.
update([params, build_mats])Update the values of Parameters in the optimization model.
Attributes