Vue/graf/src/middleware/GrafModel.js
// Adds an edge from node s to node t, both in the graph model and the smulation
Adds an edge from node s to node t, both in the graph model and the smulation
Adds an edge from node s to node t both in the graph model and the smulation
addEdgeHelper(s_id, t_id, dir = false, weight = 1, style = null) {
		let s_node = this.id_node_map.get(parseInt(s_id));
		let t_node = this.id_node_map.get(parseInt(t_id));
		if (s_node == null || t_node == null) {
			console.log("ERROR: source or target node not found when trying to add an edge");
			console.log("id_node_map contents: ");
			console.log(this.id_node_map);
			console.log("IDs: ");
			console.log(s_id);
			console.log(t_id);
		}
		let edge = new Edge(this.curr_edge_id, s_node, t_node, dir, weight, style);
		this.id_edge_map.set(this.curr_edge_id, edge);
		this.sim_wrapper.addSimLink(this.curr_edge_id, parseInt(s_id), parseInt(t_id));
		this.curr_edge_id += 1;
	}
addEdgeHelper ( s_id , t_id , dir = false , weight = 1 , style = null ) { let s_node = this . id_node_map . get ( parseInt ( s_id ) ) ; let t_node = this . id_node_map . get ( parseInt ( t_id ) ) ; if ( s_node == null || t_node == null ) { console . log ( "ERROR: source or target node not found when trying to add an edge" ) ; console . log ( "id_node_map contents: " ) ; console . log ( this . id_node_map ) ; console . log ( "IDs: " ) ; console . log ( s_id ) ; console . log ( t_id ) ; } let edge = new Edge ( this . curr_edge_id , s_node , t_node , dir , weight , style ) ; this . id_edge_map . set ( this . curr_edge_id , edge ) ; this . sim_wrapper . addSimLink ( this . curr_edge_id , parseInt ( s_id ) , parseInt ( t_id ) ) ; this . curr_edge_id += 1 ; }
Adds an edge from node s to node t, both in the graph model and the smulation
Adds an edge from node s to node t both in the graph model and the smulation