Exemple #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello BlackStar-APS!");

            EnvModel.InitializeEnvModel();
            Console.WriteLine(LicensingOP.LicenseInfo);

            USLManagerOP.InitializeUSLOP();                //初始化USL引擎
            USLManagerOP.dsUSL.ReadXml("dsBlackStar.usl"); //读入USL基本配置
            CreateModel();                                 //创建默认型号
            CreateResourcesServices();                     //创建资源服务原型
            CreateSampleCase();                            //创建算例
            RuleOP.InitilizeRuleOP();                      //初始化规则引擎

            CreateAction();                                //创建动作原型
            CreateAvailability();                          //创建可用性
            CreateDemand();                                //创建调度需求
            EnvModel.dsBlackStar.WriteXml("dsBlackStar.bs");

            BlackStar.EventAggregators.EventOP.OverAllNotifyEventAggregator.GetEvent <NotifyEvent>().Subscribe(NotifyEventHandler, true); //监听规则执行完毕事件
            RuleOP.Execute("算例");                                                                                                         //开始执行规则
            while (true)
            {
                Console.ReadLine();
            }
        }
Exemple #2
0
        //将编译好的自定义规则复制到应用目录下,启动程序后,会自动检索并加载,随后即可同内部规则一样使用。
        static void Main(string[] args)
        {
            Console.WriteLine("读入并运行注入规则");
            EnvModel.InitializeEnvModel();                  //初始化型号
            Console.WriteLine(LicensingOP.LicenseInfo);

            USLManagerOP.InitializeUSLOP();                                                                    //初始化USL引擎
            USLManagerOP.dsUSL.ReadXml("dsBlackStar.usl");                                                     //读取USL基本配置
            EnvModel.dsBlackStar.ReadXml("dsBlackStar.bs");                                                    //读取规划方案
            CallRule();                                                                                        //调用注入的规则
            EventOP.OverAllNotifyEventAggregator.GetEvent <NotifyEvent>().Subscribe(NotifyEventHandler, true); //监听规则执行完毕事件
            RuleOP.Execute("算例");                                                                              //执行规则
            while (true)
            {
                Console.ReadLine();
            }
        }
Exemple #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Load a BlackStar solution and solve");
            EnvModel.InitializeEnvModel();                              //第1行,初始化型号
            Console.WriteLine(LicensingOP.LicenseInfo);

            USLManagerOP.InitializeUSLOP();                             //第2行,初始化USL引擎
            USLManagerOP.dsUSL.ReadXml("dsBlackStar.usl");              //第3行,读取USL基本配置
            EnvModel.dsBlackStar.ReadXml("dsBlackStar.bs");             //第4行,读取规划方案


            EventOP.OverAllNotifyEventAggregator.GetEvent <NotifyEvent>().Subscribe(NotifyEventHandler, true); //第5行,监听规则执行完毕事件
            RuleOP.Execute("算例");                                                                              //第6行,执行规则
            while (true)
            {
                Console.ReadLine();
            }
        }
Exemple #4
0
        static void Main(string[] args)
        {
            Console.WriteLine("Load a BlackStar solution and solve");
            EnvModel.InitializeEnvModel();                              //Initialize a model
            Console.WriteLine(LicensingOP.LicenseInfo);

            USLManagerOP.InitializeUSLOP();                             //Initialize the USL engine
            USLManagerOP.dsUSL.ReadXml("dsBlackStar.usl");              //load the usl definitions
            EnvModel.dsBlackStar.ReadXml("dsBlackStar.bs");             //Load the scheduling definitions


            EnvModel.dsBlackStar.dtSampleCase.GetMainSampleCase().InitilizeSampleCase();
            EnvModel.dsBlackStar.dtSampleCase.GetMainSampleCase().dsSampleCase.ReadXml("dsSampleCase.ds");     //Load the SampleCase
            EnvModel.dsBlackStar.dtSampleCase.GetMainSampleCase().dsSnap.ReadXml("dsSnap.ds");                 //Load the snapshot of Samplecase

            EventOP.OverAllNotifyEventAggregator.GetEvent <NotifyEvent>().Subscribe(NotifyEventHandler, true); //Listen to "RuleExecuteComplete" event

            sw.Start();
            RuleOP.Execute("快照");                                     //Execute the rules
            while (true)
            {
                Console.ReadLine();
            }
        }