Exemple #1
0
        public virtual void removeRobot(RobotName robotName)
        {
            File file   = createFileForName(robotName);
            bool result = file.delete();

            if (!result)
            {
                throw new DAOException("Unable to remove file " + file.AbsolutePath);
            }
        }
Exemple #2
0
 public virtual RobotName[] listRobotNames()
 {
     string[]    files = listFiles(robotsPath);
     RobotName[] names = new RobotName[files.Length];
     for (int i = 0; i < files.Length; i++)
     {
         string longString = files[i].Substring(0, files[i].IndexOf('.'));
         names[i] = new RobotName(Convert.ToInt64(longString));
     }
     return(names);
 }
Exemple #3
0
 public RobotInfo(Robot robot)
 {
     name              = new RobotName(robot.Name.Name);
     weight            = robot.Weight;
     lastChildOutcomes = robot.OutcomesAtLastChild;
     totalChildren     = robot.TotalChildren;
     length            = robot.Length;
     totalPredictions  = robot.TotalPredictions;
     totalOutcomes     = robot.TotalOutcomes;
     bias              = robot.Bias;
 }
Exemple #4
0
        public override bool Equals(object o)
        {
            if (this == o)
            {
                return(true);
            }
            if (o == null || this.GetType() != o.GetType())
            {
                return(false);
            }
            RobotName that = (RobotName)o;

            return(name == that.Name);
        }
 public virtual void removeRobot(RobotName robotName)
 {
     dao.removeRobot(robotName);
 }
 public virtual Robot getRobot(RobotName name)
 {
     return(dao.getRobotByName(name));
 }
 public virtual void removeRobot(RobotName robotName)
 {
     map.Remove(robotName);
 }
 public virtual Robot getRobotByName(RobotName name)
 {
     return(map[name]);
 }
Exemple #9
0
        public virtual Robot getRobotByName(RobotName name)
        {
            File file = createFileForName(name);

            return(getRobotFromFile(file));
        }
Exemple #10
0
 private File createFileForName(RobotName name)
 {
     return(new File(robotsPath + File.separator + name.ToString() + FILE_EXTENSION));
 }