Package it.unito.di.artifact

Examples of it.unito.di.artifact.RoleMessage


 
  @OPERATION
  public void propose(Proposal prop, RoleId participant, RoleId initiator) {
   
    prop.setRoleId(participant);
    RoleMessage proposal = new RoleMessage();
     proposal.setContents(prop);
     proposal.setRoleSender(participant);
     proposal.setRoleReceiver(initiator);
     proposal.setPerformative(ACLMessage.PROPOSE);
    send(proposal);
   
    try {
      createCommitment(new Commitment(participant, new RoleId(INITIATOR_ROLE, RoleId.GENERIC_ROLE), "accept", new CompositeExpression(
          LogicalOperatorType.OR, new Fact("done"), new Fact("failure"))));
View Full Code Here


  }
 
 
  @OPERATION
  public void refuse(RoleId participant, RoleId initiator) {
    RoleMessage refusal = new RoleMessage();
    refusal.setRoleSender(participant);
    refusal.setRoleReceiver(initiator);
    refusal.setPerformative(ACLMessage.REFUSE);
    send(refusal);
   
    try {
      releaseCommitment(new Commitment(initiator, participant, "propose", new CompositeExpression(
          LogicalOperatorType.OR, new Fact("accept"), new Fact("reject"))));
View Full Code Here

    }
  }
 
  @OPERATION
  public void done(Task task, RoleId participant, RoleId initiator) {
    RoleMessage done = new RoleMessage();
     done.setContents(task);
     done.setRoleSender(participant);
     done.setRoleReceiver(initiator);
     done.setPerformative(ACLMessage.INFORM);
    send(done);
   
    try {
      assertFact(new Fact("done", initiator, task));
      logger.trace("OPERATION PERFORMED: DONE by "+participant);
View Full Code Here

    }
  }
 
  @OPERATION
  public void failure(RoleId participant, RoleId initiator) {
    RoleMessage failure = new RoleMessage();
    failure.setRoleSender(participant);
    failure.setRoleReceiver(initiator);
    failure.setPerformative(ACLMessage.FAILURE);
    send(failure);
    try {
      assertFact(new Fact("failure"));
      logger.trace("OPERATION PERFORMED: FAILURE by "+participant);
    } catch (MissingOperandException e) {
View Full Code Here

TOP

Related Classes of it.unito.di.artifact.RoleMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.