Update README.md

circuitkvl
====================================================================================================
Still needs to implement: 




* Better Documentation
* Error checking (i.e. calls to loopEqautions() when graph is not closed)
* UI for making entering points/lines/components easier.
* Clean up some redundant method calling when calculating loops
* Method for circuitGraph that reduces the number of edges. For example, if lots of wire in series,
  can just represent that with two points and one wire. (IMPROVES RUNTIME)
====================================================================================================




====================================================================================================
Intro: I represent a circuit as a directed unweighted graph. I call the edges Lines and nodes Points.
Each line has a component associated with it, either Component.WIRE/BATTERY/RESISTOR. 
A battery has an orientation. A positive orientation means if you go from p0 to p1 on the given Line object,
the voltage increases. Negative orientation means going from p0 to p1, the voltage drops.
====================================================================================================
Currently constructing a circuit is really difficult and annoying:
//creates new graph
circuitGraph cG = new circuitGraph();




//creates the points
Point p0 = new Point(0,0);
Point p1 = new Point(0,1);
Point p2 = new Point(1,1);
Point p3 = new Point(2,1);
Point p4 = new Point(2,0);
Point p5 = new Point(1,0);




//adds points
cG.addPoint(p0);
cG.addPoint(p1);
cG.addPoint(p2);
cG.addPoint(p3);
cG.addPoint(p4);
cG.addPoint(p5);




//add lines
cG.addEdge(p0, p1);
cG.addEdge(p1, p2);
cG.addEdge(p2, p3);
cG.addEdge(p3, p4);
cG.addEdge(p4, p5);
cG.addEdge(p2, p5);
cG.addEdge(p5, p0);




//add components
cG.addComponent(p0, p1, Component.TYPE_BATTERY, 5, Component.ORIENTATION_POSITIVE, "V0");
cG.addComponent(p1, p2, Component.TYPE_RESISTOR, 5, Component.ORIENTATION_UNDEF, "R0");
cG.addComponent(p2, p3, Component.TYPE_RESISTOR, 5, Component.ORIENTATION_UNDEF, "R1");
cG.addComponent(p4, p5, Component.TYPE_RESISTOR, 5, Component.ORIENTATION_UNDEF, "R2");
cG.addComponent(p2, p5, Component.TYPE_BATTERY, 5, Component.ORIENTATION_NEGATIVE, "V1");








//UPDATES THE GRAPH FIELDS (IMPORTANT)- lets user know that you are ready to do calculations on it.
cG.update();




///It is recommended that you look at the value this method call returns 1 if sucess. Returns 0 otherwise.
///NOTE: THIS MEANS GRAPH HAS TO BE _CLOSED_ before calling update.




//print the path and corresponding path labels
pr("paths");
pr(cG.getPaths());
pr(cG.getPathLabels());








//print the loops and the corresponding loop labels
pr("labels");
pr(cG.getLoops());
pr(cG.getLoopLabels());




// loopEquations() prints the loop equations. Currently has no error checking.
pr("start loopEquations()");
cG.loopEquations();
System.out.println("loop eqautions printed");
========================================================================================================================
ADD UPDATES HERE
========================================================================================================================
AS OF 1.3.12: 
The way to make a circuit is the same as making a graph. There's a sample way of creating a circuit in Main.
It prints out kirchoff loop equations of any circuit. It searches for loops using BFS, so as long the number of junctions
are low, this will be fast enough.
========================================================================================================================