Documentation ¶
Overview ¶
Package circles provides method for playing with circles
Index ¶
- type Animator
- type Circle
- type FloatFunStub
- type Fun
- func (f *Fun) About() string
- func (f *Fun) Constraint(pre TryData, hint *big.Int) (valid bool)
- func (f *Fun) CopyData(dest, src TryData)
- func (f *Fun) Cost(data TryData) (cost float64)
- func (f *Fun) CreateData() TryData
- func (f *Fun) DefaultParam() *big.Int
- func (f *Fun) Delete(i int) bool
- func (f *Fun) IDecode(data TryData, z *big.Int)
- func (f *Fun) Len() int
- func (f *Fun) MaxLen() int
- type FunTry
- type FunTryData
- type Store
- type Try
- type TryData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Animator ¶
type Animator struct {
// contains filtered or unexported fields
}
Animator works with psokit to generate an HTML file that gives an animation of used circles of global best during the run.
func NewAnimator ¶
NewAnimator creates an animation of the personal best used circles
func (*Animator) DataUpdate ¶
DataUpdate stores used circles of personal best
type Circle ¶
type Circle struct {
// contains filtered or unexported fields
}
Circle is the type used to represent a packing
type FloatFunStub ¶
type FloatFunStub = futil.FloatFunStub
FloatFunStub gives interface to setpso
func New ¶
func New(radius float64, innerFuzz, outerFuzz float64, valueNbits int, birthBonus float64) *FloatFunStub
New generates a circle packing cost function suitable for SPSO. 'radius' is the radius of the circles to be packed; 'innerFuzz' is reducing factor on 'radius' to get rejection radius 'outerFuzz' is increasing factor on 'radius' to get maximum influence radius // 'value. Nbits' is the number of bits used to locate a coordinate of a packed circle. 'birthBonus' is the reduction of cost due to including a circle
type Fun ¶
type Fun struct {
// contains filtered or unexported fields
}
Fun is the circles packaging cost function
func (*Fun) Constraint ¶
Constraint attempts to constrain hint possibly using a copy of pre to do this
func (*Fun) CreateData ¶
CreateData creates a empty structure for decoded try
func (*Fun) DefaultParam ¶
DefaultParam gives a default that satisfies constraints
type FunTryData ¶
type FunTryData struct { UsedCircles []Circle // contains filtered or unexported fields }
FunTryData is the decoded data structure for a try
func (*FunTryData) Circles ¶
func (d *FunTryData) Circles() []Circle
Circles returns the array of used circles
func (*FunTryData) Decode ¶
func (d *FunTryData) Decode() string
Decode requests the function to give a meaningful interpretation of d.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store stores circles for plotting
func NewStore ¶
NewStore creates a circle store assuming dataLen data points but with a skipLen skip interval on this data each snapshot storing at most nCircles; dispSize is the size of animation display in pixels.