13 Commits

Author SHA1 Message Date
Pitchaya Boonsarngsuk
6182a5fc26 Change logging 2018-02-13 18:42:29 +00:00
Pitchaya Boonsarngsuk
adf8126d86 Add perf matrix, esp for hybrid 2018-02-12 08:53:54 +00:00
Pitchaya Boonsarngsuk
0d148b555f Merge remote-tracking branch 'origin/master' into withConsoleLog 2018-02-12 08:27:41 +00:00
Pitchaya Boonsarngsuk
054ff7312e Merge remote-tracking branch 'origin/master' into withConsoleLog 2018-02-12 08:07:05 +00:00
Pitchaya Boonsarngsuk
a240f12b73 Merge branch 'master' into withConsoleLog 2018-02-09 09:30:16 +00:00
Pitchaya Boonsarngsuk
076e28d48f Merge branch 'master' into withConsoleLog 2018-02-06 13:40:34 +00:00
Pitchaya Boonsarngsuk
fad925d85a Update readme for the new API 2018-02-06 13:40:25 +00:00
Pitchaya Boonsarngsuk
e37d731f49 Update Readme for the new API (reverted from commit 23c173fd14) 2018-02-06 13:40:05 +00:00
Pitchaya Boonsarngsuk
23c173fd14 Update Readme for the new API 2018-02-06 13:37:37 +00:00
Pitchaya Boonsarngsuk
0ccbc345db Merge branch 'master' into withConsoleLog 2018-02-06 13:33:12 +00:00
Pitchaya Boonsarngsuk
35de97d6ba Link add logging 2018-02-06 13:20:04 +00:00
Pitchaya Boonsarngsuk
cdc97f8c81 Merge branch 'master' into withConsoleLog 2018-02-06 13:19:50 +00:00
Pitchaya Boonsarngsuk
34b666a668 Merge branch 'master' into withConsoleLog 2018-02-06 13:11:28 +00:00
5 changed files with 28 additions and 10 deletions

View File

@@ -200,7 +200,11 @@ function ticked() {
.attr("cy", function (d) {
return d.y*MULTIPLIER;
});
}
}/*
if(alreadyRanIterations%10 != 1) stresses.push("");
else stresses.push(d3.calculateStress(nodes, function (n, m) {
return distanceFunction(n, m, props, norm);
}));*/
// Emit the distribution data to allow the drawing of the bar graph
if (springForce) {
intercom.emit("passedData", simulation.force(forceName).distributionData());
@@ -214,7 +218,7 @@ function ended() {
simulation.stop();
simulation.force(forceName, null);
console.log("ended");
if (rendering !== true) { // Never drawn anything before? Now it's time.
//if (rendering !== true) { // Never drawn anything before? Now it's time.
node
.attr("cx", function (d) {
return d.x*MULTIPLIER;
@@ -222,7 +226,7 @@ function ended() {
.attr("cy", function (d) {
return d.y*MULTIPLIER;
});
}
//}
if (p1 !== 0) {
// Performance time measurement
@@ -236,6 +240,9 @@ function ended() {
p1 = 0;
p2 = 0;
}
console.log("Post stress", d3.calculateStress(nodes, function (n, m) {
return distanceFunction(n, m, props, norm);
}));
}
function brushEnded() {

View File

@@ -16,12 +16,13 @@ function startHybridSimulation() {
let forceSample = d3.forceNeighbourSampling()
.neighbourSize(NEIGHBOUR_SIZE)
.sampleSize(SAMPLE_SIZE)
.stableVelocity(0)
.stableVelocity(0.43)
.distance(distance)
let forceFull = d3.forceNeighbourSampling()
.neighbourSize(FULL_NEIGHBOUR_SIZE)
.sampleSize(FULL_SAMPLE_SIZE)
.stableVelocity(0.6)
.distance(distance)
let hybridSimulation = d3.hybridSimulation(simulation, forceSample, forceFull)

View File

@@ -40,7 +40,8 @@ export default function (sim, forceS, forceF) {
initAlready = false,
nodes,
alreadyRanIterations,
hybrid;
hybrid,
p0 = performance.now(), p1, p2, p3;
if(simulation != undefined) initSimulation();
if(forceS != undefined || forceF != undefined) initForces();
@@ -105,14 +106,20 @@ export default function (sim, forceS, forceF) {
}
function fullEnded() {
simulation.stop();
initAlready = false;
simulation.force("Full force", null);
event.call("end");
}
p3 = performance.now();
simulation.stop();
initAlready = false;
simulation.force("Full force", null);
console.log("Phase 1 takes", p1-p0);
console.log("Phase 2 takes", p2-p1);
console.log("Phase 3 takes", p3-p2);
console.log("Total", p3-p0);
console.log("Phase 3 iterations", alreadyRanIterations);
event.call("end");
}
function sampleEnded() {
p1 = performance.now();
simulation.stop();
simulation.force("Sample force", null);
// Reset velocity of all nodes
@@ -127,6 +134,7 @@ export default function (sim, forceS, forceF) {
} else {
interpBruteForce(sample, remainder, interpDistanceFn, INTERP_FINE_ITS);
}
p2 = performance.now();
event.call("fullTick");
alreadyRanIterations = 0;

View File

@@ -60,6 +60,7 @@ export default function() {
if(velocityDiff<stableVelocity){
stableVeloHandler();
}
else console.log(velocityDiff);
}
}

View File

@@ -66,6 +66,7 @@ export default function () {
if(velocityDiff<stableVelocity){
stableVeloHandler();
}
else console.log(velocityDiff);
}
}