Example #1
0
        internal static int GetNodeMarking(int linkId, int layer, int generation)
        {
            string key = "(" + (object)linkId + "," + (object)layer + ")";//string key = "(" + (object)linkId + "," + (string)(object)layer + ")";

            if (HistoricalMarkings.NodeMarkings.ContainsKey(key))
            {
                return(HistoricalMarkings.NodeMarkings[key].Id);
            }
            HistoricalMarkings.Marking marking = new HistoricalMarkings.Marking();
            marking.GenerationCreated = generation;
            marking.Id = NodeGene.NextId;
            HistoricalMarkings.NodeMarkings[key] = marking;
            return(marking.Id);
        }
Example #2
0
        internal static int GetLinkMarking(int sourceId, int targetId, int generation)
        {
            string key = "(" + (object)sourceId + "," + (object)targetId + ")";// string key = "(" + (object)sourceId + "," + (string)(object)targetId + ")";

            if (HistoricalMarkings.LinkMarkings.ContainsKey(key))
            {
                return(HistoricalMarkings.LinkMarkings[key].Id);
            }
            HistoricalMarkings.Marking marking = new HistoricalMarkings.Marking();
            marking.GenerationCreated = generation;
            marking.Id = LinkGene.NextId;
            HistoricalMarkings.LinkMarkings[key] = marking;
            return(marking.Id);
        }