# from ...Narsese import Compound

# def compound_remove_components

from typing import Union
from .TemporalFunctions import eternalize, project
from ..Budget import Budget
from ..Truth import Truth
from copy import deepcopy
# import Config, Global
from math import sqrt

def truth_to_quality(truth: Truth) -> float:
    return max(truth.e, (1 - truth.e)*0.75); 
    
def distribute_budget_among_links(budget: Budget, n_links: int) -> Budget:
    return Budget(budget.priority/sqrt(n_links), budget.durability, budget.quality)
