Beispiel #1
0
 public GraphAssemblerTests()
 {
     coordinateFactory = new TestCoordinateFactory();
     vertexFactory     = new TestVertexFactory();
     costFactory       = new TestCostFactory();
     graphFactory      = new TestGraphFactory();
     radarFactory      = new CoordinateAroundRadarFactory();
     graphAssembler    = new GraphAssemble(vertexFactory,
                                           coordinateFactory, graphFactory, costFactory, radarFactory);
 }
 public SmoothedGraphAssemble(
     IVertexFactory vertexFactory,
     ICoordinateFactory coordinateFactory,
     IGraphFactory graphFactory,
     IVertexCostFactory costFactory,
     INeighboursCoordinatesFactory radarFactory)
     : this(vertexFactory, coordinateFactory,
            graphFactory, costFactory, radarFactory, new MeanCost())
 {
 }
Beispiel #3
0
 public GraphSerializerTests()
 {
     formatter       = new BinaryFormatter();
     graphFactory    = new TestGraphFactory();
     radarFactory    = new CoordinateAroundRadarFactory();
     vertexConverter = new TestVertexInfoSerializationConverter(radarFactory);
     vertexFactory   = new TestVertexFactory();
     notSerializableCoordinateFactory = new NotSerializableCoordinateFactory();
     coordinateFactory = new TestCoordinateFactory();
     costFactory       = new TestCostFactory();
 }
        protected BaseVertexEventHolder(IVertexCostFactory costFactory)
        {
            this.costFactory        = costFactory;
            reverseActionDictionary = new Dictionary <bool, Action <IVertex> >()
            {
                { true, vertex => (vertex as IMarkable)?.MarkAsObstacle() },
                { false, vertex => (vertex as IMarkable)?.MarkAsRegular() }
            };

            If = new If <IVertex>(v => v.IsObstacle, MakeVertex)
                 .Else(MakeObstacle);
        }
 public SmoothedGraphAssemble(
     IVertexFactory vertexFactory,
     ICoordinateFactory coordinateFactory,
     IGraphFactory graphFactory,
     IVertexCostFactory costFactory,
     INeighboursCoordinatesFactory radarFactory,
     IMeanCost averageCost)
     : base(vertexFactory, coordinateFactory,
            graphFactory, costFactory, radarFactory)
 {
     this.averageCost = averageCost;
 }
Beispiel #6
0
        protected BaseVertexEventHolder(IVertexCostFactory costFactory)
        {
            this.costFactory        = costFactory;
            reverseActionDictionary = new Dictionary <bool, Action <IMarkable> >()
            {
                { true, vertex => vertex.MarkAsObstacle() },
                { false, vertex => vertex.MarkAsRegular() }
            };

            conditional = new Conditional <IVertex>(MakeVertex, v => v.IsObstacle)
                          .PerformIf(MakeObstacle);
        }
Beispiel #7
0
 public GraphAssemble(
     IVertexFactory vertexFactory,
     ICoordinateFactory coordinateFactory,
     IGraphFactory graphFactory,
     IVertexCostFactory costFactory,
     ICoordinateRadarFactory radarFactory)
 {
     this.vertexFactory     = vertexFactory;
     this.coordinateFactory = coordinateFactory;
     this.graphFactory      = graphFactory;
     this.costFactory       = costFactory;
     this.radarFactory      = radarFactory;
     percentRange           = new ValueRange(100, 0);
 }
 public GraphAssemble(
     IVertexFactory vertexFactory,
     ICoordinateFactory coordinateFactory,
     IGraphFactory graphFactory,
     IVertexCostFactory costFactory,
     INeighboursCoordinatesFactory radarFactory)
 {
     this.vertexFactory     = vertexFactory;
     this.coordinateFactory = coordinateFactory;
     this.graphFactory      = graphFactory;
     this.costFactory       = costFactory;
     this.radarFactory      = radarFactory;
     percentRange           = new InclusiveValueRange <int>(99, 0);
 }
Beispiel #9
0
        public AlgorithmTest()
        {
            radarFactory      = new CoordinateAroundRadarFactory();
            graphFactory      = new TestGraphFactory();
            vertexFactory     = new TestVertexFactory();
            costFactory       = new TestVertexCostFactory();
            coordinateFactory = new TestCoordinateFactory();

            graphAssemble = new GraphAssemble(vertexFactory,
                                              coordinateFactory,
                                              graphFactory,
                                              costFactory,
                                              radarFactory);

            testAssemble = new TestGraphAssemble(graphAssemble);
        }
 public VertexEventHolder(IVertexCostFactory costFactory) : base(costFactory)
 {
 }