Robots using DFA

View: New views
10 Messages — Rating Filter:   Alert me  

Robots using DFA

by Thiago Monteiro-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm working in a Robot using DFAs on its behavior, was wondering if anyone
had any example they could share.
To those who dont know what DFA means,
http://en.wikipedia.org/wiki/Deterministic_finite_state_machine.
Any help is really appreciated :-)

--
Prolins IT SOLUTIONS
Desenvolvedor / Analista

"Atrasos são temporários. A mediocridade é eterna."

Re: Robots using DFA

by flemmingnlarsen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You should try ask all the people at Robocode Yahoo Group:
http://tech.groups.yahoo.com/group/robocode/
or at the RoboWiki: http://robowiki.net

The guys on these sites are working indept with making robots.

Best regards,
- Flemming

On Jun 27, 11:53 pm, "Thiago Monteiro" <supermonte...@...>
wrote:

> I'm working in a Robot using DFAs on its behavior, was wondering if anyone
> had any example they could share.
> To those who dont know what DFA means,http://en.wikipedia.org/wiki/Deterministic_finite_state_machine.
> Any help is really appreciated :-)
>
> --
> Prolins IT SOLUTIONS
> Desenvolvedor / Analista
>
> "Atrasos são temporários. A mediocridade é eterna."

Re: Re: Robots using DFA

by Thiago Monteiro-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

doesnt this email reach everyone in the robocode yahoo group already?

2008/6/28 fnl <flemming.n.larsen@...>:

>   You should try ask all the people at Robocode Yahoo Group:
> http://tech.groups.yahoo.com/group/robocode/
> or at the RoboWiki: http://robowiki.net
>
> The guys on these sites are working indept with making robots.
>
> Best regards,
> - Flemming
>
> On Jun 27, 11:53 pm, "Thiago Monteiro" <supermonte...@...<supermonte...%40gmail.com>
> >
> wrote:
>
> > I'm working in a Robot using DFAs on its behavior, was wondering if
> anyone
> > had any example they could share.
> > To those who dont know what DFA means,
> http://en.wikipedia.org/wiki/Deterministic_finite_state_machine.
> > Any help is really appreciated :-)
> >
> > --
> > Prolins IT SOLUTIONS
> > Desenvolvedor / Analista
> >
> > "Atrasos são temporários. A mediocridade é eterna."
>  
>



--
Prolins IT SOLUTIONS
Desenvolvedor / Analista

"Atrasos são temporários. A mediocridade é eterna."

Re: Robots using DFA

by flemmingnlarsen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry. I just realized that. :-]

Let's see if any of your guys in this group have a good answer to
this question. :-)

- Flemming

--- In Robocode@..., "Thiago Monteiro"
<supermonteiro@...> wrote:
>
> doesnt this email reach everyone in the robocode yahoo group
already?

>
> 2008/6/28 fnl <flemming.n.larsen@...>:
>
> >   You should try ask all the people at Robocode Yahoo Group:
> > http://tech.groups.yahoo.com/group/robocode/
> > or at the RoboWiki: http://robowiki.net
> >
> > The guys on these sites are working indept with making robots.
> >
> > Best regards,
> > - Flemming
> >
> > On Jun 27, 11:53 pm, "Thiago Monteiro"
<supermonte...@...<supermonte...%40gmail.com>
> > >
> > wrote:
> >
> > > I'm working in a Robot using DFAs on its behavior, was
wondering if

> > anyone
> > > had any example they could share.
> > > To those who dont know what DFA means,
> > http://en.wikipedia.org/wiki/Deterministic_finite_state_machine.
> > > Any help is really appreciated :-)
> > >
> > > --
> > > Prolins IT SOLUTIONS
> > > Desenvolvedor / Analista
> > >
> > > "Atrasos são temporários. A mediocridade é eterna."
> >  
> >
>
>
>
> --
> Prolins IT SOLUTIONS
> Desenvolvedor / Analista
>
> "Atrasos são temporários. A mediocridade é eterna."
>



Re: Robots using DFA

by Julian Kent :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Fri, 27 Jun 2008 18:53:56 -0300, "Thiago Monteiro"
<supermonteiro@...> said:
> I'm working in a Robot using DFAs on its behavior, was wondering if
> anyone
> had any example they could share.
> To those who dont know what DFA means,
> http://en.wikipedia.org/wiki/Deterministic_finite_state_machine.
> Any help is really appreciated :-)

From the wiki page it seems that DFA only gives true/false statements. I
would be interested in what you would use a DFA for in a robot.
Generally you don't need a true/false answer, but instead something like
a double (for an angle to shoot at), or an array of ints or doubles (the
danger at specific points/angles for movement).

As far as I know no robots use DFAs. However ask on Robowiki.net,
somebody else might know of something =)

--

Julian (AKA Skilgannon on robowiki)

--
http://www.fastmail.fm - Or how I learned to stop worrying and
                          love email again


Re: Robots using DFA

by Big Mike Forsberg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Trying to remember my Automata Theory class....

I think it would be possible to use DFA to automate a robot.

The key is to make the nodes a specific correction to the state robot.

For instance the following is a DFA for a robot.

States
        Node one - turn left + 5 degrees
        Node two - fire full power
Transitions
        Node two + Hit > Node 2
        Node two + Miss > Node 1
        Node 1 + anything > Node 2

There is you DFA, very simplistic.

Hope I helped,

Thanks to my CS345 professor at UT.  (I think that was the class)

Big Mike

On Sun, Jun 29, 2008 at 09:36:38PM +0200, Julian Kent wrote:

>
> On Fri, 27 Jun 2008 18:53:56 -0300, "Thiago Monteiro"
> <supermonteiro@...> said:
> > I'm working in a Robot using DFAs on its behavior, was wondering if
> > anyone
> > had any example they could share.
> > To those who dont know what DFA means,
> > http://en.wikipedia.org/wiki/Deterministic_finite_state_machine.
> > Any help is really appreciated :-)
>
> From the wiki page it seems that DFA only gives true/false statements. I
> would be interested in what you would use a DFA for in a robot.
> Generally you don't need a true/false answer, but instead something like
> a double (for an angle to shoot at), or an array of ints or doubles (the
> danger at specific points/angles for movement).
>
> As far as I know no robots use DFAs. However ask on Robowiki.net,
> somebody else might know of something =)
>
> --
>
> Julian (AKA Skilgannon on robowiki)
>
> --
> http://www.fastmail.fm - Or how I learned to stop worrying and
>                           love email again
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>

--
Auto generated sentence :
The cash pitches maniacal jukebox in the Bastille.

Re: Robots using DFA

by Allan Halme :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I've studied, designed, and developed state machines and in the context of
Robocode, I would apply them to managing the internal state of the robot,
not to determine specific firing angles, power, and movement, etc, but
rather to decide what strategy or tactics to be applying.

As a simple example, imagine three states, DUEL, MELEE, ALONE. If the radar
scans one enemy robot, the state machine transitions to the DUEL state and
then that determines strategy. If the radar picks up multiple enemies,
transition to MELEE and then run the bot based on that, and if the radar
doesn't find any enemies, go to ALONE state. This last state is interesting
on a very large battlefield, where there may be enemies outside of the
radar's range, so the ALONE state may kick in some movement strategy aimed
at searching out enemies in the battlefield, etc.

Making use of a state machine to actually decide on movement, targeting, and
firing, is an interesting thought. Discussion on that would, I think, best
be taken up on the wiki as well.

Regards,
allan

On Mon, Jun 30, 2008 at 3:56 AM, Big Mike Forsberg <bigmike@...> wrote:

>   Trying to remember my Automata Theory class....
>
> I think it would be possible to use DFA to automate a robot.
>
> The key is to make the nodes a specific correction to the state robot.
>
> For instance the following is a DFA for a robot.
>
> States
> Node one - turn left + 5 degrees
> Node two - fire full power
> Transitions
> Node two + Hit > Node 2
> Node two + Miss > Node 1
> Node 1 + anything > Node 2
>
> There is you DFA, very simplistic.
>
> Hope I helped,
>
> Thanks to my CS345 professor at UT. (I think that was the class)
>
> Big Mike
>
>
> On Sun, Jun 29, 2008 at 09:36:38PM +0200, Julian Kent wrote:
> >
> > On Fri, 27 Jun 2008 18:53:56 -0300, "Thiago Monteiro"
> > <supermonteiro@... <supermonteiro%40gmail.com>> said:
> > > I'm working in a Robot using DFAs on its behavior, was wondering if
> > > anyone
> > > had any example they could share.
> > > To those who dont know what DFA means,
> > > http://en.wikipedia.org/wiki/Deterministic_finite_state_machine.
> > > Any help is really appreciated :-)
> >
> > From the wiki page it seems that DFA only gives true/false statements. I
> > would be interested in what you would use a DFA for in a robot.
> > Generally you don't need a true/false answer, but instead something like
> > a double (for an angle to shoot at), or an array of ints or doubles (the
> > danger at specific points/angles for movement).
> >
> > As far as I know no robots use DFAs. However ask on Robowiki.net,
> > somebody else might know of something =)
> >
> > --
> >
> > Julian (AKA Skilgannon on robowiki)
> >
> > --
> > http://www.fastmail.fm - Or how I learned to stop worrying and
> > love email again
> >
> >
> > ------------------------------------
> >
> > Yahoo! Groups Links
> >
> >
> >
>
> --
> Auto generated sentence :
> The cash pitches maniacal jukebox in the Bastille.
>  
>

Re: Robots using DFA

by Julian Kent :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

 From what I've seen, it is better to work on improving one strategy to
deal with any situation, than to make different strategies for different
situations. There are several things, like the DUEL/MELEE/ALONE example
which you gave, which have clearly defined barriers, but most of the
time  you are working with shades of grey. From the example you gave, it
would be simpler to hard code the behaviour, because it is not ever
going to be expanded upon. Although YMMV, that's the way I would do it
=) I prefer not to complicate things =)

Julian (AKA Skilgannon)




Allan Halme wrote:

> I've studied, designed, and developed state machines and in the
> context of Robocode, I would apply them to managing the internal state
> of the robot, not to determine specific firing angles, power, and
> movement, etc, but rather to decide what strategy or tactics to be
> applying.
>
> As a simple example, imagine three states, DUEL, MELEE, ALONE. If the
> radar scans one enemy robot, the state machine transitions to the DUEL
> state and then that determines strategy. If the radar picks up
> multiple enemies, transition to MELEE and then run the bot based on
> that, and if the radar doesn't find any enemies, go to ALONE state.
> This last state is interesting on a very large battlefield, where
> there may be enemies outside of the radar's range, so the ALONE state
> may kick in some movement strategy aimed at searching out enemies in
> the battlefield, etc.
>
> Making use of a state machine to actually decide on movement,
> targeting, and firing, is an interesting thought. Discussion on that
> would, I think, best be taken up on the wiki as well.
>
> Regards,
> allan
>


Re: Robots using DFA

by Thiago Monteiro-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

the DUEL/MELEE/ALONE idea is awesome :-D ty very much for it!
However i never implemented a robot yet, how should i create these
behaviors?
I have to do this fast or I won't graduate on time =(

2008/6/30 Julian Kent <jkflying@...>:

>    From what I've seen, it is better to work on improving one strategy to
> deal with any situation, than to make different strategies for different
> situations. There are several things, like the DUEL/MELEE/ALONE example
> which you gave, which have clearly defined barriers, but most of the
> time you are working with shades of grey. From the example you gave, it
> would be simpler to hard code the behaviour, because it is not ever
> going to be expanded upon. Although YMMV, that's the way I would do it
> =) I prefer not to complicate things =)
>
> Julian (AKA Skilgannon)
>
>
> Allan Halme wrote:
> > I've studied, designed, and developed state machines and in the
> > context of Robocode, I would apply them to managing the internal state
> > of the robot, not to determine specific firing angles, power, and
> > movement, etc, but rather to decide what strategy or tactics to be
> > applying.
> >
> > As a simple example, imagine three states, DUEL, MELEE, ALONE. If the
> > radar scans one enemy robot, the state machine transitions to the DUEL
> > state and then that determines strategy. If the radar picks up
> > multiple enemies, transition to MELEE and then run the bot based on
> > that, and if the radar doesn't find any enemies, go to ALONE state.
> > This last state is interesting on a very large battlefield, where
> > there may be enemies outside of the radar's range, so the ALONE state
> > may kick in some movement strategy aimed at searching out enemies in
> > the battlefield, etc.
> >
> > Making use of a state machine to actually decide on movement,
> > targeting, and firing, is an interesting thought. Discussion on that
> > would, I think, best be taken up on the wiki as well.
> >
> > Regards,
> > allan
> >
>
>  
>



--
Prolins IT SOLUTIONS
Desenvolvedor / Analista

"Atrasos são temporários. A mediocridade é eterna."

Re: Robots using DFA

by flemmingnlarsen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Well, normally robots in Robocode runs as very complex NFAs (non-
deterministic finite automaton).

With Robocode 1.6.1 Beta (was release two days ago), you can set a
random seed using the new -DRANDOMSEED option. This way the robots
will behave deterministic. You could donwload 1.6.1 Beta, and then
change your robocode.bat/sh file to contain:

java -Xmx512M -Dsun.io.useCanonCaches=false -DRANDOMSEED=12345678 -cp
libs/robocode.jar;libs/codesize.jar;libs/cachecleaner.jar
robocode.Robocode

Next step would be to simplify the robot commands etc. So that you
could e.g. turn to North (0 deg), East (90 deg), South (180 deg),
North (270 deg). You could have e.g. 3 types of fires like fire(1),
fire(2) and fire(3). I hope you get the idea. Then you basically have
to make if-statements checking some condition, and then call one or
more of you simplified commands. This way it will be possible to
create a DFA. Also notice, that you could use the JuniorRobot, which
is a very simplified robot type compared to the Robot and
AdvancedRobot class.

You could also get some inspiration from the RobocodeJGAP project,
which is used for Genetic Algorithms. Here, commands etc. are
translated into string, which are then "mutated" using various
genetic methods. Even though you just need a basic DFA, you could use
a string representation similar to the one used in RobocodeJGAP, and
base your DFA on this string representation.

You can get information about RobocodeJGAP from here:

http://jgap.sourceforge.net/doc/robocode/robocode.html

You could perhaps contact Klaus Meffert, the author of RobocodeJGAP.
He might have some good ideas for how you could represent a DFA using
strings. :-)

Best regards,
- Flemming N. Larsen

--- In Robocode@..., "Thiago Monteiro"
<supermonteiro@...> wrote:
>
> the DUEL/MELEE/ALONE idea is awesome :-D ty very much for it!
> However i never implemented a robot yet, how should i create these
> behaviors?
> I have to do this fast or I won't graduate on time =(
>
> 2008/6/30 Julian Kent <jkflying@...>:
>
> >    From what I've seen, it is better to work on improving one
strategy to
> > deal with any situation, than to make different strategies for
different
> > situations. There are several things, like the DUEL/MELEE/ALONE
example
> > which you gave, which have clearly defined barriers, but most of
the
> > time you are working with shades of grey. From the example you
gave, it
> > would be simpler to hard code the behaviour, because it is not
ever
> > going to be expanded upon. Although YMMV, that's the way I would
do it
> > =) I prefer not to complicate things =)
> >
> > Julian (AKA Skilgannon)
> >
> >
> > Allan Halme wrote:
> > > I've studied, designed, and developed state machines and in the
> > > context of Robocode, I would apply them to managing the
internal state
> > > of the robot, not to determine specific firing angles, power,
and
> > > movement, etc, but rather to decide what strategy or tactics to
be
> > > applying.
> > >
> > > As a simple example, imagine three states, DUEL, MELEE, ALONE.
If the
> > > radar scans one enemy robot, the state machine transitions to
the DUEL
> > > state and then that determines strategy. If the radar picks up
> > > multiple enemies, transition to MELEE and then run the bot
based on
> > > that, and if the radar doesn't find any enemies, go to ALONE
state.
> > > This last state is interesting on a very large battlefield,
where
> > > there may be enemies outside of the radar's range, so the ALONE
state
> > > may kick in some movement strategy aimed at searching out
enemies in
> > > the battlefield, etc.
> > >
> > > Making use of a state machine to actually decide on movement,
> > > targeting, and firing, is an interesting thought. Discussion on
that

> > > would, I think, best be taken up on the wiki as well.
> > >
> > > Regards,
> > > allan
> > >
> >
> >  
> >
>
>
>
> --
> Prolins IT SOLUTIONS
> Desenvolvedor / Analista
>
> "Atrasos são temporários. A mediocridade é eterna."
>