Semi-autonomous software agents: Practical applications.

Antarctica Starts Here. » Antarctica Starts Here. 2016-02-03

Summary:

In the last post in this series I talked about the origins of my exocortex and a few of the things I do with it. In this post I'm going to dive a little deeper into what my exocortex does for me and how it's laid out. My agent networks ("scenarios" in the terminology of Huginn) are collections of specialized agents which each carry out one function (like requesting a web page or logging into an XMPP server to send a message). Those agents communicate by sending events to one another; those events take the form of structured, packaged pieces of information that the receiving agent can pick values out of or pass along depending on how it's configured. Below the cut is what one kind of event looks like.{ "date": { "epoch": "1452481200", "pretty": "7:00 PM PST on January 10, 2016", "day": 10, "month": 1, "year": 2016, "yday": 9, "hour": 19, "min": "00", "sec": 0, "isdst": "0", "monthname": "January", "monthname_short": "Jan", "weekday_short": "Sun", "weekday": "Sunday", "ampm": "PM", "tz_short": "PST", "tz_long": "America/Los_Angeles" }, "period": 1, "high": { "fahrenheit": "57", "celsius": "14" }, "low": { "fahrenheit": "48", "celsius": "9" }, "conditions": "Chance of Rain", "icon": "chancerain", "icon_url": "http://icons.wxug.com/i/c/k/chancerain.gif", "skyicon": "", "pop": 50, "qpf_allday": { "in": 0.03, "mm": 1 }, "qpf_day": { "in": 0.03, "mm": 1 }, "qpf_night": { "in": 0.0, "mm": 0 }, "snow_allday": { "in": 0.0, "cm": 0.0 }, "snow_day": { "in": 0.0, "cm": 0.0 }, "snow_night": { "in": 0.0, "cm": 0.0 }, "maxwind": { "mph": 10, "kph": 16, "dir": "ENE", "degrees": 63 }, "avewind": { "mph": 6, "kph": 10, "dir": "ENE", "degrees": 63 }, "avehumidity": 75, "maxhumidity": 0, "minhumidity": 0, "location": "94607" } That looks like a king-hell mess of acronyms and numbers but if you take it one line or block (delineated by curly braces) at a time it's pretty easy to puzzle out. The event contains many different kinds of information from the web service the agent queried, all of which is accessible by agents but not all of which needs to be used; you can pick and choose the stuff you need out of the event and ignore the rest. For example, the date the event was received by Huginn can be seen at the very top in several different formats (time_t, the standard parts of a time/date stamp broken into separate pieces, and the time zone in a few different ways) so that you don't have to write code to transform one date/timestamp into a different format, the predicted high and low temperatures in Fahrenheit and Centigrade, projected weather conditions for the day, the wind speed and direction, humidity, and zip code of the city in question. My agent network uses a few elements of these events to build the weather report I read every morning before getting dressed for work. This agent network, called Butterfly In China also monitors the air quality index in the same locations at the same time it pulls the weather forecasts. The AQI projection is filtered through a series of if-then conditionals that determine what AQI message should be merged, if any (none, moderate, unhealthy, hazardous, or dangerous). Then the resulting message is e-mailed to my phone while I'm in the shower so I have some idea of what the weather will be like that day. After a decidedly anomalous event in 2011 I built a simple but functional agent network called Shake, Rattle, and Roll which monitors the United States Geological Service's tectonic activity surveillance network. Every few minutes, Shake, Rattle, and Roll polls their API service for earthquake activity stronger than a 4.0 on the Richter scale and if a positive event comes back (meaning that an earthquake was detected) it is fed into a Data Formatting Agent which turns the event from the API service into a human-readable message suitable for transmission through one or more instant messaging services. I've found it useful to extend Shake, Rattle, and Roll to monitor other geographic locations but, as it is now it makes a good example of a relatively simple agent net

Link:

http://drwho.virtadpt.net/archive/2016/02/03/semi-autonomous-software-agents-practical-applications

From feeds:

Gudgeon and gist » Antarctica Starts Here. » Antarctica Starts Here.

Tags:

content code

Authors:

The Doctor

Date tagged:

02/03/2016, 17:30

Date published:

02/03/2016, 11:00