UNPKG

credl-parser-evaluator

Version:

TypeScript-based CREDL Parser and Evaluator that processes CREDL files and outputs complete Intermediate Representations

220 lines (179 loc) 8.01 kB
# CREDL Example Files This directory contains comprehensive example CREDL files that demonstrate all features of the CREDL specification v0.1. These examples are designed for testing, learning, and reference purposes. ## Example Files Overview ### 1. `01-minimal-office.credl` - Minimal Example **Purpose**: Demonstrates the minimum required blocks for a valid CREDL file **Features Covered**: - ✅ Basic metadata block - ✅ Simple asset and building structure - ✅ Basic space definitions with lease information - ✅ Fixed assumptions - ✅ Simple deterministic model - ✅ Basic Monte Carlo simulation - ✅ Standard outputs **Property Type**: Single office building **Complexity**: Beginner **Use Case**: Learning basic CREDL structure --- ### 2. `02-comprehensive-mixed-use.credl` - All Features Example **Purpose**: Comprehensive demonstration of all CREDL assumption types and advanced features **Features Covered**: -**All 4 assumption types**: - Fixed assumptions (discount rates, management fees) - Distribution assumptions (normal, triangular, uniform, lognormal) - Expression assumptions (calculated fields) - Table assumptions (structured expense breakdowns) - ✅ Multiple property types (office, retail, residential) - ✅ Complex lease structures with tenant improvements - ✅ Advanced stochastic modeling - ✅ Multiple simulation processes (Brownian motion, mean reversion, jump diffusion) - ✅ Comprehensive output specifications - ✅ Risk metrics (CVaR, percentiles) **Property Type**: Mixed-use development **Complexity**: Advanced **Use Case**: Comprehensive modeling and testing --- ### 3. `03-presets-and-templates.credl` - Reusable Constructs **Purpose**: Demonstrates presets and templates for efficient space generation **Features Covered**: -**Presets**: - Lease profiles for different unit types - Expense profiles for different quality levels - Reusable parameter sets -**Templates**: - Apartment floor templates with multiple unit types - Penthouse floor templates - Retail ground floor templates -**Template Usage**: - `use_templates` blocks for space generation - Template-generated spaces with `source_template` tracking - Multiple template applications per building -**Preset Usage**: - `preset_lease` and `preset_expenses` field references - Preset resolution in manually defined spaces **Property Type**: Multi-building apartment complex **Complexity**: Intermediate **Use Case**: Efficient modeling of repetitive spaces --- ### 4. `04-extensions-scenarios-waterfall.credl` - Advanced Extensions **Purpose**: Demonstrates advanced CREDL extensions including scenarios and waterfall structures **Features Covered**: -**Scenarios**: - Market-driven triggers (rent thresholds) - Conditional actions (accelerate, delay, add spaces, reduce scope) - Assumption overrides per scenario - Complex trigger conditions with AND/OR logic -**Waterfall Structure**: - Multi-tier equity waterfall - Hurdle rates and promote structures - LP/GP distribution mechanics -**Development Project Features**: - Phased delivery schedules - Construction cost modeling - Market rent scenario analysis -**Advanced Simulation**: - Multiple stochastic processes - Geometric Brownian motion - Jump diffusion processes **Property Type**: Development project with phases **Complexity**: Expert **Use Case**: Complex development projects with optionality --- ### 5. `05-industrial-portfolio.credl` - Portfolio Modeling **Purpose**: Demonstrates portfolio-level modeling across multiple assets **Features Covered**: -**Portfolio Structure**: - Multiple assets in different markets - Various industrial property types (warehouse, manufacturing, distribution) - Regional market assumptions -**Asset-Level Modeling**: - Individual asset performance tracking - Regional rent growth variations - Asset-specific operating assumptions -**Industrial-Specific Features**: - Large-format industrial spaces - Long-term triple-net leases - Manufacturing and logistics tenants - Truck maintenance and specialized facilities -**Portfolio Analytics**: - Portfolio-level IRR and NPV - Asset contribution analysis - Regional performance comparison **Property Type**: Multi-asset industrial portfolio **Complexity**: Advanced **Use Case**: Portfolio management and analysis --- ## CREDL Specification Coverage ### Core Blocks (All Examples) -`metadata` - Project information and versioning -`assets` - Property and building definitions -`spaces` - Leasable space definitions -`assumptions` - Modeling inputs and parameters -`models` - DCF calculation logic -`simulation` - Monte Carlo and stochastic processes -`outputs` - Results specification ### Assumption Types Coverage | Type | Example 1 | Example 2 | Example 3 | Example 4 | Example 5 | |------|-----------|-----------|-----------|-----------|-----------| | `fixed` | ✅ | ✅ | ✅ | ✅ | ✅ | | `distribution` | ❌ | ✅ | ✅ | ✅ | ✅ | | `expression` | ❌ | ✅ | ❌ | ❌ | ❌ | | `table` | ❌ | ✅ | ✅ | ✅ | ✅ | ### Advanced Features Coverage | Feature | Example 1 | Example 2 | Example 3 | Example 4 | Example 5 | |---------|-----------|-----------|-----------|-----------|-----------| | Presets | ❌ | ❌ | ✅ | ❌ | ❌ | | Templates | ❌ | ❌ | ✅ | ❌ | ❌ | | Scenarios | ❌ | ❌ | ❌ | ✅ | ❌ | | Waterfall | ❌ | ❌ | ❌ | ✅ | ❌ | | Extensions | ❌ | ❌ | ❌ | ✅ | ❌ | | Portfolio | ❌ | ❌ | ❌ | ❌ | ✅ | ### Distribution Types Demonstrated -`normal` - Most common for rent growth and market variables -`triangular` - Construction costs and bounded estimates -`uniform` - Vacancy rates and range estimates -`lognormal` - Cost variables that can't be negative ### Simulation Processes Demonstrated -`brownian_motion` - Standard random walk -`geometric_brownian_motion` - Asset price modeling -`mean_reversion` - Market rent cycles -`jump_diffusion` - Market shocks and discontinuities ### Property Types Covered -**Office** - Traditional office buildings and corporate spaces -**Retail** - Shops, restaurants, and commercial spaces -**Residential** - Apartments, units, and residential complexes -**Industrial** - Warehouses, manufacturing, and distribution -**Mixed Use** - Combined property types in single projects ### Lease Types Demonstrated -**Gross** - Landlord pays operating expenses -**NNN (Triple Net)** - Tenant pays all operating expenses -**Modified Gross** - Shared expense arrangements ## Testing and Validation All example files are designed to: 1. **Parse successfully** with the CREDL parser 2. **Validate completely** against the CREDL schema 3. **Generate valid IR** through the complete processing pipeline 4. **Demonstrate specific features** as documented above 5. **Serve as test cases** for the CREDL library ## Usage ### For Learning Start with `01-minimal-office.credl` to understand basic structure, then progress through examples of increasing complexity. ### For Testing Use these files as test cases for CREDL parser validation: ```bash # Test parsing a specific example npm test -- --testNamePattern="example.*01-minimal-office" # Test all examples npm test -- --testNamePattern="example" ``` ### For Reference Use as templates for creating your own CREDL files: - Copy the structure from the most similar example - Modify assumptions and spaces for your specific property - Add or remove features as needed ## File Naming Convention Examples follow the pattern: `##-descriptive-name.credl` - `##` - Sequential number indicating complexity/learning order - `descriptive-name` - Brief description of the example's focus - `.credl` - CREDL file extension This ensures examples can be processed in logical learning order while clearly indicating their purpose.