swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

command line arguments


From: Andre Costa
Subject: command line arguments
Date: Fri, 23 Nov 2001 20:30:12 +1030 (CST)

Hi,

I am using Swarm-2.1.1/Java on FreeBSD, which was installed on our system
in Dec. 2000. No updates have been made to Swarm since then.

I am trying to pass my own command-line arguments to my Swarm application.
I referred to the online FAQ which has some documents and examples
provided by Sven Thomessen on this matter.

I was hoping to adapt some of the parsing code in TestArguments.java
(http://lark.cc.ukans.edu/~pauljohn/SwarmFaq/WorkingExampleCode/java/
TestArgs-Example-5.txt )

What I need is very basic and it initally seemed simpler for
me to write my own parsing rather than take onboard the comprehensive
command-line system given by Sven.


In the "main" section of the app, I have

>  public static void main (String[] args) {
>    Globals.env.initSwarm ("agentNetwork","0.1","email",args);
>    int h = Globals.env.arguments.getLastArgIndex();
>
>   ...
>  }

which gives the following error when I compile:

>  Found 1 semantic error compiling "StartAgentSim.java":
>
>      15.         int h = (int) Globals.env.arguments.getLastArgIndex();
>                              <------------------->
>  *** Error: No field named "arguments" was found in type
>  "swarm/SwarmEnvironment". make: *** [all] Error 1

Other Globals.env fields and methods work fine. 
Is this problem to do with the version of Swarm that I am using ? (ie: is
the Globals.env.arguments a recent addition to the package ?)

Is it possible in principle for the inbuilt Swarm command line parsing 
 to co-exist with additional parsing code which I write - just as I would
for a pure Java app, assuming I don't use the existing Swarm command line
flags ?


Thanks,
Andre Costa.


---------------------------------------------------------------------
Andre Costa                             
Research Student   

Teletraffic Research Centre           Telephone: (08) 8303 3237
Department of Applied Mathematics     Fax:       (08) 8303 4395
University of Adelaide                Email:address@hidden
South Australia  5005
----------------------------------------------------------------------          



                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]