Comparing version 1.1.4 to 1.1.5
@@ -198,2 +198,5 @@ // Generated by CoffeeScript 1.10.0 | ||
shortestPathEdges = dijkstra_from.edgesTo(dst); | ||
if (ld.isEmpty(shortestPathEdges)) { | ||
continue; | ||
} | ||
dag = new Graph(ld.map(shortestPathEdges, (function(_this) { | ||
@@ -243,9 +246,8 @@ return function(idx) { | ||
({ | ||
Ospf: countDems = Ospf.countDems = countDems, | ||
Ospf: demandsToDems = Ospf.demandsToDems = demandsToDems | ||
}); | ||
Ospf.prototype.countDems = Ospf.countDems = countDems; | ||
Ospf.prototype.demandsToDems = Ospf.demandsToDems = demandsToDems; | ||
module.exports = Ospf; | ||
}).call(this); |
// Generated by CoffeeScript 1.10.0 | ||
(function() { | ||
var Graph, Ospf, circle, countDems, dds, dem_to_show, edge, edgeUtilization, generators, i, ld, len, o, ref, res_str, ring, size; | ||
var Graph, Ospf, args, countDems, dds, dem_to_show, edge, edgeUtilization, g, generators, i, j, ld, len, len1, o, ref, ref1, ref2, res_str, ring, size, topo; | ||
@@ -13,9 +13,3 @@ ld = require("lodash"); | ||
countDems = function(dems) { | ||
return ld(dems).map(function(dests) { | ||
return dests.length; | ||
}).reduce(function(r, n) { | ||
return r + n; | ||
}); | ||
}; | ||
countDems = Ospf.countDems; | ||
@@ -64,14 +58,20 @@ size = 80; | ||
size = 60; | ||
ref1 = [ | ||
{ | ||
topo: "circle", | ||
args: [60] | ||
}, { | ||
topo: "grid", | ||
args: [3, 5] | ||
} | ||
]; | ||
for (j = 0, len1 = ref1.length; j < len1; j++) { | ||
ref2 = ref1[j], topo = ref2.topo, args = ref2.args; | ||
g = new Graph(generators[topo].apply(generators, args)); | ||
console.log(" - " + topo + "(" + args + "), with " + (Object.keys(g.vertices).length) + " vertices and " + g.edges.length + " edges"); | ||
o = new Ospf(g); | ||
console.log("Total number of demands: " + (countDems(o.dems))); | ||
console.log(JSON.stringify(o.totalUtilization())); | ||
} | ||
circle = new Graph(generators.circle(size)); | ||
console.log("Circle(" + size + "), with " + (Object.keys(circle.vertices).length) + " vertices and " + circle.edges.length + " edges"); | ||
o = new Ospf(circle); | ||
console.log("Total number of demands: " + (countDems(o.dems))); | ||
console.log(JSON.stringify(o.totalUtilization())); | ||
}).call(this); |
{ | ||
"name": "libgraph", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "graph lib in js/coffee", | ||
@@ -5,0 +5,0 @@ "main": "Graph.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
109524
68
1841