Class: Wallace::Species::BitStringSpecies
- Inherits:
-
ArraySpecies
- Object
- Wallace::Species
- ArraySpecies
- Wallace::Species::BitStringSpecies
- Defined in:
- lib/species/bit_string_species.rb
Overview
Bit-strings are implemented as a specialised form of array species that are confined to only containing 0 and 1 integers.
Instance Attribute Summary
Attributes inherited from Wallace::Species
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ BitStringSpecies
constructor
Constructs a new bit-string based species.
Methods inherited from ArraySpecies
Methods inherited from Wallace::Species
Constructor Details
#initialize(opts = {}) ⇒ BitStringSpecies
Constructs a new bit-string based species.
Parameters:
-
opts, hash of keyword options used by this method. -> id, the unique identifier for this species. -> length, the length constraints imposed on individuals of this species.
13 14 15 16 |
# File 'lib/species/bit_string_species.rb', line 13 def initialize(opts = {}) opts[:length] = [0, 1] super(opts) end |