Ejemplo n.º 1
0
		public int Golomb( int n )
		{
			Golomb golomb		= new Golomb( n );
			Solver solver		= golomb.Solver;
			solver.IntObjective.Var		= golomb.MarkList[ golomb.MarkList.Count - 1 ];
			solver.IntObjective.Step	= 1;

			SolutionGoal solution	= new SolutionGoal( solver, solver.IntObjective.Var );

			solver.Solve(	new GoalAnd(
								new IntGenerate( solver,
									golomb.MarkList.ToArray(),
									IntVarSelector.FirstNotBound,
									new IntSearchInstantiateBest() ),
								solution ) );

			int count	= CountSolution( solver );

			return solution.Value;
		}
Ejemplo n.º 2
0
        public int Golomb( int n )
        {
            Golomb golomb		= new Golomb( n );
            Solver solver		= golomb.Solver;
            solver.IntObjective.Var		= golomb.MarkList[ golomb.MarkList.Count - 1 ];
            solver.IntObjective.Step	= 1;

            SolutionGoal solution	= new SolutionGoal( solver, solver.IntObjective.Var );

            solver.Solve(	new GoalAnd(
                                new IntGenerate( solver,
                                    golomb.MarkList.ToArray(),
                                    IntVarSelector.FirstNotBound,
                                    new IntSearchInstantiateBest() ),
                                solution ) );

            int count	= CountSolution( solver );

            return solution.Value;
        }