Hello
I am writing Java program for league sports that goes through current set of played games of each team and their schedules of next games, and then based on that I make a model of flow network. The idea of program is to find which teams are already eliminated and have no chances of wining or sharing 1 place with any other team. After analyzing network (applying EdmondsKarp algo.) I find out if team get's eliminated or not. Now I also want to simulate this. I am using JGraphT as graph library, and will probably be using JGraph for visualization (reason: once I create JGraphT objects I can simply instantiate JGraph objects with them and display graph). I also found out for Jung framework yesterday, seems nice.
Main problem is I never wrote simulation and it's the point where I need "Hello World" help. When I say simulation I mean I want to visually show every part of algorithm execution, and here is example scenario: algorithm has to find augmenting paths, so I want to show when every new edge is added to augmenting path. User will be able to play and stop animation. I also want to show changes in flow in all edges and things like that. So far, I have algorithm working but I don't know how to approach simulation. Should I be using separate thread for simulation execution? Should I write separate class that would be executed as algorithm but with states recording without even knowing for real algorithm (because I don't want to interrupt performance of real algorithm). Should I use current algorithm and add some lines in between for saving execution states in some data structures that I could use later for displaying simulation to user? Any ideas might help..