static void Main(string[] args) { MatrixAccessor inputContainer; try { inputContainer = new MatrixAccessor(); }catch (Exception ex) { System.Console.WriteLine("Producer cannot open input file"); return; } Dispatcher dispatcher = new Dispatcher(inputContainer); dispatcher.Run(); //int[] m1 = new int[] { 81, 20, 17, 39 }; //var message = new StringBuilder(""); //JsonSerializer serializer = new JsonSerializer(); //using (StringWriter sw = new StringWriter(message)) //{ // serializer.Serialize(sw, m1); //} //using (Client client = new Client()) //{ // client.Call(message.ToString()); //} }
public MQClient(MatrixAccessor container, WorkerTimeLogger logger) { this.logger = logger; assembler = new MatrixAssembler(container); var factory = new ConnectionFactory() { HostName = MQServerConfig.IP, Port = MQServerConfig.PORT, UserName = MQServerConfig.USER, Password = MQServerConfig.USER, VirtualHost = MQServerConfig.VHOST }; connection = factory.CreateConnection(); channel = connection.CreateModel(); channel.QueueDeclare(queue: Queues.ReponseQueue, exclusive: false); channel.QueueDeclare(queue: Queues.NotificationQueue, durable: true, exclusive: false, autoDelete: true, arguments: null); consumer = new EventingBasicConsumer(channel); channel.BasicConsume(queue: Queues.ReponseQueue, noAck: false, consumer: consumer); }
public Matrix(int rowCount, int colCount) { var rnd = new Random(); var matrix = new double[rowCount, colCount]; for (int row = 0; row < rowCount; row++) { for (int col = 0; col < colCount; col++) { var value = Min + (rnd.NextDouble() * (Max - Min)); matrix[row, col] = Math.Round(value, 2); } } _accessor = new MatrixAccessor(matrix); }
static void Main(string[] args) { MatrixAccessor inputContainer; try { inputContainer = new MatrixAccessor(); using (MQClient worker = new MQClient(inputContainer)) { worker.Run(); } } catch (Exception ex) { System.Console.WriteLine("Worker could not load input matrixes"); } }
static void Main(string[] args) { //DependencyFactory factory = new DependencyFactory(); //var serilaize = factory.Container WorkerTimeLogger logger = new WorkerTimeLogger(); MatrixAccessor inputContainer; inputContainer = new MatrixAccessor(); using (MQClient client = new MQClient(inputContainer, logger)) { client.Run(); } string path = Environment.CurrentDirectory + @"\log.txt"; using (StreamWriter sw = new StreamWriter(path)) { logger.SaveLog(sw); } }
public MQClient(MatrixAccessor inputContainer) { worker = new Worker(inputContainer); var factory = new ConnectionFactory() { HostName = MQServerConfig.IP, Port = MQServerConfig.PORT, UserName = MQServerConfig.USER, Password = MQServerConfig.USER, VirtualHost = MQServerConfig.VHOST }; connection = factory.CreateConnection(); channel = connection.CreateModel(); channel.QueueDeclare(queue: Queues.MessageQueue, durable: false, exclusive: false, autoDelete: true, arguments: null); channel.BasicQos(0, 1, false); consumer = new EventingBasicConsumer(channel); channel.BasicConsume(queue: Queues.MessageQueue, noAck: false, consumer: consumer); }
public Matrix(MatrixAccessor accessor) => _accessor = accessor;
public Matrix(double[,] matrix) { _accessor = new MatrixAccessor(matrix); }
// Whether the elements should be accessed in row-major order. // Toggling this is equivalent to transposing the array. //bool rowMajor; public List2(List <T> rowMajorCollection, MatrixAccessor accessor) { collection = rowMajorCollection; this.accessor = accessor; }
public MatrixAssembler(MatrixAccessor container) { this.container = container; }
public Worker(MatrixAccessor inputContainer) { this.inputContainer = inputContainer; id = Guid.NewGuid().ToString(); Console.WriteLine(string.Format("Worker with id {0}, created...", id)); }
public Dispatcher(MatrixAccessor container) { this.container = container; uowGen = new UOWGenerator(container); stopwatch = new Stopwatch(); }
public UOWGenerator(MatrixAccessor container) { this.container = container; }