Skip to content

Commit

Permalink
Add ResourceNetwork, merge networkPortfolio
Browse files Browse the repository at this point in the history
  • Loading branch information
lmorisse committed Aug 19, 2020
1 parent 0c0ae11 commit 94a6239
Show file tree
Hide file tree
Showing 16 changed files with 979 additions and 560 deletions.
28 changes: 28 additions & 0 deletions SourceCode/Symu/Repository/Entity/Portfolio.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#region Licence

// Description: SymuBiz - Symu
// Website: https://symu.org
// Copyright: (c) 2020 laurent morisseau
// License : the program is distributed under the terms of the GNU General Public License

#endregion

#region using directives

using Symu.Common.Interfaces;
using Symu.Repository.Networks.Resources;

#endregion

namespace Symu.Repository.Entity
{
/// <summary>
/// Define who is using an object and how
/// </summary>
public class Portfolio : IAgentResource
{
public Portfolio(IAgentId agentId, byte typeOfUse, float allocation): base(agentId, typeOfUse, allocation)
{
}
}
}
38 changes: 38 additions & 0 deletions SourceCode/Symu/Repository/Entity/Resource.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#region Licence

// Description: SymuBiz - Symu
// Website: https://symu.org
// Copyright: (c) 2020 laurent morisseau
// License : the program is distributed under the terms of the GNU General Public License

#endregion

using Symu.Classes.Agents;
using Symu.Common.Interfaces;
using Symu.Repository.Networks.Resources;

namespace Symu.Repository.Entity
{
/// <summary>
/// Define who is using an object and how
/// </summary>
public class Resource : IResource
{

private readonly AgentId _agentId;
public Resource(IAgentId agentId)
{
_agentId = (AgentId)agentId;
}
public Resource(ushort id, byte classId)
{
_agentId = new AgentId(id, classId);
}

/// <summary>
/// The unique agentId of the resource
/// </summary>
public IAgentId Id => _agentId;

}
}
1 change: 1 addition & 0 deletions SourceCode/Symu/Repository/Networks/Databases/Database.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace Symu.Repository.Networks.Databases
{
/// <summary>
/// Database used to store and search information
/// A database is a system where agent store temporary or permanent information
/// </summary>
public class Database
{
Expand Down
5 changes: 3 additions & 2 deletions SourceCode/Symu/Repository/Networks/MetaNetwork.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
using Symu.Repository.Networks.Knowledges;
using Symu.Repository.Networks.Link;
using Symu.Repository.Networks.Portfolio;
using Symu.Repository.Networks.Resources;
using Symu.Repository.Networks.Role;
using Symu.Repository.Networks.Sphere;

Expand Down Expand Up @@ -62,7 +63,7 @@ public MetaNetwork(InteractionSphereModel interactionSphere, BeliefWeightLevel b
/// Directory of objects used by the agentIds
/// using, working, support
/// </summary>
public NetworkPortfolios Resources { get; } = new NetworkPortfolios();
public ResourceNetwork Resources { get; } = new ResourceNetwork();

/// <summary>
/// Knowledge network
Expand Down Expand Up @@ -140,7 +141,7 @@ public void RemoveAgent(IAgentId agentId)

/// <summary>
/// Add an agent to a group
/// It doesn't handle roles
/// It doesn't handle roles' impact
/// </summary>
/// <param name="agentId"></param>
/// <param name="allocation"></param>
Expand Down
73 changes: 0 additions & 73 deletions SourceCode/Symu/Repository/Networks/Portfolio/NetworkPortfolio.cs

This file was deleted.

0 comments on commit 94a6239

Please sign in to comment.