[brite-users] creating topology directly from Java?

Jean Lepropre lepropre at run.montefiore.ulg.ac.be
Tue Feb 8 11:37:38 EST 2005


Hi Chris,

It's very simple. All you have to do is to instanciate a new Topology 
object with the desired model. The following code should be sufficient 
to illustrate my answer:

Model briteModel = new ASWaxman(*params*);
RandomGenManager rgm = new RandomGenManager();
briteModel.setRandomGenManager(rgm);
Topology topology = new Topology(briteModel);

If I didn't any mistakes, the generated topology is contained in the 
Topology object. The methods topology.getGraph().getNodesArray() and 
topology.getGraph().getEdgesArray() will give you arrays containing the 
nodes and the edges respectively.

Cheers,
Jean.

Chris Majewski wrote:
> Anyone know how to create a BRITE topology directly as a data structure 
> in Java?
> I have some Java simulation code, so it feels unnecessary to run a separate
> command-line Java program (i.e. BRITE) to generate a file and then write 
> some more Java code
> to parse that file...
> 
> -chris
> 
> _______________________________________________
> brite-users mailing list
> brite-users at cs.bu.edu
> http://cs-mailman.bu.edu/mailman/listinfo/brite-users
-- 
Jean Lepropre                          Tel :   +32 4 366 26 94
Université de Liège                    Secr :  +32 4 366 26 91
Réseaux Informatiques                  Fax :   +32 4 366 29 89
Research Unit in Networking (RUN)      lepropre at run.montefiore.ulg.ac.be
Institut d'Electricité Montéfiore, B 28 (I77a), B-4000 LIEGE, BELGIUM

CoNEXT 2005 - The E-NEXT NoE conference - http://www.co-next.net/


More information about the brite-users mailing list