This is the code in Python I'm trying to convert to Java:
self.active = set(self.genes[-self.output_length:]):
Reading up on the sets in Python, I believe that this is splitting the ArrayList at the index of 'self.output_length'. Is this correct? A little background: the 'self.genes' contains genes which present both 'self.output_length' and 'self.nodes'.
Could I used this in Java:
List<float[]> temp = this.genes.subList(0,this.output_length);
this.active = Set(Collections.reverse(temp));
UPDATE: As per a previous answer, I've now done this:
List<float[]> temp = this.genes.subList(this.genes.size() - this.output_length, this.genes.size());
this.active = new ArrayList<float[]> (temp);
Thanks for your help.