Beispiel #1
0
        private void UpdateMinMax(int index, AttributeGetter <double> getter)
        {
            double value = default;

            getter(ref value);

            attributeMin[index] = value < attributeMin[index] ? value : attributeMin[index];
            attributeMax[index] = value > attributeMax[index] ? value : attributeMax[index];
        }
Beispiel #2
0
        internal override Delegate[] GetTransformingGetters(ICase targetCase)
        {
            if (targetCase == null)
            {
                throw new ArgumentNullException(nameof(targetCase));
            }

            var getters = new AttributeGetter <double> [AttributeBinding.Count];

            foreach (var binding in AttributeBinding)
            {
                var min             = attributeMin[binding.Binding];
                var max             = attributeMax[binding.Binding];
                var attributeGetter = targetCase.GetAttributeGetter <double>(targetCase.Schema[binding.Attribute]);
                getters[binding.Binding] = (ref double value) =>
                {
                    attributeGetter(ref value);
                    Normalize(ref value, min, max);
                };
            }

            return(getters);
        }
Beispiel #3
0
        private void PopulateAttributeCheckList()
        {
            bool success = false;

            while (!success)
            {
                try
                {
                    IAttributeGetter ag = new AttributeGetter(serverInstance.server);
                    Attributes = ag.GetAllAttributes();
                    success    = true;
                }
                catch
                {
                    serverInstance.ConnectToServer();
                    success = false;
                }
            }
            foreach (var attribute in Attributes)
            {
                checkedListBox1.Items.Add(attribute.Name);
            }
        }