Edited comments

This commit is contained in:
Pitchaya Boonsarngsuk
2018-03-21 16:08:32 +00:00
parent bda72e4fa8
commit 757b315309
2 changed files with 4 additions and 4 deletions

View File

@@ -48,14 +48,13 @@ export default function (sim, forceS, forceF) {
// Performed on first run
function initialize() {
initAlready = true;
console.log("Initializing Hybrid");
alreadyRanIterations = 0;
simulation
.on("tick", sampleTick)
.on("end", sampleEnded)
.nodes(sample)
.force("Sample force", forceSample);
console.log("Initialized Hybrid");
console.log("Initialized Simulation for Hybrid");
}
function initForces(){
@@ -91,7 +90,7 @@ export default function (sim, forceS, forceF) {
// Sample simulation ticked 1 frame, keep track of number of iterations here.
function sampleTick() {
event.call("sampleTick");
if(++alreadyRanIterations >= SAMPLE_ITERATIONS){
if(alreadyRanIterations++ >= SAMPLE_ITERATIONS){
sampleEnded();
}
}
@@ -99,7 +98,7 @@ export default function (sim, forceS, forceF) {
// Full simulation ticked 1 frame, keep track of number of iterations here.
function fullTick() {
event.call("fullTick");
if(++alreadyRanIterations >= FULL_ITERATIONS){
if(alreadyRanIterations++ >= FULL_ITERATIONS){
fullEnded();
}
}

View File

@@ -28,6 +28,7 @@ export default function() {
node.oldvy = node.vy;
}
}
// Each iteration in a tick
for (var k = 0, source, target, i, j, x, y, l; k < iterations; ++k) {
// For each link