Git Product home page Git Product logo

iota's Introduction

IOTA

IOTA in JAVA

Instruction

  1. Execute IotaMain class.
  2. Enter the name of device that you want to change status in the console.
  3. Enter the name of field or timer that you want to change status in the console.
  4. If you enter the timer in name of field, you can change it's timer virtually
  5. Enter the state that you want to change in the console.
  6. If you enter the timer in name of field, Enter the time that you want to change in the state.

If you want to register some new devices, make new device class using MotionSensor class form. If you want to program using IOTA syntax, enter the IOTA syntax using Event, CompPredicate, OneAction, AnyActions class in IotaMain class.

Example Code using IOTA syntax

 Event e1 = Event.From(main.devices.GetDevice("EntranceDoor").GetEventElement("Lock"), "UnLocked");  
 CompPredicate p1 = CompPredicate.CompEqual(main.devices.GetDevice("EntranceDoor"), "Lock", "Locked");  
 TimerAction a1 = TimerAction.TimerStart(main.devices.GetDevice("HallwayLight"));  
 
 Rule rule1 = new Rule(e1, p1, a1);
 
 Event e2 = Event.UnConditional(main.devices.GetDevice("HallwayLight").GetEventElement("Timer"));  
 CompPredicate p2 = CompPredicate.CompEqual(main.devices.GetDevice("HallwayLight"), "Timer", "5");  
 OneAction a21 = new OneAction(main.devices.GetDevice("HallwayLight"), "Switch", "Off");  
 TimerAction a22 = TimerAction.TimerStop(main.devices.GetDevice("HallwayLight"));  
 AnyActions as2 = new AnyActions();  as2.addAction(a21);  as2.addAction(a22);  
 
 Rule rule2 = new Rule(e2, p2, as2);
 
 RuleSet ruleset = new RuleSet();  ruleset.add(rule1);  ruleset.add(rule2);  
 
 Evaluation eval = new Evaluation(ruleset);

iota's People

Contributors

minwoo-jo avatar chosm10 avatar kwanghoon avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

minwoo-jo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.