Changeset - ef14718be3e4
[Not reviewed]
0 3 0
Tom Bannink - 8 years ago 2017-08-14 23:24:28
tombannink@gmail.com
Update CCM time evol plots
3 files changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
plots/timeevol_ccm.pdf
Show inline comments
 
binary diff not shown
plots/timeevol_ccm_log.pdf
Show inline comments
 
binary diff not shown
triangle_ccm_timeevol_plots.m
Show inline comments
 
(* ::Package:: *)
 

	
 
Needs["ErrorBarPlots`"]
 

	
 

	
 
(* ::Section:: *)
 
(*Plot successrate over time*)
 

	
 

	
 
gsraw=Import[NotebookDirectory[]<>"data/graphdata_ccm_timeevol_canonical.m"];
 
gsraw=Import[NotebookDirectory[]<>"data/graphdata_ccm_timeevol.m"];
 
(* gsraw=SortBy[gsraw,{#[[1,1]]&,#[[1,2]]&}]; (* Sort by n and then by tau. The {} forces a *stable* sort because otherwise Mathematica sorts also on triangle count and other things. *) *)
 

	
 

	
 
gdata=GatherBy[gsraw,{#[[1,2]]&,#[[1,1]]&}];
 
(* Data format: *)
 
(* gdata[[ tau index, n index, run index , datatype index ]] *)
 
(* datatype index:
 
1: {n,tau}
 
2: edges
 
3: HH tri seq
 
4: {ccm1 #failed-attempts, ccm1 seq}
 
5: {ccm2 #failed-attempts, ccm2 seq}
 
*)
 
nlabels=Map["n = "<>ToString[#]&,gdata[[1,All,1,1,1]]];
 
taulabels=Map["\[Tau] = "<>ToString[#]&,gdata[[All,1,1,1,2]]];
 

	
 

	
 
(* ::Subsection:: *)
 
(*Canonical dataset (old code for multiple ccm runs per run)*)
 

	
 

	
 
(* For export *)
 
selectedRun=gdata[[1,1,1]];
 
measureSkip=1;
 
numEdges=selectedRun[[2]];
 
maxTris=Max[selectedRun[[3]]];
 
maxTime=Length[selectedRun[[3]]];
 
avgTris=Mean[selectedRun[[3,-maxTime/2;;-1]]];
 
skipPts=Max[1,Round[maxTime/500]]; (* Plotting every point is slow. Plot only once per `skipPts` timesteps *)
 

	
 
getCourseData[array_]:=Map[Mean,Partition[array,skipPts]];
 
coarseData=getCourseData[selectedRun[[3]]];
 
fullData=selectedRun[[3]];
 

	
 
shiftedCCMdata[offset_,data_]:=If[Length[data]==0,Nothing,
 
MapIndexed[{offset+(First[#2]-1)*skipPts,Mean[#1]}&,Partition[data,skipPts]]
 
];
 
coarseDatasCCM1=MapIndexed[shiftedCCMdata[numEdges*(First[#2]-1),#1]&,selectedRun[[4]]];
 
coarseDatasCCM2=MapIndexed[shiftedCCMdata[numEdges*(First[#2]-1),#1]&,selectedRun[[5]]];
 

	
 
getStartPoint[offset_,data_]:=If[Length[data]==0,
 
{Red,Point[{offset,10}]},
 
{Black,Point[{offset,data[[1]]}]}
 
];
 
startPoints1=MapIndexed[getStartPoint[numEdges*(First[#2]-1),#1]&,selectedRun[[4]]];
 

	
 
plotlabel="n = "<>ToString[selectedRun[[1,1]]]<>", \[Tau] = "<>ToString[selectedRun[[1,2]]];
 

	
0 comments (0 inline, 0 general)