Quintiq file version 2.0
#parent: #root
Method RunInventoryEvalution (
  internal[GUIComponent] parent,
  DEPRECATED_InventoryOptimization algorithm_mp
) id:Method_DialogInventoryOptimization_RunInventoryEvalution
{
  #keys: '[138670.0.283610273]'
  Body:
  [*
    //Run inventory evaluation
    
    algorithm := shadow( algorithm_mp )
    Dialog.Data( algorithm );
    Dialog.SetDefaultValues();
    result := this.DoModal( parent );
    
    if( result > 0 )
    {
    // Parameters from user interface
    timelimit := GUIDurationSelectorTimeLimit.Duration();
    numberofsimulations := ApplicationLibMacroPlanner.FormatStringToNumber( EditorNumberOfSimulations.Text() );
    numberofperiodsinwindow := ApplicationLibMacroPlanner.FormatStringToNumber( EditorNumberOfPeriodsInWindow.Text() );
    strategy := SelectionStrategy.Data();
    
    // Get the last used optimizer settings. 
    run := MacroPlan.GetLastAlgorithmRun();
    overwritemanual := guard( run.HasOverwrittenManualPlanning(), false );
    
    // Set default values
    isrunonlyoneiteration := true;
    isselectbestiteration := true;
    isdeleteolditerations := false;
    isresetsimulations := false;
    
    // Call method for inventory optimization 
    MacroPlan.RunInventoryOptimization( timelimit, 
                                        isrunonlyoneiteration,
                                        isselectbestiteration,
                                        isdeleteolditerations,
                                        isresetsimulations,
                                        numberofsimulations,
                                        numberofperiodsinwindow,
                                        strategy,
                                        overwritemanual );
    }
  *]
}
