Ejemplo n.º 1
0
 /** Generates synthetic data with only normal users. */
 private static void normalsOnly() {
   long start = System.nanoTime();
   Simulation.run(KeepObjectsInMemory.instance());
   //		Simulation.run(SaveToDatabase.instance());
   long end = System.nanoTime();
   System.out.println((end - start) / 1000000);
   //		ClusterAnalysis.clusterSimData("");
 }
Ejemplo n.º 2
0
  //	private static void whileAway2() {
  //		ConstructGraph.allCombosFraudOnlyMultiDB();
  //		ConstructGraph.allCombosMultiDB();
  //	}
  // has loops for running big batches of simulations
  private static void whileAway1() {
    Strategy trevathan = new TrevathanStrategy(0.95, 0.85, 0.85);
    Strategy waitStart = new WaitStartStrategy(0.95, 0.85, 0.85);
    Strategy lowPrice = new LowPriceStrategy();

    //		for (int i : Arrays.asList(0)) {
    //			String databaseName = "syn_normal_20k_" + i;
    //			DBConnection.createDatabase(databaseName);
    //			SimulationCreateTableStmts.createSimulationTables(databaseName);
    //			// run the simulation and store everything into the database
    //			Simulation.run(SaveToDatabase.instance(databaseName), 20000);
    //			System.out.println("finished run " + i);
    //		}

    //		AgentAdder simpleWS = SimpleShillPair.getAgentAdder(200, waitStart); // can use 20, since
    // each submits 10 auctions.
    //		for (int i : Arrays.asList(1,2,3,4)) {
    //			String databaseName = "syn_simpleWS_20k_" + i;
    //			// construct database and tables to store simulation data
    //			DBConnection.createDatabase(databaseName);
    //			SimulationCreateTableStmts.createSimulationTables(databaseName);
    //
    //			// run the simulation and store everything into the database
    //			Simulation.run(SaveToDatabase.instance(databaseName), 20000, simpleWS);
    //			System.out.println("finished run " + i);
    //		}

    ////		AgentAdder hybridBoth = CollusionController.getAgentAdder(10 * 5, waitStart,
    // PuppetClusterBidderCombined.getFactory());
    //		AgentAdder hybridBoth = CollusionController.getAgentAdder(10 * 3, waitStart,
    // PuppetClusterBidderSellerCombined.getFactory());
    ////		Main.run(SaveToDatabase.instance(), hybrid);
    //		for (int i : Arrays.asList(0)) {
    //			String databaseName = "syn_hybridBothBS_20k_" + i;
    //			// construct database and tables to store simulation data
    ////			DBConnection.createDatabase(databaseName);
    ////			SimulationCreateTableStmts.createSimulationTables(databaseName);
    //
    //			// run the simulation and store everything into the database
    //			Simulation.run(SaveToDatabase.instance(databaseName), 20000, hybridBoth);
    //			System.out.println("finished run " + i);
    //		}

    AgentAdder hybridBothVGS =
        CollusionController.getAgentAdderVaryGroupSize(
            10 * 3, waitStart, PuppetClusterBidderSellerCombined.getFactory());
    //		Main.run(SaveToDatabase.instance(), hybrid);
    for (int i : Arrays.asList(5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19)) {
      String databaseName = "syn_hybridBothVGS_20k_" + i;
      // construct database and tables to store simulation data
      DBConnection.createDatabase(databaseName);
      SimulationCreateTableStmts.createSimulationTables(databaseName);

      // run the simulation and store everything into the database
      Simulation.run(SaveToDatabase.instance(databaseName), 20000, hybridBothVGS);
      System.out.println("finished run " + i);
    }

    AgentAdder hybrid =
        HybridT.getAgentAdder(10 * 5, waitStart, PuppetClusterBidderCombined.getFactory());
    //		Main.run(SaveToDatabase.instance(), hybrid);
    for (int i :
        Arrays.asList(
            20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39)) {
      String databaseName = "syn_hybridNormalEE_20k_" + i;
      // construct database and tables to store simulation data
      DBConnection.createDatabase(databaseName);
      SimulationCreateTableStmts.createSimulationTables(databaseName);

      // run the simulation and store everything into the database
      Simulation.run(SaveToDatabase.instance(databaseName), 20000, hybrid);
      System.out.println("finished run " + i);
    }

    //		AgentAdder repFraud = RepFraudController.getAgentAdder(1, 40, 500);
    //		for (int i : Arrays.asList(3,4,5,7,8,9,10,11,12,13,14,15,16,17,18,19)) {
    //			String databaseName = "syn_repFraud_20k_small_" + i;
    //			// construct database and tables to store simulation data
    //			DBConnection.createDatabase(databaseName);
    //			SimulationCreateTableStmts.createSimulationTables(databaseName);
    //
    //			// run the simulation and store everything into the database
    //			Simulation.run(SaveToDatabase.instance(databaseName), 20000, repFraud);
    //
    //			System.out.println("finished run " + i);
    //		}

    //		AgentAdder repFraud_3 = RepFraudController.getAgentAdder(3, 40, 800);
    //		for (int i : Arrays.asList(10,11,12,13,14,15,16,17,18,19)) {
    //			String databaseName = "syn_repFraud_20k_3_" + i;
    //			// construct database and tables to store simulation data
    //			DBConnection.createDatabase(databaseName);
    //			SimulationCreateTableStmts.createSimulationTables(databaseName);
    //
    //			// run the simulation and store everything into the database
    //			Simulation.run(SaveToDatabase.instance(databaseName), 20000, repFraud_3);
    //
    //			System.out.println("finished run " + i);
    //		}

  }