MS> I would like to ask if it is possible in JavaSwarm to use MS> the class EZBin to make an Histogram. Below is an example of how this can be done. In Java, there is a clear distinction between creating and using phases: they are different classes. So a trickier part is connecting the phases together. You do that with the new EZBinCImpl (new EZBinImp ()) expression. The rest is like Objective C. (When there are using-phase constructors like in EZGraph, it's easier since the phase switch is hidden.) Oh, I noticed there's a problem with the use of string setters in this class, so you may want to get updated DLLs and a new swarm.jar from: ftp://ftp.swarm.org/pub/swarm/binaries/w32/2.1.1-fixes import swarm.Globals; import swarm.analysis.EZBinC; import swarm.analysis.EZBin; import swarm.analysis.EZBinCImpl; import swarm.analysis.EZBinImpl; import swarm.simtoolsgui.GUISwarmImpl; import swarm.defobj.Zone; import swarm.collections.List; import swarm.collections.ListImpl; import swarm.Selector; public class EZBinDemo extends GUISwarmImpl { class Agent { double value; Agent (double value) { this.value = value; } public double getAgentValue () { return value; } } EZBin ezBin; List list; EZBinDemo (Zone aZone) { super (aZone); list = new ListImpl (aZone); for (int i = 0; i < 200; i++) list.addLast (new Agent (Math.log (i))); EZBinC ezBinC; ezBinC = new EZBinCImpl (new EZBinImpl ()); ezBinC.createBegin (aZone); ezBinC.setBinCount (10); ezBinC.setLowerBound (0); ezBinC.setUpperBound (5); ezBinC.setCollection (list); ezBinC.setTitle ("My EZBin"); ezBinC.setAxisLabelsX$Y ("count of log (i)", "i"); try { ezBinC.setProbedSelector (new Selector (Agent.class, "getAgentValue", false)); } catch (Exception e) { e.printStackTrace (System.err); System.exit (1); } ezBin = (EZBin) ezBinC.createEnd (); } void show () { ezBin.update (); ezBin.output (); } static public void main (String args[]) { Globals.env.initSwarm ("EZBinDemo", "0.0", "bug-swarm@santafe.edu", args); EZBinDemo ezBinDemo = new EZBinDemo (Globals.env.globalZone); ezBinDemo.show (); ezBinDemo.buildObjects (); ezBinDemo.buildActions (); ezBinDemo.activateIn (null); ezBinDemo.go (); } }