rorshi commited on
Commit
6760670
·
1 Parent(s): 1a3c349

step 7: 감정 종류별 positive 영향 수정

Browse files
Files changed (2) hide show
  1. npc_social_network/npc/npc_base.py +2 -2
  2. test.ipynb +3 -3
npc_social_network/npc/npc_base.py CHANGED
@@ -109,8 +109,8 @@ class NPC:
109
  # 감정 종류별 base 수정
110
  if emotion in positive_emotions:
111
  base += 2.0
112
- # 긍정 감정은 positive = True일 때만 +로 반영
113
- return base if positive else -base
114
  elif emotion in negative_emotions:
115
  base += 3.0
116
  # 부정 감정은 positive = False일 때만 -로 반영, positive = True일 경우 최소한으로 영향
 
109
  # 감정 종류별 base 수정
110
  if emotion in positive_emotions:
111
  base += 2.0
112
+ # 긍정 감정은 positive = True일 때만 +로 반영, positive = False일 경우 최소한으로 영향
113
+ return base if positive else 0.0
114
  elif emotion in negative_emotions:
115
  base += 3.0
116
  # 부정 감정은 positive = False일 때만 -로 반영, positive = True일 경우 최소한으로 영향
test.ipynb CHANGED
@@ -2852,7 +2852,7 @@
2852
  },
2853
  {
2854
  "cell_type": "code",
2855
- "execution_count": null,
2856
  "id": "9638a156",
2857
  "metadata": {},
2858
  "outputs": [
@@ -2860,7 +2860,7 @@
2860
  "name": "stdout",
2861
  "output_type": "stream",
2862
  "text": [
2863
- "로다와의 관계 점수: 15.0\n",
2864
  "로다와의 관계 설명: 호감 있음\n"
2865
  ]
2866
  }
@@ -2873,7 +2873,7 @@
2873
  "npc2 = NPC(name=\"로다\", job=\"blacksmith\", path=[(0,1)], image=None)\n",
2874
  "\n",
2875
  "npc1.interact_with(\"로다\", emotion=\"joy\", positive=True)\n",
2876
- "npc1.interact_with(\"로다\", emotion=\"anger\", positive=False)\n",
2877
  "\n",
2878
  "print(\"로다와의 관계 점수:\", npc1.relationships.get_relationship(\"로다\"))\n",
2879
  "print(\"로다와의 관계 설명:\", npc1.get_relationship_description(\"로다\"))"
 
2852
  },
2853
  {
2854
  "cell_type": "code",
2855
+ "execution_count": 2,
2856
  "id": "9638a156",
2857
  "metadata": {},
2858
  "outputs": [
 
2860
  "name": "stdout",
2861
  "output_type": "stream",
2862
  "text": [
2863
+ "로다와의 관계 점수: 7.0\n",
2864
  "로다와의 관계 설명: 호감 있음\n"
2865
  ]
2866
  }
 
2873
  "npc2 = NPC(name=\"로다\", job=\"blacksmith\", path=[(0,1)], image=None)\n",
2874
  "\n",
2875
  "npc1.interact_with(\"로다\", emotion=\"joy\", positive=True)\n",
2876
+ "npc1.interact_with(\"로다\", emotion=\"anger\", positive=True)\n",
2877
  "\n",
2878
  "print(\"로다와의 관계 점수:\", npc1.relationships.get_relationship(\"로다\"))\n",
2879
  "print(\"로다와의 관계 설명:\", npc1.get_relationship_description(\"로다\"))"