-
Notifications
You must be signed in to change notification settings - Fork 2
/
rerunWoidlinoParamSamplesWithSweeping.m
34 lines (30 loc) · 1.44 KB
/
rerunWoidlinoParamSamplesWithSweeping.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
function [] = rerunWoidlinoParamSamplesWithSweeping(sampleCtr,r_feed)
% rerun parameter samples with sweeping
addpath('visualisation/')
filepath = '~/Dropbox/projects/collectiveBehaviour/sworm-model/results/woidlinos/paramSamples/PRW_4D_taxis_weighted_additive_r2/npr_1/';
thisfile = dir([filepath '*v0_0.33_*sample_' num2str(sampleCtr) '.mat']);
if exist([filepath thisfile.name],'file')
newfilename = [strrep(thisfile.name,'.mat','') '_sweeping_feedrate_' num2str(r_feed)];
if~exist(['movies/woidlinoMovies/paramSampleMovies/' ...
newfilename '.mp4'],'file')
load([filepath thisfile.name]);
% set parameters for sweeping simulation
param.r_feed = r_feed;
param.k_unroam = 10;
T = 5400;
param.saveEvery = round(2/param.dT);
% run simulation
[xyarray, currentState, food] = runWoids(T,N,M,L,param);
save(['results/woidlinos/paramSamples/sweeping/' newfilename '.mat'],...
'food','xyarray','T','N','M','L','param','currentState')
% make movie
animateWoidTrajectories(xyarray,['movies/woidlinoMovies/paramSampleMovies/' newfilename '.mp4'],...
L,0.035,food);
elseif exist(['movies/woidlinoMovies/paramSampleMovies/' ...
newfilename '.mp4'],'file')
disp(['sweeping movie already exists for ' thisfile.name])
end
elseif ~exist([filepath thisfile.name],'file')
disp(['no results for ' thisfile.name])
end
end