Quantcast

Building a Mavenized Repast model

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Building a Mavenized Repast model

Van Parunak
I'm trying to use Maven to manage dependencies on external packages in a
Repast Simphony project, based on David Momper's amazing detective work
reported on this list on 12 June 2015. I've gotten to the point that all
my sources compile correctly, so they find the Maven dependencies, and
the project as a whole shows no errors. With an ordinary Repast project,
at this point a run configuration would be available for the model, but
apparently adding the Maven nature breaks that mechanism. Maven, of
course, expects one to use Maven to build the project, but that won't
work here because although David's hack allows Repast to find the Maven
dependencies, Maven can't find the Repast dependencies. David tells me
in private correspondence that when he did this 18 months ago, the run
configuration just appeared as always, so apparently something has
changed. I did try setting up a run configuration treating this as a
Java project, but it complains it can't find the main method. How do I
tell Eclipse to run such a model?

Here are the details of what I've done so far.

1. Write a very simple RS project ( it just instantiates a single agent,
which at each step makes an assignment to a variable and returns). When
the agent is instantiated, it invokes gson, which is exposed via Maven.

2. Add the Maven nature via Configure --> Convert to Maven Project

3. Add a dependency in the POM to com.google.com.gson

4. Since Maven insists on resetting the JRE library to version 1.5,

     a. In the POM, set the source and target in the
maven-compiler-plugin to 1.8

     b. Change the build path (back to) 1.8

5. Apply David Momper's hack to the model.launch file

6. Invoke Maven --> Update Maven to get Maven lined up with the new Java
version

At this point, my project directory has a "Maven Dependencies"
subdirectory with the gson jar in it, all source files save without
errors, and the overall project shows no errors. But there's no run
configuration available.

I'd be grateful for any hints, and once I get it to work, I'll post the
overall recipe.

Thanks!

Van Parunak




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building a Mavenized Repast model

srcnick
When you created the project as a Repast Project there should be a launchers folder with a .launcher file for the model. That is in fact the run configuration. Maybe there’s something about the maven nature that prevents it from showing up in the run menu. You can right click on that file and run it directly.

Nick

> On Jan 17, 2017, at 4:47 PM, Van Parunak <[hidden email]> wrote:
>
> I'm trying to use Maven to manage dependencies on external packages in a
> Repast Simphony project, based on David Momper's amazing detective work
> reported on this list on 12 June 2015. I've gotten to the point that all
> my sources compile correctly, so they find the Maven dependencies, and
> the project as a whole shows no errors. With an ordinary Repast project,
> at this point a run configuration would be available for the model, but
> apparently adding the Maven nature breaks that mechanism. Maven, of
> course, expects one to use Maven to build the project, but that won't
> work here because although David's hack allows Repast to find the Maven
> dependencies, Maven can't find the Repast dependencies. David tells me
> in private correspondence that when he did this 18 months ago, the run
> configuration just appeared as always, so apparently something has
> changed. I did try setting up a run configuration treating this as a
> Java project, but it complains it can't find the main method. How do I
> tell Eclipse to run such a model?
>
> Here are the details of what I've done so far.
>
> 1. Write a very simple RS project ( it just instantiates a single agent,
> which at each step makes an assignment to a variable and returns). When
> the agent is instantiated, it invokes gson, which is exposed via Maven.
>
> 2. Add the Maven nature via Configure --> Convert to Maven Project
>
> 3. Add a dependency in the POM to com.google.com.gson
>
> 4. Since Maven insists on resetting the JRE library to version 1.5,
>
>     a. In the POM, set the source and target in the
> maven-compiler-plugin to 1.8
>
>     b. Change the build path (back to) 1.8
>
> 5. Apply David Momper's hack to the model.launch file
>
> 6. Invoke Maven --> Update Maven to get Maven lined up with the new Java
> version
>
> At this point, my project directory has a "Maven Dependencies"
> subdirectory with the gson jar in it, all source files save without
> errors, and the overall project shows no errors. But there's no run
> configuration available.
>
> I'd be grateful for any hints, and once I get it to work, I'll post the
> overall recipe.
>
> Thanks!
>
> Van Parunak
>
>
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Repast-interest mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/repast-interest


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Fwd: Building a Mavenized Repast model

David Momper
Nick is right, what I described was how to get Maven managed dependencies to work in the default Repast launchers that are automatically generated when you create a Repast project. In the Run Configurations list in Eclipse, these launchers will show up in the "Java Application" category as "[ProjectName] Model", "Batch [ProjectName] Model", and "Build Installer for [ProjectName] Model"

And as Van mentions, the method that I previously described doesn't enable full Maven functionality, so you can't do Maven build/install/test/etc. All that it does is allow the default Repast launchers to build/run using Maven managed dependencies (after converting to a Maven Project).

The original post I made, in case anyone else is interested, can be found here: https://sourceforge.net/p/repast/mailman/message/34207741/

On Wed, Jan 18, 2017 at 8:21 AM, Nick Collier <[hidden email]> wrote:
When you created the project as a Repast Project there should be a launchers folder with a .launcher file for the model. That is in fact the run configuration. Maybe there’s something about the maven nature that prevents it from showing up in the run menu. You can right click on that file and run it directly.

Nick

> On Jan 17, 2017, at 4:47 PM, Van Parunak <[hidden email]> wrote:
>
> I'm trying to use Maven to manage dependencies on external packages in a
> Repast Simphony project, based on David Momper's amazing detective work
> reported on this list on 12 June 2015. I've gotten to the point that all
> my sources compile correctly, so they find the Maven dependencies, and
> the project as a whole shows no errors. With an ordinary Repast project,
> at this point a run configuration would be available for the model, but
> apparently adding the Maven nature breaks that mechanism. Maven, of
> course, expects one to use Maven to build the project, but that won't
> work here because although David's hack allows Repast to find the Maven
> dependencies, Maven can't find the Repast dependencies. David tells me
> in private correspondence that when he did this 18 months ago, the run
> configuration just appeared as always, so apparently something has
> changed. I did try setting up a run configuration treating this as a
> Java project, but it complains it can't find the main method. How do I
> tell Eclipse to run such a model?
>
> Here are the details of what I've done so far.
>
> 1. Write a very simple RS project ( it just instantiates a single agent,
> which at each step makes an assignment to a variable and returns). When
> the agent is instantiated, it invokes gson, which is exposed via Maven.
>
> 2. Add the Maven nature via Configure --> Convert to Maven Project
>
> 3. Add a dependency in the POM to com.google.com.gson
>
> 4. Since Maven insists on resetting the JRE library to version 1.5,
>
>     a. In the POM, set the source and target in the
> maven-compiler-plugin to 1.8
>
>     b. Change the build path (back to) 1.8
>
> 5. Apply David Momper's hack to the model.launch file
>
> 6. Invoke Maven --> Update Maven to get Maven lined up with the new Java
> version
>
> At this point, my project directory has a "Maven Dependencies"
> subdirectory with the gson jar in it, all source files save without
> errors, and the overall project shows no errors. But there's no run
> configuration available.
>
> I'd be grateful for any hints, and once I get it to work, I'll post the
> overall recipe.
>
> Thanks!
>
> Van Parunak
>
>
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Repast-interest mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/repast-interest


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fwd: Building a Mavenized Repast model

Van Parunak

I've almost got this working now--my problem was that David's hack in the original post has some line breaks at illegal locations, which killed the run config. I've got it running, but the .class files end up where they shouldn't (regardless of how one sets the build path). This is under investigation--I'll publish the full recipe once I get it sorted out.


On 1/18/17 16:41, David Momper wrote:
Nick is right, what I described was how to get Maven managed dependencies to work in the default Repast launchers that are automatically generated when you create a Repast project. In the Run Configurations list in Eclipse, these launchers will show up in the "Java Application" category as "[ProjectName] Model", "Batch [ProjectName] Model", and "Build Installer for [ProjectName] Model"

And as Van mentions, the method that I previously described doesn't enable full Maven functionality, so you can't do Maven build/install/test/etc. All that it does is allow the default Repast launchers to build/run using Maven managed dependencies (after converting to a Maven Project).

The original post I made, in case anyone else is interested, can be found here: https://sourceforge.net/p/repast/mailman/message/34207741/

On Wed, Jan 18, 2017 at 8:21 AM, Nick Collier <[hidden email]> wrote:
When you created the project as a Repast Project there should be a launchers folder with a .launcher file for the model. That is in fact the run configuration. Maybe there’s something about the maven nature that prevents it from showing up in the run menu. You can right click on that file and run it directly.

Nick

> On Jan 17, 2017, at 4:47 PM, Van Parunak <[hidden email]> wrote:
>
> I'm trying to use Maven to manage dependencies on external packages in a
> Repast Simphony project, based on David Momper's amazing detective work
> reported on this list on 12 June 2015. I've gotten to the point that all
> my sources compile correctly, so they find the Maven dependencies, and
> the project as a whole shows no errors. With an ordinary Repast project,
> at this point a run configuration would be available for the model, but
> apparently adding the Maven nature breaks that mechanism. Maven, of
> course, expects one to use Maven to build the project, but that won't
> work here because although David's hack allows Repast to find the Maven
> dependencies, Maven can't find the Repast dependencies. David tells me
> in private correspondence that when he did this 18 months ago, the run
> configuration just appeared as always, so apparently something has
> changed. I did try setting up a run configuration treating this as a
> Java project, but it complains it can't find the main method. How do I
> tell Eclipse to run such a model?
>
> Here are the details of what I've done so far.
>
> 1. Write a very simple RS project ( it just instantiates a single agent,
> which at each step makes an assignment to a variable and returns). When
> the agent is instantiated, it invokes gson, which is exposed via Maven.
>
> 2. Add the Maven nature via Configure --> Convert to Maven Project
>
> 3. Add a dependency in the POM to com.google.com.gson
>
> 4. Since Maven insists on resetting the JRE library to version 1.5,
>
>     a. In the POM, set the source and target in the
> maven-compiler-plugin to 1.8
>
>     b. Change the build path (back to) 1.8
>
> 5. Apply David Momper's hack to the model.launch file
>
> 6. Invoke Maven --> Update Maven to get Maven lined up with the new Java
> version
>
> At this point, my project directory has a "Maven Dependencies"
> subdirectory with the gson jar in it, all source files save without
> errors, and the overall project shows no errors. But there's no run
> configuration available.
>
> I'd be grateful for any hints, and once I get it to work, I'll post the
> overall recipe.
>
> Thanks!
>
> Van Parunak
>
>
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Repast-interest mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/repast-interest


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot


_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest

--
H. Van Dyke Parunak, Ph.D.
President, ABC Research, LLC

Superior solutions through Agent-Based and Complex systems
1027 Ferdon Road
Ann Arbor, MI 48104-3630
email: van.parunak@...
cell: 734 395 3253
www.ABCResearch.org

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fwd: Building a Mavenized Repast model

David Momper
I think that at some point line breaks were added to my post in order to make it more readable. There should be no line breaks at all. The entire <listEntry/>  element that you add to the Model.launch file should be on a single line, in the same way that the other classpath entries (JRE_CONTAINER and REPAST_SIMPHONY_LAUNCHER) both occupy a single line.

On Wed, Jan 18, 2017 at 4:31 PM, Van Parunak <[hidden email]> wrote:

I've almost got this working now--my problem was that David's hack in the original post has some line breaks at illegal locations, which killed the run config. I've got it running, but the .class files end up where they shouldn't (regardless of how one sets the build path). This is under investigation--I'll publish the full recipe once I get it sorted out.


On 1/18/17 16:41, David Momper wrote:
Nick is right, what I described was how to get Maven managed dependencies to work in the default Repast launchers that are automatically generated when you create a Repast project. In the Run Configurations list in Eclipse, these launchers will show up in the "Java Application" category as "[ProjectName] Model", "Batch [ProjectName] Model", and "Build Installer for [ProjectName] Model"

And as Van mentions, the method that I previously described doesn't enable full Maven functionality, so you can't do Maven build/install/test/etc. All that it does is allow the default Repast launchers to build/run using Maven managed dependencies (after converting to a Maven Project).

The original post I made, in case anyone else is interested, can be found here: https://sourceforge.net/p/repast/mailman/message/34207741/

On Wed, Jan 18, 2017 at 8:21 AM, Nick Collier <[hidden email]> wrote:
When you created the project as a Repast Project there should be a launchers folder with a .launcher file for the model. That is in fact the run configuration. Maybe there’s something about the maven nature that prevents it from showing up in the run menu. You can right click on that file and run it directly.

Nick

> On Jan 17, 2017, at 4:47 PM, Van Parunak <[hidden email]> wrote:
>
> I'm trying to use Maven to manage dependencies on external packages in a
> Repast Simphony project, based on David Momper's amazing detective work
> reported on this list on 12 June 2015. I've gotten to the point that all
> my sources compile correctly, so they find the Maven dependencies, and
> the project as a whole shows no errors. With an ordinary Repast project,
> at this point a run configuration would be available for the model, but
> apparently adding the Maven nature breaks that mechanism. Maven, of
> course, expects one to use Maven to build the project, but that won't
> work here because although David's hack allows Repast to find the Maven
> dependencies, Maven can't find the Repast dependencies. David tells me
> in private correspondence that when he did this 18 months ago, the run
> configuration just appeared as always, so apparently something has
> changed. I did try setting up a run configuration treating this as a
> Java project, but it complains it can't find the main method. How do I
> tell Eclipse to run such a model?
>
> Here are the details of what I've done so far.
>
> 1. Write a very simple RS project ( it just instantiates a single agent,
> which at each step makes an assignment to a variable and returns). When
> the agent is instantiated, it invokes gson, which is exposed via Maven.
>
> 2. Add the Maven nature via Configure --> Convert to Maven Project
>
> 3. Add a dependency in the POM to com.google.com.gson
>
> 4. Since Maven insists on resetting the JRE library to version 1.5,
>
>     a. In the POM, set the source and target in the
> maven-compiler-plugin to 1.8
>
>     b. Change the build path (back to) 1.8
>
> 5. Apply David Momper's hack to the model.launch file
>
> 6. Invoke Maven --> Update Maven to get Maven lined up with the new Java
> version
>
> At this point, my project directory has a "Maven Dependencies"
> subdirectory with the gson jar in it, all source files save without
> errors, and the overall project shows no errors. But there's no run
> configuration available.
>
> I'd be grateful for any hints, and once I get it to work, I'll post the
> overall recipe.
>
> Thanks!
>
> Van Parunak
>
>
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Repast-interest mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/repast-interest


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot


_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest

--
H. Van Dyke Parunak, Ph.D.
President, ABC Research, LLC

Superior solutions through Agent-Based and Complex systems
1027 Ferdon Road
Ann Arbor, MI 48104-3630
email: van.parunak@...
cell: <a href="tel:(734)%20395-3253" value="+17343953253" target="_blank">734 395 3253
www.ABCResearch.org

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Recipe for using Maven to manage dependencies in Repast

Van Parunak
In reply to this post by srcnick
The widespread use of Maven to distribute packages, and the inherited dependencies that they impose, make it really helpful to use Maven to manage dependencies in Repast Simphony (RS) projects. Building on David Momper's launcher hack (https://sourceforge.net/p/repast/mailman/message/34207741/), and with thanks to David and Nick for patiently helping me work through details, here's the recipe that works for me. NB: as David has emphasized in recent posts, we are using Maven only to manage dependencies, not to manage the build cycle. Repast still takes care of building, but it will now be able to link in dependencies defined in Maven.

1. Go to the Eclipse marketplace, and install the m2e Maven Integration for Eclipse plugin.

2. Create a new RS (Repast Simphony) project.

3. Add the Maven nature: in the package explorer, right click on the project, Configure --> Convert to Maven Project. You will now have pom.xml visible at the top level of your project directory.

4. It's a well-known bother that Maven insists on resetting the JRE library and compiler preference to version 1.5. If you're not using 1.5,

    a. In pom.xml, set the source and target in the 
maven-compiler-plugin to 1.8 (or whatever you're using). The <build> section of the POM should look like this:
<build> <sourceDirectory>src</sourceDirectory> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins> </build>
b. Right click on the project, Maven --> Update Project to set the JRE System Library consistent with the setting in the POM. 5. Add your dependencies to the POM. You'll now have a "Maven Dependencies" folder containing them. 6. Apply David Momper's hack to the model.launch file in the "launchers" directory: in the section that begins <listAttribute key="org.eclipse.jdt.launching.CLASSPATH">, insert the following, ALL AS ONE LINE:
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER&quot; path=&quot;3&quot; type=&quot;4&quot;/&gt;&#13;&#10;"/>
7. Code away. You can import classes from any of the Maven dependencies, just as you would from Repast or Java. You'll see that Maven has added a "Maven Dependencies" folder with all of the dependencies you added to the POM. 8. Now you want to run your program. Each time you save your files, Repast updates the class files. Without Maven, Repast puts its class files in the bin/<packageName> directory, and that's where Eclipse expects to find them when you select the run configuration. But with the Maven nature, the files end up in target/classes/<packageName>, which you can't even see in the Eclipse package explorer. (You can see them in the PROJECT explorer, if you change the default filters.) To allow the run configuration to find the class files, edit <projectName>.rs/user_path.xml. The default Repast version contains this element:
<classpath> <agents path="../bin" /> <entry path="../lib" /> </classpath>
Change the agents path entry to <agents path="../target/classes" />, and now your run configuration will find and run your masterpiece.

--
H. Van Dyke Parunak, Ph.D.
President, ABC Research, LLC

Superior solutions through Agent-Based and Complex systems
1027 Ferdon Road
Ann Arbor, MI 48104-3630
email: van.parunak@...
cell: 734 395 3253
www.ABCResearch.org

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Problems with SugarScape in 2.4.1

Van Parunak
For some reason, I can't get the SugarScape demo supplied with the 2.4.1 distribution to run. When I press the "Initialize Run" button on the interface, the Eclipse console says:
objc[75306]: Class ContextUpdater is implemented in both /private/var/folders/6m/j2vdcg7x7qd0330j839pr0v00000gn/T/jogamp_0000/file_cache/jln6478740876802497423/jln6188523417513059574/libjogl_desktop.jnilib and /System/Library/Java/Extensions/libJ3D.jnilib. One of the two will be used. Which one is undefined.
JavaVM WARNING: JAWT_GetAWT must be called after loading a JVM
AWT not found
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: apple/awt/CGraphicsDevice
    at javax.media.j3d.GraphicsConfigTemplate3D.<clinit>(GraphicsConfigTemplate3D.java:55)
    at repast.simphony.visualization.visualization3D.Display3D.initFirstRender(Display3D.java:151)
    at repast.simphony.visualization.visualization3D.Display3D.render(Display3D.java:434)
    at repast.simphony.ui.RSGui.addViewsFromRegistry(RSGui.java:300)
    at repast.simphony.ui.RSApplication.initSim(RSApplication.java:164)
    at repast.simphony.ui.action.InitRun.actionPerformed(InitRun.java:17)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
    at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
    at java.awt.Component.processMouseEvent(Component.java:6533)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
    at java.awt.Component.processEvent(Component.java:6298)
    at java.awt.Container.processEvent(Container.java:2236)
    at java.awt.Component.dispatchEventImpl(Component.java:4889)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
    at java.awt.Container.dispatchEventImpl(Container.java:2280)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.ClassNotFoundException: apple.awt.CGraphicsDevice
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 43 more
I'm running Java 1.8.0_102 on a MacBook Pro running OS X 10.10.5.

One irregularity that might or might not be in play: if I create a brand new workspace, open Eclipse (Neon.1, Release 4.6.1, the one in the Repast distro), then import SugarScape from the Repast distribution, I get a warning window saying 
'Update Installed JREs' has encountered a problem.
Resource '/.org/eclipse.jdt.core.external.folders' already exists.
I'd be grateful for help on either or both of these issues.
Thanks!


--
H. Van Dyke Parunak, Ph.D.
President, ABC Research, LLC

Superior solutions through Agent-Based and Complex systems
1027 Ferdon Road
Ann Arbor, MI 48104-3630
email: van.parunak@...
cell: 734 395 3253
www.ABCResearch.org

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Simphony: Using NetworkBuilder and Network

Van Parunak
I'm working on an application using graphs that are not embedded in a physical space, and have two questions about the Network projection and the NetworkBuilder class that the Repast Simphony Reference recommends using.

First, the Reference (and the JavaDocs page) says that NetworkBuilder can load a file in the DL file format. It can indeed load an unlabeled graph matrix like this:
dl n=5
data:
0 1 1 1 0
1 0 0 0 1
1 0 0 1 0
1 0 1 0 1
0 1 0 1 0
But it chokes on the labeled  form of DL:
dl n=5
format = fullmatrix
labels:
barry,david,lin,pat,russ
data:
0 1 1 1 0
1 0 0 0 1
1 0 0 1 0
1 0 1 0 1
0 1 0 1 0
It also does not like the edge list format:
DL n=5
format = edgelist1
labels:
george, sally, jim, billy, jane
data:
1 2
1 3
2 3
3 1
4 3
I've got to think there is some labeled DL format that it will handle--can someone help me?

Second: in the days of Repast J, there was a GraphLayout class with methods that could be applied to a graph before passing it to Network2DDisplay, including circular, random, Fruchmen-Reingold, and Kamada Kawai layout options. Does the new network system include some similar resource, or is it necessary to pair every network projection with a continuous space and compute one's own layout?

Thanks!

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Simphony: Using NetworkBuilder and Network

srcnick
Re. the labels, I think the excel format supports that although the DL one does not. 

Re. the layouts, I think these still work although I haven't used them in ages:


If you have visualization a network by itself via the wizard you will be asked for a layout class.

Nick

On Sat, Jan 21, 2017 at 5:36 PM, Van Parunak <[hidden email]> wrote:
I'm working on an application using graphs that are not embedded in a physical space, and have two questions about the Network projection and the NetworkBuilder class that the Repast Simphony Reference recommends using.

First, the Reference (and the JavaDocs page) says that NetworkBuilder can load a file in the DL file format. It can indeed load an unlabeled graph matrix like this:
dl n=5
data:
0 1 1 1 0
1 0 0 0 1
1 0 0 1 0
1 0 1 0 1
0 1 0 1 0
But it chokes on the labeled  form of DL:
dl n=5
format = fullmatrix
labels:
barry,david,lin,pat,russ
data:
0 1 1 1 0
1 0 0 0 1
1 0 0 1 0
1 0 1 0 1
0 1 0 1 0
It also does not like the edge list format:
DL n=5
format = edgelist1
labels:
george, sally, jim, billy, jane
data:
1 2
1 3
2 3
3 1
4 3
I've got to think there is some labeled DL format that it will handle--can someone help me?

Second: in the days of Repast J, there was a GraphLayout class with methods that could be applied to a graph before passing it to Network2DDisplay, including circular, random, Fruchmen-Reingold, and Kamada Kawai layout options. Does the new network system include some similar resource, or is it necessary to pair every network projection with a continuous space and compute one's own layout?

Thanks!

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problems with SugarScape in 2.4.1

srcnick
In reply to this post by Van Parunak
For some reason OS X installs an ancient version of java 3D that conflicts with more recent versions. The fix is described in:


See the section on Vecmath / Jogl/ Java3D Exceptions

Nick

On Sat, Jan 21, 2017 at 9:25 AM, Van Parunak <[hidden email]> wrote:
For some reason, I can't get the SugarScape demo supplied with the 2.4.1 distribution to run. When I press the "Initialize Run" button on the interface, the Eclipse console says:
objc[75306]: Class ContextUpdater is implemented in both /private/var/folders/6m/j2vdcg7x7qd0330j839pr0v00000gn/T/jogamp_0000/file_cache/jln6478740876802497423/jln6188523417513059574/libjogl_desktop.jnilib and /System/Library/Java/Extensions/libJ3D.jnilib. One of the two will be used. Which one is undefined.
JavaVM WARNING: JAWT_GetAWT must be called after loading a JVM
AWT not found
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: apple/awt/CGraphicsDevice
    at javax.media.j3d.GraphicsConfigTemplate3D.<clinit>(GraphicsConfigTemplate3D.java:55)
    at repast.simphony.visualization.visualization3D.Display3D.initFirstRender(Display3D.java:151)
    at repast.simphony.visualization.visualization3D.Display3D.render(Display3D.java:434)
    at repast.simphony.ui.RSGui.addViewsFromRegistry(RSGui.java:300)
    at repast.simphony.ui.RSApplication.initSim(RSApplication.java:164)
    at repast.simphony.ui.action.InitRun.actionPerformed(InitRun.java:17)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
    at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
    at java.awt.Component.processMouseEvent(Component.java:6533)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
    at java.awt.Component.processEvent(Component.java:6298)
    at java.awt.Container.processEvent(Container.java:2236)
    at java.awt.Component.dispatchEventImpl(Component.java:4889)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
    at java.awt.Container.dispatchEventImpl(Container.java:2280)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.ClassNotFoundException: apple.awt.CGraphicsDevice
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 43 more
I'm running Java 1.8.0_102 on a MacBook Pro running OS X 10.10.5.

One irregularity that might or might not be in play: if I create a brand new workspace, open Eclipse (Neon.1, Release 4.6.1, the one in the Repast distro), then import SugarScape from the Repast distribution, I get a warning window saying 
'Update Installed JREs' has encountered a problem.
Resource '/.org/eclipse.jdt.core.external.folders' already exists.
I'd be grateful for help on either or both of these issues.
Thanks!


--
H. Van Dyke Parunak, Ph.D.
President, ABC Research, LLC

Superior solutions through Agent-Based and Complex systems
1027 Ferdon Road
Ann Arbor, MI 48104-3630
email: van.parunak@...
cell: <a href="tel:(734)%20395-3253" value="+17343953253" target="_blank">734 395 3253
www.ABCResearch.org

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Loading...