Skip to content

Commit

Permalink
#1717 Allow enablingAutoReduceTolerances on sumulator options
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaperez1983 committed Feb 12, 2025
1 parent f1977d2 commit 4d23c9b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/OSPSuite.Core/Domain/Services/SimModelManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ private void simulate()
options.ShowProgress = true;
options.ExecutionTimeLimit = _executionTimeLimit;
options.CheckForNegativeValues = _simulationRunOptions.CheckForNegativeValues;
options.AutoReduceTolerances = _simulationRunOptions.AutoReduceTolerances;

try
{
Expand Down
5 changes: 5 additions & 0 deletions src/OSPSuite.Core/Domain/SimulationRunOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ public class SimulationRunOptions
/// </summary>
public bool CheckForNegativeValues { get; set; }

/// <summary>
/// Specifies whether auto reduce tolerance should be applied
/// </summary>
public bool AutoReduceTolerances { get; set; }

public SimulationRunOptions()
{
SimModelExportMode = SimModelExportMode.Full;
Expand Down
5 changes: 5 additions & 0 deletions src/OSPSuite.R/Domain/SimulationRunOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,10 @@ public class SimulationRunOptions : RunOptions
/// Specifies whether progress bar should be shown during simulation run. Default is <c>true</c>
/// </summary>
public bool ShowProgress { get; set; } = true;

/// <summary>
/// Specifies whether auto reduce tolerance should be applied
/// </summary>
public bool AutoReduceTolerances { get; set; }
}
}
3 changes: 2 additions & 1 deletion src/OSPSuite.R/Services/SimulationRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ private Core.Domain.SimulationRunOptions coreSimulationRunOptionsFrom(Simulation
return new Core.Domain.SimulationRunOptions
{
CheckForNegativeValues = options.CheckForNegativeValues,
SimModelExportMode = SimModelExportMode.Optimized
SimModelExportMode = SimModelExportMode.Optimized,
AutoReduceTolerances = options.AutoReduceTolerances
};
}

Expand Down

0 comments on commit 4d23c9b

Please sign in to comment.