Skip to content

Commit

Permalink
Move InteractionSphere to Symu.DNA
Browse files Browse the repository at this point in the history
  • Loading branch information
lmorisse committed Aug 28, 2020
1 parent 9fb2277 commit a80d9ab
Show file tree
Hide file tree
Showing 61 changed files with 221 additions and 2,267 deletions.
2 changes: 1 addition & 1 deletion SourceCode/Symu/Classes/Agents/CognitiveAgent.Murphies.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
using Symu.Classes.Task;
using Symu.Common;
using Symu.Common.Interfaces.Entity;
using Symu.DNA.TwoModesNetworks.Sphere;
using Symu.Messaging.Messages;
using Symu.Repository;
using Symu.Repository.Entity;
using Symu.Repository.Networks.Sphere;
using Symu.Results.Blocker;
using static Symu.Common.Constants;

Expand Down
2 changes: 1 addition & 1 deletion SourceCode/Symu/Classes/Agents/CognitiveAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
using Symu.Common;
using Symu.Common.Interfaces.Agent;
using Symu.Common.Interfaces.Entity;
using Symu.DNA.TwoModesNetworks.Sphere;
using Symu.Environment;
using Symu.Messaging.Messages;
using Symu.Repository;
using Symu.Repository.Entity;
using Symu.Repository.Networks.Sphere;

#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class ActivityModel
/// <param name="agentId"></param>
/// <param name="cognitiveArchitecture"></param>
/// <param name="network"></param>
public ActivityModel(AgentId agentId, CognitiveArchitecture cognitiveArchitecture, MetaNetwork network)
public ActivityModel(AgentId agentId, CognitiveArchitecture cognitiveArchitecture, SymuMetaNetwork network)
{
if (cognitiveArchitecture == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using System;
using System.Linq;
using Symu.Common;
using Symu.Common.Classes;
using Symu.Common.Interfaces.Agent;
using Symu.Common.Interfaces.Entity;
using Symu.Common.Math.ProbabilityDistributions;
Expand Down Expand Up @@ -50,7 +51,7 @@ public class BeliefsModel
/// <param name="network"></param>
/// <param name="model"></param>
public BeliefsModel(AgentId agentId, ModelEntity entity, CognitiveArchitecture cognitiveArchitecture,
MetaNetwork network, RandomGenerator model)
SymuMetaNetwork network, RandomGenerator model)
{
if (entity is null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using Symu.Classes.Organization;
using Symu.Classes.Task;
using Symu.Common;
using Symu.Common.Classes;
using Symu.Common.Interfaces.Entity;
using Symu.Common.Math.ProbabilityDistributions;
using Symu.DNA.Knowledges;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

using System;
using Symu.Common;
using Symu.Common.Classes;
using Symu.Common.Interfaces.Agent;
using Symu.Common.Interfaces.Entity;
using Symu.Common.Math.ProbabilityDistributions;
Expand Down Expand Up @@ -47,7 +48,7 @@ public class InfluenceModel
/// <param name="beliefsModel"></param>
/// <param name="model"></param>
public InfluenceModel(AgentId agentId, ModelEntity entity, CognitiveArchitecture cognitiveArchitecture,
MetaNetwork network, BeliefsModel beliefsModel, RandomGenerator model)
SymuMetaNetwork network, BeliefsModel beliefsModel, RandomGenerator model)
{
if (entity is null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using System;
using Symu.Common;
using Symu.Common.Math.ProbabilityDistributions;
using Symu.Repository.Networks.Sphere;
using Symu.DNA.TwoModesNetworks.Sphere;

#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

using System;
using System.Linq;
using Symu.Common.Classes;
using Symu.Common.Interfaces.Agent;
using Symu.Common.Interfaces.Entity;
using Symu.Common.Math.ProbabilityDistributions;
Expand Down Expand Up @@ -46,7 +47,7 @@ public class KnowledgeModel
/// <param name="cognitiveArchitecture"></param>
/// <param name="network"></param>
public KnowledgeModel(AgentId agentId, ModelEntity entity, CognitiveArchitecture cognitiveArchitecture,
MetaNetwork network)
SymuMetaNetwork network)
{
if (entity is null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using System.Linq;
using Symu.Classes.Organization;
using Symu.Common;
using Symu.Common.Classes;
using Symu.Common.Interfaces.Agent;
using Symu.Common.Interfaces.Entity;
using Symu.Common.Math.ProbabilityDistributions;
Expand Down
93 changes: 0 additions & 93 deletions SourceCode/Symu/Classes/Agents/Models/ModelEntity.cs

This file was deleted.

1 change: 1 addition & 0 deletions SourceCode/Symu/Classes/Agents/ReactiveAgent.Messaging.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using System.Collections.Generic;
using Symu.Classes.Task.Manager;
using Symu.Common;
using Symu.Common.Classes;
using Symu.Common.Interfaces.Agent;
using Symu.Messaging.Manager;
using Symu.Messaging.Messages;
Expand Down
1 change: 1 addition & 0 deletions SourceCode/Symu/Classes/Murphies/Murphy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#region using directives

using Symu.Classes.Agents.Models;
using Symu.Common.Classes;

#endregion

Expand Down
3 changes: 2 additions & 1 deletion SourceCode/Symu/Classes/Organization/OrganizationModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
using System;
using Symu.Classes.Agents.Models;
using Symu.Common;
using Symu.Common.Classes;
using Symu.DNA.TwoModesNetworks.Sphere;
using Symu.Engine;
using Symu.Repository.Entity;
using Symu.Repository.Networks.Sphere;

#endregion

Expand Down
3 changes: 2 additions & 1 deletion SourceCode/Symu/Environment/SymuEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using Symu.Classes.Organization;
using Symu.Classes.Scenario;
using Symu.Common;
using Symu.Common.Classes;
using Symu.Common.Interfaces;
using Symu.Common.Interfaces.Agent;
using Symu.Environment.Events;
Expand Down Expand Up @@ -373,7 +374,7 @@ private void SetInteractionSphere(bool initialization)
var agentIds = WhitePages.AllCognitiveAgents().Where(x =>
x.Cognitive.InteractionPatterns.IsPartOfInteractionSphere &&
x.State == AgentState.Started).Select(x => x.AgentId).Cast<IAgentId>().ToList();
WhitePages.MetaNetwork.InteractionSphere.SetSphere(initialization, agentIds, WhitePages.MetaNetwork);
WhitePages.MetaNetwork.InteractionSphere.SetSphere(initialization, agentIds, WhitePages.MetaNetwork.Network);
}

/// <summary>
Expand Down
10 changes: 10 additions & 0 deletions SourceCode/Symu/Repository/Entity/AgentBelief.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using System;
using System.Linq;
using Symu.Common;
using Symu.Common.Classes;
using Symu.Common.Interfaces.Entity;
using Symu.Common.Math.ProbabilityDistributions;
using Symu.DNA.Beliefs;
Expand Down Expand Up @@ -241,5 +242,14 @@ public void SetBeliefBits(float[] beliefBits)
{
BeliefBits.SetBits(beliefBits);
}

public float CompareTo(IAgentBelief other)
{
if (other is AgentBelief agentBelief)
{
return Bits.CompareTo(BeliefBits, agentBelief.BeliefBits);
}
return 0;
}
}
}
9 changes: 9 additions & 0 deletions SourceCode/Symu/Repository/Entity/AgentKnowledge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

using System;
using Symu.Common;
using Symu.Common.Classes;
using Symu.Common.Interfaces.Entity;
using Symu.Common.Math.ProbabilityDistributions;
using Symu.DNA.Knowledges;
Expand Down Expand Up @@ -286,5 +287,13 @@ public void SetKnowledgeBit(byte index, float value, ushort step)
KnowledgeBits.SetBit(index, value, step);
}

public float CompareTo(IAgentKnowledge other)
{
if (other is AgentKnowledge agentKnowledge)
{
return Bits.CompareTo(KnowledgeBits, agentKnowledge.KnowledgeBits);
}
return 0;
}
}
}
1 change: 1 addition & 0 deletions SourceCode/Symu/Repository/Entity/Belief.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

using System;
using Symu.Common;
using Symu.Common.Classes;
using Symu.Common.Interfaces.Entity;
using Symu.Common.Math.ProbabilityDistributions;
using Symu.DNA.Beliefs;
Expand Down
2 changes: 1 addition & 1 deletion SourceCode/Symu/Repository/Entity/Bits.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public static ushort[] Initialize(byte length, ushort value)
/// <param name="bits1"></param>
/// <param name="bits2"></param>
/// <returns></returns>
public static float GetRelativeBits(Bits bits1, Bits bits2)
public static float CompareTo(Bits bits1, Bits bits2)
{
if (bits1 == null)
{
Expand Down
1 change: 1 addition & 0 deletions SourceCode/Symu/Repository/Entity/KnowledgeBits.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

using System;
using Symu.Common;
using Symu.Common.Classes;

#endregion

Expand Down

0 comments on commit a80d9ab

Please sign in to comment.