Skip to content

Replaces the "callOutputAndPlotFcns" in the simplex with the new plot events#173

Merged
DrPaulSharp merged 3 commits intoRascalSoftware:masterfrom
StephenNneji:use_events_in_simplex
Nov 28, 2023
Merged

Replaces the "callOutputAndPlotFcns" in the simplex with the new plot events#173
DrPaulSharp merged 3 commits intoRascalSoftware:masterfrom
StephenNneji:use_events_in_simplex

Conversation

@StephenNneji
Copy link
Copy Markdown
Collaborator

@StephenNneji StephenNneji commented Nov 22, 2023

callOutputAndPlotFcns is used 5 times in fMinSearch.m these have now been replaced with triggerEvents. Also adds a method hasPlotHandler so triggerEvent can check when a plothandler is present and exit early if not.

Also Fixes #168

@StephenNneji
Copy link
Copy Markdown
Collaborator Author

@arwelHughes I am concerned this could affect the speed significantly when plotting during optimization

problem = load('DSPCBilayerProjectClass.mat').thisProjectClass;

% Make a controls block
controls = controlsClass();
controls.parallel = parallelOptions.Points;
controls.procedure = procedures.Simplex;
controls.maxIter = 1;

figure(2); clf
eventManager.register(eventTypes.Plot, 'plotRefSLDHelper')
% eventManager.register(eventTypes.Message, 'disp')

[problem1, result1] = RAT(problem, controls);

eventManager.clear()

When running the example above, the times go from ~0.02 sec without plotting to ~1 sec with plotting. This time difference will grow with more iterations. Potential solutions

  • Reduce number of calls to plot from 5 to maybe 1
  • Speedup of plotRefSLDHelper since plot cannot be performed on another thread

@StephenNneji StephenNneji marked this pull request as ready for review November 28, 2023 11:29
@StephenNneji StephenNneji requested review from DrPaulSharp and removed request for DrPaulSharp November 28, 2023 11:29
@DrPaulSharp DrPaulSharp merged commit 18db474 into RascalSoftware:master Nov 28, 2023
@StephenNneji StephenNneji deleted the use_events_in_simplex branch May 9, 2024 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compile throws a warning in drawMultiNest.m

2 participants