Menu

[r36]: / GraphScript / trunk / scripts / algorithmsupport.js  Maximize  Restore  History

Download this file

33 lines (29 with data), 599 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
function Algorithm()
{
this.steps = [];
this.stepDelay = 1000; //in ms
return this;
}
Algorithm.prototype.addStep = function(step)
{
if (step)
this.steps.push(step);
}
//-------------------------------------------------------------------------------
function runAlgorithm(alg)
{
if (!alg) return;
}
function addAlgorithmStep(alg,stepFunc,nextStepInd)
{
if (alg)
{
var step = new Packages.ls.graph.script.AlgorithmStep()
{
execute : stepFunc,
getNextStep : function() { return nextStepInd; }
};
msg(alg.addStep);
alg.addStep(step);
}
}
MongoDB Logo MongoDB