[kepler-code] r28792 - trunk/modules/science-pipes-backend/src/edu/cornell/birds/is/bap/actor/survivorship

barseghian at ecoinformatics.org barseghian at ecoinformatics.org
Thu Oct 13 20:17:40 PDT 2011


Author: barseghian
Date: 2011-10-13 20:17:40 -0700 (Thu, 13 Oct 2011)
New Revision: 28792

Added:
   trunk/modules/science-pipes-backend/src/edu/cornell/birds/is/bap/actor/survivorship/LifeTable.java
Log:
actor for displaying Life Table from demography data. needs work

Added: trunk/modules/science-pipes-backend/src/edu/cornell/birds/is/bap/actor/survivorship/LifeTable.java
===================================================================
--- trunk/modules/science-pipes-backend/src/edu/cornell/birds/is/bap/actor/survivorship/LifeTable.java	                        (rev 0)
+++ trunk/modules/science-pipes-backend/src/edu/cornell/birds/is/bap/actor/survivorship/LifeTable.java	2011-10-14 03:17:40 UTC (rev 28792)
@@ -0,0 +1,95 @@
+/**
+ *    '$RCSfile: RExpression.java,v $'
+ *
+ *     '$Author: pea1 $'
+ *       '$Date: 2009/03/25 15:51:49 $'
+ *   '$Revision: 1.2 $'
+ *
+ *  For Details: http://kepler.ecoinformatics.org
+ *
+ * Copyright (c) 2003 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Permission is hereby granted, without written agreement and without
+ * license or royalty fees, to use, copy, modify, and distribute this
+ * software and its documentation for any purpose, provided that the
+ * above copyright notice and the following two paragraphs appear in
+ * all copies of this software.
+ *
+ * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
+ * FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
+ * IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY
+ * OF SUCH DAMAGE.
+ *
+ * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+ * PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY
+ * OF CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT,
+ * UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ */
+
+package edu.cornell.birds.is.bap.actor.survivorship;
+
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.ecoinformatics.seek.R.RExpression;
+
+import ptolemy.actor.TypedIOPort;
+import ptolemy.kernel.CompositeEntity;
+import ptolemy.kernel.util.IllegalActionException;
+import ptolemy.kernel.util.NameDuplicationException;
+
+
+public class LifeTable extends RExpression {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 3628449403386107672L;
+
+	public static Log log = LogFactory.getLog(LifeTable.class);
+
+	//public TypedIOPort outPort;
+	public TypedIOPort dataPort;
+	
+
+	/** Construct an actor with the given container and name.
+	 *  @param container The container.
+	 *  @param name The name of this actor.
+	 *  @exception IllegalActionException If the actor cannot be contained
+	 *   by the proposed container.
+	 *  @exception NameDuplicationException If the container already has an
+	 *   actor with this name.
+	 */
+	public LifeTable(CompositeEntity container, String name)
+	throws NameDuplicationException, IllegalActionException  {
+		super(container, name);
+		
+        dataPort = new TypedIOPort(this, "dataPort", true, false);
+        //dataPort.setTypeEquals(BaseType.GENERAL);    	
+    	
+		//outPort = new TypedIOPort(this, "out", false, true);
+		//outPort.setTypeEquals(BaseType.OBJECT);
+
+		expression.setExpression("filled in when actor fires");
+	}
+
+	public void fire() throws IllegalActionException {
+		
+		//TODO should probably change from summary to a dataframe of our making
+		String survivalCurveRcode = "" +
+			"demographyData.survfit <- dataPort\n" + 
+			"library(survival)\n" +
+			"summary(demographyData.survfit)\n";
+			//"out <- summary(demographyData.survfit)\n";
+		
+		expression.setExpression(survivalCurveRcode);
+		
+        super.fire();
+	}
+	
+	
+}


Property changes on: trunk/modules/science-pipes-backend/src/edu/cornell/birds/is/bap/actor/survivorship/LifeTable.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain



More information about the Kepler-cvs mailing list