Wiki
Clone wikiArchEx / Library file
Library files consists of two parts: description and list of components.
Description part has two parameters: name of the library and list of comma-separated component types, which are present in this library (based on them the Library class knows which components to expect while parsing the file). For example:
Name: EPN library 1; Types: Generator, ACBus, Rectifier, DCBus, Load;
This description section provides a library name (“EPN library 1”) and five component type names.
Components list has the following syntax:
Type_name:Name, Subtype, Cost, attr_1, attr_2 … attr_n
Basically every row has component type name and a list of attributes of this component after a colon. Attribute values are separated by commas. The expected ordering of attributes is defined within a dedicated library class (e.g., EPNLibrary.m). Name, Subtype and Cost are mandatory attributes for every component. If they are not used they still must be present as first three attributes of a component (they can also be omitted like this – Type_name:,,,attr_1, attr_2 …
).
Other attributes are problem-specific (e.g., power capacity/requirement for EPN, processing rate for RPL and so forth). Their order is also strict and is predefined in a corresponding library class. For correct parsing the ordering has to be followed. Typically, there will be comments in the library file, describing the order, in which attribute values have to appear for a component.
Example:
%% COMPONENTS % (Type:Name,Cost,Subtype,FailProb,Power;) Generator:LV Gen 1,5000,Low voltage,2e-4,20000; Generator:HV Gen 1,5000,High voltage,2e-4,60000; %Generator:Gen 4,8000,High voltage,2e-4,80000; Generator: APU, 10000, APU, 2e-4, 150000; ACBus:LV AC bus,2000,Low voltage,2e-4,1000; ACBus:HV AC bus,2000,High voltage,2e-4,2000; Rectifier:LV Rectifier,2000,Low voltage,2e-4; Rectifier:HV Rectifier,2000,High voltage,2e-4; Rectifier:TRU,3000,TRU,2e-4;
NOTES:
- Every row starting with “%” is a comment and will be ignored when the library is parsed.
- Every row that is not a comment must end with a semicolon (“;”)
- It is recommended to group components of the same type for better readability, though, it is not mandatory (ArchEx uses regular expressions for parsing, so components of a particular type will be found in any place within the file)
Updated