[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Swarm-Support] A couple of questions
From: |
ALESSANDRO PERRONE |
Subject: |
Re: [Swarm-Support] A couple of questions |
Date: |
Tue, 16 Aug 2005 09:16:44 +0200 (CEST) |
Hi
> > 1. How do I have to do so that the random seed is different every time I
> > run my model?
try "javaswarm StartNameSimulation --varyseed"
> >
> > 2. How do I chose the colors of the lines on my EZGraph? Oddly there is a
> > class with a method to do it, EZGraphCImpl (setColors$count), but this
> > class has no data generating methods.
In Objective-c
You might try accessing the underlying graph components directly,
instead of going through EZGraph.
Then define something like:
static const char * colors[NUMCOLORS] =
{
"blue", "orange", "yellow", "green",
"red", "purple", "violet", "cyan",
"grey50", "darkgreen", "goldenrod", "seagreen",
"navy", "turquoise",
"khaki", "gold", "brown", "salmon",
"pink", "magenta", "maroon", "thistle"
};
And put as many values as you want in there, as long as they
comply with the colors Tcl/Tk understands.
When you define your graph element (the thing that actually draws
data to the graph), you can set the color directly using:
[ge setColor: colors[colorNdx % NUMCOLORS]];
If you see the javadoc pages at the followinf URL
http://www.swarm.org/swarmdocs-2.2/refbook-java/swarm/analysis/EZGraphC.html
you can see that there's the corresponding objmethod "setcolor" which is
setColors$count(java.lang.String[] colors, int count)
>From a brief description of the command, it sets a custom vector of colors
for the graph lines.
Hope this help.
ALEX