public SuggestedStrategiesService(IOptionsPlayUow uow, IPredictionAndStdDevService predictionAndStdDevService, IMarketDataService marketDataService, IStrategyService strategyService) : base(uow) { _predictionAndStdDevService = predictionAndStdDevService; _marketDataService = marketDataService; _strategyService = strategyService; }
public static string Cooperation(WorkflowContext context, ExecutingContext executeContext) { string resultTo = String.Empty; Node current = context.Current; AbstractWorkflow workflowService = WorkflowGlobalServiceProvider.Resolve <AbstractWorkflow>(); IWorkflowCooperationService workflowCooperationService = workflowService.NodeService.WorkflowCooperationService; IStrategyService strategyService = (IStrategyService)Utils.CreateInstance(current.Assistant); string instanceID = context.Instance.InstanceID; workflowService.NodeService.WorkflowCooperationService.Persistent(new WorkflowCooperation { NodeID = current.NID, InstanceID = context.Instance.InstanceID, TransitionID = context.TransitionID, CreateTime = DateTime.Now }); IList <WorkflowCooperation> records = workflowCooperationService.Query(instanceID).Where(e => e.NodeID == current.NID).ToList(); executeContext.Result = strategyService.Check(records); if (executeContext.Result) { IWorkflowCooperationDecision workflowCooperationDecision = (IWorkflowCooperationDecision)Utils.CreateInstance(current.Cooperation); resultTo = workflowCooperationDecision.Execute(records); workflowService.NodeService.WorkflowCooperationService.Delete(instanceID, current.NID); } else { workflowService.Actions.ForEach(pluin => pluin.ActionExecute(executeContext)); } return(resultTo); }
/// <summary> /// Creates a new instance of <see cref="SimulationService"/> /// </summary> /// <param name="strategyService"></param> /// <param name="indicatorsService"></param> /// <param name="companyService"></param> /// <param name="priceService"></param> public SimulationService(IStrategyService strategyService, IIndicatorsService indicatorsService, ICompanyService companyService, IPriceService priceService) { _strategyService = strategyService; _indicatorsService = indicatorsService; _companyService = companyService; _priceService = priceService; }
public PlacementsController(IPlacementService placementService, IStrategyService strategyService, ICreativeService creativeService, IMappingEngine mapping) { _placementService = placementService; _strategyService = strategyService; _creativeService = creativeService; _mapping = mapping; }
/// <summary>Initializes a new instance of the <see cref="LevelsViewPresenter"/> class.</summary> /// <param name="view">The view.</param> /// <param name="msgBoxService">The msg box service.</param> /// <param name="fileBrowserService">The file browser service.</param> /// <param name="eventAggregator">The event aggregator.</param> /// <param name="fileManagerService">The file Manager Service.</param> /// <param name="strategyService"></param> public LevelsViewPresenter( ILevelsView view, IMessageBoxService msgBoxService, IFileBrowserService fileBrowserService, IEventAggregator eventAggregator, IFileManagerService fileManagerService, IStrategyService strategyService) { // Wire up our services this.msgBoxService = msgBoxService; this.fileBrowserService = fileBrowserService; this.fileManagerService = fileManagerService; this.eventAggregator = eventAggregator; this.strategyService = strategyService; this.view = view; view.ViewLoad += this.LevelsViewOnViewLoad; view.SelectionChanged += this.LevelsViewOnSelectionChanged; view.LevelDrag += this.OnLevelItemDrag; view.LevelDragDrop += this.OnLevelDragDrop; view.LevelDragEnter += this.OnLevelDragEnter; view.Tree.AllowDrop = true; this.eventAggregator.GetEvent<SaveLevelsMessage>().Subscribe(this.OnSaveLevels); this.eventAggregator.GetEvent<AddLevelMessage>().Subscribe(this.OnAddLevel); this.eventAggregator.GetEvent<RemoveLevelMessage>().Subscribe(this.OnRemoveLevel); this.eventAggregator.GetEvent<OpenPartMessage>().Subscribe(this.OnOpenParts); this.eventAggregator.GetEvent<SaveStrategyMessage>().Subscribe(this.OnSaveStrategyEvent); this.eventAggregator.GetEvent<OpenStrategyMessage>().Subscribe(this.OnLoadStrategyEvent); this.eventAggregator.GetEvent<OpenLevelsMessage>().Subscribe(this.OnOpenLevelsEvent); }
public SimulationService(ISimulationRepository simulationRepository, IPopulationService populationService, IStrategyService strategyService, ISimulationSettingsProvider simulationSettingsProdiver) { _populationService = populationService; _simulationRepository = simulationRepository; _strategyService = strategyService; _simulationSettings = simulationSettingsProdiver.GetSimulationSettings(); }
public PlacementService(IRepositoryAsync <Placement> placementRepositoryAsync, IStrategyService strategyService, ICreativeService creativeService, IClock clock, IBrandscreenContext brandscreenContext) { _placementRepositoryAsync = placementRepositoryAsync; _strategyService = strategyService; _creativeService = creativeService; _clock = clock; _brandscreenContext = brandscreenContext; }
public void test_strategy_manager_as_service() { ChannelFactory <IStrategyService> channelFactory = new ChannelFactory <IStrategyService>(""); IStrategyService proxy = channelFactory.CreateChannel(); test_manager_as_service(proxy as ICommunicationObject, "IStrategyService"); channelFactory.Close(); }
public Village(IDiceService diceService, IStrategyService strategyService, IRules rules) { _diceService = diceService; _strategyService = strategyService; _charactersMap = new Dictionary <EFighterClass, Func <string, Qualification, ICharacter> > { { EFighterClass.Warrior, (name, qualification) => new Warrior(name, qualification, _strategyService, rules) }, { EFighterClass.Ranger, (name, qualification) => new Archer(name, qualification, _strategyService, rules) }, }; }
public StrategyManagerViewModel(ViewModelContext viewModelContext, IStrategyService strategyService) : base(viewModelContext) { this.strategyService = strategyService; AddStrategyCommand = new ViewModelCommand(AddStrategy); DeleteStrategyCommand = new ViewModelCommand(DeleteStrategy); AddStrategySubscriptionCommand = new ViewModelCommand(AddStrategySubscription); DeleteStrategySubscriptionCommand = new ViewModelCommand(DeleteStrategySubscription); DeleteStrategyDependencyCommand = new ViewModelCommand(DeleteStrategyDependency); }
public StrategyManagerViewModel(ViewModelContext viewModelContext, IStrategyService strategyService, IStrategyFileManager strategyFileManager) : base(viewModelContext) { this.strategyService = strategyService; this.strategyFileManager = strategyFileManager; AddStrategyCommand = new ViewModelCommand(AddStrategy); DeleteStrategyCommand = new ViewModelCommand(DeleteStrategy); CloseCommand = new ViewModelCommand(Close); SelectedStrategyViewModels = new ObservableCollection <StrategyViewModel>(); strategyObservableSubscriptions = new Dictionary <string, IDisposable>(); }
public StrategyViewModel(Strategy strategy, IStrategyService strategyService, IStrategyFileManager strategyFileManager, ILoggerFacade logger) : base(logger) { this.strategy = strategy; this.strategyService = strategyService; this.strategyFileManager = strategyFileManager; AddStrategySubscriptionCommand = new ViewModelCommand(AddStrategySubscription); DeleteStrategySubscriptionCommand = new ViewModelCommand(DeleteStrategySubscription); DeleteStrategyDependencyCommand = new ViewModelCommand(DeleteStrategyDependency); AddParameterSchemaCommand = new ViewModelCommand(AddParameterSchema); OnPropertyChanged(string.Empty); }
public PortfolioOrchestrator( IPortfolioManager portfolioManager, IMarketWorkTimeService marketWorkTimeService, IMarketDataProviderQueryable marketDataProviderQueryable, IMarketDataService marketDataService, IStrategyService strategyService, IAccountManager accountManager) { _portfolioManager = portfolioManager; _marketWorkTimeService = marketWorkTimeService; _marketDataProviderQueryable = marketDataProviderQueryable; _marketDataService = marketDataService; _strategyService = strategyService; _accountManager = accountManager; }
/// <summary> /// Initializes a new instance of the <see cref="Accumulator"/> class /// </summary> /// <param name="strategyService"> A service from which the algorithmic strategies are retrieved </param> /// <param name="specificationService"> A service of specifications that the sentence (or path) must satisfy </param> public Accumulator(IStrategyService strategyService, ISpecificationService specificationService) { if (strategyService == null) { throw new ArgumentNullException("strategyService"); } if (specificationService == null) { throw new ArgumentNullException("specificationService"); } this._strategyService = strategyService; this._specificationService = specificationService; }
public StrategiesController(IStrategyService strategyService, IStrategyTargetingService strategyTargetingService, IStrategyTargetingUpdateService strategyTargetingUpdateService, ICampaignService campaignService, IMappingEngine mapping, IClock clock, ICacheManager cacheManager) { _strategyService = strategyService; _strategyTargetingService = strategyTargetingService; _strategyTargetingUpdateService = strategyTargetingUpdateService; _campaignService = campaignService; _mapping = mapping; _clock = clock; _cacheManager = cacheManager; }
public StrategyViewModel(ViewModelContext viewModelContext, IStrategyService strategyService) : base(viewModelContext) { this.strategyService = strategyService; CanConnect = true; IsConnected = false; IsConnecting = false; Notifications = new ObservableCollection <Message>(); RunCommand = new ViewModelCommand(RunStrategy); MonitorCommand = new ViewModelCommand(MonitorStrategy); DisconnectCommand = new ViewModelCommand(Disconnect); StopCommand = new ViewModelCommand(StopStrategy); ClearNotificationsCommand = new ViewModelCommand(ClearNotifications); }
protected void Discuss(WorkflowContext context, Node current, ExecutingContext executeContext, string actorID) { string instanceID = context.Instance.InstanceID; IWorkflowCooperationService workflowCooperationService = workflowService.NodeService.WorkflowCooperationService; IStrategyService strategyService = workflowService.StrategyService; workflowService.NodeService.WorkflowCooperationService.Persistent(new WorkflowCooperation { NID = Guid.NewGuid().ToString(), NodeID = current.NID, InstanceID = context.Instance.InstanceID, TransitionID = context.TransitionID, CreateDateTime = DateTime.Now }); IList <WorkflowCooperation> records = workflowCooperationService.Query(instanceID) .Where(e => e.NodeID == current.NID) .ToList(); executeContext.Result = strategyService.Check(records); if (executeContext.Result) { string to = strategyService.Use().Execute(records); Transition transition = current.Transitions.FirstOrDefault(e => e.NID == to); Node node = workflowService.NodeService.Query(current.InstanceID) .Where(e => e.ID == transition.Destination).FirstOrDefault(); this.Invoke(node, instanceID, transition, new ExecutingContext() { From = current, To = node, Instance = context.Instance, Data = context.Data, Result = executeContext.Result, Direction = executeContext.Direction }, actorID, context); } else { workflowService.Actions.ForEach(pluin => pluin.ActionExecute(executeContext)); } }
/// <summary>Initializes a new instance of the <see cref="ShellView"/> class.</summary> /// <param name="msgBoxService">The msg Box Service.</param> /// <param name="fileBrowserService">The file Browser Service.</param> /// <param name="eventAggregator">The event Aggregator.</param> /// <param name="operationscommands"></param> /// <param name="levelscommands"></param> /// <param name="fileManagerService"></param> /// <param name="buttonsCommands"></param> /// <param name="strategyService"></param> public ShellView(IMessageBoxService msgBoxService, IFileBrowserService fileBrowserService, IEventAggregator eventAggregator, List<IToolbarCommand> operationscommands, List<IToolbarCommand> levelscommands, IFileManagerService fileManagerService, List<IButtonsCommand> buttonsCommands, IStrategyService strategyService) { this.InitializeComponent(); // Wire up our view presenters var toolbarOperationsView = new ToolbarButtonView { Dock = DockStyle.Top }; var toolbarViewPresenter = new ToolbarViewPresenter(toolbarOperationsView, operationscommands); var toolbarLevelsView = new ToolbarButtonView { Dock = DockStyle.Top }; var toolbarLevelsViewPresenter = new ToolbarViewPresenter(toolbarLevelsView, levelscommands); var buttonView = new ButtonBarView { Dock = DockStyle.Fill }; var buttonViewPresenter = new ButtonBarViewPresenter(buttonView, buttonsCommands); var levelView = new LevelsView { Dock = DockStyle.Fill, Margin = new Padding(5) }; var levelViewPresenter = new LevelsViewPresenter(levelView, msgBoxService, fileBrowserService, eventAggregator, fileManagerService, strategyService); var opsView = new OperationsView { Dock = DockStyle.Fill, Margin = new Padding(5) }; var opsViewPresenter = new OperationsViewPresenter(opsView, msgBoxService, fileBrowserService, eventAggregator, strategyService); // Wire up the views this.buttonBarView = buttonView; this.toolbarOperationsButtonView = toolbarOperationsView; this.toolbarLevelsButtonView = toolbarLevelsView; this.levelsView = levelView; this.operationsView = opsView; this.eventAggregator = eventAggregator; this.eventAggregator.GetEvent<CloseShellMessage>().Subscribe(this.OnCloseShell); // Place the views in the correct regions this.InjectViews(); }
protected Character(string name, Qualification qualification, IStrategyService strategyService, IRules rules) { Name = name; _qualification = qualification; _strategyService = strategyService; _stats = rules.GetStats(_qualification); Id = Guid.NewGuid(); HealthChanged += OnHealthChanged; _conditionMap = new Dictionary <int, EWounds> { { 0, EWounds.Dead }, { (int)(0.1 * _stats.Health), EWounds.Faint }, { (int)(0.2 * _stats.Health), EWounds.ReallyBad }, { (int)(0.3 * _stats.Health), EWounds.Badly }, { (int)(0.5 * _stats.Health), EWounds.Injured }, { (int)(0.7 * _stats.Health), EWounds.SlightlyInjured }, { (int)(0.9 * _stats.Health), EWounds.Scratched }, { _stats.Health, EWounds.Healthy } }; }
public StrategyRunnerViewModel( ViewModelContext viewModelContext, AccountViewModel accountViewModel, SymbolsViewModel symbolsViewModel, OrdersViewModel ordersViewModel, StrategyParametersViewModel strategyParametersViewModel, IStrategyService strategyService, IServerMonitorCache serverMonitorCache, IStrategyAssemblyManager strategyAssemblyManager) : base(viewModelContext) { this.strategyService = strategyService; this.serverMonitorCache = serverMonitorCache; this.strategyAssemblyManager = strategyAssemblyManager; AccountViewModel = accountViewModel; SymbolsViewModel = symbolsViewModel; OrdersViewModel = ordersViewModel; StrategyParametersViewModel = strategyParametersViewModel; CanRun = false; CanMonitor = false; IsConnected = false; IsConnecting = false; Notifications = new ObservableCollection <Message>(); RunCommand = new ViewModelCommand(RunStrategy); MonitorCommand = new ViewModelCommand(MonitorStrategy); DisconnectCommand = new ViewModelCommand(Disconnect); StopCommand = new ViewModelCommand(StopStrategy); ClearNotificationsCommand = new ViewModelCommand(ClearNotifications); ObserveOrders(); ObserveSymbols(); ObserveAccount(); ObserveParameters(); ObserveServerMonitorCache(); }
/// <summary>Initializes a new instance of the <see cref="OperationsViewPresenter"/> class.</summary> /// <param name="view">The view.</param> /// <param name="msgBoxService">The msg box service.</param> /// <param name="fileBrowserService">The file browser service.</param> /// <param name="eventAggregator">The event aggregator.</param> /// <param name="strategyService">The Strategy Service</param> public OperationsViewPresenter(IOperationsView view, IMessageBoxService msgBoxService, IFileBrowserService fileBrowserService, IEventAggregator eventAggregator, IStrategyService strategyService) { // Wire up our services this.msgBoxService = msgBoxService; this.fileBrowserService = fileBrowserService; this.eventAggregator = eventAggregator; this.strategyService = strategyService; this.view = view; view.ViewLoad += this.OperationsViewOnViewLoad; view.SelectionChanged += this.OperationsViewOnSelectionChanged; view.OperationDrag += this.OnOperationItemDrag; view.OperationDragDrop += this.OnOperationDragDrop; view.OperationDragEnter += this.OnOperationDragEnter; view.Tree.AllowDrop = true; // Event subscriptions this.eventAggregator.GetEvent<OperationsLibraryLoadMessage>().Subscribe(this.OnOperationsLibraryLoadEvent); }
public StrategiesController(IStrategyService strategyService) { this._strategyService = strategyService; }
public StrategiesOrchestrator(IStrategyService strategyService) { _strategyService = strategyService; }
/// <summary> /// Creates a new instance of <see cref="StrategiesController"/> /// </summary> /// <param name="strategyService"></param> /// <param name="indicatorsService"></param> public StrategiesController(IStrategyService strategyService, IIndicatorsService indicatorsService) { _strategyService = strategyService; _indicatorsService = indicatorsService; }
public void init() { service = new StrategyService(); }
public StrategiesController(IStrategyService strategyService) { _strategyService = strategyService; }
/// <summary> /// Creates a new instance of <see cref="SimulationsController"/> /// </summary> /// <param name="strategyService"></param> /// <param name="companyService"></param> /// <param name="simulationService"></param> public SimulationsController(IStrategyService strategyService, ICompanyService companyService, ISimulationService simulationService) { _strategyService = strategyService; _companyService = companyService; _simulationService = simulationService; }
public StrategiesController(StrategiesOrchestrator strategiesOrchestrator, IStrategyService strategyService) { _strategiesOrchestrator = strategiesOrchestrator; _strategyService = strategyService; }
public GameController(ApplitactionDbContext dbcontext, IStrategyService service) { _dbcontext = dbcontext; _service = service; }
public Warrior(string name, Qualification qualification, IStrategyService strategyService, IRules rules) : base(name, qualification, strategyService, rules) { _currentStrategy = _strategyService.GetStrategy(EStrategies.Aggressive); }
public StrategyServiceTests() { _service = new StrategyService(_strategyRepository.Object, _indicatorsService.Object); _strategyRepository.Setup(s => s.GetQueryable()) .Returns(_strategies.GetTestAsyncQueryable()); }
public StrategiesApiController(IStrategyService service) { _service = service; }
public CountryController(ApplitactionDbContext dbcontext, IStrategyService service, IUnitBuildingSetterService s2) { _dbcontext = dbcontext; _service = service; _ibserv = s2; }
public Archer(string name, Qualification qualification, IStrategyService strategyService, IRules rules) : base(name, qualification, strategyService, rules) { }
public GameService(IStrategyService strategyService, IGameSettingsProvider gameSettingsProvider) { _strategyService = strategyService; _gameSettings = gameSettingsProvider.GetGameSettings(); }