- Timestamp:
- 01/08/11 14:28:59 (14 years ago)
- Location:
- branches/OKBJavaConnector/HLOKBWebClient/src/main/java/at/hl/okb
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OKBJavaConnector/HLOKBWebClient/src/main/java/at/hl/okb/impl/ECJ19ConnectorImpl.java
r5252 r5254 6 6 import java.util.List; 7 7 import java.util.Map; 8 import java.util.Set; 8 9 9 10 import com.sun.codemodel.writer.PrologCodeWriter; … … 41 42 Long algorithmId = okbClient.getAlgorithmId(algorithmName, platformId); 42 43 if (algorithmId == null) 43 throw new Exception("Algorithm " + algorithmName + " for Platform " + platformName + " not found!");44 throw new Exception("Algorithm " + algorithmName + " for Platform " + platformName + " not found!"); 44 45 45 46 Long problemId = okbClient.getProblemId(problemName); … … 55 56 // TODO Auto-generated method stub 56 57 58 Set<String> missingParamSet = algoParams.keySet(); 59 missingParamSet.removeAll(okbClient.getAlgorithmParameterMap(state.getAlgorithmId()).keySet()); 60 61 //fehlende Param Anlegen 62 63 okbClient.createMissingAlgoParams(state.getAlgorithmId(), missingParamSet); 57 64 58 65 //create Experiment if algoparams not exists in HL and problemparams not exits (in HL) -
branches/OKBJavaConnector/HLOKBWebClient/src/main/java/at/hl/okb/wsclient/OKBServiceClient.java
r5249 r5254 8 8 import java.util.List; 9 9 import java.util.Map; 10 import java.util.Set; 11 12 import javax.xml.bind.JAXBElement; 10 13 11 14 import at.hl.wsclient.okb.Algorithm; 12 15 import at.hl.wsclient.okb.AlgorithmClass; 16 import at.hl.wsclient.okb.AlgorithmData; 13 17 import at.hl.wsclient.okb.AlgorithmParameter; 14 18 import at.hl.wsclient.okb.ArrayOfAlgorithmParameter; … … 102 106 } 103 107 104 // public Map<String, ECJDataTypeEnum> getAlgorithParameter(Long 105 // algorithmId) { 106 // Map<String, AlgorithmParameter> returnMap = new HashMap<String, 107 // AlgorithmParameter>(); 108 // 109 // AlgorithmData algoData = port.getAlgorithmData(algorithmId); 110 // 111 // ArrayOfAlgorithmParameter algoParamList = 112 // port.getAlgorithmParameters(algorithmId); 113 // 114 // for (AlgorithmParameter algoParam:algoParamList.getAlgorithmParameter()) 115 // { 116 // mapOKBDataTypetoECJDataTypeEnum() 117 // port.getDataType(algoParam.getDataTypeId()).getName().getValue()) { 118 // 119 // } 120 // returnMap.put(algoParam.getName().getValue(), 121 // port.getDataType(algoParam.getDataTypeId()).getName().getValue()); 122 // } 123 // 124 // return returnMap; 125 // } 108 public Map<String, Object> getAlgorithmParameterMap(Long algorithmId) { 109 Map<String, Object> returnMap = new HashMap<String, Object>(); 110 111 AlgorithmData algoData = port.getAlgorithmData(algorithmId); 112 113 ArrayOfAlgorithmParameter algoParamList = port 114 .getAlgorithmParameters(algorithmId); 115 116 for (AlgorithmParameter algoParam : algoParamList 117 .getAlgorithmParameter()) { 118 returnMap.put(algoParam.getName().getValue(), null); 119 // port.getDataType(algoParam.getDataTypeId()).getName().getValue()); 120 } 121 122 return returnMap; 123 } 126 124 127 125 private <T extends NamedOKBItem> T createNamedOKBItem(Class<T> clazz, … … 137 135 } 138 136 } 139 137 140 138 public Boolean areAlgoParamsEqual() { 141 139 Boolean retval = false; 142 143 140 144 141 return retval; 145 142 } 146 143 147 144 public void createMissingAlgoParams(Long algorithmId, 148 Map<String, Object> ecjAlgoParams) {145 Set<String> missingParamNames) { 149 146 150 List<String> missingParams = new ArrayList<String>(); 151 152 ArrayOfAlgorithmParameter hlAlgoParams = port 153 .getAlgorithmParameters(algorithmId); 154 Map<String, Object> hlAlgoParamMap = new HashMap<String, Object>(); 155 156 for (AlgorithmParameter algoParam : hlAlgoParams 157 .getAlgorithmParameter()) { 158 hlAlgoParamMap.put(algoParam.getName().getValue(), null); // value 159 // hangs 160 // on 161 // Experiments 147 //falls Werte auch verglichen werdne sollen 148 //Map<String, Object> ecjAlgoParams 149 //Set<String> missingParamNames = ecjAlgoParams.keySet(); 150 for (String paramname : missingParamNames) { 151 AlgorithmParameter newAlgoParam = new AlgorithmParameter(); 152 newAlgoParam.setAlgorithmId(algorithmId); 153 newAlgoParam.setDataTypeId(null);// TODO insert DatatypeId if not 154 // exists (mapping first); 155 newAlgoParam.setDescription(factory 156 .createNamedOKBItemDescription("created from ECJ")); 157 newAlgoParam.setName(factory 158 .createNamedOKBItemDescription(paramname)); 159 port.addAlgorithmParameter(newAlgoParam); 162 160 } 163 164 String[] ecjparamNames = (String[]) ecjAlgoParams.keySet().toArray();165 166 for (int i = 0; i < ecjparamNames.length; i++) {167 if (!hlAlgoParamMap.containsKey(ecjparamNames[i])) {168 missingParams.add(new String(ecjparamNames[i]));169 }170 }171 172 161 } 173 162 }
Note: See TracChangeset
for help on using the changeset viewer.