# Teste 2
Condições inicias:
```python
subjects_and_classes1 = {"LPOO": 2,"TCOM": 1,"MDIS": 1,"PLOG": 1}
subject_targets1 = {"LPOO": [2,3],"TCOM": [4,5]}
subject_give_ins1 = {"MDIS": [2,3],"PLOG": [4,5]}
s1 = Student(201800175, subjects_and_classes1, subject_targets1, subject_give_ins1, {})
subjects_and_classes2 = {"LPOO": 3, "TCOM": 7, "MDIS": 1, "PLOG": 1, "SINF": 1}
subject_targets2 = {"MDIS": [1]}
subject_give_ins2 = {"LPOO": [3,7], "SINF": [2,4,1,7]}
s2 = Student(201800149, subjects_and_classes2, subject_targets2, subject_give_ins2, {})
s1.add_buddy("MDIS", [201800149])
s2.add_buddy("LPOO",[201800175])
s2.add_buddy("PLOG",[201800175])
```
_OBS:_ O teste foi feito de forma que não haja conflito de horários.
## Givins
Se a aula estiver em `subject_targets1` ela é analisada.
```python
if j in i.subject_give_ins.keys():
if i.subjects_and_classes[j] in i.subject_give_ins[j]:
score -= 3 #if a class was abdicated
i.givin = True #Flag--
else:
score += 5
```
`j` = nome da aula. Ex: 'TCOM'
- Houve givins do aluno 1 em nenhuma materia. `Score = 10`
- Houve givins do aluno 2 em LPOO e SINF. `Score - 6 = 4`
`Score final: 4`
## Target
Se determinada aula estiver em `subject_targets` ela é analisada.
```python
#checking target class
for position, j in enumerate(i.subjects_and_classes):
if j in i.subject_targets.keys():
if i.subjects_and_classes[j] in i.subject_targets[j]:
score += 40 #if the person got the target class
i.target = True #Flag--
print("Target", score)
else:
score -= 30
`````
`Score atual = 4`
- O aluno 1 conseguiu trocar 1 materia de 2 requisitadas. `Score+40-30 = 14`
- O aluno 2 conseguiu trocar 1 materia de 1 requisitada. `Score+40 = 54`
`Score final = 54`
## Buddies
```python
for numbers in set(list(i.buddies.values())):
for classes in set(list(i.buddies.keys())):
if i.subjects_and_classes[classes] == self.students[numbers].subjects_and_classes[classes]:
score += 30 #the person is at the same class of his friend
i.alone = False #Flag--
print("Buddy Score:", score)
else:
score -= 20
```
- O aluno 1 quer ficar com o aluno 2 em MDIS e conseguiu. `Score + 30 = 84`
- O aluno 2 quer ficar com o aluno 1 em LPOO e PLOG. Só conseguiu em PLOG. `Score + 30 - 20 = 94`
`Score final = 94`