Menu
  • HOME
  • TAGS

NoSuchElementException error iterator anylogic [duplicate]

java,anylogic

Calling .next() will retrieve the next element and advances the iterator. You have multiple .next() calls without checking if there is a next element at all. If you want to keep using the same element that the .next() initially returned, then, replace the first .next() with H next = iter.next(),...

How to declare a sort function in Java / Anylogic?

java,sorting,compare,anylogic

If your main intention is to only sort a collection of PLClass based on the element PL then the following might be what you are looking for Collections.sort(Mycollect,new Comparator<PLClass>(){ @Override public int compare(PLClass o1, PLClass o2) { Double i = o1.PL; Double j = o2.PL; return i.compareTo(j); }; }; ...

What is the equivalent Anylogic function “zidz” in Java?

java,function,anylogic

There isn't one in the common set of libraries. That's not to say there is nobody in the world who has written and published one, but the function is so trivial as to be unlikely to be included in a Java library.

How to move agent forward in Anylogic 7

simulation,agent,anylogic

to my knowledge there is no method like: .moveforward() you could use your current position: .getXYZ() and direction: getRotation() to calculate a point some distance: r, in front of your agent and then use the .moveToStraight(x,y) x = r * cos(direction) + x_0 y = r * sin(direction) + y_0...

Discrete Event Modeling: designing reverse flows and loops in AnyLogic 7

simulation,modeling,anylogic

I assume you are talking about this model: This model already models your first request. The "magic" is done in the NeedAdditionalService element where 30% (the specified value is 0.3) of all customers that are done at the ATM are sent to the cashiers, because they need additional service. You...

Convert ESRI Shapefile to (lat, long) points for each region

gis,latitude-longitude,shapefile,esri,anylogic

Generally you can use OGR2OGR to do something with your shapes. May be you could find this helpful.

Connecting to a MySQL db with the anylogic objects

mysql,anylogic

First you have to download and add the mysql-connector-java-*.jar file to the anylogic-project. Then you have to type com.mysql.jdbc.Driver into the JDBC driver dropdown box. finally the connection string should look something like jdbc:mysql:[host/db]?:[port] another thing I found that might be helpfull to others, is that you can get the...

Anylogic 7: Different Random Generators for different processes

random,anylogic

You can create your own random number generators like this: Random rng1 = new Random(); and use them in distributions like this uniform(2,5,rng1). This way rng1 is used as random number stream instead of the default one.

Marking an Agent as abstract?

anylogic

You can't declare anything abstract (class or method (AnyLogic function)) in a GUI-designed Agent, but you can create an Agent as a user-defined Java class (i.e., via New --> Java Class) which is abstract. You need to know the appropriate constructor signatures to do so, which AnyLogic doesn't document (but...

Taking a screenshot of the simulation area

anylogic

Okay... so after a lot of experimentation, i found that the "magic parameter" wasn't as magic as i thought. but this piece of code should be able to create a screenshot that extends the visible area: public void capturePanel (ShapeGroup p, String fileName) { Panel argPanel = p.getPresentable().getPresentation().getPanel(); BufferedImage capture...