Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/fieldsend/mo_lons
Browse files Browse the repository at this point in the history
  • Loading branch information
fieldsend committed May 10, 2019
2 parents 57e4319 + 12d40ff commit 60b2509
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 34 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Note codebase is illustrative of proceedures and not optimised for speed!

FUNCTION OVERVIEW

regenerate_GECCO_2019_plots.m --- scriptwill regenerate all the PLON, DNON and PLOS-net plots from the paper
generate_GECCO_2019_plots.m --- script will regenerate all the PLON, DNON and PLOS-net plots from the paper

gecco_workshop_2019_problem1.m, gecco_workshop_2019_problem2.m and gecco_workshop_2019_problem3.m --- cost functions used in illustrations in the paper. The last takes an argument holding the grid for each objective (this data is stored in the two .mat files loaded in regenerate_GECCO_2019_plots.m).

Expand Down
9 changes: 9 additions & 0 deletions gecco_workshop_2019_problem1.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
function y = gecco_workshop_2019_problem1(x,S)

% y = gecco_workshop_2019_problem1(x,S)
%
% First simple illustrative problem used in GECCO 2019 paper.
%
% Jonathan Fieldsend, University of Exeter, 2019
% See license information in package, available at
% https://github.com/fieldsend/mo_lons


if (sum(x<=0)>0)
error('input variable cannot be negative');
end
Expand Down
9 changes: 9 additions & 0 deletions gecco_workshop_2019_problem2.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
function y = gecco_workshop_2019_problem1(x,S)

% y = gecco_workshop_2019_problem1(x,S)
%
% Second simple illustrative problem used in GECCO 2019 paper.
%
% Jonathan Fieldsend, University of Exeter, 2019
% See license information in package, available at
% https://github.com/fieldsend/mo_lons


if (sum(x<=0)>0)
error('input variable cannot be negative');
end
Expand Down
12 changes: 10 additions & 2 deletions gecco_workshop_2019_problem3.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
function y = gecco_workshop_2019_problem3(x,S)

% y = gecco_workshop_2019_problem1(x,S)
%
% Many-objective illustrative problem used in GECCO
% 2019 paper. S contains extra data needed by the
% different problem versions, available in the repository
%
% Jonathan Fieldsend, University of Exeter, 2019
% See license information in package, available at
% https://github.com/fieldsend/mo_lons

if (sum(x<=0)>0)
error('input variable cannot be negative');
end
Expand All @@ -18,5 +28,3 @@
y(5) = S.F5(x(1),x(2));




24 changes: 11 additions & 13 deletions plot_PLOS_net.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
function [DNO] = plot_PLOS_net(X,Y,state,neighbours,edge_weight,node_weight)

% [DNO] = plot_PLOS_net(X,Y,state,neighbours,edge_weight,node_weight)
%
% Function plots the PLOS-net for the given parameters, outputted from the
% exaustive_generate_lon function. See e.g. generate_GECCO_2019_plots for
% example usage.
%
% Jonathan Fieldsend, University of Exeter, 2019
% See license information in package, available at
% https://github.com/fieldsend/mo_lons


[~,k] = size(Y);

% function plots the PLOS-net for the given inputs
Expand Down Expand Up @@ -57,20 +68,7 @@
highlight(H,i,'MarkerSize',node_weight,'NodeColor',0.1+abs(ones(1,3)*(Y(DNO(i),k)-min_y)/(max_y-min_y)-1)*0.5);
end


% if min_y==max_y
% for i=1:length(basin_size)
% highlight(H,i,'MarkerSize',node_weight*basin_size(i)/sum(basin_size),'NodeColor',[0 0 0]);
% end
% else
% for i=1:length(basin_size)
% highlight(H,i,'MarkerSize',node_weight*basin_size(i)/sum(basin_size),'NodeColor',0.1+abs(ones(1,3)*(Q(i)-min_y)/(max_y-min_y)-1)*0.5);
% end
% end
set(gca,'YTick',[])
set(gca,'XTick',[])




end
13 changes: 11 additions & 2 deletions process_d_lon.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
function [V,B,EE,C,PO] = process_d_lon(X,Y,w,YY,state, neighbours)


% [V,B,EE,C,PO] = process_d_lon(X,Y,w,YY,state, neighbours)
%
% Processes data outputted from exaustive_generate_lon to create
% the matrices needed to plot the DNON
%
% see generate_GECCO_2019_plots for example usage
%
% state holds destination of all walks from the index

%
% Jonathan Fieldsend, University of Exeter, 2019
% See license information in package, available at
% https://github.com/fieldsend/mo_lons

V=cell(1,1);
v_index=1;
Expand Down
30 changes: 14 additions & 16 deletions process_p_lon.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
function [V,B,Adj,EE,C] = process_p_lon(X,Y,state,neighbours)

% [V,B,EE,C,PO] = process_p_lon(X,Y,w,YY,state, neighbours)
%
% Processes data outputted from exaustive_generate_lon to create
% the matrices needed to plot the PLON
%
% see generate_GECCO_2019_plots for example usage
%
% state holds destination of the walk from the index
%
% Jonathan Fieldsend, University of Exeter, 2019
% See license information in package, available at
% https://github.com/fieldsend/mo_lons

min_state = cell(0);
for j=1:length(state)
Expand Down Expand Up @@ -60,24 +72,13 @@
Z(j) = 1;
end
end
%if length(K)==length(V{j}) %if V{j} is a subset of state{i}
% B(j) = B(j)+1;
% Z(j) = 1;
%end

end
% now increase weight between vertices which all have path from ith
Adj(Z==1,index) = Adj(Z==1,index)+1;
% for j=1:length(V)
% if (Z(j)==true)
% Adj(j,Z==1) = Adj(j,Z==1) + 1;
% Adj(Z==1,j) = Adj(Z==1,j) + 1;
% end
% end

end

%for j=1:length(V)
% Adj(j,j) = length(V{j});
%end

% now colour each vertex

Expand Down Expand Up @@ -106,9 +107,6 @@






% add esacpe edges to links
EE = zeros(length(B)); % matrix of edges between basins, filled with zeros initially
for i=1:length(B) % process each vertex
Expand Down

0 comments on commit 60b2509

Please sign in to comment.