public void Initialization(Constants.SimulationType simulationType)
        {
            CreateInitializationTables();

            DataSetTools dsTools = new DataSetTools();

            dataSet = dsTools.parseDateSet("c:\\projects\\QWS_Dataset_v2.txt");

            outputLog.AppendText("/*********************** Strategy: " + simulationType.ToString() + " ***********************/\n");

            // Generate tasks
            outputLog.AppendText("Generating Tasks...\n");
            for (int i = 0; i < Constants.NumberOfTasks; i++)
            {
                Task task = new Task(i);
                TaskPool.Add(task);
                FillTaskTable(i, task);
            }

            // Generate communities
            outputLog.AppendText("Generating Communities...\n");
            Community community = new Community(1);

            community.TaskPool = TaskPool;

            // Generate web services
            outputLog.AppendText("Generating " + Constants.NumberOfWebservices + " of Web Services...\n");

            for (int i = 0; i < Constants.NumberOfWebservices; i++)
            {
                WebService ws = new WebService(i);

                switch (simulationType)
                {
                case Constants.SimulationType.AllCompetitive:
                    ws.Type = Constants.WebserviceType.JustCompetitive;
                    break;

                case Constants.SimulationType.AllRandom:
                    ws.Type = Constants.WebserviceType.Random;
                    break;

                case Constants.SimulationType.Coopetitive:
                    ws.Type = Constants.WebserviceType.Coopetitive;
                    break;
                }

                community.AddMember(ws);
                ws.CommunityId = community.Id;
                FillWsTable(i, ws);
            }

            Communities.Add(community);

            // Collaboration Network Initialization
            outputLog.AppendText("Initializating Collaboration Network...\n");
            InitializeNetworks(simulationType);

            // Computing thresholds and probabilities
        }
Example #2
0
        private void InitializeUsingDataTables(Constants.SimulationType simulationType)
        {
            outputLog.AppendText("/*********************** Strategy: " + simulationType.ToString() + " ***********************/\n");

            // Generate tasks
            TaskPool.Clear();
            outputLog.AppendText("Generating Tasks...\n");
            foreach (DataRow drTask in dtTaskInitialValues.Rows)
            {
                Task task = new Task();
                task.Id = Int32.Parse(drTask[colTaskId].ToString());
                task.QoS = double.Parse(drTask[colTaskQoS].ToString());
                task.Fee = Int32.Parse(drTask[colTaskFee].ToString());
                task.Assigned = Boolean.Parse(drTask[colTaskAssigned].ToString());
                TaskPool.Add(task);
            }

            // Generate communities
            outputLog.AppendText("Generating Communities...\n");
            Communities.RemoveAt(0);
            Community community = new Community(1);
            community.TaskPool = TaskPool;

            // Generate web services
            outputLog.AppendText("Generating " + Constants.NumberOfWebservices + " of Web Services...\n");

            community.Members.Clear();
            community.IntraNetworks.Clear();
            foreach (DataRow drWs in dtWsInitialValues.Rows)
            {
                WebService ws = new WebService();
                ws.Id = Int32.Parse(drWs[colWsId].ToString());
                ws.QoS = double.Parse(drWs[colWsQoS].ToString());
                ws.GrowthFactor = double.Parse(drWs[colWsGrowthFactor].ToString());
                ws.Reputation = double.Parse(drWs[colWsReputation].ToString());
                ws.Budget = Int32.Parse(drWs[colWsBudget].ToString());
                switch (simulationType)
                {
                    case Constants.SimulationType.AllCompetitive:
                        ws.Type = Constants.WebserviceType.JustCompetitive;
                        break;
                    case Constants.SimulationType.AllRandom:
                        ws.Type = Constants.WebserviceType.Random;
                        break;
                    case Constants.SimulationType.Coopetitive:
                        ws.Type = Constants.WebserviceType.Coopetitive;
                        break;
                }
                ws.CommunityId = Int32.Parse(drWs[colCmId].ToString());

                ws.NetworkId = Int32.Parse(drWs[colWsNetwork].ToString());

                community.AddMember(ws);
            }

            Communities.Add(community);

            // Collaboration Network Initialization
            outputLog.AppendText("Initializating Collaboration Network...\n");
            InitializeNetworksUsingDataTable();
        }
Example #3
0
        public void Initialization(Constants.SimulationType simulationType)
        {
            CreateInitializationTables();

            DataSetTools dsTools = new DataSetTools();
            dataSet = dsTools.parseDateSet("c:\\projects\\QWS_Dataset_v2.txt");

            outputLog.AppendText("/*********************** Strategy: " + simulationType.ToString() + " ***********************/\n");

            // Generate tasks
            outputLog.AppendText("Generating Tasks...\n");
            for (int i = 0; i < Constants.NumberOfTasks; i++)
            {
                Task task = new Task(i);
                TaskPool.Add(task);
                FillTaskTable(i, task);
            }

            // Generate communities
            outputLog.AppendText("Generating Communities...\n");
            Community community = new Community(1);
            community.TaskPool = TaskPool;

            // Generate web services
            outputLog.AppendText("Generating " + Constants.NumberOfWebservices + " of Web Services...\n");

            for (int i = 0; i < Constants.NumberOfWebservices; i++)
            {
                WebService ws = new WebService(i);

                switch (simulationType)
                {
                    case Constants.SimulationType.AllCompetitive:
                        ws.Type = Constants.WebserviceType.JustCompetitive;
                     break;
                    case Constants.SimulationType.AllRandom:
                        ws.Type = Constants.WebserviceType.Random;
                     break;
                    case Constants.SimulationType.Coopetitive:
                        ws.Type = Constants.WebserviceType.Coopetitive;
                     break;
                }

                community.AddMember(ws);
                ws.CommunityId = community.Id;
                FillWsTable(i, ws);
            }

            Communities.Add(community);

            // Collaboration Network Initialization
            outputLog.AppendText("Initializating Collaboration Network...\n");
            InitializeNetworks(simulationType);

            // Computing thresholds and probabilities
        }
Example #4
0
        private void InitializeUsingDataTables(Constants.SimulationType simulationType)
        {
            outputLog.AppendText("/*********************** Strategy: " + simulationType.ToString() + " ***********************/\n");

            // Generate tasks
            TaskPool.Clear();
            outputLog.AppendText("Generating Tasks...\n");
            foreach (DataRow drTask in dtTaskInitialValues.Rows)
            {
                Task task = new Task();
                task.Id       = Int32.Parse(drTask[colTaskId].ToString());
                task.QoS      = double.Parse(drTask[colTaskQoS].ToString());
                task.Fee      = Int32.Parse(drTask[colTaskFee].ToString());
                task.Assigned = Boolean.Parse(drTask[colTaskAssigned].ToString());
                TaskPool.Add(task);
            }

            // Generate communities
            outputLog.AppendText("Generating Communities...\n");
            Communities.RemoveAt(0);
            Community community = new Community(1);

            community.TaskPool = TaskPool;

            // Generate web services
            outputLog.AppendText("Generating " + Constants.NumberOfWebservices + " of Web Services...\n");

            community.Members.Clear();
            community.IntraNetworks.Clear();
            foreach (DataRow drWs in dtWsInitialValues.Rows)
            {
                WebService ws = new WebService();
                ws.Id           = Int32.Parse(drWs[colWsId].ToString());
                ws.QoS          = double.Parse(drWs[colWsQoS].ToString());
                ws.GrowthFactor = double.Parse(drWs[colWsGrowthFactor].ToString());
                ws.Reputation   = double.Parse(drWs[colWsReputation].ToString());
                ws.Budget       = Int32.Parse(drWs[colWsBudget].ToString());
                switch (simulationType)
                {
                case Constants.SimulationType.AllCompetitive:
                    ws.Type = Constants.WebserviceType.JustCompetitive;
                    break;

                case Constants.SimulationType.AllRandom:
                    ws.Type = Constants.WebserviceType.Random;
                    break;

                case Constants.SimulationType.Coopetitive:
                    ws.Type = Constants.WebserviceType.Coopetitive;
                    break;
                }
                ws.CommunityId = Int32.Parse(drWs[colCmId].ToString());

                ws.NetworkId = Int32.Parse(drWs[colWsNetwork].ToString());

                community.AddMember(ws);
            }

            Communities.Add(community);

            // Collaboration Network Initialization
            outputLog.AppendText("Initializating Collaboration Network...\n");
            InitializeNetworksUsingDataTable();
        }