[Next] [Previous] [Up] [Top] [Contents] [Index]
"Demopolis" est un petit exemple complet montrant comment on pourrait intégrer règles et simulation numérique discrète et sert de test pour le petit langage que nous avons dévelopé (voir la section 6-2.3 "Simulation numérique et règles d'inférence" [p. 246]). Il représente un simple modèle démographique caricatural. Il existe une base de simulation "intelligente" appelée "demopolis" qui est en communication avec deux bases d'inférence. Il s'agit de deux décideurs, le gouvernement et le peuple. Chacun des deux observe certaines variables de simulation et réagit en fonction de certains seuils. Ils s'envoient également des messages entre eux.
;;; FILE pop.sib ;;; Short demo program for the simulation inference module ;;; The way in which we do this is still very experimental ;; ****************************** THE POLIS ****************************** ;; --------------------------- The systems in demopolis ;; The system which simulates the country (demopolis); it can do numeric ;; simulation and inference (def-sibdemopolis
) ;; The system which models the "people" (def-ibpeople
) ;; The system which models the "government" (def-ibgovernment
) ;; --------------------------- the simulation objects of demopolis (def-level?pop
sbs (demopolis) ini (20000) eq (+ ?pop ?Birth (- ?Death))) (def-flow?Birth
sbs (demopolis) ini (0) eq (* ?Birthrate ?pop)) (def-flow?Death
sbs (demopolis) ini (0) eq (* ?Deathrate ?pop)) (def-parm?Birthrate
sbs (demopolis) ini (0.051)) (def-parm?Deathrate
sbs (demopolis) ini (0.039)) (def-obs?occupation
sbs (demopolis) ini (0) eq (/ ?pop 20000)) ; ----------------------- declaration of inference base - subsystems ;; At some point we must tell the demopolis system to whom it should send its ;; states after each cyle. The subsys function does this. Note, that this ;; kind of "interface" is still very experimental. (sub-sys demopolis demopolis) (sub-sys demopolis government) (sub-sys demopolis people) ;; ---------------------------- the rules for demopolis ;; The following two rules are needed for "administration purposes". ;; -------- organization rules ;; clean up msg from the simulation cycle, also passed to the others ;; sim-cycle no and end msg are removed ;; (p clean-up ibs (demopolis people government) lhs (end sim-cycle) (sim-cycle -t) rhs (rm =f1 =f2)) ;; -------- update rules ;; This rule fires when it encounters an "effect" pattern in the data base ;; and if its "time" (-s) is equal to the simulation cycle number (-t) ;; The "(eval ..)" function evaluates (= executes) the function stored in ;; the variable "-thing". (p trigger-effect ibs (demopolis) lhs (sim-cycle -t) (effect -thing -s) test (= -t -s) rhs (eval -thing) (rm =f2) ) ;; **************************** THE ACTORS ******************************* ;; --------------------------- the rules for the government ;; This rule allows family allocations to people when the occupation of ;; the territory is too low. ;; Let's illustrate how inference bases are linked to the simulation base. ;; After each simulation cycle, the simulation system writes its states to ;; all the systems which have been declared as subsystems. ;; It uses the following template: (sys-var <?name> <simulation-object> ;; which then is used by the lhs of a rule. The function ;; (so-val <simulation-object>) returns the value of a simulation object, ;; (so-def <simulation-object> <val>) sets the value of a simulation object. ;; Note also the difference between the add-f and the add-fact functions. ;; The further adds a fact to the proper database, whereas the the latter ;; adds a fact to another database. (paugment-births
ibs (government) lhs (sim-cycle -t) (family-allocation -x) (sys-var ?occupation -occobj) test (< (so-val -occobj) 0.945) (not-fact (program birth-stimulation -n) government) rhs (add-f* '(family allocation ,(+ -x 300) (time ,-t))) (add-fact* '(family-allocation ,(+ -x 300) (time ,-t)) people) (add-f* '(program birth-simulation ,(+ -t 12))) (rm =f2) ) ;; checks the time a program should run, before a new one can be installed (pprogram-update
ibs (government) lhs (sim-cycle -t) (program -prog -endtime) test (>= -t -endtime) rhs (rm =f2) ) ;; If the government organizes a war, the population is reduced once ;; to 80 percent (porganize-war
ibs (government) lhs (voice-of-people make-war) (sys-var ?pop -popobj) rhs (so-def -popobj (* 0.8 (so-val -popobj))) (rm =f1) ) ;; If the government hears the voice of the people, it undertakes some ;; symbolic action without effect upon the system (preact-to-people
ibs (government) lhs (voice-of-people -anything) rhs (msg /N /beep "MESSAGE FROM THE GOVERNMENT: GIVE SPEECH" /N /beep) (rm =f1)) ;; In the beginning there is no family allocation (initial-facts government (family-allocation 0)) ;; --------------------------- the rules for the people ;; If people feel too crowded they reduce the birthrate (in 5 cycles) ;; and they call for a war. ;; This rule writes (effect <function> <time> templates ;; in an inference base. They are triggered upon an impulse by the "trigger ;; effect rule". This is a typical example where we use a procedure, ;; i.e. "(so-def .....)" as data and evaluate it when needed. (pcheck-population
ibs (people) lhs (sys-var ?pop -popobj) (sys-var ?birthrate -brobj) (sim-cycle -t) test (> (so-val -popobj) 21000) rhs (add-fact (voice-of-people make-war) government) (add-fact* '(effect (so-def ,-brobj (- (so-val ,-brobj) 0.05)) ,(+ -t 5)) demopolis)) ;; But they also react positivly to family allocations, i.e. the birth-rate ;; is raisen by 0.06 percent in seven cycles. (preact-to-family-allocation
ibs (people) lhs (family-allocation -amount (time -t)) (sys-var ?birthrate -brobj) rhs (add-fact* '(effect (so-def ,-brobj (+ (so-val ,-brobj) 0.06)) ,(+ -t 7)) demopolis) (rm =f1))
Voici une "trace" assez longue qui montre comment ce petit système tourne. Cette trace n'est pas très facile à comprendre. Il s'agit ici d'un système prototype à l'interface très rudimentaire. Toutefois, on voit le principe de l'interaction entre ces différents systèmes et le mécanisme d'exécution de règles. Il faut essayer de comprendre comment s'exécutent les règles et le code devient plus clair. Il suffit par exemple de bien analyser les événements qui se passent dans le cycle no.6 pour comprendre la logique. Au début de ce cycle, la règle "check-population" qui modélise la perception du seuil de la population par le peuple est activée. Elle produit deux conséquences. Un "message" qui appelle à commencer une guerre est envoyé au gouvernement (insertion de "voice-of-people make-war" dans sa base de faits) et le taux de natalité est diminué dans le modèle de simulation (avec effet retardé). Le gouvernement réagit au message envoyé en activant les règles "react-to-people" et "organize-war".
SB-D> Defining Level: ?POP SB-D> DEMOPOLIS - Level: ?POP defined SB-D> DEMOPOLIS - Flow: ?BIRTH defined SB-D> DEMOPOLIS - Flow: ?DEATH defined SB-D> DEMOPOLIS - Parameter: ?BIRTHRATE defined SB-D> DEMOPOLIS - Parameter: ?DEATHRATE defined SB-D> DEMOPOLIS - Obs: ?OCCUPATION defined KB-D> DEMOPOLIS - Rule CLEAN-UP defined KB-D> PEOPLE - Rule CLEAN-UP defined KB-D> GOVERNMENT - Rule CLEAN-UP defined KB-D> DEMOPOLIS - Rule TRIGGER-EFFECT defined KB-D> GOVERNMENT - Rule AUGMENT-BIRTHS defined KB-D> GOVERNMENT - Rule PROGRAM-UPDATE defined KB-D> GOVERNMENT - Rule ORGANIZE-WAR defined KB-D> GOVERNMENT - Rule REACT-TO-PEOPLE defined KB-R> GOVERNMENT - Add fact: 1 (FAMILY-ALLOCATION 0 ) KB-D> PEOPLE - Rule CHECK-POPULATION defined KB-D> PEOPLE - Rule REACT-TO-FAMILY-ALLOCATION definedOK KB-R> DEMOPOLIS - Add fact: 1 (SYS-VAR ?POP #<ENVIRONMENT> ) KB-R> DEMOPOLIS - Add fact: 2 (SYS-VAR ?BIRTH #<ENVIRONMENT> ) KB-R> DEMOPOLIS - Add fact: 3 (SYS-VAR ?DEATH #<ENVIRONMENT> ) KB-R> DEMOPOLIS - Add fact: 4 (SYS-VAR ?BIRTHRATE #<ENVIRONMENT> ) KB-R> DEMOPOLIS - Add fact: 5 (SYS-VAR ?DEATHRATE #<ENVIRONMENT> ) KB-R> DEMOPOLIS - Add fact: 6 (SYS-VAR ?OCCUPATION #<ENVIRONMENT> ) KB-R> GOVERNMENT - Add fact: 2 (SYS-VAR ?POP #<ENVIRONMENT> ) KB-R> GOVERNMENT - Add fact: 3 (SYS-VAR ?BIRTH #<ENVIRONMENT> ) KB-R> GOVERNMENT - Add fact: 4 (SYS-VAR ?DEATH #<ENVIRONMENT> ) KB-R> GOVERNMENT - Add fact: 5 (SYS-VAR ?BIRTHRATE #<ENVIRONMENT> ) KB-R> GOVERNMENT - Add fact: 6 (SYS-VAR ?DEATHRATE #<ENVIRONMENT> ) KB-R> GOVERNMENT - Add fact: 7 (SYS-VAR ?OCCUPATION #<ENVIRONMENT> ) KB-R> PEOPLE - Add fact: 1 (SYS-VAR ?POP #<ENVIRONMENT> ) KB-R> PEOPLE - Add fact: 2 (SYS-VAR ?BIRTH #<ENVIRONMENT> ) KB-R> PEOPLE - Add fact: 3 (SYS-VAR ?DEATH #<ENVIRONMENT> ) KB-R> PEOPLE - Add fact: 4 (SYS-VAR ?BIRTHRATE #<ENVIRONMENT> ) KB-R> PEOPLE - Add fact: 5 (SYS-VAR ?DEATHRATE #<ENVIRONMENT> ) KB-R> PEOPLE - Add fact: 6 (SYS-VAR ?OCCUPATION #<ENVIRONMENT> ) ----------------------------- simulation cycle: 2 ------------------------ KB-R> DEMOPOLIS - Add fact: 7 (SIM-CYCLE 2 ) KB-R> GOVERNMENT - Add fact: 8 (SIM-CYCLE 2 ) KB-R> GOVERNMENT - Rule AUGMENT-BIRTHS fails test KB-R> PEOPLE - Add fact: 7 (SIM-CYCLE 2 ) KB-R> PEOPLE - Rule CHECK-POPULATION fails test KB-R> DEMOPOLIS - --- Inference for sim-cycle done, cleaning STM's ............ ----------------------------- simulation cycle: 6 ------------------------ ;; à examiner plus particulièrement ===== KB-R> DEMOPOLIS - Add fact: 15 (SIM-CYCLE 6 ) KB-R> GOVERNMENT - Add fact: 16 (SIM-CYCLE 6 ) KB-R> GOVERNMENT - Rule AUGMENT-BIRTHS fails test KB-R> PEOPLE - Add fact: 15 (SIM-CYCLE 6 ) ;;*** la règle qui teste le seuil de population est activable *** KB-R> PEOPLE - Rule CHECK-POPULATION succedes test KB-R> PEOPLE - Ready rules: (CHECK-POPULATION) KB-R> PEOPLE ---- Rule: CHECK-POPULATION EXECUTES
, Facts used: (SYS-VAR ?POP #<ENVIRONMENT> ) (SYS-VAR ?BIRTHRATE #<ENVIRONMENT> ) (SIM-CYCLE 6 ) KB-R> GOVERNMENT -Add fact: 17 (VOICE-OF-PEOPLE MAKE-WAR )
;;*** la règle qui réagit à la pression pour une guerre est activable *** KB-R> GOVERNMENT - Rule ORGANIZE-WAR succedes test KB-R> GOVERNMENT - Ready rules: (ORGANIZE-WAR) ;;*** une deuxième règle de réaction est activable *** KB-R> GOVERNMENT - Rule REACT-TO-PEOPLE succedes test KB-R> GOVERNMENT - Ready rules: (ORGANIZE-WAR REACT-TO-PEOPLE) KB-R> GOVERNMENT ---- Rule: ORGANIZE-WAR EXECUTES
, Facts used: (VOICE-OF-PEOPLE MAKE-WAR ) (SYS-VAR ?POP #<ENVIRONMENT> ) ;; la population a perdu 20%! SIB-R> DEMOPOLIS -New value installed for ?POP
;; c'est la conséquence de cette règle KB-R> GOVERNMENT - Rm fact: 17 (VOICE-OF-PEOPLE MAKE-WAR ) KB-R> GOVERNMENT - Rule: ORGANIZE-WAR executed --- KB-R> GOVERNMENT ---- Rule: REACT-TO-PEOPLE EXECUTES
, Facts used: (VOICE-OF-PEOPLE MAKE-WAR ) ;; voici un autre type de réaction, c.a.d imprimer qc. MESSAGE FROM THE GOVERNMENT: GIVE SPEECH KB-R> GOVERNMENT - Rm fact: 17 (VOICE-OF-PEOPLE MAKE-WAR ) KB-R> GOVERNMENT - Rule: REACT-TO-PEOPLE executed --- ;; ici le système lance "effet délayé", le taux de natalité va baisser au cycle 11, cf. la règle "check population". KB-R> DEMOPOLIS -Add fact: 16 (EFFECT (SO-DEF #<ENVIRONMENT> (- (SO-VAL #<ENVIRONMENT> )
0.05 ))
11 )
KB-R> DEMOPOLIS - Rule TRIGGER-EFFECT fails test KB-R> PEOPLE - Rule: CHECK-POPULATION executed --- KB-R> DEMOPOLIS - --- Inference for sim-cycle done, cleaning STM's ----------------------------- simulation cycle: 7 ------------------------ KB-R> DEMOPOLIS - Add fact: 18 (SIM-CYCLE 7 ) KB-R> DEMOPOLIS - Rule TRIGGER-EFFECT fails test KB-R> GOVERNMENT - Add fact: 19 (SIM-CYCLE 7 ) KB-R> GOVERNMENT - Rule AUGMENT-BIRTHS fails test KB-R> PEOPLE - Add fact: 17 (SIM-CYCLE 7 ) KB-R> PEOPLE - Rule CHECK-POPULATION fails test KB-R> DEMOPOLIS - --- Inference for sim-cycle done, cleaning STM's -------------------------------- simulation cycle: 8 ------------------------ KB-R> DEMOPOLIS - Add fact: 20 (SIM-CYCLE 8 ) KB-R> DEMOPOLIS - Rule TRIGGER-EFFECT fails test KB-R> GOVERNMENT - Add fact: 21 (SIM-CYCLE 8 ) KB-R> GOVERNMENT - Rule AUGMENT-BIRTHS succedes test KB-R> GOVERNMENT - Ready rules: (AUGMENT-BIRTHS) KB-R> PEOPLE - Add fact: 19 (SIM-CYCLE 8 ) KB-R> PEOPLE - Rule CHECK-POPULATION fails test KB-R> GOVERNMENT - --- Rule: AUGMENT-BIRTHS EXECUTES, Facts used: (SIM-CYCLE 8 ) (FAMILY-ALLOCATION 0 ) (SYS-VAR ?OCCUPATION #<ENVIRONMENT> ) KB-R> GOVERNMENT - Add fact: 22 (FAMILY ALLOCATION 300 (TIME 8) ) KB-R> PEOPLE - Add fact: 20 (FAMILY-ALLOCATION 300 (TIME 8) ) KB-R> PEOPLE - Rule REACT-TO-FAMILY-ALLOCATION succedes test KB-R> PEOPLE - Ready rules: (REACT-TO-FAMILY-ALLOCATION) KB-R> GOVERNMENT - Add fact: 23 (PROGRAM BIRTH-SIMULATION 20 ) KB-R> GOVERNMENT - Rule PROGRAM-UPDATE fails test KB-R> GOVERNMENT - Rm fact: 1 (FAMILY-ALLOCATION 0 ) KB-R> GOVERNMENT - Rule: AUGMENT-BIRTHS executed --- KB-R> PEOPLE - --- Rule: REACT-TO-FAMILY-ALLOCATION EXECUTES, Facts used: (FAMILY-ALLOCATION 300 (TIME 8) ) (SYS-VAR ?BIRTHRATE #<ENVIRONMENT> ) KB-R> DEMOPOLIS - Add fact: 21 (EFFECT (SO-DEF #<ENVIRONMENT> (+ (SO-VAL #<ENVIRONMENT> ) 0.06 )) 15 ) KB-R> DEMOPOLIS - Rule TRIGGER-EFFECT fails test KB-R> PEOPLE - Rm fact: 20 (FAMILY-ALLOCATION 300 (TIME 8) ) KB-R> PEOPLE - Rule: REACT-TO-FAMILY-ALLOCATION executed --- KB-R> DEMOPOLIS - --- Inference for sim-cycle done, cleaning STM's ----------------------------- simulation cycle: 9 ------------------------ KB-R> DEMOPOLIS - Add fact: 23 (SIM-CYCLE 9 ) KB-R> DEMOPOLIS - Rule TRIGGER-EFFECT fails test KB-R> DEMOPOLIS - Rule TRIGGER-EFFECT fails test KB-R> GOVERNMENT - Add fact: 25 (SIM-CYCLE 9 ) KB-R> GOVERNMENT - Rule PROGRAM-UPDATE fails test KB-R> PEOPLE - Add fact: 22 (SIM-CYCLE 9 ) KB-R> PEOPLE - Rule CHECK-POPULATION fails test KB-R> DEMOPOLIS - --- Inference for sim-cycle done, cleaning STM's ........... ---------------------------- simulation cycle: 10 ------------------------ KB-R> DEMOPOLIS - Add fact: 27 (SIM-CYCLE 11 ) KB-R> DEMOPOLIS - Rule TRIGGER-EFFECT fails test KB-R> DEMOPOLIS - Rule TRIGGER-EFFECT succedes test KB-R> DEMOPOLIS - Ready rules: (TRIGGER-EFFECT) KB-R> GOVERNMENT - Add fact: 29 (SIM-CYCLE 11 ) KB-R> GOVERNMENT - Rule PROGRAM-UPDATE fails test KB-R> PEOPLE - Add fact: 26 (SIM-CYCLE 11 ) KB-R> PEOPLE - Rule CHECK-POPULATION fails test KB-R> DEMOPOLIS - --- Rule: TRIGGER-EFFECT EXECUTES, Facts used: (SIM-CYCLE 11 ) (EFFECT (SO-DEF #<ENVIRONMENT> (- (SO-VAL #<ENVIRONMENT>) 0.05 )) 11 ) SIB-R> DEMOPOLIS - New value installed for ?BIRTHRATE KB-R> DEMOPOLIS - Rm fact: 16 (EFFECT (SO-DEF #<ENVIRONMENT> (- (SO-VAL #<ENVIRONMENT> ) 0.05 )) 11 ) KB-R> DEMOPOLIS - Rule: TRIGGER-EFFECT executed --- KB-R> DEMOPOLIS - --- Inference for sim-cycle done, cleaning STM's ---------------------------- simulation cycle: 12 ------------------------ KB-R> DEMOPOLIS - Add fact: 29 (SIM-CYCLE 12 ) KB-R> DEMOPOLIS - Rule TRIGGER-EFFECT fails test KB-R> GOVERNMENT - Add fact: 31 (SIM-CYCLE 12 ) KB-R> GOVERNMENT - Rule PROGRAM-UPDATE fails test KB-R> PEOPLE - Add fact: 28 (SIM-CYCLE 12 ) KB-R> PEOPLE - Rule CHECK-POPULATION fails test KB-R> DEMOPOLIS - --- Inference for sim-cycle done, cleaning STM's ........... ---------------------------- simulation cycle: 15 ------------------------ KB-R> DEMOPOLIS - Add fact: 35 (SIM-CYCLE 15 ) KB-R> DEMOPOLIS - Rule TRIGGER-EFFECT succedes test KB-R> DEMOPOLIS - Ready rules: (TRIGGER-EFFECT) KB-R> GOVERNMENT - Add fact: 37 (SIM-CYCLE 15 ) KB-R> GOVERNMENT - Rule PROGRAM-UPDATE fails test KB-R> PEOPLE - Add fact: 34 (SIM-CYCLE 15 ) KB-R> PEOPLE - Rule CHECK-POPULATION fails test KB-R> DEMOPOLIS - --- Rule: TRIGGER-EFFECT EXECUTES, Facts used: (SIM-CYCLE 15 ) (EFFECT (SO-DEF #<ENVIRONMENT> (+ (SO-VAL #<ENVIRONMENT>) 0.06 )) 15 ) SIB-R> DEMOPOLIS - New value installed for ?BIRTHRATE KB-R> DEMOPOLIS - Rm fact: 21 (EFFECT (SO-DEF #<ENVIRONMENT> (+ (SO-VAL #<ENVIRONMENT> ) 0.06 )) 15 ) KB-R> DEMOPOLIS - Rule: TRIGGER-EFFECT executed --- KB-R> DEMOPOLIS - --- Inference for sim-cycle done, cleaning STM's ............. ---------------------------- simulation cycle: 20 ----------------------- KB-R> DEMOPOLIS - Add fact: 45 (SIM-CYCLE 20 ) KB-R> GOVERNMENT - Add fact: 47 (SIM-CYCLE 20 ) KB-R> GOVERNMENT - Rule PROGRAM-UPDATE succedes test KB-R> GOVERNMENT - Ready rules: (PROGRAM-UPDATE) KB-R> PEOPLE - Add fact: 44 (SIM-CYCLE 20 ) KB-R> PEOPLE - Rule CHECK-POPULATION fails test KB-R> GOVERNMENT - --- Rule: PROGRAM-UPDATE EXECUTES, Facts used: (SIM-CYCLE 20 ) (PROGRAM BIRTH-SIMULATION 20 ) KB-R> GOVERNMENT - Rm fact: 23 (PROGRAM BIRTH-SIMULATION 20 ) KB-R> GOVERNMENT - Rule: PROGRAM-UPDATE executed --- KB-R> DEMOPOLIS - --- Inference for sim-cycle done, cleaning STM's ---------------------------- simulation cycle: 21 ------------------------ KB-R> DEMOPOLIS - Add fact: 47 (SIM-CYCLE 21 ) KB-R> GOVERNMENT - Add fact: 49 (SIM-CYCLE 21 ) KB-R> PEOPLE - Add fact: 46 (SIM-CYCLE 21 ) KB-R> PEOPLE - Rule CHECK-POPULATION fails test KB-R> DEMOPOLIS - --- Inference for sim-cycle done, cleaning STM's ............... ---------------------------- simulation cycle: 30 ------------------------ KB-R> DEMOPOLIS - Add fact: 65 (SIM-CYCLE 30 ) KB-R> GOVERNMENT - Add fact: 67 (SIM-CYCLE 30 ) KB-R> PEOPLE - Add fact: 64 (SIM-CYCLE 30 ) KB-R> PEOPLE - Rule CHECK-POPULATION succedes test KB-R> PEOPLE - Ready rules: (CHECK-POPULATION) KB-R> PEOPLE - --- Rule: CHECK-POPULATION EXECUTES, Facts used: (SYS-VAR ?POP #<ENVIRONMENT> ) (SYS-VAR ?BIRTHRATE #<ENVIRONMENT> ) (SIM-CYCLE 30 ) KB-R> GOVERNMENT - Add fact: 68 (VOICE-OF-PEOPLE MAKE-WAR ) KB-R> GOVERNMENT - Rule ORGANIZE-WAR succedes test KB-R> GOVERNMENT - Ready rules: (ORGANIZE-WAR) KB-R> GOVERNMENT - Rule REACT-TO-PEOPLE succedes test KB-R> GOVERNMENT - Ready rules: (ORGANIZE-WAR REACT-TO-PEOPLE) KB-R> GOVERNMENT - --- Rule: ORGANIZE-WAR EXECUTES, Facts used: (VOICE-OF-PEOPLE MAKE-WAR ) (SYS-VAR ?POP #<ENVIRONMENT> ) SIB-R> DEMOPOLIS - New value installed for ?POP KB-R> GOVERNMENT - Rm fact: 68 (VOICE-OF-PEOPLE MAKE-WAR ) KB-R> GOVERNMENT - Rule: ORGANIZE-WAR executed --- KB-R> GOVERNMENT - --- Rule: REACT-TO-PEOPLE EXECUTES, Facts used: (VOICE-OF-PEOPLE MAKE-WAR ) MESSAGE FROM THE GOVERNMENT: GIVE SPEECH KB-R> GOVERNMENT - Rm fact: 68 (VOICE-OF-PEOPLE MAKE-WAR ) KB-R> GOVERNMENT - Rule: REACT-TO-PEOPLE executed --- KB-R> DEMOPOLIS - Add fact: 66 (EFFECT (SO-DEF #<ENVIRONMENT> (- (SO-VAL #<ENVIRONMENT> ) 0.05 )) 35 ) KB-R> DEMOPOLIS - Rule TRIGGER-EFFECT fails test KB-R> PEOPLE - Rule: CHECK-POPULATION executed --- KB-R> DEMOPOLIS - --- Inference for sim-cycle done, cleaning STM's ...............
Voici un graphe de l'évolution des variables de simulation. Les variables ?pop et ?occupation évoluent ensemble, on voit donc une étoile au lieu des lettres a et d. Dans ce diagramme, on voit bien la logique discrète des événements qui découle de l'intervention des règles dans une simulation discrète fondée sur des équations. Les événements les plus importants se passent entre les cycles 5/6, 10/11, 14/15 et 29/30. Par exemple le niveau de la population ?pop ("*") diminue brusquement dans le cycle 6 (conséquence de la guerre). Les naissances ?birth ("b") tombent dans le cycle 11 (conséquence du changement brusque du taux de natalité). L'augmentation des allocations familiales dans le cycle 8 a la conséquence inverse à partir du cycle 15.
a = ?POP min: 15624.4920843431 max: 21655.5563359669 b = ?BIRTH min: 16.2416757633504 max: 1292.55277543442 c = ?DEATH min: 609.35519128938 max: 827.936759464489 d = ?OCCUPATION min: 0.781224604217153 max: 1.08277781679835 STEP 1: * c STEP 2: b *c STEP 3: b *c STEP 4: b * c STEP 5: b * c STEP 6: c* b STEP 7: * b STEP 8: c* b STEP 9: c* b STEP 10: * b STEP 11: b * c STEP 12: b * c STEP 13: b * c STEP 14: * c STEP 15: c * b STEP 16: c * b STEP 17: c * b STEP 18: c * b STEP 19: c * b STEP 20: c * b STEP 21: c * b STEP 22: c * b STEP 23: c * b STEP 24: c * b STEP 25: c * b STEP 26: c* b STEP 27: c* b STEP 28: c* b STEP 29: * STEP 30: c * b STEP 31: c * b
Voici une liste avec les valeurs plus précises:
?POP ?BIRTH ?DEATH ?BIRTHRATE ?DEATHRATE?OCCUPATION MAX : 21655.556 1292.553 827.937 .061 .039 1.083 MIN : 15624.492 16.242 609.355 .001 .039 .781 STEP 0: 20240.000 1020.000 780.000 .051 .039 1.012 STEP 1: 20482.880 1032.240 789.360 .051 .039 1.024 STEP 2: 20728.675 1044.627 798.832 .051 .039 1.036 STEP 3: 20977.419 1057.162 808.418 .051 .039 1.049 STEP 4: 21229.148 1069.848 818.119 .051 .039 1.061 STEP 5: 21483.897 1082.687 827.937 .051 .039 1.074 STEP 6: 17393.363 876.543 670.298 .051 .039 .870 STEP 7: 17602.084 887.062 678.341 .051 .039 .880 STEP 8: 17813.309 897.706 686.481 .051 .039 .891 STEP 9: 18027.068 908.479 694.719 .051 .039 .901 STEP 10: 18243.393 919.380 703.056 .051 .039 .912 STEP 11: 17550.144 18.243 711.492 .001 .039 .878 STEP 12: 16883.239 17.550 684.456 .001 .039 .844 STEP 13: 16241.676 16.883 658.446 .001 .039 .812 STEP 14: 15624.492 16.242 633.425 .001 .039 .781 STEP 15: 15968.231 953.094 609.355 .061 .039 .798 STEP 16: 16319.532 974.062 622.761 .061 .039 .816 STEP 17: 16678.562 995.491 636.462 .061 .039 .834 STEP 18: 17045.490 1017.392 650.464 .061 .039 .852 STEP 19: 17420.491 1039.775 664.774 .061 .039 .871 STEP 20: 17803.742 1062.650 679.399 .061 .039 .890 STEP 21: 18195.424 1086.028 694.346 .061 .039 .910 STEP 22: 18595.723 1109.921 709.622 .061 .039 .930 STEP 23: 19004.829 1134.339 725.233 .061 .039 .950 STEP 24: 19422.935 1159.295 741.188 .061 .039 .971 STEP 25: 19850.240 1184.799 757.494 .061 .039 .993 STEP 26: 20286.945 1210.865 774.159 .061 .039 1.014 STEP 27: 20733.258 1237.504 791.191 .061 .039 1.037 STEP 28: 21189.390 1264.729 808.597 .061 .039 1.059 STEP 29: 21655.556 1292.553 826.386 .061 .039 1.083 STEP 30: 17705.583 1056.791 675.653 .061 .039 .885 STEP 31: 18095.106 1080.041 690.518 .061 .039 .905
Cet exemple sans intérêt théorique montre bien l'utilité de combiner simulation numérique et règles sans difficultés majeurs. En effet, c'est un moyen pour tenir compte du décideur humain, et revaloriser certaines modélisations du type "Club de Rome" à ses débuts qui n'ont pas su intégrer dans leurs scénarios de tels mécanismes, qui interviennent dans des boucles de "feed-back" positif.
[Next] [Previous] [Up] [Top] [Contents] [Index]
Generated with Harlequin WebMaker