Solver Platform SDK - Object-Oriented Calls, Callbacks, and Error HandlingObject-Oriented Calls, Callbacks, and Error HandlingToday, most software development is done in modern languages such as C++ or C#, Visual Basic or VB.NET, Java, and MATLAB. Each of these languages supports features such as object-oriented programming, properties, events, and exceptions -- all of which contribute to faster development and fewer errors.
Calling the SDK via Properties and MethodsAlthough you can call a series of API functions using the Solver Platform SDK's Procedural API, it's much easier to implicitly call upon the SDK's capabilities by simply defining your model, using the objects and properties provided by the SDK. For example:
creates a new problem, and implicitly creates one block of decision variables, one block of constraints, and one objective function. Simply assigning the UpperBound property of the constraint object:
defines a set of <= constraints. You can also define constraints with explicit relations and right hand sides, or define lower bounds of zero with a statement such as problem.VarDecision.NonNegative(). To define a quadratic objective, you can write:
to create a DoubleMatrix (an object supplied by the SDK) from a plain array, and assign it to the appropriate property of the Model object.Moreover, IntelliSense in Microsoft Visual Studio shows you dynamically -- as you type -- what objects and properties are available at each point. The result is faster development with fewer errors! Callbacks from the SDK via Events and DelegatesWhere other optimization libraries use low-level, error-prone "callback functions" to pass control to your code during the solution process, the Solver Platform SDK supports the "natural", high-level notification mechanisms in each language, such as events, delegates, and interfaces in object-oriented languages. Of course, in procedural languages such as C, you can still use callback functions with the SDK via its Procedural API. For example, you might define an Evaluator that should be called on each new iteration, or trial solution, found during the optimization process. In C# and .NET, which supports events as a high-level notification mechanism, you can pass a reference to your Evaluator via:
In Visual Basic 6, which supports a slightly different style of events using Microsoft COM, you would write a function EvalIteration_Evaluate() and pass a reference to your Evaluator via:
In both cases, your code will be called, in a type-safe manner, on each Solver engine iteration. In your Evaluator, you can reference the SDK object model to access, for example, the current iteration and value of the objective.. In C# syntax:
Error Handling in the SDK via ExceptionsOther "callable library" packages for optimization provide only a procedural API, where you must write code to check the result returned by each API call for possible errors. This makes code harder to write, harder to read, and invites "skipping the checks" which can lead to hard-to-diagnose problems later. In contrast, the Solver Platform SDK's object-oriented API uses the exception handling mechanism built-in to most modern programming languages, reporting all errors by raising a SolverException. This allows you to write code such as (in C# syntax):
thereby centralizing your error checking, keeping your mainline code readable, and -- most important -- ensuring that no error condition is ever ignored. |
Platform Capabilities What's New in Version 9.0 Language/OS Support Monte Carlo Simulation Plug-in Solver Engines
Risk Solver Platform is an integrated superset of Premium Solver Platform and Risk Solver with best-of-breed simulation, best-of-breed optimization, and new stochastic programming and robust optimization capabilities you can't get anywhere else. Premium Solver Platform, our premier tool for conventional optimization, uses new PSI Technology to automatically analyze and transform your Excel model. It solves every type and size of problem, using built-in and plug-in Solver Engines. Premium Solver, our basic upgrade for the Excel Solver, solves up to 10X larger problems at much higher speed, and solves new kinds of problems with our Evolutionary Solver.
Risk Solver Platform is an integrated superset of Premium Solver Platform and Risk Solver with best-of-breed simulation, best-of-breed optimization, and new stochastic programming and robust optimization capabilities you can't get anywhere else. Risk Solver Premium integrates all the features of Premium Solver and Risk Solver, with far superior optimization and higher performance, easier to use simulation, for about the same price as competitive products for Monte Carlo simulation. Risk Solver is the easiest and fastest tool available for risk analysis of your Excel models, using Monte Carlo simulation. Evaluate thousands of scenarios in seconds, and see instantly updated charts and statistics, each time you ask "what if". Software Developer Tools: Solver Platform SDK makes it easy to solve any type or size of optimization problem in your Visual Basic, VB.NET, C/C++, C#, Java, or MATLAB program. And it's easy to deploy your application with our flexible licensing for software vendors and corporate developers. |



