Added documenting comments
rodzic
48e8cdf4ae
commit
243c363f3b
Plik binarny nie jest wyświetlany.
19
src/Graph.js
19
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<string>} cids of the projects in the Graph.
|
||||
*/
|
||||
get projects() {
|
||||
return this._graph.nodes()
|
||||
}
|
||||
|
||||
depedencyBetween
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue