Categorical crossingover
This commit is contained in:
parent
b6098ce825
commit
66a4c4fa46
3 changed files with 13 additions and 7 deletions
|
|
@ -53,6 +53,5 @@ text = "Категориальная трансформация"
|
||||||
godot_genome_a = NodePath("../../GenomeA")
|
godot_genome_a = NodePath("../../GenomeA")
|
||||||
godot_genome_b = NodePath("../../GenomeB")
|
godot_genome_b = NodePath("../../GenomeB")
|
||||||
|
|
||||||
[connection signal="genome_updated" from="GenomeA" to="CanvasLayer/HBoxContainer" method="_on_genome_a_genome_updated"]
|
|
||||||
[connection signal="pressed" from="CanvasLayer/HBoxContainer/Allelic" to="CanvasLayer/HBoxContainer" method="_on_allelic_pressed"]
|
[connection signal="pressed" from="CanvasLayer/HBoxContainer/Allelic" to="CanvasLayer/HBoxContainer" method="_on_allelic_pressed"]
|
||||||
[connection signal="pressed" from="CanvasLayer/HBoxContainer/Categoric" to="CanvasLayer/HBoxContainer" method="_on_categoric_pressed"]
|
[connection signal="pressed" from="CanvasLayer/HBoxContainer/Categoric" to="CanvasLayer/HBoxContainer" method="_on_categoric_pressed"]
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,5 @@ func _on_allelic_pressed() -> void:
|
||||||
|
|
||||||
|
|
||||||
func _on_categoric_pressed() -> void:
|
func _on_categoric_pressed() -> void:
|
||||||
pass # Replace with function body.
|
reference_pair_modifier.categoric_crossingover()
|
||||||
|
|
||||||
|
|
||||||
func _on_genome_a_genome_updated() -> void:
|
|
||||||
print("test")
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,17 @@ impl ReferencePairModifier {
|
||||||
let (genome_a,genome_b) = pair.allelic_crossingover(None);
|
let (genome_a,genome_b) = pair.allelic_crossingover(None);
|
||||||
self.godot_genome_a.as_mut().unwrap().bind_mut().set_genome(genome_a);
|
self.godot_genome_a.as_mut().unwrap().bind_mut().set_genome(genome_a);
|
||||||
self.godot_genome_b.as_mut().unwrap().bind_mut().set_genome(genome_b);
|
self.godot_genome_b.as_mut().unwrap().bind_mut().set_genome(genome_b);
|
||||||
godot_print!("Kukayan");
|
}
|
||||||
|
else {
|
||||||
|
godot_error!("Modifier is not initialized!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#[func]
|
||||||
|
fn categoric_crossingover(&mut self) {
|
||||||
|
if let Some(pair) = self.modifier.as_mut() {
|
||||||
|
let (genome_a,genome_b) = pair.categoric_crossingover(None);
|
||||||
|
self.godot_genome_a.as_mut().unwrap().bind_mut().set_genome(genome_a);
|
||||||
|
self.godot_genome_b.as_mut().unwrap().bind_mut().set_genome(genome_b);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
godot_error!("Modifier is not initialized!");
|
godot_error!("Modifier is not initialized!");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue