Beispiel #1
0
 public static MvcHtmlString GetLink(this HtmlHelper helper, Agent agent)
 {
     return helper.ActionLink (agent.FriendlyName, "GoalModel");
 }
Beispiel #2
0
 public void ExportAgent(Agent g)
 {
     writer.WriteLine (@"""{0}"" [shape=hexagon,label=""{1}"",style=filled,fillcolor=""#dcbdfa"",fontname=""HelveticaNeue"",fontsize=9,margin=""0.1,-0.1""];", g.Identifier, g.Name);
 }
 public void Add(Agent agent)
 {
     this.AgentIdentifiers.Add (agent.Identifier);
 }
Beispiel #4
0
 public void Add(Agent agent)
 {
     Agents.Add (agent);
 }
Beispiel #5
0
        public static IEncodedString GetPartialAgentDiagram(Agent a)
        {
            var view = new PartialModelView ();
            view.Add (a);

            foreach (var g in a.AssignedGoals ()) {
                view.Add (g);
                view.Add (g.Goal ());
            }

            var stream1 = new MemoryStream();
            var ser = new DataContractJsonSerializer(typeof(PartialModelView));
            ser.WriteObject(stream1, view);
            stream1.Position = 0;
            StreamReader sr = new StreamReader(stream1);
            return new RawString (sr.ReadToEnd());
        }
        protected ShapedGraphic Render(Agent agent)
        {
            if (agent.Type == AgentType.Software)
                return AddHexagon (agent.Identifier, agent.FriendlyName,
                    1, 0.99607843137, 0.80392156862, 0.58039215686);
            if (agent.Type == AgentType.Malicious)
                return AddHexagon (agent.Identifier, agent.FriendlyName,
                    1, 1, 0.590278, 0.611992);

            return AddHexagon (agent.Identifier, agent.FriendlyName,
                1, 0.824276, 0.670259, 1);
        }