Mentions légales du service

Skip to content
Snippets Groups Projects
ObservableEvent.h 4.04 KiB
Newer Older
// ****************************************************************************
//
//          Aevol - An in silico experimental evolution platform
//
// ****************************************************************************
//
// Copyright: See the AUTHORS file provided with the package or <www.aevol.fr>
// Web: http://www.aevol.fr/
// E-mail: See <http://www.aevol.fr/contact/>
// Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
//
// ****************************************************************************

Vincent Liard's avatar
Vincent Liard committed
#ifndef AEVOL_OBSERVABLEEVENT_H_
#define AEVOL_OBSERVABLEEVENT_H_
enum ObservableEvent {
  NEW_INDIV,
  MUTATION,
  END_REPLICATION,
#ifdef __REGUL
class Individual_R;
#else

class NewIndivEvent {
 public:
#ifdef __REGUL
  NewIndivEvent(Individual_R* childx, Individual_R* parentx, int xx, int yx, int indiv_id, int parent_id) {
    child = childx;
    parent = parentx;
    simd_parent = nullptr;
    simd_child = nullptr;
    indiv_id_ = indiv_id;
    parent_id_ = parent_id;
    x = xx;
    y = yx;
  }
#else
    NewIndivEvent(Individual* childx, Individual* parentx, int xx, int yx, int indiv_id, int parent_id) {
      child = childx;
      parent = parentx;
      simd_parent = nullptr;
      simd_child = nullptr;
#ifdef __EUKARYOTE
 NewIndivEvent(Individual_7* childx,
               Individual_7* parent1, Individual_7* parent2,
               int xx, int yx, int indiv_id,
               int parent1_id, int parent2_id,
               bool remote = true, int32_t rank = -1) {
        simd_child = childx;
        simd_parent = parent1;
        simd_parent2 = parent2;
        child = nullptr;
        parent = nullptr;

        indiv_id_ = indiv_id;
        parent_id_ = parent1_id;
        parent2_id_ = parent2_id;
        x = xx;
        y = yx;
        remote_ = remote;
        rank_ = rank;
    }
#else
    NewIndivEvent(Individual_7* childx,
                  Individual_7* parentx, int xx, int yx, int indiv_id, int parent_id, bool remote = true, int32_t rank = -1) {
        indiv_id_ = indiv_id;
        parent_id_ = parent_id;
#ifdef __REGUL
  Individual_R* child;
  Individual_R* parent;
#else
    Individual* child;
    Individual* parent;
    Individual_7* simd_child;
    Individual_7* simd_parent;
    #ifdef __EUKARYOTE
    Individual_7* simd_parent2;

    int parent2_id_;
    #endif
};

class EndReplicationEvent {
 public:
#ifdef __REGUL
    EndReplicationEvent(Individual_R* childx, int xx, int yx) {
#else
      EndReplicationEvent(Individual* childx, int xx, int yx) {
#endif
    EndReplicationEvent(Individual_7* childx, int xx, int yx) {
#ifdef __REGUL
    Individual_R* child;
#else
    Individual_7* simd_child;
Vincent Liard's avatar
Vincent Liard committed
#endif //AEVOL_OBSERVABLEEVENT_H_