SuperISD32
04-07-2018, 16:27
Ciao,
c'è una sfida online su Hola (https://github.com/hola/challenge_haggling) questo 20 luglio, bisogna scrivere un bot in Javascript che duella in trattative commerciali simulate contro altri bot.
L'obiettivo è scrivere il miglior bot che nelle trattative accumula più soldi; i partecipanti che inviano gli script migliori sono premiati fino a 3000$.
Partecipare non costa niente, basta caricare il proprio script qui (https://hola.org/challenges/haggling), il 20 luglio Hola lancerà il torneo mettendo in combattimento tutti i bot registrandone le performace.
Il regolamento è qui: https://github.com/hola/challenge_haggling
Giusto per dare l'idea, un bot d'esempio completo e funzionante:
module.exports = class Agent {
constructor(me, counts, values, max_rounds, log){
this.counts = counts;
this.values = values;
this.rounds = max_rounds;
this.log = log;
this.total = 0;
for (let i = 0; i<counts.length; i++)
this.total += counts[i]*values[i];
}
offer(o){
this.log(`${this.rounds} rounds left`);
this.rounds--;
if (o)
{
let sum = 0;
for (let i = 0; i<o.length; i++)
sum += this.values[i]*o[i];
if (sum>=this.total/2)
return;
}
o = this.counts.slice();
for (let i = 0; i<o.length; i++)
{
if (!this.values[i])
o[i] = 0;
}
return o;
}
};
c'è una sfida online su Hola (https://github.com/hola/challenge_haggling) questo 20 luglio, bisogna scrivere un bot in Javascript che duella in trattative commerciali simulate contro altri bot.
L'obiettivo è scrivere il miglior bot che nelle trattative accumula più soldi; i partecipanti che inviano gli script migliori sono premiati fino a 3000$.
Partecipare non costa niente, basta caricare il proprio script qui (https://hola.org/challenges/haggling), il 20 luglio Hola lancerà il torneo mettendo in combattimento tutti i bot registrandone le performace.
Il regolamento è qui: https://github.com/hola/challenge_haggling
Giusto per dare l'idea, un bot d'esempio completo e funzionante:
module.exports = class Agent {
constructor(me, counts, values, max_rounds, log){
this.counts = counts;
this.values = values;
this.rounds = max_rounds;
this.log = log;
this.total = 0;
for (let i = 0; i<counts.length; i++)
this.total += counts[i]*values[i];
}
offer(o){
this.log(`${this.rounds} rounds left`);
this.rounds--;
if (o)
{
let sum = 0;
for (let i = 0; i<o.length; i++)
sum += this.values[i]*o[i];
if (sum>=this.total/2)
return;
}
o = this.counts.slice();
for (let i = 0; i<o.length; i++)
{
if (!this.values[i])
o[i] = 0;
}
return o;
}
};