Compare commits
13 Commits
Submission
...
withConsol
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6182a5fc26 | ||
|
|
adf8126d86 | ||
|
|
0d148b555f | ||
|
|
054ff7312e | ||
|
|
a240f12b73 | ||
|
|
076e28d48f | ||
|
|
fad925d85a | ||
|
|
e37d731f49 | ||
|
|
23c173fd14 | ||
|
|
0ccbc345db | ||
|
|
35de97d6ba | ||
|
|
cdc97f8c81 | ||
|
|
34b666a668 |
@@ -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() {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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() {
|
||||
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;
|
||||
|
||||
@@ -60,6 +60,7 @@ export default function() {
|
||||
if(velocityDiff<stableVelocity){
|
||||
stableVeloHandler();
|
||||
}
|
||||
else console.log(velocityDiff);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -66,6 +66,7 @@ export default function () {
|
||||
if(velocityDiff<stableVelocity){
|
||||
stableVeloHandler();
|
||||
}
|
||||
else console.log(velocityDiff);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user