ParticleExtractor
Fri Jan 27 21:06:25 KST 2006
Package ParticleExtractor
Class Diagrams
diagram ParticleExtractor
Subpackages
package Resources
package edu
package nrc
package ucam
Classes
class ActivityFuzzyRule
class DeviceProfileReader
class FileOutput
class ParticleExtractorMain
class VotingMethod
Class Diagrams
Class Diagram ParticleExtractor
package: ParticleExtractor
Package Nodes
Resources
Class Nodes
ActivityFuzzyRule
DeviceProfileReader
FileOutput
ParticleExtractorMain
VotingMethod
Package Node Detail
Package Resources
Class Detail
Class ActivityFuzzyRule
package: ParticleExtractor
public class ActivityFuzzyRule
This class is Example of a simple Tsukamoto rule (Fuzzy Rule) system (order 1).


In this case there are 4 rules each with 3 inputs and 1 output.
The inputs: x, y, z
The output: activity

This class is based on "NRC FuzzyJ Toolkit" (http://www.iit.nrc.ca/IR_public/fuzzy/fuzzyJToolkit2.html).
Since:
J2SDK1.5
Version:
ubi-UCAM 2.0 (ubiSensor)
Author:
Yoosoo Oh
Field Summary
private String
   Instance of String for the final activity
 
Constructor Summary
public
   It initializes a newly ActivityFuzzyRule Object.
 
Method Summary
public void
FuzzyActivity(double xVal, double yVal, double zVal)
   This method is ready to infer the user's activity.
 
public String
   This method returns the user's final activity.
 
Field Detail
final_activity
private String final_activity
Instance of String for the final activity
Constructor Detail
ActivityFuzzyRule
public ActivityFuzzyRule()
It initializes a newly ActivityFuzzyRule Object.

Method Detail
FuzzyActivity
public void FuzzyActivity(double xVal, double yVal, double zVal)
This method is ready to infer the user's activity.


This method is based on Fuzzy Rule
Parameters:
xVal double: the input of x axis of acceleration
yVal double: the input of y axis of acceleration
zVal double: the input of z axis of acceleration

getActivity
public String getActivity()
This method returns the user's final activity.
Class DeviceProfileReader
package: ParticleExtractor
public class DeviceProfileReader
This class is ready to get Profile information of Particle sensor.

Since:
J2SDK1.5
Version:
ubi-UCAM 2.0 (ubiSensor)
Author:
Yoosoo Oh
Field Summary
private String
   Instance of String for the user's location
 
private String
   Instance of String for the user's identity
 
Constructor Summary
public
   It initializes a newly DeviceProfileReader Object.
 
Method Summary
public String
   This method returns the user's location.
 
public String
getUserName(String sensorID)
   This method returns the user's identity that is recorded in the user's profile.
 
private void
readFile(String file, String ID)
   This method is ready to read the device profile.
 
public void
setLocation(String receiverID)
   This method is ready to convert the Particle Receiver's ID as the location.
 
Field Detail
symboliclocation
private String symboliclocation
Instance of String for the user's location

username
private String username
Instance of String for the user's identity
Constructor Detail
DeviceProfileReader
public DeviceProfileReader()
It initializes a newly DeviceProfileReader Object.

Method Detail
getLocation
public String getLocation()
This method returns the user's location.


getUserName
public String getUserName(String sensorID)
This method returns the user's identity that is recorded in the user's profile.

Parameters:
sensorID String: the input of the Particle sensor's ID

readFile
private void readFile(String file, String ID)
This method is ready to read the device profile.

Parameters:
file String: the file name of the device profile
ID String: the input of the user's identity

setLocation
public void setLocation(String receiverID)
This method is ready to convert the Particle Receiver's ID as the location.

Parameters:
receiverID String: the input of the Particle Receiver's ID
Class FileOutput
package: ParticleExtractor
public class FileOutput
This class is ready to test Particle output data.

Since:
J2SDK1.5
Version:
ubi-UCAM 2.0 (ubiSensor)
Author:
Yoosoo Oh
Constructor Summary
public
   It initializes a newly FileOutput Object.
 
Method Summary
public void
CleanFile(String file)
   This method removes all contents in a file (initialization).
 
public void
writeFile(String file, String str)
   This method writes the output data in a file.
 
Constructor Detail
FileOutput
public FileOutput()
It initializes a newly FileOutput Object.

Method Detail
CleanFile
public void CleanFile(String file)
This method removes all contents in a file (initialization).

Parameters:
file String: the file name

writeFile
public void writeFile(String file, String str)
This method writes the output data in a file.

Parameters:
file String: the file name
str String: the data input
Class ParticleExtractorMain
package: ParticleExtractor
public class ParticleExtractorMain
This class is ready to extract sensing data from Particle sensors.

Since:
J2SDK1.5
Version:
ubi-UCAM 2.0 (ubiSensor)
Author:
Yoosoo Oh
Inner Class Summary
public final static class
ParticleExtractorMain.GetFuzzyThread
   This class is Thread for election of VotingMethod class (every 5 second).
 
public final static class
ParticleExtractorMain.GetSendThread
   This class is Thread for sendContext method (every 5 second).
 
Field Summary
private int
   Instance of Integer for x axis of acceleration
 
private int
   Instance of Integer for y axis of acceleration
 
private int
   Instance of Integer for z axis of acceleration
 
private Communicator
   Instance of Communicator for multicasting between ubiSensor & ubiService
 
public String
   Instance of String for the result of activity election
 
private int
   Instance of Integer for the degree of force
 
   Instance of ActivityFuzzyRule for inferring activity
 
private int
   Instance of Integer for the level of light
 
private Vector
   Instance of Vector for gathering Activity
 
private VotingMethod
   Instance of VotingMethod for electing the major activity
 
private Context5W1H
   Instance of Context5W1H object
 
protected static int
   Instance of Integer for Particle communication
 
   Instance of DeviceProfileReader for getting the profile data
 
private String
   Instance of String for Particle sensor's identity
 
private int
   Instance of Integer for the level of sound
 
private int
   Instance of Integer for the degree of temperature
 
private boolean
   Instance of boolean for control thread to send context
 
Constructor Summary
public
   It initializes a newly ParticleExtractorMain Object.
 
Method Summary
private void
   This method is to initialize the status of Preliminary Context.
 
private void
   This method is ready for extracting the sensed data from Particle sensor.
 
public void
run()
public void
run()
public static void
main(String args)
   This method is a main to initialize ParticleExtractorMain.
 
private void
   This method is to send Preliminary Context to multicasting group.
 
Field Detail
accel_x
private int accel_x
Instance of Integer for x axis of acceleration

accel_y
private int accel_y
Instance of Integer for y axis of acceleration

accel_z
private int accel_z
Instance of Integer for z axis of acceleration

COMM
private Communicator COMM
Instance of Communicator for multicasting between ubiSensor & ubiService

ElectedActivity
public String ElectedActivity
Instance of String for the result of activity election

force
private int force
Instance of Integer for the degree of force

fuzzy
private ActivityFuzzyRule fuzzy
Instance of ActivityFuzzyRule for inferring activity

light
private int light
Instance of Integer for the level of light

m_VContinuousTimeValue
private Vector m_VContinuousTimeValue
Instance of Vector for gathering Activity

m_Vote
private VotingMethod m_Vote
Instance of VotingMethod for electing the major activity

pcontext
private Context5W1H pcontext
Instance of Context5W1H object

port
protected static int port = 5555
Instance of Integer for Particle communication

profile
private DeviceProfileReader profile
Instance of DeviceProfileReader for getting the profile data

sensorID
private String sensorID
Instance of String for Particle sensor's identity

sound
private int sound
Instance of Integer for the level of sound

temperature
private int temperature
Instance of Integer for the degree of temperature

thread_flag
private boolean thread_flag
Instance of boolean for control thread to send context
Constructor Detail
ParticleExtractorMain
public ParticleExtractorMain()
It initializes a newly ParticleExtractorMain Object.

Method Detail
context_init
private void context_init()
This method is to initialize the status of Preliminary Context.

extractParticle
private void extractParticle()
This method is ready for extracting the sensed data from Particle sensor.

main
public static void main(String args)
This method is a main to initialize ParticleExtractorMain.


sendContext
private void sendContext()
This method is to send Preliminary Context to multicasting group.
Class VotingMethod
package: ParticleExtractor
public class VotingMethod
This class is ready to elect a leader among the inputted contexts.


It elects the context leader by using the spedified context key.
Since:
J2SDK1.4
Version:
ubi-UCAM 2.0
Author:
Yoosoo Oh
Field Summary
private String
   The Value indicating a object key
 
private Vector
   The Instance of the Vector for a context buffer
 
Constructor Summary
public
VotingMethod(Vector temp, String contextkey)
   It initializes a newly VotingMethod Object.
 
Method Summary
public Object
   This method elects the leader in a given object buffer.
 
Field Detail
m_ContextKey
private String m_ContextKey
The Value indicating a object key

m_VContextBuffer
private Vector m_VContextBuffer
The Instance of the Vector for a context buffer
Constructor Detail
VotingMethod
public VotingMethod(Vector temp, String contextkey)
It initializes a newly VotingMethod Object.

Parameters:
temp the Vector to be used as a object buffer
context the String to be used as a object key
Method Detail
election
public Object election()
This method elects the leader in a given object buffer.


It uses a context key for an election.
It expresses the result as the form of Object.
Returns:
the result of an election
Package Resources
Class Diagrams
diagram Resources
Subpackages
package Resources.APSConfig
package Resources.lib
package Resources.ParticleOutput
package Resources.ParticleProfile
Class Diagrams
Class Diagram Resources
package: Resources
Package Nodes
APSConfig
lib
ParticleOutput
ParticleProfile
Package Node Detail
Package Resources.APSConfig
Package Resources.lib
Package Resources.ParticleProfile
Package Resources.ParticleOutput
Package Resources.APSConfig
Class Diagrams
diagram APSConfig
Class Diagrams
Class Diagram APSConfig
package: Resources.APSConfig
Package Resources.lib
Class Diagrams
diagram lib
Class Diagrams
Class Diagram lib
package: Resources.lib
Package Resources.ParticleOutput
Class Diagrams
diagram ParticleOutput
Class Diagrams
Class Diagram ParticleOutput
package: Resources.ParticleOutput
Package Resources.ParticleProfile
Class Diagrams
diagram ParticleProfile
Class Diagrams
Class Diagram ParticleProfile
package: Resources.ParticleProfile