2 using System
.Collections
.Generic
;
6 namespace _2DTest
.lindo
8 /** Collect information about our surroundings and tell where we are. */
11 public Aggregator aggregator
= new AggregatorThree();
12 public Comparator comparator
= new ComparatorOne();
13 public WeightedShape shapeAll
= null;
14 public WeightedShape shapeLast
= null;
15 public Shape shapePoi
= new Shape();
16 public Variator variator
= new VariatorTwo();
17 public Motion MotionBest
= null;
19 public void addShape(Shape shapeOne
, Motion motionOne
)
23 shapeAll
= new WeightedShape(shapeOne
, 0.333);
27 WeightedShape shapeBest
= null;
28 double weightBest
= 0;
29 foreach (Motion motionTwo
in variator
.vary(motionOne
))
31 WeightedShape shapeTwo
= Transformator
.move(shapeAll
, motionTwo
);
32 double weight
= comparator
.compare(shapeOne
, shapeTwo
.shape
);
33 if (weight
> weightBest
)
37 MotionBest
= motionTwo
;
40 if (null != shapeBest
)
42 shapePoi
= Transformator
.move(shapePoi
, MotionBest
);
43 shapeLast
= new WeightedShape(shapeOne
, weightBest
);
44 shapeAll
= null == aggregator
? shapeBest
: aggregator
.aggregate(shapeBest
, shapeLast
);
45 System
.Diagnostics
.Debug
.WriteLine("Weight:" + shapeAll
.weight
);