Ejemplo n.º 1
0
func main() {
	load, bs, nb, ns := parseFlags()

	var sp *bls.SpikeProfile
	if *load != 0.0 {
		sp = &bls.SpikeProfile{
			[]bls.Spike{
				bls.Spike{0.0, *load},
			},
		}
	} else {
		sp = &bls.SpikeProfile{
			[]bls.Spike{
				bls.Spike{0.0, 0.1},
				bls.Spike{0.33, 1.0},
				bls.Spike{0.67, 0.11},
			},
		}
	}

	bls.NewLoadSpikeSimulation(*bs, *nb, *ns).
		UseSpikeProfile(sp).
		AddCumulativeLogger("data/load-spike").
		//AddTimeSeriesLogger("data/load-spike").
		Run()
}
Ejemplo n.º 2
0
func main() {
	// Default to two processes, this will increase after further optimizations to the `createTxns` method
	runtime.GOMAXPROCS(2)

	load, bs, nb, ns := parseFlags()

	// Use constant `SpikeProfile` if `load` is set, otherwise use custom `SpikeProfile`
	var sp *bls.SpikeProfile
	if *load != 0.0 {
		sp = &bls.SpikeProfile{
			[]bls.Spike{
				bls.Spike{0.0, *load},
			},
		}
	} else {
		sp = &bls.SpikeProfile{
			[]bls.Spike{
				bls.Spike{0.0, 0.1},
				bls.Spike{0.33, 10.0},
				bls.Spike{0.67, 0.11},
			},
		}
	}

	// Run simulation with appropriate `SpikeProfile`
	bls.NewLoadSpikeSimulation(*bs, *nb, *ns).
		UseSpikeProfile(sp).
		AddCumulativeLogger("data/load-spike").
		//AddTimeSeriesLogger("data/load-spike").
		Run()
}