Package avrora.sim.energy

Examples of avrora.sim.energy.Energy


        mcu.getPin("PD5").connect(new PD5Output());
        // input
        mcu.getPin("PD2").connect(new PD2Input());

        //setup energy recording
        new Energy("flash", modeAmpere, stateMachine);
    }
View Full Code Here


        simulator = new Simulator(id, f, this, p);
        interpreter = simulator.getInterpreter();
        MCUCR_reg = getIOReg("MCUCR");
        installPins();
        installDevices();
        new Energy("CPU", modeAmpere, sleepState, simulator);
    }
View Full Code Here

        //setup energy recording
        Simulator simulator = mcu.getSimulator();
        stateMachine = new FiniteStateMachine(simulator.getClock(), RadioEnergy.startMode, allModeNames, ttm);
       
        new Energy("Radio", RadioEnergy.modeAmpere, stateMachine);

    }
View Full Code Here

        //setup energy recording
        Clock clk = sim.getClock();
       
        state = new FiniteStateMachine(clk, startMode, modeName, 0);
        probe = new LEDProbe();
        new Energy(c, modeAmpere, state);
    }
View Full Code Here

        sim = s;       
        //setup energy recording
        //note: the name sensorBoard was choosen on purpose as it is used in the log files
        //if you use sensor board, you may have trouble with importing the data as it is separated by white spaces
        FiniteStateMachine fsm = new FiniteStateMachine(s.getClock(), startMode, modeName, 0);
        new Energy("SensorBoard", modeAmpere, fsm);
    }
View Full Code Here

            Terminal.println("Node lifetime: " + cycles + " cycles,  " + simulator.getMicrocontroller().cyclesToMillis(cycles) / 1000.0+ " seconds\n");
            // get energy information for each device
            Iterator it = instance.consumer.iterator();
            while( it.hasNext() ){
                //get energy information
                Energy en = (Energy)it.next();
                int modes = en.getModeNumber();
                Terminal.println(en.getName() + ": " + en.getTotalConsumedEnergy() + " Joule");
                // get information for each state
                for (int j = 0; j < modes; j++)
                    //when there are more than 10 modes, only print the ones the system was in
                    if (modes <= 10 || en.getCycles(j) > 0)
                        Terminal.println("   " + en.getModeName(j) + ": " + en.getConsumedEnergy(j) + " Joule, " + en.getCycles(j) + " cycles");
                Terminal.nextln();
            }
        }
View Full Code Here

  public double getConsumedEnergy(){
      double energy = 0;
            Iterator it = instance.consumer.iterator();
            while( it.hasNext() ){
                //get energy information
                Energy en = (Energy)it.next();
                energy += en.getTotalConsumedEnergy();
            }
      return energy;
  }
View Full Code Here

            write("cycle ");
            //and than all consumers names
            Iterator it = instance.consumer.iterator();
            while( it.hasNext() ){
            //for (int i = 0; i < consumer.size(); ++i) {
                Energy en = (Energy)it.next();
                write(en.getName() + " ");
            }
            write("total");
            newLine();
           
            //log the startup state
View Full Code Here

            write(state.getCycles() + " ");
            //and than all consumers
            double total = 0.0f;
            Iterator it = instance.consumer.iterator();
            while(it.hasNext()){
                Energy en = (Energy)it.next();
                double ampere = en.getCurrentAmpere();
                total += ampere;
                write(ampere + " ");
            }
            write(total + "");
            newLine();
View Full Code Here

            //and than all consumers
            double total = 0.0f;
            Iterator it = instance.consumer.iterator();
            //for (int i = 0; i < consumer.size(); ++i) {
            while( it.hasNext() ){
                Energy en = (Energy)it.next();
                double ampere = (en != energy) ? en.getCurrentAmpere() : en.getOldAmpere();

                total += ampere;
                write(ampere + " ");
            }
            write(total + "");
View Full Code Here

TOP

Related Classes of avrora.sim.energy.Energy

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.