Skip to content
Snippets Groups Projects
Commit 32c522e8 authored by boqiren's avatar boqiren
Browse files

implement interfaces

parent d644869f
No related branches found
No related tags found
No related merge requests found
Showing
with 832 additions and 6 deletions
...@@ -27,12 +27,12 @@ public class InternalMachineLearningHandler implements MachineLearningEncoder, M ...@@ -27,12 +27,12 @@ public class InternalMachineLearningHandler implements MachineLearningEncoder, M
} }
@Override @Override
public List<Item> getTargets() { public List<Item> getTargets(Root model) {
return model.getTargetItems(); return model.getTargetItems();
} }
@Override @Override
public List<Item> getRelevantItems() { public List<Item> getRelevantItems(Root model) {
return model.getRelevantItems(); return model.getRelevantItems();
} }
......
<?xml version="1.0" encoding="UTF-8"?>
<module version="4">
<component name="FacetManager">
<facet type="Python" name="Python">
<configuration sdkName="" />
</facet>
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="Console">
<PatternLayout pattern="%highlight{%d{HH:mm:ss.SSS} %-5level} %c{1.} - %msg%n"/>
</Console>
<RollingFile name="RollingFile" fileName="logs/eraser.log"
filePattern="logs/eraser-%i.log">
<PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n"/>
<Policies>
<OnStartupTriggeringPolicy/>
</Policies>
<DefaultRolloverStrategy max="20"/>
</RollingFile>
</Appenders>
<Loggers>
<Root level="debug">
<AppenderRef ref="Console"/>
<AppenderRef ref="RollingFile"/>
</Root>
</Loggers>
</Configuration>
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="Console">
<PatternLayout pattern="%highlight{%d{HH:mm:ss.SSS} %-5level} %c{1.} - %msg%n"/>
</Console>
<RollingFile name="RollingFile" fileName="logs/eraser.log"
filePattern="logs/eraser-%i.log">
<PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n"/>
<Policies>
<OnStartupTriggeringPolicy/>
</Policies>
<DefaultRolloverStrategy max="20"/>
</RollingFile>
</Appenders>
<Loggers>
<Root level="debug">
<AppenderRef ref="Console"/>
<AppenderRef ref="RollingFile"/>
</Root>
<Logger name="org.eclipse.jetty" level="info" additivity="false">
<AppenderRef ref="Console"/>
<AppenderRef ref="RollingFile"/>
</Logger>
</Loggers>
</Configuration>
encog,BasicNetwork,java,3.4.0,1,1548842414446
[BASIC]
[BASIC:PARAMS]
[BASIC:NETWORK]
beginTraining=0
connectionLimit=0
contextTargetOffset=0,0,0
contextTargetSize=0,0,0
endTraining=2
hasContext=f
inputCount=4
layerCounts=4,8,5
layerFeedCounts=4,7,4
layerContextCount=0,0,0
layerIndex=0,4,12
output=0.5121833792,-0.9601322536,-0.8758172535,-0.9979697503,0.9622664202,-0.9999734797,0.1592770336,0.799331477,-0.4541506621,0.9665504755,0.9965543485,1,0,0.9333333333,-0.2727272727,0.3898305085,1
outputCount=4
weightIndex=0,32,67
weights=-1.0786840029,-2.2924792202,-1.9930859783,1.7958491576,0.1959961268,-2.0543645855,0.0362033078,0.2318024444,0.6379648215,0.6228614294,0.6327962466,1.4938586483,2.7154918438,-0.6821478373,-0.5520417752,-0.790812791,-0.6920871265,1.9974666857,2.3298834154,0.4485384863,-2.6899092835,0.031268515,-0.5795866919,-0.0980217125,-0.484143335,0.1511539927,0.420087673,-2.5050298291,0.2594955046,-1.095053346,1.3237034623,-1.0362683252,-1.4462851652,0.3753510899,-1.601258201,2.069584469,0.3818308747,1.9103650822,-1.0462844546,17.7814469175,0.6795954934,-0.0542764038,0.9582859267,0.3301209469,0.1352880767,0.0400876451,-0.1261986993,0.5055884018,0.6447792243,2.3674963793,1.1415287221,0.6956421989,0.3954445374,-0.0968051838,-5.3921438906,-1.0800675361,-1.4491070517,0.299983963,0.4432921269,-0.1229873384,0.3763334954,1.4430117456,2.3128771304,2.6904772398,-0.2334282302,2.656365234,-0.429273975
biasActivation=0,1,1
[BASIC:ACTIVATION]
"org.encog.engine.network.activation.ActivationTANH"
"org.encog.engine.network.activation.ActivationTANH"
"org.encog.engine.network.activation.ActivationLinear"
ThingType: id="hue:bridge" label="Hue Bridge" description="The hue bridge represents the Philips hue bridge." parameters=[] channelTypes=[] ;
ThingType: id="hue:0200" label="Color Light" description="A dimmable light with changeable colors." ;
ThingType: id="hue:0210" label="Extended Color Light" description="A dimmable light with changeable colors and tunable color temperature." parameters=[] channelTypes=[];
ThingType: id="skywriter-hat" label="SkyWriterHAT" description="SkyWriterHAT Gesture Recognition" parameters=["brokername"] channelTypes=["flick-type", "skywriter-x", "skywriter-y"] ;
Thing: id="hue:bridge:0017880adcf4" label="Philips hue (10.8.0.160)" type="hue:bridge" channels=[] ;
Thing: id="hue:0210:0017880adcf4:1" label="Wohnzimmer" type="hue:0210" channels=["hue:0210:0017880adcf4:1:color_temperature", "hue:0210:0017880adcf4:1:effect"] ;
Thing: id="hue:0200:0017880adcf4:5" label="Hue iris 1" type="hue:0200" channels=["hue:0210:0017880adcf4:4:color", "hue:0210:0017880adcf4:4:color_temperature", "hue:0210:0017880adcf4:4:alert", "hue:0210:0017880adcf4:4:effect"] ;
Thing: id="hue:0210:0017880adcf4:4" label="Hue go 1" type="hue:0210" channels=["hue:0200:0017880adcf4:5:color", "hue:0200:0017880adcf4:5:alert", "hue:0200:0017880adcf4:5:effect"] ;
Thing: id="skywriter1" label="Our skywriter" type="skywriter-hat" channels=["skywriter1-flick", "skywriter1-x", "skywriter1-y"] ;
ChannelType: id="hue:color" label="Color" description="The color channel allows to control the color of a light. It is also possible to dim values and switch the light on and off." itemType="Color" category="ColorLight" ;
ChannelType: id="hue:alert" label="Alert" description="The alert channel allows a temporary change to the bulb’s state." itemType="String" category="Unknown" ;
ChannelType: id="hue:effect" label="Color Loop" description="The effect channel allows putting the bulb in a color looping mode." itemType="Switch" category="ColorLight" ;
ChannelType: id="hue:color_temperature" label="Color Temperature" description="The color temperature channel allows to set the color temperature of a light from 0 (cold) to 100 (warm)." itemType="Dimmer" category="ColorLight" ;
ChannelType: id="flick-type" itemType="String" label="Last Flick" description="Last Flick detected (and its direction)" category="Motion" readOnly ;
ChannelType: id="skywriter-x" itemType="String" label="Current X coordinate" description="Current X coordinate" category="Motion" readOnly ;
ChannelType: id="skywriter-y" itemType="String" label="Current Y coordinate" description="Current Y coordinate" category="Motion" readOnly ;
Channel: id="hue:0210:0017880adcf4:1:color_temperature" type="hue:color_temperature" links=[] ;
Channel: id="hue:0210:0017880adcf4:1:effect" type="hue:effect" links=[] ;
Channel: id="hue:0210:0017880adcf4:4:color" type="hue:color" links=[] ;
Channel: id="hue:0210:0017880adcf4:4:color_temperature" type="hue:color_temperature" links=[] ;
Channel: id="hue:0210:0017880adcf4:4:alert" type="hue:alert" links=[] ;
Channel: id="hue:0210:0017880adcf4:4:effect" type="hue:effect" links=[] ;
Channel: id="hue:0200:0017880adcf4:5:color" type="hue:color" links=["iris1_item"] ;
Channel: id="hue:0200:0017880adcf4:5:alert" type="hue:alert" links=[] ;
Channel: id="hue:0200:0017880adcf4:5:effect" type="hue:color" links=[] ;
Channel: id="skywriter1-flick" type="flick-type" links=[];
Channel: id="skywriter1-x" type="skywriter-x" links=["skywriter1_x"];
Channel: id="skywriter1-y" type="skywriter-y" links=["skywriter1_y"];
Item: id="iris1_item" label="Iris 1" state="121,88,68" topic="iris1_item/state";
Item: id="skywriter1_x" label="X" state="0" topic="skywriter/x";
Item: id="skywriter1_y" label="Y" state="0" topic="skywriter/y";
Item: id="skywriter1_xyz" label="Y" state="0" topic="skywriter/xyz";
Group: id="Lights" items=["iris1_item"];
Group: id="Skywriter" items=["skywriter1_x", "skywriter1_y"];
Parameter: id="brokername" label="Broker Name" description="Name of the broker as defined in the &lt;broker&gt;.url in services/mqtt.cfg. See the MQTT Binding for more information on how to configure MQTT broker connections." type="Text" context="service" default="mosquitto" required ;
// MqttHost is set programmatically
Mqtt: incoming="oh2/out/" outgoing="oh2/in/" ;
Color Item: id="iris1_item" label="Iris 1" state="121,88,68" topic="iris1_item";
Number Item: id="datetime_month" label="Month" state="1" topic="datetime_month";
Number Item: id="datetime_day" label="Day" state="31" topic="datetime_day";
Number Item: id="datetime_hour" label="Hour" state="13" topic="datetime_hour";
Number Item: id="datetime_minute" label="Minute" state="37" topic="datetime_minute";
Number Item: id="bias" label="bias item" state="1" ;
Activity Item: id="activity" ;
Group: id="Lights" items=["iris1_item"];
Group: id="Datetime" items=["datetime_month", "datetime_day", "datetime_hour", "datetime_minute"];
Mqtt: incoming="oh2/out/" outgoing="oh2/in/" host="localhost:2883" ;
//Mqtt: incoming="oh2/out/" outgoing="oh2/in/" host="192.168.1.250" ;
Influx: host="172.22.1.152" ;
ML: activities={
0: "Open door in empty room",
1: "Door closed in empty room",
2: "Open door with person in room",
3: "Door closed with person in room",
4: "Working",
5: "Watch TV",
6: "Reading",
7: "Listening to music",
8: "Going to sleep",
9: "Wake up"
} ;
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="Console">
<PatternLayout pattern="%highlight{%d{HH:mm:ss.SSS} %-5level} %c{1.} - %msg%n"/>
</Console>
<RollingFile name="RollingFile" fileName="logs/eraser.log"
filePattern="logs/eraser-%i.log">
<PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n"/>
<Policies>
<OnStartupTriggeringPolicy/>
</Policies>
<DefaultRolloverStrategy max="20"/>
</RollingFile>
</Appenders>
<Loggers>
<Root level="debug">
<AppenderRef ref="Console"/>
<AppenderRef ref="RollingFile"/>
</Root>
</Loggers>
</Configuration>
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="Console">
<PatternLayout pattern="%highlight{%d{HH:mm:ss.SSS} %-5level} %c{1.} - %msg%n"/>
</Console>
<RollingFile name="RollingFile" fileName="logs/eraser.log"
filePattern="logs/eraser-%i.log">
<PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n"/>
<Policies>
<OnStartupTriggeringPolicy/>
</Policies>
<DefaultRolloverStrategy max="20"/>
</RollingFile>
</Appenders>
<Loggers>
<Root level="debug">
<AppenderRef ref="Console"/>
<AppenderRef ref="RollingFile"/>
</Root>
</Loggers>
</Configuration>
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="Console">
<PatternLayout pattern="%highlight{%d{HH:mm:ss.SSS} %-5level} %c{1.} - %msg%n"/>
</Console>
<RollingFile name="RollingFile" fileName="logs/eraser.log"
filePattern="logs/eraser-%i.log">
<PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n"/>
<Policies>
<OnStartupTriggeringPolicy/>
</Policies>
<DefaultRolloverStrategy max="20"/>
</RollingFile>
</Appenders>
<Loggers>
<Root level="debug">
<AppenderRef ref="Console"/>
<AppenderRef ref="RollingFile"/>
</Root>
</Loggers>
</Configuration>
encog,BasicNetwork,java,3.4.0,1,1549011876959
[BASIC]
[BASIC:PARAMS]
[BASIC:NETWORK]
beginTraining=0
connectionLimit=0
contextTargetOffset=0,0,0
contextTargetSize=0,0,0
endTraining=2
hasContext=f
inputCount=4
layerCounts=4,8,5
layerFeedCounts=4,7,4
layerContextCount=0,0,0
layerIndex=0,4,12
output=0.7897697775,-0.4093295807,-0.9998836757,-1,0.8474456805,-0.2366377403,-0.9973602461,-0.9999999955,-0.4764290146,0.461275072,-0.0649442099,1,0,-0.6666666667,-0.4545454545,0.6949152542,1
outputCount=4
weightIndex=0,32,67
weights=-1.1570349988,-0.8578879992,-1.0549159925,-3.7244521995,0.9574302229,-2.0931447828,0.896591315,-1.4483568363,1.4900254439,0.7366819855,0.6613521579,-0.609388338,-2.5552763401,1.2462544768,-0.6792334441,-3.3093626419,-2.155033701,-3.0549866186,-4.46456694,6.3689156226,-0.7553336123,-4.3167151702,-0.2075796591,-0.2387765659,-5.3558179654,0.3870219651,2.1254188856,-0.8070693427,16.3409581377,-0.0181269232,-3.5894371967,-0.6128690116,18.1886181385,-2.1919701152,0.7652143515,-0.5972333161,0.5485570992,2.8445160284,-3.1372144242,-6.0940916584,-12.1412546646,3.3344157392,-1.5344530226,4.1146550246,1.3873868104,1.3560253856,-0.8830370237,3.4646973293,0.45451005,19.2628819453,-1.4746031138,0.1239027404,0.5654616795,-0.3474956993,-0.7700441522,-0.2617909991,-0.9181158122,0.2756671819,0.0437957183,-7.3920564965,-0.4480327205,-2.520553979,-1.2363459836,-0.7189965057,1.2558119854,-0.5462053441,0.4060233037
biasActivation=0,1,1
[BASIC:ACTIVATION]
"org.encog.engine.network.activation.ActivationTANH"
"org.encog.engine.network.activation.ActivationTANH"
"org.encog.engine.network.activation.ActivationLinear"
encog,BasicNetwork,java,3.4.0,1,1549011876959
[BASIC]
[BASIC:PARAMS]
[BASIC:NETWORK]
beginTraining=0
connectionLimit=0
contextTargetOffset=0,0,0
contextTargetSize=0,0,0
endTraining=2
hasContext=f
inputCount=4
layerCounts=4,8,5
layerFeedCounts=4,7,4
layerContextCount=0,0,0
layerIndex=0,4,12
output=0.7897697775,-0.4093295807,-0.9998836757,-1,0.8474456805,-0.2366377403,-0.9973602461,-0.9999999955,-0.4764290146,0.461275072,-0.0649442099,1,0,-0.6666666667,-0.4545454545,0.6949152542,1
outputCount=4
weightIndex=0,32,67
weights=-1.1570349988,-0.8578879992,-1.0549159925,-3.7244521995,0.9574302229,-2.0931447828,0.896591315,-1.4483568363,1.4900254439,0.7366819855,0.6613521579,-0.609388338,-2.5552763401,1.2462544768,-0.6792334441,-3.3093626419,-2.155033701,-3.0549866186,-4.46456694,6.3689156226,-0.7553336123,-4.3167151702,-0.2075796591,-0.2387765659,-5.3558179654,0.3870219651,2.1254188856,-0.8070693427,16.3409581377,-0.0181269232,-3.5894371967,-0.6128690116,18.1886181385,-2.1919701152,0.7652143515,-0.5972333161,0.5485570992,2.8445160284,-3.1372144242,-6.0940916584,-12.1412546646,3.3344157392,-1.5344530226,4.1146550246,1.3873868104,1.3560253856,-0.8830370237,3.4646973293,0.45451005,19.2628819453,-1.4746031138,0.1239027404,0.5654616795,-0.3474956993,-0.7700441522,-0.2617909991,-0.9181158122,0.2756671819,0.0437957183,-7.3920564965,-0.4480327205,-2.520553979,-1.2363459836,-0.7189965057,1.2558119854,-0.5462053441,0.4060233037
biasActivation=0,1,1
[BASIC:ACTIVATION]
"org.encog.engine.network.activation.ActivationTANH"
"org.encog.engine.network.activation.ActivationTANH"
"org.encog.engine.network.activation.ActivationLinear"
7,20,12,13,2
7,20,14,40,1
7,20,14,40,2
7,21,13,2,2
7,21,13,2,2
7,21,14,23,2
7,21,14,23,2
7,21,15,41,2
7,21,16,54,2
7,21,16,54,2
7,21,17,45,3
7,22,12,28,3
7,22,15,35,2
7,22,15,35,2
7,22,18,59,3
7,22,18,59,3
7,23,12,32,2
7,23,12,32,2
7,23,16,7,2
7,23,16,7,2
7,23,16,7,2
7,23,16,7,2
7,23,16,7,2
7,24,12,4,0
7,24,12,4,0
7,24,12,4,1
7,24,14,38,2
7,24,14,38,2
7,24,18,54,3
7,25,12,31,0
7,25,12,32,1
7,25,12,32,1
7,25,15,6,3
7,25,18,56,3
7,26,13,41,2
7,26,19,14,3
7,27,11,39,2
7,27,11,39,3
7,27,11,46,3
7,27,11,46,2
7,27,13,8,2
7,27,13,8,2
7,27,13,9,2
7,27,13,45,2
7,27,13,45,2
7,27,15,38,3
7,28,12,12,2
7,28,12,13,2
7,28,12,41,2
7,28,12,41,2
7,28,12,41,2
7,28,14,0,1
7,28,14,0,2
7,28,15,21,3
7,28,18,56,3
7,29,10,9,1
7,29,10,9,1
7,29,10,9,1
7,29,11,54,0
7,29,11,54,0
7,29,11,54,0
7,29,11,54,1
7,29,14,10,2
7,29,16,44,2
7,29,16,44,2
7,30,16,7,3
7,30,18,45,3
7,31,13,2,0
7,31,13,2,1
7,31,13,3,1
7,31,13,3,1
7,31,13,3,1
7,31,18,39,3
8,1,12,22,0
8,1,12,22,1
8,1,14,20,2
8,1,14,20,2
8,1,14,20,2
8,1,15,55,3
8,1,18,31,3
8,1,18,37,3
8,1,18,37,3
8,1,19,2,3
8,1,19,2,3
8,1,20,5,3
8,2,10,9,2
8,2,10,9,1
8,2,10,9,2
8,2,10,9,2
8,2,13,58,2
8,2,13,58,2
8,2,15,44,3
8,2,15,44,3
8,2,15,44,3
8,2,17,21,3
8,2,17,21,3
8,2,17,21,3
8,3,13,31,1
8,3,13,31,2
8,3,13,32,2
8,3,16,43,3
8,4,13,20,1
8,4,13,20,2
8,4,18,27,3
8,5,13,37,2
8,5,13,37,2
8,5,18,33,3
8,6,11,24,3
8,6,11,24,3
8,6,11,24,3
8,6,13,50,3
8,7,13,4,2
8,7,13,4,2
8,7,14,56,3
8,8,12,13,2
8,8,12,13,2
8,8,15,51,2
8,8,15,51,2
8,8,15,51,3
8,9,13,32,2
8,9,13,32,2
8,9,13,32,2
8,9,15,8,2
8,9,15,8,2
8,9,15,8,2
8,9,16,19,2
8,10,11,32,0
8,10,11,32,1
8,10,11,32,1
8,10,13,13,1
8,10,13,13,1
8,10,13,13,2
8,10,16,42,3
8,10,16,42,3
8,11,14,6,2
8,11,14,7,2
8,11,18,54,3
8,11,18,54,3
8,11,18,54,3
8,12,12,27,1
8,12,12,27,1
8,12,12,28,1
8,12,13,53,2
8,12,13,53,2
8,12,13,53,2
8,12,15,21,3
8,13,13,16,1
8,13,13,16,1
8,13,13,16,1
8,13,14,14,2
8,13,14,14,2
8,13,16,11,3
8,13,17,18,3
8,14,13,7,1
8,14,13,7,1
8,14,13,7,1
8,14,13,7,1
8,14,13,7,2
8,14,13,7,2
8,14,15,6,3
8,15,14,5,2
8,15,14,5,2
8,15,14,6,2
8,15,14,6,2
8,15,16,41,3
8,15,16,41,3
8,15,17,30,3
8,16,13,40,2
8,16,13,40,2
8,16,17,52,3
8,16,17,53,3
8,17,13,34,1
8,17,13,35,2
8,17,14,7,2
8,17,19,2,3
8,18,10,21,3
8,18,11,14,2
8,18,11,14,2
8,18,11,14,2
8,18,11,14,2
8,18,14,25,2
8,18,14,25,3
8,18,14,25,2
8,18,18,18,3
8,18,18,19,3
8,19,18,33,3
8,19,18,33,3
8,19,18,33,3
8,19,18,33,3
8,20,14,28,2
8,20,14,28,2
8,20,14,28,2
8,20,14,28,2
8,20,17,8,3
8,20,18,22,3
8,21,11,24,1
8,21,11,24,1
8,21,11,24,1
8,21,15,34,3
8,21,18,55,3
8,22,12,3,1
8,22,12,4,2
8,22,12,4,2
8,22,13,51,2
8,22,13,51,2
8,22,13,51,2
8,22,18,12,3
8,22,18,12,3
8,22,18,12,3
8,22,18,12,3
8,22,18,40,3
8,22,18,40,3
8,23,13,42,1
8,23,13,42,1
8,23,17,32,3
8,23,19,28,3
8,23,20,27,3
8,23,20,27,3
8,23,21,49,3
8,24,14,0,2
8,24,14,0,2
8,24,14,0,2
8,24,14,0,2
8,24,15,4,3
8,24,15,4,3
8,24,16,2,3
8,24,16,3,3
8,24,16,37,3
8,24,17,9,3
8,24,17,14,3
8,25,13,34,1
8,25,13,34,1
8,25,13,34,1
8,25,13,34,1
8,25,13,34,1
8,25,15,1,3
8,25,17,58,3
8,26,10,29,0
8,26,10,29,0
8,26,10,29,0
8,26,10,29,0
8,26,10,29,0
8,26,16,42,3
8,26,16,42,3
8,26,18,41,3
8,26,18,41,3
8,27,13,41,2
8,27,13,41,2
8,27,13,41,2
8,27,13,41,2
8,27,17,42,3
8,28,11,9,1
8,28,11,9,1
8,28,12,14,0
8,28,12,14,1
8,28,12,14,0
8,28,15,3,2
8,28,15,3,2
8,28,16,31,3
8,28,17,40,3
8,29,14,44,3
8,29,17,25,3
8,30,12,5,0
8,30,12,5,0
8,30,12,5,0
8,30,13,32,1
8,30,13,32,1
8,30,13,56,2
8,30,14,23,2
8,30,14,23,2
8,30,14,23,2
8,30,14,23,2
8,30,14,41,2
8,30,14,41,2
8,30,14,41,2
8,30,15,50,3
8,30,17,0,3
8,30,18,59,3
8,30,18,59,3
8,31,14,31,2
8,31,14,31,2
8,31,14,31,2
8,31,17,59,3
8,31,18,0,3
9,1,16,13,3
9,1,16,13,3
9,1,16,13,3
9,1,17,41,3
9,2,13,44,1
9,2,13,44,1
9,2,13,44,1
9,2,14,49,2
9,2,14,49,2
9,2,14,49,2
9,2,16,6,3
9,2,16,6,3
9,2,17,2,3
9,3,16,9,3
9,3,17,35,3
9,3,17,36,3
9,4,12,57,1
9,4,12,57,1
9,4,15,8,3
9,4,15,34,3
9,4,16,26,3
9,4,16,26,3
9,4,18,37,3
9,4,18,37,3
9,4,18,37,3
9,6,11,18,0
9,6,11,18,0
9,6,12,54,1
9,6,12,54,1
9,6,14,21,2
9,6,14,21,2
9,6,19,20,3
9,7,11,50,0
9,7,14,17,2
9,7,14,57,3
9,7,14,57,3
9,7,16,56,3
9,7,16,56,3
9,7,16,56,3
9,7,16,56,3
9,7,18,38,3
9,7,18,38,3
9,8,11,4,2
9,8,11,4,2
9,8,11,13,0
9,8,11,13,0
9,8,11,13,0
9,8,11,13,0
9,8,11,13,0
9,8,11,14,0
9,8,11,14,1
9,8,11,14,1
9,8,12,1,0
9,8,12,1,0
9,8,12,1,0
9,8,12,1,0
9,8,12,1,0
9,8,12,1,1
9,8,12,36,0
9,8,12,36,0
9,8,12,36,0
9,8,12,36,0
9,8,12,36,0
9,8,13,37,1
9,8,13,37,1
9,8,13,37,1
9,8,14,20,2
9,8,14,20,2
9,8,18,20,3
9,9,12,47,1
9,9,12,47,2
9,9,12,47,2
9,9,19,5,3
9,10,13,15,1
9,10,13,15,1
9,10,13,15,0
9,10,16,49,3
9,10,19,6,3
9,10,21,5,3
9,11,14,16,2
9,11,14,16,2
9,11,14,16,2
9,11,18,41,3
9,12,14,43,2
9,12,14,43,2
9,12,14,43,2
9,12,16,14,3
9,12,17,12,3
9,12,17,12,2
9,12,17,12,3
9,12,17,12,2
9,12,20,44,3
9,13,19,52,3
9,14,14,39,2
9,14,14,39,2
9,14,15,14,3
9,14,17,29,3
9,14,17,29,3
9,14,17,29,3
9,15,11,41,1
9,15,11,41,1
9,15,13,4,1
9,15,14,3,1
9,15,14,3,2
9,16,12,36,1
9,16,12,36,1
9,16,12,36,1
9,16,12,36,1
9,16,12,48,1
9,16,12,48,1
9,16,13,51,1
9,16,13,51,2
9,16,13,51,1
9,16,15,13,3
9,16,15,14,3
9,16,15,14,3
9,17,10,27,0
9,17,10,27,0
9,17,11,10,0
9,17,11,10,0
9,17,11,10,0
9,17,12,43,1
9,17,12,43,1
9,17,12,43,1
9,17,13,32,1
9,17,13,32,1
9,17,14,5,1
9,17,14,5,2
9,17,14,6,2
9,17,15,7,3
9,17,15,49,3
9,17,15,49,3
9,17,18,12,3
9,17,18,13,3
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="Console">
<PatternLayout pattern="%highlight{%d{HH:mm:ss.SSS} %-5level} %c{1.} - %msg%n"/>
</Console>
<RollingFile name="RollingFile" fileName="logs/eraser.log"
filePattern="logs/eraser-%i.log">
<PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n"/>
<Policies>
<OnStartupTriggeringPolicy/>
</Policies>
<DefaultRolloverStrategy max="20"/>
</RollingFile>
</Appenders>
<Loggers>
<Root level="debug">
<AppenderRef ref="Console"/>
<AppenderRef ref="RollingFile"/>
</Root>
</Loggers>
</Configuration>
...@@ -4,12 +4,14 @@ import de.tudresden.inf.st.eraser.jastadd.model.*; ...@@ -4,12 +4,14 @@ import de.tudresden.inf.st.eraser.jastadd.model.*;
import java.time.Instant; import java.time.Instant;
import java.util.List; import java.util.List;
public class MachineLearningEncoderImpl implements MachineLearningDecoder,MachineLearningEncoder { public class MachineLearningImpl implements MachineLearningDecoder,MachineLearningEncoder {
private String[] new_data = new String[13]; private String[] new_data = new String[13];
private List<Item> target_item_list; private List<Item> target_item_list;
private List<Item> relevant_item_list; private List<Item> relevant_item_list;
private String[] result; private String[] result;
private MachineLearningResult ml_result;
private List<ItemPreference> item_preference_list;
@Override @Override
public void newData(Root model, List<Item> changedItems) { public void newData(Root model, List<Item> changedItems) {
...@@ -73,13 +75,12 @@ public class MachineLearningEncoderImpl implements MachineLearningDecoder,Machin ...@@ -73,13 +75,12 @@ public class MachineLearningEncoderImpl implements MachineLearningDecoder,Machin
relevant_item_list.add(w_rotation_y); relevant_item_list.add(w_rotation_y);
relevant_item_list.add(w_rotation_z); relevant_item_list.add(w_rotation_z);
relevant_item_list.add(w_brightness); relevant_item_list.add(w_brightness);
return null; return relevant_item_list;
} }
@Override @Override
public void triggerTraining() { public void triggerTraining() {
} }
@Override @Override
...@@ -91,6 +92,7 @@ public class MachineLearningEncoderImpl implements MachineLearningDecoder,Machin ...@@ -91,6 +92,7 @@ public class MachineLearningEncoderImpl implements MachineLearningDecoder,Machin
public MachineLearningResult classify() { public MachineLearningResult classify() {
String activity=result[0]; String activity=result[0];
String[] preference= {result[1],result[2]}; String[] preference= {result[1],result[2]};
return null; ml_result.getPreferences();
return ml_result;
} }
} }
package de.tudresden.inf.st.eraser.feedbackloop.learner_backup; package de.tudresden.inf.st.eraser.feedbackloop.learner_backup;
import com.intellij.openapi.vcs.history.VcsRevisionNumber;
import de.tudresden.inf.st.eraser.jastadd.model.*; import de.tudresden.inf.st.eraser.jastadd.model.*;
import org.encog.util.csv.ReadCSV; import org.encog.util.csv.ReadCSV;
import org.encog.util.csv.CSVFormat; import org.encog.util.csv.CSVFormat;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List;
public class Main { public class Main {
...@@ -31,6 +35,10 @@ public class Main { ...@@ -31,6 +35,10 @@ public class Main {
System.out.println(result[1]); System.out.println(result[1]);
System.out.println(result[2]); System.out.println(result[2]);
List k=new ArrayList();
k.add(new_data);
//learner.preference_train("datasets/backup/preference_data.csv"); //learner.preference_train("datasets/backup/preference_data.csv");
//learner.train("datasets/backup/activity_data.csv","datasets/backup/preference_data.csv"); //learner.train("datasets/backup/activity_data.csv","datasets/backup/preference_data.csv");
//walking,medium,120,70 //walking,medium,120,70
......
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="Console">
<PatternLayout pattern="%highlight{%d{HH:mm:ss.SSS} %-5level} %c{1.} - %msg%n"/>
</Console>
<RollingFile name="RollingFile" fileName="logs/eraser.log"
filePattern="logs/eraser-%i.log">
<PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n"/>
<Policies>
<OnStartupTriggeringPolicy/>
</Policies>
<DefaultRolloverStrategy max="20"/>
</RollingFile>
</Appenders>
<Loggers>
<Root level="debug">
<AppenderRef ref="Console"/>
<AppenderRef ref="RollingFile"/>
</Root>
</Loggers>
</Configuration>
ThingType: id="hue:bridge" label="Hue Bridge" description="The hue bridge represents the Philips hue bridge." parameters=[] channelTypes=[] ;
ThingType: id="hue:0200" label="Color Light" description="A dimmable light with changeable colors." ;
ThingType: id="hue:0210" label="Extended Color Light" description="A dimmable light with changeable colors and tunable color temperature." parameters=[] channelTypes=[];
ThingType: id="skywriter-hat" label="SkyWriterHAT" description="SkyWriterHAT Gesture Recognition" parameters=["brokername"] channelTypes=["flick-type", "skywriter-x", "skywriter-y"] ;
Thing: id="hue:bridge:0017880adcf4" label="Philips hue (10.8.0.160)" type="hue:bridge" channels=[] ;
Thing: id="hue:0210:0017880adcf4:1" label="Wohnzimmer" type="hue:0210" channels=["hue:0210:0017880adcf4:1:color_temperature", "hue:0210:0017880adcf4:1:effect"] ;
Thing: id="hue:0200:0017880adcf4:5" label="Hue iris 1" type="hue:0200" channels=["hue:0210:0017880adcf4:4:color", "hue:0210:0017880adcf4:4:color_temperature", "hue:0210:0017880adcf4:4:alert", "hue:0210:0017880adcf4:4:effect"] ;
Thing: id="hue:0210:0017880adcf4:4" label="Hue go 1" type="hue:0210" channels=["hue:0200:0017880adcf4:5:color", "hue:0200:0017880adcf4:5:alert", "hue:0200:0017880adcf4:5:effect"] ;
Thing: id="skywriter1" label="Our skywriter" type="skywriter-hat" channels=["skywriter1-flick", "skywriter1-x", "skywriter1-y"] ;
ChannelType: id="hue:color" label="Color" description="The color channel allows to control the color of a light. It is also possible to dim values and switch the light on and off." itemType="Color" category="ColorLight" ;
ChannelType: id="hue:alert" label="Alert" description="The alert channel allows a temporary change to the bulb’s state." itemType="String" category="Unknown" ;
ChannelType: id="hue:effect" label="Color Loop" description="The effect channel allows putting the bulb in a color looping mode." itemType="Switch" category="ColorLight" ;
ChannelType: id="hue:color_temperature" label="Color Temperature" description="The color temperature channel allows to set the color temperature of a light from 0 (cold) to 100 (warm)." itemType="Dimmer" category="ColorLight" ;
ChannelType: id="flick-type" itemType="String" label="Last Flick" description="Last Flick detected (and its direction)" category="Motion" readOnly ;
ChannelType: id="skywriter-x" itemType="String" label="Current X coordinate" description="Current X coordinate" category="Motion" readOnly ;
ChannelType: id="skywriter-y" itemType="String" label="Current Y coordinate" description="Current Y coordinate" category="Motion" readOnly ;
Channel: id="hue:0210:0017880adcf4:1:color_temperature" type="hue:color_temperature" links=[] ;
Channel: id="hue:0210:0017880adcf4:1:effect" type="hue:effect" links=[] ;
Channel: id="hue:0210:0017880adcf4:4:color" type="hue:color" links=[] ;
Channel: id="hue:0210:0017880adcf4:4:color_temperature" type="hue:color_temperature" links=[] ;
Channel: id="hue:0210:0017880adcf4:4:alert" type="hue:alert" links=[] ;
Channel: id="hue:0210:0017880adcf4:4:effect" type="hue:effect" links=[] ;
Channel: id="hue:0200:0017880adcf4:5:color" type="hue:color" links=["iris1_item"] ;
Channel: id="hue:0200:0017880adcf4:5:alert" type="hue:alert" links=[] ;
Channel: id="hue:0200:0017880adcf4:5:effect" type="hue:color" links=[] ;
Channel: id="skywriter1-flick" type="flick-type" links=[];
Channel: id="skywriter1-x" type="skywriter-x" links=["skywriter1_x"];
Channel: id="skywriter1-y" type="skywriter-y" links=["skywriter1_y"];
Item: id="iris1_item" label="Iris 1" state="121,88,68" topic="iris1_item/state";
Item: id="skywriter1_x" label="X" state="0" topic="skywriter/x";
Item: id="skywriter1_y" label="Y" state="0" topic="skywriter/y";
Item: id="skywriter1_xyz" label="Y" state="0" topic="skywriter/xyz";
Group: id="Lights" items=["iris1_item"];
Group: id="Skywriter" items=["skywriter1_x", "skywriter1_y"];
Parameter: id="brokername" label="Broker Name" description="Name of the broker as defined in the &lt;broker&gt;.url in services/mqtt.cfg. See the MQTT Binding for more information on how to configure MQTT broker connections." type="Text" context="service" default="mosquitto" required ;
// MqttHost is set programmatically
Mqtt: incoming="oh2/out/" outgoing="oh2/in/" ;
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="Console">
<PatternLayout pattern="%highlight{%d{HH:mm:ss.SSS} %-5level} %c{1.} - %msg%n"/>
</Console>
<RollingFile name="RollingFile" fileName="logs/eraser.log"
filePattern="logs/eraser-%i.log">
<PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n"/>
<Policies>
<OnStartupTriggeringPolicy/>
</Policies>
<DefaultRolloverStrategy max="20"/>
</RollingFile>
</Appenders>
<Loggers>
<Root level="debug">
<AppenderRef ref="Console"/>
<AppenderRef ref="RollingFile"/>
</Root>
</Loggers>
</Configuration>
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="Console">
<PatternLayout pattern="%highlight{%d{HH:mm:ss.SSS} %-5level} %c{1.} - %msg%n"/>
</Console>
<RollingFile name="RollingFile" fileName="logs/eraser.log"
filePattern="logs/eraser-%i.log">
<PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n"/>
<Policies>
<OnStartupTriggeringPolicy/>
</Policies>
<DefaultRolloverStrategy max="20"/>
</RollingFile>
</Appenders>
<Loggers>
<Root level="debug">
<AppenderRef ref="Console"/>
<AppenderRef ref="RollingFile"/>
</Root>
</Loggers>
</Configuration>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment