[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Swarm-Support] EZGraph
From: |
Marshall, James A R |
Subject: |
RE: [Swarm-Support] EZGraph |
Date: |
Tue, 4 Feb 2003 16:09:19 -0000 |
Dear Li An,
I assume you're using the Java collections LinkedList rather than the
Swarm one. In this case the following example code should help you. What you
do is simply create a graph object and tell it to plot the results of
calling the size() method on your LinkedList. If you prefer to use the Swarm
LinkedList replace size() with getCount(). Don't forget to schedule the
step() method on the graph regularly.
The main thing to remember is you can use an EZGraph to create a sequence
from pretty much any object using pretty much any method.
James
LinkedList list = new LinkedList();
EZGraphImpl graph = new EZGraphImpl(getZone(), "List size", "Time", "Size",
listSizeGraph");
graph.createSequence$withFeedFrom$andSelector("list size", list, new
Selector(list.getClass(), "size", false));
---
Dr James A R Marshall
Complex Systems Modelling Group (COSMIC)
Department of Earth Science and Engineering
Imperial College London
Tel: +44 (0)20 7594 7493
Fax: +44 (0)20 7594 7444
Container World Project - http://www.ese.ic.ac.uk/research/containerworld/
-----Original Message-----
From: Li An [mailto:address@hidden
Sent: 04 February 2003 15:42
To: address@hidden
Subject: Re: [Swarm-Support] EZGraph
Sounds good. Does EZgraph have a method to graph what I get using
getSizeOfList (y-axis) over time (x-axis)?
At 08:57 AM 2/4/2003 -0600, you wrote:
>In the class where you have the list, write a method
>
>getSizeOfList
>
>and the plot the output of that method. No need to average it, since it
>is just one thing being plotted.
>
>Li An wrote:
>>Dear Swarm colleagues,
>>I have a dynamically updated list (object of Java class called
>>LinkedList) containing objects (persons), and want to graph the size of
>>the list (rather than get the information (say, age) of individual
>>persons from the list) over time. Any suggestions on how to do this?
>>Thanks in advance.
>>Li
>
>
>--
>Paul E. Johnson email: address@hidden
>Dept. of Political Science http://lark.cc.ku.edu/~pauljohn
>1541 Lilac Lane, Rm 504
>University of Kansas Office: (785) 864-9086
>Lawrence, Kansas 66044-3177 FAX: (785) 864-5700
>
>_______________________________________________
>Support mailing list
>address@hidden
>http://www.swarm.org/mailman/listinfo/support
Li An
Systems Modeling Lab
Department of Fisheries and Wildlife
Michigan State University
East Lansing, MI 48824
Phone (Work): 517-353-7981
Fax: 517-432-1699
http://www.msu.edu/~anli
_______________________________________________
Support mailing list
address@hidden
http://www.swarm.org/mailman/listinfo/support
- RE: [Swarm-Support] EZGraph,
Marshall, James A R <=