[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Averager usage
From: |
Jan Kreft |
Subject: |
Re: Averager usage |
Date: |
Tue, 22 Jun 1999 08:25:16 +0100 (BST) |
Steve,
this won't solve your compile problem, but I note you cast 0 to an id (j
is zero first time round). Could that lead to trouble?
Jan.
On Tue, 22 Jun 1999 address@hidden wrote:
>
> 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.
>
>
==================================
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.