public void SimpleTopological7ContextTest() { var map = new GraphMap <string, IGraphNode <string>, IGraphEdge <string> >() { new GraphNode <string>("Node1"), new GraphNode <string>("Node2"), new GraphNode <string>("Node3"), new GraphNode <string>("Node4"), new GraphEdge <string>("Node1", "Node2"), new GraphEdge <string>("Node2", "Node3"), new GraphEdge <string>("Node3", "Node4"), }; var graphContext = new GraphTopologicalContext <String, IGraphEdge <string> >(maxLevels: 2) .AddStopNodeKey("Node3"); IList <IList <IGraphNode <string> > > sort = map.TopologicalSort(graphContext); var compare = new List <IList <string> > { new List <string> { "Node1" }, new List <string> { "Node2" }, }; Verify(sort, compare); }
public void Run_ShortGraph_PathFound() { // ARRAGE var expectedPath = new List <IGraphNode>(); var map = new GraphMap(); map.AddNode(new HexNode(0, 0)); map.AddNode(new HexNode(1, 0)); map.AddNode(new HexNode(0, 1)); var nodesArray = map.Nodes.ToArray(); map.AddEdge(nodesArray[0], nodesArray[2]); map.AddEdge(nodesArray[2], nodesArray[1]); expectedPath.Add(nodesArray[0]); expectedPath.Add(nodesArray[2]); expectedPath.Add(nodesArray[1]); var context = CreatePathFindingContext(map); var astar = new AStar(context, expectedPath.First(), expectedPath.Last()); // ACT var factState = astar.Run(); // ASSERT factState.Should().Be(State.GoalFound); var factPath = astar.GetPath(); factPath.Should().BeEquivalentTo(expectedPath); }
public void CreateMap() { Tiles = new List <Tile>(); _noise = new PerlinNoise( Data.Width, Data.Height, UnityEngine.Random.Range(0f, 99999f), UnityEngine.Random.Range(0f, 99999f), Data.Scale); // Создания тайлов по шуму for (int column = 0; column < Data.Width; column++) { for (int row = 0; row < Data.Height; row++) { var sample = _noise.GetSample(column, row); if (sample < 0.35f) { Tiles.Add(CreateTile(Data.PrefabWater, CreateCoordinate(column, row))); } if (sample >= 0.35f && sample < 0.5f) { Tiles.Add(CreateTile(Data.PrefabShores, CreateCoordinate(column, row))); } if (sample >= 0.5f) { Tiles.Add(CreateTile(Data.PrefabEarth, CreateCoordinate(column, row))); } } } Graph = new GraphMap(Tiles); }
public void Level3PipelineTopological2Test() { var map = new GraphMap <string, IGraphNode <string>, IGraphEdge <string> >() { new GraphNode <string>("P0"), new GraphNode <string>("P0-A1"), new GraphEdge <string>("P0", "P0-A1"), new GraphNode <string>("P0-A2"), new GraphEdge <string>("P0", "P0-A2"), new GraphNode <string>("P0-A3"), new GraphEdge <string>("P0", "P0-A3"), new GraphDependOnEdge <string>("P0-A3", "P0-A2"), new GraphNode <string>("P3-A1"), new GraphEdge <string>("P0-A3", "P3-A1"), new GraphNode <string>("P3-A2"), new GraphEdge <string>("P0-A3", "P3-A2"), new GraphNode <string>("P0-A4"), new GraphDependOnEdge <string>("P0-A4", "P0-A1"), new GraphDependOnEdge <string>("P0-A4", "P0-A2"), new GraphDependOnEdge <string>("P0-A4", "P0-A3"), new GraphNode <string>("P4-A1"), new GraphEdge <string>("P0-A4", "P4-A1"), new GraphNode <string>("P4-A2"), new GraphEdge <string>("P0-A4", "P4-A2"), }; IList <IList <IGraphNode <string> > > sort = map.TopologicalSort(); var compare = new List <IList <string> > { new List <string> { "P0" }, new List <string> { "P0-A1", "P0-A2" }, new List <string> { "P0-A3" }, new List <string> { "P3-A1", "P3-A2" }, new List <string> { "P0-A4" }, new List <string> { "P4-A1", "P4-A2" }, }; Verify(sort, compare); }
public void TestExceptionHandling() { var job1 = new TestJob("Job1") { ThrowException = true }; var graph = new GraphMap <string, JobBase <string>, IGraphEdge <string> > { job1, }; var jobHost = new OrchestratorBuilder <string, JobBase <string>, IGraphEdge <string> >(graph) .Build() .Start(_workContext); jobHost.Wait(_workContext); jobHost.RunningTask.IsCompleted.Should().BeTrue(); jobHost.GetProcessedNodeKeys().Count.Should().Be(0); jobHost.GetStopNodeKeys().Count.Should().Be(1); graph.Nodes.Values .All(x => x.GetResult(_workContext).Status == JobStatus.Failed) .Should() .BeTrue(); }
public void TestException2Handling() { var job1 = new TestJob("Job1") { ThrowException = true }; var job1a = new TestJob("Job1-a"); var job2 = new TestJob("Job2-a", job1); var graph = new GraphMap <string, JobBase <string>, IGraphEdge <string> > { job1, job1a, job2, new GraphEdge <string>(job1.Key, job2.Key) }; var jobHost = new OrchestratorBuilder <string, JobBase <string>, IGraphEdge <string> >(graph) .Build() .Start(_workContext); jobHost.Wait(_workContext); jobHost.RunningTask.IsCompleted.Should().BeTrue(); jobHost.GetProcessedNodeKeys().ForEach(x => _output.WriteLine($"ProcessNode: {x}")); jobHost.GetProcessedNodeKeys().Count.Should().Be(1); jobHost.GetStopNodeKeys().Count.Should().Be(1); jobHost.GetProcessedNodeKeys().Last().Should().Be(job1a.Key); }
public void AllFilterGraphTests() { var map = new GraphMap <string, IGraphNode <string>, IGraphEdge <string> >() { new GraphNode <string>("Node1"), new GraphNode <string>("Node2"), new GraphNode <string>("Node3"), new GraphNode <string>("Node4"), new GraphEdge <string>("Node1", "Node2"), new GraphEdge <string>("Node2", "Node3"), new GraphEdge <string>("Node1", "Node4"), }; var filter = map.CreateFilter() .Include(map.Nodes["Node1"].Key); GraphMap <string, IGraphNode <string>, IGraphEdge <string> > newMap = map.Create(filter); newMap.Nodes.Count.Should().Be(4); newMap.Nodes.Values.Any(x => x.Key == "Node1").Should().BeTrue(); newMap.Nodes.Values.Any(x => x.Key == "Node2").Should().BeTrue(); newMap.Nodes.Values.Any(x => x.Key == "Node3").Should().BeTrue(); newMap.Nodes.Values.Any(x => x.Key == "Node4").Should().BeTrue(); }
public void ComplexGraphTest() { var map = new GraphMap <string, IGraphNode <string>, IGraphEdge <string> >() { new GraphNode <string>("Node1"), new GraphNode <string>("Node2"), new GraphNode <string>("Node3"), new GraphNode <string>("Node4"), new GraphEdge <string>("Node1", "Node2"), new GraphEdge <string>("Node2", "Node3"), new GraphEdge <string>("Node1", "Node4"), }; IReadOnlyList <IGraphNode <string> > nodes = map.GetLeafNodes(map.Nodes["Node1"]); nodes.Should().NotBeNull(); nodes.Count.Should().Be(2); nodes[0].Key.Should().Be("Node4"); nodes[1].Key.Should().Be("Node3"); nodes = map.GetLeafNodes(map.Nodes["Node2"]); nodes.Should().NotBeNull(); nodes.Count.Should().Be(1); nodes[0].Key.Should().Be("Node3"); nodes = map.GetLeafNodes(map.Nodes["Node3"]); nodes.Should().NotBeNull(); nodes.Count.Should().Be(0); nodes = map.GetLeafNodes(map.Nodes["Node4"]); nodes.Should().NotBeNull(); nodes.Count.Should().Be(0); }
public SimpleOptionalLockedDoorWithMovie(GraphMap.Door door, string openMovie, string cantOpenMovie, string confirmationString, string idToReport, Color color) : base(door, idToReport, color) { this.openMovie = openMovie; this.cantOpenMovie = cantOpenMovie; this.confirmationString = confirmationString; }
private static WeightMatrix LinkNodes(GraphMap<FeatureVector, WeightMatrix>.ILinkable self, GraphMap<FeatureVector, WeightMatrix>.ILinkable node) { if (self.Data.sourcenames.Contains(node.Data.name)) { MessageBox.Show("Cycles not supported yet"); return null; } WeightMatrix wm = new WeightMatrix(self.Data.size + 1, node.Data.size); wm.linkAccess = self.LinkTo(node, wm); wm.linkAccess.AddAction("See Matrix", x => { var fm = new ViewMatrix(x.weights); fm.Show(); }); wm.linkAccess.Name = wm.weights.ColumnCount + "x" + wm.weights.RowCount; foreach (var sourcename in self.Data.sourcenames) { node.Data.sourcenames.Add(sourcename); } // add new UpdateLinks(self); return wm; }
public void SimpleTreeTopological2Test() { var map = new GraphMap <string, IGraphNode <string>, IGraphEdge <string> >() { new GraphNode <string>("Node1"), new GraphNode <string>("Node2-1"), new GraphNode <string>("Node2-2"), new GraphNode <string>("Node3-1"), new GraphNode <string>("Node3-2"), new GraphEdge <string>("Node2-1", "Node1"), new GraphEdge <string>("Node2-2", "Node1"), new GraphEdge <string>("Node3-1", "Node2-1"), new GraphEdge <string>("Node3-2", "Node2-2"), }; IList <IList <IGraphNode <string> > > sort = map.TopologicalSort(); var compare = new List <IList <string> > { new List <string> { "Node3-1", "Node3-2" }, new List <string> { "Node2-1", "Node2-2" }, new List <string> { "Node1" }, }; Verify(sort, compare); }
public void ThreeMix1JobTest() { var job1 = new TestJob("Job1"); var job1a = new TestJob("Job1-a"); var job2 = new TestJob("Job2-a", job1); var graph = new GraphMap <string, JobBase <string>, IGraphEdge <string> > { job1, job1a, job2, new GraphEdge <string>(job1.Key, job2.Key) }; var jobHost = new OrchestratorBuilder <string, JobBase <string>, IGraphEdge <string> >(graph) .Build() .Start(_workContext); jobHost.Wait(_workContext); jobHost.RunningTask.IsCompleted.Should().BeTrue(); jobHost.GetProcessedNodeKeys().ForEach(x => _output.WriteLine($"ProcessNode: {x}")); jobHost.GetProcessedNodeKeys().Count.Should().Be(3); jobHost.GetProcessedNodeKeys().Last().Should().Be(job2.Key); graph.Nodes.Values .All(x => x.GetResult(_workContext).Status == JobStatus.Completed) .Should() .BeTrue(); }
public Clue(GraphMap.Clue mapClue, Color lockColour, string id) { Setup(mapClue); color = lockColour; this.id = id; }
public void ThreeLevelTopologicalTest() { var map = new GraphMap <string, IGraphNode <string>, IGraphEdge <string> >() { new GraphNode <string>("Node1"), new GraphNode <string>("Node2"), new GraphNode <string>("Node3"), new GraphNode <string>("Node4"), new GraphEdge <string>("Node2", "Node1"), new GraphEdge <string>("Node3", "Node2"), new GraphEdge <string>("Node4", "Node3"), }; IList <IList <IGraphNode <string> > > sort = map.TopologicalSort(); var compare = new List <IList <string> > { new List <string> { "Node4" }, new List <string> { "Node3" }, new List <string> { "Node2" }, new List <string> { "Node1" }, }; Verify(sort, compare); }
public Clue(GraphMap.Clue mapClue) { Setup(mapClue); color = ColorPresets.Magenta; /* //Map id to color switch (parentId) { case "red": color = ColorPresets.Red; break; case "green": color = ColorPresets.Green; break; case "blue": color = ColorPresets.Blue; break; case "yellow": color = ColorPresets.Yellow; break; case "escape": color = ColorPresets.Yellow; break; case "self-destruct": color = ColorPresets.LimeGreen; break; }*/ }
private void SetActions(GraphMap <FeatureVector> .Box box) { if (box.Data.layer != Layer.OUTPUT) { box.AddAction("Link", self => { gm.SelectNode(node => { if (node.Data.layer != Layer.INPUT) { self.LinkTo(node); } }); }); } box.AddAction("Edit", self => { EditFeatureVector editfv = new EditFeatureVector(self.Data); editfv.ShowDialog(); self.Data.size = editfv.NumOfUnits; self.Data.name = editfv.FVName; self.Name = editfv.FVName; }); }
private static WeightMatrix LinkNodes(GraphMap <FeatureVector, WeightMatrix> .ILinkable self, GraphMap <FeatureVector, WeightMatrix> .ILinkable node) { if (self.Data.sourcenames.Contains(node.Data.name)) { MessageBox.Show("Cycles not supported yet"); return(null); } WeightMatrix wm = new WeightMatrix(self.Data.size + 1, node.Data.size); wm.linkAccess = self.LinkTo(node, wm); wm.linkAccess.AddAction("See Matrix", x => { var fm = new ViewMatrix(x.weights); fm.Show(); }); wm.linkAccess.Name = wm.weights.ColumnCount + "x" + wm.weights.RowCount; foreach (var sourcename in self.Data.sourcenames) { node.Data.sourcenames.Add(sourcename); } // add new UpdateLinks(self); return(wm); }
private void SetActions(GraphMap <FeatureVector, WeightMatrix> .Box box) { box.Data.sourcenames.Add(box.Data.name); box.Data.state = new Matrix(box.Data.size, 1); if (box.Data.layer != LayerType.OUTPUT) { box.AddAction("Link", self => { gm.SelectNode(node => { if (node.Data.layer != LayerType.INPUT) { LinkNodes((GraphMap <FeatureVector, WeightMatrix> .ILinkable)self, node); return; } }); }); } //box.AddAction("Edit", self => //{ // EditFeatureVector editfv = new EditFeatureVector(self.Data); // editfv.ShowDialog(); // self.Data.size = editfv.NumOfUnits; // self.Data.name = editfv.FVName; // self.Name = editfv.FVName; //}); }
// get real property name public void ProjectDataFilter(DataObject dataObject, ref DataFilter filter, GraphMap graphMap) { try { if (filter != null && (filter.Expressions != null || filter.OrderExpressions != null)) { _graphMap = graphMap; DataObject _dataObject = dataObject; if (filter.Expressions != null) { for (int i = 0; i < filter.Expressions.Count; i++) { Expression expression = filter.Expressions[i]; try { string[] propertyNameParts = expression.PropertyName.Split('.'); Values values = expression.Values; string dataPropertyName = ProjectProperty(propertyNameParts, ref values); expression.PropertyName = dataPropertyName.Substring(dataPropertyName.LastIndexOf('.') + 1); } catch (Exception e) { _logger.Error("Error projecting data filter expression [" + expression.ToString() + "]: " + e.Message); filter.Expressions.RemoveAt(i--); } } } if (filter.OrderExpressions != null) { for (int i = 0; i < filter.OrderExpressions.Count; i++) { OrderExpression orderExpression = filter.OrderExpressions[i]; try { string[] propertyNameParts = orderExpression.PropertyName.Split('.'); string dataPropertyName = ProjectProperty(propertyNameParts); orderExpression.PropertyName = dataPropertyName.Substring(dataPropertyName.LastIndexOf('.') + 1); } catch (Exception e) { _logger.Error("Error projecting data filter expression [" + orderExpression.ToString() + "]: " + e.Message); filter.OrderExpressions.RemoveAt(i--); } } } } } catch (Exception ex) { string error = "Error while projecting a DataFilter: " + ex.Message; _logger.Error(error); throw new Exception(error); } }
private static void ResizeBox(FlowLayoutPanel flp, GraphMap <FeatureVector, WeightMatrix> .Box box) { flp.Width = flp.Parent.Width - 6; int numPerRow = flp.Width / 16; int rows = box.Data.size / numPerRow; flp.Height = (rows + 1) * 16; }
public MovieClue(GraphMap.Clue mapClue, char representation, string pickupMovie, string description) : base(mapClue, ColorPresets.LimeGreen, pickupMovie) { Setup(mapClue); this.pickupMovie = pickupMovie; this.representation = representation; this.description = description; }
public void NoNodeTest() { var map = new GraphMap <string, IGraphNode <string>, IGraphEdge <string> >() { }; map.Invoking(x => x.GetLeafNodes(null)).Should().Throw <ArgumentNullException>(); }
public Response Refresh(string graphName, XDocument xDocument) { Response response = new Response(); response.StatusList = new List <Status>(); Status status = new Status(); status.Messages = new Messages(); try { status.Identifier = graphName; DateTime startTime = DateTime.Now; _graphMap = _mapping.FindGraphMap(graphName); // create xdoc from rdf xelement Uri graphUri = new Uri(_graphNs.NamespaceName + graphName); XmlDocument xmlDocument = new XmlDocument(); xmlDocument.LoadXml(xDocument.ToString()); xDocument.Root.RemoveAll(); // load xdoc to graph RdfXmlParser parser = new RdfXmlParser(); _graph.Clear(); _graph.BaseUri = graphUri; parser.Load(_graph, xmlDocument); xmlDocument.RemoveAll(); // delete old graph and save new one DeleteGraph(graphUri); _tripleStore.SaveGraph(_graph); DateTime endTime = DateTime.Now; TimeSpan duration = endTime.Subtract(startTime); status.Messages.Add("Graph [" + graphName + "] has been refreshed in triple store successfully."); status.Messages.Add( String.Format("Execution time [{0}:{1}.{2}] minutes.", duration.Minutes, duration.Seconds, duration.Milliseconds ) ); } catch (Exception ex) { _logger.Error(string.Format("Error refreshing graph [{0}]. {1}", graphName, ex)); status.Level = StatusLevel.Error; status.Messages.Add(String.Format("Error refreshing graph [{0}]. {1}", graphName, ex)); } response.Append(status); return(response); }
public void OneNodeTest() { var map = new GraphMap <string, IGraphNode <string>, IGraphEdge <string> >() { new GraphNode <string>("Node1"), }; map.Nodes.Count.Should().Be(1); map.Edges.Count.Should().Be(0); }
public void VerifyGraphMapModelRequiredAnnotations() { var graphForValidation = new GraphMap { GraphString = string.Empty }; var errorCount = CheckPropertyValidation.Validate(graphForValidation).Count; Assert.AreEqual(ClassValidationError, errorCount); }
public OutboundDtoTask(ManualResetEvent doneEvent, DtoProjectionEngine projectionLayer, DataLayerGateway dataLayerGateway, GraphMap graphMap, DataObject dataObject, List <string> identifiers) { _doneEvent = doneEvent; _dataLayerGateway = dataLayerGateway; _projectionLayer = projectionLayer; _projectionLayer.dataLayerGateway = dataLayerGateway; _graphMap = graphMap; _dataObject = dataObject; _identifiers = identifiers; }
public DataTransferObjectsTask(ManualResetEvent doneEvent, DtoProjectionEngine projectionLayer, DataLayerGateway dataLayerGateway, GraphMap graphMap, DataObject objectType, DataTransferObjects dataTransferObjects) { _doneEvent = doneEvent; _dataLayerGateway = dataLayerGateway; _projectionLayer = projectionLayer; _projectionLayer.dataLayerGateway = dataLayerGateway; _objectType = objectType; _graphMap = graphMap; _dataTransferObjects = dataTransferObjects; }
public void OneNodeTest() { var map = new GraphMap <string, IGraphNode <string>, IGraphEdge <string> >() { new GraphNode <string>("Node1"), }; IReadOnlyList <IGraphNode <string> > nodes = map.GetLeafNodes(map.Nodes["Node1"]); nodes.Should().NotBeNull(); nodes.Count.Should().Be(0); }
public void TwoNodesCountTest() { var map = new GraphMap <string, IGraphNode <string>, IGraphEdge <string> >() { new GraphNode <string>("Node1"), new GraphNode <string>("Node2"), new GraphEdge <string>("Node1", "Node2"), }; map.Nodes.Count.Should().Be(2); map.Edges.Count.Should().Be(1); }
public LookForState(GameObject inv, List <Transition> trans, float lookSpeed) { //Store path following script from gameobject invocant = inv; transitions = trans; name = "look"; pathFollowing = invocant.GetComponent <GraphPathFollowing>(); speed = lookSpeed; graph = GameObject.Find("Map Graph").GetComponent <GraphMap>(); newTargetNode = -1; pathFollowing.astar_target = null; //Set to null just in case }
public void TwoNodesSameKeyOverwriteTest() { GraphMap <string, IGraphNode <string>, IGraphEdge <string> > map = null !; map = new GraphMap <string, IGraphNode <string>, IGraphEdge <string> >() { new GraphNode <string>("Node1"), new GraphNode <string>("Node1"), }; map.Nodes.Count.Should().Be(1); map.Edges.Count.Should().Be(0); }
//TODO: public DtiTask(ManualResetEvent doneEvent, DtoProjectionEngine projectionLayer, DataLayerGateway dataLayerGateway, DataDictionary dictionary, GraphMap graphMap, DataFilter filter, int pageSize, int startIndex) { _doneEvent = doneEvent; _dataLayerGateway = dataLayerGateway; _projectionLayer = projectionLayer; _projectionLayer.dataLayerGateway = dataLayerGateway; _dictionary = dictionary; _graphMap = graphMap; _filter = Utility.CloneDataContractObject <DataFilter>(filter); _pageSize = pageSize; _startIndex = startIndex; }
public void NoTopologicalTest() { var map = new GraphMap <string, IGraphNode <string>, IGraphEdge <string> >() { new GraphNode <string>("Node1"), new GraphNode <string>("Node2"), }; IList <IList <IGraphNode <string> > > sort = map.TopologicalSort(); sort.Count.Should().Be(1); sort[0].Count.Should().Be(2); }
public void AdjacentTest() { IGraph <int> graph = GraphMap.New <int>(); for (int i = 1; i <= 5; i++) { graph.Add(i); } graph.Add(1, 5); graph.Add(2, 5); graph.Add(3, 5); graph.Add(4, 5); Assert.IsTrue(graph.Adjacent(1, 5)); }
public void TwoNodesWithEdgeErrorsTest() { GraphMap <string, IGraphNode <string>, IGraphEdge <string> > map = null; Action test = () => { map = new GraphMap <string, IGraphNode <string>, IGraphEdge <string> >() { new GraphNode <string>("Node1"), new GraphNode <string>("Node2"), new GraphEdge <string>("Node2", "Node-fake"), }; }; test.Should().Throw <ArgumentException>(); }
public AntennaeObjective(GraphMap.Objective objective, IEnumerable<Clue> objectiveProducesClues) : base(objective, objectiveProducesClues) { }
public SelfDestructObjective(GraphMap.Objective objective, IEnumerable<Clue> objectiveProducesClues) : base(objective, objectiveProducesClues) { }
void OnEnable() { graphMap = (GraphMap)target; }
private void Setup(GraphMap.Clue mapClue) { this.mapClue = mapClue; if (mapClue.LockedDoor != null) { parentId = mapClue.LockedDoor.Id; } else { parentId = mapClue.LockedObjective.Id; } }
private void SetActions(GraphMap<FeatureVector>.Box box) { if (box.Data.layer != Layer.OUTPUT) { box.AddAction("Link", self => { gm.SelectNode(node => { if (node.Data.layer != Layer.INPUT) { self.LinkTo(node); } }); }); } box.AddAction("Edit", self => { EditFeatureVector editfv = new EditFeatureVector(self.Data); editfv.ShowDialog(); self.Data.size = editfv.NumOfUnits; self.Data.name = editfv.FVName; self.Name = editfv.FVName; }); }
public ClueAutoPickup(GraphMap.Clue mapClue) : base(mapClue) { }
private static void ResizeBox(FlowLayoutPanel flp, GraphMap<FeatureVector, WeightMatrix>.Box box) { flp.Width = flp.Parent.Width - 6; int numPerRow = flp.Width / 16; int rows = box.Data.size / numPerRow; flp.Height = (rows + 1) * 16; }
private static void UpdateLinks(GraphMap<FeatureVector, WeightMatrix>.ILinkable self) { }
public SimpleLockedDoorWithMovie(GraphMap.Door door, string openMovie, string cantOpenMovie, string idToReport, Color color) : base(door, idToReport, color) { this.openMovie = openMovie; this.cantOpenMovie = cantOpenMovie; }
private void SetActions(GraphMap<FeatureVector, WeightMatrix>.Box box) { box.Data.sourcenames.Add(box.Data.name); box.Data.state = new Matrix(box.Data.size, 1); if (box.Data.layer != LayerType.OUTPUT) { box.AddAction("Link", self => { gm.SelectNode(node => { if (node.Data.layer != LayerType.INPUT) { LinkNodes((GraphMap<FeatureVector, WeightMatrix>.ILinkable)self, node); return; } }); }); } //box.AddAction("Edit", self => //{ // EditFeatureVector editfv = new EditFeatureVector(self.Data); // editfv.ShowDialog(); // self.Data.size = editfv.NumOfUnits; // self.Data.name = editfv.FVName; // self.Name = editfv.FVName; //}); }
public SimpleLockedDoor(GraphMap.Door door, string idToReport, Color color) { this.mapDoor = door; this.idToReport = idToReport; this.color = color; }
public SimpleObjective(GraphMap.Objective objective, IEnumerable<Clue> objectiveProducesClues) { this.obj = objective; this.objectiveProducesClues = objectiveProducesClues; }
private void Setup(GraphMap.Clue mapClue) { this.mapClue = mapClue; }
private void SetupStatePanel(FlowLayoutPanel flp, GraphMap<FeatureVector, WeightMatrix>.Box box) { foreach (CheckBox cb in flp.Controls) { cb.CheckedChanged += new EventHandler((o, ev) => { var chk = (o as CheckBox); int num = (int)chk.Tag; box.Data.state[num, 0] = chk.Checked ? 1 : 0; btn_forwardProp_Click(o, ev); chk.BackColor = chk.Checked ? Color.White : Color.Black; }); flp.Width = 10; flp.Parent.Resize += new EventHandler((o, ev) => { ResizeBox(flp, box); }); ResizeBox(flp, box); } }
public SimpleLockedDoor(GraphMap.Door door) { this.mapDoor = door; this.idToReport = door.Id; }