Coder Social home page Coder Social logo

repast / repast.simphony Goto Github PK

View Code? Open in Web Editor NEW
86.0 86.0 20.0 578.74 MB

Git repository for Repast Simphony development

Home Page: repast.github.io

Java 93.33% Groovy 4.26% NSIS 0.10% Python 0.02% Shell 0.11% HTML 0.51% Batchfile 0.01% XSLT 0.04% Scheme 0.03% C++ 0.01% GAP 0.23% Objective-J 0.03% R 0.01% C 0.01% JavaScript 1.00% CSS 0.15% RouterOS Script 0.15%

repast.simphony's People

Contributors

etatara avatar jonas-andersen avatar jozik avatar mjbragen avatar ncollier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

repast.simphony's Issues

Repast models not working under macOS Catalina

I recently installed repast simphony on my machine running macOS Catalina, and everything works fine until I want to run a model. I have tried this with a few of them, but let's take heatbugs as an example. I can import the project just fine, and I can use the run button in Eclipse to build it, and have the Repast Simphony window show up. But then when I click the "start run" button, the application crashes "due to an uncaught exception 'NSInternalInconsistencyException'" (full log included below).

From your FAQ I can see that this error is not unique to my setup, since it is mentioned there as a warning that can safely be ignored on Mojave. My guess is that this warning became more severe in Catalina, such that it now blocks the running of a model.

Java version is openjdk 13.0.2, OS is macOS Catalina 10.15.4, Repast is version 2.7.0.

2020-06-12 16:16:35.932 java[44797:16293652] CoreText note: Client requested name ".SFNS-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2020-06-12 16:16:35.932 java[44797:16293652] CoreText note: Set a breakpoint on CTFontLogSystemFontNameRequest to debug.
2020-06-12 16:16:35.933 java[44797:16293652] CoreText note: Client requested name ".SFNS-Bold", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2020-06-12 16:16:35.933 java[44797:16293652] CoreText note: Client requested name ".SFNSMono-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2020-06-12 16:16:35.937 java[44797:16293652] CoreText note: Client requested name ".SFNSMono-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2020-06-12 16:16:35.938 java[44797:16293652] CoreText note: Client requested name ".SFNSMono-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2020-06-12 16:16:35.938 java[44797:16293652] CoreText note: Client requested name ".SFNS-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2020-06-12 16:16:35.938 java[44797:16293652] CoreText note: Client requested name ".SFNS-Bold", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields (file:/private/var/folders/k8/3h600g1s5hnbc8lkqvqpqv540000gp/T/AppTranslocation/797D8BFA-18BC-464A-A293-09315D86FCBF/d/Eclipse.app/Contents/Eclipse/plugins/repast.simphony.runtime_2.7.0/lib/xstream-1.4.7.jar) to field java.util.TreeMap.comparator
WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.core.util.Fields
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2020-06-12 16:17:45.473 java[44797:16293652] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSWindow drag regions should only be invalidated on the Main Thread!'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff368b5d07 __exceptionPreprocess + 250
	1   libobjc.A.dylib                     0x00007fff6f5d95bf objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff368de50c -[NSException raise] + 9
	3   AppKit                              0x00007fff33ae524c -[NSWindow(NSWindow_Theme) _postWindowNeedsToResetDragMarginsUnlessPostingDisabled] + 310
	4   AppKit                              0x00007fff33acccb2 -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 1416
	5   AppKit                              0x00007fff33acc723 -[NSWindow initWithContentRect:styleMask:backing:defer:] + 42
	6   libnativewindow_macosx.jnilib       0x0000000131621f9e Java_jogamp_nativewindow_macosx_OSXUtil_CreateNSWindow0 + 398
	7   ???                                 0x00000001105d8c90 0x0 + 4569533584
)
libc++abi.dylib: terminating with uncaught exception of type NSException

Sign the update site jars

Sign the update site jars with a certificate so that Eclipse does not warn about unsigned content when installing via the update site.

Creating a custom edge agent to schedule specific actions

I have a model with a lot of edges (links) between different sorts of other agents (objects). I would like to model these edges as agents where I could add attributes and schedule actions. It is helpful to see a simple example of how to do this job?

errorous cast of double to int in FPRangeParameterBinder.

In the FPRangeParameterBinder on line 64, in the resetToDefault() function, the code tries to cast a double to an int, where a double is required:

public void resetToDefault() {
Object defaultValue = params.getSchema().getDetails(getName()).getDefaultValue();
int val = ((Integer) defaultValue).intValue();
spinner.setValue(val);
}

This line should be:

double val = ((Number) defaultValue).doubleValue();

Context: the spinner is only use for double values. As such, the default value should always be a double. If your default value != a whole number you will get the following error:

Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: class java.lang.Double cannot be cast to class java.lang.Integer (java.lang.Double and java.lang.Integer are in module java.base of loader 'bootstrap')
at repast.simphony.ui.parameters.FPRangeParameterBinder.resetToDefault(FPRangeParameterBinder.java:64)
at repast.simphony.ui.parameters.ParametersUI.resetParameters(ParametersUI.java:195)
at repast.simphony.ui.GUIParametersManager.reset(GUIParametersManager.java:56)
at repast.simphony.ui.GUIParametersManager.reset(GUIParametersManager.java:79)
at repast.simphony.ui.RSApplication.reset(RSApplication.java:450)
at repast.simphony.ui.action.ResetRun.actionPerformed(ResetRun.java:17)
at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279)
at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297)
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6632)
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
at java.desktop/java.awt.Component.processEvent(Component.java:6397)
at java.desktop/java.awt.Container.processEvent(Container.java:2263)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5008)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Groovy Eclipse plugin / Groovy 3 support

The latest Groovy Eclipse plugin no longer supports Groovy 2.4, and has moved to only supporting Groovy 2.5 and Groovy 3. Furthermore, the groovy-all.jar packaging is no longer available with the Groovy Eclipse plugin, and the Groovy project nature classpath container only provides access to the Groovy core language libraries. Some of the r.s.eclipse and relogo projects depend on the groovy util, xml, etc. packages contained in the auxilliary libs. We need to refactor the RS project dependencies on the groovy libs.

Invalid Border Rule Error

Hi, I ran the java tutorial once and didn't have any issue. I then tried to write my own code, and when I try to set my context as the data loader, I get the following set of errors for space and grid:

ERROR [AWT-EventQueue-0] 16:06:57,107 repast.simphony.dataLoader.engine.GridProjectionBuilder - Unable to build Grid 'grid': invalid border rule
java.lang.IllegalArgumentException: Invalid border rule
ERROR [AWT-EventQueue-0] 16:06:57,107 repast.simphony.dataLoader.engine.GridProjectionBuilder - Unable to build Grid 'grid': too few dimensions specified
java.lang.IllegalArgumentException: Too few dimensions specified

I had deleted the tutorial so I wrote everything again and I got the same error.

Would it be possible to know how to fix it?

Thanks,

Antoine

JSch does not support keys generated with OpenSSH 7.8 and newer

The SSH key generated with the steps outlined in Repast Batch Runs: Getting Started Section 2.2.2 using the most up to date version of ssh-keygen is not supported by JSch.
This is because ssh-keygen is using a version of OpenSSH newer than 7.8 when they changed the format of the SSH keys.

You receive the following error when trying to use this key to do remote batch runs:

ERROR [SwingWorker-pool-1-thread-1] 15:37:13,952 repast.simphony.batch.ssh.SessionsDriver - Error while creating connection to me@remote
com.jcraft.jsch.JSchException: invalid privatekey: /home/me/.ssh/key-file

The workaround for this is to convert your keys back to the classic OpenSSH format using the following command as described in this SO answer:

ssh-keygen -p -f file -m pem -P passphrase -N passphrase

If this is not an issue that can be resolved, please let me know and I will submit a PR in your docs repo to outline the workaround.

Thanks!
Max

How to remotly control Repast with Java API?

I would like to implement a connector for the EMA workbench:
quaquel/EMAworkbench#52

What is the right starting point in the Java API to

  • load a Repast model
  • set some variable values using the API
  • run the model
  • return some results

I found
repast.simphony.batch.BatchMain
and
repast.simphony.runtime.RepastBatchMain
but they seem to be for a different purpose because they load the values from *.xml files?

=>What is the recommended way to remotely control a Repast model?
=> Do you have some example for doing so?

Repast Server does not adapt icon to Agent's size

Hello everybody,

as described in the title, agents that have an icon specified in their EditedStyle2D class will be rendered according to icon's dimension instead of their size and max size properties in a server simulation.

Thank you!
Giacomo

Use maven for depndencies

Instead of having the jar library dependencies (like apache commons) in the github repository, maven could be used (i.e. writing the proper pom.xml file).

Update JOGL to ver 2.4

  • Update jogl jars
  • Update Repast vis code
  • Update demo models
  • Complete and verify testing

Best way to create a neighborhood in repast.simphony.space.gis.Geography

I have created a Geography (repast.simphony.space.gis.Geography) object which holds my raster files, shapefiles and agents. At some point in the simulation, I need to find cells OR locations(lat,long) from a specified point location(lat,long).
E.g. Get all cells OR locations(lat,long) at a distance 25km from current point(lat/long).

A few ways of doing this are:
Opt 1. Get a Moore Neighborhood/Grid Neighborhood around the current point at the specified distance.
Opt 2. Draw a circle around the current point at the specified distance. Then get all (lat,long) positions on the circumference with a gap of 1km.

Are there any APIs in Repast Java that I can use for Opt 1 or Opt 2. If not, is there any other easier way to compute this?

Improve support for Java modules

I would like to see the Repast system become a properly defined Java module with module-info.txt specifying the modules that Repast depends on and the packages that it exports.

That may be a difficult hurdle, so if it is necessary as an interim step, it may be appropriate to have Repast define an automatic module name.

Note that becoming modular would entail removing any split packages. I am not aware of many issues with split packages, but there may be some problems related to the javax.measure package, which is mostly obtained from a dependency but also has a class defined in the repast.simphony.bin_and_src.jar archive.

C# Interface

Hi, is there a way to use repast with C#?
thx,
Manuel

Adding parameter in GUI removes other "extended" parameters

In my parameters list I have a number of parameters that work with a range attribute. Range is an undocumented attribute in the standard repast simphony library. It also isn't represented in the GUI. You can only set it in the xml.

When I add another parameter the parameter with range attribute disappear. If I save the parameters I can see that the paramter that had the range attribute is still in the xml, but the range attribute has been removed. It seems as if there is some validation function that removes all attributes that do not comply to the GUI settable attributes.

Proposed solution:

  • remove this validation or check.
  • document and add range to the GUI.

How to debug repast

Now I am learning how to use repast simphony. However, I find it is difficult for me to debug the repast by using eclipse. I would be appreciate it if who can teach me how to debug the repast simphony or send me some tutorials.

Labels in 3D display throws exception

When enabling an agent label in the 3D Cartesian display, an exception is thrown:

ERROR [AWT-EventQueue-0] 12:12:13,565 repast.simphony.visualization.engine.DisplayComponentControllerAction - Error while creating displays
java.lang.IllegalStateException: No GeometryService implementation found. Please add j3d-core-utils to the classpath.
at org.jogamp.java3d.Font3D.newGeometryService(Font3D.java:956)
at org.jogamp.java3d.Font3D.triangulateGlyphs(Font3D.java:471)
at org.jogamp.java3d.Text3DRetained.updateCharacterData(Text3DRetained.java:700)
at org.jogamp.java3d.Text3DRetained.setString(Text3DRetained.java:254)
at org.jogamp.java3d.Text3D.(Text3D.java:276)
at repast.simphony.visualization.visualization3D.AbstractLabel.getBranchGroup(AbstractLabel.java:159)

Improve performance of 3D displays with agent labels

3D Cartesian displays with agent labels render slower in RS 2.9 compared with version 2.7. A change in the jogl / J3D implementation is suspected. We needed to include a fix for a font render issue with RS 2.8 and 2.9 as described here: #51 and this may possible be related.

Java/Jogl had a major update so this is likely the culprit as the Repast label code has not changed significantly. It appears that in the method AbstractLabel.getBranchGroup() there is a lot of label related object destruction and creation. Perhaps we can preserve the label objects and simply translate them instead of creating new instances on each update. This might speed up label updating.

Agent style: range not working

Version: Repast 2.4
OS: Tested both Windows and OS X

To reproduce the problem:

  • Import Geography demo model
  • Run the model, and edit A Display, choose Agent Style, then ZoneAgent, then edit, then Range Style
  • Change Range Start and Range End
  • Change is not reflected in the symbol table below

Repast Simphony 2.5 in Ubuntu 16.04 and Eclipse Oxygen 1A not working

I want to use Repast Simphony 2.5 on my Ubuntu 16.04 installation. I followed the instructions from https://repast.github.io/download.html but when I want to run the demonstration Zombies_Demo models imported from https://github.com/Repast/repast.simphony.models/archive/v.2.5.zip
I get the error "Errors occured during the build. Errors running builder 'ReLogo Builder' on project 'Zombies_Demo'. groovy/utli/XmlSlurper'"
The only difference between instruction and what I done is when I installing Groovy stuff from http://dist.springsource.org/snapshot/GRECLIPSE/e4.7 only Extra Groovy Compilers, Groovy-Eclipse, Uncategorized, I can only found Main Package, Maven Support, More Compilers(I install skipping Maven Support)

repaset simphony 2.4-Initialize model issue

Hi,
I used the flowchart to build the model, and I finished my all flowcharts, then I run the model, but, In the Run Time shows that "Error in invoking the ModelInitializer class", I checked my code again and again, I don't know where is the wrong, please help me! Thank you very much.

Importing model to new REPAST version

Hi all!
I'm trying to import a model developed in REPAST 2.3.1 to 2.5 by going to:
File>import>General>Existing Project into workspace
Unfortunately, REPAST libraries are not imported automatically. (For instance the Grid Class etc... are not recognized).
Do you have any suggestions to fix this?
Best,
Maziyar

Update the model installer

The IzPack model installer libraries should be updated and let's make the following improvements to the installer process:

  • groovy jar location not being set correctly in the model builder ant script
  • change the classpath in the start_model scripts to use wildcard * in the /lib folders
  • change the default install path to the user home folder

Jogl 2.4 and Java 8 FloatBuffer NoSuchMethodError

Jogl 2.4 and Java 8:

caused by: java.lang.NoSuchMethodError: java.nio.FloatBuffer.rewind()Ljava/nio/FloatBuffer;
    at saf.v3d.grid.GridMesh.updateColors(GridMesh.java:119)
    at saf.v3d.grid.GridMesh.update(GridMesh.java:115)
    at saf.v3d.grid.VGridShape.update(VGridShape.java:25)
    at repast.simphony.visualizationOGL2D.ValueLayerDisplayLayer.update(ValueLayerDisplayLayer.java:67)
    at repast.simphony.visualizationOGL2D.DisplayOGL2D.update(DisplayOGL2D.java:402)
    at repast.simphony.visualizationOGL2D.DisplayOGL2D.reshape(DisplayOGL2D.java:589)
    at saf.v3d.Canvas2D.reshape(Canvas2D.java:400)
    at jogamp.opengl.GLDrawableHelper.reshape(GLDrawableHelper.java:751)
    at com.jogamp.opengl.awt.GLJPanel$Updater.display(GLJPanel.java:1442)
    at com.jogamp.opengl.awt.GLJPanel$10.run(GLJPanel.java:1521)
    at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1293)

repast simphony error

Hi, I finished my code for java, but ,after I run the model, the repast shows that Error while creats a display, but I had set the display, What the problem? Is there a problem with my code?

Thank you for solving my issue

Cannot satisfy dependency

Hello, I trying install repast simphony on Eclipse Committers Neon, but i receive some errors.

I tried install repast on several versions of eclipse, groovy and another linux system (Manjaro), but it always return the same error.

The error

Cannot complete the install because one or more required items could not be found.
  Software being installed: Repast Simphony 2.6.0 (repast.simphony.feature.feature.group 2.6.0)
  Missing requirement: Repast relogo ide 2.6.0 (repast.simphony.relogo.ide 2.6.0) requires 'osgi.bundle; org.codehaus.groovy.eclipse.codeassist.completion 0.0.0' but it could not be found
  Cannot satisfy dependency:
    From: Repast Simphony 2.6.0 (repast.simphony.feature.feature.group 2.6.0)
    To: org.eclipse.equinox.p2.iu; repast.simphony.relogo.ide [2.6.0,2.6.0]

I'm using

  • GNU/Debian testing
  • OpenJDK 8
  • groovy-eclipse 4.6
    and I trying install repast 2.6.

openjdk version "1.8.0_222-ea"
OpenJDK Runtime Environment (build 1.8.0_222-ea-8u222-b07-3-b07)
OpenJDK 64-Bit Server VM (build 25.222-b07, mixed mode)

Repast Simphony run time issue

Hi, I'm using the version 1.2 of Repast Simphony, After I finish my flowchart according to the file named Getting Started , Then I launch the model, but, the Console shows that"log4j:WARN No appenders could be found for logger (MessageCenter.INTERNAL.saf.core.runtime.Boot). log4j:WARN Please initialize the log4j system properly." and I can't see the Run time interface, Please tell me where is wrong, if I use the version 2.4, this issue doesn't exist.

Parameter parcer array out of bounds with batch models that have <2 paramaters

When running a model that has fewer than two parameters (in this case, only the random seed) as a batch process, it fails to parse the parameters and exits the model. After adding just a dummy parameter, this issue is resolved and the batch model runs as expected.

Here is the stack trace for the issue, and all parameters in the model at the time of this error.

repast.simphony.batch.ssh.LocalSession - ERROR [main] 13:12:24,129 repast.simphony.batch.InstanceRunner - Error while running model
repast.simphony.batch.ssh.LocalSession - java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
repast.simphony.batch.ssh.LocalSession - 	at repast.simphony.batch.parameter.ParameterLineParser.parse(ParameterLineParser.java:55)
repast.simphony.batch.ssh.LocalSession - 	at repast.simphony.batch.InstanceRunner.run(InstanceRunner.java:193)
repast.simphony.batch.ssh.LocalSession - 	at repast.simphony.batch.InstanceRunner.main(InstanceRunner.java:217)

image

Here is the method from the stack trace that is causing the problems, specifically params.setValue(param[0].trim(), param[1].trim());. It looks to me that while parsing, you are trying to grab the 2nd parameter, but in this case, it doesn't exist.

  public Parameters parse(String line) {
    String runNum = line.substring(0, line.indexOf("\t")).trim();
    DefaultParameters params = new DefaultParameters(this.params);
    params.addParameter(BatchConstants.BATCH_RUN_PARAM_NAME, "Batch Run Number", Integer.class , 
        Integer.valueOf(runNum), true);
    
    line = line.substring(line.indexOf("\t") + 1, line.length());
    String[] vals = line.split(",");
    for (String val : vals) {
      String[] param = val.split("\t");
      params.setValue(param[0].trim(), param[1].trim());
    }
    
    return params;
  }

Thanks!
Max

WARNING: An illegal reflective access operation has occurred

The FAQ states that following warning can savely be ignored. Nevertheless, I suggest to update xstream, which might resolve the issue.

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields (file:/D:/EclipseJava/App/Eclipse/plugins/repast.simphony.runtime_2.6.0/lib/xstream-1.4.7.jar) to field java.util.TreeMap.comparator
WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.core.util.Fields
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

I use Eclipse 2018-12 and Open JDK 11.0.2 and installed the Groovy and Repast plugins using update pages.

How to create a MooreNeighborhood around a particular point in a GIS environment?

Hi ,

I am new to GIS modeling in Repast. I am not understanding how to retrieve Moore Neighborhood around a particular point (denoted by lat/long) located on a raster layer OR the GIS grid coverage. Also, is there a way that I can generate this neighborhood at certain distance from the center point.

Any help/reading material would be greatly appreciated.
Thanks!

IntelliJ support

It would be nice to be able to use Repast Simphony with IntelliJ IDEA !

Repast Simphony 2.5 in Ubuntu 17.04 and Eclipse Oxygen 1A not working

I want to use Repast Simphony 2.5 on my Ubuntu 17.04 installation. I followed the instructions from https://repast.github.io/download.html but when I want to run the demonstration models imported from https://github.com/Repast/repast.simphony.models/archive/v.2.5.zip I can't because the path to the Repast Simphony Libraries is invalid / they are simply missing. I get the error "Invalid classpath container: 'Repast Simphony Development Libraries' in project XXX'".

Same error when using Neon.

Closing execution removes dataset entries

When closing a model execution while having the Dataset editor opened seemed to remove the entries in the dataset. I had this problem while having also the Eclipse editor opened with the dataset XML file on it as well.

Aggregate Data Set Editor removes all "not recently added" sources when pressing apply all

In the repast gui you can edit data sets. One way to do this is the aggregate data set editor. I have configured one and want to edit the data sources later in the project as I go on developing the model.

When you open an existing Data Set, go to the "Select Data Sources" tab you see your data sources. If you press "Apply all" and ok, without doing anything else, you get no visual feedback. If you then try to edit a chart with the edited data source you get nullpointer exceptions. When you then inspect your data set again you see that all your data sources are gone.

If you happen to have added a data source before pressing "apply all" and ok, you only see those data sources left.

Summary: pressing apply all and ok seems to remove all existing data sources from a data set.

Issue with Repast 2.7.

3D displays do not pan with right mouse button

The 3D displays previously would pan with right mouse button click and drag, and now the mouse button 1+3 behavior is identical such that both buttons rotate the display. Using Java 8 demonstrates the correct behavior while Java 11 does not so their may have been a mouse listener API change we need to account for.

The Java3D MouseZoom, MouseRotate, and MouseTranslate use deprecated or outdated mouse event API for detecting event types. We should change thie mouse event type to use MouseEvent extended modifier and event bitmask checks.

  • Update Java3D mouse event classes
  • Test on Windows
  • Test on macOS
  • Test with JDK 8

Allow GIS Styles to specify their own GIS layers

Currently, it seems only PlaceMarkLayer and SurfaceShapeLayer are allowed as GIS layers. I would like to have my own layers (subclassing from AbstractRenderableLayer) associated with my own styles.

Looks like this would just be changing DisplayGIS3D.registerStyle (and solve a TODO ๐Ÿ˜ƒ ). Would be happy to submit a PR

GIS Issue with JDK10

When running Repast Simphony with JDK10 and using the GIS library we get the following error:

ERROR [AWT-EventQueue-0] 14:52:59,175 repast.simphony.ui.RSApplication - Error while initializing simulation
java.lang.IllegalArgumentException: org.geotools.styling.StyleFactory is not an ImageIO SPI class
	at java.desktop/javax.imageio.spi.ServiceRegistry.checkClassAllowed(Unknown Source)
	at java.desktop/javax.imageio.spi.ServiceRegistry.<init>(Unknown Source)
	at org.geotools.factory.FactoryRegistry.<init>(FactoryRegistry.java:155)
	at org.geotools.factory.FactoryCreator.<init>(FactoryCreator.java:91)
	at org.geotools.factory.CommonFactoryFinder.getServiceRegistry(CommonFactoryFinder.java:76)
	at org.geotools.factory.CommonFactoryFinder.lookup(CommonFactoryFinder.java:346)
	at org.geotools.factory.CommonFactoryFinder.getFilterFactory(CommonFactoryFinder.java:300)
	at org.geotools.factory.CommonFactoryFinder.getFilterFactory(CommonFactoryFinder.java:317)
	at org.geotools.data.store.ContentDataStore.<init>(ContentDataStore.java:173)
	at org.geotools.data.shapefile.ShapefileDataStore.<init>(ShapefileDataStore.java:124)
	at zikaVectorControl.ContextCreator.loadFeaturesFromFile(ContextCreator.java:205)

This is the code that throws the error

import org.geotools.data.shapefile.ShapefileDataStore;
import org.geotools.data.simple.SimpleFeatureIterator;
import org.opengis.feature.simple.SimpleFeature;

Grid<Object> grid = (Grid<Object>) context.getProjection("Grid");
		URL url = null;
		try {
			url = new File(filename).toURL();
		} catch (MalformedURLException e1) {
			e1.printStackTrace();
		}
ShapefileDataStore store = null;
		store = new ShapefileDataStore(url);

Read and display 1 or more raster files in Repast Simphony

I am new to using GIS aspect of Repast.
The agents have to get pixel values from multiple shapefiles and 2 raster files (based on lat, long), to decide their movement course at every tick.
So far, I first created a geography, then added the raster coverage to the geography.

I have used the org.geotools package to read raster file in geotif format.
GeoTiffReader geoTiffReader = new GeoTiffReader(new File(filename));
GridCoverage2D coverage = (GridCoverage2D) geoTiffReader.read(null);
geography.addCoverage("coverage1", coverage);

My questions are as follows:

  1. My agents will be moving in this geography, so do I need to create writable grid coverage (for rasters and shapefiles) and then add it to the geography?

  2. Is it possible to add 2 raster files and 3-4 shapefiles to the geography?

  3. How do I read data from a raster file? E.g. NDVI index from a vegetation raster file.
    (I was looking at the RasterLayer class.)

  4. All of the above mentioned files are created by year. So, I need to recreate these layers according to appropriate tick. Is this approach correct? However, my main question is , how do I display raster data in repast simphony? Some resources would be useful.

Any sort of help will be great.
Thanks!

GLProfiles 2 error with Ubuntu 20.04

User reports this stack trace with RS2.7 and Ubuntu 20.04

ERROR [AWT-EventQueue-1] 13:41:53,941 repast.simphony.visualizationOGL2D.DisplayOGL2D - Error initializing OGL 2D display. JOGL must be installed and computer must support open gl rendering
javax.media.opengl.GLException: Profile GL2 is not available on null, but: [GLProfile[GLES1/GLES1.hw], GLProfile[GLES2/GLES3.hw], GLProfile[GL2ES1/GLES1.hw], GLProfile[GL4ES3/GL4.hw], GLProfile[GL2ES2/GL4.hw], GLProfile[GL4/GL4.hw], GLProfile[GLES3/GLES3.hw], GLProfile[GL4/GL4.hw], GLProfile[GL3/GL4.hw], GLProfile[GL2GL3/GL4.hw]]
	at javax.media.opengl.GLProfile.get(GLProfile.java:962)
	at javax.media.opengl.GLProfile.get(GLProfile.java:975)
	at saf.v3d.Canvas2D.<init>(Canvas2D.java:82)

So it looks GL2 is not available, although others are.

RandomHelper API and Docs

RandomHelper API doesn't support examples in RepastReference/RepastReference.html#_multiple_stream_non_uniform_stream_usage

In particular, there's no way to set the seed for some particular distribution.

static variable can't be watched

Every time when I try to use an annotation @watch listen static variable, there is an java.lang.reflect.InvocationTargetException exception,

public class Zombie {
private    static Integer count = new Integer(0);

public void infect() {
		GridPoint pt = grid.getLocation(this);
		List<Object> humans = new ArrayList<Object>();
		for (Object obj : grid.getObjectsAt(pt.getX(), pt.getY())) {
			if (obj instanceof Human) {
				humans.add(obj);
			}
		}

		if (humans.size() > 0) {
			int index = RandomHelper.nextIntFromTo(0, humans.size() - 1);
			Object obj = humans.get(index);
			NdPoint spacePt = space.getLocation(obj);
			Context<Object> context = ContextUtils.getContext(obj);
			context.remove(obj);
			Zombie zombie = new Zombie(space, grid);
			System.out.println(count);
			count = count + 1;
			context.add(zombie);
			space.moveTo(zombie, spacePt.getX(), spacePt.getY());
			grid.moveTo(zombie, pt.getX(), pt.getY());
			
			Network<Object> net = (Network<Object>)context.getProjection("infection network");
			net.addEdge(this, zombie);
		}
	}
	
	public int getCount() {
		return count;
	}
}

Human.class

@Watch(watcheeClassName = "jzombies.Zombie", watcheeFieldNames = "count",
			whenToTrigger = WatcherTriggerSchedule.IMMEDIATE, triggerCondition = "$watchee.getCount() > 1")
	public void Number() {
		System.out.println("count value"  );
	}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.