From d48a25fe856ce22c390dd1e5c7877ea9a3dc9f38 Mon Sep 17 00:00:00 2001 From: kasinadhsarma Date: Thu, 26 Dec 2024 14:03:45 +0530 Subject: [PATCH] Add target cognition percentage and enhance reporting in cognition progress; update tests for new functionality --- .../consciousness_model.cpython-310.pyc | Bin 19698 -> 19859 bytes models/consciousness_model.py | 22 ++++++---- ...tion_progress.cpython-310-pytest-8.3.4.pyc | Bin 8486 -> 10879 bytes tests/unit/test_cognition_progress.py | 39 +++++++++++++++++- 4 files changed, 52 insertions(+), 9 deletions(-) diff --git a/models/__pycache__/consciousness_model.cpython-310.pyc b/models/__pycache__/consciousness_model.cpython-310.pyc index d157a471f8298920833a3d382abf4c46293be440..9bb4def6775555524a8d4448648cc167e9cbca9d 100644 GIT binary patch delta 3917 zcmb7H3vg6d8Q!zm-6WfL2q9$iSRSF=ya>-g5@?i{JPKGSbPCLJv-f7RWOwg!?hTKy zX<+IDA260P>HwuASd~ZBcD6dxs#81FDpIAzv^aO1vDF!rIu;eN4l;xPckY%AOzVuv z+%Nz6|Ns2wod5jiJ174*#>5F$Y!nswUGx*Gh)0fm{rTd4535NJdMe!or72fvf#%xi zQp(a_^_8-M2>e_JHg_xS>2K$rb=TSfOXU&W3WbeGB5FmAL@25Au%58gh%PqxkFzg} zzxco8^E1DDFd#-7C!`M-OkN zE(S~1H{RRLo^0x|-VoP&V|rLlAg+h|)I`*bA5GsVnZejLQC+saTtxs45#2lnIWG2> zDU~u9hPVA)v8ZWZ6<7Bv zUT30@i-Gc{0vYxRIBgW?%j?5JtlHXr%p4S>7TS*PUlPs%_EBNXAP##g|O0qh*L z$K-}cRa6yZlklWCRk6Ssz?r;wry{^!P2aA##l(LqYu)^`m^f)$JB+l}g9ya>&$?}& z88*0X+PQo5Xr#|Fo&3wS=XXW)guXY)ms}TTCVg|-=P?Bnum+F-tR}F%n%*-IQG9&8 zNLH;Xl@oXdRvD&7T$ohD-V#@<28(k^TS(th`pj;Tn5+z^TsxWOJ>k*vPUd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id)JQ)*Z-1Q;yxK34;X&mVYsw6 z1A!MjnX8}@2w7gNobtz`1+K$?K85fi!U=?v0A4NeymV$ZGvmFR(&XmRb-a;yV zX*Qe5W{)=yU96dQ)vOm+vIAA3;-KAoU%?^8iLS)Pb`kd!{dD3!Z_Dx}?GyWw{vX8S zyNG*Ie`zY~8-ps5Gg#2tl2-XOQBE8Ag5hFNix5#olN5com{m5;DV zXm&I~SZwfN_zitvhs!|!2O7Z+`wfp_jAr&{1=8YM;!~O~gVhx`#Ly^-zEN&1E%sdD zn*?3KKL9{$1ZH0a7kF1w=^<|$=Ft@jhn|W&!k3-hc_MZtzuzx)X)6$!kTs z(5qInD!R&pcs_*iI>L2?G{Q2%+XxpC&I5GAi;eYu_UT?nY~1tP@|xF)96L93-~C5# z!-;2pMeYjC%hQ|y-LLP!okeJ$HC3P4}>fnd_01auW1G_rc74XiU0tpB_-Pc diff --git a/tests/unit/test_cognition_progress.py b/tests/unit/test_cognition_progress.py index 2de821b..7f109a7 100644 --- a/tests/unit/test_cognition_progress.py +++ b/tests/unit/test_cognition_progress.py @@ -137,4 +137,41 @@ def test_stress_condition_large_dataset(self, model): model.optimize_memory_usage() assert len(model.cognition_progress_history) == 100 assert len(model.state_history) == 50 - assert len(model.context_history) == 50 \ No newline at end of file + assert len(model.context_history) == 50 + + def test_report_cognition_progress_with_target(self, model): + model.target_cognition_percentage = 80.0 + metrics = { + 'phi': 0.6, + 'coherence': 0.75, + 'stability': 0.65, + 'adaptability': 0.80, + 'memory_retention': 0.70, + 'emotional_coherence': 0.60, # Below threshold + 'decision_making_efficiency': 0.85 + } + model.calculate_cognition_progress(metrics) + report = model.report_cognition_progress() + assert "Current Cognition Progress: 68.75%" in report + assert "Target Cognition Progress: 80.00%" in report + assert "Emotional Coherence: 60.00%" in report + assert "Areas Needing Improvement:" in report + + def test_report_cognition_progress_no_improvement_needed(self, model): + model.target_cognition_percentage = 70.0 + metrics = { + 'phi': 0.8, + 'coherence': 0.75, + 'stability': 0.85, + 'adaptability': 0.80, + 'memory_retention': 0.90, + 'emotional_coherence': 0.75, # Above threshold + 'decision_making_efficiency': 0.85 + } + model.calculate_cognition_progress(metrics) + report = model.report_cognition_progress() + assert "Current Cognition Progress: 81.00%" in report + assert "Target Cognition Progress: 70.00%" in report + assert "Areas Needing Improvement:" in report + # No areas should be listed as needing improvement + assert not any(metric in report for metric in []), "No metrics should need improvement" \ No newline at end of file