-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
daliirc modifications #41
base: master
Are you sure you want to change the base?
daliirc modifications #41
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
controlla la mia review, dobbiamo mantenere una certa compatibilità verso il basso
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rompe la compatibilità con la versione esempi basic, non posso accettare un path hard-coded
check_number(El):- El>47, El<58. %range in ASCII per i numeri da 0 a 9 | ||
scorri(L_rest):-if(L_rest=[],true, scorri_list(L_rest)). %controlla che tutti gli elementi della lista sono numeri | ||
scorri_list(L_rest):- nth0(0,L_rest,X,L2), check_number(X),scorri(L2). | ||
scrittura(Me):- name(Me,L),nth0(0,L,R,L3), append([100,101,108,116,97,116,40],L3,L1), %scrittura sul file pl del deltat inserito dall'agente | ||
append(L1,[41],L2), clause(buffer(Parsed),_), retractall(buffer(_)), | ||
append(Parsed,L2,Parola),assert(buffer(Parola)), | ||
clause(deltaT(X),true),retractall(deltaT(X)),assert(deltaT(1)). %asserisco deltat a 1 in modo tale da sapere che � stato inserito | ||
clause(deltaT(X),true),retractall(deltaT(X)),assert(deltaT(1)). %asserisco deltat a 1 in modo tale da sapere che � stato inserito |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non capisco qui dove sono le differenze
@@ -89,7 +89,7 @@ | |||
set_prolog_flag(discontiguous_warnings,off), | |||
open(FI,read,Stream,[]), read(Stream,Me), close(Stream), | |||
Me \= end_of_file, | |||
agent(File, AgentName, Ontolog, Lang, Fil, Lib, UP, DO, Specialization) = Me, | |||
agent(File, AgentName, Ontolog, Lang, Fil, Lib, UP, DO, Specialization,AgentType) = Me, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
anche qui che succede se uno studente decide di far girare la versione basic? In quel caso i types non sono utilizzati
@@ -104,8 +104,12 @@ | |||
|
|||
delete_agent_files(File), | |||
token(File), | |||
start1(File, AgentName, Lib, Fil). | |||
|
|||
start1(File, AgentName, Lib, Fil,AgentType). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idem
@@ -119,7 +123,7 @@ | |||
|
|||
filtra_fil(FI):-arg(1,FI,File),token_fil(File),retractall(parentesi(_)),togli_var_fil(File). | |||
|
|||
start1(Fe,AgentName,Libr,Fil):- | |||
start1(Fe,AgentName,Libr,Fil,AgentType):- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idem
@@ -165,9 +169,13 @@ | |||
ass_internal_repeat, | |||
|
|||
ass_stringhe_mul(FilePlv), | |||
|
|||
open(FilePlv, append, Stream), | |||
atom_concat(' ?-',AgentType,E1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idem
@@ -693,7 +700,7 @@ | |||
%print('RECEIVED: '),print(message(Ind,Ag,IndM,AgM,Language,Ontology,Con)),nl, | |||
if(clause(receive(Con),_),chiama_con(AgM,IndM,Language,Ontology,Con),not_receivable_meta(AgM,IndM,Language,Ontology,Con)). | |||
|
|||
chiama_con(AgM,IndM,Language,Ontology,Con):-if(receive(Con),true,not_receivable_message(AgM,IndM,Language,Ontology,Con)). | |||
chiama_con(AgM,IndM,Language,Ontology,Con):-write(Con),if(receive(Con),true,not_receivable_message(AgM,IndM,Language,Ontology,Con)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a che serve questa write?
@@ -953,7 +960,7 @@ | |||
fai(X,T,Ag):-functor(X,F,_),if(F=message,em_mess0(X,T,Ag),choose_action(X)),if(F\=message,(ver_az_int(X,T,Ag),!),true). | |||
|
|||
choose_action(X):-functor(X,F,_),if(member(F,[drop_past,look_up_past,add_past,set_past,callasp]), | |||
take_past_actions(F,X),(print(make(X)),nl)),save_on_log_file(make(X)). | |||
take_past_actions(F,X),(print(make(X)),nl)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perché hai tolto il log?
@@ -994,9 +1001,8 @@ | |||
%% Azione di invio del messaggio | |||
emetti_ms(To,M,S,IndS,IndTo):-clause(own_language(Lang),_), | |||
invia_terms_ontology(O), | |||
out(message(IndTo,To,IndS,S,Lang,O,M)), | |||
out(message(IndTo,To,IndS,S,Lang,O,M)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
qui cosa è diverso?
@@ -994,9 +1001,8 @@ | |||
%% Azione di invio del messaggio | |||
emetti_ms(To,M,S,IndS,IndTo):-clause(own_language(Lang),_), | |||
invia_terms_ontology(O), | |||
out(message(IndTo,To,IndS,S,Lang,O,M)), | |||
out(message(IndTo,To,IndS,S,Lang,O,M)). | |||
%print(send_message_to(To,M,Lang,O)),nl, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perché togliere anche qui il log?
Hi
These modifications were made during the development of the DAIRC project
The modifications provided enable agent initialization by adding a predicate of the following kind
AgentType:- <initCode>
By injecting such predicate into the resulting plv files.
Vittorio D'Antico
282289