public void computeErrors(MyGraph reference, PrintWriter writer){
		int misplacements=0;
		int wrongoriented=0;
		for(MyEdge e : this.edges){
		   MyNode a = reference.nodeFromId(e.getSource().getId());
		   MyNode b = reference.nodeFromId(e.getTarget().getId());
		   MyEdge edge = reference.getEdgeByST(a, b);
			if(edge!=null){
				if(a.getId().equals(edge.getSource().getId())){
					if(a.getOrientation()!=e.getSource().getOrientation()||b.getOrientation()!=e.getTarget().getOrientation()){
						wrongoriented++;
					}
					
				} else if(a.getOrientation()!=(e.getTarget().getOrientation()*-1)||b.getOrientation()!=(e.getSource().getOrientation()*-1)){
						wrongoriented++;
					}
				
			}else{
				misplacements++;
			}
		}

		System.out.println("Total number of joints: "+this.getEdges().size());
		System.out.println("Misplacements: "+misplacements);
		System.out.println("Wrong oriented: "+wrongoriented);
		System.out.println("Correct joints: "+(this.getEdges().size()-misplacements-wrongoriented)+" ("+((Double.valueOf(this.getEdges().size()-misplacements-wrongoriented))/(this.edges.size())*100)+")");
	
		writer.println("Total number of joints: "+this.getEdges().size());
		writer.println("Misplacements: "+misplacements);
		writer.println("Wrong oriented: "+wrongoriented);
		writer.println("Correct joints: "+(this.getEdges().size()-misplacements-wrongoriented)+" ("+((Double.valueOf(this.getEdges().size()-misplacements-wrongoriented))/(this.edges.size())*100)+")");

	}