public void Initialize(IGenomeDecoder<NeatGenome, IBlackBox> genomeDecoder, IMapClusteringDataset dataset, MapClusteringEvaluator evaluator, int nbClusters)
        {
            this.dataset = dataset;
            this.nbClusters = nbClusters;
            this.decoder = genomeDecoder;
            this.evaluator = evaluator;

            samples = dataset.GetSamplesMatrix();
            outputs = new double[nbClusters, samples.GetLength(1), samples.GetLength(2)];
            this.nbInputs = samples.GetLength(0);

            maxValue = 0.0;
            for (var i = 0; i < samples.GetLength(0); i++)
            {
                for (var j = 0; j < samples.GetLength(1); j++)
                {
                    for (var k = 0; k < samples.GetLength(2); k++)
                    {
                        var value = samples[i, j, k];
                        if (value > maxValue) maxValue = value;
                    }
                }
            }
            maxValue *= 2; // margin
        }
        public MapClusteringView(IGenomeDecoder<NeatGenome, IBlackBox> genomeDecoder,
                                IMapClusteringDataset dataset,
                                MapClusteringEvaluator evaluator,
                                int nbClusters)
            : this()
        {
            this.dataset = dataset;
            this.nbClusters = nbClusters;
            this.decoder = genomeDecoder;
            this.evaluator = evaluator;

            samples = dataset.GetSamplesMatrix();
            outputs = new double[nbClusters, samples.GetLength(1), samples.GetLength(2)];

            inputView.LabelName = "Input";
            outputView.LabelName = "Output";

            inputView.SetDimensions(samples.GetLength(0), samples.GetLength(1), samples.GetLength(2));
            outputView.SetDimensions(nbClusters, samples.GetLength(1), samples.GetLength(2));

            maxValue = 0.0;
            minValue = double.PositiveInfinity;
            for (var i = 0; i < samples.GetLength(0); i++)
            {
                for (var j = 0; j < samples.GetLength(1); j++)
                {
                    for (var k = 0; k < samples.GetLength(2); k++)
                    {
                        var value = samples[i, j, k];
                        if (value > maxValue) maxValue = value;
                        if (value < minValue) minValue = value;
                    }
                }
            }
            // Add some margin
            maxValue *= 2;
            minValue *= 2;

            inputView.OnClusterChanged += (id) =>
            {
                currentInputIdx = id;
                RefreshInput();
            };
            outputView.OnClusterChanged += (id) =>
            {
                currentClusterIdx = id;
                RefreshOutput();
            };

            RefreshInput();
        }
 public MapClusteringScatterPlotView(IGenomeDecoder<NeatGenome, IBlackBox> genomeDecoder, IMapClusteringDataset dataset, MapClusteringEvaluator evaluator, int nbClusters)
     : this()
 {
     Initialize(genomeDecoder, dataset, evaluator, nbClusters);
 }