Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Panda

Pages: [1] 2 3 ... 31
Off Topic / Re: Personal news
« on: April 01, 2016, 06:08:54 AM »
It would still be possible with structures, just the code organisation would be different, i.e. with constructor methods instead of actual constructors. I don't know how VB6 classes work so I can't really comment on them.

Off Topic / Re: Personal news
« on: March 31, 2016, 05:59:57 PM »
One way to do it, and probably the most like a conventional global variable, would be to use the Singleton pattern. This is NOT my favourite way to do it.

Another way of doing it would be "giving" each part of the program that needs what was a global variable or a set of them, an instance of a holder for it. i.e.
Code: [Select]
class PreviouslyGlobal {
  private int variable1;
  private int variable2;

class Component1 {
   private PreviouslyGlobal vars;
   public Component1(PreviouslyGlobal vars) {
       this.vars = vars;

class Component2 {
   private PreviouslyGlobal vars;
   public Component2(PreviouslyGlobal vars) {
       this.vars = vars;

class Driver {
   void main() {
       PreviouslyGlobal sharedVars = new PreviouslyGlobal();
       Component1 c1 = new Component1(sharedVars);
       Component2 c2 = new Component2(sharedVars);

I'm not exactly sure how these would be implemented in VB6.

These are both certain ways of doing it, although not the way of doing it.

Off Topic / Re: Personal news
« on: March 31, 2016, 04:05:59 PM »
Is there anything that could be done with the global variables in DB2 other than changing most of the architecture?
Not without tests, really!

Darwinbots3 / Re: DB3 Leagues
« on: April 14, 2015, 10:05:01 AM »
It's clear that the conversation is going in a different direction, spike43884, isn't it?

Darwinbots3 / Re: DB3 Leagues
« on: April 12, 2015, 11:51:14 AM »
Yeah, there is boilerplate code for it but I'm just trying to work out how to do it.

Each of these systems are designed so that matches are picked at random, aren't they? You basically want to take a small sample that represents the global population.

Darwinbots3 / Re: DB3 Leagues
« on: April 12, 2015, 10:58:46 AM »
We don't know the elo of each of the 10000 players when we're trying to simulate that, unless we just assume they're all new?

Darwinbots3 / Re: DB3 Leagues
« on: April 12, 2015, 07:25:41 AM »
Here's a quick stab at some python to simulate some rock-paper-scissors type matches with asymmetric numbers of players playing each type.  Right now winrates are high for players with strategies that happen to beat the dominant strategy, as you'd expect.  Later I'm going to try and add in elo and see what it would do.  I found some python packages for it, but I'm feeling too lazy right now to figure it out.

Code: [Select]
import numpy
import skills
import elo

winrates = { }

wintable = numpy.matrix([
[ 0, 1, -1, ],
[-1, 0, 1, ],
[ 1, -1, 0 ]

typenames = [
"rock    ",
"paper   ",

print('type, "score", \t \t winrate')
for i in range(0, 10):
type = numpy.random.randint(0, 4)

if type > 2: type = 2

score = 0
matches = 0
wins = 0

for i in range(0, 10000):
opponent_type = numpy.random.randint(0, 4)
if opponent_type > 2: opponent_type = 2

score = score + wintable[type, opponent_type]
matches = matches + 1
wins = wins + (1 if wintable[type, opponent_type] > 0 else 0)

print(typenames[type], (score/matches), "\t", (wins/matches))
Is this 1 player vs 4 players (including the original player) pitted against each other randomly 10000 times, or 1 player pitted against 10000 players? Just trying to work our how you'd do the elo in the second situation.

Darwinbots3 / Re: DB3 Leagues
« on: April 10, 2015, 02:35:58 PM »
I'm working through the articles on TrueSkill and Glickman right now; they might be doing something more clever.  At the very least they factor in confidence intervals.  But I think, because we can run exactly the rounds we want to and no more, and can choose how the matches are chosen, we can do a lot more global optimizing and a lot less incremental updating.
The confidence decreases over time? This idea could be used to ignore differences between versions so no reruns and bots with a low confidence could be prioritised for a rerun?

In situations of rock-paper-scissors, where there's a (large) margin of players choosing one strategy over another, the flat win rate I mentioned above would artificially inflate for the minority strategy, I think.  Would elo have that same problem?  I think not...  I'd want to see some simulations, probably.
I can't work out your reasoning for this (don't judge my lack of statistical knowledge).

Darwinbots3 / Re: DB3 Leagues
« on: April 10, 2015, 11:38:27 AM »
Your point of the entire tournament with floors having to be repeated is incorrect. A bot is entered in, then it starts only floor one, once floor one is finished it goes to floor 2 if it scored highly in floor one, and that process continues till it hits a floor which it struggles in... This stops the problem of 1 species v 1 species scenario's cropping up as well. Only once a bot is entered does a floor need to be repeated...which also allows all bots on that floor to be re-ranked...Maybe to conserve CPU resources we update the positions every 6 hours instead of every tournament, just storing scores between those intervals...
Yeah, it would be 1v1 but one loss won't mean it will be knocked out completely, it'll just lower its score a little (as it rightly should), which would be brought back up in the situation of 1 species obliterating so many others.

I would err on the side of using a statistical system since I trust the mathematics rather than your reasoning (sorry :().

A specific league for an "all round bot"? I think that's a brilliant idea but I foresee problems with computation times.
Not necessarily, the fights would just have another random attribute, the map and physics. It doesn't have to take more computation time.
So are you saying F1 should be a "all round" or it would be different?

I expect fights not to have a definite win/lose like in db2. Continuing till you hit 95% confidence. But let the rating system take care of it, so a fight is just one fight.
Yeah, I agree that it will probably be the same and that the rating system will take care of it.

Darwinbots3 / Re: DB3 Leagues
« on: April 10, 2015, 09:26:23 AM »
I assume everyone naming Elo means a statistical model instead of just Elo. From a quick search Glicko, TrueSkill and Elo are the ones where libraries are plenty available.

Trueskill has the advantage it could rate "free for all" fights. Which may be handy for newer bots to quickly rise on the league table.
I suppose I do. I was reading about a few of them earlier and which statistical system we use would be a decision we'd have to make.

Also how about multiple fight maps, size, shapes and different physics. Means a bot need to survive in different environments. A all round bot.
A specific league for an "all round bot"? I think that's a brilliant idea but I foresee problems with computation times.
A round robin-like for the top bots seems logically. Might enforce a higher confidence/reliability level in a rating model for the top bots to create it naturally. Not sure if it needs to happen often, once in place positions would be rather static. Which has the advantage to extend the round robin more down.
Prehaps a system where, when a new bot reaches a certain rating (possibly above the worst bot in the "top league"), it can be entered into the "top league" and pitted against each one of the bots and then placed (or not placed) in the league accordingly? Unless that is what you were trying to say?

Darwinbots3 / Re: DB3 Leagues
« on: April 10, 2015, 06:57:23 AM »
I like the idea of using the Elo system.

There are possibly issues of elo inflation to contend with and bots doing better/worse on different versions, but those are similar to the issues real elo systems face, and we have the advantage that bots don't age or really change much over time (except for the issues around different versions).
The bots shouldn't be powered differently over shorter periods of time, only over a longer period of time. Perhaps the concepts of a season can be introduced (after an agreed number of versions or periodically) to help prevent problems between versions. This might reduce the effects of deflation. However, I don't believe that deflation is too much of a problem since it would probably be only used to compare current bots rather than bots between versions, since a bot is never removed from the rankings or never stops playing (unless the rules of the tournament are changed).

We wouldn't have a problem with bots "avoiding" playing, either.

Would it be sensible to have a round robin tournament (or something similar) periodically for the top n bots to give a clear ranking?

Elo rating im still against, for reasons very clear in some of my bots that I wrote in DB2... Lets take a simple example of my 2 very iconic bots, Dizzy & All_hunter... All_hunter is superbly programmed, and can take out most bots, even some of the top F1 bots when i've pitted it in 1 species v 1 species scenario's but then when its pitted against Dizzy, its obliterated, because All_Hunter spreads out, and doesn't form colonies which allows it to target food across the map, and is a failsafe for cannibots evolving in evolutionary simulations and dizzy just spins it. Hence the name dizzy, it spins its prey... Brilliant against any bot that tries to go solo, because it spins the prey so quickly it actually breaks the eyes (some weird weakness in the code, and some sims they haven't even attacked a specific plant or bot but its eyes go as if its been spinned?) now, currently in Elo rating it'd put Dizzy above all_hunter probably, yet if we pitted Dizzy against a 3rd bot of mine, RBM (russian babies mobilised) it'd be obliterated, yet RBM is easily wiped out by all_hunter. So which one is better? You don't nessisarily save much more CPU cost than if did another type of league, or you'd get really inaccurate readings...

You're forgetting that you're only really comparing these 3 bots together. Where RBM > Dizzy > All_hunter (RBM ? All_hunter) and you aren't taking into account all of the other bots for all of them 00. With enough competitions, the bot should arrive at an appropriate rating. All_hunters rating would be reduced by Dizzy slightly and (if it beats RBM) then its elo would be increased. Elo rating doesn't work well when you're comparing 3 bots that can beat each other but works better when more can be compared.

Darwinbots3 / Re: Command Shortcutting
« on: April 09, 2015, 02:26:45 PM »
That is something that could be completed by the IDE before it is shared, perhaps "export to single file" functionality.

Darwinbots3 / Re: Command Shortcutting
« on: April 09, 2015, 02:19:41 PM »
then an extra folder would be good then you can store .txt files in there and then you can have your alternatives in there

What a great idea!  Let me propose the syntax to define the set of alternatives to look like this:

Code: [Select]
def alternative original

Then you just need some way to copy+paste the contents of one of these text files in to the bot you're writing.  Well, not copy+paste, since you want any changes you make in your alternatives file to be automatically reflected in any bot you write.  So something that lets you specify where the text file lives on disk and the program can automatically copy+paste it in there for you when you load your bot in the program.

How does that sound?

Sharing that bot would become difficult, wouldn't it?

Darwinbots3 / DB3 Leagues
« on: April 09, 2015, 02:02:51 PM »
I assume DB3 will have the concept of leagues. There are a few things to consider when it comes to the leagues. For the most part, these are just musings on my behalf.
  • league design
  • a server side league: an official league or set of leagues that can be computed periodically
    • low run costs - top n winners from previous league
    • central repository - allows users to download all bots more easily; linked to the forum (e.g. whenever a bot is posted a thread is posted)
    • limiting user bot submission - too many bots posted could cause difficulty running leagues

Darwinbots3 / Re: Command Shortcutting
« on: April 09, 2015, 01:53:52 PM »
Yeah, that's what I was thinking. To be honest, I think the subject of alternate variable names is irrelevant, at the moment, since this has only arisen due to "obscure" variable names.

Pages: [1] 2 3 ... 31