-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
38 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
''' Definition of individual class with decimal encoding. | ||
''' | ||
|
||
from .individual import IndividualBase | ||
|
||
|
||
class DecimalIndividual(IndividualBase): | ||
''' Individual with decimal encoding. | ||
''' | ||
def __init__(self, ranges, eps=0.001): | ||
super(self.__class__, self).__init__(ranges, eps) | ||
# Initialize it randomly. | ||
self.init() | ||
|
||
def encode(self): | ||
return self.solution | ||
|
||
def decode(self): | ||
return self.solution | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters