Edited comments
This commit is contained in:
@@ -48,14 +48,13 @@ export default function (sim, forceS, forceF) {
|
|||||||
// Performed on first run
|
// Performed on first run
|
||||||
function initialize() {
|
function initialize() {
|
||||||
initAlready = true;
|
initAlready = true;
|
||||||
console.log("Initializing Hybrid");
|
|
||||||
alreadyRanIterations = 0;
|
alreadyRanIterations = 0;
|
||||||
simulation
|
simulation
|
||||||
.on("tick", sampleTick)
|
.on("tick", sampleTick)
|
||||||
.on("end", sampleEnded)
|
.on("end", sampleEnded)
|
||||||
.nodes(sample)
|
.nodes(sample)
|
||||||
.force("Sample force", forceSample);
|
.force("Sample force", forceSample);
|
||||||
console.log("Initialized Hybrid");
|
console.log("Initialized Simulation for Hybrid");
|
||||||
}
|
}
|
||||||
|
|
||||||
function initForces(){
|
function initForces(){
|
||||||
@@ -91,7 +90,7 @@ export default function (sim, forceS, forceF) {
|
|||||||
// Sample simulation ticked 1 frame, keep track of number of iterations here.
|
// Sample simulation ticked 1 frame, keep track of number of iterations here.
|
||||||
function sampleTick() {
|
function sampleTick() {
|
||||||
event.call("sampleTick");
|
event.call("sampleTick");
|
||||||
if(++alreadyRanIterations >= SAMPLE_ITERATIONS){
|
if(alreadyRanIterations++ >= SAMPLE_ITERATIONS){
|
||||||
sampleEnded();
|
sampleEnded();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -99,7 +98,7 @@ export default function (sim, forceS, forceF) {
|
|||||||
// Full simulation ticked 1 frame, keep track of number of iterations here.
|
// Full simulation ticked 1 frame, keep track of number of iterations here.
|
||||||
function fullTick() {
|
function fullTick() {
|
||||||
event.call("fullTick");
|
event.call("fullTick");
|
||||||
if(++alreadyRanIterations >= FULL_ITERATIONS){
|
if(alreadyRanIterations++ >= FULL_ITERATIONS){
|
||||||
fullEnded();
|
fullEnded();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ export default function() {
|
|||||||
node.oldvy = node.vy;
|
node.oldvy = node.vy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Each iteration in a tick
|
// Each iteration in a tick
|
||||||
for (var k = 0, source, target, i, j, x, y, l; k < iterations; ++k) {
|
for (var k = 0, source, target, i, j, x, y, l; k < iterations; ++k) {
|
||||||
// For each link
|
// For each link
|
||||||
|
|||||||
Reference in New Issue
Block a user