Module fitnessutil
[hide private]
[frames] | no frames]

Module fitnessutil

source code

fitnessutil

Contains different methods used for problem specific fitness functions. These are domain dependent utilities that are used for computing the fitness function. e.g. the problem is about reading a list of motion capture frames and we need a function that gives indexes of different groups of frames.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Author: by Mehdi Khoury

Version: 1.20

Copyright: (c) 2009 Mehdi Khoury under the mit license http://www.opensource.org/licenses/mit-license.html

Contact: mehdi.khoury at gmail.com

Functions [hide private]
 
GetIndexesOfGroupsInList(ml)
finds groups of identical elements in a list and gives their starting and last indexes.
source code
 
GetInputDataFromFile(myfile) source code
 
ReplaceUsingBinaryMask(listElem, binarymask, initial, replacement) source code
 
UncompressList(listTuples) source code
Variables [hide private]
  __package__ = None
Function Details [hide private]

GetIndexesOfGroupsInList(ml)

source code 

Function: GetIndexesOfGroupsInList

finds groups of identical elements in a list and gives their starting and last indexes.

Parameters:
  • ml - a list of elements. e.g. ml=[1,1,1,1,1,2,2,3,4,5,5,5,6]

    returns: A list of tuples, where each tuple is of the form (group_discrete_val,group_first_ind,group_last_ind). e.g. [(1, 0, 4), (2, 5, 6), (3, 7, 7), (4, 8, 8), (5, 9, 11), (6, 12, 12)]