Esempio n. 1
0
        static void Main(string[] args)
        //args[0] optimizer key
        //OMR -OnlyMoveAndRotate
        {
            //Console.WriteLine("paste description");

            string description = Console.ReadLine();
            // string description = File.ReadAllText("/Users/denis/Downloads/part-1-initial/prob-001.desc").Trim();
            var parser = new Parser(description);
            var mine   = parser.ConfigMine();

            string optKey = string.Empty;

            if (args?.Length != 0)
            {
                optKey = args[0];
            }

            var optimizer = OptimizerFactory.CreateOptimizer(optKey);
            var executer  = new Executer(mine, optimizer);

            Console.WriteLine(executer.PrintActionSequence());

            Console.ReadLine();
        }
Esempio n. 2
0
 public PlcDataMapper(int pduSize,
                      ReadOperation readEventHandler,
                      WriteOperation writeEventHandler,
                      UpdateMonitoring updateHandler,
                      ReadBlockInfo blockInfoHandler,
                      OptimizerType optimizer = OptimizerType.Block)
 {
     PduSize            = pduSize;
     _readEventHandler  = readEventHandler;
     _writeEventHandler = writeEventHandler;
     _updateHandler     = updateHandler;
     _blockInfoHandler  = blockInfoHandler;
     Optimizer          = OptimizerFactory.CreateOptimizer(optimizer);
     ReadDataBlockSize  = pduSize - _readDataHeaderLength;
     if (ReadDataBlockSize <= 0)
     {
         ExceptionThrowHelper.ThrowInvalidPduSizeException(_readDataHeaderLength);
     }
     PlcMetaDataTreePath.CreateAbsolutePath(PlcObjectResolver.RootNodeName);
 }