Skip to content

Commit

Permalink
Clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
lmorisse committed Oct 8, 2020
1 parent 015cc51 commit 5e12913
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 109 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ public KnowledgeModel(IAgentId agentId, KnowledgeModelEntity entity,

public bool On { get; set; }

///// <summary>
///// Get the Agent Expertise
///// </summary>
//public EntityExpertise Expertise => _actorKnowledgeNetwork.EdgesFilteredBySource(_agentId);
/// <summary>
/// Get a readonly list of the actor knowledge
/// </summary>
Expand All @@ -103,8 +99,6 @@ public void InitializeExpertise(ushort step)
return;
}

//_actorKnowledgeNetwork.Add(Expertise);

foreach (var agentKnowledge in _actorKnowledgeNetwork.EdgesFilteredBySource<ActorKnowledge>(_agentId))
{
InitializeActorKnowledge(agentKnowledge, !_knowledgeAndBeliefs.HasInitialKnowledge, step);
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion SourceCode/Symu/Classes/Organization/MainOrganization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public MainOrganization(string name)
MetaNetwork = new GraphMetaNetwork(Models.InteractionSphere);
}


public string Name { get; set; }

public GraphMetaNetwork MetaNetwork { get; protected set; }
Expand Down
4 changes: 2 additions & 2 deletions SourceCode/Symu/Repository/Entities/Database.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ public Database()
}

public static Database CreateInstance(GraphMetaNetwork metaNetwork, MainOrganizationModels models, CommunicationTemplate medium,
byte classId)
IClassId classId)
{
return new Database(metaNetwork, models, medium, classId);
}

public Database(GraphMetaNetwork metaNetwork, MainOrganizationModels models, CommunicationTemplate medium,
byte classId) : base(metaNetwork, classId)
IClassId classId) : base(metaNetwork, classId)
{
if (metaNetwork is null)
{
Expand Down
2 changes: 1 addition & 1 deletion SourceCode/Symu/Repository/Entities/EmailEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private EmailEntity()
}

private EmailEntity(GraphMetaNetwork metaNetwork, MainOrganizationModels models) : base(metaNetwork, models,
new EmailTemplate(), Class)
new EmailTemplate(), ClassId)
{
}

Expand Down
2 changes: 1 addition & 1 deletion SourceCode/Symu/Repository/Entities/WikiEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private WikiEntity()
}

private WikiEntity(GraphMetaNetwork metaNetwork, MainOrganizationModels models) : base(metaNetwork, models,
new ViaPlatformTemplate(), Class)
new ViaPlatformTemplate(), ClassId)
{
}

Expand Down
5 changes: 2 additions & 3 deletions SourceCode/SymuTests/Repository/Entities/DatabaseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void Initialize()
MainOrganization.Models.SetOn(1);
_knowledge = new Knowledge(MainOrganization.MetaNetwork, MainOrganization.Models, "1",
(byte) _floats1.Length);
_database = new Database(MainOrganization.MetaNetwork, MainOrganization.Models, _communication, 0);
_database = new Database(MainOrganization.MetaNetwork, MainOrganization.Models, _communication, Database.ClassId);
_database.CognitiveArchitecture.InternalCharacteristics.TimeToLive = 10;
_bits1 = new Bits(_floats1, 0);
}
Expand Down Expand Up @@ -132,8 +132,7 @@ public void ForgettingProcessTest1()
public void ForgettingProcessTest2()
{
MainOrganization.Models.Forgetting.On = true;
_database = new Database(MainOrganization.MetaNetwork, MainOrganization.Models, _communication,
Environment.RandomLevelValue);
_database = new Database(MainOrganization.MetaNetwork, MainOrganization.Models, _communication, Database.ClassId);
_database.CognitiveArchitecture.InternalCharacteristics.TimeToLive = 1;
_database.StoreKnowledge(_knowledge.EntityId, _bits1, 1, 0);
_database.ForgettingProcess(2);
Expand Down

0 comments on commit 5e12913

Please sign in to comment.