Skip Menu |

This queue is for tickets about the AI-Genetic-Pro CPAN distribution.

Report information
The Basics
Id: 61621
Status: resolved
Priority: 0/
Queue: AI-Genetic-Pro

People
Owner: Nobody in particular
Requestors: tod222 [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.341
Fixed in: (no value)



Subject: rangevector values truncated to signed 8-bit quantities
If a rangevector is defined that exceeds 127, like this [ 1, 253 ] any values over 127 will get truncated to signed 8-bit values, like so: $ga->inject( [ [64], [126], [129], [250] ] ); # values become 64 126 -127 -6 The check of values against scope works correctly, although valid values are truncated: $ga->init( [ [ 1, 5000 ], ] ); $ga->inject( [ [4500] ] ); # becomes -108 # correctly triggers scope error $ga->inject( [ [5500] ] ); # Value out of scope in the injected chromosome of type "rangevector": 5500 AI-Genetic-Pro-0.341 Perl v5.10.1 & v5.12.2 on Ubuntu 10.04.1 LTS Linux computer 2.6.32-24-generic #43-Ubuntu SMP Thu Sep 16 14:58:24 UTC 2010 x86_64 GNU/Linux
Subject: test_rangevector1_AI-Genetic-Pro
Download test_rangevector1_AI-Genetic-Pro
application/octet-stream 1.1k

Message body not shown because it is not plain text.

Subject: test_rangevector2_AI-Genetic-Pro
Download test_rangevector2_AI-Genetic-Pro
application/octet-stream 1.2k

Message body not shown because it is not plain text.

Subject: Provisional patch for rangevector values truncated to signed 8-bit quantities
From: tod222 [...] gmail.com
Here's a patch (see attached file) which seems to fix it, just a one line change to sub init. The fixed line: else{ for(@{$self->_translations}){ $size = $_->[2] if $_->[2] > $size; } } Needs more testing than I've done yet, but it works much better than it did. Also, sub _check_data_ref seems to have a var ($ars) which is used without ever getting initialized to something to undef. Don't understand why it doesn't throw an error.
Subject: patch_AI_Genetic_Pro
Download patch_AI_Genetic_Pro
application/octet-stream 478b

Message body not shown because it is not plain text.

Fixed in 0.401.