Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form2
- Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- Main()
- End Sub
- Dim listFaits As Collection
- Dim listRegle As Collection
- Public Sub addRegle(Condition As Collection, Fact As Faits)
- Dim Regl As regle
- Regl = New regle
- For Each Obj In listRegle
- Regl.AddCondition(CType(Obj, Faits))
- Next obj
- Regl.FaitFinal(Fact)
- End Sub
- Public Sub addFait(Name As Integer, val As Boolean
- )
- Dim fait As Faits
- fait = New Faits
- fait.Faits("A", True)
- End Sub
- Function ChainageAux(ByVal BR As BR, ByVal F As Faits)
- Dim listeFait As Collection
- listeFait = listFaits
- Return ChainageArriere(listeFait, BR, F)
- End Function
- Public Function ContainsFait(Colle As Collection, Name As String) As Boolean
- Dim tmp As Boolean
- Dim Fact As Faits
- tmp = False
- For Each Fact2 In Colle
- If TypeOf Fact2 Is Faits Then
- Fact = CType(Fact2, Faits)
- If (Fact.Name.Equals(Name)) Then
- tmp = True
- End If
- End If
- Next Fact2
- Return tmp
- End Function
- Function ChainageArriere(ByVal listeFait As Collection, ByVal BR As BR, ByVal F As Faits)
- If ContainsFait(listeFait, F.Name) Then
- Return listeFait
- Else
- Return ChainageArriere2(listeFait, BR, F)
- End If
- End Function
- Function ChainageArriere2(ByVal BF As Collection, ByVal BR As BR, ByVal F As Faits)
- Dim R As BR
- Dim Fact As regle
- For Each Fact2 In BR.EnsembleRegle
- If TypeOf Fact2 Is regle Then
- Fact = CType(Fact2, regle)
- If F.Name Then
- End If
- End If
- Next
- If BR.estVide Then
- Return New Collection
- Else
- For Each Fact3 In BR.EnsembleRegle
- If TypeOf Fact3 Is regle Then
- Fact = CType(Fact3, regle)
- If Fact3.conclusionContains(F) Then
- BR = BR.suppRegle(Fact3)
- For Each Fact4 In BR.EnsembleRegle
- If TypeOf Fact4 Is regle Then
- Fact = CType(Fact4, regle)
- If BF.Contains(Fact4.condition) Then
- BR.suppRegle(Fact4)
- End If
- End If
- Next
- Return Fact3.conclusion()
- End If
- Else
- For Each Fact5 In BR.EnsembleRegle
- If TypeOf Fact5 Is Faits Then
- BF = BF + ChainageArriere(BF, BR, F)
- End If
- Next
- End If
- Next
- End If
- End Function
- Public Sub Main()
- listFaits = New Collection
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement