internal void Update(ColonyBestTrailMessage message) { lock ( this ) { ConvertPath(message.Trail); UpdateNodes(); UpdateConverter(); } m_Bus.Publish(new ShortestPathModelChangedMessage()); }
private ColonyBestTrailMessage CreateBestTrailMessage([NotNull] IEnumerable <int> trail) { var message = new ColonyBestTrailMessage { Iteration = 1, Trail = trail, Length = 123, Type = "Type", Alpha = 0.1, Beta = 0.2, Gamma = 0.3 }; return message; }
private ColonyBestTrailMessage CreateBestTrailMessage() { var message = new ColonyBestTrailMessage { Iteration = 1, // todo fix spelling iteration Trail = new[] { 0, 1 }, Length = 123.0, Type = "Type", Alpha = 0.1, Beta = 0.2, Gamma = 0.3 }; return message; }
private ColonyBestTrailMessage CreateOtherBestTrailMessage() { var message = new ColonyBestTrailMessage { Alpha = 0.1, Beta = 0.2, Gamma = 0.3, Iteration = 2, Length = 750.0, Trail = new[] { 2, 0 }, Type = "Type" }; return message; }
internal void ColonyBestTrailHandler(ColonyBestTrailMessage message) { Update(message.Trail); }
internal void ColonyBestTrailHandler(ColonyBestTrailMessage message) { m_Logger.Debug("Handling '{0}'...".Inject(message.GetType())); Update(message); }
internal ITrailDetails CreateTrailDetails(ColonyBestTrailMessage message) { ITrailDetails details = m_Factory.Create(message.Iteration, message.Trail, message.Length, 0.0, 0.0, message.Type, message.Alpha, message.Beta, message.Gamma); m_FirstTrailDetails = details; return details; }
internal void Update(ColonyBestTrailMessage message) { lock ( this ) { ITrailDetails details = CreateTrailDetails(message); if ( m_Dictionary.ContainsKey(details.Interation) ) { m_Dictionary.Remove(details.Interation); } m_Dictionary.Add(details.Interation, details); m_TrailDetails = CreateTrailDetailsList(m_Dictionary.Values.ToArray()); m_Logger.Info("Update called! (Count: {0})".Inject(m_Dictionary.Count)); m_MemoryBus.PublishAsync(new TrailHistoryModelChangedMessage()); } }
internal void Update(ColonyBestTrailMessage message) { UpdateNodes(message.Trail); }