From 243c363f3b55498c3697523668c4dc37d55230ea Mon Sep 17 00:00:00 2001 From: CSDUMMI Date: Tue, 22 Mar 2022 09:14:34 +0100 Subject: [PATCH] Added documenting comments --- src/.Graph.js.kate-swp | Bin 0 -> 102 bytes src/Graph.js | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 src/.Graph.js.kate-swp diff --git a/src/.Graph.js.kate-swp b/src/.Graph.js.kate-swp new file mode 100644 index 0000000000000000000000000000000000000000..9849a19269c556d450f8322cf331be2d4a71ac1f GIT binary patch literal 102 zcmZQzU=Z?7EJ;-eE>A2_aLdd|RWQ;sU|?Vn>3L}uUj9^1WXm4ySMy~jtueMSWeE-k h%4h&Ft0$1q1Y!_iQ2+v0upCH;1tg~hk^lmT901Sw5~BbB literal 0 HcmV?d00001 diff --git a/src/Graph.js b/src/Graph.js index f4fdd26..8ce9365 100644 --- a/src/Graph.js +++ b/src/Graph.js @@ -11,15 +11,34 @@ class GraphIndex { this._graph = Graph(); } + /** + * Each project points to a database + * containing all the information about a project. + */ addProject(cid) { this._graph.addNode(cid) } + /** + * A depedency is a directed edg + * from the project dependent on another project to that project. + * + * If project A dependes on B, an edge from A to B is added. + * + * The weight is in the interval 0,1 and indicates the probability + * that an error/bug/problem in the dependency causes an error/bug/problem + * in the dependent project. + */ addDependency(dependent, dependency, weight) { this._graph.addEdge(dependent, depedency, weight) } + /** + * @returns {Array} cids of the projects in the Graph. + */ get projects() { return this._graph.nodes() } + + depedencyBetween }