Code covered by the BSD License
-
displayoptimizationhistory(va...
DISPLAYOPTIMIZATIONHISTORY Display optimization history.
-
chompsep(str)
CHOMPSEP Remove file separator at end of string.
-
computenewpopulation(pop, bes...
COMPUTENEWPOPULATION Compute competing population of parameter vectors.
-
concatpath(varargin)
CONCATPATH Concatenate file parts with correct file separator.
-
datenum2.m
-
deletewithsemaphores(fileList...
DELETEWITHSEMAPHORES Delete files using semaphors.
-
demo1
DEMO1 Demo for usage of DIFFERENTIALEVOLUTION.
-
demo2
DEMO2 Demo for usage of DIFFERENTIALEVOLUTION.
-
demo3
DEMO3 Demo for usage of DIFFERENTIALEVOLUTION.
-
differentialevolution(...
DIFFERENTIALEVOLUTION Start Differential Evolution optimization.
-
differentialevolutionslave(sl...
DIFFERENTIALEVOLUTIONSLAVE Start differential evolution slave process.
-
displayerrorstruct(errorStruc...
DISPLAYERRORSTRUCT Display structure returned by function lasterror.
-
existfile(fileName)
EXISTFILE Check for file existence.
-
findfiles(varargin)
FINDFILES Recursively search directory for files.
-
formattime(time, mode)
FORMATTIME Return formatted time string.
-
foxholes(x, noPause)
FOXHOLES Evaluate Shekel's Foxholes function.
-
getdefaultparams
GETDEFAULTPARAMS Get default parameters for differential evolution.
-
gethostname
GETHOSTNAME Get host name.
-
getusername
GETUSERNAME Get user name.
-
mbdatevec(n)
MBDATEVEC Return date vector for time in format as of function MBTIME.
-
mbtime
MBTIME Return serial date number converted to seconds
-
quantile2(x, p, dim)
QUANTILE2 Compute quantiles of a data sample.
-
removefilesemaphore(semaphore...
REMOVEFILESEMAPHORE Remove semaphore after file access.
-
rosenbrocksaddle(scale, param...
ROSENBROCKSADDLE Standard optimization function for demonstration.
-
selectfigure(figureTag, varar...
SELECTFIGURE Select figure by user-defined tag.
-
sendmailblat(subject, body, v...
SENDMAILBLAT Send E-mail using the Windows executable BLAT.EXE.
-
setfilesemaphore(fileList)
SETFILESEMAPHORE Set semaphore for file access.
-
tempdir2
TEMPDIR2 Return temporary directory.
-
textwrap2(stringIn, nOfColumn...
TEXTWRAP2 Wrap text string.
-
translatedatestr.m
-
differentialevolution
-
differentialevolution-faq
-
View all files
from
Differential Evolution
by Markus Buehren
Optimization using the evolutionary algorithm of Differential Evolution.
|
| removefilesemaphore(semaphore)
|
function removefilesemaphore(semaphore)
%REMOVEFILESEMAPHORE Remove semaphore after file access.
% REMOVEFILESEMAPHORE(SEMAPHORE) removes the semaphore(s) set by function
% SETFILESEMAPHORE to allow file access for other Matlab processes.
%
% Example:
% sem = setfilesemaphore('test.mat');
% % access file test.mat here
% dir test.mat.semaphore.*
% removefilesemaphore(sem);
%
% Markus Buehren
% Last modified 21.12.2008
%
% See also SETFILESEMAPHORE.
checkWaitTime = 0.1;
% remove semaphore files
for fileNr = 1:length(semaphore)
if existfile(semaphore{fileNr})
% do not use function deletewithsemaphores.m here!
% sometimes deletion permission is not given, so try several times to
% delete the file
warnID = 'MATLAB:DELETE:Permission';
warnState = warning('query', warnID);
warning('off', warnID);
fileDeleted = false;
for attemptNr = 1:10
lastwarn('');
try
delete(semaphore{fileNr}); %% file access %%
if isempty(lastwarn)
fileDeleted = true;
break
end
catch
% wait before checking again
pause(checkWaitTime);
end
end
warning(warnState);
if ~fileDeleted
% try one last time with display of warning message
delete(semaphore{fileNr});
end
end
end
|
|
Contact us at files@mathworks.com