More Examples... #117661/v270 |
Tags:
Educational Examples'Hello World'
Implementation
package helloworld; import oms3.annotations.*; @Description("A simple component"). public class Component { @In public String message; @Execute public void run() { System.out.println(message); } }
OMS3/NetLogo Integration Prototype.
Download
Method
What has to be done from a NetLogo developer's perspective?
1 ; @Description("Simulates the spread of a fire through a forest.") 2 ; @Author(name="NetLogo user") 3 globals [ 4 5 ; @In 6 ; @Description("Forest density") 7 ; density 8 9 ; @Out(name="burned_trees") 10 ; @Description("Number of burned trees.") 11 burned-trees 12 13 initial-trees ;; how many trees (green patches) we started with 14 ] 15 16 ; @Execute 17 to execute ;; the execution function 18 random-seed 0 19 setup 20 repeat 50 [ go ] 21 end 22 ... 23 ; more code to follow Lines 1,2,5,6,9,10,16 contain OMS3 Annotations within comments. Implementation Notes
OMS3/Fortran9x Integration Example.
Download
Method
MainOMS.f90 ! @Description ("WEPP hillslope erosion component") ! @Author (name="j.c. ascough ii and d.c. flanagan") ! @Keywords ("Erosion") ! @VersionInfo ("$Id: MainOMS.f90 367 2009-08-28 22:21:52Z odavid $") ! @License ("http://www.gnu.org/licenses/gpl-2.0.html") ! @Documentation ("BasinSm.xml") ! @Execute SUBROUTINE wecall(eroout, eroout_len, eroplot, eroplot_len, runoff, peakro, effdrn, npart, spg, outd) USE, INTRINSIC :: ISO_C_BINDING IMPLICIT NONE ! @Description("Erosion output name") ! @In CHARACTER(kind = C_CHAR, len = eroout_len) :: eroout INTEGER(C_INT), VALUE :: eroout_len ! @Description("Erosion plot name") ! @In CHARACTER(kind = C_CHAR, len = eroplot_len) :: eroplot INTEGER(C_INT), VALUE :: eroplot_len ! @In REAL(C_FLOAT) :: runoff, peakro, effdrn ! @In INTEGER(C_INT) :: npart ! @In REAL(C_FLOAT), DIMENSION(npart) :: spg ! @Out REAL(C_FLOAT) :: outd print *, runoff, peakro, effdrn print *, npart print *, spg print *, eroout print *, eroplot print *, 'done...... ' outd = outd + 4.36 END SUBROUTINE Installation Requirements To compile and run this example you need to have ANT 1.8+, and some GCC 4.x version installed that contains gfortran. the commands for ant and gfortran have to be in the PATH variable. The example project was tested under Linux, Windows, and OSX. |
Navigation Bar for Object Modeling System
Resources:
Downloads ![]() Mercurial Repository ![]() OMS API Javadoc ![]() Publications & Presentations Annotation Reference DSL Reference Handbook 3.0 ![]() Frequently Asked Questions (FAQ) OMS License (LGPL 2.1) ![]() New Users: 1. Get a JF account 2. Join the OMS project Contact Us: Jack Carlson ![]() Coordinator, OMS Laboratory OMS Laboratory ![]() [email protected] (970) 492-7323 Olaf David |
helloworld.zip
-'Hello World' example Project