-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bench | 7145768 ELO | 4.95 +- 5.55 (95%) SPRT | 10.0+0.05s Threads=1 Hash=8MB LLR | 2.21 (-2.20, 2.20) [-1.50, 4.50] Games | N: 8000 W: 2184 L: 2070 D: 3746 ELO | 2.51 +- 3.25 (95%) SPRT | 60.0+0.3s Threads=1 Hash=64MB LLR | 2.20 (-2.20, 2.20) [-1.50, 4.50] Games | N: 18810 W: 4119 L: 3983 D: 10708
- Loading branch information
Showing
19 changed files
with
192 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
group=ratosh | ||
version=3.0.6 | ||
version=3.0.7 | ||
kotlin_version=1.3.0 | ||
detekt_version=1.0.0.RC6-3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
pirarucu-util/src/main/kotlin/pirarucu/benchmark/BenchmarkApplication.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
pirarucu-util/src/main/kotlin/pirarucu/epd/EpdFileWriter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package pirarucu.epd | ||
|
||
import pirarucu.tuning.ErrorUtil | ||
import pirarucu.util.epd.EpdInfo | ||
import java.io.File | ||
|
||
class EpdFileWriter(private val file: File) { | ||
|
||
constructor(file: String) : this(File(file)) | ||
|
||
fun flush(epdInfoList: List<EpdInfo>) { | ||
if (epdInfoList.isEmpty()) { | ||
return | ||
} | ||
try { | ||
val tempFile = createTempFile() | ||
tempFile.printWriter().use { writer -> | ||
file.forEachLine { line -> | ||
val epdInfo = findPosition(line, epdInfoList) | ||
writer.println( | ||
when { | ||
epdInfo != null -> "${epdInfo.fenPosition} c9 ${Math.round(ErrorUtil.calculateSigmoid(epdInfo.eval))}.0" | ||
else -> line | ||
} | ||
) | ||
} | ||
} | ||
check(file.delete() && tempFile.renameTo(file)) { "failed to replace file" } | ||
} catch (ex: Exception) { | ||
ex.printStackTrace() | ||
} | ||
} | ||
|
||
private fun findPosition(line: String, epdInfoList: List<EpdInfo>): EpdInfo?? { | ||
epdInfoList.forEach { | ||
if (line.contains(it.fenPosition)) { | ||
return it | ||
} | ||
} | ||
return null | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.