Documentation
¶
Index ¶
- Constants
- Variables
- func GetCurrentTimestamp() int64
- func NewCoreError(message string) error
- func NewCoreErrorWithCode(code ErrorCode, message string) error
- func WrapCoreError(err error, code ErrorCode, message string) error
- type BaseFlow
- func (bf *BaseFlow) AddObserver(observer FlowObserver)
- func (bf *BaseFlow) AdjustDirection(direction *FlowDirection) error
- func (bf *BaseFlow) AdjustEnergy(delta float64) error
- func (bf *BaseFlow) GetEnergy() float64
- func (bf *BaseFlow) GetState() FlowState
- func (bf *BaseFlow) Initialize(ctx context.Context) error
- func (bf *BaseFlow) StartFlow(ctx context.Context) error
- func (bf *BaseFlow) StopFlow(ctx context.Context) error
- func (bf *BaseFlow) Transform(ctx context.Context, newState FlowState) error
- type CoreError
- type Correlator
- type CorrelatorConfig
- type CycleManager
- type CycleState
- type EnergyFlow
- type EnergyNetwork
- func (en *EnergyNetwork) AddNode(id string, capacity float64) error
- func (en *EnergyNetwork) GetBalance() float64
- func (en *EnergyNetwork) GetNodeEnergy(id string) (float64, error)
- func (en *EnergyNetwork) GetTotalEnergy() float64
- func (en *EnergyNetwork) Initialize() error
- func (en *EnergyNetwork) UpdateFlow(from, to string, amount float64) error
- type EnergySystem
- func (es *EnergySystem) Convert(from, to EnergyType, amount float64) (float64, error)
- func (es *EnergySystem) GetBalance() float64
- func (es *EnergySystem) GetEnergy(typ EnergyType) float64
- func (es *EnergySystem) GetEnergyState() map[string]float64
- func (es *EnergySystem) GetTotalEnergy() float64
- func (es *EnergySystem) String() string
- func (es *EnergySystem) TransformEnergy(energyMap map[EnergyType]float64) error
- type EnergyType
- type ErrorCode
- type Field
- func (f *Field) ApplyYinYangSeparation(yinRatio float64) error
- func (f *Field) CalculateFieldGradient(position Vector3D) Vector3D
- func (f *Field) CalculateFieldStrength(position Vector3D) float64
- func (f *Field) CalculateInterference(other *Field, position Vector3D) float64
- func (f *Field) Evolve() error
- func (f *Field) GetStrength() float64
- func (f *Field) GetUniformity() float64
- func (f *Field) Initialize() error
- func (f *Field) Reset() error
- func (f *Field) SetPhase(phase float64) error
- func (f *Field) SetStrength(strength float64) error
- func (f *Field) Update(phase float64) error
- type FieldType
- type Flow
- type FlowConfig
- type FlowDirection
- type FlowEvent
- type FlowObserver
- type FlowPhysics
- type FlowSource
- type FlowState
- type ForceField
- type Harmonizer
- type HarmonyState
- type Interaction
- func (i *Interaction) GetCoherence() float64
- func (i *Interaction) GetEnergy() float64
- func (i *Interaction) GetStrength() float64
- func (i *Interaction) GetType() InteractionType
- func (i *Interaction) Initialize() error
- func (i *Interaction) Reset() error
- func (i *Interaction) SetCoupling(coupling float64) error
- func (i *Interaction) Update(state1, state2 *QuantumState) error
- type InteractionType
- type NetworkNode
- type QuantumPattern
- type QuantumState
- func (qs *QuantumState) AddEnergy(deltaE float64) error
- func (qs *QuantumState) Collapse()
- func (qs *QuantumState) Evolve(pattern QuantumPattern) error
- func (qs *QuantumState) GetCoherence() float64
- func (qs *QuantumState) GetEnergy() float64
- func (qs *QuantumState) GetEntropy() float64
- func (qs *QuantumState) GetPhase() float64
- func (qs *QuantumState) GetProbability() float64
- func (qs *QuantumState) Initialize() error
- func (qs *QuantumState) Reset() error
- func (qs *QuantumState) SetEnergy(energy float64) error
- func (qs *QuantumState) SetPhase(phase float64) error
- func (qs *QuantumState) SetProbability(p float64) error
- func (qs *QuantumState) String() string
- func (qs *QuantumState) Update() error
- type ResonanceState
- type Resonator
- type ResonatorConfig
- type Vector3D
Constants ¶
const ( MinFlowRate = 0.0 // 最小流动率 MaxFlowRate = 1.0 // 最大流动率 DefaultCapacity = 100.0 // 默认容量 )
EnergyNetworkConstants 能量网络常数
const ( MinEnergy = 0.0 // 最小能量 MaxEnergy = 1000.0 // 最大能量 EntropyFactor = 0.01 // 熵增因子 DissipationRate = 0.05 // 能量耗散率 DefaultBalance = 1.0 // 默认平衡度 )
能量系统常量
const ( // 场强度限制 MinFieldStrength = 0.0 MaxFieldStrength = 100.0 // 相互作用常数 InteractionConstant = 8.987551787e9 // 库仑常数 GravityConstant = 6.67430e-11 // 引力常数 // 场的特征尺度 DefaultGridSize = 32 // 默认场网格大小 MinWaveLength = 1e-10 // 最小波长(m) MaxWaveLength = 1e3 // 最大波长(m) )
场的基本常数
const ( G = 9.80665 // 重力加速度 (m/s²) StdTemperature = 298.15 // 标准温度 (K) StdPressure = 101.325 // 标准大气压 (kPa) StdDensity = 1.0 // 标准密度 (kg/m³) SpecificHeat = 4186.0 // 比热容 J/(kg·K) BoltzmannConst = 1.380649e-23 // 玻尔兹曼常数 PlanckConst = 6.62607015e-34 // 普朗克常数 )
定义常量
const ( MinCoupling = 0.0 // 最小耦合强度 MaxCoupling = 1.0 // 最大耦合强度 DefaultCoupling = 0.5 // 默认耦合强度 )
InteractionConstants 相互作用常数
const ( // 演化模式常量 PatternIntegrate QuantumPattern = "integrate" // 整合模式 PatternSplit QuantumPattern = "split" // 分裂模式 PatternCycle QuantumPattern = "cycle" // 循环模式 PatternBalance QuantumPattern = "balance" // 平衡模式 // 量子态常量 MaxProbability = 1.0 MinProbability = 0.0 DefaultPhase = 0.0 TwoPi = 2 * math.Pi DefaultEnergy = 1.0 DefaultEntropy = 0.0 )
Variables ¶
var ( ErrExceedCapacity = errors.New("energy exceeds system capacity") ErrInvalidParameter = errors.New("invalid parameter value") ErrInsufficientEnergy = errors.New("insufficient energy for conversion") )
var (
ErrInvalidQuantumState = errors.New("invalid quantum state")
)
错误定义
var FlowTypeMap = map[EnergyType]string{ PotentialEnergy: "potential", KineticEnergy: "kinetic", ThermalEnergy: "thermal", FieldEnergy: "field", }
FlowTypeMap 能量类型名称映射
Functions ¶
func NewCoreErrorWithCode ¶
NewCoreErrorWithCode 创建带错误码的核心错误
Types ¶
type BaseFlow ¶
type BaseFlow struct {
// contains filtered or unexported fields
}
BaseFlow 提供FlowSource的基础实现
func (*BaseFlow) AddObserver ¶
func (bf *BaseFlow) AddObserver(observer FlowObserver)
AddObserver 添加观察者
func (*BaseFlow) AdjustDirection ¶
func (bf *BaseFlow) AdjustDirection(direction *FlowDirection) error
AdjustDirection 调整方向
func (*BaseFlow) AdjustEnergy ¶
AdjustEnergy 调节能量
func (*BaseFlow) Initialize ¶
Initialize 实现初始化
type CoreError ¶
type CoreError struct { Message string // 错误消息 Code ErrorCode // 错误码 Stack []string // 错误堆栈 // contains filtered or unexported fields }
CoreError 核心错误类型
type Correlator ¶
type Correlator struct {
// contains filtered or unexported fields
}
Correlator 关联器
func (*Correlator) GetCorrelation ¶
func (c *Correlator) GetCorrelation(key string) float64
GetCorrelation 获取关联强度
func (*Correlator) SetCorrelation ¶
func (c *Correlator) SetCorrelation(key string, value float64) error
SetCorrelation 设置关联强度
type CorrelatorConfig ¶
type CorrelatorConfig struct { DecayTime float64 // 关联衰减时间 MaxCorrelation float64 // 最大关联强度 UpdateInterval float64 // 更新间隔 }
CorrelatorConfig 关联器配置
type CycleManager ¶
type CycleManager struct {
// contains filtered or unexported fields
}
CycleManager 周期管理器
type CycleState ¶
type CycleState struct { Index int // 当前周期索引 Phase float64 // 当前相位 Energy float64 // 周期能量 Timestamp time.Time // 时间戳 }
CycleState 周期状态
type EnergyFlow ¶
type EnergyFlow struct { Source string // 源节点 Target string // 目标节点 Amount float64 // 流动量 Timestamp int64 // 时间戳 }
EnergyFlow 能量流动记录
type EnergyNetwork ¶
type EnergyNetwork struct {
// contains filtered or unexported fields
}
EnergyNetwork 能量网络
func (*EnergyNetwork) AddNode ¶
func (en *EnergyNetwork) AddNode(id string, capacity float64) error
AddNode 添加节点
func (*EnergyNetwork) GetNodeEnergy ¶
func (en *EnergyNetwork) GetNodeEnergy(id string) (float64, error)
GetNodeEnergy 获取节点能量
func (*EnergyNetwork) GetTotalEnergy ¶
func (en *EnergyNetwork) GetTotalEnergy() float64
GetTotalEnergy 获取总能量
func (*EnergyNetwork) UpdateFlow ¶
func (en *EnergyNetwork) UpdateFlow(from, to string, amount float64) error
UpdateFlow 更新能量流动
type EnergySystem ¶
type EnergySystem struct {
// contains filtered or unexported fields
}
EnergySystem 能量系统
func (*EnergySystem) Convert ¶
func (es *EnergySystem) Convert(from, to EnergyType, amount float64) (float64, error)
Convert 能量转换
func (*EnergySystem) GetEnergy ¶
func (es *EnergySystem) GetEnergy(typ EnergyType) float64
GetEnergy 获取指定类型的能量
func (*EnergySystem) GetEnergyState ¶
func (es *EnergySystem) GetEnergyState() map[string]float64
GetEnergyState 获取能量状态
func (*EnergySystem) GetTotalEnergy ¶
func (es *EnergySystem) GetTotalEnergy() float64
getTotalEnergy 获取总能量(无锁)
func (*EnergySystem) TransformEnergy ¶
func (es *EnergySystem) TransformEnergy(energyMap map[EnergyType]float64) error
TransformEnergy 能量形态转换
type EnergyType ¶
type EnergyType uint8
EnergyType 能量类型
const ( PotentialEnergy EnergyType = iota // 势能 - 储存能量 KineticEnergy // 动能 - 运动能量 ThermalEnergy // 热能 - 热力学能量 FieldEnergy // 场能 - 场相关能量 )
type ErrorCode ¶
type ErrorCode string
ErrorCode 错误码类型
const ( // 基础错误 ErrInvalid ErrorCode = "INVALID" // 无效值 ErrRange ErrorCode = "RANGE" // 超出范围 ErrState ErrorCode = "STATE" // 状态错误 ErrInitialize ErrorCode = "INITIALIZE" // 初始化错误 // 量子相关错误 ErrQuantum ErrorCode = "QUANTUM" // 量子态错误 ErrSuperpose ErrorCode = "SUPERPOSE" // 叠加态错误 ErrEntangle ErrorCode = "ENTANGLE" // 纠缠态错误 // 场相关错误 ErrField ErrorCode = "FIELD" // 场错误 ErrPotential ErrorCode = "POTENTIAL" // 势场错误 ErrInteraction ErrorCode = "INTERACTION" // 相互作用错误 // 能量相关错误 ErrEnergy ErrorCode = "ENERGY" // 能量错误 ErrTransform ErrorCode = "TRANSFORM" // 转换错误 ErrConservation ErrorCode = "CONSERVATION" // 守恒错误 )
type Field ¶
type Field struct { // 场的基本属性 Type FieldType // 场类型 Dimension int // 场维度 GridSize int // 网格大小 Boundary []float64 // 边界条件 // 场的物理量 Strength [][]float64 // 场强度分布 Potential [][]float64 // 势能分布 Gradient [][]Vector3D // 梯度分布 // 场的动态特性 WaveNumber float64 // 波数 Frequency float64 // 频率 Phase float64 // 相位 // 相互作用特性 Coupling float64 // 耦合强度 Interaction float64 // 相互作用强度 // 阴阳属性 YinField *Field // 阴性场 YangField *Field // 阳性场 // contains filtered or unexported fields }
Field 场的基本结构
func (*Field) ApplyYinYangSeparation ¶
ApplyYinYangSeparation 应用阴阳分离
func (*Field) CalculateFieldGradient ¶
CalculateFieldGradient 计算场梯度
func (*Field) CalculateFieldStrength ¶
CalculateFieldStrength 计算场强度
func (*Field) CalculateInterference ¶
CalculateInterference 计算场的干涉
type Flow ¶
type Flow struct { ID string // 唯一标识 Energy float64 // 能量值(0-100) State FlowState // 当前状态 Direction *FlowDirection // 流动方向 // contains filtered or unexported fields }
Flow 定义基本流结构
type FlowConfig ¶
type FlowConfig struct { MinEnergy float64 MaxEnergy float64 FlowInterval time.Duration MaxTransforms int }
FlowConfig 流的配置
type FlowDirection ¶
type FlowDirection struct { X float64 // X轴方向分量 Y float64 // Y轴方向分量 Z float64 // Z轴方向分量 Angle float64 // 方向角度(0-360) }
FlowDirection 定义流动方向
type FlowObserver ¶
FlowObserver 观察者接口
type FlowPhysics ¶
type FlowPhysics struct {
// contains filtered or unexported fields
}
FlowPhysics 流体物理特性
func (*FlowPhysics) ApplyYinYangTransformation ¶
func (fp *FlowPhysics) ApplyYinYangTransformation(yinRatio float64) error
ApplyYinYangTransformation 应用阴阳转化
func (*FlowPhysics) CalculateEntropy ¶
func (fp *FlowPhysics) CalculateEntropy() float64
CalculateEntropy 计算熵变
func (*FlowPhysics) CalculateReynoldsNumber ¶
func (fp *FlowPhysics) CalculateReynoldsNumber(characteristicLength float64) float64
CalculateReynoldsNumber 计算雷诺数
func (*FlowPhysics) GetPhysicsState ¶
func (fp *FlowPhysics) GetPhysicsState() map[string]float64
GetPhysicsState 获取物理状态
type FlowSource ¶
type FlowSource interface { // Initialize 初始化流 Initialize(ctx context.Context) error // StartFlow 开始流动 StartFlow(ctx context.Context) error // StopFlow 停止流动 StopFlow(ctx context.Context) error // Transform 状态转换 Transform(ctx context.Context, newState FlowState) error // AdjustEnergy 调节能量 AdjustEnergy(delta float64) error // AdjustDirection 调整方向 AdjustDirection(direction *FlowDirection) error // GetState 获取当前状态 GetState() FlowState // GetEnergy 获取当前能量 GetEnergy() float64 }
FlowSource 定义流的源接口
type ForceField ¶
type ForceField struct {
// contains filtered or unexported fields
}
ForceField 力场定义
type Harmonizer ¶
type Harmonizer struct {
// contains filtered or unexported fields
}
Harmonizer 和谐器
func (*Harmonizer) SetWeight ¶
func (h *Harmonizer) SetWeight(component string, weight float64)
SetWeight 设置分量权重
func (*Harmonizer) UpdateComponent ¶
func (h *Harmonizer) UpdateComponent(component string, value float64)
UpdateComponent 更新分量和谐度
type HarmonyState ¶
HarmonyState 和谐状态
type Interaction ¶
type Interaction struct {
// contains filtered or unexported fields
}
Interaction 相互作用
func (*Interaction) SetCoupling ¶
func (i *Interaction) SetCoupling(coupling float64) error
SetCoupling 设置耦合强度
func (*Interaction) Update ¶
func (i *Interaction) Update(state1, state2 *QuantumState) error
Update 更新相互作用
type InteractionType ¶
type InteractionType uint8
InteractionType 相互作用类型
const ( NoInteraction InteractionType = iota WeakInteraction // 弱相互作用 StrongInteraction // 强相互作用 FieldInteraction // 场相互作用 QuantumInteraction // 量子相互作用 )
type NetworkNode ¶
type NetworkNode struct { ID string // 节点标识 Energy float64 // 节点能量 Flows map[string]float64 // 与其他节点的流动关系 Capacity float64 // 节点容量 }
NetworkNode 网络节点
type QuantumState ¶
type QuantumState struct {
// contains filtered or unexported fields
}
QuantumState 表示一个量子态系统 包含概率幅度、相位以及其他量子特性
func (*QuantumState) AddEnergy ¶
func (qs *QuantumState) AddEnergy(deltaE float64) error
AddEnergy 增加量子态的能量
func (*QuantumState) Evolve ¶
func (qs *QuantumState) Evolve(pattern QuantumPattern) error
Evolve 量子态演化
func (*QuantumState) GetCoherence ¶
func (qs *QuantumState) GetCoherence() float64
GetCoherence 获取量子相干性 相干性与概率幅度和相位的稳定性相关
func (*QuantumState) GetProbability ¶
func (qs *QuantumState) GetProbability() float64
GetProbability 获取概率幅度
func (*QuantumState) SetEnergy ¶
func (qs *QuantumState) SetEnergy(energy float64) error
SetEnergy 设置能量水平
func (*QuantumState) SetPhase ¶
func (qs *QuantumState) SetPhase(phase float64) error
SetPhase 设置量子相位
func (*QuantumState) SetProbability ¶
func (qs *QuantumState) SetProbability(p float64) error
SetProbability 设置概率幅度
type ResonanceState ¶
type ResonanceState struct { Amplitude float64 Frequency float64 Phase float64 Energy float64 Timestamp time.Time }
ResonanceState 共振状态
type Resonator ¶
type Resonator struct {
// contains filtered or unexported fields
}
Resonator 共振器
func (*Resonator) ApplyResonance ¶
func (r *Resonator) ApplyResonance(state1, state2 *QuantumState, energy float64) error
ApplyResonance 在两个量子态之间应用共振效应