org.encog.ml.ea.rules

## Interface RuleHolder

- All Known Implementing Classes:
    BasicRuleHolder

      public interface RuleHolder

  Holds a set of rules for an EA.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addConstraintRule(ConstraintRule rule)` Add a constraint rule.
    `void` | `addRewriteRule(RewriteRule rule)` Add a rewrite rule.
    `List<ConstraintRule>` | `getConstraintRules()`
    `List<RewriteRule>` | `getRewriteRules()`
    `boolean` | `isValid(Genome genome)` Determine if the specified genome is valid according to the constraint rules.
    `void` | `rewrite(Genome genome)` Rewrite the specified genome.

- - ### Method Detail

    - #### addRewriteRule

          void addRewriteRule(RewriteRule rule)

      Add a rewrite rule. Rewrite rules can be used to simplify genomes.
      Parameters:
        `rule` - The rule to add.

    - #### addConstraintRule

          void addConstraintRule(ConstraintRule rule)

      Add a constraint rule.
      Parameters:
        `rule` - The rule to add.

    - #### rewrite

          void rewrite(Genome genome)

      Rewrite the specified genome. The genome will still perform the same function, but it may be shorter.
      Parameters:
        `genome` - The genome to rewrite.

    - #### isValid

          boolean isValid(Genome genome)

      Determine if the specified genome is valid according to the constraint rules.
      Parameters:
        `genome` - The gnome to check.
      Returns:
        True, if the genome is valid.

    - #### getConstraintRules

          List<ConstraintRule> getConstraintRules()

      Returns:
        The list of constraints.

    - #### getRewriteRules

          List<RewriteRule> getRewriteRules()

      Returns:
        The rewrite rules.

Copyright © 2014. All Rights Reserved.