bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Bug-gnubg] Gap in guestimated ratings?


From: Ian Shaw
Subject: RE: [Bug-gnubg] Gap in guestimated ratings?
Date: Mon, 27 Jan 2003 09:56:58 -0000


> -----Original Message-----
> From: Joern Thyssen

> > I currently have about 500 FIBS match logs.  Is there a 
> batch procedure
> > to allow gnubg to analyze all of them at one time, 
> hopefully producing a
> > text file as output from each match analysis?
> 
> >From the mail headers I gather you run windows 95. There used to be a
> gnubg-no-gui.exe which is very useful for this purpose.
> 
> You can write a DOS batch file like the following unix shell script:
> 
> #!/bin/sh
> for ff in *.fibs; do
> 
>     $sgf=`echo $ff | sed -e 's/\.fibs/.sgf/g'
> 
>     gnubg t < EOF >> run.log
> set priority idle
> import fibs $ff
> analyse match
> save match $sgf
> show score
> show stat match
> EOF
> 
> done
> 
> Maybe someone can help re-writing this into a DOS batch file?
> 
> >From the produced file run.log we can extract the match 
> length and the
> error rate per decision.
> 
> Jørn

Here is my solution. I haven't used it for a few months, but it should work. 
I'm no batch file programmer, so this may be a most inelegant solution.

I have two batch files, Analyse.bat and AnalyseAll.bat, and a command file 
Analyse.txt. 
Analyse.txt is the commands you want to run. You should add the "show score" 
etc commands here. It is stored in C:\gnubg\commands.
Analyse.bat runs Analyse.txt from the command line and stores the results in a 
file.
AnalyseAll.bat runs Analyse.bat for all files in the C:\gnubg\matches\raw 
directory and store the results in the C:\gnubg\matches\analysed directory. 

You may need to tweak the directories to suit yourself.

----------------

Analyse.txt


load command ImportFile.txt
analyse match
load command SaveFile.txt

----------------

Analyse.bat


echo off
REM Check to see if the filename was entered with or without a .mat extension. 
If so, strip it off.
set filename=%1
set ext=%filename:~-4%
IF %ext%==.mat (set file=%filename:~0,-4%)ELSE set file=%filename%

REM Create command files that GnuBg will load to import the .mat file and save 
it as .sgf once the analysis is complete.
echo import mat matches\raw\%file%.mat > ImportFile.txt
echo save match matches\analysed\%file%.sgf > SaveFile.txt
IF NOT EXIST matches\analysed\%file%.sgf (C:\gnubg\gnubg-no-gui.exe< 
commands\analyse.txt) ELSE echo %file%.mat is already analysed
del ImportFile.txt SaveFile.txt
echo on


----------------

AnalyseAll.bat

FOR %%v IN (matches/raw/*.mat) DO analyse %%v

----------------

--Ian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]