Subject: How to make an action only one time ?
From: Fabrice Vinatier (fabrice.vinatier@cirad.fr)
Date: Mon Jun 30 2008 - 17:10:53 CEST
Hello,
I am looking for a way to make an action only one time, although the
condition is still valid for the next time steps.
I send the code :
(self thePlants select: [:a | a growingState = #harvesting]) size > 0
ifTrue:
[self saveAttackDistributions.
self savePopDistributions]
AttackDistributions and PopDistributions are saved in a file .txt, but
if there is 10 time steps after harvesting, for example, the saving will
be done ten times.
If you have an idea of how to prevent this ?
Cheers,
-- Fabrice Vinatier Modélisation / EntomologieCIRAD - PRAM Unité de recherche Systèmes de culture bananes, plantains et ananas
Téléphone : 05 96 42 30 58
!! Nouvelle adresse email !! fabrice.vinatier@cirad.fr