MCPcopy Create free account
hub / github.com/Tong89/smartNode / ContentTask

Class ContentTask

backend/core.py:261–285  ·  view source on GitHub ↗

内容任务 - 带时效性衰减的数据价值模型

Source from the content-addressed store, hash-verified

259# 4. 数据任务类
260# ==========================================
261class ContentTask:
262 """内容任务 - 带时效性衰减的数据价值模型"""
263
264 def __init__(self, task_type):
265 self.type = task_type
266 if task_type in DATA_TYPES:
267 cfg = DATA_TYPES[task_type]
268 self.beta = cfg['beta']
269 self.base_value = cfg['base_value']
270 else:
271 params = {
272 'SAR': (0.15, 100.0),
273 'OPTICAL': (0.05, 80.0),
274 'IOT': (0.001, 40.0),
275 'CONTROL': (0.5, 150.0),
276 'INFRARED': (0.03, 70.0),
277 'COMM': (0.02, 60.0)
278 }
279 self.beta, self.base_value = params.get(task_type, (0.02, 60.0))
280 self.creation_time = 0
281
282 def get_dynamic_value(self, current_time):
283 """计算当前时刻的数据价值"""
284 dt = current_time - self.creation_time
285 return self.base_value * math.exp(-self.beta * dt)
286
287
288# ==========================================

Callers 1

_make_taskFunction · 0.90

Calls

no outgoing calls

Tested by 1

_make_taskFunction · 0.72