-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there any way to get input from an external source for an agent? #313
Comments
There is no way to do that in osBrain. In theory, you could pass (a copy of) your current standard input file descriptor to a process (agent) on creation. However, I do not think that is what you want to do. Agents are running in parallel, so how would you want your system to behave if there are multiple agents waiting for "input" at the same time? Would you want to have them all receive the same input? I am guessing you only have a single terminal to write that input. If you are simply trying to input random data for testing your system, then I would recommend you to use timers instead, and generate random data for your agents periodically. This would probably mimic your real application better than if you have to manually input some values every time. 😊 If your "User" agent is a single and unique agent whose only purpose is to read user input and send it to the other agents in the network, then I would rather not make that an agent. Use your "main" script and call |
Thank you for getting back to me so quickly, I did want to make a separate
User agent but I think having a simple input in the main script won't
interfere much with what I'm trying to do. Thanks for all the suggestions,
I will try them out. :)
…On Mon, 1 Oct 2018, 11:13 am Miguel Sánchez de León Peque, < ***@***.***> wrote:
There is no way to do that in osBrain.
In theory, you could pass (a copy of) your current standard input file
descriptor to a process (agent) on creation.
However, I do not think that is what you want to do. Agents are running in
parallel, so how would you want your system to behave if there are multiple
agents waiting for "input" at the same time? Would you want to have them
all receive the same input? I am guessing you only have a single terminal
to write that input.
If you are simply trying to input random data for testing your system,
then I would recommend you to use timers instead
<https://osbrain.readthedocs.io/en/stable/timers.html>, and generate
random data for your agents periodically. This would probably mimic your
real application better than if you have to manually input some values
every time. 😊
If your "User" agent is a single and unique agent whose only purpose is to
read user input and send it to the other agents in the network, then I
would rather not make that an agent. Use your "main" script and call
input() in the infinite loop you created.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#313 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AQANEHWOTijMbYLphwvrJuEdu0kIzMN2ks5ugbKjgaJpZM4XBNV0>
.
|
I'm somewhat new to python and coding in general so this question might be somewhat stupid but I wanted to know if there is anyway to receive an input for an agent. I've tried doing it myself but receive Eof error everytime. I've pasted my code below.
Everything seems to be working rather well (the code might be a bit ugly though considering my newbish background) except for receiving the input. I'd love some help from people over here.
The text was updated successfully, but these errors were encountered: