architecture - Agents in minority games: inheritance hierarchy, pluggable behaviour through interfaces or some pattern? -


I am currently building a library to allow various minority games to be simulated. It involves the selection of agents between two options, say, A and B, then selecting the primary function of an agent is an agent wins a point for a turn in the game, if it is selected after all the agents, then the minority group Ends in.

Obviously, a unique number is different in ways that an agent examines the effect of the strategy to make different choices on the overall wealth of their choice and game system. In some ways I need an agent to be able to choose:

  • Completely random
  • is being supplied with the memory so that they are the last M minority
  • This memory is being used as an investment in strategy mapping for predicting minority preference and by promoting many other agents of 'friend' of that agent and then Everyone Selects Gent based on certain conditions, it does rely on her friends or not.

Now for the programming problem I currently have an abstract agent that contains all of these functionality. The thing is that some types of agents do not have a list of friends, a set of strategies or memory etc. At the moment, we are putting all these capabilities into the base class. I can use a succession hierarchy, but I think that in the hierarchy there should be a crossover between different classes, for example, sometimes there may be friends and strategies of an agent, for the second time only friends or strategies. Similarly, I can have a collection of interfaces and apply the interface to which each different agent needs, i.e., the public enumeration choice (A, B) public interface decafable {Private Choice Picks; Public option getChoice (); Select Public Zero (); } Public Interface Strategic {Personal Strategy Manager Strategies; Strategy Manager to Public Strategy Manager; Public Zero Setstrategy Manager (Strategy Manager Strategy Manager); } The public class CleverAgent implements the decision of the more intelligent, using strategic strategies {// strategies}, the public square fools the agent applies {public zero to choose (if (Math.Randem <0.5) {return Choice A} and {return Choice} Now if I take this route, then I can already see many types of interfaces such as strategic, secure, scanner, stateful, memorable and boundless. The solution should be a mixture between a heritage sequence (I know at least that all the agents are comfortable so that they should go to the base class) couples paired with behavior.

My question is Is this the best way in this case? Are there any design patterns that I should see?

Any help would be appreciated.

Any help would be greatly appreciated. / P>

appreciate any help I think the use of patterns will help in your case. You can use an abstract base class (. Agent) can and can provide the setters to set the behavior or the behavior can be set in the constructors.

Here is some sample code to clarify my intention:

  abstract class agent {tactical strategy; Critical selector; Public Settlement (Strategic S) {this.strategy = s; } Public Set Choicmaker (Critical C) {this.choser = c; } Abstract public zero verb (); } Class Intelligent Agent Agent {Public Zero Action () // In some way, some interfaces work by implementing structural and decisive}} class methods. Stupidate Agent Agent (Public Zero Action) (// You can set up a strategy for stupid agent and  

comes with profit Strategy pattern is that the behavior of agents is now determined by the structure which can be modified if necessary (by providing the setter).


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -