From 010d1b6d3ce99498a337337bb2b1fded8cf9a69d Mon Sep 17 00:00:00 2001 From: Manuel Plonski Date: Wed, 5 Jul 2023 17:42:45 +0200 Subject: [PATCH] simulator --- db/production.yml | 6 +++--- econ/agents/price_believe_distribute.py | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/db/production.yml b/db/production.yml index 2834f04..90ddca2 100644 --- a/db/production.yml +++ b/db/production.yml @@ -6,7 +6,7 @@ spec: prod: Raw_Agriculture_Plot: 1 - name: Fruit - amount: 100 + amount: 20 prod: Raw_Agriculture_Plot: 1 # - name: Wood @@ -20,10 +20,10 @@ spec: # Wood: 1 - name: Food - amount: 50 + amount: 500 prod: # Fuel: 1 -# Fruit: 1 + Fruit: 1 Grain: 2 diff --git a/econ/agents/price_believe_distribute.py b/econ/agents/price_believe_distribute.py index 3d1365f..2a7836d 100644 --- a/econ/agents/price_believe_distribute.py +++ b/econ/agents/price_believe_distribute.py @@ -127,8 +127,9 @@ class Price_Believe_Distribiute_Agent(Base_Distribution_Agent): If positive will add lr to believe If negative will sub lr to believe """ - - self.price_believe[cx_id]+=(modifier/self.lr_at_sales)*self.lr + clipMod=max(-self.lr_at_sales,min(modifier,self.lr_at_sales)) + #clip mod so that price believe more smooth + self.price_believe[cx_id]+=(clipMod/self.lr_at_sales)*self.lr self.price_believe[cx_id] = round(self.price_believe[cx_id], 2) if self.price_believe[cx_id] < 1: