Skip to content
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

Problem with the send guards of the transitions in the example "Autonomous Resource Allocation" #39

Open
aaniculaesei opened this issue Nov 4, 2024 · 2 comments
Assignees

Comments

@aaniculaesei
Copy link
Collaborator

Hi all,
I am experimenting a bit with the example "Autonomous Resource Allocation" in which different client agents request the allocation of virtual machines through a manager agent.

Running the example as it is listed in the browser yields no problems and the model is built successfully. I want to replace the call of the send guard g(role,cLink,mLink) with the corresponding predicate that evaluates to true, in order to see if the model builds successfully in this case also.

When I change the send guard g(role,cLink,mLink) in the sReserve transition of the client agent to (@cv==clnt), the model is built successfully.

When I replace the send guard g(role,cLink,mLink) in the sRequest transition of the client agent with (cLink==c && @cv==mgr) I get the error receiveAgentReceivePreds is empty.

I also try the following thing:

  • I create the guard guard g2(c:channel) := (channel == c) && (@cv == mgr)
  • I call it as a send guard g2(cLink) in the sRequest transition of the client agent.
  • When I try to build the model, I get the error Failure[10:1]: Error in agent definition.

What am I missing here?

@shaunazzopardi shaunazzopardi self-assigned this Nov 25, 2024
shaunazzopardi added a commit that referenced this issue Nov 25, 2024
Previous code did not abort attempts at matching receive transitions with sending transition when the send guard was false, instead throwing an exception. The proposed solution circumvents this by avoiding looping over the potentially receiving agent's states and transitions, resulting in stutter transitions being created for the receiving agent.
@shaunazzopardi
Copy link
Member

shaunazzopardi commented Nov 25, 2024

There are two issues here:

When I replace the send guard g(role,cLink,mLink) in the sRequest transition of the client agent with (cLink==c && @cv==mgr) I get the error receiveAgentReceivePreds is empty.

For this, I am proposing a solution to this issue.

This error seems to be that when we are creating the composition, when the sRequest transition considered against the Machine receiving transitions, we are detecting that no Machine transition can match sRequest. However, instead of aborting the match before looping over the Machine's receiving transition, we start looping, discover that the send guard cannot match, and raise an exception. Instead in the proposed solution, I detect the incompatibility before the looping, avoid the looping, and go directly to creating the appropriate stutter transitions for Machine.

I create the guard guard g2(c:channel) := (channel == c) && (@cv == mgr)
I call it as a send guard g2(cLink) in the sRequest transition of the client agent.
When I try to build the model, I get the error Failure[10:1]: Error in agent definition.

The error message is not very informative here, but the error is due to g2 being already defined as a channel in the first line of the script. Given the development of the new parser is ongoing with better error messages, there is no need to do anything further on this lack of informative error messages on the Java-implemented parser side.

@shaunazzopardi
Copy link
Member

shaunazzopardi commented Dec 16, 2024

Delaying merging this and marking this as solved till we have appropriate full-pipeline regression tests (#13), which is postponed until new parser is operational.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants