Some util functions that are used in the morphological evolution part and/or coevolution.py.
More...
Some util functions that are used in the morphological evolution part and/or coevolution.py.
◆ alternate()
| def morphevo.util.alternate |
( |
|
list_to_alternate, |
|
|
|
times |
|
) |
| |
Function to make an alternation of a list for x items.
Example what = [1,2,3,4] times = 6 -> [1,2,3,4,1,2].
- Parameters
-
| list_to_alternate | The list that you want to alternate. |
| times | Amount of times you want to alternate your items. |
- Returns
- Alternating list of size 'times'
◆ alternate_infinite()
| def morphevo.util.alternate_infinite |
( |
|
list_to_alternate | ) |
|
Function to make an alternation of a list on which you can iterate till infinity.
Example list_to_alternate = [1,2,3,4] -> 1,2,3,4,1,2,3,4,1,2,3,4,...
- Parameters
-
| list_to_alternate | The list that you want to alternate. |
- Returns
- Next iteration.
◆ generate_arms()
| def morphevo.util.generate_arms |
( |
int |
amount | ) |
|
Generate a list of initial random arms with random genome.
- Parameters
-
| amount | Amount of arms needed. |
- Returns
- List of arms.
◆ normalize()
| def morphevo.util.normalize |
( |
|
list_to_normalize | ) |
|
Normalize a list.
- Parameters
-
| list_to_normalize | List to normalize. |
- Returns
- List in which items are normalized.
◆ save_genome()
| def morphevo.util.save_genome |
( |
Arm |
arm, |
|
|
str |
label |
|
) |
| |
Save the urdf of an arm.
- Parameters
-
| arm | Arm to save genome for. |
| label | Unique label to add to the end of the name. |
◆ write_morphevo_benchmarks()
| def morphevo.util.write_morphevo_benchmarks |
( |
Arm |
arm | ) |
|
Output the benchmarks generated by morphevo code.
- Parameters
-
| arm | Arm to save benchmarks for. |