Package trams.simulation

Examples of trams.simulation.Simulator


     * @param playerName a <code>String</code> with the player's name.
     * @return a <code>boolean</code> which is true iff the simulation was created successfully.
     */
    public boolean createSimulator ( String scenarioName, String playerName ) {
        Scenario scen = createScenarioObject(scenarioName, playerName, 800000.00, START_SATISFACTION);
        theSimulator = new Simulator(scen);
        //Now for the scenario - create supplied vehicles.
        logger.debug("Creating " + scen.getNumberSuppliedVehicles() + " vehicles!");
        for ( int i = 0; i < scen.getNumberSuppliedVehicles(); i++ ) {
          Calendar deliveryDate = theSimulator.getCurrentSimTime();
          deliveryDate.add(Calendar.DAY_OF_MONTH, -1);
View Full Code Here


            double balance = Double.parseDouble(scenario.getAttribute("balance"));
            int psgSatisfaction = Integer.parseInt(scenario.getAttribute("satisfaction"));
            //Now create the scenario object.
            Scenario myScenario = createScenarioObject(scenarioName, playerName, balance, psgSatisfaction);
            //Seventhly, create the simulation object.
            theSimulator = new Simulator(myScenario, document.getDocumentElement().getAttribute("time"), Integer.parseInt(document.getDocumentElement().getAttribute("increment")));
            //Set the difficulty level.
            theSimulator.setDifficultyLevel(document.getDocumentElement().getAttribute("difficulty"));
            //Now add the messages!!!!
            NodeList messageNode = (NodeList) xpath.evaluate("//scenario/message", document.getDocumentElement(), XPathConstants.NODESET);
            for ( int i = 0; i < messageNode.getLength(); i++ ) {
View Full Code Here

     * Create a new simulation.
     * @param scenario a <code>Scenario</code> with the scenario to simulate.
     * @return a <code>boolean</code> which is true iff the simulation was created successfully.
     */
    public boolean createSimulation ( Scenario scenario ) {
        theSimulator = new Simulator(scenario);
        return true;
    }
View Full Code Here

TOP

Related Classes of trams.simulation.Simulator

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.