예제 #1
0
 public void Add(GoalAgentAssignment assignment)
 {
     Assignments.Add (assignment);
 }
        protected void Render(GoalAgentAssignment assignment, bool createAgentShapes = false)
        {
            var circle = GetCircle ();
            Add (assignment.Identifier, circle);

            if (shapes.ContainsKey(assignment.GoalIdentifier)) {
                var parentGraphic = shapes[assignment.GoalIdentifier].First ();
                var topArrow = GetFilledArrow (circle, parentGraphic);
                sheet.GraphicsList.Add (topArrow);
            }

            foreach (var child in assignment.AgentIdentifiers) {
                Graphic childGraphic;
                if (!createAgentShapes) {
                    if (!shapes.ContainsKey(child))
                        continue;
                    childGraphic = shapes [child].First ();
                } else {
                    childGraphic = Render (assignment.model.Agents ().Single (x => x.Identifier == child));
                }

                var line = GetLine (childGraphic, circle);
                sheet.GraphicsList.Add (line);
            }
        }