swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Averager usage


From: sme
Subject: Averager usage
Date: Tue, 22 Jun 1999 05:56:34 +0100

waterID                = WaterClass object
waterColumn            = List of WaterClass objects
phytoID                = PhytoClass object
phytoList              = List of PhytoClass objects
chla, chlb, chlc, caro = instance variables of phytoID
each waterID has a phytoList

I want to calculate the average of each separate pigment (chla..caro)
for each individual species (phytoID) down the water column. i.e. the
Averager object must iterate:

foreach phytoID
   foreach pigment in [chla, chlb, chlc, caro]
      print average across waterColumn
   }
}

My clumsy effort resulted in:

  averageID = [Averager createBegin: [self getZone]];
  [averageID setCollection: waterColumn];
  averageID = [averageID createEnd];
  for (j=0;j<phyN;j++) {
    for (i=1;i<=4;i++) {
      [averageID setProbedSelector: M(getPigments:Species:):(id)i:(id)j];
      [averageID update];
      printf("%e ",[averageID getAverage]);
    }
  }

This leads to a compiler error:

OceanClass.m:481: warning: return type for `setProbedSelector:::' defaults to id

The relevant includes are:
#import <objectbase/SwarmObject.h>
#import <objectbase.h>
#import <simtoolsgui.h>
#import <random.h>
#import <analysis.h>
#import <activity.h>

but the error is probably in the syntax of the setProbedSelector
method. Any help appreciated

-- 
  Steve Emsley                    Ecology & Epidemiology Group
-----------------------------------------------------------------
  address@hidden                   University of Warwick

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]