Rodrigo Espiga Gómez | 31 May 19:12 2014
Picon

[pio-develop] Question regarding default game board

Hi everyone! I have a question regarding the type of board used when the game is launched from the console with, for example
pioneers-server-console --port 6000 --auto-quit --fixed-seating-order --game-title "Default" --players 4 -x
I understand that this is the "Default" hexagonal board but I´m not sure if the terrain tiles are randomized or they are always in the same places. I can see there is a --terrain option and it seems I have to pass --terrain=1 to randomize the terrain, otherwise it is not. I am a bit confused because the default option with the graphic interface seems to be randomized terrain (the checkbox is ticked by default).
The Genetic Algorithm uses that command line and I´m not sure if it is learning to play in an exact board cofiguration or not.
What board does it exactly use with that command line?

Thanks!
------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
_______________________________________________
Pio-develop mailing list
Pio-develop <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pio-develop
Rodrigo Espiga Gómez | 24 Apr 18:08 2014
Picon

[pio-develop] Genetic AI: future improvements

Thanks a lot Roland for all your comments. Right now I have to write down a report with the results of the experiments and I have a deadline on that, so I will make those changes as soon as I can. I will also unlock the internal trade, cause right now it does not initiate it to avoid giving it an edge over greedy during evolution. But once the chromosome is evolved, it uses the same logic behind bestStrategy to find out if the profit of the best strategy can be improved by an exchange. I think this can lead it to make intelligent tradings with other players, and also a more interesting AI to play against by humans.
Saludos!
------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Pio-develop mailing list
Pio-develop <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pio-develop
Roland Clobus | 18 Apr 16:36 2014
Face
Picon
Picon

[pio-develop] Code review genetic player

Hallo Rodrigo and list,

The genetic computer player is playing better than the greedy player.
My test results so far in the default game, with 2 classic computer
players and 2 genetic players: classic vs. genetic = 1 vs 4 won games.

I've done a code review of the new code. Most are relatively minor
issues, but will make maintenance easier.

- Could you run 'make reindent' before committing to svn? That will
minimize the amount of changes. (Your editor appears to use a tab size
of 4, while the other source code assumes a tab size of 8).
- I've already run 'make reindent' and committed the changes, so I
suggest you run 'make reindent' before 'svn update', otherwise you'll
get many nasty merge conflicts.
- Try to keep the amount of changes small, run 'svn diff' to see if you
are about to commit some unneeded white space changes.
- Try to avoid magic numbers. In
reevaluate_gameState_supply_matrix_and_resources I see '10' and '5'. You
can use the GLib macro 'G_N_ELEMENTS', In outputChromosome you use the
value of 9. Try to use either 9 or 10.
- Use the datatypes in GLib, especially gboolean and TRUE/FALSE, that
makes the code easier readable (see e.g. facingOK)
- Avoid the pattern 'if (A) { return TRUE } else { return FALSE }', use
'return (A)' instead.
- Use a typedef for your structs and enums, so you don't have to use the
keyword 'struct' or 'enum' in every function call.
- In facingOK: 'nodeTwo = hex->nodes[(hex->facing + 5) % 6]' does the
same as the if-statement
- Instead of keeping your template code around in '#if 0', remove it
when you are done with it.
- Instead of 'printf', use GLib's 'g_print' (or g_printf). This will
remove the need to include stdlib.h and stdio.h
- Instead of 'sleep' use 'ai_wait', or if you need only one millisecond,
use 'g_usleep(1000u)' (I've replaced the call to sleep with 'ai_wait',
because the sleep function broke the Windows build).
- In checkRoadNow: It is not necessary to place a break after a return
statement.
- If you intend to keep the code in genetic_core.c separate from
genetic.c (so you might use it with another main(), I suggest to create
a regular 'genetic_core.h' file to contain the function prototypes. If
you have trouble integrating it in the Makefiles, contact me.
- genetic_game_over: You can use the argument points instead of
'player_get_score(my_player_num())' (and thus remove the G_GNUC_UNUSED
for points)
- Instead of commenting and de-commenting your debug messages, you can
add '#define GENETIC_DEBUG' and '#ifdef GENETIC_DEBUG...#endif'

I've prepared a patch [1], which should be applied to svn revision 2066,
which removes all duplicated code related to the chat-behaviour of the
computer player to the main code file (ai.c).
I've noticed that this might break your code by introducing many merge
conflicts, so I'll apply it only when you agree.

With kind regards,
Roland Clobus

[1] https://sourceforge.net/p/pio/patches/677/

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Pio-develop mailing list
Pio-develop <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pio-develop
Rodrigo Espiga Gómez | 19 Mar 10:36 2014
Picon

[pio-develop] Modifications needed to pass chromosome to Genetic AI

Hi!
As Bas proposed, I think the best option would be to add the file to the algorithm argument. The chromosome file would be like the file attached, just a plain text file with the values to be passed to thisChromosome variable inside genetic.c.
Where is the best place to put the code that access to that file? Inside genetic_init? Or should I define the callback.init_game=&genetic.init_game and place the code there?
And what do I have to modify to let genetic algorithm accept that file? I think it would be perfect to pass the file the way Bas said (--algorithm=genetic:/path/to/file.txt). Is it necessary to modify pioneersai in order to do that?
Thanks!
Attachment (chromosome): application/octet-stream, 288 bytes
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Pio-develop mailing list
Pio-develop <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pio-develop
Rodrigo Espiga Gómez | 17 Mar 19:46 2014
Picon

[pio-develop] Passing a particular chromosome to genetic AI

Hi Roland and others!
Genetic AI is working right now, given the testing chromosome that is harcoded inside it. And now it's when fun part comes: evolution. But in order to evolve the algorithm I need to run hundreds of games, generation after generation, using different chromosomes, and I need genetic to use a given chromosome when is called.
To give you an idea of the process from now on it would be like this (at least fundamentally, numbers may vary, and the exact methods have yet to be decided):
1- A set of 100 randomized chromosomes are generated.
2- 100 games (with one genetic and three greedy players) are launched, each genetic player using one of those chromosomes.
3- Outcome (victory points) of every genetic player is recorded along with its chromosome (and probably other information for statistical purposes).
4- Each player (chromosome) has a probability of being selected for the next generation that depends on its fitness (victory points) in the previous generation.
5- 100 selections of one chromosome are done, based on those probabilities (some chromosomes could be selected more than once, others none).
6- Selected chromosomes are crossed in pairs, crossbreeding their genetic information, and their offspring are inserted in a new generation (some chromosomes could passed to the next generation unmodified, that depends on the method used).
7- With this new generation of 100 chromosomes, we go back to step 2 a repeat the whole process.
This sequence of steps is repeated until certain stop condition is met (usually depending on the concurrency of the chromosomes), or a maximum number of generations is run (about 500). This method will presumibly yield an optimal chromosome whose fitness has been proved after generations. This method can be reproduced for any given game configuration so it could learn for example that one resource is more important than other in certain type of game, or that ports are more valuable in other, etc.
So I need genetic to use different chromosomes.
The best way would be having the chromosome information on an external file that would be passed to pioneersai as an argument. That way I could evolve a "universal" chromosome that could be passed to any game, and specific chromosomes to be passed for specific games as well (like Ubuntuland, and the like. Genetic would then use the "generic" chromosome (hardcoded inside it) if no one else was given. Otherwise, it would use the values inside that file (that could be just a plain text file). However, this approach needs some modification to the way pioneersai works, so it accepts this chromosome file as part of the options when genetic is passed as the AI.
Another approach to avoid any modification to pioneersai is  having all the chromosomes of one generation on a single file (my plan is to have generations of 100 chromosomes/players). Genetic would then take the information from that file and would take the chromosome inside that file that corresponds to its name inside the generation (assuming its name can be associated with a given chromosome inside the chromosomes file, naming each player, e.g., Genetic1, Genetic2, and the like).  After a whole generation is run, this file would be modified to hold the new chromosomes, and would be used by the next generation run. That way there is no need to specify a chromosome file cause all the chromosomes are in the same file. Once the evolution has concluded, I would eliminate any reference to that file and hardcode that winning chromosome inside genetic.c.
The drawback of this method is that is very rigid, and lacks all the possibilities of passing different chromosomes for different games, or even giving the user the possibility of passing its own chromosomes, that the first method does have.
Which one do you think is better?
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Pio-develop mailing list
Pio-develop <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pio-develop
Rodrigo Espiga Gómez | 25 Feb 09:26 2014
Picon

[pio-develop] Help needed identifying when a node has access to a port

I need to know if a node gives me access to a port. As far as I can tell by the way it is used inside score_hex (in greedy.c), if hex.resource==ANY_RESOURCE that means that the hex has  a generic port, and if a node is adjacent to that Hex then it has access to that port. So that means that the hex is a maritime one, isn’t it? And if resource is a different one, does that mean that the hex has a specific port?
What confuses me a bit is that, although ports in the game are conceptually associated with edges (or pairs of nodes), in the code that information is contained within the Hex structure. And sometimes two hexes are adjacent to the same maritime one, and some of their nodes have access to the port and others don’t!
So where do I have to look at to find out if a node gives me access to ports (generic and specific)?
Thanks!
------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
Pio-develop mailing list
Pio-develop <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pio-develop
Andreas Steinel | 21 Feb 22:10 2014
Picon

[pio-develop] Mac GTK3 Application

Hi all,

is there someone working on a GTK3 Mac App Bundle of Pioneers?

Best,
Andreas
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Pio-develop mailing list
Pio-develop <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pio-develop
Roland Clobus | 21 Feb 08:18 2014
Face
Picon
Picon

Re: [pio-develop] Makefile in client/ai

Hello Rodrigo,

On Tue, 2014-02-18 at 21:58 +0100, Rodrigo Espiga Gómez wrote:
> After comitting the code of genetic_core.c and genetic.c I have
> realized that, although it compiled in my local version, if I download
> it now from the repository it gives compiling errors because I erased
> your '#ifndef INTEGRATE_GENETIC_ALGORITHM' from genetic_core.c  after
> removing the whole main function inside genetic_core.c. That file was
> meant to be an auxiliary file with some of the functions that would
> later be used by genetic.c, which is actually the file with the AI. In
> fact, those funtions could be inside genetic.c itself instead, and
> genetic_core.c be removed completely.
> I was compiling the code in my computer with the Makefile of the R1885
> with no problem, but that Makefile was modified afterwards in R2044.
> I prefer not to alter the contents of the Makefile of the repository,
> so I will wait for you to do whatever changes you may consider
> necessary, if you don't mind.
> Thank you very much!

In r2048 I've fixed the Makefile.am.
This means that genetic_core.c will not be given to the C compiler,
because you already #include it in genetic.c.

With kind regards,
Roland

PS: I prefer that all mail regarding Pioneers is sent to the mailing
list.
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Pio-develop mailing list
Pio-develop <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pio-develop
Rodrigo Espiga Gómez | 17 Feb 20:03 2014
Picon

[pio-develop] Identifying nodes with access to ports

I need to know if a node gives me access to a port. As far as I can tell by the way it is used inside score_hex (in greedy.c), if hex.resource==ANY_RESOURCE that means that the hex has  a generic port, and if a node is adjacent to that Hex then it has access to that port. So that means that the hex is a maritime one, isn’t it? And if resource is a different one, does that mean that the hex has a specific port?
What confuses me a bit is that, although ports in the game are conceptually associated with edges (or pairs of nodes), in the code that information is contained within the Hex structure. And sometimes two hexes are adjacent to the same maritime one, and some of their nodes have access to the port and others don’t! For example, in the image there is a specific Lumber port in the bottom part of the map. The node with the blue circle has acces to it, but the node in the red circle does not, even though both are part of the same hex and are also adjacent to same maritime one.
So where do I have to look at to find out if a node gives me access to ports (generic and specific)?
Thanks!
 
 
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Pio-develop mailing list
Pio-develop <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pio-develop
Randall Mason | 17 Feb 11:38 2014
Picon

Re: [pio-develop] Release of Pioneers 15.2 pending

I just wanted to let you know that I had to do a couple of things to get it to build.  I first tried to run the dpkg-buildpackage command as I'm on ubuntu.  This wanted me to install a whole list of things.  I installed everything except: libgnome2-dev libgtk2.0-dev.

I then tried to run it with forced deps, but that still didn't work.  So I ran the autogen.sh command and a make.  This too failed because of a few things not being in GTK3 that were in GTK2.  I looked for the error online and found that many people solved this by removing "-DG_DISABLE_DEPRECATED".  I went in and took it out of the makefile for both glib and gtk:
-GLIB_DEPRECATION = -DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES
+GLIB_DEPRECATION = -DG_DISABLE_SINGLE_INCLUDES

and

-GTK_DEPRECATION = -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED -DGDK_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES -DGSEAL_ENABLE
+GTK_DEPRECATION = -DGNOME_DISABLE_DEPRECATED -DGDK_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES -DGSEAL_ENABLE

The next make resulted in a build and I was able to run that on a broadway backend with this command:
GDK_BACKEND=broadway UBUNTU_MENUPROXY= LIBOVERLAY_SCROLLBAR=0 pioneers-server-gtk
and
GDK_BACKEND=broadway UBUNTU_MENUPROXY= LIBOVERLAY_SCROLLBAR=0 pioneers

resulting in a great little pio server and client in my browser!

This is so exciting!  I think there are still a few things to iron out because it keeps saying that I'm disconnected from the broadwayd gtk3 backend in my browser, but I'm guessing that it's my problem.  We'll see..

Also, for those on Ubuntu, you will need to upgrade gtk3 from ppa:malizor/gtk-broadway and install broadwayd to get the above commands to work.



On Sat, Feb 8, 2014 at 6:48 PM, Roland Clobus <rclobus <at> users.sourceforge.net> wrote:
Hello all,

I've finished the port to GTK3. The patch is up for review at [1].
I would like to include the admin cheat patch [2] as well, and then
release 15.2 (no new text for translation, so a faster than usual
release cycle is possible).

Translators: If you made changes to your translation since 15.1 was
released, notify me, so I can include your updated translations in this
release. (The updated translation for Afrikaans will be included in
15.2)

With kind regards,
Roland

[1] https://sourceforge.net/p/pio/patches/676/
[2] https://sourceforge.net/p/pio/patches/673/



------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Pio-develop mailing list
Pio-develop <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pio-develop

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Pio-develop mailing list
Pio-develop <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pio-develop
Rodrigo Espiga Gómez | 14 Feb 10:57 2014
Picon

[pio-develop] GLib-CRITICAL **: g_rand_int_range: assertion `rand != NULL' failed

No, I do not call random_init() from anywhere in the code (in greedy.c is not called either). It seems to me that the error has something to do with the randomized chat messages, but that is something I have copied/pasted from greedy.c, I have not changed anything. Hints?
I already have a playable ai that I will commit shortly, so you can take a look at it. Having in mind that it is not evolved yet (I have set up a default chromosome to do the tests), is not too bad a player. I trust it will improve with evolution. ;)
------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Pio-develop mailing list
Pio-develop <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pio-develop

Gmane