ApprenticeFoundryMentorModeler 24.1.0
dotnet add package ApprenticeFoundryMentorModeler --version 24.1.0
NuGet\Install-Package ApprenticeFoundryMentorModeler -Version 24.1.0
<PackageReference Include="ApprenticeFoundryMentorModeler" Version="24.1.0" />
<PackageVersion Include="ApprenticeFoundryMentorModeler" Version="24.1.0" />
<PackageReference Include="ApprenticeFoundryMentorModeler" />
paket add ApprenticeFoundryMentorModeler --version 24.1.0
#r "nuget: ApprenticeFoundryMentorModeler, 24.1.0"
#:package ApprenticeFoundryMentorModeler@24.1.0
#addin nuget:?package=ApprenticeFoundryMentorModeler&version=24.1.0
#tool nuget:?package=ApprenticeFoundryMentorModeler&version=24.1.0
Foundry Mentor Modeler
Advanced knowledge modeling framework with intelligent unit system for engineering applications
🚀 What is Foundry Mentor Modeler?
Foundry Mentor Modeler is a powerful .NET library that provides intelligent parameter modeling, formula evaluation, and unit-aware calculations for engineering and scientific applications. It enables developers to create sophisticated models with automatic unit handling, dependency tracking, and dynamic formula evaluation.
✨ Key Features
🧮 Intelligent Parameter System
- Dynamic Formula Evaluation: Create parameters with complex formulas that automatically resolve dependencies
- Unit-Aware Calculations: Built-in support for 15+ unit families with automatic type safety
- Dependency Tracking: Automatic detection and management of parameter relationships
- Circular Reference Detection: Built-in protection against infinite evaluation loops
📐 Advanced Unit System Integration
- 39+ Unit Families: Length, Distance, Angle, Bearing, Time, Duration, Mass, Force, Temperature, Voltage, and more
- Dual Family Pattern: Scale-optimized families (Length/Distance, Angle/Bearing, Time/Duration)
- Mixed Unit Support: Imperial, Metric, and specialized engineering units across 6 unit systems
- Type-Safe Operations: Prevents invalid unit conversions (e.g., adding angles to lengths)
- Dynamic Unit Detection: Automatically creates correct MeasuredValue types
🔗 Knowledge Modeling
- Hierarchical Instances: Create complex models with parent-child relationships
- Component Systems: Build reusable components with subcomponent relationships
- Reference Resolution: Sophisticated reference system for accessing model data
- Persistence Support: Save and load model states
📦 Installation
NuGet Package Manager
Install-Package ApprenticeFoundryMentorModeler
.NET CLI
dotnet add package ApprenticeFoundryMentorModeler
PackageReference
<PackageReference Include="ApprenticeFoundryMentorModeler" Version="24.1.0" />
🏃♂️ Quick Start
Basic Parameter Creation
using FoundryMentorModeler.Model;
// Create a model instance
var robot = new KnInstance("Robot");
// Add parameters with units
var speed = robot.Parameter("maxSpeed", 2.5, "m/s");
var weight = robot.Parameter("weight", 15.0, "kg");
var angle = robot.Parameter("heading", 45.0, "deg");
Formula-Based Parameters
// Create calculated parameters
var distance = robot.Parameter("distance", 0.0, "m");
var time = robot.Parameter("time", 0.0, "s");
// Add formula that references other parameters
var avgSpeed = robot.Parameter("avgSpeed", 0.0, "m/s");
avgSpeed.ApplyFormula("distance / time", UnitSystem.Default);
// Set values and watch automatic calculation
distance.SetValue(100.0); // 100 meters
time.SetValue(40.0); // 40 seconds
// avgSpeed automatically becomes 2.5 m/s
Dual Family Pattern Usage
// Use appropriate family for scale context
var robot = new KnInstance("AutonomousRobot");
// Engineering measurements (Length family - meter base)
var sensorRange = robot.Parameter("sensorRange", 5.0, "m"); // → Length family
var wheelDiameter = robot.Parameter("wheelDiameter", 15.0, "cm"); // → Length family
// Navigation measurements (Distance family - kilometer base)
robot.ApplyFormula("missionDistance", "ASDISTANCE(25, 'km')"); // → Distance family
robot.ApplyFormula("waypointGap", "ASDISTANCE(500, 'm')"); // → Distance family
// Same input units, different optimized scales:
Console.WriteLine(sensorRange.BaseValue()); // 5.0 (meters - engineering scale)
Console.WriteLine(missionDistance.BaseValue()); // 25.0 (kilometers - geographic scale)
Hierarchical Models
// Create a complex system
var droneSystem = new KnInstance("DroneSystem");
// Add subsystems
var propulsion = droneSystem.AddMember(new KnInstance("Propulsion"));
var navigation = droneSystem.AddMember(new KnInstance("Navigation"));
// Add parameters to subsystems
propulsion.Parameter("thrust", 50.0, "N");
navigation.Parameter("altitude", 100.0, "m");
navigation.Parameter("gpsAccuracy", 2.0, "m");
// Compute all values recursively
droneSystem.ComputeAll<KnInstance>(deep: true);
🔧 Advanced Usage
Custom Formulas
var circle = new KnInstance("Circle");
circle.Parameter("radius", 5.0, "m");
circle.Parameter("area", 0.0, "m²");
// Complex formula with built-in functions
var area = circle.FindParameter("area");
area.ApplyFormula("3.14159 * radius * radius", UnitSystem.Default);
Unit System Integration
// Works with FoundryRulesAndUnits
var unitSystem = new UnitSystem();
unitSystem.Apply(UnitSystemType.SI);
// Parameters automatically use proper unit system
var force = new KnParameter("force", 9.8, "N");
var acceleration = new KnParameter("acceleration", 9.8, "m/s²");
Dependency Management
var circuit = new KnInstance("Circuit");
var voltage = circuit.Parameter("voltage", 12.0, "V");
var current = circuit.Parameter("current", 2.0, "A");
var power = circuit.Parameter("power", 0.0, "W");
power.ApplyFormula("voltage * current", UnitSystem.Default);
// Changing voltage automatically updates power
voltage.SetValue(24.0); // Power becomes 48W automatically
🔍 Architecture
Core Components
KnInstance: Base knowledge instance with hierarchical capabilitiesKnParameter: Unit-aware parameter with formula evaluationOperator: Expression evaluation system with unit supportOPResult: Type-safe result container with status tracking
Unit System Integration
Foundry Mentor Modeler integrates seamlessly with FoundryRulesAndUnits to provide:
- Automatic unit family detection
- Type-safe MeasuredValue creation
- Cross-unit conversion prevention
- Engineering-grade precision
📚 Documentation
Comprehensive Guides
- Unit System Documentation - Complete technical reference
- Parameter Unit Preservation - Unit handling best practices
- Migration Guide - Upgrading from older versions
API Reference
- Extension Methods - Helper method documentation
- Mathematical Functions - Built-in formula functions
🎯 Use Cases
Engineering Applications
- Robotics: Model robot parameters with unit-aware calculations
- Mechanical Design: Create assemblies with dimensional relationships
- Control Systems: Model feedback loops with parameter dependencies
Scientific Computing
- Physics Simulations: Unit-safe calculations across measurement types
- Data Analysis: Parameter relationships with automatic computation
- Experimental Design: Model experimental setups with validation
Industrial Systems
- Process Control: Model industrial processes with interconnected parameters
- Quality Assurance: Create measurement systems with tolerance checking
- System Integration: Build complex multi-component systems
🛠️ Requirements
- .NET 9.0 or later
- FoundryRulesAndUnits (automatically included)
- FoundryCore (automatically included)
Note: This project uses a
global.jsonfile to pin to .NET 9.0 SDK for consistent builds across environments.
🤝 Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
Development Setup
git clone https://github.com/SteveStrong/FoundryMentorModeler.git
cd FoundryMentorModeler
dotnet restore
dotnet build
dotnet test
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🆕 Recent Updates (October 2025)
🚀 Complete Evaluation Logging System - 60-Minute Challenge Success
- ✅ Production-Ready Logging: Complete evaluation tracking system built in 60 minutes
- ✅ Interactive Debugging UI: Rich Blazor components for real-time evaluation monitoring
- ✅ Real-World Validation: Tested with missile launch system scenarios
- ✅ Thread-Safe Architecture: Session-based logging with comprehensive audit trails
🏗️ Architectural Refinements
- ✅ Object-Oriented Improvements: Eliminated redundancy, leveraged existing object methods
- ✅ Interface Simplification: Clean, minimal logging interfaces
- ✅ Component-Grouped Display: Hierarchical visualization matching object tree structure
- ✅ MVB Development Philosophy: Minimum Viable Build approach for rapid development
� System Infrastructure Updates
- ✅ Package Dependencies: ApprenticeFoundryRulesAndUnits 9.2.0, ApprenticeFoundryWorldsAndDrawings 24.3.0
- ✅ Token-Based Performance: Building on 5-10x evaluation performance improvements
- ✅ Enhanced Unit Integration: 15+ unit families with cross-family protection
- ✅ Production Validation: Comprehensive testing with real customer scenarios
📚 Documentation Enhancements
- ✅ Recent System Updates: Comprehensive change documentation
- ✅ Phase 4 Success: 60-minute implementation record
- ✅ Collaboration Lessons: Development philosophy and best practices
🆕 Recent Updates (September 2025)
🚀 Major Performance Optimization - 5-10x Faster Expression Evaluation
- ✅ TokenID-Based Dispatch: Replaced string comparisons with enum switching for 5-10x performance gain
- ✅ Unified Function Registry: Single source of truth for 50+ functions (Math, String, Date, Engineering)
- ✅ Token-Based Architecture: All operators now use consistent
Operator(Token)constructor pattern - ✅ Pure Evaluation: Clean separation between parsing and evaluation phases
🏗️ Architectural Transformation
- ✅ FunctionOperator Cleanup: Eliminated hundreds of lines of legacy code, removed "hard-to-read" patterns
- ✅ IUnitSystem Dependency Removal: Pure evaluation operators using static methods
- ✅ Parser-Evaluator Separation: Dedicated FunctionParser for clean architectural boundaries
- ✅ Memory Optimization: Eliminated
Name.ToUpper()calls and string allocations in hot paths
📊 Proven Performance Improvements
- BinaryOperator: 8-10x faster arithmetic dispatch (
+,-,*,/) - CompareOperator: 6-8x faster comparison operations (
==,>,<, etc.) - LogicalBinaryOperator: 5-7x faster logical operations (
AND,OR) - FunctionOperator: 3-5x faster function lookup with unified registry
🔧 Enhanced Unit System
- ✅ Dimensionless Default Strategy: Safe handling of unknown units
- ✅ 15+ Unit Families: Complete engineering unit coverage
- ✅ Cross-Family Protection: Prevents invalid unit conversions
- ✅ API Consistency: Full integration with FoundryRulesAndUnits
📚 Comprehensive Documentation
- ✅ Optimization Success Documentation: Complete transformation details
- ✅ Architecture Quick Reference: Updated usage patterns and guidelines
- ✅ Token-Based Architecture Plan: Technical implementation details
📞 Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- NuGet: Package Page
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- ApprenticeFoundryRulesAndUnits (>= 9.2.0)
- ApprenticeFoundryWorldsAndDrawings (>= 24.3.0)
- Z.Blazor.Diagrams (>= 3.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 24.1.0 | 159 | 10/22/2025 |
| 24.0.0 | 169 | 10/15/2025 |
| 23.4.0 | 168 | 9/25/2025 |
| 23.1.0 | 163 | 9/24/2025 |
| 23.0.0 | 171 | 9/24/2025 |
| 21.3.0 | 150 | 9/13/2025 |
| 21.1.0 | 153 | 9/13/2025 |
| 21.0.0 | 171 | 9/11/2025 |
| 20.3.0 | 167 | 8/11/2025 |
| 20.2.0 | 168 | 8/10/2025 |
| 20.0.0 | 139 | 8/9/2025 |
| 19.0.0 | 145 | 7/28/2025 |
| 18.4.5 | 252 | 4/19/2025 |
| 18.4.4 | 238 | 4/17/2025 |
| 18.4.2 | 256 | 4/14/2025 |
| 18.4.1 | 223 | 4/14/2025 |
| 18.4.0 | 255 | 4/14/2025 |
| 18.3.0 | 139 | 4/4/2025 |
| 18.2.0 | 178 | 3/16/2025 |
| 18.0.0 | 171 | 2/23/2025 |
| 17.2.2 | 157 | 1/28/2025 |
| 17.1.2 | 137 | 1/28/2025 |
| 16.6.0 | 159 | 12/11/2024 |
| 16.5.0 | 132 | 12/8/2024 |
| 16.4.0 | 140 | 12/1/2024 |
| 16.3.0 | 123 | 11/26/2024 |
| 16.2.0 | 141 | 11/21/2024 |
| 15.10.3 | 143 | 10/27/2024 |
| 15.10.2 | 145 | 10/27/2024 |
| 15.10.1 | 162 | 10/11/2024 |
| 15.10.0 | 183 | 10/10/2024 |
| 15.9.0 | 134 | 10/10/2024 |
| 15.7.0 | 155 | 10/5/2024 |
| 15.5.0 | 153 | 9/13/2024 |
| 15.2.1 | 175 | 9/11/2024 |
| 15.2.0 | 169 | 9/11/2024 |
| 14.7.0 | 156 | 8/30/2024 |
| 14.6.0 | 167 | 8/28/2024 |
| 14.5.0 | 183 | 8/25/2024 |
| 14.0.2 | 175 | 8/23/2024 |
| 14.0.1 | 160 | 8/21/2024 |
| 14.0.0 | 158 | 8/21/2024 |
| 13.3.0 | 173 | 8/20/2024 |
| 2.3.0 | 162 | 8/20/2024 |
| 2.2.0 | 135 | 7/25/2024 |
| 1.1.1 | 157 | 6/2/2024 |