Empty is not allowed as random type
This commit is contained in:
parent
76e1a17f6d
commit
571c3863c0
1 changed files with 2 additions and 4 deletions
|
|
@ -208,7 +208,7 @@ impl<'a> NodeModifier<'a> {
|
||||||
self.picked_node.handler = to.unwrap_or(self.get_random_handler());
|
self.picked_node.handler = to.unwrap_or(self.get_random_handler());
|
||||||
}
|
}
|
||||||
pub fn get_random_handler(&self) -> NodeHandler {
|
pub fn get_random_handler(&self) -> NodeHandler {
|
||||||
let picked = random_range(0..4);
|
let picked = random_range(0..3);
|
||||||
|
|
||||||
if picked == 0 {
|
if picked == 0 {
|
||||||
NodeHandler::Number {
|
NodeHandler::Number {
|
||||||
|
|
@ -216,10 +216,8 @@ impl<'a> NodeModifier<'a> {
|
||||||
}
|
}
|
||||||
} else if picked == 1 {
|
} else if picked == 1 {
|
||||||
self.function_mutation_pool[random_range(0..self.function_mutation_pool.len())].clone()
|
self.function_mutation_pool[random_range(0..self.function_mutation_pool.len())].clone()
|
||||||
} else if picked == 2 {
|
|
||||||
NodeHandler::Variable
|
|
||||||
} else {
|
} else {
|
||||||
NodeHandler::Empty
|
NodeHandler::Variable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub fn get_random_node(&self) -> Node {
|
pub fn get_random_node(&self) -> Node {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue