source: src/main/java/agents/anac/y2014/Aster/SearchBid.java

Last change on this file was 1, checked in by Wouter Pasman, 6 years ago

Initial import : Genius 9.0.0

File size: 1.7 KB
Line 
1package agents.anac.y2014.Aster;
2
3import java.util.ArrayList;
4import java.util.List;
5
6import genius.core.Bid;
7import genius.core.issue.Issue;
8import genius.core.issue.IssueInteger;
9import genius.core.issue.ValueInteger;
10import genius.core.utility.AbstractUtilitySpace;
11
12public class SearchBid {
13 private AbstractUtilitySpace utilitySpace;
14
15 public SearchBid(AbstractUtilitySpace utilitySpace) {
16 this.utilitySpace = utilitySpace;
17 }
18
19 /**
20 * Search Bid for nonlinear ���高速化���ージョン
21 */
22 public ArrayList<Bid> searchOfferingBid(ArrayList<Bid> bidHistory, Bid bid,
23 double bidTarget) throws Exception {
24 List<Issue> issues = utilitySpace.getDomain().getIssues();
25 Bid nextBid = new Bid(bid);
26 IssueInteger lIssueInteger;
27 double nextBidUtility;
28 int issueNumber, issueIndexMin, issueIndexMax;
29
30 for (Issue issue : issues) {
31 lIssueInteger = (IssueInteger) issue;
32 issueNumber = lIssueInteger.getNumber();
33 issueIndexMin = lIssueInteger.getLowerBound();
34 issueIndexMax = lIssueInteger.getUpperBound();
35
36 for (int i = issueIndexMin; i <= issueIndexMax; i++) {
37 nextBid = nextBid.putValue(issueNumber, new ValueInteger(i));
38 nextBidUtility = utilitySpace.getUtility(nextBid);
39
40 // 新��Bid�Target以下�場���下
41 if (nextBidUtility <= bidTarget) {
42 continue;
43 }
44
45 // 新��Bid��在�探索テーブル���れ�追加
46 if (!bidHistory.contains(nextBid)) {
47 Bid newBid = new Bid(nextBid);
48 bidHistory.add(newBid);
49 }
50
51 }
52 nextBid = new Bid(bid); // BidReset
53 }
54
55 return bidHistory;
56 }
57}
Note: See TracBrowser for help on using the repository browser.