This is a static copy of a profile report

Home

legacy (1 call, 91.188 sec)
Generated 15-Mar-2007 12:01:40 using real time.
M-function in file c:\mind07\legacy.m
[Copy to new window for comparing multiple runs]

Parents (calling functions)
No parent
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
10
prepare_system
121.156 s23.2%
282
[content,connector]=think1;
14.969 s5.4%
18
[content,connector]=think3(num...
14.656 s5.1%
139
[i,h,omega,found]=find_open_do...
63.031 s3.3%
150
see_mind(content,connector,num...
52.922 s3.2%
Other lines & overhead  54.453 s59.7%
Totals  91.188 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
prepare_systemM-function121.156 s23.2%
see_mindM-function2615.703 s17.2%
delete_generator_connections_2M-function2412.203 s13.4%
add_generator_up_QM-function189.172 s10.1%
think1M-function14.969 s5.4%
think3M-function14.641 s5.1%
find_open_down_bondM-function94.438 s4.9%
add_generator_newM-function63.047 s3.3%
see_mind_domM-function42.250 s2.5%
see_mind_picM-function21.703 s1.9%
delete_generator_connectionsM-function31.469 s1.6%
connect_down_bondM-function51.063 s1.2%
menuM-function50.859 s0.9%
get_gs_in_modM-function10.516 s0.6%
closeM-function280.438 s0.5%
blinktxtM-function20.250 s0.3%
get_top_2ideasM-function10.156 s0.2%
ismemberM-function2830.047 s0.1%
clfM-function10.031 s0.0%
etimeM-function40.016 s0.0%
set_gs_in_modsM-function110.016 s0.0%
dom_thoughtM-function30.016 s0.0%
get_levelsM-function10.016 s0.0%
selectM-function60 s0%
holdM-function60 s0%
timercbM-function160 s0%
axisM-function100 s0%
num2strM-function40 s0%
Self time (built-ins, overhead, etc.)  7.016 s7.7%
Totals  91.188 s100% 
M-Lint results
Line numberMessage
9The variable 'G' can apparently be used before it is defined.
14Use of brackets [] is unnecessary. Use parentheses to group, if needed.
22The variable 'g_mod' can apparently be used before it is defined.
38The variable 'CREATION' can apparently be used before it is defined.
67Use of brackets [] is unnecessary. Use parentheses to group, if needed.
69END or Colon is apparently used to index a non-array.
75Variable 'THEMES' is used, but apparently is never set.
76The variable 'gs_in_mod' can apparently be used before it is defined.
77Array 'Q' might be grown using indexing. Consider preallocating for speed.
96Use of brackets [] is unnecessary. Use parentheses to group, if needed.
171IF may not be aligned with its matching END (line 184).
181Terminate statement with semicolon to suppress output.
227The value assigned here to variable 'Y' might never be used.
236Use && instead of & as the AND operator in (scalar) conditional statements.
266The value assigned here to variable 'Q' might never be used.
266The variable 'A' can apparently be used before it is defined.
266The value assigned here to variable 'A' might never be used.
267The value assigned here to variable 'gs_in_mod' might never be used.
272The value assigned here to variable 'L1' might never be used.
272The value assigned here to variable 'L2' might never be used.
272The value assigned here to variable 'L3' might never be used.
272The value assigned here to variable 'L4' might never be used.
283Terminate statement with semicolon to suppress output.
300Terminate statement with semicolon to suppress output.
308Terminate statement with semicolon to suppress output.
313Terminate statement with semicolon to suppress output.
323The value assigned here to variable 'Q' might never be used.
323The value assigned here to variable 'A' might never be used.
328Use of brackets [] is unnecessary. Use parentheses to group, if needed.
Coverage results
[ Show coverage for parent directory ]
Total lines in file331
Non-code lines (comments, blank lines)55
Code lines (lines that can run)276
Code lines that did run213
Code lines that did not run63
Coverage (did run/can run)77.17 %
Function listing
   time   calls  line
1 function legacy
2 %preserves "mind" for posterity
3 %creates complete "thought" and displays 2-idea if there is one in thought
4 %set seed for randomness
1 5 rand('state',sum(100*clock));
0.55 1 6 load c:\mind_data06
1 7 clear content connector number i1 i2 i1s i2s i3s i4s h1 h2
0.86 1 8 save c:\mind_data06
1 9 r=size(G);r=r(2);
21.16 1 10 prepare_system
11
12
13
0.41 1 14 duration=menu(['HOW MANY MINUTES OF CONTINUOUS THOUGHT ? '],'1','2','5','10');vec=[1 2 5 10];
< 0.01 1 15 duration=vec(duration)*60;
1 16 t0=clock;number_old=select(ones(1,11)./11);
< 0.01 1 17 number=number_old;
4.66 1 18 [content,connector]=think3(number);
19
20 %is there a 2-idea?
1 21 cont=content(:,2);
1 22 mods=g_mod(cont);
1 23 gs= ismember(mods,325);
1 24 if any(gs)
0.64 1 25 see_mind(content,connector,number)
1 26 hold on
0.27 1 27 blinktxt(.6,.7,'NOTE ABSTRACT IDEA')
1 28 hold on
1 29 pause(4)
0.05 1 30 figure('Units','Normalized','Position',[0 0 1 1])
1 31 axis off
0.14 1 32 a=menu('ANALYZE IDEA ?','YES','NO');
1 33 if a==1
34 close all
35 ind=find(gs);idea_generator=cont(ind(1));idea_generator=G(idea_generator);
36 idea_name=idea_generator.name;
37 idea_number=name_2_number(idea_name);
38 idea_content=CREATION{1,idea_number,1};idea_connector=CREATION{1,idea_number,2};
39 see_mind(idea_content,idea_connector,number)
40 N=radix2num(idea_content(:,2),r);
41 text(.1,.7,['IDEA WITH GOEDEL NUMBER ',num2str(N)],'FontSize',25,'Color','b')
42 pause(5)
43 end
44 %close all
0.05 1 45 figure('Units','Normalized','Position',[0 0 1 1])
0.11 1 46 b=menu('APPLY ABSTRACTION OPERATOR TO IDEA ?','YES','NO');
1 47 if b==1
48 see_mind_mod(idea_content,idea_connector,number)
49 pause(3)
1 50 else
1 51 end
1 52 end
53
0.02 1 54 while etime(clock,t0)<duration;
< 0.01 3 55 change=rand(1)<.1;
3 56 if change
1 57 number=select(ones(1,11)./11);
58
< 0.01 2 59 elseif ~change
< 0.01 2 60 number=number_old;
< 0.01 2 61 end
62
3 63 if ~(number==number_old)
0.13 1 64 figure('Units','Normalized','Position',[0 0 1 1])
1 65 axis off
0.05 1 66 clf
1 67 text(.01, .5,['MIND TRAJECTORY CHANGES DIRECTION'],'FontSize',26,'Color','r')
1 68 axis off
1 69 text(.01, .3,['TO THEME ',THEME_names(number,:)],'FontSize',26,'Color','r')
1 70 axis off
0.03 1 71 pause(1)
2 72 else
2 73 end
0.08 3 74 close all
3 75 theme=THEMES{1,number,:};
3 76 gs=set_gs_in_mods(theme,gs_in_mod);content=[];connector=[];
3 77 Q(gs)=100000;Q_theme=Q;
78
1.52 3 79 [content,connector]=add_generator_up_Q(content,connector,theme);
1.55 3 80 [content,connector]=add_generator_new(content,connector,Q_theme);
1.53 3 81 [content,connector]=delete_generator_connections_2(content,connector);
1.58 3 82 [content,connector]=add_generator_up_Q(content,connector,theme);
1.53 3 83 [content,connector]=delete_generator_connections_2(content,connector);
1.55 3 84 [content,connector]=delete_generator_connections_2(content,connector);
0.31 3 85 pause(1)
3 86 close all
< 0.01 3 87 w=[];
3 88 if isempty(content)
3 89 else
3 90 v=content(:,2);n_v=length(v);
< 0.01 3 91 k=1:n_v;
3 92 g=G(v(k));
3 93 w=[w,g.level];
3 94 if all(ismember(w,1))
0.14 3 95 figure('Units','Normalized','Position',[0 0 1 1])
3 96 text(.2,.1 ,['STOP THINKING! NO ASSOCIATIONS!'],'Color','r','FontSize',20)
3 97 axis off
0.14 3 98 pause(1)
3 99 end
3 100 end
101 %is any down bond open?
< 0.01 3 102 found=1;
3 103 while found==1
1.50 3 104 [i,h,omega,found]=find_open_down_bond(content,connector);
3 105 if found==0
1.72 3 106 see_mind(content,connector,number)
0.22 3 107 pause(1)
0.05 3 108 close all
109 %return here?
110 else
111 gs=set_gs_in_mods(theme,gs_in_mod);%content=[];connector=[];
112 Q(gs)=100000;Q_theme=Q;
113 [content,connector,found]=connect_down_bond(content,connector, i,h,omega,Q_theme);
114 see_mind(content,connector,number)
115 pause(1)
116 end
117
3 118 end
1.95 3 119 see_mind(content,connector,number);
0.19 3 120 pause(1.6)
0.02 3 121 close all
0.02 3 122 gs=set_gs_in_mods(theme,gs_in_mod);content=[];connector=[];
3 123 Q(gs)=100000;Q_theme=Q;
1.52 3 124 [content,connector]=delete_generator_connections_2(content,connector);
1.56 3 125 [content,connector]=add_generator_up_Q(content,connector,theme);
1.53 3 126 [content,connector]=add_generator_new(content,connector,Q_theme);
1.55 3 127 [content,connector]=add_generator_up_Q(content,connector,theme);
1.56 3 128 [content,connector]=add_generator_up_Q(content,connector,theme);
1.55 3 129 [content,connector]=delete_generator_connections_2(content,connector);
2.08 3 130 see_mind(content,connector,number);
131
0.16 3 132 pause(1.6)
1.50 3 133 [content,connector]=delete_generator_connections_2(content,connector);
1.53 3 134 [content,connector]=add_generator_up_Q(content,connector,theme);
1.56 3 135 [content,connector]=delete_generator_connections_2(content,connector);
136 %is any down bond open?
< 0.01 3 137 found=1;
3 138 while found==1
3.03 6 139 [i,h,omega,found]=find_open_down_bond(content,connector);
6 140 if found==0
0.56 1 141 see_mind(content,connector,number)
0.03 1 142 pause(1)
0.02 1 143 close all
144 %return %???????????????????????????????
5 145 else
5 146 gs=set_gs_in_mods(theme,gs_in_mod);%content=[];connector=[];
5 147 Q(gs)=100000;Q_theme=Q;
1.08 5 148 [content,connector,found]=connect_down_bond(content,connector, i,h,omega,...
149 Q_theme);
2.92 5 150 see_mind(content,connector,number)
151
0.25 5 152 pause(1)
5 153 end
154
6 155 end
156
157
158
159
1.78 3 160 see_mind(content,connector,number);
0.16 3 161 pause(1.6)
1.50 3 162 [content,connector]=delete_generator_connections(content,connector);
163
1.73 3 164 see_mind(content,connector,number);
0.17 3 165 pause(2)
0.02 3 166 close
1.56 3 167 delete_generator_connections_2(content,connector);
0.03 3 168 [content,connector]=dom_thought(content,connector);
1.77 3 169 see_mind_dom(content,connector);
0.11 3 170 pause(3)
3 171 if ~isempty(content)
172
173 %display picture?
2 174 PIX_n=size(PIX);PIX_n=PIX_n(2);
2 175 dis=zeros(1,PIX_n);
2 176 for k=1:PIX_n
0.05 278 177 if any(ismember(PIX(k).g_numbers,content(:,2)))
< 0.01 4 178 dis(k)=1;
4 179 end
278 180 end
< 0.01 2 181 dis
1.73 2 182 see_mind_pic(content,connector,dis)
1 183 else
1 184 end
185 %end
< 0.01 1 186 number_old=number;
0.17 3 187 close all
3 188 end
189
1 190 if rand(1)<1
1 191 for repeat=1:3
< 0.01 3 192 n_ideas=size(CREATION);n_ideas=n_ideas(2);
3 193 v=1:n_ideas;v=v./sum(v);
3 194 id_number=select(v);
3 195 content2=CREATION{1,id_number,1};
3 196 if isempty(content2)
197 return
198 end
3 199 connector2=CREATION{1,id_number,2};
< 0.01 2 200 number1=12;
1.95 3 201 see_mind(content2,connector2,number1)
3 202 text(.4,.5,['idea ',num2str(id_number)],'FontSize',32)
0.20 3 203 pause(5)
0.02 3 204 close all
3 205 end
1 206 end
207
208 %if isempty(content)
209 %now detect top_2ideas
< 0.01 1 210 content1=[];connector1=[];
0.16 1 211 [top_2ideas_g,top_2ideas_h]=get_top_2ideas(content,connector); %these are the top_2ideas
< 0.01 1 212 n_ideas=length(top_2ideas_g);
213
1 214 if n_ideas ==0
0.05 1 215 figure('Units','Normalized','Position',[0 0 1 1])
1 216 axis off
0.03 1 217 text(.2,.8,'No Conscious Thought','FontSize',32)
0.05 1 218 pause(1)
1 219 close
220 else
221
222 ns=1:n_ideas;
223
224 for t=1:n_ideas
225 gs=top_2ideas_g{1,t,:}; ns(t)=length(gs);
226 end
227 [Y,I]=max(ns);
228 m=I(1);
229 hs=top_2ideas_h{1,m,:};gs=top_2ideas_g{1,m,:};
230 content1(:,1)=hs';content1(:,2)=gs';n=length(hs);connector1=[];
231 for k1=1:n
232 for k2=1:n
233 for j=1:3
234 h1=hs(k1);h2=hs(k2);g1=gs(k1);g2=gs(k2);
235 segment=(connector(:,1)==h1)&(connector(:,2)==h2)&(connector(:,3)==j);
236 if any(segment)&(g1~=g2)
237 connector1=[connector1;[h1,h2,j]];
238 else
239 end
240 end
241 end
242 end
243 end
244
245
246
247
248
249
250 %display conscious thought
1 251 close all
252
0.52 1 253 see_mind_dom(content1,connector1)
0.06 1 254 pause(3)
1 255 close all
256 %add new idea to "G"
0.53 1 257 load c:\mind_data06
1 258 r=length(G);n_new_ideas=length(gs_in_mod{325});%note numbering of "new ideas " modality
1 259 G(r+1).name=['idea',num2str(n_new_ideas+1)];
1 260 G(r+1).level=1;
1 261 G(r+1).modality=325;
1 262 g_mod=[g_mod,325];x=size(CREATION);
< 0.01 1 263 n_new_idea=x(2);
1 264 CREATION{1,n_new_idea+1,1}=content1;
0.02 1 265 CREATION{1,n_new_idea+1,2}=connector1;
0.05 1 266 Q=[Q,1];A_new=zeros(r+1);A_new(1:r,1:r)=A;A_new(r+1,:)=ones(1,r+1);A_new(:,r+1)=ones(r+1,1);A=A_new;
0.52 1 267 gs_in_mod=get_gs_in_mod;
0.06 1 268 figure('Units','Normalized','Position',[0 0 1 1])
1 269 axis off
1 270 text(.2,.8,'New Idea Created !','FontSize',32)
0.03 1 271 pause(1)
0.02 1 272 [L1,L2,L3,L4]=get_levels(G);
1 273 clear content connector omega genre theme dis
1 274 clear content1 connector1 number number_old h1 h2
0.94 1 275 save c:\mind_data06
1 276 close all
277
278
279 %end insert
280
281
4.97 1 282 [content,connector]=think1;
1 283 number_old=select(ones(1,11)./11);number=number_old
284 %number=4;CHANGE!!!!!!!!!!!!!!!!!!
0.55 1 285 load('c:\mind_data06')
1 286 hold on
287 %is there a 2-idea?
1 288 cont=content(:,2);
1 289 mods=g_mod(cont);
1 290 gs= ismember(mods,325);
1 291 if any(gs)
0.59 1 292 see_mind(content,connector,number)
1 293 hold on
0.05 1 294 blinktxt(.6,.7,'NOTE ABSTRACT IDEA')
1 295 hold on
0.03 1 296 pause(4)
0.05 1 297 figure('Units','Normalized','Position',[0 0 1 1])
1 298 axis off
1 299 hold off
0.11 1 300 a=menu('ANALYZE IDEA ?','YES','NO')
1 301 if a==1
302 close all
303 ind=find(gs);idea_generator=cont(ind(1));idea_generator=G(idea_generator);
304 idea_name=idea_generator.name;
305 number=name_2_number(idea_name);
306 idea_content=CREATION{1,number,1};idea_connector=CREATION{1,number,2};
307 see_mind(idea_content,idea_connector,number)
308 N=radix2num(idea_content(:,2),r)
309 text(.1,.7,['IDEA WITH GOEDEL NUMBER ',num2str(N)],'FontSize',30,'Color','b')
310 pause(5)
311 end
0.08 1 312 close all
0.13 1 313 b=menu('APPLY ABSTRACTION OPERATOR TO IDEA ?','YES','NO')
1 314 if b==1
315 see_mind_mod(idea_content,idea_connector,number)
316 pause(5)
< 0.01 1 317 elseif b==2
318
< 0.01 1 319 end
1 320 end
1 321 c=clock;c=rem(c(5),5);
1 322 if c ==0
323 [Q,A]=memory(content,connector);
324 close all
325 clf
326 figure('Units','Normalized','Position',[0 0 1 1])
327 axis off
328 text(.2, .2, ['STRENGTH OF MIND LINKAGES UPDATED'],'Fontsize',20','Color','b')
329 pause(3)
330 end
1 331 close all