• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisãod93d2d4c5a8dc3b9544bbf0cbaf4ebdf93db0457 (tree)
Hora2010-01-12 08:02:47
Autorlorenzo
Commiterlorenzo

Mensagem de Log

Some minor modifications, mainly taking into account the need to use
weights=NA in the diameter calculation.

Mudança Sumário

Diff

diff -r d12496656c39 -r d93d2d4c5a8d Python-codes/iterate_addendum_infectitious_power2.py
--- a/Python-codes/iterate_addendum_infectitious_power2.py Mon Jan 11 14:22:35 2010 +0000
+++ b/Python-codes/iterate_addendum_infectitious_power2.py Mon Jan 11 23:02:47 2010 +0000
@@ -138,13 +138,22 @@
138138
139139 return [visit_arr,visit_flux,visit_arr_extended, my_black_overall]
140140
141-
141+#here boot_time is simply the dummy argument of a function, but I deal
142+#only with contact protocols
142143
143144 def generate_iteration_grid(boot_time_non_unique,\
144- number_intervals,interval_duration,ini_gap):
145+ number_intervals,interval_duration,t_ini,t_end):
145146 time_unique=s.unique1d(boot_time_non_unique)
146147
147- time_ini=time_unique[0]+ini_gap
148+ # time_ini=time_unique[0]+ini_gap
149+
150+
151+ if (t_ini>0):
152+ time_ini=t_ini
153+ else:
154+ time_ini=time_unique[0]
155+
156+
148157 print "time_ini is, ", time_ini
149158
150159 if (number_intervals<=0 and interval_duration<=0):
@@ -155,10 +164,18 @@
155164 print "Error in calling the function"
156165 #break
157166 if (number_intervals>0 and interval_duration<=0):
158- time_grid=s.linspace(time_ini,time_unique[-1],number_intervals)
167+ if (t_end<=0):
168+ time_grid=s.linspace(time_ini,time_unique[-1],number_intervals)
169+ elif (t_end>0):
170+ time_grid=s.linspace(time_ini,t_end,number_intervals)
171+
159172
160173 if (number_intervals<=0 and interval_duration>0):
161- time_grid=s.arange(time_ini,time_unique[-1],interval_duration)
174+ if (t_end<=0):
175+ time_grid=s.arange(time_ini,time_unique[-1],interval_duration)
176+ if (t_end>0):
177+ time_grid=s.arange(time_ini,t_end,interval_duration)
178+
162179
163180 return (time_grid.astype("int64"))
164181
@@ -201,13 +218,13 @@
201218
202219 boot_time_non_unique=data_arr[:,0]
203220
204-ini_gap=1240876800-1240092599 # 86400 #i.e. one day in seconds
205-
221+t_ini=1246233600
222+t_end=t_ini+86400*3+1
206223 number_intervals=-12
207224 interval_duration= 86400 #i.e. 1 day #604800 #i.e. one week in seconds
208225
209226 time_grid=generate_iteration_grid(boot_time_non_unique,\
210- (number_intervals+1),interval_duration,ini_gap)
227+ (number_intervals+1),interval_duration,t_ini,t_end)
211228
212229 print "len(time_grid) is, ", len(time_grid)
213230 print "time_grid[0] and time_grid[-1] are, ", time_grid[0], time_grid[-1]
diff -r d12496656c39 -r d93d2d4c5a8d R-codes/analyze_infected_networks.R
--- a/R-codes/analyze_infected_networks.R Mon Jan 11 14:22:35 2010 +0000
+++ b/R-codes/analyze_infected_networks.R Mon Jan 11 23:02:47 2010 +0000
@@ -43,7 +43,7 @@
4343
4444 number_networks <- length(visitor_list)
4545
46-time_period <- 31 #selected time_period I want to look at
46+time_period <- 2 #selected time_period I want to look at
4747
4848 infected_diam <- seq(length(time_period))
4949 infected_mean_degree<- seq(length(time_period))
@@ -71,7 +71,7 @@
7171
7272 g_infected <- simplify(g_infected)
7373
74-infected_diam[i+1] <- length(get.diameter(g_infected))-1
74+infected_diam[i+1] <- length(get.diameter(g_infected,weights=NA))-1
7575 infected_mean_degree[i+1] <- mean(degree(g_infected))
7676
7777
@@ -83,7 +83,7 @@
8383
8484 g_after_infection <- simplify(g_after_infection)
8585
86-diam_after_infection[i+1] <- length(get.diameter(g_after_infection))-1
86+diam_after_infection[i+1] <- length(get.diameter(g_after_infection,weights=NA))-1
8787
8888 mean_degree_after_infection[i+1] <- mean(degree(g_after_infection))
8989