24 package org.lightvoting.simulation.rule;
26 import cern.colt.bitvector.BitVector;
27 import junit.framework.Test;
28 import junit.framework.TestCase;
29 import junit.framework.TestSuite;
31 import java.util.ArrayList;
32 import java.util.List;
68 final List<String> l_alternatives =
new ArrayList<String>();
70 l_alternatives.add(
"POI1" );
71 l_alternatives.add(
"POI2" );
72 l_alternatives.add(
"POI3" );
73 l_alternatives.add(
"POI4" );
74 l_alternatives.add(
"POI5" );
75 l_alternatives.add(
"POI6" );
77 final List<BitVector> l_votes =
new ArrayList<>();
79 final BitVector l_vote1 =
new BitVector( 6 );
80 l_vote1.put( 0, true );
81 l_vote1.put( 1, true );
82 l_vote1.put( 2, true );
83 l_vote1.put( 3, true );
84 l_vote1.put( 4, true );
86 final BitVector l_vote2 = l_vote1.copy();
87 final BitVector l_vote3 = l_vote1.copy();
88 final BitVector l_vote4 = l_vote1.copy();
89 final BitVector l_vote5 = l_vote1.copy();
91 final BitVector l_vote6 =
new BitVector( 6 );
92 l_vote6.put( 3, true );
93 l_vote6.put( 4, true );
94 l_vote6.put( 5, true );
96 l_votes.add( l_vote1 );
97 l_votes.add( l_vote2 );
98 l_votes.add( l_vote3 );
99 l_votes.add( l_vote4 );
100 l_votes.add( l_vote5 );
101 l_votes.add( l_vote6 );
103 final int l_comSize = 3;
105 final BitVector l_bitVector = l_minimaxApproval.applyRuleBV( l_alternatives, l_votes, l_comSize );
106 System.out.println( l_bitVector );
Created by sophie on 09.02.17.
Created by sophie on 10.01.17.
CMinimaxApprovalTest(final String p_testName)
Create the test case.
static Test suite()
Testsuite.
void testApplyRule()
test application of voting rule