[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Batch mode option + customized option
From: |
Akiko Ogawa - RS/GIS lab |
Subject: |
Batch mode option + customized option |
Date: |
Wed, 24 May 2000 15:58:02 -0600 (MDT) |
Marcus,
I'm trying to use the sample coyote codes you gave me sometime ago.
What I intend to do is to run my Coyote program in batch mode with option of
the
number of steps at which the program terminates. The command line should look
like "coyote -bT 100" or something like that, if I want to run my Coyote
program
in batch mode and automatically terminate it after 100 steps.
In main.m I combined your codes, codes from mousetrap, and mine as shown in the
end. I got the following error message when I compiled this.
I would appreciate your advice if this is the right way.
Akiko Ogawa
Utah State University
*** event raised for error: InvalidArgument
*** function: _i_Object_s__doesNotRecognize_(), file:
/net/pojoaque/disk1/Scratch/mgd/src/swarm-2.0.1/src/defobj/DefObject.m, line:
872
Zone_c does not recognize create:*** execution terminating due to error
/net/pojoaque/disk1/Scratch/mgd/src/swarm-2.0.1/src/defobj/Symbol.m:173
-[Error(c) _raiseEvent:]
Abort
/// main.m ///
#import <simtools.h>
#import "CoyoteObserverSwarm.h"
#import "CoyoteBatchSwarm.h"
#include <swarmconfig.h>
#ifdef HAVE_ARGP_H
#include <argp.h>
#else
#include <misc/argp.h>
#endif
int
main (int argc, const char **argv)
{
id topLevelSwarm;
unsigned timesteps = 100;
struct argp_option options[] = {
{"timesteps", 'T', "COUNT", 0, "Timesteps before quitting", 0},
{NULL}
};
int parse (int key, const char *arg)
{
if (key == 'T')
timesteps = strtoul (arg, NULL, 10);
return 0;
}
initSwarmAppOptions (argc, argv, "0.0", "address@hidden", options, parse);
if (swarmGUIMode == YES)
{
topLevelSwarm = [CoyoteObserverSwarm create: globalZone];
SET_WINDOW_GEOMETRY_RECORD_NAME (topLevelSwarm);
topLevelSwarm = [topLevelSwarm createEnd];
}
else
{
id archiver = [LispArchiver create: globalZone setPath: "batch.scm"];
if ((topLevelSwarm =
[archiver getWithZone: globalZone object: "batchSwarm"]) == nil)
raiseEvent(InvalidOperation,
"Can't find archiver file or appropriate key");
[archiver drop];
}
[topLevelSwarm setMaxSteps: timesteps];
[topLevelSwarm buildObjects];
[topLevelSwarm buildActions];
[topLevelSwarm activateIn: nil];
[topLevelSwarm go];
return 0;
}
==================================
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.
- Batch mode option + customized option,
Akiko Ogawa - RS/GIS lab <=