<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Aksdb</id>
	<title>Apache OpenOffice Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Aksdb"/>
	<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/wiki/Special:Contributions/Aksdb"/>
	<updated>2026-08-05T02:19:18Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=NLPSolver&amp;diff=116403</id>
		<title>NLPSolver</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=NLPSolver&amp;diff=116403"/>
		<updated>2009-03-20T14:36:47Z</updated>

		<summary type="html">&lt;p&gt;Aksdb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Optimization ===&lt;br /&gt;
&lt;br /&gt;
Many scientific and economic problems involve the task of finding a certain optimum to a set of formulas, be it the minimum or the maximum. Additionally there are often also constraints, further restricting the set of possible solutions.&lt;br /&gt;
&lt;br /&gt;
An example would be, to minimize the costs of a company while still meeting the demand of its customers. Such a formula could look like:&lt;br /&gt;
&amp;lt;math&amp;gt;c = p_1 \cdot x_1 + p_2 \cdot x_2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;p_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;p_2&amp;lt;/math&amp;gt; are the prices of the two products and &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; are their amounts to be produced.&lt;br /&gt;
This would be a typical &amp;#039;&amp;#039;linear&amp;#039;&amp;#039; optimization problem, since the target variables (&amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt;) are linear. A &amp;#039;&amp;#039;nonlinear&amp;#039;&amp;#039; problem on the other hand could involve much more complicated relations between the variables. An example for this is the [http://en.wikipedia.org/wiki/Rosenbrock_function Rosenbrock Function]:&lt;br /&gt;
&amp;lt;math&amp;gt;f(x,y) = (1-x)^2 + 100 \cdot (y - x^2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In practice nonlinear optimization is used for curve fitting (by minimizing an error function) or for more complicated economical relations.&lt;br /&gt;
&lt;br /&gt;
=== Spreadsheets - Calc ===&lt;br /&gt;
&lt;br /&gt;
Since optimization problems consist of several variables and many different relations between them, they can be modeled inside a spreadsheet and therefore allow for easy user interaction. It is therefore useful, to have an embedded tool to solve such a model.&lt;br /&gt;
&lt;br /&gt;
In &amp;#039;&amp;#039;Calc&amp;#039;&amp;#039;, there is by default a solver for linear problems. To lift this limit, the extension &amp;#039;&amp;#039;&amp;#039;[http://extensions.services.openoffice.org/project/NLPSolver Solver for Nonlinear Programming]&amp;#039;&amp;#039;&amp;#039; can be used to add more solvers which are also capable of handling nonlinear problems (as well as linear ones).&lt;br /&gt;
&lt;br /&gt;
=== When to use? ===&lt;br /&gt;
&lt;br /&gt;
Since the &amp;#039;&amp;#039;&amp;#039;[http://extensions.services.openoffice.org/project/NLPSolver Solver for Nonlinear Programming]&amp;#039;&amp;#039;&amp;#039; can handle both - linear and nonlinear problems - you may ask yourself, why it is still necessary to have the &amp;#039;&amp;#039;&amp;#039;OpenOffice.org Linear Solver&amp;#039;&amp;#039;&amp;#039; then. The answer is easy: performance.&lt;br /&gt;
&lt;br /&gt;
Solving nonlinear problems is a large burden and is still an active field of research in mathematics. There are not many all-round solutions. Often it is necessary to precisely know the problem to be solved and choose the appropriate method as well as their parameters according to that knowledge.&lt;br /&gt;
&lt;br /&gt;
Since the representation of optimization models in a spreadsheet cannot be analyzed that deeply, the solver has to be able to handle a broad spectrum of optimization problems.&lt;br /&gt;
&lt;br /&gt;
Another problem is, that many algorithms tend to get trapped in &amp;#039;&amp;#039;local extrema&amp;#039;&amp;#039;. That means that the solution they find, may not be the best &amp;#039;&amp;#039;overall&amp;#039;&amp;#039; (global) solution.&lt;br /&gt;
&lt;br /&gt;
One category of algorithms which overcome both problems are Evolutionary Strategies which are slow, in comparison to the deterministic approach by the OpenOffice.org Linear Solver.&lt;br /&gt;
&lt;br /&gt;
=== Evolutionary Strategies ===&lt;br /&gt;
&lt;br /&gt;
In nature there is not much analysis but things &amp;quot;just work&amp;quot; through a complex system of behaviors and events. Ant colonies build very short routes over time to transport food into their anthill - just by instinct. Bird swarms stay together and follow a leader in a certain formation. The simple change of the leaders mind, influences the behavior of all the other birds in the swarm. Similarly, a human population is influenced by each others knowledge. People talk, share information and make up their own mind based on what they learned, read and heard so far.&lt;br /&gt;
&lt;br /&gt;
Several people had the idea, to use these principles to solve numerical and combinatorial problems. This is also the approach our &amp;#039;&amp;#039;&amp;#039;[http://extensions.services.openoffice.org/project/NLPSolver Solver for Nonlinear Programming]&amp;#039;&amp;#039;&amp;#039; chooses to solve nonlinear optimization problems. The solution is found by annealing the solution towards the (global) optimum, which is achieved by &amp;quot;structured trial and error&amp;quot;. Due to the randomization it becomes very likely to find the &amp;#039;&amp;#039;&amp;#039;global optimum&amp;#039;&amp;#039;&amp;#039; instead of getting stuck in a local optimum. Also it doesn&amp;#039;t matter (much) how the problem is structured, since the solver will adjust itself automatically by learning.&lt;br /&gt;
&lt;br /&gt;
The biggest downside of this approach is, that it has to evaluate the whole optimization model many times to find the solution, which costs a lot of time and is therefore rather slow.&lt;br /&gt;
&lt;br /&gt;
== Solvers ==&lt;br /&gt;
&lt;br /&gt;
=== DEPS - Differential Evolution &amp;amp; Particle Swarm Optimization ===&lt;br /&gt;
&lt;br /&gt;
DEPS consists of two independent algorithms: &amp;#039;&amp;#039;Differential Evolution&amp;#039;&amp;#039; and &amp;#039;&amp;#039;Particle Swarm Optimization&amp;#039;&amp;#039;. Both are especially suited for numerical problems, such as nonlinear optimization, and are complementary to each other in that they even out their others shortcomings.&lt;br /&gt;
&lt;br /&gt;
The idea behind &amp;#039;&amp;#039;Particle Swarm Optimization&amp;#039;&amp;#039; is to represent every solution vector as coordinates in an n-dimensional room. Each individual (particle) traverses through that space and keeps track of its own best point so far. This information as well as the knowledge about the particle with the best current solution influence how it will move in each iteration. Due to that, the particles will always try to build a swarm and float around the best solutions, traversing possible even better solutions on its way.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Differential Evolution&amp;#039;&amp;#039; on the other hand is a strategy to &amp;quot;recombine&amp;quot; two individuals similar to Genetic Algorithms. Instead of crossing over chromosomes (i.e. mixing up their variables), the knowledge about the target function is used to anneal both points.&lt;br /&gt;
&lt;br /&gt;
In each iteration of the algorithm, each individual chooses one of both strategies and applies them to its current solution vector. The probability, which strategy is chosen, can be modified with the option Agent Switch Rate.&lt;br /&gt;
&lt;br /&gt;
=== SCO - Social Cognitive Optimization ===&lt;br /&gt;
&lt;br /&gt;
SCO takes into account the human behavior of learning and sharing informations. Each individual has access to a common library with knowledge shared between all individuals.&lt;br /&gt;
&lt;br /&gt;
In each step, an individual looks up the (presumably) best information available in the library and builds a decision based on it together with its own current knowledge about the problem. Afterwards it replaces one of the worse informations from the library with its newly learned solution.&lt;br /&gt;
&lt;br /&gt;
That way all individuals work together (&amp;#039;&amp;#039;the social aspect&amp;#039;&amp;#039;) and make up their own mind (&amp;#039;&amp;#039;the cognitive aspect&amp;#039;&amp;#039;). Therefore it&amp;#039;s called &amp;#039;&amp;#039;&amp;#039;Social Cognitive Optimization&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
Regardless whether you use DEPS or SCO, you start by going to Tools -&amp;gt; Solver and set the Cell to be optimized, the direction to go (minimization, maximization) and the cells to be modified to reach the goal. Then you go to the Options and specify the solver to be used and if necessary adjust the according parameters.&lt;br /&gt;
&lt;br /&gt;
There is also a list of constraints you can use to restrict the possible range of solutions or to penalize certain conditions. However, in case of the evolutionary solvers DEPS and SCO, these constraints are also used to specify bounds on the variables of the problem. Due to the random nature of the algorithms, it is &amp;#039;&amp;#039;&amp;#039;highly recommended&amp;#039;&amp;#039;&amp;#039; to do so and give upper (and in case &amp;quot;Assume Non-Negative Variables&amp;quot; is turned off also lower) bounds for all variables. They don&amp;#039;t have to be near the actual solution (which is probably unknown) but should give a rough indication of the expected size (&amp;lt;math&amp;gt;0 \leq \text{var} \leq 1&amp;lt;/math&amp;gt; or maybe &amp;lt;math&amp;gt;-1000000 \leq \text{var} \leq 1000000&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Bounds are specified by selecting one or more variables (as range) on the left side and entering a numerical value (&amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; a cell or a formula) on the right side. That way you can also choose one or more variables to be &amp;#039;&amp;#039;Integer&amp;#039;&amp;#039; or &amp;#039;&amp;#039;Binary&amp;#039;&amp;#039; only.&lt;br /&gt;
&lt;br /&gt;
== Options and Parameters ==&lt;br /&gt;
&lt;br /&gt;
=== General Options ===&lt;br /&gt;
&lt;br /&gt;
{|width=100% class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|width=20% | &amp;#039;&amp;#039;&amp;#039;Size of Swarm&amp;#039;&amp;#039;&amp;#039; || ... defines the number of individuals to participate in the learning process. Each individual finds its own solutions and contributes to the overall knowledge.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Learning Cycles&amp;#039;&amp;#039;&amp;#039; || ... defines the number of iterations, the algorithm should take. In each iteration, all individuals make a guess on the best solution and share their knowledge.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Variable Bounds Guessing&amp;#039;&amp;#039;&amp;#039; || ... If enabled (default), the algorithm tries to find variable bounds by looking at the starting values.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Variable Bounds Threshold&amp;#039;&amp;#039;&amp;#039; || When guessing variable bounds, this threshold specifies, how the initial values are shifted to build the bounds. The calculation is as follows: &amp;lt;math&amp;gt;\text{Bound} = \text{InitialValue} \pm(\text{Threshold} \cdot \text{InitialValue})&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Example&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;math&amp;gt;\text{InitialValue}&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;\text{Threshold}&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3&amp;lt;/math&amp;gt; (default). In this case, the lower bound would be &amp;lt;math&amp;gt;100 - 3 \cdot 100 = -200&amp;lt;/math&amp;gt; and the upper bound &amp;lt;math&amp;gt;100 + 3 \cdot 100 = 400&amp;lt;/math&amp;gt;.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Use ACR Comparator&amp;#039;&amp;#039;&amp;#039; || If &amp;#039;&amp;#039;disabled&amp;#039;&amp;#039; (default), the BCH Comparator is used. It compares two individuals by first looking at their constraint violations and only if those are equal, it measures their current solution.&lt;br /&gt;
&lt;br /&gt;
If &amp;#039;&amp;#039;enabled&amp;#039;&amp;#039;, the ACR Comparator is used. It compares two individuals dependent on the current iteration and measures their goodness with knowledge about the libraries worst known solutions (in regard to their constraint violations).&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Use Random Starting Point&amp;#039;&amp;#039;&amp;#039; || If &amp;#039;&amp;#039;enabled&amp;#039;&amp;#039;, the library is simply filled up with randomly chosen points.&lt;br /&gt;
&lt;br /&gt;
If &amp;#039;&amp;#039;disabled&amp;#039;&amp;#039;, the currently present values (as given by the user) are inserted in the library as reference point.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Stagnation Limit&amp;#039;&amp;#039;&amp;#039; || If this number of individuals found solutions within a close range, the iteration is stopped and the best of these values is chosen as optimal.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Stagnation Tolerance&amp;#039;&amp;#039;&amp;#039; || Defines in what range solutions are considered &amp;quot;similar&amp;quot;.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Show Enhanced Solver Status&amp;#039;&amp;#039;&amp;#039; || If &amp;#039;&amp;#039;enabled&amp;#039;&amp;#039;, an additional dialog is shown during the solving process which gives information about the current progress, the level of stagnation, the currently best known solution as well as the possibility, to stop or resume the solver.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== DEPS-specific Options ===&lt;br /&gt;
&lt;br /&gt;
{| width=100% class=wikitable&lt;br /&gt;
|- valign=top&lt;br /&gt;
|width=20% | &amp;#039;&amp;#039;&amp;#039;Agent Switch Rate&amp;#039;&amp;#039;&amp;#039; || Specifies the probability for an individual to choose the Differential Evolution strategy.&lt;br /&gt;
|- valign=top&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;DE: Crossover Probability&amp;#039;&amp;#039;&amp;#039; || ... defines the probability of the individual being combined with the globally best point. If crossover is not used, the point is assembled from the own memory of the individual.&lt;br /&gt;
|- valign=top&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;DE: Scaling Factor&amp;#039;&amp;#039;&amp;#039; || During crossover, the scaling factor decides about the &amp;quot;speed&amp;quot; of movement.&lt;br /&gt;
|- valign=top&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;PS: Constriction Coefficient&amp;#039;&amp;#039;&amp;#039; || ... defines the speed at which the particles/individuals move towards each other.&lt;br /&gt;
|- valign=top&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;PS: Cognitive Constant&amp;#039;&amp;#039;&amp;#039; || ... sets the importance of the own memory (in particular the best reached point so far).&lt;br /&gt;
|- valign=top&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;PS: Social Constant&amp;#039;&amp;#039;&amp;#039; || ... sets the importance of the global best point between all particles/individuals.&lt;br /&gt;
|- valign=top&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;PS: Mutation Probability&amp;#039;&amp;#039;&amp;#039; || ... defines the probability, that instead of moving a component of the particle towards the best point, it randomly chooses a new value from the valid range for that variable.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== SCO-specific Options ===&lt;br /&gt;
&lt;br /&gt;
{| width=100% class=wikitable&lt;br /&gt;
|- valign=top&lt;br /&gt;
|width=20% | &amp;#039;&amp;#039;&amp;#039;Size of Library&amp;#039;&amp;#039;&amp;#039; || ... defines the amount of information to store in the public library. Each individual stores knowledge there and asks for information.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Scripting ==&lt;br /&gt;
&lt;br /&gt;
There are a number of reasons why it may be useful to access the solver from within a scripting language (like &amp;#039;&amp;#039;&amp;#039;OpenOffice.org Basic&amp;#039;&amp;#039;&amp;#039;). One of them could be, that you don&amp;#039;t want to specify all of the constraints whenever you want to run the solver on a specific problem. In that case you could handle the solver setup from Basic.&lt;br /&gt;
&lt;br /&gt;
=== Properties and Methods ===&lt;br /&gt;
&lt;br /&gt;
Apart from the default properties and methods defined by the [http://api.openoffice.org/docs/common/ref/com/sun/star/sheet/XSolver.html XSolver] interface, DEPS and SCO publish the following properties:&lt;br /&gt;
&lt;br /&gt;
{|width=100% class=wikitable&lt;br /&gt;
!style=&amp;quot;text-align: left&amp;quot;  | Property !!style=&amp;quot;text-align: left&amp;quot;  | Type !!style=&amp;quot;text-align: left&amp;quot; | Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;SwarmSize&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Integer&amp;lt;/tt&amp;gt; || Size of Swarm&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;LearningCycles&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Integer&amp;lt;/tt&amp;gt; ||Learning Cycles&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;GuessVariableRange&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Boolean&amp;lt;/tt&amp;gt; || Variable Range Guessing&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;VariableRangeThreshold&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Double&amp;lt;/tt&amp;gt; || Variable Range Threshold&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;UseACRComparator&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Boolean&amp;lt;/tt&amp;gt; || Use ACR Comparator&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;UseRandomStartingPoint&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Boolean&amp;lt;/tt&amp;gt; || Use Random Starting Point&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;StagnationLimit&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Integer&amp;lt;/tt&amp;gt; || Stagnation Limit&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;Tolerance&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Double&amp;lt;/tt&amp;gt; || Stagnation Tolerance&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;EnhancedSolverStatus&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Boolean&amp;lt;/tt&amp;gt; || Show Enhanced Solver Status&lt;br /&gt;
|-&lt;br /&gt;
!colspan=3 style=&amp;quot;text-align: left&amp;quot; | &amp;lt;tt&amp;gt;com.sun.star.comp.Calc.NLPSolver.DEPSSolverImpl&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;AgentSwitchRate&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Double&amp;lt;/tt&amp;gt; || Agent Switch Rate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;DEFactor&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Double&amp;lt;/tt&amp;gt; || Scaling Factor&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;DECR&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Double&amp;lt;/tt&amp;gt; || Crossover Probability&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;PSC1&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Double&amp;lt;/tt&amp;gt; || Cognitive Constant&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;PSC2&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Double&amp;lt;/tt&amp;gt; || Social Constant&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;PSWeight&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Double&amp;lt;/tt&amp;gt; || Constriction Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;PSCL&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Double&amp;lt;/tt&amp;gt; || Mutation Probability&lt;br /&gt;
|-&lt;br /&gt;
!colspan=3 style=&amp;quot;text-align: left&amp;quot; | &amp;lt;tt&amp;gt;com.sun.star.comp.Calc.NLPSolver.SCOSolverImpl&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;LibrarySize&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Integer&amp;lt;/tt&amp;gt; || Size of Library&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&lt;br /&gt;
The following example will iterate over the row 5 to 300 (the internal numbering starts at 0!) from sheet 1 and solve each of them separately by minimizing the objective in the same row.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Sub OptimizeDEPS&lt;br /&gt;
  Dim Solver as Object&lt;br /&gt;
  Set Solver = CreateUnoService(&amp;quot;com.sun.star.comp.Calc.NLPSolver.DEPSSolverImpl&amp;quot;)&lt;br /&gt;
  Solver.Document = ThisComponent&lt;br /&gt;
  Solver.Maximize = false&lt;br /&gt;
  &lt;br /&gt;
  Dim ObjectiveCell as new com.sun.star.table.CellAddress&lt;br /&gt;
  ObjectiveCell.Sheet = 0&lt;br /&gt;
  ObjectiveCell.Column = 10&lt;br /&gt;
  &lt;br /&gt;
  Dim VariableCells(0) as new com.sun.star.table.CellAddress&lt;br /&gt;
  VariableCells(0).Sheet = 0&lt;br /&gt;
  VariableCells(0).Column = 2&lt;br /&gt;
  &lt;br /&gt;
  For TargetRow = 4 To 299&lt;br /&gt;
    ObjectiveCell.Row = TargetRow&lt;br /&gt;
    VariableCells(0).Row = TargetRow&lt;br /&gt;
    Solver.Objective = ObjectiveCell&lt;br /&gt;
    Solver.Variables = VariableCells&lt;br /&gt;
    Solver.solve&lt;br /&gt;
  Next&lt;br /&gt;
  &lt;br /&gt;
  MsgBox &amp;quot;Done.&amp;quot;&lt;br /&gt;
End Sub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== License and Disclaimer ==&lt;br /&gt;
&lt;br /&gt;
This extension has been developed at &amp;#039;&amp;#039;&amp;#039;Sun Microsystems Inc.&amp;#039;&amp;#039;&amp;#039; and is licensed under the terms of the [http://www.openoffice.org/license.html GNU Lesser General Public License version 3].&lt;br /&gt;
&lt;br /&gt;
Research and implementation of DEPS and SCO have been done by &amp;#039;&amp;#039;&amp;#039;Xiao-Feng Xie&amp;#039;&amp;#039;&amp;#039; of [http://www.adaptivebox.net/research/ adaptivebox.net]. Both were modified and applied to the needs of the OpenOffice.org Solver by Andreas Schneider for Sun Microsystems, Inc.&lt;/div&gt;</summary>
		<author><name>Aksdb</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=NLPSolver&amp;diff=116376</id>
		<title>NLPSolver</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=NLPSolver&amp;diff=116376"/>
		<updated>2009-03-20T10:46:49Z</updated>

		<summary type="html">&lt;p&gt;Aksdb: New page: == Introduction ==  === Optimization ===  Many scientific and economic problems involve the task of finding a certain optimum to a set of formulas, be it the minimum or the maximum. Additi...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Optimization ===&lt;br /&gt;
&lt;br /&gt;
Many scientific and economic problems involve the task of finding a certain optimum to a set of formulas, be it the minimum or the maximum. Additionally there are often also constraints, further restricting the set of possible solutions.&lt;br /&gt;
&lt;br /&gt;
An example would be, to minimize the costs of a company while still meeting the demand of its customers. Such a formula could look like:&lt;br /&gt;
&amp;lt;math&amp;gt;c = p_1 \cdot x_1 + p_2 \cdot x_2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;p_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;p_2&amp;lt;/math&amp;gt; are the prices of the two products and &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; are their amounts to be produced.&lt;br /&gt;
This would be a typical &amp;#039;&amp;#039;linear&amp;#039;&amp;#039; optimization problem, since the target variables (&amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt;) are linear. A &amp;#039;&amp;#039;nonlinear&amp;#039;&amp;#039; problem on the other hand could involve much more complicated relations between the variables. An example for this is the [http://en.wikipedia.org/wiki/Rosenbrock_function Rosenbrock Function]:&lt;br /&gt;
&amp;lt;math&amp;gt;f(x,y) = (1-x)^2 + 100 \cdot (y - x^2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In practice nonlinear optimization is used for curve fitting (by minimizing an error function) or for more complicated economical relations.&lt;br /&gt;
&lt;br /&gt;
=== Spreadsheets - Calc ===&lt;br /&gt;
&lt;br /&gt;
Since optimization problems consist of several variables and many different relations between them, they can be modeled inside a spreadsheet and therefore allow for easy user interaction. It is therefore useful, to have an embedded tool to solve such a model.&lt;br /&gt;
&lt;br /&gt;
In &amp;#039;&amp;#039;Calc&amp;#039;&amp;#039;, there is by default a solver for linear problems. To lift this limit, the extension &amp;#039;&amp;#039;&amp;#039;Solver for Nonlinear Programming&amp;#039;&amp;#039;&amp;#039; can be used to add more solvers which are also capable of handling nonlinear problems (as well as linear ones).&lt;br /&gt;
&lt;br /&gt;
=== When to use? ===&lt;br /&gt;
&lt;br /&gt;
Since the &amp;#039;&amp;#039;&amp;#039;Solver for Nonlinear Programming&amp;#039;&amp;#039;&amp;#039; can handle both - linear and nonlinear problems - you may ask yourself, why it is still necessary to have the &amp;#039;&amp;#039;&amp;#039;OpenOffice.org Linear Solver&amp;#039;&amp;#039;&amp;#039; then. The answer is easy: performance.&lt;br /&gt;
&lt;br /&gt;
Solving nonlinear problems is a large burden and is still an active field of research in mathematics. There are not many all-round solutions. Often it is necessary to precisely know the problem to be solved and choose the appropriate method as well as their parameters according to that knowledge.&lt;br /&gt;
&lt;br /&gt;
Since the representation of optimization models in a spreadsheet cannot be analyzed that deeply, the solver has to be able to handle a broad spectrum of optimization problems.&lt;br /&gt;
&lt;br /&gt;
Another problem is, that many algorithms tend to get trapped in &amp;#039;&amp;#039;local extrema&amp;#039;&amp;#039;. That means that the solution they find, may not be the best &amp;#039;&amp;#039;overall&amp;#039;&amp;#039; (global) solution.&lt;br /&gt;
&lt;br /&gt;
One category of algorithms which overcome both problems are Evolutionary Strategies which are slow, in comparison to the deterministic approach by the OpenOffice.org Linear Solver.&lt;br /&gt;
&lt;br /&gt;
=== Evolutionary Strategies ===&lt;br /&gt;
&lt;br /&gt;
In nature there is not much analysis but things &amp;quot;just work&amp;quot; through a complex system of behaviors and events. Ant colonies build very short routes over time to transport food into their anthill - just by instinct. Bird swarms stay together and follow a leader in a certain formation. The simple change of the leaders mind, influences the behavior of all the other birds in the swarm. Similarly, a human population is influenced by each others knowledge. People talk, share information and make up their own mind based on what they learned, read and heard so far.&lt;br /&gt;
&lt;br /&gt;
Several people had the idea, to use these principles to solve numerical and combinatorial problems. This is also the approach our &amp;#039;&amp;#039;&amp;#039;Solver for Nonlinear Programming&amp;#039;&amp;#039;&amp;#039; chooses to solve nonlinear optimization problems. The solution is found by annealing the solution towards the (global) optimum, which is achieved by &amp;quot;structured trial and error&amp;quot;. Due to the randomization it becomes very likely to find the &amp;#039;&amp;#039;&amp;#039;global optimum&amp;#039;&amp;#039;&amp;#039; instead of getting stuck in a local optimum. Also it doesn&amp;#039;t matter (much) how the problem is structured, since the solver will adjust itself automatically by learning.&lt;br /&gt;
&lt;br /&gt;
The biggest downside of this approach is, that it has to evaluate the whole optimization model many times to find the solution, which costs a lot of time and is therefore rather slow.&lt;br /&gt;
&lt;br /&gt;
== Solvers ==&lt;br /&gt;
&lt;br /&gt;
=== DEPS - Differential Evolution &amp;amp; Particle Swarm Optimization ===&lt;br /&gt;
&lt;br /&gt;
DEPS consists of two independent algorithms: &amp;#039;&amp;#039;Differential Evolution&amp;#039;&amp;#039; and &amp;#039;&amp;#039;Particle Swarm Optimization&amp;#039;&amp;#039;. Both are especially suited for numerical problems, such as nonlinear optimization, and are complementary to each other in that they even out their others shortcomings.&lt;br /&gt;
&lt;br /&gt;
The idea behind &amp;#039;&amp;#039;Particle Swarm Optimization&amp;#039;&amp;#039; is to represent every solution vector as coordinates in an n-dimensional room. Each individual (particle) traverses through that space and keeps track of its own best point so far. This information as well as the knowledge about the particle with the best current solution influence how it will move in each iteration. Due to that, the particles will always try to build a swarm and float around the best solutions, traversing possible even better solutions on its way.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Differential Evolution&amp;#039;&amp;#039; on the other hand is a strategy to &amp;quot;recombine&amp;quot; two individuals similar to Genetic Algorithms. Instead of crossing over chromosomes (i.e. mixing up their variables), the knowledge about the target function is used to anneal both points.&lt;br /&gt;
&lt;br /&gt;
In each iteration of the algorithm, each individual chooses one of both strategies and applies them to its current solution vector. The probability, which strategy is chosen, can be modified with the option Agent Switch Rate.&lt;br /&gt;
&lt;br /&gt;
=== SCO - Social Cognitive Optimization ===&lt;br /&gt;
&lt;br /&gt;
SCO takes into account the human behavior of learning and sharing informations. Each individual has access to a common library with knowledge shared between all individuals.&lt;br /&gt;
&lt;br /&gt;
In each step, an individual looks up the (presumably) best information available in the library and builds a decision based on it together with its own current knowledge about the problem. Afterwards it replaces one of the worse informations from the library with its newly learned solution.&lt;br /&gt;
&lt;br /&gt;
That way all individuals work together (&amp;#039;&amp;#039;the social aspect&amp;#039;&amp;#039;) and make up their own mind (&amp;#039;&amp;#039;the cognitive aspect&amp;#039;&amp;#039;). Therefore it&amp;#039;s called &amp;#039;&amp;#039;&amp;#039;Social Cognitive Optimization&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
Regardless whether you use DEPS or SCO, you start by going to Tools -&amp;gt; Solver and set the Cell to be optimized, the direction to go (minimization, maximization) and the cells to be modified to reach the goal. Then you go to the Options and specify the solver to be used and if necessary adjust the according parameters.&lt;br /&gt;
&lt;br /&gt;
There is also a list of constraints you can use to restrict the possible range of solutions or to penalize certain conditions. However, in case of the evolutionary solvers DEPS and SCO, these constraints are also used to specify bounds on the variables of the problem. Due to the random nature of the algorithms, it is &amp;#039;&amp;#039;&amp;#039;highly recommended&amp;#039;&amp;#039;&amp;#039; to do so and give upper (and in case &amp;quot;Assume Non-Negative Variables&amp;quot; is turned off also lower) bounds for all variables. They don&amp;#039;t have to be near the actual solution (which is probably unknown) but should give a rough indication of the expected size (&amp;lt;math&amp;gt;0 \leq \text{var} \leq 1&amp;lt;/math&amp;gt; or maybe &amp;lt;math&amp;gt;-1000000 \leq \text{var} \leq 1000000&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Bounds are specified by selecting one or more variables (as range) on the left side and entering a numerical value (&amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; a cell or a formula) on the right side. That way you can also choose one or more variables to be &amp;#039;&amp;#039;Integer&amp;#039;&amp;#039; or &amp;#039;&amp;#039;Binary&amp;#039;&amp;#039; only.&lt;br /&gt;
&lt;br /&gt;
== Options and Parameters ==&lt;br /&gt;
&lt;br /&gt;
=== General Options ===&lt;br /&gt;
&lt;br /&gt;
{|width=100% class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|width=20% | &amp;#039;&amp;#039;&amp;#039;Size of Swarm&amp;#039;&amp;#039;&amp;#039; || ... defines the number of individuals to participate in the learning process. Each individual finds its own solutions and contributes to the overall knowledge.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Learning Cycles&amp;#039;&amp;#039;&amp;#039; || ... defines the number of iterations, the algorithm should take. In each iteration, all individuals make a guess on the best solution and share their knowledge.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Variable Bounds Guessing&amp;#039;&amp;#039;&amp;#039; || ... If enabled (default), the algorithm tries to find variable bounds by looking at the starting values.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Variable Bounds Threshold&amp;#039;&amp;#039;&amp;#039; || When guessing variable bounds, this threshold specifies, how the initial values are shifted to build the bounds. The calculation is as follows: &amp;lt;math&amp;gt;\text{Bound} = \text{InitialValue} \pm(\text{Threshold} \cdot \text{InitialValue})&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Example&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;math&amp;gt;\text{InitialValue}&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;\text{Threshold}&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;3&amp;lt;/math&amp;gt; (default). In this case, the lower bound would be &amp;lt;math&amp;gt;100 - 3 \cdot 100 = -200&amp;lt;/math&amp;gt; and the upper bound &amp;lt;math&amp;gt;100 + 3 \cdot 100 = 400&amp;lt;/math&amp;gt;.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Use ACR Comparator&amp;#039;&amp;#039;&amp;#039; || If &amp;#039;&amp;#039;disabled&amp;#039;&amp;#039; (default), the BCH Comparator is used. It compares two individuals by first looking at their constraint violations and only if those are equal, it measures their current solution.&lt;br /&gt;
&lt;br /&gt;
If &amp;#039;&amp;#039;enabled&amp;#039;&amp;#039;, the ACR Comparator is used. It compares two individuals dependent on the current iteration and measures their goodness with knowledge about the libraries worst known solutions (in regard to their constraint violations).&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Use Random Starting Point&amp;#039;&amp;#039;&amp;#039; || If &amp;#039;&amp;#039;enabled&amp;#039;&amp;#039;, the library is simply filled up with randomly chosen points.&lt;br /&gt;
&lt;br /&gt;
If &amp;#039;&amp;#039;disabled&amp;#039;&amp;#039;, the currently present values (as given by the user) are inserted in the library as reference point.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Stagnation Limit&amp;#039;&amp;#039;&amp;#039; || If this number of individuals found solutions within a close range, the iteration is stopped and the best of these values is chosen as optimal.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Stagnation Tolerance&amp;#039;&amp;#039;&amp;#039; || Defines in what range solutions are considered &amp;quot;similar&amp;quot;.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Show Enhanced Solver Status&amp;#039;&amp;#039;&amp;#039; || If &amp;#039;&amp;#039;enabled&amp;#039;&amp;#039;, an additional dialog is shown during the solving process which gives information about the current progress, the level of stagnation, the currently best known solution as well as the possibility, to stop or resume the solver.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== DEPS-specific Options ===&lt;br /&gt;
&lt;br /&gt;
{| width=100% class=wikitable&lt;br /&gt;
|- valign=top&lt;br /&gt;
|width=20% | &amp;#039;&amp;#039;&amp;#039;Agent Switch Rate&amp;#039;&amp;#039;&amp;#039; || Specifies the probability for an individual to choose the Differential Evolution strategy.&lt;br /&gt;
|- valign=top&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;DE: Crossover Probability&amp;#039;&amp;#039;&amp;#039; || ... defines the probability of the individual being combined with the globally best point. If crossover is not used, the point is assembled from the own memory of the individual.&lt;br /&gt;
|- valign=top&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;DE: Scaling Factor&amp;#039;&amp;#039;&amp;#039; || During crossover, the scaling factor decides about the &amp;quot;speed&amp;quot; of movement.&lt;br /&gt;
|- valign=top&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;PS: Constriction Coefficient&amp;#039;&amp;#039;&amp;#039; || ... defines the speed at which the particles/individuals move towards each other.&lt;br /&gt;
|- valign=top&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;PS: Cognitive Constant&amp;#039;&amp;#039;&amp;#039; || ... sets the importance of the own memory (in particular the best reached point so far).&lt;br /&gt;
|- valign=top&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;PS: Social Constant&amp;#039;&amp;#039;&amp;#039; || ... sets the importance of the global best point between all particles/individuals.&lt;br /&gt;
|- valign=top&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;PS: Mutation Probability&amp;#039;&amp;#039;&amp;#039; || ... defines the probability, that instead of moving a component of the particle towards the best point, it randomly chooses a new value from the valid range for that variable.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== SCO-specific Options ===&lt;br /&gt;
&lt;br /&gt;
{| width=100% class=wikitable&lt;br /&gt;
|- valign=top&lt;br /&gt;
|width=20% | &amp;#039;&amp;#039;&amp;#039;Size of Library&amp;#039;&amp;#039;&amp;#039; || ... defines the amount of information to store in the public library. Each individual stores knowledge there and asks for information.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Scripting ==&lt;br /&gt;
&lt;br /&gt;
There are a number of reasons why it may be useful to access the solver from within a scripting language (like &amp;#039;&amp;#039;&amp;#039;OpenOffice.org Basic&amp;#039;&amp;#039;&amp;#039;). One of them could be, that you don&amp;#039;t want to specify all of the constraints whenever you want to run the solver on a specific problem. In that case you could handle the solver setup from Basic.&lt;br /&gt;
&lt;br /&gt;
=== Properties and Methods ===&lt;br /&gt;
&lt;br /&gt;
Apart from the default properties and methods defined by the [http://api.openoffice.org/docs/common/ref/com/sun/star/sheet/XSolver.html XSolver] interface, DEPS and SCO publish the following properties:&lt;br /&gt;
&lt;br /&gt;
{|width=100% class=wikitable&lt;br /&gt;
!style=&amp;quot;text-align: left&amp;quot;  | Property !!style=&amp;quot;text-align: left&amp;quot;  | Type !!style=&amp;quot;text-align: left&amp;quot; | Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;SwarmSize&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Integer&amp;lt;/tt&amp;gt; || Size of Swarm&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;LearningCycles&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Integer&amp;lt;/tt&amp;gt; ||Learning Cycles&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;GuessVariableRange&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Boolean&amp;lt;/tt&amp;gt; || Variable Range Guessing&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;VariableRangeThreshold&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Double&amp;lt;/tt&amp;gt; || Variable Range Threshold&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;UseACRComparator&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Boolean&amp;lt;/tt&amp;gt; || Use ACR Comparator&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;UseRandomStartingPoint&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Boolean&amp;lt;/tt&amp;gt; || Use Random Starting Point&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;StagnationLimit&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Integer&amp;lt;/tt&amp;gt; || Stagnation Limit&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;Tolerance&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Double&amp;lt;/tt&amp;gt; || Stagnation Tolerance&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;EnhancedSolverStatus&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Boolean&amp;lt;/tt&amp;gt; || Show Enhanced Solver Status&lt;br /&gt;
|-&lt;br /&gt;
!colspan=3 style=&amp;quot;text-align: left&amp;quot; | &amp;lt;tt&amp;gt;com.sun.star.comp.Calc.NLPSolver.DEPSSolverImpl&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;AgentSwitchRate&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Double&amp;lt;/tt&amp;gt; || Agent Switch Rate&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;DEFactor&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Double&amp;lt;/tt&amp;gt; || Scaling Factor&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;DECR&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Double&amp;lt;/tt&amp;gt; || Crossover Probability&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;PSC1&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Double&amp;lt;/tt&amp;gt; || Cognitive Constant&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;PSC2&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Double&amp;lt;/tt&amp;gt; || Social Constant&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;PSWeight&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Double&amp;lt;/tt&amp;gt; || Constriction Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;PSCL&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Double&amp;lt;/tt&amp;gt; || Mutation Probability&lt;br /&gt;
|-&lt;br /&gt;
!colspan=3 style=&amp;quot;text-align: left&amp;quot; | &amp;lt;tt&amp;gt;com.sun.star.comp.Calc.NLPSolver.SCOSolverImpl&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;LibrarySize&amp;lt;/tt&amp;gt; || &amp;lt;tt&amp;gt;Integer&amp;lt;/tt&amp;gt; || Size of Library&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&lt;br /&gt;
The following example will iterate over the row 5 to 300 (the internal numbering starts at 0!) from sheet 1 and solve each of them separately by minimizing the objective in the same row.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Sub OptimizeDEPS&lt;br /&gt;
  Dim Solver as Object&lt;br /&gt;
  Set Solver = CreateUnoService(&amp;quot;com.sun.star.comp.Calc.NLPSolver.DEPSSolverImpl&amp;quot;)&lt;br /&gt;
  Solver.Document = ThisComponent&lt;br /&gt;
  Solver.Maximize = false&lt;br /&gt;
  &lt;br /&gt;
  Dim ObjectiveCell as new com.sun.star.table.CellAddress&lt;br /&gt;
  ObjectiveCell.Sheet = 0&lt;br /&gt;
  ObjectiveCell.Column = 10&lt;br /&gt;
  &lt;br /&gt;
  Dim VariableCells(0) as new com.sun.star.table.CellAddress&lt;br /&gt;
  VariableCells(0).Sheet = 0&lt;br /&gt;
  VariableCells(0).Column = 2&lt;br /&gt;
  &lt;br /&gt;
  For TargetRow = 4 To 299&lt;br /&gt;
    ObjectiveCell.Row = TargetRow&lt;br /&gt;
    VariableCells(0).Row = TargetRow&lt;br /&gt;
    Solver.Objective = ObjectiveCell&lt;br /&gt;
    Solver.Variables = VariableCells&lt;br /&gt;
    Solver.solve&lt;br /&gt;
  Next&lt;br /&gt;
  &lt;br /&gt;
  MsgBox &amp;quot;Done.&amp;quot;&lt;br /&gt;
End Sub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== License and Disclaimer ==&lt;br /&gt;
&lt;br /&gt;
This extension has been developed at &amp;#039;&amp;#039;&amp;#039;Sun Microsystems Inc.&amp;#039;&amp;#039;&amp;#039; and is licensed under the terms of the [http://www.openoffice.org/license.html GNU Lesser General Public License version 3].&lt;br /&gt;
&lt;br /&gt;
Research and implementation of DEPS and SCO have been done by &amp;#039;&amp;#039;&amp;#039;Xiao-Feng Xie&amp;#039;&amp;#039;&amp;#039; of [http://www.adaptivebox.net/research/ adaptivebox.net]. Both were modified and applied to the needs of the OpenOffice.org Solver by Andreas Schneider for Sun Microsystems, Inc.&lt;/div&gt;</summary>
		<author><name>Aksdb</name></author>
	</entry>
</feed>