Exemplo n.º 1
0
        // Add all compatible ISearchTypes to combobox list
        private void UpdateSearchTypes(ISearchMethod method)
        {
            CBItem oldItem = CbScanDataType.SelectedIndex < 0 ? null : (CBItem)CbScanDataType.SelectedItem;
            CBItem item;

            CbScanDataType.BeginUpdate();
            CbScanDataType.SuspendLayout();
            CbScanDataType.Items.Clear();

            for (int x = 0; x < _host.SearchTypes.Count; x++)
            {
                if (method.SupportSearchType(_host.SearchTypes[x]))
                {
                    item = new CBItem(_host.SearchTypes[x]);
                    CbScanDataType.Items.Add(item);
                    if (!_cbScanDataTypeToolTips.Keys.Contains(_host.SearchTypes[x]))
                    {
                        _cbScanDataTypeToolTips.Add(_host.SearchTypes[x], item.ToTooltip());
                    }

                    if (oldItem != null && oldItem.Plugin == item.Plugin)
                    {
                        CbScanDataType.SelectedIndex = CbScanDataType.Items.Count - 1;
                    }
                }
            }

            CbScanDataType.ResumeLayout(true);
            CbScanDataType.EndUpdate();
        }
Exemplo n.º 2
0
        // Begin first scan
        private void ScanFirst(ISearchType type, ISearchMethod method, ulong start, ulong stop, object[] param)
        {
            Invoke((MethodInvoker) delegate
            {
                this.BtBeginScan.Enabled = false;
                this.BtStopScan.Text     = "Stop";
                this.BtStopScan.Enabled  = true;
                this.ResultBox.List      = new NetCheatX.Core.Containers.SearchResultContainer <ISearchResult>();
            });

            this.ResultBox.ScanFirst(type, method, new Types.MemoryRange[] { new Types.MemoryRange()
                                                                             {
                                                                                 start = start, stop = stop
                                                                             } }, param, (p, v, m, t) => { if (method == p)
                                                                                                           {
                                                                                                               try { Invoke((MethodInvoker) delegate { this.PbScanProgress.LeftText = t; this.PbScanProgress.Maximum = 100; this.PbScanProgress.Value = (int)(100f * ((float)v / (float)m)); }); } catch (Exception e) { }
                                                                                                           }
                                     });

            Invoke((MethodInvoker) delegate
            {
                this.BtBeginScan.Text    = "Next Scan";
                this.BtBeginScan.Enabled = true;
                this.BtStopScan.Text     = "New Scan";
            });

            this._scanState = Types.SearchMode.Next;
        }
Exemplo n.º 3
0
        public void ScanFirst(ISearchType type, ISearchMethod method, Types.MemoryRange[] ranges, object[] args, Types.SetProgressCallback setProgress)
        {
            if (_list == null)
            {
                throw new Exception("Results list is null on start of initial scan.");
            }

            PopulateColumns();
            method.FirstScan(ref _list, type, args, ranges, setProgress);

            this._stopWatch.Stop();
            Invoke((MethodInvoker) delegate
            {
                this.VirtualListSize = _list.Count;
            });
        }
Exemplo n.º 4
0
        /// <summary>
        /// Diese Methode wird aufgerufen, wenn eine Konfiguration gefunden wurde, wo jeder Variable der
        /// Konfiguration ein Wert zugewiesen wurde und dabei keine Randbedingung verletzt wurde.
        /// <param name="destination">Der Zielknoten, der die Konfiguration ummantelt</param>
        /// <param name="searchMethod">Die Suchmethode wird mit übergeben</param>
        /// <returns>Wird true zurückgegeben, endet die Suche, ansonsten wird weiter gesucht.</returns>
        /// </summary>
        public virtual bool OnFoundDestination(INode destination, ISearchMethod searchMethod)
        {
            // Es muss nicht geprüft werden, ob die Configuration schon als Lösung exisitert,
            // da der Suchraum zu neuen Variablen immer von einer Variablenbelegung ausgeht.
            ConstraintConfiguration configuration = destination.Data as ConstraintConfiguration;

            foreach (Node node in _solutionList)
            {
                ConstraintConfiguration alreadyFoundConfiguration = node.Data as ConstraintConfiguration;
                if (alreadyFoundConfiguration.ToString() == configuration.ToString())
                {
                    return(false);
                }
            }

            // Lösung hinzufügen
            _solutionList.Add(destination as Node);
            // Prüfen, ob schon genug Lösungen gefunden worden
            if (_solutionList.Count == _countSolutions)
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Dies Funktion wird aufgerufen, wenn eine Lösung gefunden wurde.
        /// </summary>
        /// <param name="destination">Gibt den Knoten an, der die Lösungskonfiguration ummantelt.</param>
        /// <param name="searchMethod">
        /// Gibt die Suchmethode an, mit der die Lösung gefunden wurde.
        /// <remarks>
        /// Dies ist notwendig, um den Zugriff auf die Knotenmenge der Suchmethode zu erhalten und diese dann ändern zu können.
        /// </remarks>
        /// </param>
        /// <returns></returns>
        public override bool OnFoundDestination(INode destination, ISearchMethod searchMethod)
        {
            // Bei einem Optimierungsproblem wird sich nur die beste Lösung gemerkt
            if (_solutionList.Count == 0)
            {
                _solutionList.Add(destination as Node);
            }
            else
            {
                _solutionList[0] = destination as Node;
            }
            ConstraintConfiguration configuration = (ConstraintConfiguration)destination.Data;

            _objectiveConstraint.SetCurrentConfiguration(configuration);
            _objectiveConstraint.SetObjectiveValue();

            List <INode> newNodeSet = new List <INode>();

            /*foreach (INode node in searchMethod.NodeSet)
             * {
             *  configuration = (ConstraintConfiguration)node.Data;
             *  _objectiveConstraint.setCurrentConfiguration(configuration);
             *  if (_objectiveConstraint.IsComplied)
             *  {
             *      if (CheckNodeConsistency(configur5ation, false) == true)
             *          newNodeSet.Add(node);
             *      else
             *          configuration = null;
             *  }
             * }*/

            configuration = (ConstraintConfiguration)_begin.Data;

            if (_eventHandler != null)
            {
                _eventHandler.FoundEvent(searchMethod, this, destination, _objectiveConstraint.ObjectiveValue);
            }

            SetCurrentConfiguration(configuration);

            if (CheckBoundsConsistency(configuration) == false)
            {
                AddOptVariable();
                return(true);
            }

            if (_consistencyOptions.GetCheckConsistencyActive(ConsistencyCheckRegion.EachSolution, ConsistencyType.Node) == true &&
                CheckNodeConsistency(configuration, false) == false)
            {
                AddOptVariable();
                return(true);
            }

            if (_consistencyOptions.GetCheckConsistencyActive(ConsistencyCheckRegion.EachSolution, ConsistencyType.Arc) == true &&
                CheckArcConsistency(configuration) == false)
            {
                AddOptVariable();
                return(true);
            }

            //if (CheckLimitConsistency(configuration) == false)
            //    return true;

            Logger.LogDebug("##### Node the begin node has the following configuration");
            Logger.LogDebug(((ConstraintConfiguration)_begin.Data).ToString());

            newNodeSet.Add(_begin);

            Logger.LogDebug("##### Arc the begin node has the following configuration");
            Logger.LogDebug(((ConstraintConfiguration)_begin.Data).ToString());

            searchMethod.NodeSet = newNodeSet;

            return(false);
        }
Exemplo n.º 6
0
        // Populate parameters panel with the required UserControls
        private void UpdateParameters(ISearchMethod method, ISearchType type)
        {
            UserControl ctrl;

            MetroFramework.Controls.MetroLabel label;
            Point initPoint = new Point(12, 4);

            SplitContainer2.Panel2.SuspendLayout();
            SplitContainer2.Panel2.Enabled = false;
            SplitContainer2.Panel2.Controls.Clear();

            if (method.Params != null)
            {
                foreach (Types.SearchParam param in method.Params)
                {
                    // Get the UserControl
                    if (param.process)
                    {
                        ctrl = GetTypeEditor(param.name, type.ParamType);
                    }
                    else
                    {
                        ctrl = GetTypeEditor(param.name, param.type);
                    }

                    if (ctrl == null)
                    {
                        MessageBox.Show("Failed to create UserControl type editor for parameter " + param.name + " of type " + (param.process ? type.ParamType : param.type));
                        continue;
                    }

                    label = new MetroFramework.Controls.MetroLabel()
                    {
                        Theme = MetroFramework.MetroThemeStyle.Light,
                        UseCustomBackColor = true,
                        BackColor          = Color.Transparent,
                        Text     = param.name,
                        Location = new Point(initPoint.X, initPoint.Y),
                        Tag      = ctrl
                    };
                    label.Top += (ctrl.Height - label.Height) / 2;
                    MetroToolTip1.SetToolTip(label, param.description);

                    ctrl.Name     = param.name;
                    ctrl.Location = new Point(initPoint.X + label.Width + 5, initPoint.Y);
                    ctrl.Width    = SplitContainer2.Panel2.Width - ctrl.Left - 4;

                    initPoint.Y += ctrl.Height + 6;

                    SplitContainer2.Panel2.Controls.Add(label);
                    SplitContainer2.Panel2.Controls.Add(ctrl);
                }
            }


            // Adjust controls
            SplitContainer1.SplitterDistance = 110 + initPoint.Y + 5;
            SplitContainer2.SplitterDistance = 110;

            SplitContainer2.Panel2.Enabled = true;
            SplitContainer2.Panel2.ResumeLayout(true);
        }
Exemplo n.º 7
0
        // Get all search arguments
        private GetScanArgsResult GetScanArgs(out ISearchType type, out ISearchMethod method, out ulong start, out ulong stop, out object[] param)
        {
            Types.SearchParam sParam;
            ITypeEditor       editor;
            int i;

            type   = null;
            method = null;
            start  = 0;
            stop   = 0;
            param  = null;

            // Check we have Scan Type and Method selected
            if (CbScanDataType.SelectedIndex < 0)
            {
                return(GetScanArgsResult.NO_SCAN_TYPE);
            }
            if (CbScanMethod.SelectedIndex < 0)
            {
                return(GetScanArgsResult.NO_SCAN_METHOD);
            }

            // Try to get variables
            try
            {
                type   = (ISearchType)(CbScanDataType.SelectedItem as CBItem).Plugin;
                method = (ISearchMethod)(CbScanMethod.SelectedItem as CBItem).Plugin;
                start  = Convert.ToUInt64(TbStartAddress.Text, 16);
                stop   = Convert.ToUInt64(TbStopAddress.Text, 16);
            }
            catch { return(GetScanArgsResult.INVALID_ADDRESS_RANGE); }

            if (start >= stop)
            {
                return(GetScanArgsResult.INVALID_ADDRESS_RANGE);
            }

            param = new object[method.Params.Length];

            // Try to get search params from Type Editor controls
            i = 0;
            foreach (Control ctrl in SplitContainer2.Panel2.Controls)
            {
                if (!(ctrl is MetroFramework.Controls.MetroLabel) && ctrl.Name != null && ctrl.Name != "")
                {
                    sParam = method.Params.Where(x => x.name == ctrl.Name).FirstOrDefault();

                    if (sParam.process) // Convert to byte array
                    {
                        editor = _host.TypeEditors.Where(x => x.EditorType == ((ISearchType)(CbScanDataType.SelectedItem as CBItem).Plugin).ParamType).FirstOrDefault();
                        if (!editor.ProcessParam((UserControl)ctrl, out var ba))
                        {
                            return(GetScanArgsResult.INVALID_PARAMETER);
                        }

                        param[i++] = ba;
                    }
                    else
                    {
                        editor = _host.TypeEditors.Where(x => x.EditorType == sParam.type).FirstOrDefault();
                        editor.GetUnprocessedParam((UserControl)ctrl, out object obj);
                        param[i++] = obj;
                    }
                }
            }

            return(GetScanArgsResult.SUCCESS);
        }
Exemplo n.º 8
0
 /// <summary>
 /// Create a new search refiner for the specified domain
 /// </summary>
 /// <param name="producer"></param>
 public SearchRefiner(ISketchModificationProducer producer)
 {
     _producer     = producer;
     _searchMethod = new HillClimbSearch();
 }
Exemplo n.º 9
0
        public static bool FirstScan(IPluginHost host, ISearchMethod method, Types.SetProgressCallback setProgress, Types.MemoryRange range, NetCheatX.Core.Containers.SearchResultContainer <ISearchResult> result, SearchType type, bool signed, int align, byte[] param0, byte[] param1 = null)
        {
            bool      pass = false;
            int       progress = 0, lastProgress = 0;
            Stopwatch watch = new Stopwatch();

            // Return false if param is invalid
            if (param0 == null || param0.Length == 0 || (type == SearchType.ValueBetween && (param0 == null || param1.Length < 2)))
            {
                return(false);
            }
            // Return false if any of the other arguments are invalid
            if (host == null || method == null || result == null)
            {
                return(false);
            }

            // Define total range
            ulong distance = range.stop - range.start;

            // Define max block size
            ulong blockSize = SEARCH_BLOCK_SIZE;

            if (blockSize > distance)
            {
                blockSize = distance;
            }

            // Define block increment value
            // Subtract param0.Length-1 to ensure memory at end of blocks is scanned
            ulong blockInc = blockSize - (ulong)(param0.Length - align);

            // Initialize our buffers
            byte[] block   = new byte[blockSize];
            byte[] compare = new byte[param0.Length];

            // Reset progress bar to 0
            setProgress.Invoke(method, 0, 100, "");

            // Loop through memory, grabbing blocks and comparing them
            watch.Start();
            for (ulong addr = range.start; addr < range.stop; addr += blockInc)
            {
                // Update progress bar
                progress = (int)((float)((float)(addr - range.start) / (float)distance) * 100f);
                if (progress > lastProgress)
                {
                    lastProgress = progress;
                    setProgress.Invoke(method, progress, 100, result.Count().ToString("N0") + " results found");
                }

                // Update blockSize if range smaller than SEARCH_BLOCK_SIZE
                if (blockSize > (range.stop - addr))
                {
                    blockSize = (range.stop - addr);
                }

                // Grab block
                if (host.ActiveCommunicator.GetBytes(addr, ref block))
                {
                    for (int off = 0; off < (int)blockInc; off += align)
                    {
                        // Copy section for comparison
                        Array.Copy(block, off, compare, 0, param0.Length);

                        // Compare based on SearchType
                        switch (type)
                        {
                        case SearchType.EqualTo:
                            pass = NetCheatX.Core.Bitlogic.Compare.BAEqual(param0, compare);
                            break;

                        case SearchType.NotEqualTo:
                            pass = NetCheatX.Core.Bitlogic.Compare.BANotEqual(param0, compare);
                            break;

                        case SearchType.LessThan:
                            if (signed)
                            {
                                pass = NetCheatX.Core.Bitlogic.Compare.BALessThanSigned(compare, param0);
                            }
                            else
                            {
                                pass = NetCheatX.Core.Bitlogic.Compare.BALessThanUnsigned(compare, param0);
                            }
                            break;

                        case SearchType.LessThanOrEqualTo:
                            if (signed)
                            {
                                pass = NetCheatX.Core.Bitlogic.Compare.BALessThanOrEqualSigned(compare, param0);
                            }
                            else
                            {
                                pass = NetCheatX.Core.Bitlogic.Compare.BALessThanOrEqualUnsigned(compare, param0);
                            }
                            break;

                        case SearchType.GreaterThan:
                            if (signed)
                            {
                                pass = NetCheatX.Core.Bitlogic.Compare.BAGreaterThanSigned(compare, param0);
                            }
                            else
                            {
                                pass = NetCheatX.Core.Bitlogic.Compare.BAGreaterThanUnsigned(compare, param0);
                            }
                            break;

                        case SearchType.GreaterThanOrEqualTo:
                            if (signed)
                            {
                                pass = NetCheatX.Core.Bitlogic.Compare.BAGreaterThanOrEqualSigned(compare, param0);
                            }
                            else
                            {
                                pass = NetCheatX.Core.Bitlogic.Compare.BAGreaterThanOrEqualUnsigned(compare, param0);
                            }
                            break;

                        case SearchType.ValueBetween:
                            if (signed)
                            {
                                pass = NetCheatX.Core.Bitlogic.Compare.BAGreaterThanOrEqualSigned(compare, param0);
                                if (pass)
                                {
                                    pass &= NetCheatX.Core.Bitlogic.Compare.BALessThanOrEqualSigned(compare, param1);
                                }
                            }
                            else
                            {
                                pass = NetCheatX.Core.Bitlogic.Compare.BAGreaterThanOrEqualUnsigned(compare, param0);
                                if (pass)
                                {
                                    pass &= NetCheatX.Core.Bitlogic.Compare.BALessThanOrEqualUnsigned(compare, param1);
                                }
                            }
                            break;
                        }

                        // If passed then add the result
                        if (pass)
                        {
                            result.Add(new NetCheatX.Core.Basic.BasicSearchResult()
                            {
                                Address = addr + (ulong)off, Value = (byte[])compare.Clone()
                            });
                        }
                    }
                }
            }
            watch.Stop();

            // Finish progress
            setProgress.Invoke(method, 100, 100, result.Count().ToString("N0") + " results found in " + watch.Elapsed.ToString("ss\\.fff") + " seconds");

            return(true);
        }
Exemplo n.º 10
0
        public static bool NextScan(IPluginHost host, ISearchMethod method, Types.SetProgressCallback setProgress, NetCheatX.Core.Containers.SearchResultContainer <ISearchResult> result, SearchType type, bool signed, byte[] param0, byte[] param1 = null)
        {
            bool  pass = false;
            int   progress = 0, lastProgress = 0;
            ulong lastAddr = 0;

            NetCheatX.Core.Basic.BasicSearchResult resultEdit;

            // Return false if param is invalid
            if (param0 == null || param0.Length == 0 || (type == SearchType.ValueBetween && (param0 == null || param1.Length < 2)))
            {
                return(false);
            }
            // Return false if any of the other arguments are invalid
            if (host == null || method == null || result == null || result.Count == 0)
            {
                return(false);
            }

            // Initialize counters
            int resultSize  = result.Count;
            int resultIndex = 0;
            int resultFound = 0;

            // Initialize our buffers
            byte[] block   = new byte[SEARCH_BLOCK_SIZE];
            byte[] compare = new byte[param0.Length];

            // Reset progress bar to 0
            setProgress.Invoke(method, 0, 100, "");

            for (int off = 0; off < result.Count; off++)
            {
                // Update progress bar
                progress = (int)((float)((float)resultIndex / (float)resultSize) * 100f);
                if (progress > lastProgress)
                {
                    lastProgress = progress;
                    setProgress.Invoke(method, progress, 100, resultFound.ToString() + " results found");
                }

                // Grab current result
                resultEdit = (NetCheatX.Core.Basic.BasicSearchResult)result.ElementAt(off);

                // Update block if address is out of block range
                if (resultEdit.Address > (lastAddr + SEARCH_BLOCK_SIZE - (ulong)(param0.Length - 1)) || off == 0)
                {
                    // Load block
                    lastAddr = result[off].Address;
                    host.ActiveCommunicator.GetBytes(lastAddr, ref block);
                }

                // Copy section for comparison
                Array.Copy(block, (int)(resultEdit.Address - lastAddr), compare, 0, param0.Length);

                // Compare based on SearchType
                switch (type)
                {
                case SearchType.EqualTo:
                    pass = NetCheatX.Core.Bitlogic.Compare.BAEqual(param0, compare);
                    break;

                case SearchType.NotEqualTo:
                    pass = NetCheatX.Core.Bitlogic.Compare.BANotEqual(param0, compare);
                    break;

                case SearchType.LessThan:
                    if (signed)
                    {
                        pass = NetCheatX.Core.Bitlogic.Compare.BALessThanSigned(compare, param0);
                    }
                    else
                    {
                        pass = NetCheatX.Core.Bitlogic.Compare.BALessThanUnsigned(compare, param0);
                    }
                    break;

                case SearchType.LessThanOrEqualTo:
                    if (signed)
                    {
                        pass = NetCheatX.Core.Bitlogic.Compare.BALessThanOrEqualSigned(compare, param0);
                    }
                    else
                    {
                        pass = NetCheatX.Core.Bitlogic.Compare.BALessThanOrEqualUnsigned(compare, param0);
                    }
                    break;

                case SearchType.GreaterThan:
                    if (signed)
                    {
                        pass = NetCheatX.Core.Bitlogic.Compare.BAGreaterThanSigned(compare, param0);
                    }
                    else
                    {
                        pass = NetCheatX.Core.Bitlogic.Compare.BAGreaterThanUnsigned(compare, param0);
                    }
                    break;

                case SearchType.GreaterThanOrEqualTo:
                    if (signed)
                    {
                        pass = NetCheatX.Core.Bitlogic.Compare.BAGreaterThanOrEqualSigned(compare, param0);
                    }
                    else
                    {
                        pass = NetCheatX.Core.Bitlogic.Compare.BAGreaterThanOrEqualUnsigned(compare, param0);
                    }
                    break;

                case SearchType.ValueBetween:
                    if (signed)
                    {
                        pass = NetCheatX.Core.Bitlogic.Compare.BAGreaterThanOrEqualSigned(compare, param0) &
                               NetCheatX.Core.Bitlogic.Compare.BALessThanOrEqualSigned(compare, param1);
                    }
                    else
                    {
                        pass = NetCheatX.Core.Bitlogic.Compare.BAGreaterThanOrEqualUnsigned(compare, param0) &
                               NetCheatX.Core.Bitlogic.Compare.BALessThanOrEqualUnsigned(compare, param1);
                    }
                    break;
                }

                if (!pass)
                {
                    // Clean up
                    resultEdit.Value = null;
                    result[off]      = resultEdit;

                    // Remove
                    result.RemoveAt(off);

                    // Lower off so the next result is not skipped
                    off--;
                }
                else
                {
                    // Update result
                    resultEdit.Value = compare;
                    result[off]      = resultEdit;

                    resultFound++;
                }

                resultIndex++;
            }

            return(true);
        }
Exemplo n.º 11
0
 public SearchRefiner(ContextDomain.ContextDomain domain)
 {
     _domain       = domain;
     _searchMethod = new HillClimbSearch();
 }
Exemplo n.º 12
0
 public bool OnFoundDestination(INode destination, ISearchMethod searchMethod)
 {
     m_FoundSolution = true;
     return(true);
 }
        /// <summary>
        /// Liefert den Wert der heuristischen Funktion für den übergebenen Knoten.
        /// </summary>
        /// <param name="node">Der Knoten, dessen Heuristik ermittelt werden soll.</param>
        /// <param name="searchProblem">Das Problem, dass es zu lösen gilt.</param>
        /// <param name="searchMethod">Die Suchmethode, die gerade abläuft.</param>
        /// <returns>Gibt den Wert der Heuristik zurück.</returns>
        public double GetHeuristicValue(OKSearchRoom.INode node, IHeuristicSearchProblem searchProblem, ISearchMethod searchMethod)
        {
            double result = 0;

            if (searchProblem is ConstraintOptimizationProblem)
            {
                ConstraintConfiguration       configuration = (ConstraintConfiguration)node.Data;
                ConstraintOptimizationProblem optProblem    = searchProblem as ConstraintOptimizationProblem;

                if (optProblem.SolutionList.Count == 0)
                {
                    return(configuration.GetCountDomainValues());
                }
                else
                {
                    OptimizationConstraint optConstraint = optProblem.GetObjectiveFunction();
                    optConstraint.SetCurrentConfiguration(configuration);
                    IOperation operation = optConstraint.ObjectiveFunction;

                    if (operation.DoOperation(out result) != true)
                    {
                        return(-double.MaxValue);
                    }
                    else
                    {
                        //return configuration.GetCountDomainValues();
                        if (operation.GetType() == typeof(Minimum))
                        {
                            return(result + configuration.GetCountDomainValues());
                        }
                        //return configuration.GetCountDomainValues();
                        //return (configuration.GetCountDomainValues()+result);
                        //return (result + configuration.GetCountDomainValues());
                        //return (result + _objectiveConstraint.ObjectiveValue * configuration.GetCountDomainValues());
                        //return configuration.GetCountDomainValues();
                        //return -(_objectiveConstraint.ObjectiveValue - result) + configuration.GetCountDomainValues() * result;
                        //return -(_objectiveConstraint.ObjectiveValue - result) + configuration.GetCountDomainValues() * _objectiveConstraint.ObjectiveValue;
                        //return -node.Depth * (_objectiveConstraint.ObjectiveValue - result);
                        //return result - _objectiveConstraint.ObjectiveValue;
                        //return -node.Depth * (result - _objectiveConstraint.ObjectiveValue);
                        else
                        {
                            //return node.Depth * (_objectiveConstraint.ObjectiveValue - result);
                            return(configuration.GetCountDomainValues() - result);
                        }
                    }
                }
            }
            return(result);
        }
Exemplo n.º 14
0
 public bool OnFoundDestination(INode destination, ISearchMethod searchMethod)
 {
     _destination = (TreeNode)destination;
     return(true);
 }
Exemplo n.º 15
0
        public double GetHeuristicValue(OKSearchRoom.INode node, IHeuristicSearchProblem searchProblem, ISearchMethod searchMethod)
        {
            ConstraintConfiguration configuration = (ConstraintConfiguration)node.Data;

            return(configuration.GetCountDomainValues());
        }