if 1
clear all; close all; clc;
%load the relevant processed network workspace:
L = 50; W = 50; ff = 0.06; % L,W are system dimensions. For archaic reasons (that you don't need to worry about), they are in units of HALF \ell, the unit of distance used in the paper. So set them to TWICE the value you want in units of \ell. ff is the fill factor, called 'f' in the paper. The definition of this parameter is the same as in the paper, so it is easy to set.

count = 1; % noise realisation label
folder = strcat('L',int2str(L),'W',int2str(W),'ff',num2str(ff),'P');
folder = strrep(folder,'.','_');
cd SimCity; % pick folder
cd(folder);
load(strcat('wrkspc',int2str(count),'.mat'));
cd ../..
end

% or you can skip the loading above if it's already in your workspace
figure; hold on; grid on;
% plot the valley network
for k=1:length(C)
    traj = C{k,1};    
    plot3(traj(1,:),traj(2,:),traj(3,:),'b.');
    traj = C{k,2};    
    plot3(traj(1,:),traj(2,:),traj(3,:),'r.');
end
% add domain labels for easy visualisation
for k=1:size(maxima,1)
    plot(maxima(k,1),maxima(k,2),'ko');
    text(maxima(k,1),maxima(k,2),strcat('\leftarrow ',int2str(k)),'FontSize',20);
end


