Building agents in Pharo

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Building agents in Pharo

Andy Burnett
I am interested in building a system that uses co-operating agents to parse events.

Is Pharo a suitable system for this? I ask because given that it is single threaded, I wondered whether running multiple agents would present any sort of problem. Has anyone got experience of building something like this? And, if so, what did you use for your basic queue? Is there a suitable FIFO style queue within Pharo?

Cheers
Andy
Reply | Threaded
Open this post in threaded view
|

Re: Building agents in Pharo

Sven Van Caekenberghe-2
Hi Andy,

> On 21 Dec 2014, at 20:00, Andy Burnett <[hidden email]> wrote:
>
> I am interested in building a system that uses co-operating agents to parse events.
>
> Is Pharo a suitable system for this? I ask because given that it is single threaded, I wondered whether running multiple agents would present any sort of problem. Has anyone got experience of building something like this? And, if so, what did you use for your basic queue? Is there a suitable FIFO style queue within Pharo?
>
> Cheers
> Andy

The standard VM is using a single OS process (and thus uses a single core) but manages its own user land threads called Processes. The cool thing is that you can read/understand all this threading code (ProcessorScheduler, Process, Semaphore, Monitor, Delay, ..). There few if any limits to the amount of processes you can have.

To answer the second question: I believe SharedQueue is the class you should be looking at (first).

Sven


Reply | Threaded
Open this post in threaded view
|

Re: Building agents in Pharo

Andy Burnett
In reply to this post by Andy Burnett
Sven wrote
<<
The standard VM is using a single OS process (and thus uses a single core) but manages its own user land threads called Processes. The cool thing is that you can read/understand all this threading code (ProcessorScheduler, Process, Semaphore, Monitor, Delay, ..). There few if any limits to the amount of processes you can have. 

To answer the second question: I believe SharedQueue is the class you should be looking at (first). 

>>

Great, that sounds very encouraging. Thanks very much.

Andy


Reply | Threaded
Open this post in threaded view
|

Re: Building agents in Pharo

stepharo
Andy which kind of agents would you like to build?
I was playing with Actalk (I should resurrect it in Pharo 40.
But in essence an object with a thread and a mailbox

Stef
Sven wrote
<<
The standard VM is using a single OS process (and thus uses a single core) but manages its own user land threads called Processes. The cool thing is that you can read/understand all this threading code (ProcessorScheduler, Process, Semaphore, Monitor, Delay, ..). There few if any limits to the amount of processes you can have. 

To answer the second question: I believe SharedQueue is the class you should be looking at (first). 

>>

Great, that sounds very encouraging. Thanks very much.

Andy



Reply | Threaded
Open this post in threaded view
|

Re: Building agents in Pharo

Andy Burnett
In reply to this post by Andy Burnett
Stef said
<< 

Andy which kind of agents would you like to build?
I was playing with Actalk (I should resurrect it in Pharo 40.
But in essence an object with a thread and a mailbox

Stef

>>

Hi Stef,

In very simple terms I want to build a system that would look at what you are typing in a text box, and have various agents that analyse the text and modify/augment it.

Simple Examples:
  1. If I enter a web address it could look it up on Delicious.com and extract links that had been similarly tagged.
  2. If I enter something that looks like a name, it would search google scholar, or mendeley and include links to any documents
  3. If I entered "call david tomorrow" it would be able to add something to my things to do list.
My - very early - thoughts are that I need to continually parse the text, as I type, and various agents would look for the things they are interested in.  The question is how best to model this, and process the data.

Cheers
Andy

Reply | Threaded
Open this post in threaded view
|

Re: Building agents in Pharo

stepharo


Hi Stef,

In very simple terms I want to build a system that would look at what you are typing in a text box, and have various agents that analyse the text and modify/augment it.

Simple Examples:
  1. If I enter a web address it could look it up on Delicious.com and extract links that had been similarly tagged.
  2. If I enter something that looks like a name, it would search google scholar, or mendeley and include links to any documents
  3. If I entered "call david tomorrow" it would be able to add something to my things to do list.
My - very early - thoughts are that I need to continually parse the text, as I type, and various agents would look for the things they are interested in.  The question is how best to model this, and process the data.

You see this is what the color higlighting is doing.
You type and in parallel it is trying to colorize the text.
After I'm not sure that you need agents running all the time (reacting to each characters you type).
I would be you I would
 - prototype a hierarchy of classes whose instances have a kind of patterns to know if they should be kick in
 - at the end of each line, I would send the line to a list of such "agent" and react
  
- then only then, I would consider to fork the behavior of the agents. why? because when you can avoid concurrency this is simpler :)


Cheers
Andy


Reply | Threaded
Open this post in threaded view
|

Re: Building agents in Pharo

Andy Burnett
In reply to this post by Andy Burnett

Stef wrote
<<

You see this is what the color higlighting is doing.
You type and in parallel it is trying to colorize the text.
After I'm not sure that you need agents running all the time (reacting
to each characters you type).
I would be you I would
  - prototype a hierarchy of classes whose instances have a kind of
patterns to know if they should be kick in
  - at the end of each line, I would send the line to a list of such
"agent" and react

- then only then, I would consider to fork the behavior of the agents.
why? because when you can avoid concurrency this is simpler :)

>>

Thanks, that sounds like a very good way forward. I will go and try to understand the highlighting code.

Cheers
Andy
Reply | Threaded
Open this post in threaded view
|

Re: Building agents in Pharo

Tudor Girba-2
Hi Andy,

You can also just hook into GTSpotter. It already provides the infrastructure for handling parallel search and lets you focus only on specifying the search logic.

Cheers,
Doru



On Tue, Dec 23, 2014 at 1:20 PM, Andy Burnett <[hidden email]> wrote:

Stef wrote
<<

You see this is what the color higlighting is doing.
You type and in parallel it is trying to colorize the text.
After I'm not sure that you need agents running all the time (reacting
to each characters you type).
I would be you I would
  - prototype a hierarchy of classes whose instances have a kind of
patterns to know if they should be kick in
  - at the end of each line, I would send the line to a list of such
"agent" and react

- then only then, I would consider to fork the behavior of the agents.
why? because when you can avoid concurrency this is simpler :)

>>

Thanks, that sounds like a very good way forward. I will go and try to understand the highlighting code.

Cheers
Andy



--

"Every thing has its own flow"
Reply | Threaded
Open this post in threaded view
|

Re: Building agents in Pharo

Andy Burnett
In reply to this post by Andy Burnett
Doru wrote
<<<
Hi Andy,

You can also just hook into GTSpotter. It already provides the
infrastructure for handling parallel search and lets you focus only on
specifying the search logic.

Cheers,
Doru

>>>

Brilliant!  I am very impressed with GTSpotter. In fact, I am impressed with the whole GT suite.  I think I will build a first prototype with Glamour and GTSpotter.

By the way, what really motivated me to do this experiment is the tools - from the 90's - that were presented in this "Story of Siri" video.  If you have the time, it is well worth watching.  Being able to build this sort of capability into an environment like Pharo would be amazing


Cheers
Andy
Reply | Threaded
Open this post in threaded view
|

Re: Building agents in Pharo

S Krish
Not really free form text but quite a bit keyword dependent. Closer to what will make good sense on Pharo / every enterprise app also more contextual based on what the app does.





On Tue, Dec 23, 2014 at 10:17 PM, Andy Burnett <[hidden email]> wrote:
Doru wrote
<<<
Hi Andy,

You can also just hook into GTSpotter. It already provides the
infrastructure for handling parallel search and lets you focus only on
specifying the search logic.

Cheers,
Doru

>>>

Brilliant!  I am very impressed with GTSpotter. In fact, I am impressed with the whole GT suite.  I think I will build a first prototype with Glamour and GTSpotter.

By the way, what really motivated me to do this experiment is the tools - from the 90's - that were presented in this "Story of Siri" video.  If you have the time, it is well worth watching.  Being able to build this sort of capability into an environment like Pharo would be amazing


Cheers
Andy

Reply | Threaded
Open this post in threaded view
|

Re: Building agents in Pharo

Andy Burnett
In reply to this post by Andy Burnett
Kish wrote <<<

How about this:

http://www.wolframalpha.com/

Not really free form text but quite a bit keyword dependent. Closer to what
will make good sense on Pharo / every enterprise app also more contextual
based on what the app does.

>>>

Yup, totally agree. I have been playing with Mathematica a lot recently, and there are a number of things I would love to see in Pharo.  The ability to pull in data sets in computable form is really useful. Being able to say something like Population London UK, and have the data returned as a collection is great.  In theory we could do the same with e.g. DataWiki.

Cheers
Andy