コード例 #1
0
        public bool DoLockClueStressTest(int numberOfNodes, double branchingRatio, int numberOfDoors, int numberOfCluesPerDoor, bool visualise)
        {
            var graphGenerator = new GraphGenerator(random);

            var randomMap = graphGenerator.GenerateConnectivityMapNoCycles(numberOfNodes, branchingRatio);

            var doorAndClueTester = new DoorAndObjectiveGenerator(random);

            var mapModel = new MapModel(randomMap, 0);

            if (visualise)
            {
                VisualiseConnectivityGraph(mapModel);
            }

            doorAndClueTester.AddDoorsAndObjectives(mapModel, numberOfDoors, numberOfCluesPerDoor);

            if (visualise)
            {
                VisualiseConnectivityGraphWithDoors(mapModel);
            }

            var mapTester = new GraphSolver(mapModel);

            return(mapTester.MapCanBeSolved());
        }
        public bool DoLockClueStressTest(int numberOfNodes, double branchingRatio, int numberOfDoors, int numberOfCluesPerDoor, bool visualise)
        {
            var graphGenerator = new GraphGenerator(random);

            var randomMap = graphGenerator.GenerateConnectivityMapNoCycles(numberOfNodes, branchingRatio);

            var doorAndClueTester = new DoorAndObjectiveGenerator(random);

            var mapModel = new MapModel(randomMap, 0);
            if (visualise)
                VisualiseConnectivityGraph(mapModel);

            doorAndClueTester.AddDoorsAndObjectives(mapModel, numberOfDoors, numberOfCluesPerDoor);

            if (visualise)
                VisualiseConnectivityGraphWithDoors(mapModel);

            var mapTester = new GraphSolver(mapModel);

            return mapTester.MapCanBeSolved();
        }