Example #1
0
        public static double MIN_PRICE = 0.01;                  //lowest possible price

        public Agent(int id, AgentData data) : base(id, data)
        {
        }
Example #2
0
 /// <summary>
 /// Get an agent from AgentData by matching the logic name to the logic associated with the agent.
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 private BasicAgent getAgent(AgentData data)
 {
     data.Logic = getLogic(data.logicName);
     return(new DoranParberryAgent(0, data));
 }
Example #3
0
        public const double MIN_PRICE = 0.01;                   //lowest possible price

        public DoranParberryAgent(int id, AgentData data) : base(id, data)
        {
        }
Example #4
0
        /**
         * Find the agent class that has the most of a given good
         * @param	good
         * @return
         */
        /*
         * public function getAgentClassWithMost(good:String):String
         * {
         *      var amount:Float = 0;
         *      var bestAmount:Float = 0;
         *      var bestClass:String = "";
         *      for (key in _mapAgents.keys())
         *      {
         *              amount = getAverageInventory(key, good);
         *              if (amount > bestAmount)
         *              {
         *                      bestAmount = amount;
         *                      bestClass = key;
         *              }
         *      }
         *      return bestClass;
         * }
         */

        //private BasicAgent getAgentScript(AgentData data)
        //{
        //    data.logic = new LogicScript(data.logicName+".hs");
        //    return new Agent(0, data);
        //}

        private BasicAgent getAgent(AgentData data)
        {
            data.logic = getLogic(data.logicName);
            return(new Agent(0, data));
        }