Skip to content

Commit

Permalink
fix after change of mutability check
Browse files Browse the repository at this point in the history
  • Loading branch information
arcuri82 committed Oct 30, 2024
1 parent 5c34ac0 commit f02ad8f
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import kotlin.math.min

class StringGene(
name: String,
var value: String = "foo",
var value: String = DEFAULT_VALUE,
/** Inclusive */
val minLength: Int = 0,
/**
Expand Down Expand Up @@ -76,13 +76,18 @@ class StringGene(
if (minLength>maxLength) {
throw IllegalArgumentException("Cannot create string gene ${this.name} with minimum length ${this.minLength} and maximum length ${this.maxLength}")
}
if(value == DEFAULT_VALUE && value.length > maxLength){
value = value.substring(0, maxLength)
}
}

companion object {

private val log: Logger = LoggerFactory.getLogger(StringGene::class.java)

private const val PROB_CHANGE_SPEC = 0.1

private const val DEFAULT_VALUE = "foo"
}

private var validChar: String? = null
Expand Down

0 comments on commit f02ad8f

Please sign in to comment.