@Override
  public Domain generateDomain() {

    SADomain domain = new SADomain();

    Attribute xatt = new Attribute(domain, ATTX, AttributeType.INT);
    xatt.setLims(0, 10);

    Attribute yatt = new Attribute(domain, ATTY, AttributeType.INT);
    yatt.setLims(0, 10);

    ObjectClass agentClass = new ObjectClass(domain, CLASSAGENT);
    agentClass.addAttribute(xatt);
    agentClass.addAttribute(yatt);

    ObjectClass locationClass = new ObjectClass(domain, CLASSLOCATION);
    locationClass.addAttribute(xatt);
    locationClass.addAttribute(yatt);

    new Movement(ACTIONNORTH, domain, 0);
    new Movement(ACTIONSOUTH, domain, 1);
    new Movement(ACTIONEAST, domain, 2);
    new Movement(ACTIONWEST, domain, 3);

    new AtLocation(domain);

    return domain;
  }
Пример #2
0
  @Override
  public Domain generateDomain() {
    Domain domain = new SADomain();
    Attribute currentAmount = new Attribute(domain, STATE_CURRENT_AMOUNT, AttributeType.INT);
    currentAmount.setLims(0, maxAmount);

    ObjectClass agent = new ObjectClass(domain, CLASS_AGENT);
    agent.addAttribute(currentAmount);

    for (int i = 1; i <= maxAmount / 2; i++) {
      new BetAction(ACTION_BET + "_" + i, domain, winProb, i, maxAmount);
    }

    return domain;
  }