Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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
`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.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2014. All Rights Reserved.