Programmation avec Netlogo
Romeric
-
KX Messages postés 16761 Date d'inscription Statut Modérateur Dernière intervention -
KX Messages postés 16761 Date d'inscription Statut Modérateur Dernière intervention -
Salut! S'il vous plait voici un bout de code que je n'arrive pas à interpréter:
Et aussi
NB:
Ce code est tiré du code source de El Farol dans les bibliotheques Netlogo. S'il est possible de l'expliquer à l'aide d'un algorithme, il me sera surement plus compréhensible. Merci
Set prediction predict-attendance? Sublist history week(week + memory-size) Set score score+abs(item(week-1) history-prediction
Et aussi
Set prediction predict-attendance? Best-strategy sublist history 0 memory-size
NB:
predict-attendanceest une fonction je pense, voici son code:
To report predict-attendance [strategy subhistory] Report 100*first strategy + sum(map [?1*?2] butfirst strategy subhistory)
Ce code est tiré du code source de El Farol dans les bibliotheques Netlogo. S'il est possible de l'expliquer à l'aide d'un algorithme, il me sera surement plus compréhensible. Merci
A voir également:
- Programmation avec Netlogo
- Application de programmation - Guide
- Programmation envoi sms - Guide
- Programmation vb - Télécharger - Langages
- Programmation binaire - Guide
- Programmation télécommande porte de garage brico depot - Forum Matériel & Système
1 réponse
Bonsoir,
Si tu as le code, tu dois aussi avoir les commentaires qui vont avec :
Et plus globalement, tu as la description du modèle sur le site de NetLogo
http://ccl.northwestern.edu/netlogo/models/ElFarol
Si tu as le code, tu dois aussi avoir les commentaires qui vont avec :
;; This reports an agent's prediction of the current attendance ;; using a particular strategy and portion of the attendance history. ;; More specifically, the strategy is then described by the formula ;; p(t) = x(t - 1) * a(t - 1) + x(t - 2) * a(t -2) +.. ;; ... + x(t - MEMORY-SIZE) * a(t - MEMORY-SIZE) + c * 100, ;; where p(t) is the prediction at time t, x(t) is the attendance of the bar at time t, ;; a(t) is the weight for time t, c is a constant, and MEMORY-SIZE is an external parameter. to-report predict-attendance [strategy subhistory] ;; the first element of the strategy is the constant, c, in the prediction formula. ;; one can think of it as the the agent's prediction of the bar's attendance ;; in the absence of any other data ;; then we multiply each week in the history by its respective weight report 100 * first strategy + sum (map [?1 * ?2] butfirst strategy subhistory) end
Et plus globalement, tu as la description du modèle sur le site de NetLogo
http://ccl.northwestern.edu/netlogo/models/ElFarol