Exemplo n.º 1
0
 /// <summary>
 ///     Add Organization knowledge
 /// </summary>
 public void AddKnowledge()
 {
     // KnowledgeCount are added for tasks initialization
     // Adn Beliefs are created based on knowledge
     for (var i = 0; i < KnowledgeCount; i++)
     {
         // knowledge length of 10 is arbitrary in this example
         Knowledge.CreateInstance(ArtifactNetwork, Models, i.ToString(), 10);
     }
 }
Exemplo n.º 2
0
        public void Initialize()
        {
            Knowledge.CreateInstance(_mainOrganization.ArtifactNetwork, _mainOrganization.Models, "1", 50);
            _environment.SetOrganization(_mainOrganization);
            _simulation.SetEnvironment(_environment);
            _environment.SetDebug(true);
            var scenario = TimeBasedScenario.CreateInstance(_environment);

            scenario.NumberOfSteps = 10;
            _simulation.AddScenario(scenario);
        }
Exemplo n.º 3
0
        private void tbKnowledgeLength_TextChanged(object sender, EventArgs e)
        {
            try
            {
                var value = byte.Parse(tbKnowledgeLength.Text, CultureInfo.InvariantCulture);
                if (value > Bits.MaxBits)
                {
                    throw new ArgumentOutOfRangeException("Knowledge should be < " + Bits.MaxBits);
                }

                Knowledge.CreateInstance(_mainOrganization.ArtifactNetwork, _mainOrganization.Models, "1", value);
                tbKnowledgeLength.BackColor = SystemColors.Window;
            }
            catch (FormatException)
            {
                tbKnowledgeLength.BackColor = Color.Red;
            }
            catch (OverflowException exception)
            {
                tbKnowledgeLength.BackColor = Color.Red;
                MessageBox.Show(exception.Message);
            }
        }