Examples of Theory


Examples of alice.tuprolog.Theory

    PrologControl prolog = new PrologControl();
    PrologCafeModel model1 = new PrologCafeModel(prolog);

    Prolog engine = new Prolog();
    try {
      Theory theory1 = new Theory(
          this
          .getClass()
          .getClassLoader()
          .getResourceAsStream(
              "org/cspoker/client/bots/bot/search/opponentmodel/prolog/tuprolog/theory.pl"));
View Full Code Here

Examples of alice.tuprolog.Theory

  @Override
  public OpponentModel create(PlayerId actor) {
    Prolog engine = new Prolog();
    try {
      Theory theory1 = new Theory(
          this
              .getClass()
              .getClassLoader()
              .getResourceAsStream(
                  "org/cspoker/client/bots/bot/search/opponentmodel/prolog/tuprolog/theory.pl"));
View Full Code Here

Examples of clueless.model.Theory

   
  }
 
  private void submitAccusation()
  {
    Theory theory;
    //TODO:  Do we really need to pass which player suggested it or can the server deduce that?
    theory = new Theory(Theory.Type.ACCUSATION, selectedWeapon, selectedCharacter, selectedRoom, controller.getCurrentPlayer());
    //TODO: CC - check if is server, then send the MakeAccusation message?
    controller.fireMakeAccusationEvent(new MakeAccusationEvent(this, theory));
  }
View Full Code Here

Examples of clueless.model.Theory

   
  }
 
  private void submitSuggestion()
  {
    Theory theory;
    //TODO:  Do we really need to pass which player suggested it or can the server deduce that?
    theory = new Theory(Theory.Type.SUGGESTION, selectedWeapon, selectedCharacter, selectedRoom);
    controller.fireMakeSuggestionEvent(new MakeSuggestionEvent(this, theory));
    jfrm.dispose();
  }
View Full Code Here

Examples of clueless.model.Theory

    mainView.initialView()
  }

  @Override
  public void handleMakeAccusationEvent(MakeAccusationEvent event) {
    Theory theory = event.getTheory();

    //If fired by main game view, show the accusation view
    if(theory == null)
    {
      mainView.showAccusationView();
    }
    else //otherwise, fired by AccusationView and it contains an actual theory
    {
      //if host, pass message to clients indicating the suggestion being made, and whether it was correct
      if(isServer)
      {
        this.fireTextStatusEvent(new TextStatusEvent(this, theory.getTheoryText()));
        //check if theory is correct
        boolean isTheoryCorrect = testTheory(theory);
        if(isTheoryCorrect){
          this.fireTextStatusEvent(new TextStatusEvent(this, "Case Solved!"));
          //System.out.println("Case Solved!");
View Full Code Here

Examples of clueless.model.Theory

    /*if server, pass message to clients indicating the suggestion being made,
     *so they may respond
     *If fired by main game view, show the suggestion view and pass
     *the player's current location
     */
    Theory theory = event.getTheory();
    if(theory == null)
    {
      //TODO: Need to get current player location
      //Ask server for current player location
      CurrentLocationRequestMessage msg = new CurrentLocationRequestMessage();
      msg.setPlayer(client.getPlayer());
      client.send(msg);
    }
    else //otherwise, fired by SuggestionView and it contains an actual theory
    {
      this.fireTextStatusEvent(new TextStatusEvent(this, theory.getTheoryText()));
      if(isServer)
      {
        //Inject player as theorist if null
        if(theory.getTheorist() == null)
          theory = new Theory(Theory.Type.SUGGESTION, theory.getWeapon(), theory.getCharacter(), theory.getLocation(), this.currentPlayer); //this.client.getPlayer());
       

        //TODO:  Shouldn't this only check the immediately next player, unless they have none of the cards in question?
       
        for(Player player : this.game.getPlayers())
        {
          if(!player.equals(currentPlayer))
          {
            Vector<Card> hand = player.getHand();
            LinkedList<Card> invalidCards = new LinkedList<Card>();
            for(Card card : hand){
              switch(card.getCardType()){
              case WEAPON_CARD:
                if(theory.getWeapon().getWeaponType().equals(((WeaponCard)card).getWeaponType())){
                  invalidCards.add(card);
                }
                break;
              case CHARACTER_CARD:
                if(theory.getCharacter().getCharacterName().equals(((CharacterCard)card).getCharacterName())){
                  invalidCards.add(card);
                }
                break;
              case LOCATION_CARD:
                if(theory.getLocation().getRoomName().equals(((LocationCard)card).getLocationName())){
                  invalidCards.add(card);
                }
                break;
              }
             
            }
            if(invalidCards != null){
              if(invalidCards.size()==1) {
                // This player has one of the suggestion cards, notify the suggester AND let everyone else know at least one card in the suggestion is wrong.
                server.send(theory.getTheorist(), new SuggestionDisprovedCardMessage(player, invalidCards.get(0)));
                server.sendAll(new SuggestionDisprovedMessage(player, theory));
                return;
              } else if(invalidCards.size()>1) {
                // This player has more than one card - we need them to decide which one to show the suggester.
                this.fireSuggestionDisprovedNeedFeedBackEvent(new SuggestionDisprovedNeedFeedBackEvent(this, theory, invalidCards));
View Full Code Here

Examples of cs227b.teamIago.resolver.Theory

    for (int i = 0; i < el.size(); i++) {
      Expression e = el.get(i);
      exps[i] = new Predicate("true", new Expression[] {e});
    }
    // add to theory and extract the GameState
    Theory t = new Theory(true, false);
    t.setState(new ExpList(exps));
    GameState gs = t.getState();
    return gs;
  }
View Full Code Here

Examples of cs227b.teamIago.resolver.Theory

  protected static final Atom aGoal = new Atom("GOAL");

  public GameSimulator(boolean wantDebugPrintouts, boolean useOpt)
  {
    // TODO: enable second param once optimization works
    theoryObj = new Theory(wantDebugPrintouts, useOpt);
  }
View Full Code Here

Examples of org.junit.experimental.theories.Theory

          .fail("Never found parameters that satisfied method.  Violated assumptions: "
              + fInvalidParameters);
  }

  public boolean nullsOk() {
    Theory annotation= fMethod.getAnnotation(Theory.class);
    if (annotation == null)
      return false;
    return annotation.nullsAccepted();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.