swarm-support
[Top][All Lists]
Advanced

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

Archiver / syntax


From: Holger Perlt
Subject: Archiver / syntax
Date: Thu, 11 Oct 2001 07:55:09 +0200

Hello,

I have tried to incorporate the Averager into my program.
It sould average a list (AvPreisList), especially the numbers
which are stored there. The numbers are available via a
getNum method.

First the creation:
*******************

- buildObjects
{

  AvPreisList = [List create:  [self getZone]];

  AveragePreis = [Averager createBegin: [self getZone]];
  [AveragePreis setCollection: AvPreisList];
  AveragePreis = [AveragePreis createEnd];

  return self;

}

Now the use:
************

- (double) getWinAvPreis
{

  double ap;
  Integer *hh;
  ap = 0.0;


   if(Time < 10){
    hh = [Integer create: [self getZone]];
    [hh setNum: PreisPerAktie];
    [AvPreisList addLast: hh];
    ap = AvPreis;
  }
  else{

    [AvPreisList removeFirst];
    hh = [Integer createBegin: [self getZone]];
    [hh setNum: PreisPerAktie];
    [AvPreisList addLast: hh];

    ap = [AveragePreis getAverage];
    }


        return ap;
}

This does not work - as I know - because AveragePreis does not know
how to get the numbers in order to average anything. But I do not know
how to tell this AveragePreis.

Holger


-- 
PD Dr. habil. Holger Perlt
Diplomphysiker/Geschäftsführer
Reinforcement Control GmbH
Karl-Heine-Str. 99
04229 Leipzig
Germany
Phone:  ++49 (0)341 9410370
Fax:    ++49 (0)341 9410372
http://www.reinforcement.de

                  ==================================
   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]