Phil 10.20.17

7:00 – 4:30 ASRC MKT

  • Asked Wayne yesterday if I could have a desk in the HCC lab, since I’m going to Columbia for no good reason these days.
    • In support of this, got my laptop updated with code bases, PHP, database, etc.
  • Working on getting up the motivation to start combining the db and code pieces. So as a way of avoiding this, tweaked the CHIIR DC submission by using part of my abstract from the HCIC poster and using that browser mockup instead of the one that I put together the other day. I’m conflicted in that it has a word cloud, but I could argue that a word cloud is a reasonable boundary object for someone glancing through the papers and looking at the pictures. I also fixed the populations chart so that the terms line up with the simulation screenshots. populations
  • The RedBeanPHP file didn’t make it into subversion, so I downloaded it at home, verified that everything runs and committed it in the right place.
  • Ok, I think the plan will be to write a test harness that produces a threaded discussion with multiple users and votes for a solution that writes into the DB and is then able to retrieve the thread. To do that I’m going to need one-to-many and many-to-one, so I need to read more of the RedBeanPHP docs
    • Note that the name of the list has to match the type of beans it contains. So, the ‘ownProductList’ contains beans of type ‘product‘, a pageList contains pages, an ‘ownCarList’ contains ‘cars‘ and so on. This convention is used to create the database mapping, in case of the shop, every product record will get a ‘shop_id’field.
    • Ok, I think this is what I want to do:
      <?php
      /**
       * Created by IntelliJ IDEA.
       * Date: 10/20/2017
       * Time: 3:10 PM
       */
      require_once 'libs/rb.php';
      R::setup( 'mysql:host=localhost;dbname=polarizationgameone', 'root', 'postgres' );
      R::fancyDebug(TRUE);
      
      // create or get the scenarios
      $CREATE_SCENARIOS = TRUE;
      
      if(isset($CREATE_SCENARIOS)){
          echo "CREATE_SCENARIOS defined\n";
      }else{
          echo "CREATE_SCENARIOS not defined\n";
      }
      
      // create or get a random number of users between $minPlayers and $maxPlayers
      $CREATE_PLAYERS = NULL;
      $minPlayers = 3;
      $maxPlayers = 5;
      $numPlayers = rand($minPlayers, $maxPlayers);
      if(isset($CREATE_PLAYERS)){
          echo "CREATE_PLAYERS defined\n";
      }else{
          echo "CREATE_PLAYERS not defined\n";
      }
      
      // create a game using the scenarios and the players
      
      // for $numTurns, randomly choose a player to add a chat message
      $minTurns = 10;
      $maxTurns = 20;
      $numTurns = rand($minTurns, $maxTurns);
      for ($t = 0; $t < $numTurns; $t++){
          // connect to a previous statement or set thread_parent to zero
          // write the statment
          // maybe vote for a message?. At the end, some games need to have agreement.
          // a player changing votes pulls their vote from any previous message.
          // produce a list of posts with votes. It'll be something between 0 and $numPlayers
          // if a post has $numPlayers votes, its won. Allocate points to all players and some more to the 
          //  player with the winning post
          
          // print the status of this turn
          echo "$t\n";
      }
      
      // reconstruct the game from the database to compare and validate
      
      
      R::close();

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.