-
Notifications
You must be signed in to change notification settings - Fork 7
save_agent
Tushar Semwal edited this page Oct 15, 2017
·
1 revision
save_agent(GUID, FileName) % Saves the predicates associated to the specified agent into a file. %
Agent_name: <atom + > FileName: <atom + >
This predicate is used to save all the predicates, payload and facts associated with the agent named Agent_name
specified by a user. The definitions are stored in the file with name FileName
.
Let the agent handler code be:
agent_handler(guid,(IP,Port),main):-
writeln("I am the handler"),
N is 1,
writeln(N).
?- agent_save(myagent,'E:\\save_agent_state.txt').
On successful execution of above predicate, a text file is created in the specified location containing agent code. The save_agent_state .txt file will save the agent state as:
agent_handler(myagent,(__ , __),main):-
writeln("I am the handler"),
N is 1,
writeln(N).
The user can use the desired file type (eg. .pl, .txt).