public class Polygon extends Object
Constructor and Description |
---|
Polygon() |
Modifier and Type | Method and Description |
---|---|
void |
draw(Graphics2D g,
int width,
int height)
Draw the Polygon to the buffer of the given size.
|
Polygon |
mutate(float mutationRate,
float mutationAmount)
Return a new Polygon, mutated with the given rate and amount.
|
static Polygon |
randomPolygon(int length)
Creates a new random Polygon of the given length.
|
public static Polygon randomPolygon(int length)
public Polygon mutate(float mutationRate, float mutationAmount)
Each component of the Polygon may be mutated according to the specified mutation rate. In case a component is going to be mutated, its value will be randomly modified in the uniform range of [-mutationAmount, +mutationAmount].
mutationRate
- the mutation ratemutationAmount
- the mutation amountpublic void draw(Graphics2D g, int width, int height)
Copyright © 2016 Hipparchus.org. All rights reserved.