com.mebigfatguy.polycasso
Class GenerationHandler

java.lang.Object
  extended by com.mebigfatguy.polycasso.GenerationHandler

public class GenerationHandler
extends java.lang.Object

class that maintains the set of polygon data for this generation of images


Nested Class Summary
static class GenerationHandler.Member
          class that holds a sample set of polygons and it's score
 
Constructor Summary
GenerationHandler(Settings confSettings, java.awt.Dimension imageSize)
          constructs a handler for managing successive generations of image samples
 
Method Summary
 ImprovementResult addPolygonData(long score, PolygonData[] polygonData)
          add a sample polygon set to this generation with a given score
 GenerationHandler.Member getBestMember()
          returns the best polygon set to draw the picture
 PolygonData[] getRandomPolygonData(boolean elite)
          pick a random polygon sample either from the general pool or elite pool skew the results towards the elite
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenerationHandler

public GenerationHandler(Settings confSettings,
                         java.awt.Dimension imageSize)
constructs a handler for managing successive generations of image samples

Parameters:
confSettings - settings to use for generation and elite size
imageSize - the size of the target image
Method Detail

addPolygonData

public ImprovementResult addPolygonData(long score,
                                        PolygonData[] polygonData)
add a sample polygon set to this generation with a given score

Parameters:
score - the deviation from perfection this set calculates
polygonData - the polygons that draw the image
Returns:
whether this is the best polygon set so far

getRandomPolygonData

public PolygonData[] getRandomPolygonData(boolean elite)
pick a random polygon sample either from the general pool or elite pool skew the results towards the elite

Parameters:
elite - whether to pick from the elite pool or not
Returns:
a random polygon set

getBestMember

public GenerationHandler.Member getBestMember()
returns the best polygon set to draw the picture

Returns:
the best polygon set


Copyright © 2009-2010 MeBigFatGuy.com. All Rights Reserved.