Modeling a Generator Set
The Constraint Model for a Generator Set examples use CML to define a technical power configuration, illustrating concepts such as calculated variables, enforcement of external standards, and component selection based on requirements.
The examples correspond to the CML core concepts linked here. See the Generator Set examples for code samples that use the core concepts.
- Global Properties and Settings—
VOLTAGE_REGEXis a global constant that defines a fixed regular expression pattern used for validation or parsing throughout the model. - Types—
GeneratorSetis the root type that represents the main entity.GeneralModelrepresents a related component type. - Variables—The
GeneratorSettype defines variables likerequiredKW(the user’s power requirement),Voltage, and calculated variables likesurgeLoadKWandVoltage3(derived from parsing theVoltagestring). - Relationships—The
GeneralModelsrelation connects theGeneratorSettype to its possible configurations (GeneralModel). - Constraints—Constraints enforce critical business rules and safety standards, such as ensuring the selected generator model’s power meets the required threshold, or restricting configuration options (such as
Voltage) based on the specified compliance standards (Listing-UL 2200).