Skip to content
Snippets Groups Projects
Commit 9dd2fab3 authored by Renato Melo's avatar Renato Melo
Browse files

preprarando simulação

parent f7fad9b5
No related branches found
No related tags found
No related merge requests found
...@@ -186,7 +186,7 @@ public class DirectedSocialNetwork extends ...@@ -186,7 +186,7 @@ public class DirectedSocialNetwork extends
public double espectedSpread(HashSet<Actor> seed, boolean ic) { public double espectedSpread(HashSet<Actor> seed, boolean ic) {
double media = 0; double media = 0;
int soma = 0; int soma = 0;
int repeticoes = 100; int repeticoes = 10000;
if (!ic) { if (!ic) {
HashSet<Actor> ativados = linearThresholdDiffusion(seed); HashSet<Actor> ativados = linearThresholdDiffusion(seed);
......
...@@ -25,9 +25,9 @@ public class MeuPlot extends JGnuplot { ...@@ -25,9 +25,9 @@ public class MeuPlot extends JGnuplot {
plotPropagacao.add(dts); plotPropagacao.add(dts);
plot.compile(plotPropagacao, plot.plot2d, "propagacao_esperada.plt"); plot.compile(plotPropagacao, plot.plot2d, "propagacao_esperada.plt");
// this.terminal = "epslatex color colortext dashed"; this.terminal = "epslatex color colortext dashed";
this.terminal = "eps color dashed"; // this.terminal = "eps color dashed";
this.output = outDir+"propagacao.eps'"; this.output = outDir+"propagacao.tex'";
this.execute(plotPropagacao, this.plot2d); this.execute(plotPropagacao, this.plot2d);
} }
...@@ -67,9 +67,9 @@ public class MeuPlot extends JGnuplot { ...@@ -67,9 +67,9 @@ public class MeuPlot extends JGnuplot {
plotTempo.add(dts2); plotTempo.add(dts2);
plot.compile(plotTempo, plot.plot2d, "tempo_execucao.plt"); plot.compile(plotTempo, plot.plot2d, "tempo_execucao.plt");
// this.terminal = "epslatex color colortext dashed"; this.terminal = "epslatex color colortext dashed";
this.terminal = "eps color dashed"; // this.terminal = "eps color dashed";
this.output = outDir+"tempo.eps'"; this.output = outDir+"tempo.tex'";
this.execute(plotTempo, this.plot2d); this.execute(plotTempo, this.plot2d);
} }
......
...@@ -47,7 +47,7 @@ public class Simulacao { ...@@ -47,7 +47,7 @@ public class Simulacao {
+ ", tempo = " + tempo2[i] + " segundos"); + ", tempo = " + tempo2[i] + " segundos");
excutionTime = System.currentTimeMillis() * -1; excutionTime = System.currentTimeMillis() * -1;
HashSet<Actor> seed3 = new DominatingSeed(g).escolherGreedy(k); HashSet<Actor> seed3 = new HightDegree(g).escolher(k);
excutionTime += System.currentTimeMillis(); excutionTime += System.currentTimeMillis();
tempo3[i] = (excutionTime / 1000.0f); tempo3[i] = (excutionTime / 1000.0f);
sigma3[i] = g.espectedSpread(seed3, true); sigma3[i] = g.espectedSpread(seed3, true);
...@@ -73,14 +73,14 @@ public class Simulacao { ...@@ -73,14 +73,14 @@ public class Simulacao {
public static void main(String[] args) { public static void main(String[] args) {
// simularArtificial(); // simularArtificial();
// simularHep(); simularHep();
simularPhy(); // simularPhy();
// simularEpinions(); // simularEpinions();
} }
private static void simularArtificial() { private static void simularArtificial() {
DirectedSocialNetwork g; DirectedSocialNetwork g;
g = new SocialNetworkGenerate().gerarGrafo(300, 2.8); g = new SocialNetworkGenerate().gerarGrafo(1000, 2.5);
System.out.println("|V(G)| = " + g.vertexSet().size()); System.out.println("|V(G)| = " + g.vertexSet().size());
System.out.println("|E(G)| = " + g.edgeSet().size()); System.out.println("|E(G)| = " + g.edgeSet().size());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment