RLPark 1.0.0
Reinforcement Learning Framework in Java

LoggerRow.java

Go to the documentation of this file.
00001 package zephyr.plugin.core.api.internal.monitoring.fileloggers;
00002 
00003 import java.io.IOException;
00004 import java.io.Writer;
00005 
00006 public class LoggerRow extends AbstractFileLogger {
00007   public LoggerRow(String filepath) throws IOException {
00008     this(filepath, false);
00009   }
00010 
00011   public LoggerRow(String filepath, boolean temporaryFile) throws IOException {
00012     super(filepath, temporaryFile);
00013   }
00014 
00015   public LoggerRow(Writer writer) {
00016     super(writer);
00017   }
00018 
00019   public void writeLegend(String... labels) {
00020     StringBuilder line = new StringBuilder();
00021     for (String label : labels)
00022       line.append(label + " ");
00023     file.println(line.substring(0, line.length() - 1).toString());
00024   }
00025 
00026   public void writeRow(double... row) {
00027     StringBuilder line = new StringBuilder();
00028     for (Double data : row) {
00029       if (Double.isInfinite(data))
00030         data = Double.NaN;
00031       line.append(data + " ");
00032     }
00033     file.println(line.substring(0, line.length() - 1).toString());
00034   }
00035 }
 All Classes Namespaces Files Functions Variables Enumerations
Zephyr
RLPark