swarm-support
[Top][All Lists]
Advanced

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

RE: [Swarm-Support] Please help, How to use EZDistribution graphs in ja


From: Marshall, James A R
Subject: RE: [Swarm-Support] Please help, How to use EZDistribution graphs in java?
Date: Thu, 6 Mar 2003 16:09:23 -0000

Hala,
  although I haven't done this myself in Java I think this is probably what
you should be doing... others can tell you if I'm wrong.
        James

EZDistribution custIncGraph;
EZDistributionC custIncGraphC;
custIncGraphC = new EZDistributionCImpl(custIncGraph);
custIncGraphC.createBegin(getZone());
...initialise object with create time methods...
custIncGraph = (EZDistribution) custIncGraphC.createEnd();
custIncGraph.update();
custIncGraph.output();

---
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: Albakour, Hala [mailto:address@hidden
Sent: 06 March 2003 15:50
To: address@hidden
Subject: RE: [Swarm-Support] Please help, How to use EZDistribution
graphs in java?



Hi Everybody,

Thank you James very much for your reply, I understand now the
differences between creating, setting and using interfaces, I have gone
through the examples you mentioned and several others, actually I
couldn't find any example that uses creating objects, I am trying to
sort it out my self but it is not working, what I am doing is the
following:

        custIncGraph = new EZDistributionImpl(getZone());

      custIncGraphC = new EZDistributionCImpl(custIncGraph);

        custIncGraphC.createBegin(getZone());

 
custIncGraphC.setCollectio(networkAdoptionModelSwarm.customerList);
      custIncGraphC.setProbedSelector(new Selector(
Class.forName("Customer"),"getIncome",false) );
      custIncGraphC.setTitle("Customer Income Distribution");
      custIncGraphC.setAxisLabelsX$Y("income","no. of customers");
      custIncGraphC.setBinCount(9);
 
custIncGraphC.setLowerBound(networkAdoptionModelSwarm.customer_min_incom
e);
 
custIncGraphC.setUpperBound(networkAdoptionModelSwarm.customer_min_incom
e+1000);

      custIncGraphC.createEnd();

      custIncGraph.update();

      custIncGraph.output();

The first statement in this code could not be executed, the error I
received is: EZBin created without a collection,

How can I then pass EZDistribution object as an argument for
EZDistributionCImpl? If we could not, how can we combine both objects?

I know that createEnd() returns an object but what kind of object? Does
it return a reference to the actual object we have created? How can then
we combine it with the object custIncGraph?,

I hope I am not bothering you with my questions, I know that there are
some concepts which I don't understand but I could not find any helpful
references,

Thanks,

Hala


   


-----Original Message-----
From: Marshall, James A R [mailto:address@hidden 
Sent: 05 March 2003 15:43
To: 'address@hidden'
Subject: RE: [Swarm-Support] Please help, How to use EZDistribution
graphs in java?


Hello Hala,
  the difference between EZDistributionImpl and EZDistributionCImpl is
related to how you create the object... refer to the Swarm FAQ article:
http://lark.cc.ukans.edu/~pauljohn/SwarmFaq/SwarmOnlineFaq.html#7.5
  As EZDistributionImpl does not allow you to specify a collection in
its default constructor it looks like you'll have to create the
EZDistribution object in two stages. If you try taking a look at the
Java demos heatbugs or mousetrap you should find examples of how to do
this.
        James

---
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: %fullname% [mailto:address@hidden
Sent: 05 March 2003 15:25
To: address@hidden
Subject: [Swarm-Support] Please help, How to use EZDistribution graphs
in java?



Hello,

I am a new user of swarm, I am using java swarm packages to simulate
complex adaptive economic environments, I've got good experience in
Java,

I am facing some troubles when trying to use some classes of java swarm
library, for example I need to draw a distribution graph, I know that I
should create an object of type EZDistributionImpl, how then can I set
the collection data of that graph, I investigated the library but could
not find any method that does that, if you looked at EZDistributionCImpl
you can find a method called setCollection which sets the collection of
target objects which will be requested to generate the dataset for the
histogram, and a set of other useful methods that could be used to set
the properties of that graph, however, I could not find any
corresponding methods in EZDistributionImpl, what is the difference
between EZDistributionImpl & EZDistributionCImpl?!! I tried also to use
the latter, it had been compiled well but I could not run it, the
program crashed (actually it had been freezed at some point without
providing any kind of exceptions), I think I have used it in a correct
way, I mapped each possible statement in ObjectiveC to the corresponding
method in java (like createBegin() and createEnd()), what is the
difference between EZBin and EZBinC? Why the former does not contain the
methods I need and the latter could not be used? I found a lot of
similar pairs of classes and interfaces in library with the same
problem,

Please Help!

Hala Al-Bakour
University of Essex
UK

_______________________________________________
Support mailing list
address@hidden
http://www.swarm.org/mailman/listinfo/support
_______________________________________________
Support mailing list
address@hidden
http://www.swarm.org/mailman/listinfo/support
_______________________________________________
Support mailing list
address@hidden
http://www.swarm.org/mailman/listinfo/support


reply via email to

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