Exemplo n.º 1
0
 public void ExportDomainHypothesis(DomainHypothesis domhyp)
 {
     var name = new StringBuilder (domhyp.Name);
     if (name.Length > 30) {
         var midspace = domhyp.Name.IndexOf (' ', (domhyp.Name.Length / 2) - 1);
         name.Replace (" ", @"\n", midspace, 1);
     }
     writer.WriteLine (@"""{0}"" [shape=trapezium,label=""{1}"",style=filled,fillcolor=""{2}"",fontname=""HelveticaNeue"",fontsize=9,margin=""-.2,0""];",
                       domhyp.Identifier, name, "#FFEFEF");
 }
Exemplo n.º 2
0
 public static MvcHtmlString GetLink(this HtmlHelper helper, DomainHypothesis domhyp)
 {
     return helper.ActionLink (domhyp.FriendlyName, "GoalModel");
 }
Exemplo n.º 3
0
 public void Add(DomainHypothesis domHyp)
 {
     this.DomainHypothesisIdentifiers.Add (domHyp.Identifier);
 }
Exemplo n.º 4
0
 public void Remove(DomainHypothesis domHyp)
 {
     this.DomainHypothesisIdentifiers.Remove (domHyp.Identifier);
 }
Exemplo n.º 5
0
 public void Add(DomainHypothesis agent)
 {
     DomainHypotheses.Add (agent);
 }
Exemplo n.º 6
0
        public static IEncodedString GetPartialDomHypDiagram(DomainHypothesis domhyp)
        {
            var view = new PartialModelView ();
            view.Add (domhyp);

            foreach (var r in domhyp.GoalRefinements ()) {
                view.Add (r);
                view.Add (r.ParentGoal ());
                foreach (var gg in r.SubGoals ()) {
                    view.Add (gg);
                }
                foreach (var gg in r.DomainProperties ()) {
                    view.Add (gg);
                }
                foreach (var gg in r.DomainHypotheses ()) {
                    view.Add (gg);
                }
            }

            foreach (var r in domhyp.ObstacleRefinements ()) {
                view.Add (r);
                view.Add (r.ParentObstacle ());
                foreach (var gg in r.SubObstacles ()) {
                    view.Add (gg);
                }
            }

            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 void Render(DomainHypothesis domHyp)
 {
     AddHomeShape (domHyp.Identifier, domHyp.FriendlyName,
         1, 1, 0.92156862745, 0.92156862745);
 }