[mlpack-git] [mlpack/mlpack] CNE algorithm (#753)

Marcus Edel notifications at github.com
Sun Aug 7 09:42:46 EDT 2016


> +      aId = genome.aId;
> +      aNeuronGenes = genome.aNeuronGenes;
> +      aLinkGenes = genome.aLinkGenes;
> +      aNumInput = genome.aNumInput;
> +      aNumOutput = genome.aNumOutput;
> +      aFitness = genome.aFitness;
> +    }
> +
> +    return *this;
> +  }
> +
> +  // Get genome id.
> +  int Id() const { return aId; }
> +
> +  // Set genome id.
> +  void Id(int id) { aId = id; }

Generally we use a setter function that takes the input as an argument if it's necessary to validate what the user is setting the value to. Otherwise, we use a function that allows a direct access e.g.:

```
//! Get the genome id.
int Id() const { return id; }
//! Modify the genome id.
int& Id() { return id; }
```

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/753/files/10b99ab5c6e8d2836d231fa60a898cc03f7d9192#r73802116
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160807/178c3d4f/attachment.html>


More information about the mlpack-git mailing list