/* dem.kb */


low( total_demand_increment, 0 ).
high( total_demand_increment, 100 ).
scale( total_demand_increment, 'percent' ).
fuzzy_set( total_demand_increment, zero_tdi, down(0, 2) ).          % Effectively zero.
fuzzy_set( total_demand_increment, low_tdi, down(0, 30) ).          % Low demand increment.
fuzzy_set( total_demand_increment, moderate_tdi, tri(20, 50, 70) ). % Moderate demand increment.
fuzzy_set( total_demand_increment, high_tdi, up(60, 100) ).         % High demand increment.

low( health_concerns, 0 ).
high( health_concerns, 100 ).
scale( health_concerns, 'level' ).
fuzzy_set( health_concerns, low_hc, down(0, 30) ).             % Low health concerns.
fuzzy_set( health_concerns, moderate_hc, tri(20, 50, 70) ).    % Moderate health concerns.
fuzzy_set( health_concerns, high_hc, up(60, 100) ).            % High health concerns.

low( event_popularity_change, -100 ).
high( event_popularity_change, 100 ).
scale( event_popularity_change, 'change' ).
fuzzy_set( event_popularity_change, decreased_epc, down(-100, 0) ).  % Decreased popularity.
fuzzy_set( event_popularity_change, unchanged_epc, tri(-10, 0, 10) ).% Unchanged popularity.
fuzzy_set( event_popularity_change, increased_epc, up(0, 100) ).     % Increased popularity.

low( price_increase, 0 ).
high( price_increase, 100 ).
scale( price_increase, 'percent' ).
fuzzy_set( price_increase, lowest  , down(0, 1) ).      % Lowest increase in price.
fuzzy_set( price_increase, low     , down(0, 25) ).     % Low increase in price.
fuzzy_set( price_increase, moderate, tri(20, 50, 75) ). % Noticeable increase but not extreme.
fuzzy_set( price_increase, high    , up(70, 100) ).     % High increase in price.
fuzzy_set( price_increase, highest , up(99,100) ).      % Highest increase in price.


if total_demand_increment be low_tdi and health_concerns be low_hc
then 
   price_increase := low.

if total_demand_increment be moderate_tdi and health_concerns be low_hc
then 
   price_increase := moderate.

if total_demand_increment be high_tdi and health_concerns be low_hc
then 
   price_increase := high.

if total_demand_increment be moderate_tdi and health_concerns be moderate_hc
then 
   price_increase := low.

if total_demand_increment be high_tdi and health_concerns be moderate_hc
then 
   price_increase := moderate.

if total_demand_increment be low_tdi and health_concerns be high_hc
then 
   price_increase := lowest.

if total_demand_increment be moderate_tdi and health_concerns be high_hc
then 
   price_increase := low.

if total_demand_increment be high_tdi and health_concerns be high_hc
then 
   price_increase := moderate.

if event_popularity_change be increased_epc and total_demand_increment be moderate_tdi
then 
   price_increase := high.

if event_popularity_change be increased_epc and total_demand_increment be high_tdi
then 
   price_increase := highest.

if event_popularity_change be decreased_epc and total_demand_increment be moderate_tdi
then 
   price_increase := low.

if event_popularity_change be decreased_epc and total_demand_increment be high_tdi
then 
   price_increase := moderate.

% Additional rules for baseline demand and sudden corrections.
if total_demand_increment be zero_tdi and health_concerns be moderate_hc
then 
   price_increase := lowest.

if total_demand_increment be zero_tdi and health_concerns be high_hc
then 
   price_increase := lowest.