Exemplo n.º 1
0
def ari():
    t_len = 30
    x_len = 30
    y_len = 30

    atcs = create_all_time_cloudlets(t_len, x_len, y_len)

    print(atcs[3][3][1])
"""

from simulator.model.cloudlet import Cloudlet, create_all_time_cloudlets
from simulator.model.device import Device
from simulator.model.point import Point
from simulator.utility.point import route
from simulator.utility.data import input_data_to_file
from typing import List
import random

cloudlets_type = "plane"

t_len = 30
x_len = 30
y_len = 30
atcs = create_all_time_cloudlets(t_len, x_len, y_len)


devices = []  # type:List[Device]
d_num = 0

setup_roads = [
    # 混雑道路
    (10, Point(0, 10), Point(x_len - 1, 10)),
    (13, Point(0, 13), Point(x_len - 1, 13)),
    (15, Point(0, 15), Point(x_len - 1, 15)),
    (17, Point(0, 17), Point(x_len - 1, 17)),
    (20, Point(0, 20), Point(x_len - 1, 20)),
    (40, Point(10, 0), Point(10, y_len - 1)),
    (43, Point(13, 0), Point(13, y_len - 1)),
    (45, Point(15, 0), Point(15, y_len - 1)),
Exemplo n.º 3
0
d_sur = [3, 8, 13, 7]
#1:5:9
#d_sur = [3, 5, 13, 7]
#1:2:3
ca_num = [0, 0, 0]
app1 = Application(name="1")
app2 = Application(name="2")
app3 = Application(name="3")
app4 = Application(name="4")
app5 = Application(name="5")
t_len = 30
x_len = 30
y_len = 30
app_name = [app1.name, app2.name, app3.name]
c_resource = 200
atcs = create_all_time_cloudlets(t_len, x_len, y_len, r=c_resource)
n1 = 0
i = 0
for x in range(x_len):
    for y in range(y_len):
        for t in range(t_len):

            #atcs[x][y][t].apps_append(app1)
            #i = random.randint(1, 3)
            #if i % 2 == 0:
            if i == 0:
            #n1 = random.randint(1, d_random_num)
            #if n1 % d_sur[0] == 0:
                atcs[x][y][t].apps_append(app1)
                atcs[x][y][t].apps_append(app2)
                ca_num[0] += 1
Exemplo n.º 4
0
from typing import List
import random

cloudlets_type = "plane"  #平面モデルってこと
c_sur = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

ca_num = [0, 0, 0]  #Cloudletサーバの数
app1 = Application(name="1")
app2 = Application(name="2")
app3 = Application(name="3")
t_len = 30  #福永さんが研究で使うと決めた時間
x_len = 30
y_len = 30
app_name = [app1.name, app2.name, app3.name]  #アプリケーションの名前のリスト
c_resource = 200  #各cloudletの所有リソース量
atcs = create_all_time_cloudlets(
    t_len, x_len, y_len, r=c_resource)  #cloudletnoの格子状のモデルと時間軸を設定(3次元リスト)

#3次元リストの中にアプリケーションの情報をセット
#
i = 0
for x in range(x_len):
    for y in range(y_len):
        for t in range(t_len):
            if i == 0:
                #AP1とAP2の実行環境を持つCloudletサーバの設置
                atcs[x][y][t].apps_append(app1)
                atcs[x][y][t].apps_append(app2)
                ca_num[0] += 1
            if i == 1:
                #AP2とAP3の実行環境を持つCloudletサーバの設置
                atcs[x][y][t].apps_append(app2)