query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
provides access to severity
public int getSeverity() { return severity; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getSeverity();", "public Type getSeverity() {\n return severity;\n }", "int getSeverityValue();", "public java.lang.String getSeverity() {\n return severity;\n }", "public java.lang.String getSeverity() {\n return severity;\n }", "org.apache.calcite.avatica.proto.Common.Severity getSeverity();", "public SeverityEnum getSeverity() {\n return severity;\n }", "public String getSeverity() {\n return severity.toString().toLowerCase(Locale.US);\n }", "public int getSeverityValue() {\n return severity_;\n }", "public String getSeverity() { \n\t\treturn getSeverityElement().getValue();\n\t}", "public int getSeverityValue() {\n return severity_;\n }", "public LogLevel getSeverity() {\r\n\t\treturn level;\r\n\t}", "public void setSeverity(int severity) {\n this.severity = severity;\n }", "public int getSeverity() {\n return current.getSeverity();\n }", "public int getSeverity() {\n\t\treturn adaptee.getSeverity();\n\t}", "public void setSeverity(java.lang.String value) {\n this.severity = value;\n }", "public AlertSeverity severity() {\n return this.innerProperties() == null ? null : this.innerProperties().severity();\n }", "public org.apache.calcite.avatica.proto.Common.Severity getSeverity() {\n @SuppressWarnings(\"deprecation\")\n org.apache.calcite.avatica.proto.Common.Severity result = org.apache.calcite.avatica.proto.Common.Severity.valueOf(severity_);\n return result == null ? org.apache.calcite.avatica.proto.Common.Severity.UNRECOGNIZED : result;\n }", "public org.apache.calcite.avatica.proto.Common.Severity getSeverity() {\n @SuppressWarnings(\"deprecation\")\n org.apache.calcite.avatica.proto.Common.Severity result = org.apache.calcite.avatica.proto.Common.Severity.valueOf(severity_);\n return result == null ? org.apache.calcite.avatica.proto.Common.Severity.UNRECOGNIZED : result;\n }", "public final twogapplicationinsights.proxies.SeverityLevel getSeverity()\n\t{\n\t\treturn getSeverity(getContext());\n\t}", "public void onSeveritySelected(TriggerSeverity severity);", "public Map<FacesMessage.Severity, String> getSeverityName() {\n return FxSharedUtils.getMappedFunction(new FxSharedUtils.ParameterMapper<FacesMessage.Severity, String>() {\n @Override\n public String get(Object key) {\n final FacesMessage.Severity severity = (FacesMessage.Severity) key;\n if (FacesMessage.SEVERITY_ERROR.equals(severity)) {\n return \"error\";\n } else if (FacesMessage.SEVERITY_FATAL.equals(severity)) {\n return \"fatal\";\n } else if (FacesMessage.SEVERITY_INFO.equals(severity)) {\n return \"info\";\n } else if (FacesMessage.SEVERITY_WARN.equals(severity)) {\n return \"warn\";\n } else {\n return \"\";\n }\n }\n });\n }", "public String getStrSeverityCode() {\r\n return strSeverityCode;\r\n }", "public int getSeverity() {\n /*\n // Can't load method instructions: Load method exception: null in method: android.telephony.SmsCbCmasInfo.getSeverity():int, dex: in method: android.telephony.SmsCbCmasInfo.getSeverity():int, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.telephony.SmsCbCmasInfo.getSeverity():int\");\n }", "public boolean hasSeverity() {\n return fieldSetFlags()[2];\n }", "private String getSeverityImage(Object severity)\n/* */ {\n/* 125 */ if (severity == null)\n/* */ {\n/* 127 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_unknown_status.gif\\\" alt=\\\"Unknown\\\" title=\\\"\" + FormatUtil.getString(\"am.webclient.hometab.monitorssnapshot.key.unknown\") + \"\\\" align=\\\"absmiddle\\\">\";\n/* */ }\n/* 129 */ if (severity.equals(\"1\"))\n/* */ {\n/* 131 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_critical.gif\\\" alt=\\\"Critical\\\" title=\\\"\" + FormatUtil.getString(\"am.webclient.hometab.monitorssnapshot.key.critical\") + \"\\\" align=\\\"absmiddle\\\">\";\n/* */ }\n/* 133 */ if (severity.equals(\"4\"))\n/* */ {\n/* 135 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_warning.gif\\\" alt=\\\"Warning\\\" title=\\\"\" + FormatUtil.getString(\"am.webclient.hometab.monitorssnapshot.key.warning\") + \"\\\" align=\\\"absmiddle\\\">\";\n/* */ }\n/* 137 */ if (severity.equals(\"5\"))\n/* */ {\n/* 139 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_clear.gif\\\" alt=\\\"Clear\\\" title=\\\"\" + FormatUtil.getString(\"am.webclient.hometab.monitorssnapshot.key.clear\") + \"\\\" align=\\\"absmiddle\\\" >\";\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 144 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_unknown_status.gif\\\" alt=\\\"Unknown\\\" title=\\\"Unknown\\\" align=\\\"absmiddle\\\">\";\n/* */ }", "private String getSeverityClass(int status)\n/* */ {\n/* 611 */ switch (status)\n/* */ {\n/* */ case 1: \n/* 614 */ return \"class=\\\"errorgrayborder\\\"\";\n/* */ \n/* */ case 2: \n/* 617 */ return \"class=\\\"errorgrayborder\\\"\";\n/* */ \n/* */ case 3: \n/* 620 */ return \"class=\\\"errorgrayborder\\\"\";\n/* */ \n/* */ case 4: \n/* 623 */ return \"class=\\\"errorgrayborder\\\"\";\n/* */ \n/* */ case 5: \n/* 626 */ return \"class=\\\"whitegrayborder\\\"\";\n/* */ \n/* */ case 6: \n/* 629 */ return \"class=\\\"whitegrayborder\\\"\";\n/* */ }\n/* */ \n/* 632 */ return \"class=\\\"whitegrayborder\\\"\";\n/* */ }", "public BoundCodeDt<ConstraintSeverityEnum> getSeverityElement() { \n\t\tif (mySeverity == null) {\n\t\t\tmySeverity = new BoundCodeDt<ConstraintSeverityEnum>(ConstraintSeverityEnum.VALUESET_BINDER);\n\t\t}\n\t\treturn mySeverity;\n\t}", "private String getSeverityImage(Object severity)\n/* */ {\n/* 119 */ if (severity == null)\n/* */ {\n/* 121 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_unknown_status.gif\\\" alt=\\\"Unknown\\\" title=\\\"\" + FormatUtil.getString(\"am.webclient.hometab.monitorssnapshot.key.unknown\") + \"\\\" align=\\\"absmiddle\\\">\";\n/* */ }\n/* 123 */ if (severity.equals(\"1\"))\n/* */ {\n/* 125 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_critical.gif\\\" alt=\\\"Critical\\\" title=\\\"\" + FormatUtil.getString(\"am.webclient.hometab.monitorssnapshot.key.critical\") + \"\\\" align=\\\"absmiddle\\\">\";\n/* */ }\n/* 127 */ if (severity.equals(\"4\"))\n/* */ {\n/* 129 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_warning.gif\\\" alt=\\\"Warning\\\" title=\\\"\" + FormatUtil.getString(\"am.webclient.hometab.monitorssnapshot.key.warning\") + \"\\\" align=\\\"absmiddle\\\">\";\n/* */ }\n/* 131 */ if (severity.equals(\"5\"))\n/* */ {\n/* 133 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_clear.gif\\\" alt=\\\"Clear\\\" title=\\\"\" + FormatUtil.getString(\"am.webclient.hometab.monitorssnapshot.key.clear\") + \"\\\" align=\\\"absmiddle\\\" >\";\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 138 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_unknown_status.gif\\\" alt=\\\"Unknown\\\" title=\\\"Unknown\\\" align=\\\"absmiddle\\\">\";\n/* */ }", "private String getSeverityImage(Object severity)\n/* */ {\n/* 116 */ if (severity == null)\n/* */ {\n/* 118 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_unknown_status.gif\\\" alt=\\\"Unknown\\\" title=\\\"\" + FormatUtil.getString(\"am.webclient.hometab.monitorssnapshot.key.unknown\") + \"\\\" align=\\\"absmiddle\\\">\";\n/* */ }\n/* 120 */ if (severity.equals(\"1\"))\n/* */ {\n/* 122 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_critical.gif\\\" alt=\\\"Critical\\\" title=\\\"\" + FormatUtil.getString(\"am.webclient.hometab.monitorssnapshot.key.critical\") + \"\\\" align=\\\"absmiddle\\\">\";\n/* */ }\n/* 124 */ if (severity.equals(\"4\"))\n/* */ {\n/* 126 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_warning.gif\\\" alt=\\\"Warning\\\" title=\\\"\" + FormatUtil.getString(\"am.webclient.hometab.monitorssnapshot.key.warning\") + \"\\\" align=\\\"absmiddle\\\">\";\n/* */ }\n/* 128 */ if (severity.equals(\"5\"))\n/* */ {\n/* 130 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_clear.gif\\\" alt=\\\"Clear\\\" title=\\\"\" + FormatUtil.getString(\"am.webclient.hometab.monitorssnapshot.key.clear\") + \"\\\" align=\\\"absmiddle\\\" >\";\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 135 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_unknown_status.gif\\\" alt=\\\"Unknown\\\" title=\\\"Unknown\\\" align=\\\"absmiddle\\\">\";\n/* */ }", "private String getSeverityClass(int status)\n/* */ {\n/* 602 */ switch (status)\n/* */ {\n/* */ case 1: \n/* 605 */ return \"class=\\\"errorgrayborder\\\"\";\n/* */ \n/* */ case 2: \n/* 608 */ return \"class=\\\"errorgrayborder\\\"\";\n/* */ \n/* */ case 3: \n/* 611 */ return \"class=\\\"errorgrayborder\\\"\";\n/* */ \n/* */ case 4: \n/* 614 */ return \"class=\\\"errorgrayborder\\\"\";\n/* */ \n/* */ case 5: \n/* 617 */ return \"class=\\\"whitegrayborder\\\"\";\n/* */ \n/* */ case 6: \n/* 620 */ return \"class=\\\"whitegrayborder\\\"\";\n/* */ }\n/* */ \n/* 623 */ return \"class=\\\"whitegrayborder\\\"\";\n/* */ }", "private String getSeverityClass(int status)\n/* */ {\n/* 605 */ switch (status)\n/* */ {\n/* */ case 1: \n/* 608 */ return \"class=\\\"errorgrayborder\\\"\";\n/* */ \n/* */ case 2: \n/* 611 */ return \"class=\\\"errorgrayborder\\\"\";\n/* */ \n/* */ case 3: \n/* 614 */ return \"class=\\\"errorgrayborder\\\"\";\n/* */ \n/* */ case 4: \n/* 617 */ return \"class=\\\"errorgrayborder\\\"\";\n/* */ \n/* */ case 5: \n/* 620 */ return \"class=\\\"whitegrayborder\\\"\";\n/* */ \n/* */ case 6: \n/* 623 */ return \"class=\\\"whitegrayborder\\\"\";\n/* */ }\n/* */ \n/* 626 */ return \"class=\\\"whitegrayborder\\\"\";\n/* */ }", "private Severity(String strSeverityCode) {\r\n this.strSeverityCode = strSeverityCode;\r\n }", "public void setOpLevel(OpLevel severity) {\n\t\topLevel = severity;\n\t}", "public final void setSeverity(twogapplicationinsights.proxies.SeverityLevel severity)\n\t{\n\t\tsetSeverity(getContext(), severity);\n\t}", "@Override\n public List<String> catchFaults(){\n List<String> errors = new ArrayList<>();\n severityLevels.forEach(level -> {\n if(level.equals(\"ERROR\")){\n errors.add(level);\n }\n });\n return errors;\n }", "Collection<? extends Integer> getHasInjurySeverity();", "public final void setSeverity(com.mendix.systemwideinterfaces.core.IContext context, twogapplicationinsights.proxies.SeverityLevel severity)\n\t{\n\t\tif (severity != null)\n\t\t\tgetMendixObject().setValue(context, MemberNames.Severity.toString(), severity.toString());\n\t\telse\n\t\t\tgetMendixObject().setValue(context, MemberNames.Severity.toString(), null);\n\t}", "int getProblemCategory();", "public Builder setSeverityValue(int value) {\n severity_ = value;\n onChanged();\n return this;\n }", "private Priority getPriority(final String severity) {\n\t\tif (SEVERITY_FATAL.equalsIgnoreCase(severity) || SEVERITY_ERROR.equalsIgnoreCase(severity)) {\n\t\t\treturn Priority.HIGH;\n\t\t}\n\t\tif (SEVERITY_WARNING.equalsIgnoreCase(severity) || SEVERITY_WARN.equalsIgnoreCase(severity)) {\n\t\t\treturn Priority.NORMAL;\n\t\t}\n\t\tif (SEVERITY_INFORMATIONAL.equalsIgnoreCase(severity) || SEVERITY_INFO.equalsIgnoreCase(severity)) {\n\t\t\treturn Priority.LOW;\n\t\t}\n\t\treturn Priority.NORMAL;\n\t}", "private String getSeverityImageForHealthWithoutMouseOver(String severity)\n/* */ {\n/* 296 */ if (severity == null)\n/* */ {\n/* 298 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_health_unknown_nm.gif\\\" alt=\\\"Unknown\\\">\";\n/* */ }\n/* 300 */ if (severity.equals(\"5\"))\n/* */ {\n/* 302 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_health_clear_nm.gif\\\" alt=\\\"Clear\\\" >\";\n/* */ }\n/* 304 */ if (severity.equals(\"4\"))\n/* */ {\n/* 306 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_health_warning_nm.gif\\\" alt=\\\"Warning\\\">\";\n/* */ }\n/* 308 */ if (severity.equals(\"1\"))\n/* */ {\n/* 310 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_health_critical_nm.gif\\\" alt=\\\"Critical\\\">\";\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 315 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_health_unknown_nm.gif\\\" alt=\\\"Unknown\\\">\";\n/* */ }", "public Builder setSeverity(org.apache.calcite.avatica.proto.Common.Severity value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n severity_ = value.getNumber();\n onChanged();\n return this;\n }", "public abstract String getStatusMessage();", "public List<IkrInstanceData> fetchDBMS_SYBASE_LOG_SEVERITY()\r\n\tthrows ConnectorException, FetchException, PersistenceException {\t \r\n\t\tList<IkrInstanceData> res = new ArrayList<IkrInstanceData>();\r\n\t\t\r\n\t\tSybaseLogMeasurement measurement = (SybaseLogMeasurement)client.getMeasurement(\"DBMS_SYBASE_LOG_SEVERITY\");\r\n\r\n\t\tMap<String, Integer> severities = measurement.getLogSeverityResult();\t\t\r\n\t\tfor(String key : severities.keySet())\r\n\t\t\tres.add(new SybaseLogsSeverityIkrInstanceData(key + \"@\" + client.getDatabaseInstance(), severities.get(key), fetchDate));\r\n\t\t\r\n\t\treturn res;\r\n\t}", "private String getSeverityImageForHealth(String severity)\n/* */ {\n/* 254 */ if (severity == null)\n/* */ {\n/* 256 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_health_unknown.gif\\\" name=\\\"Image\" + ++this.j + \"\\\">\";\n/* */ }\n/* 258 */ if (severity.equals(\"5\"))\n/* */ {\n/* 260 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_health_clear.gif\\\" name=\\\"Image\" + ++this.j + \"\\\">\";\n/* */ }\n/* 262 */ if (severity.equals(\"4\"))\n/* */ {\n/* 264 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_health_warning.gif\\\" name=\\\"Image\" + ++this.j + \"\\\">\";\n/* */ }\n/* 266 */ if (severity.equals(\"1\"))\n/* */ {\n/* 268 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_health_critical.gif\\\" name=\\\"Image\" + ++this.j + \"\\\">\";\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 273 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_health_unknown.gif\\\" name=\\\"Image\" + ++this.j + \"\\\">\";\n/* */ }", "private String getSeverityImageForHealth(String severity)\n/* */ {\n/* 248 */ if (severity == null)\n/* */ {\n/* 250 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_health_unknown.gif\\\" name=\\\"Image\" + ++this.j + \"\\\">\";\n/* */ }\n/* 252 */ if (severity.equals(\"5\"))\n/* */ {\n/* 254 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_health_clear.gif\\\" name=\\\"Image\" + ++this.j + \"\\\">\";\n/* */ }\n/* 256 */ if (severity.equals(\"4\"))\n/* */ {\n/* 258 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_health_warning.gif\\\" name=\\\"Image\" + ++this.j + \"\\\">\";\n/* */ }\n/* 260 */ if (severity.equals(\"1\"))\n/* */ {\n/* 262 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_health_critical.gif\\\" name=\\\"Image\" + ++this.j + \"\\\">\";\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 267 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_health_unknown.gif\\\" name=\\\"Image\" + ++this.j + \"\\\">\";\n/* */ }", "private String getSeverityImageForHealthWithoutMouseOver(String severity)\n/* */ {\n/* 305 */ if (severity == null)\n/* */ {\n/* 307 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_health_unknown_nm.gif\\\" alt=\\\"Unknown\\\">\";\n/* */ }\n/* 309 */ if (severity.equals(\"5\"))\n/* */ {\n/* 311 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_health_clear_nm.gif\\\" alt=\\\"Clear\\\" >\";\n/* */ }\n/* 313 */ if (severity.equals(\"4\"))\n/* */ {\n/* 315 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_health_warning_nm.gif\\\" alt=\\\"Warning\\\">\";\n/* */ }\n/* 317 */ if (severity.equals(\"1\"))\n/* */ {\n/* 319 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_health_critical_nm.gif\\\" alt=\\\"Critical\\\">\";\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 324 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_health_unknown_nm.gif\\\" alt=\\\"Unknown\\\">\";\n/* */ }", "private String getSeverityImageForHealthWithoutMouseOver(String severity)\n/* */ {\n/* 299 */ if (severity == null)\n/* */ {\n/* 301 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_health_unknown_nm.gif\\\" alt=\\\"Unknown\\\">\";\n/* */ }\n/* 303 */ if (severity.equals(\"5\"))\n/* */ {\n/* 305 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_health_clear_nm.gif\\\" alt=\\\"Clear\\\" >\";\n/* */ }\n/* 307 */ if (severity.equals(\"4\"))\n/* */ {\n/* 309 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_health_warning_nm.gif\\\" alt=\\\"Warning\\\">\";\n/* */ }\n/* 311 */ if (severity.equals(\"1\"))\n/* */ {\n/* 313 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_health_critical_nm.gif\\\" alt=\\\"Critical\\\">\";\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 318 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_health_unknown_nm.gif\\\" alt=\\\"Unknown\\\">\";\n/* */ }", "private String getSeverityImageForHealth(String severity)\n/* */ {\n/* 245 */ if (severity == null)\n/* */ {\n/* 247 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_health_unknown.gif\\\" name=\\\"Image\" + ++this.j + \"\\\">\";\n/* */ }\n/* 249 */ if (severity.equals(\"5\"))\n/* */ {\n/* 251 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_health_clear.gif\\\" name=\\\"Image\" + ++this.j + \"\\\">\";\n/* */ }\n/* 253 */ if (severity.equals(\"4\"))\n/* */ {\n/* 255 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_health_warning.gif\\\" name=\\\"Image\" + ++this.j + \"\\\">\";\n/* */ }\n/* 257 */ if (severity.equals(\"1\"))\n/* */ {\n/* 259 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_health_critical.gif\\\" name=\\\"Image\" + ++this.j + \"\\\">\";\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 264 */ return \"<img border=\\\"0\\\" src=\\\"/images/icon_health_unknown.gif\\\" name=\\\"Image\" + ++this.j + \"\\\">\";\n/* */ }", "public int failureLevel(){\n return RESULT_WARNING;\n }", "@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic List<Severity> getAllSeverities() {\n\t\ttry{\r\n\t\t\tList<Severity> severityList = getSessionFactory().getCurrentSession().createCriteria(Severity.class).list();\r\n\t\t\treturn severityList;\r\n\t\t}catch(HibernateException ex){\r\n\t\t\tex.printStackTrace();// logger.error(ex.getMessage(),ex);\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic Severity getSeverityBySeverityId(int severityId) {\n\t\ttry{\r\n\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\tList<Severity> list = getSessionFactory().getCurrentSession()\r\n\t\t\t.createQuery(\"from Severity where SEVERITY_ID=?\")\r\n\t\t\t.setParameter(0, severityId).list();\r\n\t\t\tif(list!=null&& list.size()>0){\r\n\r\n\t\t\t\treturn list.get(0);\r\n\t\t\t}\r\n\t\t}catch(HibernateException ex){\r\n\t\t\tex.printStackTrace();// logger.error(ex.getMessage(),ex);\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "String getStatusMessage( );", "public graphene.model.idl.G_DocumentError.Builder setSeverity(java.lang.String value) {\n validate(fields()[2], value);\n this.severity = value;\n fieldSetFlags()[2] = true;\n return this; \n }", "public Constraint setSeverity(BoundCodeDt<ConstraintSeverityEnum> theValue) {\n\t\tmySeverity = theValue;\n\t\treturn this;\n\t}", "public void setIncidentSeverity(int incidentSeverity) {\n\t\t\tthis.incidentSeverity = incidentSeverity;\r\n\t\t}", "void addHasInjurySeverity(Integer newHasInjurySeverity);", "String getStatusMessage();", "boolean hasHasInjurySeverity();", "java.lang.String getErrorInfo();", "java.lang.String getErrorInfo();", "java.lang.String getErrorInfo();", "java.lang.String getErrorInfo();", "public void setSeverity(TriggerSeverity severity) {\n\t\tmSeverityListPagerAdapter.setCurrentPosition(severity.getPosition());\n\t}", "LogLevel getLogLevel();", "@Override\n public void log(Class<?> callerClass, TechnicalLogSeverity severity, String message) {\n\n }", "public Constraint setSeverity(ConstraintSeverityEnum theValue) {\n\t\tgetSeverityElement().setValueAsEnum(theValue);\n\t\treturn this;\n\t}", "public NrtAlertRule withSeverity(AlertSeverity severity) {\n if (this.innerProperties() == null) {\n this.innerProperties = new NrtAlertRuleProperties();\n }\n this.innerProperties().withSeverity(severity);\n return this;\n }", "public String getInspectionLevel() {\n return this.inspectionLevel;\n }", "public static int getLevel(){\n\treturn logLevel;\n }", "public static void log(int severity, String message, Throwable e)\n {\n ILog log = plugin != null? plugin.getLog() : Platform.getLog(FrameworkUtil.getBundle(PluginConsistencyActivator.class));\n log = log != null? log : IDEWorkbenchPlugin.getDefault().getLog();\n\n log.log(new Status(severity, PLUGIN_ID, message, e));\n }", "public CWE getProductServiceLineItemStatus() { \r\n\t\tCWE retVal = this.getTypedField(6, 0);\r\n\t\treturn retVal;\r\n }", "protected boolean checkForMarkers(ISubmissionProject project, \n String type, int severity) {\n boolean found = false;\n if (null != project) {\n IMarker[] marker = project.getMarker(type, \n true, IResource.DEPTH_INFINITE);\n if (null != marker) {\n for (int i = marker.length - 1; !found && i >= 0; i--) {\n try {\n Object sev = marker[i].getAttribute(IMarker.SEVERITY);\n found = null != sev && Integer.parseInt(sev.toString()) \n == severity;\n } catch (CoreException e) {\n } catch (NumberFormatException e) {\n }\n }\n }\n }\n return found;\n }", "public CWE[] getIndication() {\r\n \tCWE[] retVal = this.getTypedField(19, new CWE[0]);\r\n \treturn retVal;\r\n }", "public int getAlertPriority()\n {\n return this.alert_priority;\n }", "public void sub() {\n\t\tlog.severe(\"severe level\");// <= (1)\n\t\tlog.warning(\"warning level\");// <= (2)\n\t\tlog.info(\"info level\");// <= (3)\n\t\tlog.config(\"config level\");// <= (4)\n\t\tlog.fine(\"fine level\");// <= (5)\n\t\tlog.finer(\"finer level\");// <= (6)\n\t\tlog.finest(\"finest level\");// <= (7)\n\n\t}", "@Override\n public void log(Class<?> callerClass, TechnicalLogSeverity severity, Throwable t) {\n\n }", "int getCauseValue();", "public void setStrSeverityCode(String strSeverityCode) {\r\n this.strSeverityCode = strSeverityCode;\r\n }", "public static LogLevel getLevel(){\n return EZLoggerManager.lvl;\n }", "public int[] exceptionTypes();", "public String getLevel ()\n {\n return level;\n }", "@Override\n public void log(Class<?> callerClass, TechnicalLogSeverity severity, String message, Throwable t) {\n\n }", "public CWE[] getAdministrationNotes() {\r\n \tCWE[] retVal = this.getTypedField(9, new CWE[0]);\r\n \treturn retVal;\r\n }", "String getWarningsString();", "public Integer getRiskWarning() {\n return riskWarning;\n }", "public graphene.model.idl.G_DocumentError.Builder clearSeverity() {\n severity = null;\n fieldSetFlags()[2] = false;\n return this;\n }", "public CWE getPsl6_ProductServiceLineItemStatus() { \r\n\t\tCWE retVal = this.getTypedField(6, 0);\r\n\t\treturn retVal;\r\n }", "public int getAlertness() {\n return 0;\n }", "public HighlightSeverity(@NotNull String name,\n int val,\n @Nullable Supplier<@Nls String> displayName,\n @Nullable Supplier<@Nls String> capitalizedDisplayName,\n @Nullable Supplier<@Nls String> countMessageTemplate) {\n myName = name;\n myVal = val;\n myDisplayName = displayName;\n myCapitalizedDisplayName = capitalizedDisplayName;\n myCountMessageTemplate = countMessageTemplate;\n }", "private int computeHighestServityFlag(IResource res) {\n \t\tIMarker[] pbmMarkers = null; \n \t\ttry {\n \t\t\tpbmMarkers = res.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);\n \t\t} catch (CoreException e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t\tint severity = -1; // none\n \t\tif (pbmMarkers != null) {\n \t\t\tfor (int i = 0; i < pbmMarkers.length; i++) {\n \t\t\t\tIMarker curr = pbmMarkers[i];\n \t\t\t\tseverity = curr.getAttribute(IMarker.SEVERITY, -1);\n \t\t\t\tif (severity == IMarker.SEVERITY_ERROR)\n \t\t\t\t\treturn IMarker.SEVERITY_ERROR;\t\t\t\t\t\t\t\n \t\t\t}\n \t\t}\t\t\n \t\treturn severity;\n \t}", "String getTraceabilityNotes();", "public StatusLogger getStatusLogger();", "public java.lang.String getErrorLevel() {\n return errorLevel;\n }", "public CWE getIndication(int rep) { \r\n\t\tCWE retVal = this.getTypedField(19, rep);\r\n\t\treturn retVal;\r\n }", "EDataType getSusceptance();", "public static void log(int severity, String message)\n {\n log(severity, message, null);\n }", "void logSevere(String pMessage)\n{\n\n Logger.getLogger(getClass().getName()).log(Level.SEVERE, pMessage);\n\n}" ]
[ "0.839455", "0.81622314", "0.78517294", "0.7795058", "0.76768345", "0.76616853", "0.7647593", "0.7508637", "0.7409767", "0.73473674", "0.7244981", "0.7201349", "0.7172199", "0.71610963", "0.71449673", "0.7084321", "0.7006098", "0.6998123", "0.69746363", "0.68603396", "0.6670141", "0.6649959", "0.6485184", "0.6376329", "0.6367464", "0.6112388", "0.6088164", "0.6085282", "0.6079459", "0.60712", "0.60569954", "0.60446197", "0.6016019", "0.59721816", "0.59523326", "0.5835409", "0.58345443", "0.5811819", "0.57297194", "0.57112086", "0.56900656", "0.56496894", "0.56260437", "0.56173164", "0.56129164", "0.5610276", "0.560903", "0.5592923", "0.5585526", "0.55853033", "0.554765", "0.5545139", "0.5536591", "0.5522324", "0.55202854", "0.5515984", "0.5498801", "0.54696536", "0.5459714", "0.54457456", "0.54350495", "0.54350495", "0.54350495", "0.54350495", "0.54327005", "0.5429428", "0.54186916", "0.53917855", "0.5377413", "0.5364945", "0.53440785", "0.5337668", "0.53364825", "0.53294975", "0.5309161", "0.5263798", "0.5226801", "0.521586", "0.51836544", "0.51831937", "0.51628834", "0.5153828", "0.51222837", "0.512204", "0.5116566", "0.5105807", "0.5105591", "0.50717294", "0.5070502", "0.506667", "0.50567853", "0.50554854", "0.50494355", "0.5035575", "0.50351226", "0.50177443", "0.5005264", "0.5003015", "0.49961248" ]
0.8045171
3
provides access to moderation
public int getModeration() { return moderation; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void grantModerator(String nickname);", "List<Moderator> getModerators();", "private void checkAdminOrModerator(HttpServletRequest request, String uri)\n throws ForbiddenAccessException, ResourceNotFoundException {\n if (isAdministrator(request)) {\n return;\n }\n\n ModeratedItem moderatedItem = getModeratedItem(uri);\n if (moderatedItem == null) {\n throw new ResourceNotFoundException(uri);\n }\n\n String loggedInUser = getLoggedInUserEmail(request);\n if (moderatedItem.isModerator(loggedInUser)) {\n return;\n }\n\n throw new ForbiddenAccessException(loggedInUser);\n }", "public void setModerator(boolean moderator) {\n\t\tthis.moderator = moderator;\n\t}", "public boolean isModerator() {\n\t\treturn this.moderator;\n\t}", "List<Moderator> getAvailableModerators(int digestNum);", "@RolesAllowed(RoleEnum.ROLE_ADMIN)\n\tpublic int saveModerator(Moderator moderator);", "abstract public void getPermission();", "public static void main(String[] args) {\n\t\n\tAccesingModifiers.hello();//heryerden accessable \n\tAccesingModifiers.hello1();\n\tAccesingModifiers.hello2();\n\t\n\t//AccesingModifiers.hello3(); not acceptable since permission is set to private\n\t\n}", "@Override\n\tpublic List<String> getUserModerator(String userName, boolean isModeCate)\n\t\t\tthrows Exception {\n\t\treturn null;\n\t}", "public abstract OwUIAccessRightsModul getEditAccessRightsSubModul(OwObject object_p) throws Exception;", "@Override\n\tpublic void modifierUser(User c) {\n\t\t\n\t}", "public String updatePrivilege() {\r\n\r\n String elementID = this.getParam(\"idElement\");\r\n // If need to add to update list.\r\n boolean needToAdd = false;\r\n\r\n String optin = this.getParam(\"optin\");\r\n String optout = this.getParam(\"optout\");\r\n String view = this.getParam(\"view\");\r\n String read = this.getParam(\"read\");\r\n String update = this.getParam(\"update\");\r\n String administrate = this.getParam(\"administrate\");\r\n\r\n Subject updateSubject = (Subject) this.getAddedItem(elementID);\r\n\r\n if (updateSubject == null) {\r\n updateSubject = (Subject) this.updatedGroups.get(elementID);\r\n if (updateSubject == null) {\r\n Subject aux = (Subject) this.getItem(elementID);\r\n if (aux.getValueFormCol(\"canOptin\") == null) {\r\n aux.addMappingFieldCol(\"canOptin\", ESCOConstantes.FALSE);\r\n }\r\n if (aux.getValueFormCol(\"canOptout\") == null) {\r\n aux.addMappingFieldCol(\"canOptout\", ESCOConstantes.FALSE);\r\n }\r\n updateSubject = (Subject) aux.clone();\r\n this.originalGroups.put(elementID, aux);\r\n needToAdd = true;\r\n }\r\n }\r\n\r\n GroupPrivilegeEnum theRight = updateSubject.getSubjectRight();\r\n\r\n if (theRight == null) {\r\n theRight = GroupPrivilegeEnum.NONE;\r\n }\r\n\r\n if (optin != null) {\r\n // OptIn is true\r\n if (optin.equals(ESCOConstantes.TRUE)) {\r\n // Adding the VIEW privilege\r\n if (theRight.eq(GroupPrivilegeEnum.NONE)) {\r\n updateSubject.setSubjectRight(GroupPrivilegeEnum.VIEW);\r\n }\r\n }\r\n // Adding the OptIn\r\n updateSubject.addMappingFieldCol(\"canOptin\", Boolean.valueOf(optin.equals(ESCOConstantes.TRUE))\r\n .toString());\r\n }\r\n\r\n if (optout != null) {\r\n // OptOut is true\r\n if (optout.equals(ESCOConstantes.TRUE)) {\r\n // Adding the VIEW privilege\r\n if (theRight.eq(GroupPrivilegeEnum.NONE)) {\r\n updateSubject.setSubjectRight(GroupPrivilegeEnum.VIEW);\r\n }\r\n }\r\n updateSubject.addMappingFieldCol(\"canOptout\", Boolean.valueOf(optout.equals(ESCOConstantes.TRUE))\r\n .toString());\r\n }\r\n\r\n if (view != null) {\r\n if (view.equals(ESCOConstantes.TRUE)) {\r\n updateSubject.setSubjectRight(GroupPrivilegeEnum.VIEW);\r\n } else {\r\n updateSubject.setSubjectRight(GroupPrivilegeEnum.NONE);\r\n updateSubject.setOptin(false);\r\n updateSubject.setOptout(false);\r\n }\r\n }\r\n if (read != null) {\r\n if (read.equals(ESCOConstantes.TRUE)) {\r\n updateSubject.setSubjectRight(GroupPrivilegeEnum.READ);\r\n } else {\r\n updateSubject.setSubjectRight(GroupPrivilegeEnum.VIEW);\r\n }\r\n }\r\n if (update != null) {\r\n if (update.equals(ESCOConstantes.TRUE)) {\r\n updateSubject.setSubjectRight(GroupPrivilegeEnum.UPDATE);\r\n } else {\r\n updateSubject.setSubjectRight(GroupPrivilegeEnum.READ);\r\n }\r\n }\r\n if (administrate != null) {\r\n if (administrate.equals(ESCOConstantes.TRUE)) {\r\n updateSubject.setSubjectRight(GroupPrivilegeEnum.ADMIN);\r\n } else {\r\n updateSubject.setSubjectRight(GroupPrivilegeEnum.UPDATE);\r\n }\r\n }\r\n\r\n // Only one group in the list of group of the members class because\r\n // we add it to convert group to subject.\r\n if (needToAdd) {\r\n this.updatedGroups.put(elementID, updateSubject);\r\n } else {\r\n Sortable theOrignGroup = this.originalGroups.get(elementID);\r\n if (theOrignGroup != null) {\r\n if (theOrignGroup.getValueFormCol(ESCOConstantes.USER_RIGHT_VALUE).toUpperCase().equals(\r\n updateSubject.getValueFormCol(ESCOConstantes.USER_RIGHT_VALUE).toUpperCase())) {\r\n if (theOrignGroup.getValueFormCol(\"canOptin\").toUpperCase().equals(\r\n updateSubject.getValueFormCol(\"canOptin\").toUpperCase())) {\r\n if (theOrignGroup.getValueFormCol(\"canOptout\").toUpperCase().equals(\r\n updateSubject.getValueFormCol(\"canOptout\").toUpperCase())) {\r\n // The updateGroup and origin is same.\r\n this.updatedGroups.remove(elementID);\r\n this.originalGroups.remove(elementID);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Create and return the XML status.\r\n XmlProducer producer = new XmlProducer();\r\n producer.setTarget(new Status(Boolean.TRUE));\r\n producer.setTypesOfTarget(Status.class);\r\n\r\n return this.xmlProducerWrapper.wrap(producer);\r\n }", "public Boolean isModoAdmin() {\r\n\t\treturn this.modoAdmin;\r\n\t}", "@Override\n\tpublic void saveUserModerator(String userName, List<String> ids,\n\t\t\tboolean isModeCate) throws Exception {\n\n\t}", "@Override\r\n public boolean modererAvis(Avis paramAvis) {\n return false;\r\n }", "@Override\r\n\tprotected void verificaUtentePrivilegiato() {\n\r\n\t}", "@Override\n public void onExplanationNeeded(List<String> permissionsToExplain) {\n }", "public int getUserModificationPermission() {\n return permission;\n }", "private void channelPrivilegedUserUpdate() {\n String userKey = builder.getPersonalUser().getUserKey();\n if (channel.getPrivilegedUsers().size() != 0) {\n ArrayList<String> members = new ArrayList<>();\n for (User user : channel.getPrivilegedUsers()) {\n members.add(user.getId());\n }\n String[] membersArray = members.toArray(new String[0]);\n // send update to server\n restClient.updateChannel(server.getId(), channel.getCategories().getId(), channel.getId(), userKey,\n channel.getName(), channel.isPrivilege(), membersArray, response -> {\n });\n } else {\n channel.setPrivilege(false);\n restClient.updateChannel(server.getId(), channel.getCategories().getId(), channel.getId(), userKey,\n channel.getName(), false, null, response -> {\n });\n }\n }", "public String getFloodPerm() throws PermissionDeniedException;", "public abstract void revokeModerator(String nickname);", "public abstract boolean canEditAccessRights(OwObject object_p) throws Exception;", "@Override\n protected String requiredPostPermission() {\n return \"admin\";\n }", "@Override\n public boolean userCanAccess(int id) {\n return true;\n }", "public int getMetaPrivileges();", "ISSeedModifications createISSeedModifications();", "public boolean isAdmin();", "boolean isAdminDirect() {\n return isAdministrator;\n }", "public void doPermissions(RunData data, Context context)\n\t{\n\t\tSessionState state = ((JetspeedRunData)data).getPortletSessionState(((JetspeedRunData)data).getJs_peid());\n\n\t\t// cancel copy if there is one in progress\n\t\tif(! Boolean.FALSE.toString().equals(state.getAttribute (STATE_COPY_FLAG)))\n\t\t{\n\t\t\tinitCopyContext(state);\n\t\t}\n\n\t\t// cancel move if there is one in progress\n\t\tif(! Boolean.FALSE.toString().equals(state.getAttribute (STATE_MOVE_FLAG)))\n\t\t{\n\t\t\tinitMoveContext(state);\n\t\t}\n\n\t\t// should we save here?\n\t\tstate.setAttribute(STATE_LIST_SELECTIONS, new TreeSet());\n\n\t\t// get the current home collection id and the related site\n\t\tString collectionId = (String) state.getAttribute (STATE_HOME_COLLECTION_ID);\n\t\tReference ref = EntityManager.newReference(ContentHostingService.getReference(collectionId));\n\t\tString siteRef = SiteService.siteReference(ref.getContext());\n\n\t\t// setup for editing the permissions of the site for this tool, using the roles of this site, too\n\t\tstate.setAttribute(PermissionsHelper.TARGET_REF, siteRef);\n\n\t\t// ... with this description\n\t\tstate.setAttribute(PermissionsHelper.DESCRIPTION, rb.getString(\"setpermis1\")\n\t\t\t\t+ SiteService.getSiteDisplay(ref.getContext()));\n\n\t\t// ... showing only locks that are prpefixed with this\n\t\tstate.setAttribute(PermissionsHelper.PREFIX, \"content.\");\n\n\t\t// get into helper mode with this helper tool\n\t\tstartHelper(data.getRequest(), \"sakai.permissions.helper\");\n\n\t}", "public void doFolder_permissions(RunData data, Context context)\n\t{\n\t\tSessionState state = ((JetspeedRunData)data).getPortletSessionState(((JetspeedRunData)data).getJs_peid());\n\t\tParameterParser params = data.getParameters();\n\n\t\t// cancel copy if there is one in progress\n\t\tif(! Boolean.FALSE.toString().equals(state.getAttribute (STATE_COPY_FLAG)))\n\t\t{\n\t\t\tinitCopyContext(state);\n\t\t}\n\n\t\t// cancel move if there is one in progress\n\t\tif(! Boolean.FALSE.toString().equals(state.getAttribute (STATE_MOVE_FLAG)))\n\t\t{\n\t\t\tinitMoveContext(state);\n\t\t}\n\n\t\t// get the current collection id and the related site\n\t\tString collectionId = params.getString(\"collectionId\"); //(String) state.getAttribute (STATE_COLLECTION_ID);\n\t\tString title = \"\";\n\t\ttry\n\t\t{\n\t\t\ttitle = ContentHostingService.getProperties(collectionId).getProperty(ResourceProperties.PROP_DISPLAY_NAME);\n\t\t}\n\t\tcatch (PermissionException e)\n\t\t{\n\t\t\taddAlert(state, rb.getString(\"notread\"));\n\t\t}\n\t\tcatch (IdUnusedException e)\n\t\t{\n\t\t\taddAlert(state, rb.getString(\"notfindfol\"));\n\t\t}\n\n\t\t// the folder to edit\n\t\tReference ref = EntityManager.newReference(ContentHostingService.getReference(collectionId));\n\t\tstate.setAttribute(PermissionsHelper.TARGET_REF, ref.getReference());\n\n\t\t// use the folder's context (as a site) for roles\n\t\tString siteRef = SiteService.siteReference(ref.getContext());\n\t\tstate.setAttribute(PermissionsHelper.ROLES_REF, siteRef);\n\n\t\t// ... with this description\n\t\tstate.setAttribute(PermissionsHelper.DESCRIPTION, rb.getString(\"setpermis\") + \" \" + title);\n\n\t\t// ... showing only locks that are prpefixed with this\n\t\tstate.setAttribute(PermissionsHelper.PREFIX, \"content.\");\n\n\t\t// get into helper mode with this helper tool\n\t\tstartHelper(data.getRequest(), \"sakai.permissions.helper\");\n\n\t}", "@Override\n protected String requiredPutPermission() {\n return \"admin\";\n }", "int getDefensiveMod(ActionType type);", "private void habilitarCamposModif() {\n\n listarPromotoresModif();\n //limpiarListaCrear();\n }", "public boolean getAllowModifications() {\n return true;\n }", "public boolean estaEnModoAvion();", "public static Moderator getModerator(long modId) {\n HttpRequest request = HttpRequest.newBuilder().GET().uri(URI.create(\"http://localhost:8080/moderators/get/\" + modId)).build();\n HttpResponse<String> response = null;\n try {\n response = client.send(request, HttpResponse.BodyHandlers.ofString());\n } catch (Exception e) {\n e.printStackTrace();\n return null;\n }\n if (response.statusCode() != 200) {\n System.out.println(\"Status: \" + response.statusCode());\n }\n return gson.fromJson(response.body(), Moderator.class);\n }", "String getPermission();", "public Boolean setFloodPerm(String floodPerm) throws PermissionDeniedException;", "UserModCollection getModificationsAsUserModCollection(SpectrumAnnotatorResult spectrumAnnotatorResult);", "int getOffensiveMod(ActionType type);", "public static void ShowAdminPreferences() {\n if (Controller.permission.GetUserPermission(\"EditUser\")) {\n ToggleVisibility(UsersPage.adminWindow);\n } else {\n DialogWindow.NoAccessTo(\"Admin options\");\n }\n }", "void enableMod();", "private boolean isProtected(String level, ModifierHolder mods) {\r\n\t\treturn level.equalsIgnoreCase(\"protected\") && \r\n\t\t\t\t(mods.isProtected() || mods.isPublic());\r\n\t}", "public interface ModController {\r\n\r\n /**\r\n * Do something to enable the mod this controller is designed for properly.\r\n */\r\n void enableMod();\r\n\r\n /**\r\n * Do something to disable the mod this controller is designed for properly.\r\n */\r\n void disableMod();\r\n\r\n}", "public void grantModerate(User user) throws ServiceException{\n }", "private void setPrivilagesToModifyUser(User user){\n\t\tsetFields(false);\n\t\tif (!LoginWindowController.loggedUser.getPermissions().equals(\"administrator\"))\n\t\t{\n\t\t\tif (LoginWindowController.loggedUser.getId() != user.getId()){\n\t\t\t\tif ((user.getPermissions().equals(\"manager\")) \n\t\t\t\t\t\t|| (user.getPermissions().equals(\"administrator\"))){\n\t\t\t\t\tsetFields(true);\n\t\t\t\t}\n\t\t\t\tif (user.getPermissions().equals(\"pracownik\")){\n\t\t\t\t\tsetFields(false);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\t\t\t\tsetFields(false);\n\t\t\t\tdeleteMenuItem.setDisable(true);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (LoginWindowController.loggedUser.getId() == user.getId()){\n\t\t\t\tdeleteMenuItem.setDisable(true);\n\t\t\t\tuserPermissionsBox.setDisable(true);\n\t\t\t}\n\t\t}\n\t}", "private boolean isPublic(String level, ModifierHolder mods) {\r\n\t\treturn level.equalsIgnoreCase(\"public\") && \r\n\t\t\t\tmods.isPublic();\r\n\t}", "private PermissionHelper() {}", "int getPermissionWrite();", "public String getPermissionAdmin() {\n return permissionAdmin;\n }", "@Override\n\tpublic void calculateModerator(String categoryPath, boolean isNew)\n\t\t\tthrows Exception {\n\n\t}", "boolean isAdmin();", "Object getPerm(String name, Object def);", "@Override\n\tpublic void saveModOfCategory(List<String> moderatorCate, String userId,\n\t\t\tboolean isAdd) {\n\n\t}", "public interface AccessManager {\n\n /**\n * predefined action constants\n */\n public String READ_ACTION = javax.jcr.Session.ACTION_READ;\n public String REMOVE_ACTION = javax.jcr.Session.ACTION_REMOVE;\n public String ADD_NODE_ACTION = javax.jcr.Session.ACTION_ADD_NODE;\n public String SET_PROPERTY_ACTION = javax.jcr.Session.ACTION_SET_PROPERTY;\n\n public String[] READ = new String[] {READ_ACTION};\n public String[] REMOVE = new String[] {REMOVE_ACTION};\n\n /**\n * Determines whether the specified <code>permissions</code> are granted\n * on the item with the specified path.\n *\n * @param parentState The node state of the next existing ancestor.\n * @param relPath The relative path pointing to the non-existing target item.\n * @param actions An array of actions that need to be checked.\n * @return <code>true</code> if the actions are granted; otherwise <code>false</code>\n * @throws ItemNotFoundException if the target item does not exist\n * @throws RepositoryException if another error occurs\n */\n boolean isGranted(NodeState parentState, Path relPath, String[] actions) throws ItemNotFoundException, RepositoryException;\n\n /**\n * Determines whether the specified <code>permissions</code> are granted\n * on the item with the specified path.\n *\n * @param itemState\n * @param actions An array of actions that need to be checked.\n * @return <code>true</code> if the actions are granted; otherwise <code>false</code>\n * @throws ItemNotFoundException if the target item does not exist\n * @throws RepositoryException if another error occurs\n */\n boolean isGranted(ItemState itemState, String[] actions) throws ItemNotFoundException, RepositoryException;\n\n\n /**\n * Returns true if the existing item with the given <code>ItemId</code> can\n * be read.\n *\n * @param itemState\n * @return\n * @throws ItemNotFoundException\n * @throws RepositoryException\n */\n boolean canRead(ItemState itemState) throws ItemNotFoundException, RepositoryException;\n\n /**\n * Returns true if the existing item state can be removed.\n *\n * @param itemState\n * @return\n * @throws ItemNotFoundException\n * @throws RepositoryException\n */\n boolean canRemove(ItemState itemState) throws ItemNotFoundException, RepositoryException;\n\n /**\n * Determines whether the subject of the current context is granted access\n * to the given workspace.\n *\n * @param workspaceName name of workspace\n * @return <code>true</code> if the subject of the current context is\n * granted access to the given workspace; otherwise <code>false</code>.\n * @throws NoSuchWorkspaceException if a workspace with the given name does not exist.\n * @throws RepositoryException if another error occurs\n */\n boolean canAccess(String workspaceName) throws NoSuchWorkspaceException, RepositoryException;\n}", "java.lang.String getAdmin();", "@RequestMapping(value = \"/memberships/uris/**/moderate\", method = RequestMethod.POST)\n public ModelAndView moderate_uri_access(HttpServletRequest request, @RequestParam(\"moderator\") String email) throws Exception {\n checkAdmin(request);\n String moderatedUri = substringBetween(request.getRequestURI(), \"/memberships/uris\", \"/moderate\");\n setModerator(new ModeratedItem(moderatedUri, email));\n\n return new ModelAndView(new OkResponseView());\n }", "public interface AccessControlled {\r\n\r\n}", "@Override\r\n protected void mayProceed() throws InsufficientPermissionException {\n if (ub.isSysAdmin() || ub.isTechAdmin()) {\r\n return;\r\n }\r\n// if (currentRole.getRole().equals(Role.STUDYDIRECTOR) || currentRole.getRole().equals(Role.COORDINATOR)) {// ?\r\n// ?\r\n// return;\r\n// }\r\n\r\n addPageMessage(respage.getString(\"no_have_correct_privilege_current_study\") + respage.getString(\"change_study_contact_sysadmin\"));\r\n throw new InsufficientPermissionException(Page.MENU_SERVLET, resexception.getString(\"not_allowed_access_extract_data_servlet\"), \"1\");// TODO\r\n // above copied from create dataset servlet, needs to be changed to\r\n // allow only admin-level users\r\n\r\n }", "@Override\n\tpublic void setAccessModifier(AccessModifier modifier) {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}", "public interface PermissionListener {\n\n void onGranted(); //授权\n\n void onDenied(List<String> deniedPermission); //拒绝 ,并传入被拒绝的权限\n}", "public String findPrivileges() {\r\n\r\n String thePrivilegeType = this.getParam(\"privilegeType\");\r\n if (thePrivilegeType == null) {\r\n this.privilegeTypeEnum = ScopeEnum.IMMEDIATE;\r\n } else {\r\n this.privilegeTypeEnum = ScopeEnum.valueOf(PrivilegesRadioEnum.fromLabel(thePrivilegeType).name());\r\n }\r\n\r\n this.clearContext();\r\n\r\n // The list of groups.\r\n List < Privilege > privileges = null;\r\n\r\n List < Subject > subjects = null;\r\n\r\n ParameterGroup parameterGroup = null;\r\n Iterator < Parameter > itParam = null;\r\n Parameter parameter = null;\r\n\r\n if (this.getGroupController().getGroup() != null && !this.getGroupController().getIsCreation()) {\r\n\r\n // Dynamic parameters\r\n List < String > attributes = new ArrayList < String >();\r\n IParameterService parameterService = this.getGroupController().getParameterService();\r\n\r\n parameterGroup = parameterService\r\n .findParametersByGroup(\"org.esco.grouperui.group.privileges.attribut\");\r\n\r\n // We retrieve the parameters from the database.\r\n itParam = parameterGroup.getParameters().iterator();\r\n while (itParam.hasNext()) {\r\n parameter = itParam.next();\r\n attributes.add(parameter.getKey());\r\n }\r\n\r\n // Dynamic source\r\n Map < String, SourceTypeEnum > sources = new HashMap < String, SourceTypeEnum >();\r\n parameterGroup = parameterService.findParametersByGroup(\"org.esco.grouperui.group.privileges.map\");\r\n\r\n itParam = parameterGroup.getParameters().iterator();\r\n while (itParam.hasNext()) {\r\n parameter = itParam.next();\r\n sources.put(parameter.getValue(), SourceTypeEnum.valueOf(parameter.getKey().toUpperCase()));\r\n }\r\n\r\n // The stem name from which we want to retrieve the privileges.\r\n String groupName = this.getGroupController().getGroup().getName();\r\n\r\n // The person from which we want to open the grouper session.\r\n Person userConnected = null;\r\n try {\r\n userConnected = PersonController.getConnectedPerson();\r\n } catch (ESCOSubjectNotFoundException e1) {\r\n GroupModificationsPrivilegesController.LOGGER.error(e1, \"Subject not found\");\r\n } catch (ESCOSubjectNotUniqueException e1) {\r\n GroupModificationsPrivilegesController.LOGGER.error(e1, \"Subject not unique\");\r\n }\r\n\r\n // The Membership Type selected via the Radio Button.\r\n PrivilegesRadioEnum radioType = PrivilegesRadioEnum.fromLabel(thePrivilegeType.toUpperCase());\r\n if (radioType == null) {\r\n radioType = PrivilegesRadioEnum.IMMEDIATE;\r\n }\r\n\r\n // The list of Subject corresponding to the find parameters.\r\n privileges = this.getGroupController().getGrouperService().findGroupPrivileges(userConnected,\r\n attributes, sources, groupName, ScopeEnum.valueOf(radioType.name()));\r\n\r\n GroupPrivileges groupPrivileges = new GroupPrivileges(privileges);\r\n subjects = groupPrivileges.getSubjects();\r\n\r\n Iterator < Subject > itSubject = subjects.iterator();\r\n while (itSubject.hasNext()) {\r\n this.data.add(itSubject.next());\r\n }\r\n }\r\n this.addedItems();\r\n\r\n // Create and return the XML status.\r\n XmlProducer producer = new XmlProducer();\r\n producer.setTarget(new Status(this.isRowToReturn()));\r\n producer.setTypesOfTarget(Status.class);\r\n\r\n return this.xmlProducerWrapper.wrap(producer);\r\n }", "public boolean canDo (Player player, Type type, boolean isAdmin){\r\n\t\tif (isAdmin || isOwner(player.getName()))\r\n\t\t\treturn true;\r\n\t\t\r\n\t\tif (!isMember(player.getName()))\r\n\t\t\treturn false; \r\n\t\t\r\n\t\tswitch (type) {\r\n\t\t\tcase ADD:\r\n\t\t\tcase GET:\r\n\t\t\t\treturn true;\r\n\t\t\tdefault:\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t}", "public boolean handlePerm(Player player, String perm);", "void permissionGranted(int requestCode);", "int getPermissionRead();", "void onPrivMsg(TwitchUser sender, TwitchMessage message);", "public String getFloodPerm(String dpidStr) throws PermissionDeniedException;", "public String getAccess();", "public Boolean setFloodPerm(String dpidStr, String floodPerm) throws PermissionDeniedException;", "@Override\n public void onPermissionGranted() {\n }", "public void genMutants(ModifierList mod) {\r\n\t\tif (mod.contains(ModifierList.PRIVATE)) {\r\n\t\t\tchangeModifier(mod, ModifierList.PRIVATE, -1);\r\n\t\t\tchangeModifier(mod, ModifierList.PRIVATE, ModifierList.PROTECTED);\r\n\t\t\tchangeModifier(mod, ModifierList.PRIVATE, ModifierList.PUBLIC);\r\n\r\n\t\t} else if (mod.contains(ModifierList.PROTECTED)) {\r\n\t\t\tchangeModifier(mod, ModifierList.PROTECTED, -1);\r\n\t\t\tchangeModifier(mod, ModifierList.PROTECTED, ModifierList.PRIVATE);\r\n\t\t\tchangeModifier(mod, ModifierList.PROTECTED, ModifierList.PUBLIC);\r\n\t\t} else if (mod.contains(ModifierList.PUBLIC)) {\r\n\t\t\tchangeModifier(mod, ModifierList.PUBLIC, -1);\r\n\t\t\tchangeModifier(mod, ModifierList.PUBLIC, ModifierList.PRIVATE);\r\n\t\t\tchangeModifier(mod, ModifierList.PUBLIC, ModifierList.PROTECTED);\r\n\t\t} else { // Friendly\r\n\t\t\tchangeModifier(mod, -1, ModifierList.PRIVATE);\r\n\t\t\tchangeModifier(mod, -1, ModifierList.PROTECTED);\r\n\t\t\tchangeModifier(mod, -1, ModifierList.PUBLIC);\r\n\t\t}\r\n\t}", "private Permit saveToPermitObject() {\n\n\n\n return null;\n\n }", "Object getPerm(String name);", "@Override\n public void onRequestAllow(String permissionName) {\n }", "void setPermission(String perm, boolean add);", "public void modifierArgent(int modificationArgent);", "public void askModification() {\n\t\t\n\t\n\t}", "public void setUsuarioModificacion(String p) { this.usuarioModificacion = p; }", "public void setUsuarioModificacion(String p) { this.usuarioModificacion = p; }", "Privilege getPrivilege();", "private void setPermissions( String userId, ProposalDevelopmentDocument doc, Set<String> editModes ) {\n\t\tif ( editModes.contains( AuthorizationConstants.EditMode.FULL_ENTRY ) ) {\n\t\t\teditModes.add( \"modifyProposal\" );\n\t\t}\n\n\t\tif ( canExecuteTask( userId, doc, TaskName.ADD_BUDGET ) ) {\n\t\t\teditModes.add( \"addBudget\" );\n\t\t}\n\n\t\tif ( canExecuteTask( userId, doc, TaskName.OPEN_BUDGETS ) ) {\n\t\t\teditModes.add( \"openBudgets\" );\n\t\t}\n\n\t\tif ( canExecuteTask( userId, doc, TaskName.MODIFY_BUDGET ) ) {\n\t\t\teditModes.add( \"modifyProposalBudget\" );\n\t\t}\n\n\t\tif ( canExecuteTask( userId, doc, TaskName.MODIFY_PROPOSAL_ROLES ) ) {\n\t\t\teditModes.add( \"modifyPermissions\" );\n\t\t}\n\n\t\tif ( canExecuteTask( userId, doc, TaskName.ADD_NARRATIVE ) ) {\n\t\t\teditModes.add( \"addNarratives\" );\n\t\t}\n\n\t\tif ( canExecuteTask( userId, doc, TaskName.CERTIFY ) ) {\n\t\t\teditModes.add( \"certify\" );\n\t\t}\n\n\t\tif ( canExecuteTask( userId, doc, TaskName.MODIFY_NARRATIVE_STATUS ) ) {\n\t\t\teditModes.add( \"modifyNarrativeStatus\" );\n\t\t}\n\n\t\tif ( canExecuteTask( userId, doc, TaskName.PRINT_PROPOSAL ) ) {\n\t\t\teditModes.add( \"printProposal\" );\n\t\t}\n\n\t\tif ( canExecuteTask( userId, doc, TaskName.ALTER_PROPOSAL_DATA ) ) {\n\t\t\teditModes.add( \"alterProposalData\" );\n\t\t}\n\n\t\tif ( canExecuteTask( userId, doc, TaskName.SHOW_ALTER_PROPOSAL_DATA ) ) {\n\t\t\teditModes.add( \"showAlterProposalData\" );\n\t\t}\n\n\t\tif ( canExecuteTask( userId, doc, TaskName.SUBMIT_TO_SPONSOR ) ) {\n\t\t\teditModes.add( \"submitToSponsor\" );\n\t\t}\n\t\tif ( canExecuteTask( userId, doc, TaskName.MAINTAIN_PROPOSAL_HIERARCHY ) ) {\n\t\t\teditModes.add( \"maintainProposalHierarchy\" );\n\t\t}\n\n\t\tif ( canExecuteTask( userId, doc, TaskName.REJECT_PROPOSAL ) ) {\n\t\t\teditModes.add( TaskName.REJECT_PROPOSAL );\n\t\t}\n\n\t\tsetNarrativePermissions( userId, doc, editModes );\n\t}", "public abstract boolean isAdminPacket();", "String privacyPolicy();", "@FunctionalInterface\npublic interface PermissionProvider {\n\n /**\n * Checks if a user can use a special kind of commands.\n *\n * @param level The {@link PermissionLevel} of the command\n * @param channel The channel the message occurred in\n * @param member The {@link Member} that send the message\n * @return True if the user has the rights to use the commands\n */\n boolean hasPermission(PermissionLevel level, TextChannel channel, Member member);\n\n /**\n * @return The default {@link PermissionProvider}.\n */\n static PermissionProvider getDefault() {\n return new IdPermissionsProvider();\n }\n\n enum PermissionLevel {\n ADMIN\n }\n}", "@Override\r\n\tpublic void specialAbility() {\n\t}", "JApiModifier<AccessModifier> getAccessModifier();", "boolean makeAdmin(User user);", "public String getPrivacy();", "@Override\n public void onGranted() {\n }", "public boolean getAdminPermission(boolean isAdmin)\n {\n return isAdmin;\n }", "@Override\n public void checkPermission(Permission perm) {\n }", "public void apply() {\n for (Player player : Bukkit.getOnlinePlayers())\n if (player.getName().equalsIgnoreCase(getName())) {\n for (PermissionAttachmentInfo attachmentInfo : player.getEffectivePermissions())\n if (attachmentInfo.getAttachment().getPlugin().getName().equalsIgnoreCase(\"rpermissions\")) {\n player.removeAttachment(attachmentInfo.getAttachment());\n break;\n }\n PermissionAttachment attachment = player.addAttachment(rPermissions.getInstance());\n for (Map.Entry<String, Boolean> entry : calculatePerms().entrySet())\n attachment.setPermission(entry.getKey(), entry.getValue());\n }\n }", "private boolean askForSuperviser(Person p) throws Exception {\n\n\t\treturn p.isResearcher() && (p.getInstitutionalRoleId() > 1);\n\t}", "public void grantAdminOnIndividualToSystemUser(Individual i, SystemUser user);", "public boolean isUpdateRight() {\r\n if (getUser() != null) {\r\n return getUser().hasPermission(\"/vocabularies\", \"u\");\r\n }\r\n return false;\r\n }", "@Override\n public void onPermissionGranted() {\n }", "private void init() {\r\n\t\t// administration\r\n\t\taddPrivilege(CharsetAction.class, User.ROLE_ADMINISTRATOR);\r\n\t\taddPrivilege(LanguageAction.class, User.ROLE_ADMINISTRATOR);\r\n\t\t\r\n\t\t// dictionary management\r\n\t\taddPrivilege(AddApplicationAction.class, User.ROLE_APPLICATION_OWNER | User.ROLE_TRANSLATION_MANAGER);\r\n\t\taddPrivilege(AddDictLanguageAction.class, User.ROLE_APPLICATION_OWNER | User.ROLE_TRANSLATION_MANAGER);\r\n\t\taddPrivilege(AddLabelAction.class, User.ROLE_APPLICATION_OWNER);\r\n\t\taddPrivilege(ChangeApplicationVersionAction.class, User.ROLE_APPLICATION_OWNER | User.ROLE_TRANSLATION_MANAGER);\r\n\t\taddPrivilege(ChangeDictVersionAction.class, User.ROLE_APPLICATION_OWNER | User.ROLE_TRANSLATION_MANAGER);\r\n\t\taddPrivilege(CreateApplicationAction.class, User.ROLE_APPLICATION_OWNER | User.ROLE_TRANSLATION_MANAGER);\r\n\t\taddPrivilege(CreateApplicationBaseAction.class, User.ROLE_APPLICATION_OWNER | User.ROLE_TRANSLATION_MANAGER);\r\n\t\taddPrivilege(CreateOrAddApplicationAction.class, User.ROLE_APPLICATION_OWNER | User.ROLE_TRANSLATION_MANAGER);\r\n\t\taddPrivilege(CreateProductAction.class, User.ROLE_APPLICATION_OWNER | User.ROLE_TRANSLATION_MANAGER);\r\n\t\taddPrivilege(CreateProductReleaseAction.class, User.ROLE_APPLICATION_OWNER | User.ROLE_TRANSLATION_MANAGER);\r\n\t\taddPrivilege(DeleteLabelAction.class, User.ROLE_APPLICATION_OWNER);\r\n\t\taddPrivilege(DeliverAppDictAction.class, User.ROLE_APPLICATION_OWNER);\r\n\t\taddPrivilege(DeliverDictAction.class, User.ROLE_APPLICATION_OWNER);\r\n\t\taddPrivilege(DeliverUpdateDictAction.class, User.ROLE_APPLICATION_OWNER);\r\n\t\taddPrivilege(DeliverUpdateDictLanguageAction.class, User.ROLE_APPLICATION_OWNER);\r\n\t\taddPrivilege(DeliverUpdateLabelAction.class, User.ROLE_APPLICATION_OWNER);\r\n\t\taddPrivilege(RemoveApplicationAction.class, User.ROLE_APPLICATION_OWNER | User.ROLE_TRANSLATION_MANAGER);\r\n\t\taddPrivilege(RemoveApplicationBaseAction.class, User.ROLE_APPLICATION_OWNER | User.ROLE_TRANSLATION_MANAGER);\r\n\t\taddPrivilege(RemoveDictAction.class, User.ROLE_APPLICATION_OWNER);\r\n\t\taddPrivilege(RemoveDictLanguageAction.class, User.ROLE_APPLICATION_OWNER);\r\n\t\taddPrivilege(RemoveProductAction.class, User.ROLE_APPLICATION_OWNER | User.ROLE_TRANSLATION_MANAGER);\r\n\t\taddPrivilege(RemoveProductBaseAction.class, User.ROLE_APPLICATION_OWNER | User.ROLE_TRANSLATION_MANAGER);\r\n\t\taddPrivilege(UpdateDictAction.class, User.ROLE_APPLICATION_OWNER | User.ROLE_TRANSLATION_MANAGER);\r\n\t\taddPrivilege(UpdateDictLanguageAction.class, User.ROLE_APPLICATION_OWNER | User.ROLE_TRANSLATION_MANAGER);\r\n\t\taddPrivilege(UpdateLabelAction.class, User.ROLE_APPLICATION_OWNER | User.ROLE_TRANSLATION_MANAGER);\r\n\t\taddPrivilege(UpdateLabelStatusAction.class, User.ROLE_APPLICATION_OWNER | User.ROLE_TRANSLATION_MANAGER);\r\n\t\taddPrivilege(ImportTranslationDetailsAction.class, User.ROLE_APPLICATION_OWNER | User.ROLE_TRANSLATION_MANAGER);\r\n\r\n\t\taddPrivilege(UpdateLabelRefAndTranslationsAction.class, User.ROLE_APPLICATION_OWNER | User.ROLE_TRANSLATION_MANAGER);\r\n\t\taddPrivilege(GlossaryAction.class, User.ROLE_ADMINISTRATOR);\r\n\r\n\r\n\t\t// translation management\r\n\t\taddPrivilege(UpdateStatusAction.class, User.ROLE_APPLICATION_OWNER | User.ROLE_TRANSLATION_MANAGER);\r\n\t\taddPrivilege(UpdateTranslationAction.class, User.ROLE_APPLICATION_OWNER | User.ROLE_TRANSLATION_MANAGER);\r\n\t\t\r\n\t\t// task management\r\n\t\taddPrivilege(ApplyTaskAction.class, User.ROLE_TRANSLATION_MANAGER);\r\n\t\taddPrivilege(CloseTaskAction.class, User.ROLE_TRANSLATION_MANAGER);\r\n\t\taddPrivilege(CreateTaskAction.class, User.ROLE_TRANSLATION_MANAGER);\r\n\t\taddPrivilege(ReceiveTaskFilesAction.class, User.ROLE_TRANSLATION_MANAGER);\r\n\t}", "@Override\n public void onGranted() {\n }" ]
[ "0.679996", "0.6329394", "0.63014245", "0.6183691", "0.60106575", "0.59729004", "0.59248006", "0.5883345", "0.58567667", "0.5837052", "0.5807433", "0.5800699", "0.5757531", "0.5734203", "0.5715413", "0.56905025", "0.5670601", "0.5643749", "0.561722", "0.5606772", "0.5584786", "0.5583688", "0.5563496", "0.5532459", "0.55318606", "0.5529616", "0.54924154", "0.5484454", "0.54639596", "0.54627407", "0.5456891", "0.54355425", "0.5432668", "0.54325175", "0.54317915", "0.54303503", "0.5429857", "0.54246813", "0.54122716", "0.540943", "0.5407547", "0.54043734", "0.5384263", "0.5384127", "0.537097", "0.53668493", "0.5362013", "0.5354474", "0.5353071", "0.5346424", "0.53364015", "0.53248715", "0.5321251", "0.53126556", "0.5303603", "0.52816516", "0.5278762", "0.52774245", "0.52770275", "0.5271161", "0.5269595", "0.5259577", "0.52510756", "0.52463686", "0.5236213", "0.52287996", "0.5227645", "0.5208655", "0.5203036", "0.5195514", "0.5183664", "0.5183355", "0.5179482", "0.5179473", "0.517135", "0.51666784", "0.51558954", "0.51506364", "0.5146943", "0.5141799", "0.5141799", "0.51411855", "0.51408273", "0.513428", "0.51313394", "0.5128636", "0.5119388", "0.5119015", "0.51157993", "0.5106075", "0.5104452", "0.5099703", "0.5098416", "0.5094405", "0.50913167", "0.5090704", "0.5088972", "0.50840896", "0.50840324", "0.5082067" ]
0.6651868
1
provides access to votes
public int getVotes() { return votes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getVotes() {\n return this.votes;\n }", "public Integer getVotes();", "public void setVotes(int votes) {\n this.votes = votes;\n }", "public void addVote() {\n this.votes++;\n }", "public static void doVote() {\n }", "void votedOnPoll(String pollId);", "public Ratio getVotes() {\n return votes;\n }", "public Float getVote() {\n return vote;\n }", "public void vote(int index,Person voter,ArrayList<String> choices){\n votingList.get(index).vote(voter,choices);\n\n }", "public ArrayList<Voting> getVotingList() {\n return votingList;\n }", "public Voting getVoting(int index){\n return votingList.get(index);\n }", "int getVotes(QuestionId questionId);", "public VotingSystem(){\n votingList = new ArrayList<Voting>();\n }", "@GET(\"/{interaction-id}/votes\")\n List<GetGlueInteraction> votes(\n @EncodedPath(\"interaction-id\") String interactionId\n );", "public interface VoteRepository {\n List<Vote> searchVotes(VoteSearchCriteria searchCriteria);\n\n Vote getVoteById(int voteId);\n\n List<Vote> getActiveVotes();\n\n void saveVote(Vote vote);\n\n void deleteVote(int voteId);\n\n List<Subject> getSubjectsByVote(int voteId);\n\n void addSubjectToVote(int voteId, List<Subject> subjects);\n\n List<Vote> getVotesBySubject(int subjectId);\n\n void shutDown();\n\n int countVotes();\n}", "void addVote(UserId userId, QuestionId questionId, int vote);", "Vote get(int id, int userId);", "@Test\n public void vote() {\n System.out.println(client.makeVotes(client.companyName(0), \"NO\"));\n }", "public VotingSystem() {\n votingList=new ArrayList<>();\n }", "TrackerVotes getTrackerVotes(final Integer id);", "public void addVote(String token);", "void castVote(Peer candidate) {\n votedFor = candidate;\n }", "public void countVotes() {\n int[] voteResponses = RaftResponses.getVotes(mConfig.getCurrentTerm());\n int numVotes = 0;\n if(voteResponses == null) {\n //System.out.println(mID + \" voteResponses null\");\n //System.out.println(\"cur \" + mConfig.getCurrentTerm() + \" RR: \" + RaftResponses.getTerm());\n }\n else {\n for(int i = 1; i <= mConfig.getNumServers(); i++) {\n //If vote has not been received yet, resend request\n //if(voteResponses[i] == -1)\n //this.remoteRequestVote(i, mConfig.getCurrentTerm(), mID, mLog.getLastIndex(), mLog.getLastTerm());\n if(voteResponses[i] == 0)\n numVotes++;\n }\n }\n //If election is won, change to leader\n if(numVotes >= (mConfig.getNumServers()/2.0)) {\n electionTimer.cancel();\n voteCountTimer.cancel();\n RaftServerImpl.setMode(new LeaderMode());\n }\n else {\n voteCountTimer = scheduleTimer((long) 5, 2);\n }\n }", "public void setVotes(Set<Vote> arg0) {\n \n }", "@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\n\t\t\t\t\tdoVote(getIntent().getStringExtra(\"aid\"), getIntent().getStringExtra(\"id\"));\n\t\t\t\t\t\n\t\t\t\t}", "public void printVottingQuestion(){\n for (Voting voting : votingList){\n System.out.println(\"question : \"+voting.getQuestion());\n }\n\n }", "public static void doVoteAndComment() {\n }", "public int calculateVotes() {\n return 1;\n }", "public Map<String, Integer> getVotes(){\r\n\t\treturn allVotes;\r\n\t}", "public void vote(int rating) {\n\t\tnew WebTraceTask(this, String.valueOf(rating)).execute(WebTraceTask.VOTE);\n\t}", "public void printVoting(int index){\n System.out.println(\"vote question : \"+votingList.get(index).getQuestion());\n for (int i = 0;i<votingList.get(index).getPolls().size();i++){\n System.out.println(\"poll \"+(i+1)+\" : \"+votingList.get(index).getPolls().get(i));\n }\n }", "int getVoteValue(UserId userId, QuestionId questionId);", "public void addVote(String vote){\r\n\t\tif(allVotes.get(vote) == null){\r\n\t\t\tallVotes.put(vote, 1);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tallVotes.put(vote, allVotes.get(vote) + 1);\r\n\t\t}\r\n\t\tsetChanged();\r\n\t\tnotifyObservers(\"vote\");\r\n\t}", "public interface VoteService {\n\n\tvoid addVote(Vote contact);\n\n\tList<Vote> listVote();\n\n\tvoid removeVote(String id);\n\n\tvoid closeVote(String id);\n\n\tVote getVote(String id);\n\n\tvoid firstCounterIncrementer(String id);\n\n\tvoid secondCounterIncrementer(String id);\n}", "public void voteIdea(String username, Long ideaId, boolean vote) throws VotingException, DataAccessException {\n try {\n MyUser user = myUserFacade.getUser(username);\n Idea idea = this.find(ideaId);\n Boolean previousVote = user.getVotes().get(idea);\n if (previousVote == null) {\n // If the user never voted for this idea, then create a new Vote:\n user.addVote(idea, vote);\n if (vote) {\n idea.upvote();\n } else {\n idea.downvote();\n }\n } else {\n // The user had previously voted for this idea.\n // Case 1: trying to upvote twice the idea:\n if (previousVote && vote) {\n throw new VotingException((null), \"Cannot upvote twice the same post\");\n } // Case 2: trying to downvote twice the idea:\n else if (!previousVote && !vote) {\n throw new VotingException((null), \"Cannot downvote twice the same post\");\n } // Case 3: one is upvote and the other downvote. Vote is removed\n else {\n user.removeVote(idea);\n if (vote) {\n idea.setUpvotes(idea.getUpvotes() - 1);\n } else {\n idea.setDownvotes(idea.getDownvotes() - 1);\n }\n }\n }\n myUserFacade.edit(user);\n this.edit(idea);\n } catch (PersistenceException | EJBException pe) {\n throw new DataAccessException(pe, \"Error while voting post\");\n }\n }", "public Set<Vote> getVotes() {\n return null;\n }", "private void postVote() {\n if ( unvotedParties() == 0 )\n TransactionManager.getTransactionManager().resolveTransaction(txId);\n }", "public String toString() {\n return this.name + \": \" + this.votes;\n }", "public int getNumVotes() {\n return numVotes;\n }", "public Vote(int id, int v) {\n candidate_id = id;\n priority = v;\n }", "public void upVote(Post p) {\n p.upvote();\n }", "public void vote(int index,Person personName,ArrayList<String> choices){\n if (votingList.get(index).getType()==0 && choices.size()==1 && choices.get(0).equals(\"random\")){\n\n Random random = new Random();\n int rand = random.nextInt(votingList.get(index).getPolls().size());\n choices.remove(0);\n choices.add(votingList.get(index).getPolls().get(rand));\n }\n\n votingList.get(index).vote(personName,choices);\n\n }", "public void setNumVotes(int value) {\n this.numVotes = value;\n }", "boolean hasVotedInTerm() {\n return null != votedFor;\n }", "public synchronized void reportVotes() {\n StringBuilder voteReport = new StringBuilder(\"\");\n for (Player player : playerVotes.keySet()) {\n voteReport.append(player.getUserName()).append(\": \").append(\n playerVotes.get(player) ? \"yes\\n\" : \"no\\n\");\n }\n sendPublicMessage(\"The votes were:\\n\" + voteReport.toString());\n }", "TrackerVotes loadTrackerVotes(final Integer id);", "public void addKickVote()\n\t{\n\t\tthis.numberOfKickVotes++;\n\t}", "public interface VotingService {\n\n public String deploy(List<String> list) throws Exception;\n\n\n public TransactionReceipt voteForCandidate(String candidateName) throws Exception;\n\n public BigInteger totalVotesFor(String candidateName) throws Exception;\n\n}", "void handle(VoteMessage vote);", "private void vote(Vote whichVoteButton, MenuItem item, PostData p) {\n if (!RedditLoginInformation.isLoggedIn()) {\n Toast.makeText(this, R.string.you_must_be_logged_in_to_vote, Toast.LENGTH_SHORT).show();\n return;\n }\n\n Intent intent = new Intent(Consts.BROADCAST_UPDATE_SCORE);\n intent.putExtra(Consts.EXTRA_PERMALINK, p.getPermalink());\n\n switch (whichVoteButton) {\n case DOWN:\n switch (p.getVote()) {\n case DOWN:\n RedditService.vote(this, p.getName(), Vote.NEUTRAL);\n item.setIcon(R.drawable.ic_action_downvote);\n p.setVote(Vote.NEUTRAL);\n p.setScore(p.getScore() + 1);\n break;\n\n case NEUTRAL:\n case UP:\n RedditService.vote(this, p.getName(), Vote.DOWN);\n item.setIcon(R.drawable.ic_action_downvote_highlighted);\n p.setVote(Vote.DOWN);\n mUpvoteMenuItem.setIcon(R.drawable.ic_action_upvote);\n p.setScore(p.getScore() - 1);\n break;\n }\n break;\n\n case UP:\n switch (p.getVote()) {\n case NEUTRAL:\n case DOWN:\n RedditService.vote(this, p.getName(), Vote.UP);\n item.setIcon(R.drawable.ic_action_upvote_highlighted);\n p.setVote(Vote.UP);\n p.setScore(p.getScore() + 1);\n mDownvoteMenuItem.setIcon(R.drawable.ic_action_downvote);\n break;\n\n case UP:\n RedditService.vote(this, p.getName(), Vote.NEUTRAL);\n item.setIcon(R.drawable.ic_action_upvote);\n p.setVote(Vote.NEUTRAL);\n p.setScore(p.getScore() - 1);\n break;\n }\n\n break;\n\n default:\n break;\n }\n\n // Broadcast the intent to update the score in the ImageDetailFragment\n intent.putExtra(Consts.EXTRA_SCORE, p.getScore());\n LocalBroadcastManager.getInstance(this).sendBroadcast(intent);\n }", "public interface VoteHandler {\n\n /**\n * Handle the user's vote to alter the media's score\n *\n * @param vote User's vote\n */\n void handle(VoteMessage vote);\n\n}", "@Override\n public List<VoteAnswer> findAllVotesFromUserId(int id) {\n return template.query(\"SELECT * FROM \" + tableName + \" WHERE user = ?\", rowMapper, id);\n }", "@OnClick(R.id.upvote)\n public void onUpvoteClicked() {\n upvoted.setEnabled(false);\n downvoted.setEnabled(true);\n dataItem.setUpvoted();\n points++;\n upvoted.setBackgroundColor(Color.parseColor(\"#666bff\"));\n downvoted.setBackgroundColor(Color.parseColor(\"#ffffff\"));\n a.setText(points + \" points\");\n }", "public void printResult(int index){\n votingList.get(index).printVotes();\n }", "public void printResult(int index){\n votingList.get(index).printVotes();\n }", "protected SyncedLearnerTracker getVoteTracker(Map<Long, Vote> votes, Vote vote) {\n SyncedLearnerTracker voteSet = new SyncedLearnerTracker();\n voteSet.addQuorumVerifier(self.getQuorumVerifier());\n if (self.getLastSeenQuorumVerifier() != null\n && self.getLastSeenQuorumVerifier().getVersion() > self.getQuorumVerifier().getVersion()) {\n voteSet.addQuorumVerifier(self.getLastSeenQuorumVerifier());\n }\n\n /*\n * First make the views consistent. Sometimes peers will have different\n * zxids for a server depending on timing.\n */\n for (Map.Entry<Long, Vote> entry : votes.entrySet()) {\n if (vote.equals(entry.getValue())) {\n voteSet.addAck(entry.getKey());\n }\n }\n\n return voteSet;\n }", "public String getVoteurl() {\n return voteurl;\n }", "boolean hasVotedOnPoll(String pollId);", "@Override\n public void onThirdVote(String arg0) {\n\n }", "public static void main(String[] args)\r\n{\r\n\tresetVotes();\r\n\tVoteRecorder voter1 = new VoteRecorder();\t\r\n\tvoter1.getAndConfirmVotes();\r\n\tSystem.out.println(\"President: \" + getCurrentVotePresident());\r\n\tSystem.out.println(\"Vice President: \" + getCurrentVoteVicePresident());\r\n\tSystem.out.println(votesCandidatePresident1);\r\n\r\n}", "Vote getWithUserAndRestaurant(int id, int userId);", "public void setVotingThreshold(double votingThreshold) {\n this.votingThreshold = votingThreshold;\n }", "private void botVoting(){\n int stockPos;\n int myStockPos = getMostShares(playerList.lastIndexOf(player));\n Collections.sort(playerList);\n if(playerList.get(0) == player){ //if i am the leader\n stockPos = getMostShares(1); //get the second players info\n }else{\n stockPos = getMostShares(0); //else get the first players info\n }\n\n //if my most shares are the same as other players most shares, don't vote.\n if(game.getStockByIndex(stockPos) != game.getStockByIndex(myStockPos)){\n //offensive play against leader\n if(game.isCardPositive(game.getStockByIndex(stockPos))){\n game.getStockByIndex(stockPos).vote(0);\n player.getVotedStocks().append(game.getStockByIndex(stockPos).getName().charAt(0));\n player.deductVotesLeft();\n System.out.println(\"bot voted NO for \" + game.getStockByIndex(stockPos).getName() );\n }else{\n game.getStockByIndex(stockPos).vote(1);\n player.getVotedStocks().append(game.getStockByIndex(stockPos).getName().charAt(0));\n player.deductVotesLeft();\n System.out.println(\"bot voted YES for \" + game.getStockByIndex(stockPos).getName());\n }\n //defensive play, votes that will benefit me\n if(game.isCardPositive(game.getStockByIndex(myStockPos))){\n game.getStockByIndex(myStockPos).vote(1);\n player.getVotedStocks().append(game.getStockByIndex(myStockPos).getName().charAt(0));\n player.deductVotesLeft();\n System.out.println(\"bot voted YES for \" + game.getStockByIndex(myStockPos).getName());\n }else{\n game.getStockByIndex(myStockPos).vote(0);\n player.getVotedStocks().append(game.getStockByIndex(myStockPos).getName().charAt(0));\n player.deductVotesLeft();\n System.out.println(\"bot voted NO for \" + game.getStockByIndex(myStockPos).getName());\n }\n }\n }", "public synchronized void beginVoting() {\n\t\tvotingThread = new Thread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\t// votes should be filled with [each delegate] -> `null`\n\t\t\t\tfor (int i = 0; i < 2 /* rounds */; i++) {\n\t\t\t\t\tfor (Delegate delegate : votes.keySet()) {\n\t\t\t\t\t\tif (votes.get(delegate) != null) {\n\t\t\t\t\t\t\t// Already voted.\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurrentlyVoting = delegate;\n\t\t\t\t\t\tlblCurrentVoter.setText(delegate.getName());\n\t\t\t\t\t\tlblCurrentVoter.setIcon(delegate.getSmallIcon());\n\n\t\t\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\t\t\tfinal List<Map<Vote, JButton>> maplist = Arrays.asList(\n\t\t\t\t\t\t\t\tbuttons_roundOne, buttons_roundTwo);\n\t\t\t\t\t\tfor (Map<Vote, JButton> map : maplist) {\n\t\t\t\t\t\t\tfor (Vote vote : map.keySet()) {\n\t\t\t\t\t\t\t\tmap.get(vote)\n\t\t\t\t\t\t\t\t\t\t.setText(\n\t\t\t\t\t\t\t\t\t\t\t\tdelegate.getStatus().hasVetoPower ? vote.vetoText\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: vote.normalText);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tsynchronized (votingThread) {\n\t\t\t\t\t\t\t\tvotingThread.wait();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfinal Vote cast = votes.get(delegate);\n\t\t\t\t\t\tif (cast == Vote.PASS) {\n\t\t\t\t\t\t\tvotes.put(delegate, null);\n\t\t\t\t\t\t\t// So he goes again.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (JButton button : votingButtons) {\n\t\t\t\t\t\t\tbutton.setEnabled(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlayout.show(pnlVoting, pnlSecondRound.getName());\n\t\t\t\t}\n\t\t\t\t// When done, disable again.\n\t\t\t\tfor (JButton button : votingButtons) {\n\t\t\t\t\tbutton.setEnabled(false);\n\t\t\t\t}\n\t\t\t\tcurrentlyVoting = null;\n\t\t\t\tlblCurrentVoter.setText(null);\n\t\t\t\tlblCurrentVoter.setIcon(null);\n\t\t\t\tpnlVoting.setVisible(false);\n\t\t\t}\n\t\t});\n\t\tvotingThread.start();\n\t}", "public boolean didStudentVote() {\n\t\treturn voted;\n\t}", "public Vector getRatingsVector()\n {\n\n return new Vector(getLikedUsers(),id);\n\n }", "private synchronized void delegateVoted(Vote voteType) {\n\t\tvotes.put(currentlyVoting, voteType);\n\t\tif (currentlyVoting.getStatus().hasVetoPower && voteType.isVoteAgainst) {\n\t\t\t// A delegate with veto power voted against.\n\t\t\tvetoed = true;\n\t\t}\n\t\tsynchronized (votingThread) {\n\t\t\tvotingThread.notify();\n\t\t}\n\t}", "public Response<Poll> votePoll(String id, long[] choices);", "public String getVoteURL() {\r\n\t\treturn voteURL;\r\n\t}", "public void sendVoteRequests() {\n for(int i = 1; i <= mConfig.getNumServers(); i++) {\n this.remoteRequestVote(i, mConfig.getCurrentTerm(), mID, mLog.getLastIndex(), mLog.getLastTerm());\n }\n //Initiate count vote timer\n voteCountTimer = scheduleTimer((long) 5, 2);\n }", "public JsonObject addVote(String login, String token, String target,\r\n String voteRating) throws IOException {\r\n /*\r\n\r\n Refactoring notes: this function is overgrown.\r\n */\r\n JsonObject object = utils.authCheck(login, token);\r\n if (!StringUtils.isBlank(object.get(\"error\").getAsString())) {\r\n return object;\r\n }\r\n if (StringUtils.isBlank(target)) {\r\n object.addProperty(\"error\", \"target user parameter is blank\");\r\n return object;\r\n }\r\n if (!reader.loginExistCheck(target)) {\r\n object.addProperty(\"error\", \"target user doesn't exist\");\r\n return object;\r\n }\r\n if (target.equals(login)) {\r\n object.addProperty(\"error\", \"you cannot vote for yourself\");\r\n return object;\r\n }\r\n int voteRate;\r\n if (StringUtils.isBlank(voteRating)) {\r\n voteRate = 1;\r\n } else {\r\n try {\r\n voteRate = Integer.parseInt(voteRating);\r\n } catch (Exception e) {\r\n voteRate = 1;\r\n }\r\n }\r\n if (voteRate < 0) {\r\n voteRate = -1;\r\n } else {\r\n voteRate = 1;\r\n }\r\n JsonArray featured = serializer.getFeaturedMentors(login);\r\n boolean isFeatured = false;\r\n if (featured.size() > 0) {\r\n for (int i = 0; i < featured.size(); i++) {\r\n if (featured.get(i).getAsString().equals(target)) {\r\n isFeatured = true;\r\n break;\r\n }\r\n }\r\n }\r\n if (isFeatured) {\r\n if (voteRate == -1) {\r\n serializer.deleteFeaturedMentor(login, target);\r\n utils.addFlash(login, \"user \" + target + \" unfeatured\", \"this \" +\r\n \"user is removed from featured list\",\r\n \"user featured deleted\");\r\n }\r\n } else {\r\n if (voteRate == 1) {\r\n serializer.addFeaturedMentor(login, target);\r\n utils.addFlash(login, \"user \" + target + \" featured\", \"this user \" +\r\n \"is added to featured list\", \"user featured deleted\");\r\n stats.produceUserStatsIncreasing(login, \"users_interesting\", 1);\r\n }\r\n }\r\n JsonObject vote = new JsonObject();\r\n vote.addProperty(\"login\", login);\r\n vote.addProperty(\"vote\", voteRate);\r\n JsonArray votes = serializer.getVotes(target);\r\n if (votes.size() > 0) {\r\n for (int i = 0; i < votes.size(); i++) {\r\n JsonObject oldVote = votes.get(i).getAsJsonObject();\r\n if (oldVote.get(\"login\").getAsString().equals(login)) {\r\n int old = Integer.parseInt(oldVote.get(\"vote\").getAsString());\r\n if (old == voteRate) {\r\n if (voteRate == 1) {\r\n object.addProperty(\"error\", \"you already voted for this user, \" +\r\n \"but you can vote against\");\r\n utils.addFlash(login, \"already voted for \" + target,\r\n object.get(\"error\").getAsString(), \"vote failed\");\r\n } else {\r\n object.addProperty(\"error\", \"you already voted against this \" +\r\n \"user, but you can vote for him\");\r\n utils.addFlash(login, \"already voted against \" + target,\r\n object.get(\"error\").getAsString(), \"vote failed\");\r\n }\r\n return object;\r\n }\r\n }\r\n }\r\n }\r\n serializer.addVote(target, vote);\r\n String type = \"new vote\";\r\n String title = login + \" voted for you\";\r\n String description = \"You have received a thumbs up vote.\";\r\n if (!(voteRate == 1)) {\r\n title = login + \" voted against you\";\r\n description = \"You have received a thumbs down vote. Please contact \" +\r\n \"us if you feel this is an error or want to dispute. \";\r\n }\r\n utils.addFlash(target, title, description, type);\r\n if (voteRate == 1) {\r\n stats.produceUserStatsIncreasing(login, \"votes_for\", 1);\r\n title = \"Your thumbs up vote for \" + target + \" was received.\";\r\n } else {\r\n stats.produceUserStatsIncreasing(login, \"votes_against\", 1);\r\n title = \"Your thumbs down vote for \" + target + \" was received.\";\r\n }\r\n description = \"you always can change your vote\";\r\n utils.addFlash(login, title, description, type);\r\n stats.produceUserStatsIncreasing(login, \"time_action\",\r\n System.currentTimeMillis());\r\n stats.writeUserAction(login, \"vote added\", \"success\",\r\n \"target - \" + target + \", vote - \" + voteRate);\r\n return object;\r\n }", "public void printVotingQuestions(){\n int i=0;\n System.out.println(\"Question\");\n for (Voting v:votingList) {\n System.out.println(i+\":\"+v.getQuestion());\n i++ ;\n }\n }", "private int[] collectVotes()\n {\n int[] votes = new int[ 6 ];\n double centerX = (double) xCoord + 0.5;\n double centerY = (double) yCoord + 0.5;\n double centerZ = (double) zCoord + 0.5;\n\n // For each player:\n List players = worldObj.playerEntities;\n for( int i = 0; i < players.size(); ++i )\n {\n // Determine whether they're looking at the block:\n EntityPlayer player = (EntityPlayer) players.get( i );\n if( player != null )\n {\n // Check the player can see:\n if( QCraft.isPlayerWearingGoggles( player ) )\n {\n continue;\n }\n else\n {\n ItemStack headGear = player.inventory.armorItemInSlot( 3 );\n if( headGear != null && headGear.getItem() == Item.getItemFromBlock( Blocks.pumpkin ) )\n {\n continue;\n }\n }\n\n // Get position info:\n double x = player.posX - centerX;\n double y = player.posY + 1.62 - (double) player.yOffset - centerY;\n double z = player.posZ - centerZ;\n\n // Check distance:\n double distance = Math.sqrt( x * x + y * y + z * z );\n if( distance < 96.0 )\n {\n // Get direction info:\n double dx = x / distance;\n double dy = y / distance;\n double dz = z / distance;\n\n // Get facing info:\n float pitch = player.rotationPitch;\n float yaw = player.rotationYaw;\n float f3 = MathHelper.cos( -yaw * 0.017453292f - (float) Math.PI );\n float f4 = MathHelper.sin( -yaw * 0.017453292f - (float) Math.PI );\n float f5 = -MathHelper.cos( -pitch * 0.017453292f );\n float f6 = MathHelper.sin( -pitch * 0.017453292f );\n float f7 = f4 * f5;\n float f8 = f3 * f5;\n double fx = (double) f7;\n double fy = (double) f6;\n double fz = (double) f8;\n\n // Compare facing and direction (must be close to opposite):\n double dot = fx * dx + fy * dy + fz * dz;\n if( dot < -0.4 )\n {\n if( QCraft.enableQBlockOcclusionTesting )\n {\n // Do some occlusion tests\n Vec3 playerPos = Vec3.createVectorHelper( centerX + x, centerY + y, centerZ + z );\n boolean lineOfSightFound = false;\n for( int side = 0; side < 6; ++side )\n {\n // Only check faces that are facing the player\n Vec3 sideNormal = Vec3.createVectorHelper(\n 0.49 * Facing.offsetsXForSide[ side ],\n 0.49 * Facing.offsetsYForSide[ side ],\n 0.49 * Facing.offsetsZForSide[ side ]\n );\n Vec3 blockPos = Vec3.createVectorHelper(\n centerX + sideNormal.xCoord,\n centerY + sideNormal.yCoord,\n centerZ + sideNormal.zCoord\n );\n Vec3 playerPosLocal = playerPos.addVector(\n -blockPos.xCoord,\n -blockPos.yCoord,\n -blockPos.zCoord\n );\n //if( playerPosLocal.dotProduct( sideNormal ) > 0.0 )\n {\n Vec3 playerPos2 = playerPos.addVector( 0.0, 0.0, 0.0 );\n if( checkRayClear( playerPos2, blockPos ) )\n {\n lineOfSightFound = true;\n break;\n }\n }\n }\n if( !lineOfSightFound )\n {\n continue;\n }\n }\n\n // Block is being observed!\n\n // Determine the major axis:\n int majoraxis = -1;\n double majorweight = 0.0f;\n\n if( -dy >= majorweight )\n {\n majoraxis = 0;\n majorweight = -dy;\n }\n if( dy >= majorweight )\n {\n majoraxis = 1;\n majorweight = dy;\n }\n if( -dz >= majorweight )\n {\n majoraxis = 2;\n majorweight = -dz;\n }\n if( dz >= majorweight )\n {\n majoraxis = 3;\n majorweight = dz;\n }\n if( -dx >= majorweight )\n {\n majoraxis = 4;\n majorweight = -dx;\n }\n if( dx >= majorweight )\n {\n majoraxis = 5;\n majorweight = dx;\n }\n\n // Vote for this axis\n if( majoraxis >= 0 )\n {\n if( getSubType() == BlockQBlock.SubType.FiftyFifty )\n {\n boolean flip = s_random.nextBoolean();\n if( flip )\n {\n majoraxis = Facing.oppositeSide[ majoraxis ];\n }\n }\n votes[ majoraxis ]++;\n }\n }\n }\n }\n }\n\n return votes;\n }", "private void vote(ActionEvent x) {\n\t\tProject p = this.list.getSelectedValue();\n\t\tif (p != null) {\n\t\t\tif (this.controller.vote(p.getName())) {\n\t\t\t\tfield3.addSupported(p);\n\t\t\t}\n\t\t}\n\t}", "@Override\n public String getDescription() {\n return \"Vote casting\";\n }", "@Override\n public List<VoteAnswer> findAllVotesTowardsUserId(int userId) {\n return template.query(\"SELECT * FROM \" + tableName + \" WHERE vote_recipient = ?\", rowMapper, userId);\n }", "public void printVoting(int index){\n System.out.print(\"Question : \"+votingList.get(index).getQuestion()+\" Choices: \");\n int i=0;\n for (String s:votingList.get(index).getChoices()) {\n System.out.print(i + \": \" + s + \" \");\n i++;\n }\n System.out.println();\n }", "private void receiveVote() {\n\t\t//Se la postazione termina la connessione informiamo lo staff con un messaggio di errore\n\t\tif(!link.hasNextLine()) {\n\t\t\tcontroller.printError(\"Errore di Comunicazione\", \"La postazione \"+ ip.getHostAddress() + \" non ha inviato i pacchetti di voto.\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//Vengono recuperati i voti cifrati\n\t\tMessage request;\n\t\tWrittenBallot[] encryptedBallots;\n\t\ttry {\n\t\t\trequest = (Message) Message.fromB64(link.read(), \"postazione \" + ip.getHostAddress());\n\t\t\tString[] required = {\"encryptedBallots\"};\n\t\t\tClass<?>[] types = {WrittenBallot[].class};\n\t\t\t\n\t\t\trequest.verifyMessage(Protocol.sendVoteToStation, required, types, \"postazione \" + ip.getHostAddress());\n\t\t\tencryptedBallots = request.getElement(\"encryptedBallots\");\n\t\t\t\n\t\t\t//I voti vengono memorizzati nel seggio in attesa dell'invio all'urna\n\t\t\tif(((Controller) controller).storeVoteLocally(encryptedBallots, ip))\n\t\t\t\tlink.write(Protocol.votesReceivedAck);\n\t\t\telse\n\t\t\t\tlink.write(Protocol.votesReceivedNack);\n\t\t\t\n\t\t} catch (PEException e) {\n\t\t\tlink.write(Protocol.votesReceivedNack);\n\t\t\tcontroller.printError(e);\n\t\t}\n\t}", "public DemographicVote()\n\t{\n\t\t//initialize the votes to zero\n\t\tliberal=0;\n\t\tndp=0;\n\t\tgreen=0;\n\t}", "public void addVoter(Employee voter) {\n voters.add(voter);\n voter.getVotes().add(this);\n }", "BlogPostLikes userLikes(BlogPost blogPost,User user);", "public DemographicVote(DemographicVote n)\n\t{\n\t\t//copy all three private fields from object that was passed\n\t\tliberal=n.getLiberal();\n\t\tndp=n.getNDP();\n\t\tgreen=n.getGreen();\n\t\t\n\t}", "public String getVoteString() {\n\t\treturn voted ? Arrays.toString(topIdeas) : \"n/a\";\n\t}", "public void addVote(int n)\n\t{\n\t\t//if statements to determine where vote will be placed\n\t\tif(n==1)\n\t\t\tliberal++;\n\t\tif(n==2)\n\t\t\tndp++;\n\t\tif(n==3)\n\t\t\tgreen++;\n\t}", "@Override\n public String getDescription() {\n return \"Phasing vote casting\";\n }", "public int compare(Candidate a, Candidate b) \n { \n return b.getNoOfVotes() - a.getNoOfVotes(); \n }", "public interface VotingConfigManager {\n\n byte getVoteWithdrawalPenaltyPercentage();\n\n void setVoteWithdrawalPenaltyPercentage(byte newValue);\n\n long getVoteCostToCreatePolicy();\n\n void setVoteCostToCreatePolicy(long voteCost);\n\n long getUserVoteSalaryIncrement();\n\n void setUserVoteSalaryIncrement(long voteSalaryIncrement);\n\n short getUserVoteSalaryFrequencyDays();\n\n void setUserVoteSalaryFrequencyDays(short voteSalaryFrequencyDays);\n\n /**\n * Get the day of week on which vote salary should be paid IF frequency is set to 7 days\n *\n * @see #getUserVoteSalaryFrequencyDays()\n */\n DayOfWeek getUserVoteSalaryWeeklyDayOfWeek();\n\n /**\n * Set the day of week on which vote salary should be paid IF frequency is set to 7 days\n *\n * @see #getUserVoteSalaryFrequencyDays()\n */\n void setUserVoteSalaryWeeklyDayOfWeek(DayOfWeek voteSalaryDayOfWeek);\n\n /**\n * Set amount of time to wait before assuming current vote records are final and no late-write conflicts can occur.\n *\n * @return number of seconds, always >0\n */\n long getVoteFinalizeDelaySeconds();\n\n /**\n * Set amount of time to wait before assuming current vote records are final and no late-write conflicts can occur.\n *\n * @param voteFinalizeDelaySeconds must be >0; normally the same as cassandra GC_GRACE_SECONDS.\n */\n void setVoteFinalizeDelaySeconds(long voteFinalizeDelaySeconds);\n}", "int countByExample(CmsVoteTitleExample example);", "public void setVoteurl(String voteurl) {\n this.voteurl = voteurl;\n }", "@Override \n public void updateVote(String keyString) throws EntityNotFoundException {\n Key entityKey = KeyFactory.stringToKey(keyString);\n Entity entity = ds.get(entityKey);\n int currentCount = ((Long) entity.getProperty(\"voteCount\")).intValue();\n entity.setProperty(\"voteCount\", currentCount + 1);\n ds.put(entity);\n }", "VoteList selectByPrimaryKey(Integer id);", "public void createVoting(String question , int type,ArrayList<String> choices){\n Voting voting = new Voting(type,question);\n for (String choice : choices){\n voting.createChoice(choice);\n }\n votingList.add(voting);\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tfor (int i = 0; i < 2 /* rounds */; i++) {\n\t\t\t\t\tfor (Delegate delegate : votes.keySet()) {\n\t\t\t\t\t\tif (votes.get(delegate) != null) {\n\t\t\t\t\t\t\t// Already voted.\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurrentlyVoting = delegate;\n\t\t\t\t\t\tlblCurrentVoter.setText(delegate.getName());\n\t\t\t\t\t\tlblCurrentVoter.setIcon(delegate.getSmallIcon());\n\n\t\t\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\t\t\tfinal List<Map<Vote, JButton>> maplist = Arrays.asList(\n\t\t\t\t\t\t\t\tbuttons_roundOne, buttons_roundTwo);\n\t\t\t\t\t\tfor (Map<Vote, JButton> map : maplist) {\n\t\t\t\t\t\t\tfor (Vote vote : map.keySet()) {\n\t\t\t\t\t\t\t\tmap.get(vote)\n\t\t\t\t\t\t\t\t\t\t.setText(\n\t\t\t\t\t\t\t\t\t\t\t\tdelegate.getStatus().hasVetoPower ? vote.vetoText\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: vote.normalText);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tsynchronized (votingThread) {\n\t\t\t\t\t\t\t\tvotingThread.wait();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfinal Vote cast = votes.get(delegate);\n\t\t\t\t\t\tif (cast == Vote.PASS) {\n\t\t\t\t\t\t\tvotes.put(delegate, null);\n\t\t\t\t\t\t\t// So he goes again.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (JButton button : votingButtons) {\n\t\t\t\t\t\t\tbutton.setEnabled(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlayout.show(pnlVoting, pnlSecondRound.getName());\n\t\t\t\t}\n\t\t\t\t// When done, disable again.\n\t\t\t\tfor (JButton button : votingButtons) {\n\t\t\t\t\tbutton.setEnabled(false);\n\t\t\t\t}\n\t\t\t\tcurrentlyVoting = null;\n\t\t\t\tlblCurrentVoter.setText(null);\n\t\t\t\tlblCurrentVoter.setIcon(null);\n\t\t\t\tpnlVoting.setVisible(false);\n\t\t\t}", "public Integer getOutstandingVoteCount() {\n return this.outstandingVoteCount;\n }", "public interface UpvoteDownvoteListener {\n public void onUpvoteClicked(UpvoteDownvoteView v);\n public void onDownvoteClicked(UpvoteDownvoteView v);\n}", "public List getResults() {\r\n List<Candidate> list = new ArrayList<>();\r\n list = getCurrentVoting().getCandidates();\r\n list.sort(Comparator.comparingInt(Candidate::getVoices));\r\n return list;\r\n }", "public int getAdvisorCount();", "private void setVoteOrder() {\n\t\tfor (int i = 1; i < temp.size(); i++) {\n\t\t\t// deleting the comma from the name\n\t\t\tString s = temp.elementAt(i).replaceAll(\",\", \"\");\n\t\t\t// creating a vector \"tempVoteOrder\" to store the preferences of\n\t\t\t// each voter\n=======\n\t\t\tCandidats.add(candidat);\n\t\t\ttempCandidats = tempCandidats.replaceFirst(\n\t\t\t\t\ttempCandidats.substring(0, tempCandidats.indexOf(\",\") + 1),\n\t\t\t\t\t\"\");// delete the first candidat in the String\n\t\t}\n\t\tfor (int j = 0; j < Candidats.size(); j++)\n\t\t\tCandidats.elementAt(j).setVowsPerRound(Candidats.size());// fill the\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// vector\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// of\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// size\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \"candidats\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// by\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 0's\n\t}", "@GetMapping(\"/up-question-votes/{id}\")\n @Timed\n public ResponseEntity<UpQuestionVote> getUpQuestionVote(@PathVariable Long id) {\n log.debug(\"REST request to get UpQuestionVote : {}\", id);\n UpQuestionVote upQuestionVote = upQuestionVoteService.findOne(id);\n return Optional.ofNullable(upQuestionVote)\n .map(result -> new ResponseEntity<>(\n result,\n HttpStatus.OK))\n .orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND));\n }" ]
[ "0.7344513", "0.7323857", "0.725002", "0.7222429", "0.7097811", "0.70492965", "0.68760246", "0.6718004", "0.67031044", "0.6664692", "0.6635202", "0.6628517", "0.6491623", "0.6486452", "0.6451216", "0.6376229", "0.6361033", "0.6320346", "0.6315991", "0.631554", "0.62776", "0.62603146", "0.62365013", "0.6226194", "0.6219464", "0.621012", "0.61945266", "0.61668307", "0.6145501", "0.6129257", "0.61278975", "0.6122536", "0.6119497", "0.6117503", "0.6095331", "0.60867995", "0.6067254", "0.6012001", "0.5989332", "0.59686273", "0.5940906", "0.59076023", "0.58992445", "0.58991146", "0.5860475", "0.585853", "0.5846274", "0.5838675", "0.58270943", "0.5825599", "0.5778569", "0.5775116", "0.5768797", "0.5739421", "0.5739421", "0.5736923", "0.569893", "0.5698679", "0.5683424", "0.5678598", "0.56750363", "0.5671976", "0.5650811", "0.5632087", "0.56227237", "0.56215596", "0.5615889", "0.5603828", "0.5580134", "0.5576129", "0.55682856", "0.55675095", "0.5563536", "0.555264", "0.55194545", "0.5518711", "0.551115", "0.5510553", "0.54977065", "0.5490644", "0.5467529", "0.5464429", "0.54535466", "0.5439567", "0.5431627", "0.54148245", "0.5401127", "0.54007417", "0.5399165", "0.5397982", "0.53849477", "0.5383164", "0.53802305", "0.5374036", "0.53721", "0.5365261", "0.53651977", "0.53618133", "0.5356662" ]
0.732839
2
provides access to content
public String getContent() { return content; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract Object getContent();", "private void LoadContent()\n {\n \n }", "public void LoadContent(){\n }", "public String getContent();", "public Content createContent();", "java.lang.String getContent();", "java.lang.String getContent();", "java.lang.String getContent();", "java.lang.String getContent();", "java.lang.String getContent();", "java.lang.String getContent();", "abstract public Content createContent();", "protected abstract Content newContent();", "@Override\n\tpublic\n\tObject getContent() {\n\t\treturn this.content;\n\t}", "@Override\r\n public String getContent() {\r\n return content;\r\n }", "List<UserContentAccess> findContentAccess();", "public String getContent()\n/* */ {\n/* 1329 */ return this.content;\n/* */ }", "abstract String getContent();", "@Override\n\tpublic GetContentResponse listContents() {\n\t\tLOGGER.debug(\"LIST ALL CONTENTS\");\n\t\t\n\t\tClientConfig clientConfig = new ClientConfig();\n\t\t \n\t HttpAuthenticationFeature feature = HttpAuthenticationFeature.basic(env.getProperty(\"liferay.user.id\"), env.getProperty(\"liferay.user.key\"));\n\t clientConfig.register( feature) ;\n\t \n\t clientConfig.register(JacksonFeature.class);\n\t\t\n\t\tClient client = ClientBuilder.newClient(clientConfig);\n\t\tWebTarget webTarget = client.target(env.getProperty(\"liferay.api.rootpath\")).path(\"article-id/0/content-type/tagtest\");\n\t\t \n\t\tInvocation.Builder invocationBuilder = webTarget.request(MediaType.APPLICATION_JSON);\n\t\n\t\tResponse response = invocationBuilder.get();\n\t\t \n\t\tGetContentResponse content = response.readEntity(GetContentResponse.class);\n\t\t\n\t\t\n\t\n\t\t \n\t\tLOGGER.info(\"status::\"+response.getStatus());\n\t\t\n\t\t\n\t\t\n\t\tcontent.setStatusCode(200);\n\t\tcontent.setStatusMessage(\"Content List\");\n\t\n\t\treturn content;\n\t}", "public String getContent() { return this.content; }", "String getContent();", "String getContent();", "String getContent();", "String getContent();", "String getContent();", "String getContent();", "String getContent();", "String getContent();", "ContentLocator getContentLocator();", "public abstract String getContentDescription();", "ContentFactory getContentFactory();", "public T getContent();", "@Override\n public String get_content() {\n return _adContent;\n }", "public Contents getContents(\n )\n {return contents;}", "public IContentContext getContentContext(\n )\n {return contents.getContentContext();}", "public Content getContent() {\n return this.content;\n }", "public void seeFreshContent();", "public Object getContent() {\n return null;\n }", "public interface Content {\n}", "protected void createContents() {\n\n\t}", "public abstract String getContentString();", "public String getContent() {\n return instance.getContent();\n }", "public String getContent() {\n return instance.getContent();\n }", "String content();", "ContentLoader getContentLoader(ClientRequestContext context);", "Map<String, Object> getContent();", "public abstract List<String> getContent( );", "public interface VersionedContent {\n /**\n * Version of the content.\n */\n long version();\n\n /**\n * Actual content\n */\n String content();\n }", "public String getContent() {\n return this.content;\n }", "Serializable getContent();", "public String getContent() {\n\t return content;\n }", "public abstract String getNewContent();", "private java.util.Vector getContentItems()\r\n\t{\r\n\t\treturn contentItems;\r\n\t}", "public String getContent() {\r\n return content;\r\n }", "public String getContent() {\r\n return content;\r\n }", "public String getContent() {\n return content_;\n }", "public String getContent() {\n return content_;\n }", "public T getContent() {\n return content;\n }", "ISObject loadContent(ISObject sobj);", "public String getContents() { return contents; }", "UserContentAccess findContentAccessForPath(@Param(\"path\") String path);", "public void setContent(Object content) {\n this.content = content;\n }", "protected abstract Component addContent();", "boolean contentViewable();", "public String getContent() {\n return instance.getContent();\n }", "public String getContent() {\n return instance.getContent();\n }", "public String getPublicContent() {\n return this.publicContent;\n }", "@Override\n public InputStream getContent() {\n throw new UnsupportedOperationException();\n }", "public String getContentObj() {\n return contentObj;\n }", "default boolean visitContent() {\n\t\treturn true;\n\t}", "void retrievePageContents()\n\t{\n\t\tStringBuilder longString = new StringBuilder();\n\t\tfor (int i = 0; i < pageContents.size(); i++)\n\t\t{\n\t\t\tlongString.append(pageContents.get(i));\n\t\t}\n\t\tString pageMarkup = longString.toString().toLowerCase();\n\t\textractComments(pageMarkup);\n\n\t}", "public java.lang.String getContent () {\n\t\treturn content;\n\t}", "public String getContent() {\n return this.content;\n }", "public String getContent() {\n return this.content;\n }", "public String getContent() {\n return this.content;\n }", "public String getContent() {\n return this.content;\n }", "public java.lang.String getContent() {\n return content;\n }", "public void setContent(String content) { this.content = content; }", "@Override\n protected Serializable getContentObject() {\n return result;\n }", "public interface ContentService {\n\n //前面四个方法都是后台的内容查询\n int add(Content content);\n\n PageInfo<Content> list(int categoryId, int page, int rows);\n\n int edit(Content content);\n\n int delete(String ids);\n\n //商城首页的大广告位查询\n // List<Content> selectByCategoryId(long cid);\n //缓存的写法\n String selectByCategoryId(long cid);\n\n}", "boolean updateContent();", "public java.lang.String getContent() {\n return content;\n }", "public ResourceContent getContent() throws IOException;", "@Override\n\tpublic ArrayList<FileSystemItem> getContent() {\n\t\treturn this.content;\n\t}" ]
[ "0.73915917", "0.6954169", "0.6903335", "0.68262815", "0.6734295", "0.66965425", "0.66965425", "0.66965425", "0.66965425", "0.66965425", "0.66965425", "0.6666957", "0.65536267", "0.6553395", "0.6522019", "0.65198326", "0.65182227", "0.65092057", "0.64502686", "0.64493155", "0.6433387", "0.6433387", "0.6433387", "0.6433387", "0.6433387", "0.6433387", "0.6433387", "0.6433387", "0.6377031", "0.63666725", "0.63611263", "0.6337", "0.6331225", "0.6329085", "0.6300396", "0.62854785", "0.62748146", "0.6263299", "0.62505084", "0.62275404", "0.6213316", "0.6208507", "0.6208507", "0.62012035", "0.6196693", "0.6196293", "0.6194424", "0.6193757", "0.6165587", "0.61479527", "0.61478126", "0.6127454", "0.61188036", "0.61139315", "0.61139315", "0.6105109", "0.6105109", "0.6098803", "0.6093944", "0.6078313", "0.60743093", "0.6071986", "0.6054989", "0.6046111", "0.6038978", "0.6038978", "0.60256666", "0.6022486", "0.6009537", "0.60046154", "0.5999544", "0.5981475", "0.5974518", "0.5974518", "0.5974518", "0.5974518", "0.59730905", "0.5971312", "0.59608144", "0.59539825", "0.5951013", "0.5945199", "0.5940704", "0.5938943" ]
0.6007643
85
provides access to proposal
public String getProposal() { return proposal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private ClaimOrConcession(int proposal) {\n this.proposal = proposal;\n }", "public Path getProposalPath() { return proposalPath; }", "public void setProposalPath(Path proposalPath) { this.proposalPath = proposalPath; }", "public String getProposalId() {\n return this.proposalId;\n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "public static Map<Integer, Proposal> getProposals() { return proposals; }", "private Proposal getSelectedProposal() {\n\t\tif (isValid()) {\n\t\t\tint index = proposalTable.getSelectionIndex();\n\t\t\tif (proposalList == null || index < 0 || index >= getTableLength()) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tint proposalIndex = 0;\n\t\t\tfor (Proposal proposal : proposalList.getTopProposalList()) {\n\t\t\t\tif (index == proposalIndex) {\n\t\t\t\t\treturn proposal;\n\t\t\t\t}\n\t\t\t\tproposalIndex++;\n\t\t\t}\n\t\t\tfor (String provider : proposalList.getProviderList()) {\n\t\t\t\tif (index == proposalIndex) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tproposalIndex++;\n\t\t\t\tfor (Proposal proposal : proposalList.getProposals(provider)) {\n\t\t\t\t\tif (index == proposalIndex) {\n\t\t\t\t\t\treturn proposal;\n\t\t\t\t\t}\n\t\t\t\t\tproposalIndex++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public DevelopmentProposal getDevelopmentProposal() {\n return developmentProposal;\n }", "long getProposalId();", "public final void addProposal(ProposedPromiseDrop proposal) {\r\n if (proposal != null) {\r\n synchronized (f_seaLock) {\r\n if (f_proposals == null) {\r\n f_proposals = new ArrayList<>(1);\r\n }\r\n f_proposals.add(proposal);\r\n }\r\n }\r\n }", "public java.lang.String getProposalNo() {\n return proposalNo;\n }", "public BidCommitmentData fetchProposalCommitment(CommsPublicIdentity member) {\n return proposals.get(member).getCommitment();\n }", "public void sortProposals() {\n\n\t}", "public void proposalAdded(IProposal proposal) throws RemoteException {\n\t\tlogger.create().block(\"proposalAdded\").info().level(1).msg(\n\t\t\t\t\"Adding addProposal request to update queue for proposal: pid:\" + proposal.getID() + \", name: \"\n\t\t\t\t\t\t+ proposal.getName()).send();\n\t\t// will need to grab all its content ?\n\t}", "public void setProposalId(String proposalId) {\n this.proposalId = proposalId;\n }", "@Override\n public void doExecute(ProcessBundle bundle) throws Exception {\n\n HttpServletRequest request = RequestContext.get().getRequest();\n VariablesSecureApp vars = new VariablesSecureApp(request);\n\n try {\n OBContext.setAdminMode();\n final String unifiedProposalId = (String) bundle.getParams().get(\"Escm_Proposalmgmt_ID\")\n .toString();\n EscmProposalMgmt unifiedProposal = OBDal.getInstance().get(EscmProposalMgmt.class,\n unifiedProposalId);\n\n final String clientId = (String) bundle.getContext().getClient();\n String userId = (String) bundle.getContext().getUser();\n String tabId = (String) bundle.getParams().get(\"tabId\");\n String roleId = (String) bundle.getContext().getRole();\n String orgId = unifiedProposal.getOrganization().getId();\n\n String histStatus = \"\", comments = (String) bundle.getParams().get(\"comments\").toString();\n boolean errorFlag = false, headerUpdate = false;\n String DocStatus = unifiedProposal.getProposalappstatus();\n\n if (DocStatus.equals(\"INC\")) {\n OBDal.getInstance().rollbackAndClose();\n OBError result = OBErrorBuilder.buildMessage(null, \"error\",\n \"@Escm_AlreadyPreocessed_Approved@\");\n bundle.setResult(result);\n return;\n }\n\n // OBError error = UnifiedProposalReactivateMethods\n // .proposalReactivateValidation(unifiedProposalId, clientId, orgId, userId, roleId, tabId);\n // if (error.getType().equals(\"error\")) {\n // OBDal.getInstance().rollbackAndClose();\n // bundle.setResult(error);\n // return;\n // }\n\n Connection con = OBDal.getInstance().getConnection();\n PreparedStatement ps = null;\n ResultSet rs = null;\n String query = null;\n List<String> proposalList = new ArrayList<String>();\n\n try {\n\n query = \" select escm_proposalmgmt_id from escm_proposalmgmt_line \"\n + \" where escm_proposalmgmt_line_id in (select escm_unifiedproposalines_v_id \"\n + \" from escm_unifiedproposalines_v where escm_proposalmgmt_id = ?) \"\n + \" group by escm_proposalmgmt_id \";\n\n ps = con.prepareStatement(query);\n ps.setString(1, unifiedProposalId);\n\n rs = ps.executeQuery();\n\n // Get proposal id list\n while (rs.next()) {\n proposalList.add(rs.getString(\"escm_proposalmgmt_id\"));\n }\n\n // Reactivate validation\n // Check PO is created for awarded proposals\n boolean hasError = false;\n String proposalMessage = OBMessageUtils.messageBD(\"Escm_proposalcommon\").replace(\"%\", \"\");\n for (String proposalId : proposalList) {\n EscmProposalMgmt proposal = OBDal.getInstance().get(EscmProposalMgmt.class, proposalId);\n OBError error1 = UnifiedProposalReactivateMethods.proposalReactivateValidation(proposalId,\n clientId, proposal.getOrganization().getId(), userId, roleId, tabId);\n if (error1.getType().equals(\"error\")) {\n OBDal.getInstance().rollbackAndClose();\n hasError = true;\n proposalMessage = proposalMessage + proposal.getProposalno() + \", \";\n }\n }\n if (hasError) {\n OBError result = OBErrorBuilder.buildMessage(null, \"error\", proposalMessage,\n \"@Escm_Proposalhasorder@\");\n bundle.setResult(result);\n return;\n }\n\n // Update line info if any error occurs\n hasError = false;\n proposalMessage = OBMessageUtils.messageBD(\"Escm_proposalcommon\").replace(\"%\", \"\");\n for (String proposalId : proposalList) {\n EscmProposalMgmt proposal = OBDal.getInstance().get(EscmProposalMgmt.class, proposalId);\n OBError error1 = UnifiedProposalRejectMethods.encumbranceValidationReject(proposal, vars);\n if (error1.getType().equals(\"error\")) {\n // OBDal.getInstance().rollbackAndClose();\n hasError = true;\n proposalMessage = proposalMessage + proposal.getProposalno() + \", \";\n }\n }\n if (hasError) {\n OBError result = OBErrorBuilder.buildMessage(null, \"error\", proposalMessage,\n \"@Efin_Encum_Used_Cannot_Rej@\");\n bundle.setResult(result);\n return;\n }\n\n // Skip new version (todo)\n // Check bid encumbrance for unified proposal\n if (unifiedProposal.getEscmBidmgmt() != null\n && unifiedProposal.getEscmBidmgmt().getEncumbrance() != null) {\n OBError error1 = UnifiedProposalRejectMethods\n .getUnifiedProposaltoBidDetailsRej(unifiedProposal, vars, true, proposalList);\n if (error1.getType().equals(\"error\")) {\n bundle.setResult(error1);\n return;\n }\n }\n\n // If no error occurs, do encumbrance changes\n for (String proposalId : proposalList) {\n EscmProposalMgmt proposal = OBDal.getInstance().get(EscmProposalMgmt.class, proposalId);\n OBError error1 = UnifiedProposalRejectMethods.updateProposalEncumbranceReject(proposal,\n vars);\n if (error1.getType().equals(\"error\")) {\n OBDal.getInstance().rollbackAndClose();\n bundle.setResult(error1);\n return;\n }\n }\n // update bid encumbrance for unified proposal\n if (unifiedProposal.getEscmBidmgmt() != null\n && unifiedProposal.getEscmBidmgmt().getEncumbrance() != null) {\n\n boolean isFullyAwarded = UnifiedProposalActionMethod.isProposalFullyAwarded(proposalList);\n if (isFullyAwarded) {\n\n OBError error1 = UnifiedProposalRejectMethods.changeEncumStageRej(unifiedProposal,\n vars);\n if (error1.getType().equals(\"error\")) {\n OBDal.getInstance().rollbackAndClose();\n bundle.setResult(error1);\n return;\n }\n\n } else {\n // reactivate split encumbrance\n for (String proposalId : proposalList) {\n EscmProposalMgmt proposalMgmt = OBDal.getInstance().get(EscmProposalMgmt.class,\n proposalId);\n UnifiedProposalRejectMethods.reactivateSplitBid(proposalMgmt, false, proposalList);\n }\n\n OBError error1 = UnifiedProposalRejectMethods\n .getUnifiedProposaltoBidDetailsRej(unifiedProposal, vars, false, proposalList);\n if (error1.getType().equals(\"error\")) {\n OBDal.getInstance().rollbackAndClose();\n bundle.setResult(error1);\n return;\n }\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n // log.error(\"Exception in isDirectApproval \" + e.getMessage());\n } finally {\n // close db connection\n try {\n if (rs != null)\n rs.close();\n if (ps != null)\n ps.close();\n } catch (Exception e) {\n }\n }\n\n // update proposal Management header status based on reject\n if (!errorFlag) {\n\n headerUpdate = UnifiedProposalReactivateMethods\n .updateUnifiedProposalReactivate(unifiedProposal);\n\n if (headerUpdate) {\n OBDal.getInstance().save(unifiedProposal);\n\n // insert the Action history\n if (!StringUtils.isEmpty(unifiedProposalId)) {\n JSONObject historyData = new JSONObject();\n histStatus = \"REA\";// Reactivate\n historyData.put(\"ClientId\", clientId);\n historyData.put(\"OrgId\", orgId);\n historyData.put(\"RoleId\", roleId);\n historyData.put(\"UserId\", userId);\n historyData.put(\"HeaderId\", unifiedProposalId);\n historyData.put(\"Comments\", comments);\n historyData.put(\"Status\", histStatus);\n historyData.put(\"NextApprover\", \"\");\n historyData.put(\"HistoryTable\", ApprovalTables.Proposal_Management_History);\n historyData.put(\"HeaderColumn\",\n ApprovalTables.Proposal_Management_History_HEADER_COLUMN);\n historyData.put(\"ActionColumn\",\n ApprovalTables.Proposal_Management_History_DOCACTION_COLUMN);\n\n UnifiedProposalActionMethod.InsertApprovalHistory(historyData);\n }\n\n // delete the unused nextroles in eut_next_role table.\n DocumentRuleDAO.deleteUnusedNextRoles(OBDal.getInstance().getConnection(),\n Resource.PROPOSAL_MANAGEMENT);\n // delete the unused nextroles in eut_next_role table.\n DocumentRuleDAO.deleteUnusedNextRoles(OBDal.getInstance().getConnection(),\n Resource.PROPOSAL_MANAGEMENT_DIRECT);\n\n }\n }\n\n OBError result = OBErrorBuilder.buildMessage(null, \"success\", \"@Escm_Ir_complete_success@\");\n bundle.setResult(result);\n return;\n\n } catch (Exception e) {\n e.printStackTrace();\n OBDal.getInstance().rollbackAndClose();\n log.debug(\"Exeception in UnifiedProposalReactivate:\" + e);\n // Throwable t = DbUtility.getUnderlyingSQLException(e);\n final OBError error = OBMessageUtils.translateError(bundle.getConnection(), vars,\n vars.getLanguage(), OBMessageUtils.messageBD(\"HB_INTERNAL_ERROR\"));\n bundle.setResult(error);\n } finally {\n OBContext.restorePreviousMode();\n }\n }", "public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer,\n\t\t\tint documentOffset) {\n\t\tboolean dotActivation = false;\n\n\t\tVector<ICompletionProposal> result = new Vector<ICompletionProposal>();\n\t\t// ICompletionProposal[] result= new\n\t\t// ICompletionProposal[fgProposals.length];\n\t\tIDocument doc = viewer.getDocument();\n\n\t\tFindReplaceDocumentAdapter frd = new FindReplaceDocumentAdapter(doc);\n\n\t\tint pos = documentOffset;\n\t\tdo {\n\t\t\tpos--;\n\t\t} while (pos >= 0 && !Character.isWhitespace(frd.charAt(pos)));\n\t\tpos++;\n\n\t\tString stp = \"\";\n\t\tif (pos >= 0)\n\t\t\tstp = frd.subSequence(pos, documentOffset).toString();\n\n\t\t// See if we have . activation\n\t\tif (frd.charAt(documentOffset - 1) == '.') {\n\t\t\tString props[] = dotActivation(stp, result);\n\t\t\tfor (int i = 0; i < props.length; i++) {\n\t\t\t\tString val = props[i];\n\t\t\t\tIContextInformation info = new ContextInformation(\n\t\t\t\t\t\tval,\n\t\t\t\t\t\tMessageFormat\n\t\t\t\t\t\t\t\t.format(\n\t\t\t\t\t\t\t\t\t\t\"CompletionProcessor.Proposal.ContextInfo.pattern\", new Object[] { val })); //$NON-NLS-1$\n\t\t\t\t// result.add(new CompletionProposal(fgProposals[i],\n\t\t\t\t// documentOffset, 0, fgProposals[i].length(), null,\n\t\t\t\t// fgProposals[i], info,\n\t\t\t\t// MessageFormat.format(\"CompletionProcessor.Proposal.hoverinfo.pattern\",\n\t\t\t\t// new Object[] { fgProposals[i]}))); //$NON-NLS-1$\n\t\t\t\tresult.add(new CompletionProposal(val, documentOffset, 0,\n\t\t\t\t\t\tval.length(), null, val, null, null)); //$NON-NLS-1$\n\t\t\t}\n\n\t\t} else {\n\t\t\t// System.out.println(\"String part:\" + stp);\n\t\t\tSet<String> comps = fgProposals.keySet();\n\t\t\tIterator<String> compitr = comps.iterator();\n\t\t\twhile (compitr.hasNext()) {\n\t\t\t\t// CompletionToken comp = comps.nextElement();\n\t\t\t\t// String val = comp.getKey();\n\t\t\t\tString val = compitr.next();\n\t\t\t\t// If there are too many matches (and it becomes annoying) then\n\t\t\t\t// remove the two calls to toLowerCase() below\n\t\t\t\t// if (val.toLowerCase().startsWith(stp.toLowerCase())) {\n\t\t\t\tif (val.startsWith(stp)) {\n\n\t\t\t\t\tString rep = val.substring(stp.length());\n\t\t\t\t\tIContextInformation info = new ContextInformation(\n\t\t\t\t\t\t\tval,\n\t\t\t\t\t\t\tMessageFormat\n\t\t\t\t\t\t\t\t\t.format(\n\t\t\t\t\t\t\t\t\t\t\t\"CompletionProcessor.Proposal.ContextInfo.pattern\", new Object[] { val })); //$NON-NLS-1$\n\t\t\t\t\t// result.add(new CompletionProposal(fgProposals[i],\n\t\t\t\t\t// documentOffset, 0, fgProposals[i].length(), null,\n\t\t\t\t\t// fgProposals[i], info,\n\t\t\t\t\t// MessageFormat.format(\"CompletionProcessor.Proposal.hoverinfo.pattern\",\n\t\t\t\t\t// new Object[] { fgProposals[i]}))); //$NON-NLS-1$\n\t\t\t\t\t\n\t\t\t\t\t// Do not show proposals with . if the stump does not have a .\n\t\t\t\t\tif(!((stp.indexOf('.') == -1) && val.indexOf('.') != -1)) {\n\t\t\t\t\t\tresult.add(new CompletionProposal(rep, documentOffset, 0,\n\t\t\t\t\t\t\t\trep.length(), null, val, null, null)); //$NON-NLS-1$\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// adding an empty string to ensure that the completion dialog appears\n\t\tif (result.size() == 0) {\n\t\t\tresult.add(new CompletionProposal(\n\t\t\t\t\t\"\", documentOffset, 0, 0, null, \"\", null, null)); //$NON-NLS-1$\n\t\t}\n\n\t\treturn result.toArray(new ICompletionProposal[result.size()]);\n\t}", "public void run() {\n\t\t\t\t\t\t\tProposal p = getSelectedProposal();\n\t\t\t\t\t\t\tif (p != null) {\n\t\t\t\t\t\t\t\tString description = p.getDescription();\n\t\t\t\t\t\t\t\tif (description != null) {\n\t\t\t\t\t\t\t\t\tif (infoPopup == null) {\n\t\t\t\t\t\t\t\t\t\tinfoPopup = new InfoPopupDialog(getShell());\n\t\t\t\t\t\t\t\t\t\tinfoPopup.open();\n\t\t\t\t\t\t\t\t\t\tinfoPopup.getShell()\n\t\t\t\t\t\t\t\t\t\t\t\t.addDisposeListener(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew DisposeListener() {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpublic void widgetDisposed(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDisposeEvent event) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tinfoPopup = null;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tinfoPopup.setContents(p.getDescription());\n\t\t\t\t\t\t\t\t} else if (infoPopup != null) {\n\t\t\t\t\t\t\t\t\tinfoPopup.close();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tpendingDescriptionUpdate = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "public void setProposalNo(java.lang.String proposalNo) {\n this.proposalNo = proposalNo;\n }", "public Long getInstProposalId() {\n return instProposalId;\n }", "@Override\n \tpublic ArrayList<ICompletionProposal> getCompletionProposals() {\n\n \t\tif (region.getType() == DOMRegionContext.XML_TAG_OPEN) {\n \t\t\tcomputeTagOpenProposals();\n \t\t} else if (region.getType() == DOMRegionContext.XML_TAG_NAME) {\n \t\t\tcomputeTagNameProposals();\n \t\t}\n \t\treturn getAllCompletionProposals();\n \t}", "private void showProposalDevelopment(){\r\n try{\r\n \r\n ProposalBaseWindow propFrame = null;\r\n if ( (propFrame = (ProposalBaseWindow)mdiForm.getFrame(\r\n CoeusGuiConstants.PROPOSAL_BASE_FRAME_TITLE))!= null ) {\r\n if( propFrame.isIcon() ){\r\n propFrame.setIcon(false);\r\n }\r\n propFrame.setSelected(true);\r\n return;\r\n }\r\n propFrame = new ProposalBaseWindow(mdiForm );\r\n propFrame.setVisible( true );\r\n }catch(Exception exception){\r\n CoeusOptionPane.showInfoDialog(exception.getMessage());\r\n }\r\n }", "private void claim(int proposal) {\n this.claimStatus = new ClaimOrConcession(proposal);\n }", "private String getString(Proposal proposal) {\n\t\tif (proposal == null) {\n\t\t\treturn EMPTY;\n\t\t}\n\t\t// if (labelProvider == null) {\n\t\t// return proposal.getLabel() == null ? proposal.getContent()\n\t\t// : proposal.getLabel();\n\t\t// }\n\t\t// return labelProvider.getText(proposal);\n\t\treturn proposal.getValue();\n\t}", "@SuppressWarnings(\"unused\")\n\tprivate LedgerInitProposalData() {\n\t}", "Publication getPubli();", "ProvenanceFactory getProvenanceFactory();", "private void showProposalDescription() {\n\t\t// If we do not already have a pending update, then\n\t\t// create a thread now that will show the proposal description\n\t\tif (!pendingDescriptionUpdate) {\n\t\t\t// Create a thread that will sleep for the specified delay\n\t\t\t// before creating the popup. We do not use Jobs since this\n\t\t\t// code must be able to run independently of the Eclipse\n\t\t\t// runtime.\n\t\t\tRunnable runnable = new Runnable() {\n\t\t\t\tpublic void run() {\n\t\t\t\t\tpendingDescriptionUpdate = true;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(POPUP_DELAY);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t}\n\t\t\t\t\tif (!isValid()) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tgetShell().getDisplay().syncExec(new Runnable() {\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t// Query the current selection since we have\n\t\t\t\t\t\t\t// been delayed\n\t\t\t\t\t\t\tProposal p = getSelectedProposal();\n\t\t\t\t\t\t\tif (p != null) {\n\t\t\t\t\t\t\t\tString description = p.getDescription();\n\t\t\t\t\t\t\t\tif (description != null) {\n\t\t\t\t\t\t\t\t\tif (infoPopup == null) {\n\t\t\t\t\t\t\t\t\t\tinfoPopup = new InfoPopupDialog(getShell());\n\t\t\t\t\t\t\t\t\t\tinfoPopup.open();\n\t\t\t\t\t\t\t\t\t\tinfoPopup.getShell()\n\t\t\t\t\t\t\t\t\t\t\t\t.addDisposeListener(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew DisposeListener() {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpublic void widgetDisposed(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDisposeEvent event) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tinfoPopup = null;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tinfoPopup.setContents(p.getDescription());\n\t\t\t\t\t\t\t\t} else if (infoPopup != null) {\n\t\t\t\t\t\t\t\t\tinfoPopup.close();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tpendingDescriptionUpdate = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\t\t\tThread t = new Thread(runnable);\n\t\t\tt.start();\n\t\t}\n\t}", "public Deplacement getProchainMouvement();", "public void decide(String a_proposal)\n {\n this.m_paxosInstance.addDecision(this.getInitiator(), a_proposal);\n m_decided = true;\n }", "public Idea getProposedIdea() {\n\t\treturn proposedIdea;\n\t}", "public Proposal getAttackedProposal() {\n\t\treturn this.targetProposal;\n\t}", "public ProposalSpecialReviewForm() {\r\n }", "public void proposalUpdated(IProposal proposal) throws RemoteException {\n\t\tlogger.create().block(\"proposalUpdated\").info().level(1).msg(\n\t\t\t\t\"Adding updateProposal request to update queue for proposal: pid: \" + proposal.getID() + \", name:\"\n\t\t\t\t\t\t+ proposal.getName()).send();\n\t\t// will need to grab content if we dont already have this -\n\t\t// eg the proposal may have been disabled before but now enabled.\n\n\t\tupdateList.add(new ProposalUpdatedNotification(proposal));\n\n\t}", "public Proposal withStatus(ProposalStatus status) {\n this.status = status.toString();\n return this;\n }", "private void selectProposal(int index) {\n\t\tAssert.isTrue(index >= 0, \"Proposal index should never be negative\"); //$NON-NLS-1$\n\t\tif (!isValid() || proposalList == null || index >= getTableLength()) {\n\t\t\treturn;\n\t\t}\n\t\tproposalTable.setSelection(index);\n\t\tproposalTable.showSelection();\n\n\t\tshowProposalDescription();\n\t}", "public Proposal withProposedByMemberName(String proposedByMemberName) {\n setProposedByMemberName(proposedByMemberName);\n return this;\n }", "public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset) {\n\t\tDatabaseNode activeDatabaseNode = DatabaseView.getActiveDatabase();\n\t\tif (activeDatabaseNode == null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tString[] proposals = null;\n\t\tif (activeDatabaseNode != connectionModelCache) {\n\t\t\ttableNamesCache = getModelNames(activeDatabaseNode.getChildren());\n\t\t\tproposals = tableNamesCache;\n\t\t} else {\n\t\t\tdatabaseNamesCache = getModelNames(activeDatabaseNode.getChildren());\n\t\t\tproposals = databaseNamesCache;\n\t\t}\n\n\t\treturn getProposals(proposals, documentOffset);\n\t}", "public String toString() {\n\t\treturn \"[\"+this.getClass().getName()+\":\"+\n\t\t\tgetId()+\n\t\t\t\", proposalPath=\"+proposalPath+\"]\";\n\t}", "public int open() {\n\t\tint value = super.open();\n\t\tif (popupCloser == null) {\n\t\t\tpopupCloser = new PopupCloserListener();\n\t\t}\n\t\tpopupCloser.installListeners();\n\t\tProposal p = getSelectedProposal();\n\t\tif (p != null) {\n\t\t\tshowProposalDescription();\n\t\t}\n\t\treturn value;\n\t}", "Gruppo getGruppo();", "Publication getPubliRef();", "public String getDevProposalNumber() {\n return devProposalNumber;\n }", "public String getProposedByMemberId() {\n return this.proposedByMemberId;\n }", "public interface StatusCodePropertiesEditionPart {\n\n\t/**\n\t * @return the number\n\t * \n\t */\n\tpublic String getNumber();\n\n\t/**\n\t * Defines a new number\n\t * @param newValue the new number to set\n\t * \n\t */\n\tpublic void setNumber(String newValue);\n\n\n\n\n\n\t/**\n\t * Returns the internationalized title text.\n\t * \n\t * @return the internationalized title text.\n\t * \n\t */\n\tpublic String getTitle();\n\n\t// Start of user code for additional methods\n\t\n\t// End of user code\n\n}", "public interface Offer {\r\n\t/**\r\n\t * information about provider \r\n\t * @return\r\n\t */\r\n\tOperationUser getOfferProvider();\r\n\r\n\t/**\r\n\t * short description of offer\r\n\t * @return\r\n\t */\r\n\tString getOfferSummary();\r\n}", "public InstitutionalProposal getInstitutionalProposal() {\n return institutionalProposal;\n }", "public java.util.List<edu.ustb.sei.mde.xmu2.resource.xmu2.ui.Xmu2CompletionProposal> process(java.util.List<edu.ustb.sei.mde.xmu2.resource.xmu2.ui.Xmu2CompletionProposal> proposals) {\n\t\treturn proposals;\r\n\t}", "public java.util.Vector getProposalSpecialReviewDataProtocol(){\r\n if(!isSaveRequired())\r\n return new Vector();\r\n Vector vecSpecialReview = new Vector();\r\n //Get Deleted/Non deleted records from SpecialReviewForm\r\n vecSpecialReviewData = specialReviewForm.getSpecialReviewData();\r\n setFormDataProtocol();\r\n //Merge the Deleted and Non deleted records\r\n vecSpecialReviewData = getFormData();\r\n if(vecSpecialReviewData != null && vecSpecialReviewData.size()>0){\r\n ProposalSpecialReviewFormBean proposalSpecialReviewFormBean = null;\r\n for(int index = 0; index < vecSpecialReviewData.size(); index++){\r\n SpecialReviewFormBean bean = (SpecialReviewFormBean)vecSpecialReviewData.get(index);\r\n if(bean.getAcType()!= null){\r\n proposalSpecialReviewFormBean = new ProposalSpecialReviewFormBean(bean);\r\n proposalSpecialReviewFormBean.setProposalNumber(proposalNumber);\r\n vecSpecialReview.add(proposalSpecialReviewFormBean);\r\n }\r\n }\r\n }\r\n return vecSpecialReview;\r\n }", "@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2014-08-13 13:14:15.602 -0400\", hash_original_method = \"4B5496A79468DEC2FA84449A5CCBD295\", hash_generated_method = \"06016682917508DEF780A2C1DA1531D4\")\n \npublic PolicyNode getPolicyTree() {\n return policyTree;\n }", "@Override\r\npublic Object execute()\r\n{\r\n\tfinal Article proposal = new Article(this.currentBetterProposal.getIdentifier());\r\n\r\n\tfinal float currentPrice = ((Article)this.currentBetterProposal).getPrice();\r\n\r\n\tif(currentPrice>=this.hightPrice)\r\n\t\treturn null;\r\n\telse\r\n\t{\r\n\t\tfinal float price = (1+this.taux)*currentPrice; //ajouter taux % du prix actuel\r\n\r\n\t\tif (price < this.hightPrice)\r\n\t\t\tproposal.setPrice(price);\r\n\t\telse\r\n\t\t\tproposal.setPrice(this.hightPrice);\r\n\r\n\t\treturn proposal;\r\n\t}\r\n}", "private ICompletionProposal[] getCompletionProposals(int offset) throws BadLocationException {\n \t\treturn contentAssistant.getContentAssistProcessor(document.getContentType(offset))\n \t\t\t\t.computeCompletionProposals(editor.getProjectionViewer(), offset);\n \t}", "public interface Participation {\n\n /** alternative owner, but as long as this person is not the owner. \n * This person is allowed to make comments, but nothing else. */\n String CANDIDATE = \"candidate\";\n\n /** the person with ultimate responsibility over a task. */\n String OWNER = \"owner\";\n\n /** person that will be using the result of this task. This person is \n * allowed to make comments, but nothing else. */\n String CLIENT = \"client\";\n\n /** person that is allowed to watch-but-not-touch this task */\n String VIEWER = \"viewer\";\n\n /** a person that was assigned to a task, but got replaced because of \n * absence or another reason. This way, a trace can be left in case \n * this person returns and wants to take back his tasks that got \n * reassigned. */\n String REPLACED_ASSIGNEE = \"replaced-assignee\";\n\n /** the unique id for this participation that is used as a reference in the service methods */\n String getId();\n\n /** userId for this participation. \n * null in case this is a {@link #getGroupId() group participation}. */\n String getUserId();\n\n /** groupId for this participation. \n * null in case this is a {@link #getUserId() user participation}. */\n String getGroupId();\n\n /** see constants for default participations */\n String getType();\n}", "public interface PathSynopsisMgr extends TXObject<PathSynopsisMgr> {\n\n\tpublic static class SubtreeCopyResult {\n\t\tpublic final PSNode newRoot;\n\t\tpublic final Map<Integer, Integer> pcrMap;\n\n\t\tpublic SubtreeCopyResult(PSNode newRoot, Map<Integer, Integer> pcrMap) {\n\t\t\tsuper();\n\t\t\tthis.newRoot = newRoot;\n\t\t\tthis.pcrMap = pcrMap;\n\t\t}\n\t}\n\n\t/**\n\t * Spawns a private path synopsis manager for the specified document,\n\t * optimized for transaction-local bulk use (e.g. store,restore). Access to\n\t * a different document or by a different transaction will cause an error.\n\t */\n\tpublic PathSynopsisMgr spawnBulkPsManager() throws DocumentException;\n\n\tpublic Set<Integer> getPCRsForPaths(Collection<Path<QNm>> paths)\n\t\t\tthrows DocumentException;\n\n\tpublic Set<Integer> match(Path<QNm> path) throws DocumentException;\n\n\tpublic BitSet match(QNm name, int minLevel) throws DocumentException;\n\t\n\tpublic BitSet matchChildPath(NodeType[] types, int pcr) throws DocumentException;\n\t\n\tpublic PSNode get(int pcr) throws DocumentException;\n\n\tpublic PSNode getAncestor(int pcr, int level) throws DocumentException;\n\n\tpublic PSNode getAncestorOrParent(int pcr, int level)\n\t\t\tthrows DocumentException;\n\n\t/**\n\t * Returns the requested child PSNode. If such a child does not exist it is\n\t * created and returned.\n\t */\n\tpublic PSNode getChild(int parentPcr, QNm name, byte kind,\n\t\t\tNsMapping nsMapping) throws DocumentException;\n\n\t/**\n\t * Allows to make a snapshot of the path synopsis containing relevant meta\n\t * data\n\t */\n\tpublic void snapshot(PSSnapshotBuilder builder) throws DocumentException;\n\n\tpublic int getPathSynopsisNo() throws DocumentException;\n\n\t/**\n\t * Attribute children are allowed but no element child nodes/PCRs\n\t */\n\tpublic boolean isLeaf(int pcr);\n\n\tpublic int getMaxPCR();\n\n\t/**\n\t * Changes the NsMapping of the PSNode with PCR 'originalPCR'. This\n\t * operation does not only create one new node in the path synopsis, but a\n\t * whole new subtree. The mapping between the PCRs of the old and the new\n\t * subtree is described by the returned Map.\n\t */\n\tpublic SubtreeCopyResult copySubtree(int originalPCR,\n\t\t\tNsMapping newNsMapping, QNm newName) throws DocumentException;\n\n\t/**\n\t * Returns the requested child PSNode. If such a child does not exist, null\n\t * is returned.\n\t */\n\tpublic PSNode getChildIfExists(int parentPcr, QNm name, byte kind,\n\t\t\tNsMapping nsMapping) throws DocumentException;\n\n\tpublic int[] matchChildPath(Path<QNm> path) throws DocumentException;\n}", "public void getAssignment() {\n \n }", "public FORCE_UNLOCK_PROPOSAL(\n\t String id,\n\t Path proposalPath) {\n\t super(id);\n\t this.proposalPath = proposalPath;\n\t }", "Provider createProvider(Provider prov, Aggregator agr) throws RepoxException;", "Provider createProvider(Provider prov, Aggregator agr) throws RepoxException;", "private boolean canCreateProposal( Person user ) {\n\t\tApplicationTask task = new ApplicationTask( TaskName.CREATE_PROPOSAL );\n\t\tTaskAuthorizationService taskAuthenticationService = KraServiceLocator.getService( TaskAuthorizationService.class );\n\t\treturn taskAuthenticationService.isAuthorized( user.getPrincipalId(), task );\n\t}", "String propose() {\r\n Person person = preferences[pointer];\r\n partner = determinePartner(person);\r\n String result;\r\n if (partner == null) {\r\n result = person.name + \" rejects. \";\r\n } else if (ex == null || ex.isEmpty()) {\r\n result = person.name + \" accepts. \";\r\n } else {\r\n result = person.name + \" dumps \" + ex + \", gets engaged to \" + name + \".\";\r\n }\r\n pointer++;\r\n ex = \"\";\r\n return name + \" proposes to \" + person.name + \". \" + result;\r\n }", "public static ProposalDTO getProposalFromCache(String proposalId){\n\t\tlog.info(\"In MemcacheUtil getProposalFromCache\");\n\t\tProposalDTO proposalDTO=null;\n \tString proposalKey=PROPOSAL_KEY+\"_\"+proposalId;\n \tif(memcache !=null && memcache.contains(proposalKey)){\n \t\tproposalDTO=(ProposalDTO) memcache.get(proposalKey);\n \t} \t\n \treturn proposalDTO;\n\t}", "public void setProposals(ICompletionProposal[] preComputedProposals) {\n fPreComputedProposals = preComputedProposals;\n }", "@Override\r\n\tpublic void selectionChanged(ICompletionProposal proposal, boolean smartToggle) {\n\t\ttry {\r\n\t\tTracer.info(this, \"Selection changed\" + proposal.getDisplayString());\r\n\t\tTracer.info(this, \"Selection contxt\" + proposal.getContextInformation());\r\n\r\n\t\t\r\n//\t\tSystem.out.println(proposal.getAdditionalProposalInfo());\r\n//\t\tif (proposal instanceof ICompletionProposalExtension2) {\r\n//\t\t\tICompletionProposalExtension2 anExtension2 = (ICompletionProposalExtension2) proposal;\r\n//\t\t\t\r\n//\t\t}\r\n//\t\tSystem.out.println(proposal.getContextInformation().getInformationDisplayString());\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t}", "public I getChangeInfo(int startSeqNum);", "protected void addPopupMouseListener() {\n Object /*ContentProposalPopup*/ popup = ReflectionUtils.getFieldValue(adapter, \"popup\");\n if (popup == null) // e.g. due to no available proposal\n return;\n Table proposalTable = (Table)ReflectionUtils.getFieldValue(popup, \"proposalTable\");\n proposalTable.addMouseListener(MouseListener.mouseUpAdapter(e -> {\n if (e.button == 1 && proposalTable.getBounds().contains(e.x, e.y))\n ReflectionUtils.invokeMethod(popup, \"acceptCurrentProposal\");\n }));\n }", "public Professor professor() {\n ////\n return professor;\n }", "public String getProposedByMemberName() {\n return this.proposedByMemberName;\n }", "public void setDevelopmentProposal(DevelopmentProposal developmentProposal) {\n this.developmentProposal = developmentProposal;\n }", "public String getProposer() {\r\n\t\treturn proposer;\r\n\t}", "public CCA2KPABEpp getPublicParameter(){\n\t\treturn this.pp;\n\t}", "private void acceptCurrentProposal(boolean addToHistory) {\n\t\t// Close before accepting the proposal. This is important\n\t\t// so that the cursor position can be properly restored at\n\t\t// acceptance, which does not work without focus on some controls.\n\t\t// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=127108\n\t\tProposal proposal = getSelectedProposal();\n\t\tif (proposal != null) {\n\t\t\tadapter.proposalAccepted(proposal, addToHistory);\n\t\t\tclose();\n\t\t}\n\t}", "HrDocumentRequest approve(HrDocumentRequest hrDocumentRequest);", "private interface Permit {\n\t\t/**\n\t\t * context id\n\t\t */\n\t\tpublic String id();\n\t\t\n\t\t/**\n\t\t * The context which we have a permit to\n\t\t */\n\t\tpublic ColumnContext context();\n\n\t\t/**\n\t\t * Must call release when done with context\n\t\t */\n\t\tpublic void revoke();\n\t}", "public static void setProposalInCache(ProposalDTO proposalDTO){\n \tString proposalKey=PROPOSAL_KEY+\"_\"+proposalDTO.getProposalId();\n\t\tlog.info(\"set proposal in memcache : memcache key:\"+proposalKey);\n\t\t\t\n\t\tif(memcache !=null && memcache.contains(proposalKey)){\n \t\tmemcache.delete(proposalKey);\n \t}\n \tmemcache.put(proposalKey, proposalDTO);\n\t}", "public Integer getProposer() {\r\n return proposer;\r\n }", "private ContentProposalList getEmptyProposalArray() {\n\t\treturn new ContentProposalList();\n\t}", "public interface Propagator extends PVCoordinatesProvider {\n\n /** Default mass. */\n double DEFAULT_MASS = 1000.0;\n\n /** Default attitude provider. */\n AttitudeProvider DEFAULT_LAW = InertialProvider.EME2000_ALIGNED;\n\n /** Indicator for slave mode. */\n int SLAVE_MODE = 0;\n\n /** Indicator for master mode. */\n int MASTER_MODE = 1;\n\n /** Indicator for ephemeris generation mode. */\n int EPHEMERIS_GENERATION_MODE = 2;\n\n /** Get the current operating mode of the propagator.\n * @return one of {@link #SLAVE_MODE}, {@link #MASTER_MODE},\n * {@link #EPHEMERIS_GENERATION_MODE}\n * @see #setSlaveMode()\n * @see #setMasterMode(double, OrekitFixedStepHandler)\n * @see #setMasterMode(OrekitStepHandler)\n * @see #setEphemerisMode()\n */\n int getMode();\n\n /** Set the propagator to slave mode.\n * <p>This mode is used when the user needs only the final orbit at the target time.\n * The (slave) propagator computes this result and return it to the calling\n * (master) application, without any intermediate feedback.\n * <p>This is the default mode.</p>\n * @see #setMasterMode(double, OrekitFixedStepHandler)\n * @see #setMasterMode(OrekitStepHandler)\n * @see #setEphemerisMode()\n * @see #getMode()\n * @see #SLAVE_MODE\n */\n void setSlaveMode();\n\n /** Set the propagator to master mode with fixed steps.\n * <p>This mode is used when the user needs to have some custom function called at the\n * end of each finalized step during integration. The (master) propagator integration\n * loop calls the (slave) application callback methods at each finalized step.</p>\n * @param h fixed stepsize (s)\n * @param handler handler called at the end of each finalized step\n * @see #setSlaveMode()\n * @see #setMasterMode(OrekitStepHandler)\n * @see #setEphemerisMode()\n * @see #getMode()\n * @see #MASTER_MODE\n */\n void setMasterMode(double h, OrekitFixedStepHandler handler);\n\n /** Set the propagator to master mode with variable steps.\n * <p>This mode is used when the user needs to have some custom function called at the\n * end of each finalized step during integration. The (master) propagator integration\n * loop calls the (slave) application callback methods at each finalized step.</p>\n * @param handler handler called at the end of each finalized step\n * @see #setSlaveMode()\n * @see #setMasterMode(double, OrekitFixedStepHandler)\n * @see #setEphemerisMode()\n * @see #getMode()\n * @see #MASTER_MODE\n */\n void setMasterMode(OrekitStepHandler handler);\n\n /** Set the propagator to ephemeris generation mode.\n * <p>This mode is used when the user needs random access to the orbit state at any time\n * between the initial and target times, and in no sequential order. A typical example is\n * the implementation of search and iterative algorithms that may navigate forward and\n * backward inside the propagation range before finding their result.</p>\n * <p>Beware that since this mode stores <strong>all</strong> intermediate results,\n * it may be memory intensive for long integration ranges and high precision/short\n * time steps.</p>\n * @see #getGeneratedEphemeris()\n * @see #setSlaveMode()\n * @see #setMasterMode(double, OrekitFixedStepHandler)\n * @see #setMasterMode(OrekitStepHandler)\n * @see #getMode()\n * @see #EPHEMERIS_GENERATION_MODE\n */\n void setEphemerisMode();\n\n /**\n * Set the propagator to ephemeris generation mode with the specified handler for each\n * integration step.\n *\n * <p>This mode is used when the user needs random access to the orbit state at any\n * time between the initial and target times, as well as access to the steps computed\n * by the integrator as in Master Mode. A typical example is the implementation of\n * search and iterative algorithms that may navigate forward and backward inside the\n * propagation range before finding their result.</p>\n *\n * <p>Beware that since this mode stores <strong>all</strong> intermediate results, it\n * may be memory intensive for long integration ranges and high precision/short time\n * steps.</p>\n *\n * @param handler handler called at the end of each finalized step\n * @see #setEphemerisMode()\n * @see #getGeneratedEphemeris()\n * @see #setSlaveMode()\n * @see #setMasterMode(double, OrekitFixedStepHandler)\n * @see #setMasterMode(OrekitStepHandler)\n * @see #getMode()\n * @see #EPHEMERIS_GENERATION_MODE\n */\n void setEphemerisMode(OrekitStepHandler handler);\n\n /** Get the ephemeris generated during propagation.\n * @return generated ephemeris\n * @exception IllegalStateException if the propagator was not set in ephemeris\n * generation mode before propagation\n * @see #setEphemerisMode()\n */\n BoundedPropagator getGeneratedEphemeris() throws IllegalStateException;\n\n /** Get the propagator initial state.\n * @return initial state\n * @exception OrekitException if state cannot be retrieved\n */\n SpacecraftState getInitialState() throws OrekitException;\n\n /** Reset the propagator initial state.\n * @param state new initial state to consider\n * @exception OrekitException if initial state cannot be reset\n */\n void resetInitialState(SpacecraftState state)\n throws OrekitException;\n\n /** Add a set of user-specified state parameters to be computed along with the orbit propagation.\n * @param additionalStateProvider provider for additional state\n * @exception OrekitException if an additional state with the same name is already present\n */\n void addAdditionalStateProvider(AdditionalStateProvider additionalStateProvider)\n throws OrekitException;\n\n /** Get an unmodifiable list of providers for additional state.\n * @return providers for the additional states\n */\n List<AdditionalStateProvider> getAdditionalStateProviders();\n\n /** Check if an additional state is managed.\n * <p>\n * Managed states are states for which the propagators know how to compute\n * its evolution. They correspond to additional states for which an\n * {@link AdditionalStateProvider additional state provider} has been registered\n * by calling the {@link #addAdditionalStateProvider(AdditionalStateProvider)\n * addAdditionalStateProvider} method. If the propagator is an {@link\n * org.orekit.propagation.integration.AbstractIntegratedPropagator integrator-based\n * propagator}, the states for which a set of {@link\n * org.orekit.propagation.integration.AdditionalEquations additional equations} has\n * been registered by calling the {@link\n * org.orekit.propagation.integration.AbstractIntegratedPropagator#addAdditionalEquations(\n * org.orekit.propagation.integration.AdditionalEquations) addAdditionalEquations}\n * method are also counted as managed additional states.\n * </p>\n * <p>\n * Additional states that are present in the {@link #getInitialState() initial state}\n * but have no evolution method registered are <em>not</em> considered as managed states.\n * These unmanaged additional states are not lost during propagation, though. Their\n * value will simply be copied unchanged throughout propagation.\n * </p>\n * @param name name of the additional state\n * @return true if the additional state is managed\n */\n boolean isAdditionalStateManaged(String name);\n\n /** Get all the names of all managed states.\n * @return names of all managed states\n */\n String[] getManagedAdditionalStates();\n\n /** Add an event detector.\n * @param detector event detector to add\n * @see #clearEventsDetectors()\n * @see #getEventsDetectors()\n * @param <T> class type for the generic version\n */\n <T extends EventDetector> void addEventDetector(T detector);\n\n /** Get all the events detectors that have been added.\n * @return an unmodifiable collection of the added detectors\n * @see #addEventDetector(EventDetector)\n * @see #clearEventsDetectors()\n */\n Collection<EventDetector> getEventsDetectors();\n\n /** Remove all events detectors.\n * @see #addEventDetector(EventDetector)\n * @see #getEventsDetectors()\n */\n void clearEventsDetectors();\n\n /** Get attitude provider.\n * @return attitude provider\n */\n AttitudeProvider getAttitudeProvider();\n\n /** Set attitude provider.\n * @param attitudeProvider attitude provider\n */\n void setAttitudeProvider(AttitudeProvider attitudeProvider);\n\n /** Get the frame in which the orbit is propagated.\n * <p>\n * The propagation frame is the definition frame of the initial\n * state, so this method should be called after this state has\n * been set, otherwise it may return null.\n * </p>\n * @return frame in which the orbit is propagated\n * @see #resetInitialState(SpacecraftState)\n */\n Frame getFrame();\n\n /** Propagate towards a target date.\n * <p>Simple propagators use only the target date as the specification for\n * computing the propagated state. More feature rich propagators can consider\n * other information and provide different operating modes or G-stop\n * facilities to stop at pinpointed events occurrences. In these cases, the\n * target date is only a hint, not a mandatory objective.</p>\n * @param target target date towards which orbit state should be propagated\n * @return propagated state\n * @exception OrekitException if state cannot be propagated\n */\n SpacecraftState propagate(AbsoluteDate target) throws OrekitException;\n\n /** Propagate from a start date towards a target date.\n * <p>Those propagators use a start date and a target date to\n * compute the propagated state. For propagators using event detection mechanism,\n * if the provided start date is different from the initial state date, a first,\n * simple propagation is performed, without processing any event computation.\n * Then complete propagation is performed from start date to target date.</p>\n * @param start start date from which orbit state should be propagated\n * @param target target date to which orbit state should be propagated\n * @return propagated state\n * @exception OrekitException if state cannot be propagated\n */\n SpacecraftState propagate(AbsoluteDate start, AbsoluteDate target) throws OrekitException;\n\n}", "@GetMapping(\"/updateProposalbyEmpId/{propId}\")\n\t public Proposal updateAccepted(@PathVariable int propId)\n\t {\n\t \tProposal res = employeeService.updateIsAccepted(propId);\n\t \tif(res.getPropId()==0)\n\t \t{\n\t \t\tthrow new InvalidProposalException(\"No accepted proposals available for propId \"+propId);\n\t \t}\n\t \telse\n\t \t{\n\t \t\treturn res;\n\t \t}\n\t \t\n\t }", "private void reposicionarPersonajes() {\n // TODO implement here\n }", "public interface UnitTestPropertiesEditionPart {\n\n\t/**\n\t * @return the locs\n\t * \n\t */\n\tpublic String getLocs();\n\n\t/**\n\t * Defines a new locs\n\t * @param newValue the new locs to set\n\t * \n\t */\n\tpublic void setLocs(String newValue);\n\n\n\t/**\n\t * @return the comments\n\t * \n\t */\n\tpublic String getComments();\n\n\t/**\n\t * Defines a new comments\n\t * @param newValue the new comments to set\n\t * \n\t */\n\tpublic void setComments(String newValue);\n\n\n\n\n\t/**\n\t * Init the anotations\n\t * @param current the current value\n\t * @param containgFeature the feature where to navigate if necessary\n\t * @param feature the feature to manage\n\t */\n\tpublic void initAnotations(ReferencesTableSettings settings);\n\n\t/**\n\t * Update the anotations\n\t * @param newValue the anotations to update\n\t * \n\t */\n\tpublic void updateAnotations();\n\n\t/**\n\t * Adds the given filter to the anotations edition editor.\n\t * \n\t * @param filter\n\t * a viewer filter\n\t * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(ViewerFilter)\n\t * \n\t */\n\tpublic void addFilterToAnotations(ViewerFilter filter);\n\n\t/**\n\t * Adds the given filter to the anotations edition editor.\n\t * \n\t * @param filter\n\t * a viewer filter\n\t * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(ViewerFilter)\n\t * \n\t */\n\tpublic void addBusinessFilterToAnotations(ViewerFilter filter);\n\n\t/**\n\t * @return true if the given element is contained inside the anotations table\n\t * \n\t */\n\tpublic boolean isContainedInAnotationsTable(EObject element);\n\n\n\t/**\n\t * @return the weight\n\t * \n\t */\n\tpublic String getWeight();\n\n\t/**\n\t * Defines a new weight\n\t * @param newValue the new weight to set\n\t * \n\t */\n\tpublic void setWeight(String newValue);\n\n\n\t/**\n\t * @return the name\n\t * \n\t */\n\tpublic String getName();\n\n\t/**\n\t * Defines a new name\n\t * @param newValue the new name to set\n\t * \n\t */\n\tpublic void setName(String newValue);\n\n\n\t/**\n\t * @return the maxWeight\n\t * \n\t */\n\tpublic String getMaxWeight();\n\n\t/**\n\t * Defines a new maxWeight\n\t * @param newValue the new maxWeight to set\n\t * \n\t */\n\tpublic void setMaxWeight(String newValue);\n\n\n\n\n\t/**\n\t * Init the migRelations\n\t * @param settings settings for the migRelations ReferencesTable \n\t */\n\tpublic void initMigRelations(ReferencesTableSettings settings);\n\n\t/**\n\t * Update the migRelations\n\t * @param newValue the migRelations to update\n\t * \n\t */\n\tpublic void updateMigRelations();\n\n\t/**\n\t * Adds the given filter to the migRelations edition editor.\n\t * \n\t * @param filter\n\t * a viewer filter\n\t * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(ViewerFilter)\n\t * \n\t */\n\tpublic void addFilterToMigRelations(ViewerFilter filter);\n\n\t/**\n\t * Adds the given filter to the migRelations edition editor.\n\t * \n\t * @param filter\n\t * a viewer filter\n\t * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(ViewerFilter)\n\t * \n\t */\n\tpublic void addBusinessFilterToMigRelations(ViewerFilter filter);\n\n\t/**\n\t * @return true if the given element is contained inside the migRelations table\n\t * \n\t */\n\tpublic boolean isContainedInMigRelationsTable(EObject element);\n\n\n\t/**\n\t * @return the parentLayer\n\t * \n\t */\n\tpublic EObject getParentLayer();\n\n\t/**\n\t * Init the parentLayer\n\t * @param settings the combo setting\n\t */\n\tpublic void initParentLayer(EObjectFlatComboSettings settings);\n\n\t/**\n\t * Defines a new parentLayer\n\t * @param newValue the new parentLayer to set\n\t * \n\t */\n\tpublic void setParentLayer(EObject newValue);\n\n\t/**\n\t * Defines the button mode\n\t * @param newValue the new mode to set\n\t * \n\t */\n\tpublic void setParentLayerButtonMode(ButtonsModeEnum newValue);\n\n\t/**\n\t * Adds the given filter to the parentLayer edition editor.\n\t * \n\t * @param filter\n\t * a viewer filter\n\t * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(ViewerFilter)\n\t * \n\t */\n\tpublic void addFilterToParentLayer(ViewerFilter filter);\n\n\t/**\n\t * Adds the given filter to the parentLayer edition editor.\n\t * \n\t * @param filter\n\t * a viewer filter\n\t * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(ViewerFilter)\n\t * \n\t */\n\tpublic void addBusinessFilterToParentLayer(ViewerFilter filter);\n\n\n\t/**\n\t * @return the parentModule\n\t * \n\t */\n\tpublic EObject getParentModule();\n\n\t/**\n\t * Init the parentModule\n\t * @param settings the combo setting\n\t */\n\tpublic void initParentModule(EObjectFlatComboSettings settings);\n\n\t/**\n\t * Defines a new parentModule\n\t * @param newValue the new parentModule to set\n\t * \n\t */\n\tpublic void setParentModule(EObject newValue);\n\n\t/**\n\t * Defines the button mode\n\t * @param newValue the new mode to set\n\t * \n\t */\n\tpublic void setParentModuleButtonMode(ButtonsModeEnum newValue);\n\n\t/**\n\t * Adds the given filter to the parentModule edition editor.\n\t * \n\t * @param filter\n\t * a viewer filter\n\t * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(ViewerFilter)\n\t * \n\t */\n\tpublic void addFilterToParentModule(ViewerFilter filter);\n\n\t/**\n\t * Adds the given filter to the parentModule edition editor.\n\t * \n\t * @param filter\n\t * a viewer filter\n\t * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(ViewerFilter)\n\t * \n\t */\n\tpublic void addBusinessFilterToParentModule(ViewerFilter filter);\n\n\n\t/**\n\t * @return the originalFilePath\n\t * \n\t */\n\tpublic String getOriginalFilePath();\n\n\t/**\n\t * Defines a new originalFilePath\n\t * @param newValue the new originalFilePath to set\n\t * \n\t */\n\tpublic void setOriginalFilePath(String newValue);\n\n\n\t/**\n\t * @return the newFilePath\n\t * \n\t */\n\tpublic String getNewFilePath();\n\n\t/**\n\t * Defines a new newFilePath\n\t * @param newValue the new newFilePath to set\n\t * \n\t */\n\tpublic void setNewFilePath(String newValue);\n\n\n\t/**\n\t * @return the visibility\n\t * \n\t */\n\tpublic Enumerator getVisibility();\n\n\t/**\n\t * Init the visibility\n\t * @param input the viewer input\n\t * @param current the current value\n\t */\n\tpublic void initVisibility(Object input, Enumerator current);\n\n\t/**\n\t * Defines a new visibility\n\t * @param newValue the new visibility to set\n\t * \n\t */\n\tpublic void setVisibility(Enumerator newValue);\n\n\n\n\n\t/**\n\t * Init the attributes\n\t * @param current the current value\n\t * @param containgFeature the feature where to navigate if necessary\n\t * @param feature the feature to manage\n\t */\n\tpublic void initAttributes(ReferencesTableSettings settings);\n\n\t/**\n\t * Update the attributes\n\t * @param newValue the attributes to update\n\t * \n\t */\n\tpublic void updateAttributes();\n\n\t/**\n\t * Adds the given filter to the attributes edition editor.\n\t * \n\t * @param filter\n\t * a viewer filter\n\t * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(ViewerFilter)\n\t * \n\t */\n\tpublic void addFilterToAttributes(ViewerFilter filter);\n\n\t/**\n\t * Adds the given filter to the attributes edition editor.\n\t * \n\t * @param filter\n\t * a viewer filter\n\t * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(ViewerFilter)\n\t * \n\t */\n\tpublic void addBusinessFilterToAttributes(ViewerFilter filter);\n\n\t/**\n\t * @return true if the given element is contained inside the attributes table\n\t * \n\t */\n\tpublic boolean isContainedInAttributesTable(EObject element);\n\n\n\n\n\t/**\n\t * Init the methods\n\t * @param current the current value\n\t * @param containgFeature the feature where to navigate if necessary\n\t * @param feature the feature to manage\n\t */\n\tpublic void initMethods(ReferencesTableSettings settings);\n\n\t/**\n\t * Update the methods\n\t * @param newValue the methods to update\n\t * \n\t */\n\tpublic void updateMethods();\n\n\t/**\n\t * Adds the given filter to the methods edition editor.\n\t * \n\t * @param filter\n\t * a viewer filter\n\t * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(ViewerFilter)\n\t * \n\t */\n\tpublic void addFilterToMethods(ViewerFilter filter);\n\n\t/**\n\t * Adds the given filter to the methods edition editor.\n\t * \n\t * @param filter\n\t * a viewer filter\n\t * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(ViewerFilter)\n\t * \n\t */\n\tpublic void addBusinessFilterToMethods(ViewerFilter filter);\n\n\t/**\n\t * @return true if the given element is contained inside the methods table\n\t * \n\t */\n\tpublic boolean isContainedInMethodsTable(EObject element);\n\n\n\t/**\n\t * @return the inhertance\n\t * \n\t */\n\tpublic Enumerator getInhertance();\n\n\t/**\n\t * Init the inhertance\n\t * @param input the viewer input\n\t * @param current the current value\n\t */\n\tpublic void initInhertance(Object input, Enumerator current);\n\n\t/**\n\t * Defines a new inhertance\n\t * @param newValue the new inhertance to set\n\t * \n\t */\n\tpublic void setInhertance(Enumerator newValue);\n\n\n\n\n\t/**\n\t * Init the implements\n\t * @param current the current value\n\t * @param containgFeature the feature where to navigate if necessary\n\t * @param feature the feature to manage\n\t */\n\tpublic void initImplements_(ReferencesTableSettings settings);\n\n\t/**\n\t * Update the implements\n\t * @param newValue the implements to update\n\t * \n\t */\n\tpublic void updateImplements_();\n\n\t/**\n\t * Adds the given filter to the implements edition editor.\n\t * \n\t * @param filter\n\t * a viewer filter\n\t * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(ViewerFilter)\n\t * \n\t */\n\tpublic void addFilterToImplements_(ViewerFilter filter);\n\n\t/**\n\t * Adds the given filter to the implements edition editor.\n\t * \n\t * @param filter\n\t * a viewer filter\n\t * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(ViewerFilter)\n\t * \n\t */\n\tpublic void addBusinessFilterToImplements_(ViewerFilter filter);\n\n\t/**\n\t * @return true if the given element is contained inside the implements table\n\t * \n\t */\n\tpublic boolean isContainedInImplements_Table(EObject element);\n\n\n\t/**\n\t * @return the originalFileName\n\t * \n\t */\n\tpublic String getOriginalFileName();\n\n\t/**\n\t * Defines a new originalFileName\n\t * @param newValue the new originalFileName to set\n\t * \n\t */\n\tpublic void setOriginalFileName(String newValue);\n\n\n\t/**\n\t * @return the type\n\t * \n\t */\n\tpublic String getType();\n\n\t/**\n\t * Defines a new type\n\t * @param newValue the new type to set\n\t * \n\t */\n\tpublic void setType(String newValue);\n\n\n\n\n\n\t/**\n\t * Returns the internationalized title text.\n\t * \n\t * @return the internationalized title text.\n\t * \n\t */\n\tpublic String getTitle();\n\n\t// Start of user code for additional methods\n\t\n\t// End of user code\n\n}", "public interface IModeratorProposalRepository extends JpaRepository<ModeratorProposal, Integer> {\n}", "@ManyToOne(fetch = FetchType.LAZY)\n @JoinColumn(name = \"masterOfProposal\")\n public MasterEntry getMasterOfProposal() {\n return this.masterOfProposal;\n }", "public interface Answer extends EObject {\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model\n\t * @generated\n\t */\n\tDouble accept(Object proposal);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model\n\t * @generated\n\t */\n\tString validate(Object proposal);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model\n\t * @generated\n\t */\n\tProposal<?> createProposal();\n}", "public String loadPropositions() {\n System.out.println(\"inside loadPropositions ::\");\n logger.info(PropValApproveBean.class, \"PropValApproveBean()\", \"Start loadPropositions\", null);\n Integer pgWUId = null;\n //This should work from the BPM UI Task.\n pgWUId = (Integer) JSFUtils.resolveExpression(\"#{bindings.WorkUnitId.inputValue}\");\n \n //This is for testing on local\n if(AdfFacesContext.getCurrentInstance().getPageFlowScope().get(\"workUnitId\")!= null) { \n pgWUId = Integer.parseInt(AdfFacesContext.getCurrentInstance().getPageFlowScope().get(\"workUnitId\").toString());\n } \n DCBindingContainer bindings = (DCBindingContainer) BindingContext.getCurrent().getCurrentBindingsEntry();\n\n DCIteratorBinding iter1 = (DCIteratorBinding) bindings.findIteratorBinding(\"PropertyIdentificationIterator\");\n iter1.executeQuery();\n Row row1 = iter1.getCurrentRow();\n\n String ain = (String) row1.getAttribute(\"AIN\");\n \n System.out.println(\"ain -----\"+ain);\n ADFUtils.setPageFlowValue(\"ain\", ain);\n logger.info(PropValApproveBean.class, \"PropValApproveBean()\", \"End loadPropositions\", null);\n return \"loadProp\";\n }", "protected GuiTestObject html_refPolicyNumber() \n\t{\n\t\treturn new GuiTestObject(\n getMappedTestObject(\"html_refPolicyNumber\"));\n\t}", "public ProyectoElements getProyectoAccess() {\n\t\treturn pProyecto;\n\t}", "ExploitationPackage getExploitationPackage();", "public abstract LearningEditProposal getBestEdit (boolean onlyAllowedEdits, boolean onlyPositiveEdits);", "public void getApprovalInfo() {\n setLoadingText(\"正在获取新审批数据......\");\n Log.e(\"ApprovalInfo\", \"getting.\");\n approvalDataList = new ArrayList<ApprovalData>();\n approvalJsonList.add(new ApprovalJSONOperate(UID).setAct(this).getApprovalInfo(approvalDataList));\n }", "Policy_Repository createPolicy_Repository();", "public interface AttributePropertiesEditionPart {\n\n\n\n\t/**\n\t * Init the anotations\n\t * @param current the current value\n\t * @param containgFeature the feature where to navigate if necessary\n\t * @param feature the feature to manage\n\t */\n\tpublic void initAnotations(ReferencesTableSettings settings);\n\n\t/**\n\t * Update the anotations\n\t * @param newValue the anotations to update\n\t * \n\t */\n\tpublic void updateAnotations();\n\n\t/**\n\t * Adds the given filter to the anotations edition editor.\n\t * \n\t * @param filter\n\t * a viewer filter\n\t * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(ViewerFilter)\n\t * \n\t */\n\tpublic void addFilterToAnotations(ViewerFilter filter);\n\n\t/**\n\t * Adds the given filter to the anotations edition editor.\n\t * \n\t * @param filter\n\t * a viewer filter\n\t * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(ViewerFilter)\n\t * \n\t */\n\tpublic void addBusinessFilterToAnotations(ViewerFilter filter);\n\n\t/**\n\t * @return true if the given element is contained inside the anotations table\n\t * \n\t */\n\tpublic boolean isContainedInAnotationsTable(EObject element);\n\n\n\t/**\n\t * @return the visibility\n\t * \n\t */\n\tpublic Enumerator getVisibility();\n\n\t/**\n\t * Init the visibility\n\t * @param input the viewer input\n\t * @param current the current value\n\t */\n\tpublic void initVisibility(Object input, Enumerator current);\n\n\t/**\n\t * Defines a new visibility\n\t * @param newValue the new visibility to set\n\t * \n\t */\n\tpublic void setVisibility(Enumerator newValue);\n\n\n\n\n\n\t/**\n\t * Returns the internationalized title text.\n\t * \n\t * @return the internationalized title text.\n\t * \n\t */\n\tpublic String getTitle();\n\n\t// Start of user code for additional methods\n\t\n\t// End of user code\n\n}", "public void interactWhenApproaching() {\r\n\t\t\r\n\t}", "com.unitedtote.schema.totelink._2008._06.program.ExchangeWagers xgetExchange();", "@Override\n\t\tpublic int getProofPoint() {\n\t\t\treturn 0;\n\t\t}", "public interface ReviewAssignmentProjectManager extends Configurable {\n /**\n * Adds reviewers to project and extends some project phases if necessary.\n *\n * @param reviewAuction\n * Review auction.\n * @param project\n * the Project.\n * @param assignment\n * Set of approved review applications.\n *\n * @throws IllegalArgumentException\n * If any argument is null or assignment contains null key.\n * @throws ReviewAssignmentProjectManagementException\n * If any other error with managing projects resources and phases occurs.\n */\n public void addReviewersToProject(ReviewAuction reviewAuction, Project project,\n Set<ReviewApplication> assignment)\n throws ReviewAssignmentProjectManagementException;\n}", "public Proposal(String value) {\n this(value, null);\n }", "Exploitation createExploitation();", "public abstract T provision();", "String getParagraph();", "public interface DirectPreApprovalPaymentOrdersList {\n\n /**\n * Pre Approval Code\n *\n * @return Code\n */\n String getCode();\n\n /**\n * Status of the payment order\n *\n * @return Status\n */\n Integer getStatus();\n\n /**\n * Number of the page desired to see the result\n *\n * @return Page number\n */\n Integer getPage();\n\n /**\n * Max number os registers by page\n *\n * @return Max Page Results\n */\n Integer getMaxPageResults();\n}" ]
[ "0.6828151", "0.6645016", "0.618081", "0.6153358", "0.614606", "0.6061523", "0.6035048", "0.5980169", "0.5967961", "0.5864461", "0.57265437", "0.5578671", "0.55212325", "0.5521159", "0.5509722", "0.5509143", "0.5504637", "0.54968303", "0.54966986", "0.5459093", "0.5457306", "0.5455926", "0.54546654", "0.5452105", "0.54056937", "0.5405588", "0.53920245", "0.53910756", "0.5390387", "0.5346918", "0.5341226", "0.5319449", "0.5316105", "0.52892023", "0.52727044", "0.5268331", "0.5239983", "0.52067286", "0.518695", "0.5179883", "0.51782906", "0.5153515", "0.5151994", "0.5138319", "0.51295924", "0.51294553", "0.5128715", "0.5125309", "0.5125242", "0.5123124", "0.5116355", "0.51107836", "0.51088864", "0.5107958", "0.51078916", "0.50950354", "0.5080751", "0.5080751", "0.50731534", "0.50728375", "0.5070852", "0.5065328", "0.50532913", "0.5047852", "0.5041884", "0.50416404", "0.5034929", "0.50314564", "0.5025489", "0.5015446", "0.501072", "0.5010308", "0.50003844", "0.49997205", "0.49933657", "0.49892", "0.49873567", "0.4982817", "0.49756226", "0.497129", "0.49703598", "0.49666446", "0.4956919", "0.4946965", "0.49460295", "0.49451774", "0.49426606", "0.49424657", "0.4938243", "0.49347925", "0.49342462", "0.4932784", "0.49240425", "0.49217907", "0.49213412", "0.49116674", "0.4911661", "0.49088266", "0.48999825", "0.48889756" ]
0.71799135
0
returns title of the problem
public String getTitle() { return title; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getBugTitle() {\n\t\treturn bugTitle;\n\t}", "public Problem title(String title) {\n this.title = title;\n return this;\n }", "String title();", "String title();", "public String getProblemName() {\n return this.problemName;\n }", "IDisplayString getTitle();", "static String title()\n {\n return \"POKEMON DON'T GO\\n\";\n }", "public String getTitle() {\n\t\tString displayInput = input;\n\t\tString organTitle = (focusedOrgan==null || focusedOrgan==\"\")? \"\" : \" in <em>\" + DatabaseHomepageBean.getOrganName(focusedOrgan) + \"</em>\";\n\t\treturn \"Result of <em>\" + query + \"</em> query for <em> \" + displayInput + \"</em>\" + organTitle;\n//\t\treturn \"Gene Query\";\n\t}", "String getTitle();", "String getTitle();", "String getTitle();", "String getTitle();", "String getTitle();", "String getTitle();", "String getTitle();", "String getTitle();", "String getTitle();", "String getTitle();", "String getTitle();", "String getTitle();", "String getTitle();", "String getTitle();", "String getTitle();", "java.lang.String getTitle();", "java.lang.String getTitle();", "java.lang.String getTitle();", "java.lang.String getTitle();", "java.lang.String getTitle();", "public String title()\n\t{\n\t\treturn title;\n\t}", "public String getProjectTitle()\r\n {\r\n return (m_projectTitle);\r\n }", "public String getExperimentTitle() throws InvalidFormatException;", "protected abstract String title ();", "public java.lang.String getTitle();", "public String getProblemDesc() {\n return this.problemDesc;\n }", "public String getTitle()\n {\n return \"LAB: DB Cross Site Scripting (XSS)\";\n }", "public String getProjectTitle() {\n\n\t\tif (projectTitle != null)\n\t\t\treturn ProteomeXchangeFilev2_1.MTD + TAB + \"project_title\" + TAB + projectTitle;\n\t\treturn null;\n\t}", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String title() {\n\t\treturn title;\n\t}", "@ApiModelProperty(value = \"A short, human-readable summary of the problem type\")\n \n public String getTitle() {\n return title;\n }", "public String getTitle()\r\n\t{\r\n\t\treturn TITLE;\r\n\t}", "public String getTitle() {\n \t\treturn title;\n \t}", "@Override\r\n\tpublic String getTitle() {\n\t\treturn title;\r\n\t}", "@ObjectSupport public final String title() {\n return title==null\n ? title = createTitle()\n : title;\n }", "public String getTitle()\n\t{\n\t\treturn title;\n\t}", "public String getTitle()\n\t{\n\t\treturn title;\n\t}", "public String getProjectTitle() {\n return getProperty(Property.PROJECT_TITLE);\n }", "public String getTitle() \r\n\t{\r\n\t\treturn this.title;\r\n\t}", "@Override\r\n public String getTitle() {\n return title;\r\n }", "public String getTitle()\r\n {\r\n return title;\r\n }", "public String getTitle()\r\n {\r\n return title;\r\n }", "public String problemText() {\n return problemText;\n }", "public String getPrideExperimentProjectTitle() {\n\n \n return prideExperimentProjectTitle;\n\n }", "public static void main(String[] args){\n Solution solution = new Solution();\n System.out.println(solution.convertToTitle(27));\n }", "public String getTitle()\n {\n return title;\n }", "public String getDisplayString(Problem problem) {\r\n \t\tif (problem.getProblem() == null)\r\n \t\t\treturn \"\";\r\n \t\t\r\n \t\treturn problem.getProblem().getName().toString();\r\n \t}", "public String getRunTitle() {\n\treturn runTitle;\n }", "public String getTitle() {\r\n\t\treturn title;\r\n\t}", "public String getTitle() {\r\n\t\treturn title;\r\n\t}", "public String getTitle() {\r\n\t\treturn title;\r\n\t}", "public String getTitle() {\r\n\t\treturn title;\r\n\t}", "public String getTitle() {\r\n\t\treturn title;\r\n\t}", "public String getTitle() {\r\n\t\treturn title;\r\n\t}", "public String getTitle() {\r\n\t\treturn title;\r\n\t}", "public String getTitle() {\n return getString(CommandProperties.TASK_TITLE);\n }", "public GHFrom getTitle() {\n return title;\n }", "@Override\r\n public String getTitle() {\r\n return title;\r\n }", "public String getTitle() {\n addParameter(\"title.number\" , iBundle.getString(\"reminderreport.title.date\") );\n\n return iBundle.getString(\"reminderreport.title\");\n }", "String getIssueName();", "protected String computePanelTitle(Program panelProgram) {\n\t\treturn panelProgram.getDomainFile().toString();\n\t}", "public String getTitle() { return title; }", "public String getTitle( ) {\n return null;\r\n }", "public String getTitle() {\r\n return title;\r\n }", "public String getTitle() {\r\n return title;\r\n }", "public String getTitle() {\r\n return title;\r\n }", "public String getTitle() {\r\n return title;\r\n }", "public String getTitle() {\r\n return title;\r\n }", "public String getTitle() {\r\n return title;\r\n }", "public String getTitle() {\r\n return title;\r\n }", "@Override\n public String getTitle() {\n return getName();\n }", "public String getTitle() {\r\n return title;\r\n }", "public String getTitle(){\n\n\t\treturn title;\n\t}", "public String getTitle()\n {\n return (this.title);\n }", "public String getTitle()\r\n {\r\n return this.title;\r\n }", "public java.lang.String getTitle() {\n return title;\n }" ]
[ "0.7295806", "0.7288577", "0.7208971", "0.7208971", "0.70517397", "0.6891445", "0.68542117", "0.68080586", "0.679971", "0.679971", "0.679971", "0.679971", "0.679971", "0.679971", "0.679971", "0.679971", "0.679971", "0.679971", "0.679971", "0.679971", "0.679971", "0.679971", "0.679971", "0.67977923", "0.67977923", "0.67977923", "0.67977923", "0.67977923", "0.6768776", "0.6761708", "0.67280954", "0.6702262", "0.6678735", "0.667677", "0.6668898", "0.66627747", "0.664818", "0.664818", "0.664818", "0.664818", "0.664818", "0.664818", "0.664818", "0.664818", "0.664818", "0.664818", "0.664818", "0.664818", "0.664818", "0.664818", "0.664818", "0.664818", "0.664818", "0.664818", "0.66437984", "0.66310585", "0.66191673", "0.66158783", "0.660369", "0.6591976", "0.6578239", "0.6578239", "0.6572167", "0.6540461", "0.6529862", "0.65262926", "0.65262926", "0.65122414", "0.6511543", "0.65060025", "0.65049076", "0.6503661", "0.6502887", "0.6500057", "0.6500057", "0.6500057", "0.6500057", "0.6500057", "0.6500057", "0.6500057", "0.6493394", "0.6491964", "0.649087", "0.64893234", "0.64779454", "0.64698374", "0.64561534", "0.64557874", "0.64557636", "0.64557636", "0.64557636", "0.64557636", "0.64557636", "0.64557636", "0.64557636", "0.6450717", "0.6442987", "0.6440366", "0.6440155", "0.6439467", "0.64383703" ]
0.0
-1
provides access to problemActivities
public List<ProblemActivity> getProblemActivities() { return problemActivities; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Issue> getUserProjectActiveIssue(User user, Project project);", "public interface ProblemInfo {\n}", "Activity getConflictCheckMappingActivity();", "protected ScllActivity iGetActivity() {\n\t\treturn (ScllActivity) getActivity();\n\t}", "int getProblemCategory();", "public ProblemList getProblems() {return this.problems;}", "public static Collection getAllActivities() throws EnvoyServletException\n {\n try\n {\n return ServerProxy.getJobHandler().getAllActivities();\n }\n catch (Exception e)\n {\n throw new EnvoyServletException(e);\n }\n }", "public List<Issue> getUserActiveIssues(User user);", "public Item2Vector<ConceptActivity> getConceptActivities()\r\n\t{\r\n\t\treturn activity_links;\r\n\t}", "public interface ActivityAware<E> {\r\n E getContextActivity();\r\n}", "public Activities activities() {\n return this.activities;\n }", "public interface C0869a {\n Intent getSupportParentActivityIntent();\n }", "Activity getConflictCheckForwardActivity();", "protected Activity getActivity() {\n\t\treturn (Activity) getHost().getModel();\n\t}", "public interface ActivityModuleItem {\n ActivityModuleItemView getActivityModuleItemView();\n}", "public interface ActivityAction {\r\n public void viewedActivity(String condition, String viewerFullName);\r\n}", "public IPermissionActivity getPermissionActivity(String ownerFname, String activityFname);", "public ArrayList<Activity> getActivities(){\r\n return activities;\r\n }", "public static void m4145ci(Context context) {\n AppMethodBeat.m2504i(16657);\n Intent intent = new Intent(context, PermissionWarningDialog.class);\n intent.putExtra(\"warning_type\", 3);\n intent.addFlags(805306368);\n context.startActivity(intent);\n AppMethodBeat.m2505o(16657);\n }", "private void setToOtherActivity(){\n\n util.setArrayListToOtherActivity(intent, solicitudEnviadaDAO.getSolEnviadaDTO(), Constantes.PARCEL_LISTA_SOL_ENVIADA);\n util.setArrayListToOtherActivity(intent, solicitudRecibidaDAO.getSolRecibidaDTO(), Constantes.PARCEL_LISTA_SOL_RECIBIDA);\n util.setArrayListToOtherActivity(intent, solicitudContestadaDAO.getSolContestadaDTO(), Constantes.PARCEL_LISTA_SOL_CONTESTADA);\n util.setArrayListToOtherActivity(intent, preguntaEnviadaDAO.getListaPreguntaEnviadaDTO(), Constantes.PARCEL_LISTA_PREG_ENVIADA);\n util.setArrayListToOtherActivity(intent, preguntaRecibidaDAO.getListaPreguntaRecibidaDTO(), Constantes.PARCEL_LISTA_PREG_RECIBIDA);\n util.setArrayListToOtherActivity(intent, preguntaContestadaDAO.getListaPreguntasContestadasDTO(), Constantes.PARCEL_LISTA_PREG_CONTESTADA);\n util.setArrayListToOtherActivity(intent, puntuacionRecibidaDAO.getListaPuntuacionRecibidasDTO(), Constantes.PARCEL_LISTA_PUNT_RECIBIDA);\n\n }", "protected Problem() {/* intentionally empty block */}", "public Activity[] getActivityArray()\n throws RedmineException\n {\n getActivities(false);\n return activityMap.values().toArray(new Redmine.Activity[activityMap.size()]);\n }", "public interface IModuleContextTabletActivity extends IModuleContext {\n}", "public IPermissionActivity getPermissionActivity(long id);", "@Provides @PerActivity Activity activity() {\n return this.activity;\n }", "public Issue(Projeto proj, String titulo, String desc, String dinicial,\r\n\t\t\tint critici, int tipo) {\r\n\t\tsuper();\r\n\t\tthis.proj = proj;\r\n\t\tthis.titulo = titulo;\r\n\t\tthis.desc = desc;\r\n\t\tDinicial = dinicial;\r\n\t\tthis.critici = critici;\r\n\t\tthis.tipo = tipo;\r\n\t\tstatus = 1;\r\n\t}", "public Problem getProblem(int index){\n return problems.getProblem(index);\n }", "public interface EncounterActivities extends Encounter {\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='not code.oclIsUndefined() implies not code.originalText.oclIsUndefined()'\"\n\t * @generated\n\t */\n\tboolean validateEncounterActivitiesCodeOriginalText(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='not self.code.originalText.oclIsUndefined() implies not self.code.originalText.reference.value.oclIsUndefined()'\"\n\t * @generated\n\t */\n\tboolean validateEncounterActivitiesCodeOriginalTextReference(DiagnosticChain diagnostics,\n\t\t\tMap<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='not self.code.originalText.reference.oclIsUndefined() implies not self.code.originalText.reference.value.oclIsUndefined()'\"\n\t * @generated\n\t */\n\tboolean validateEncounterActivitiesReferenceValue(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='not self.code.originalText.reference.value.oclIsUndefined() implies not self.getSection().text.getText(self.code.originalText.reference.value.substring(2, self.code.originalText.reference.value.size())).oclIsUndefined()'\"\n\t * @generated\n\t */\n\tboolean validateEncounterActivitiesCodeOriginalTextReferenceValue(DiagnosticChain diagnostics,\n\t\t\tMap<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.participant->select(par : cda::Participant2 | par.participantRole.oclIsKindOf(consol::ServiceDeliveryLocation))->forAll(p : cda::Participant2 | p.typeCode=vocab::ParticipationType::LOC)'\"\n\t * @generated\n\t */\n\tboolean validateEncounterActivitiesServiceDeliveryTypeCode(DiagnosticChain diagnostics,\n\t\t\tMap<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='(self.sDTCDischargeDispositionCode->isEmpty() or self.sDTCDischargeDispositionCode->exists(element | element.isNullFlavorUndefined())) implies (self.sDTCDischargeDispositionCode->forAll( element | not element.oclIsUndefined() and element.oclIsKindOf(datatypes::CE) and let value : datatypes::CE = element.oclAsType(datatypes::CE) in (value.codeSystem = \\'2.16.840.1.113883.6.301.5\\' or value.codeSystem = \\'2.16.840.1.113883.12.112\\') and not value.code.oclIsUndefined()))'\"\n\t * @generated\n\t */\n\tboolean validateEncounterActivitiesSdtcDDCFromNUBCOrDD(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.templateId->exists(id : datatypes::II | id.root = \\'2.16.840.1.113883.10.20.22.4.49\\')'\"\n\t * @generated\n\t */\n\tboolean validateEncounterActivitiesTemplateId(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.classCode=vocab::ActClass::ENC'\"\n\t * @generated\n\t */\n\tboolean validateEncounterActivitiesClassCode(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.moodCode=vocab::x_DocumentEncounterMood::EVN'\"\n\t * @generated\n\t */\n\tboolean validateEncounterActivitiesMoodCode(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='(self.id->isEmpty() or self.id->exists(element | element.isNullFlavorUndefined())) implies (( not self.id->isEmpty()) )'\"\n\t * @generated\n\t */\n\tboolean validateEncounterActivitiesId(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='(self.code.oclIsUndefined() or self.code.isNullFlavorUndefined()) implies (not self.code.oclIsUndefined() and self.code.oclIsKindOf(datatypes::CD) and \\r\\nlet value : datatypes::CD = self.code.oclAsType(datatypes::CD) in \\r\\nvalue.codeSystem = \\'2.16.840.1.113883.6.12\\' and not value.code.oclIsUndefined())'\"\n\t * @generated\n\t */\n\tboolean validateEncounterActivitiesCode(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='(self.effectiveTime.oclIsUndefined() or self.effectiveTime.isNullFlavorUndefined()) implies (not self.effectiveTime.oclIsUndefined())'\"\n\t * @generated\n\t */\n\tboolean validateEncounterActivitiesEffectiveTime(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='(self.sDTCDischargeDispositionCode->isEmpty() or self.sDTCDischargeDispositionCode->exists(element | element.isNullFlavorUndefined())) implies (( not self.sDTCDischargeDispositionCode->isEmpty()) )'\"\n\t * @generated\n\t */\n\tboolean validateEncounterActivitiesSDTCDischargeDispositionCode(DiagnosticChain diagnostics,\n\t\t\tMap<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.participant->exists(participant : cda::Participant2 | not participant.participantRole.oclIsUndefined() and participant.participantRole.oclIsKindOf(consol::ServiceDeliveryLocation))'\"\n\t * @generated\n\t */\n\tboolean validateEncounterActivitiesServiceDeliveryLocation(DiagnosticChain diagnostics,\n\t\t\tMap<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.entryRelationship->exists(entryRelationship : cda::EntryRelationship | not entryRelationship.observation.oclIsUndefined() and entryRelationship.observation.oclIsKindOf(consol::Indication) and entryRelationship.typeCode = vocab::x_ActRelationshipEntryRelationship::RSON)'\"\n\t * @generated\n\t */\n\tboolean validateEncounterActivitiesIndication(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.performer->exists(performer : cda::Performer2 | not performer.oclIsUndefined() and performer.oclIsKindOf(cda::Performer2))'\"\n\t * @generated\n\t */\n\tboolean validateEncounterActivitiesEncounterPerformer(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.entryRelationship->exists(entryRelationship : cda::EntryRelationship | not entryRelationship.act.oclIsUndefined() and entryRelationship.act.oclIsKindOf(consol::EncounterDiagnosis))'\"\n\t * @generated\n\t */\n\tboolean validateEncounterActivitiesEncounterDiagnosis(DiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.performer->excluding(null).assignedEntity->excluding(null)->reject((code.oclIsUndefined() or code.isNullFlavorUndefined()) implies (not code.oclIsUndefined()))'\"\n\t * @generated\n\t */\n\tboolean validateEncounterActivitiesEncounterPerformerEncounterPerformerAssignedEntityCode(\n\t\t\tDiagnosticChain diagnostics, Map<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * <!-- begin-model-doc -->\n\t * @param diagnostics The chain of diagnostics to which problems are to be appended.\n\t * @param context The cache of context-specific information.\n\t * <!-- end-model-doc -->\n\t * @model annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.performer->excluding(null)->reject(assignedEntity->one(assignedEntity : cda::AssignedEntity | not assignedEntity.oclIsUndefined() and assignedEntity.oclIsKindOf(cda::AssignedEntity)))'\"\n\t * @generated\n\t */\n\tboolean validateEncounterActivitiesEncounterPerformerEncounterPerformerAssignedEntity(DiagnosticChain diagnostics,\n\t\t\tMap<Object, Object> context);\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model kind=\"operation\" required=\"true\" ordered=\"false\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.getParticipantRoles()->select(participantRole : cda::ParticipantRole | not participantRole.oclIsUndefined() and participantRole.oclIsKindOf(consol::ServiceDeliveryLocation)).oclAsType(consol::ServiceDeliveryLocation)'\"\n\t * @generated\n\t */\n\tEList<ServiceDeliveryLocation> getServiceDeliveryLocations();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model kind=\"operation\" required=\"true\" ordered=\"false\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.getObservations()->select(observation : cda::Observation | not observation.oclIsUndefined() and observation.oclIsKindOf(consol::Indication)).oclAsType(consol::Indication)'\"\n\t * @generated\n\t */\n\tEList<Indication> getIndications();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @model kind=\"operation\" required=\"true\" ordered=\"false\"\n\t * annotation=\"http://www.eclipse.org/uml2/1.1.0/GenModel body='self.getActs()->select(act : cda::Act | not act.oclIsUndefined() and act.oclIsKindOf(consol::EncounterDiagnosis)).oclAsType(consol::EncounterDiagnosis)'\"\n\t * @generated\n\t */\n\tEList<EncounterDiagnosis> getEncounterDiagnosiss();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t */\n\tpublic EncounterActivities init();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t */\n\tpublic EncounterActivities init(Iterable<? extends Initializer<? extends EObject>> initializers);\n}", "@Override\n\tpublic int getActivityInfo() {\n\t\treturn Constants.ActivityInfo.ACTIVITY_ADDWAITACTIVITY;\n\t}", "public interface Activity extends EJBObject {\r\n public void setLinkCondition(String linkCondition, Vector binds) throws RemoteException;\r\n\r\n public void setData(ActivityDao attrs) throws RemoteException;\r\n\r\n public ActivityDao getData() throws RemoteException;\r\n\r\n public void insert(ActivityDao attrs) throws RemoteException, DupKeyException, UserException;\r\n\r\n public void update(ActivityDao attrs) throws RemoteException, UserException;\r\n\r\n public void delete(Vector<String> actlistID) throws RemoteException, ConstraintViolatedException, UserException;\r\n\r\n public void findByPrimaryKey(ActivityDao attrs) throws RemoteException, RowNotFoundException, UserException;\r\n\r\n public void findNext(ActivityDao attrs) throws RemoteException, FinderException, RowNotFoundException;\r\n\r\n public void findPrev(ActivityDao attrs) throws RemoteException, FinderException, RowNotFoundException;\r\n\r\n public Collection listAll() throws RemoteException, RowNotFoundException, UserException;\r\n\r\n public Collection find(ActivityDao attrs) throws RemoteException, FinderException, RowNotFoundException;\r\n\r\n public Collection findExact(ActivityDao attrs) throws RemoteException, FinderException, RowNotFoundException;\r\n\r\n public String[] lookupDesc(Object[] pkKeys) throws RemoteException, RowNotFoundException;\r\n\r\n public Collection<ActivityDao> getActivityTree(String startActivityNode) throws RemoteException, RowNotFoundException, UserException;\r\n}", "public interface IssueConstants {\n static final String VIEW_ID = \"net.refractions.udig.issues.view.issues\"; //$NON-NLS-1$\n static final String ISSUES_LIST_EXTENSION_ID = \"net.refractions.udig.issues.issuesList\"; //$NON-NLS-1$\n static final String ISSUES_EXTENSION_ID = \"net.refractions.udig.issues.issue\"; //$NON-NLS-1$\n static final String EXTENSION_CLASS_ATTR = \"class\"; //$NON-NLS-1$\n\n}", "private GcActivity gcActivity(int series, int item) {\n assert 0 <= series && series < checkpoint.gcTraceSize();\n assert 0 <= item && item < checkpoint.size(series);\n\n return gcActivitySet(series).get(item);\n }", "String getIssue();", "public List<Activity> getActivities() {\n getRoutesFromDao();\n updateOverridenRoutes();\n List<Activity> activities = new ArrayList<>();\n for(Route route: routes){\n if(route.getActivity().isExist()){\n activities.add(route.getActivity());\n }\n }\n for(Route route: overrideTeamRoutes.values()){\n if(route.getActivity().isExist()){\n activities.add(route.getActivity());\n }\n }\n Collections.sort(activities, (a,b) -> {\n return ActivityUtils.stringToTime(a.getDetail(Activity.DATE))\n .compareTo(ActivityUtils.stringToTime(b.getDetail(Activity.DATE)));\n });\n return activities;\n }", "public String[] getStepActivities() {\r\n HistoryStep[] steps = currentProcessInstance.getHistorySteps();\r\n String[] activities = new String[steps.length];\r\n State resolvedState = null;\r\n \r\n for (int i = 0; i < steps.length; i++) {\r\n if (steps[i].getResolvedState() != null) {\r\n resolvedState = processModel.getState(steps[i].getResolvedState());\r\n activities[i] = resolvedState.getLabel(currentRole, getLanguage());\r\n } else\r\n activities[i] = \"\";\r\n }\r\n \r\n return activities;\r\n }", "public IPermissionActivity getPermissionActivity(long ownerId, String activityFname);", "Activity getConflictCheckBackwardActivity();", "public int getProblemId() {\n return problemId;\n }", "public Boolean getFlowTracking() throws PermissionDeniedException;", "Collection<ActivityType> getActivityTypes() throws DataAccessException;", "@Override\n\tpublic List<Problem> getProblems() {\n\t\treturn problemDAO.getProblems();\n\t}", "public String getACTIVITY_ID() {\n return ACTIVITY_ID;\n }", "protected Issue getIssue() {\n\t\treturn this.issue.get();\n\t}", "public AccessibleContext getAccessibleContext()\n/* */ {\n/* 106 */ if (this.accessibleContext == null) {\n/* 107 */ this.accessibleContext = new AccessibleAWTPanel();\n/* */ }\n/* 109 */ return this.accessibleContext;\n/* */ }", "public Iterator<Activity> getActivitiesIterator(){\n\t\treturn activities.iterator();\n\t}", "public void getOpenIssues(View view) {\n Intent intent = new Intent().setClass(RepositoryActivity.this, IssueListActivity.class);\n intent.putExtra(Constants.Repository.REPO_OWNER, mBundle\n .getString(Constants.Repository.REPO_OWNER));\n intent.putExtra(Constants.Repository.REPO_NAME, mBundle\n .getString(Constants.Repository.REPO_NAME));\n intent.putExtra(Constants.Issue.ISSUE_STATE, Constants.Issue.ISSUE_STATE_OPEN);\n startActivity(intent);\n }", "abstract public void getPermission();", "Activity getRepairForwardActivity();", "public Problem getproblem() {\n\t return problem;\n\t }", "public IPermissionActivity savePermissionActivity(IPermissionActivity activity);", "public void entityActivated() throws javax.slee.resource.ResourceException {\r\n \t\t\r\n \t\tif (logger.isDebugEnabled()) {\r\n \t\t\tlogger.debug(\"entityActivated() \");\r\n \t\t}\r\n \t\t\r\n \t\ttry {\r\n \t\t\t\r\n \t\t\t// SO EACH ACTIVITY CAN HAVE ACCESS TO SOME NEEDED METHODS DEFINED\r\n \t\t\t// BY THIS INTERFACE, THIS WAY WE DONT HAVE TO WORRY ABOUT PASSING\r\n \t\t\t// IT TO CONSTRUCTOR.\r\n \t\t\tinitializeNamingContextBindings();\r\n \t\t\thttpRaSbbinterface = new HttpServletRaSbbInterfaceImpl(this);\r\n \t\t\tactivities = new ConcurrentHashMap();\r\n \t\t\trequestLock = new RequestLock();\r\n \r\n \t\t} catch (NamingException e) {\r\n \t\t\tthrow new javax.slee.resource.ResourceException(\r\n \t\t\t\t\t\"entityActivated(): Failed to activate HttpServlet RA\",\r\n \t\t\t\t\te);\r\n \t\t}\r\n \t}", "public interface IGaActivity {\n\n /**\n * Get the screen name of the activity\n * @return the name of the screen to be reported to GA for a screen view event\n * @throws UnsetScreenException if screen view is not set by overriding this method\n */\n String getScreenName() throws UnsetScreenException;\n\n /**\n * Get the TrackerManager. This should only be used if you need to send\n * explicitly defined custom GA events within your activity/fragment\n * @return TrackerManager - GA Manager object\n */\n TrackerManager getGaTracker();\n\n /**\n * Set a custom dimension for user events\n * @param customDimension1 first custom dimension\n */\n void setCustomDimension1(String customDimension1);\n\n /**\n * Set a custom dimension for user events\n * @param customDimension2 second custom dimension\n */\n void setCustomDimension2(String customDimension2);\n}", "public interface OpenClassRoomsExercise {\n\n /**\n * How crashes were solved:\n * 1. Modified the id of the view from activity_second_activity_text_view_main\n * to activity_main_activity_text_view_quantity\n * 2. Add String.valueOf() to convert int to String\n */\n\n}", "public abstract NSMutableArray<I_WorkFlowItem> tachesObligatoires();", "public ScanIssue[] getSelectedIssues() {\r\n if(scanIssues == null){\r\n return new ScanIssue[]{};\r\n }\r\n return scanIssues;\r\n }", "public List<Issue> getUserIssues(User user);", "public List<Activity> getAllActivities();", "int getProblemType();", "private Workflow context(Action a) {\n\t\tString workflowClassName = param.workflowName;\n\t\t//Independent actions may be part of some other workflow, fill them in first.\n\t\tfor(Workflow w : workflows) {\n\t\t\tif(w.isSatisfiable(a)) {\n\t\t\t\treturn w;\n\t\t\t}\n\t\t}\n\t\t//The action do not satisfy any existing workflow. We check whether the action is independent.\n\t\t//If it is, we start a new workflow with head = this action.\n\t\ttry {\n\t\t\tClass workflowClass = Class.forName(workflowClassName);\n\t\t\tWorkflow w = (Workflow) workflowClass.newInstance();\n\t\t\tw.sys = this;\n\n\t\t\tif(w.isIndependentAction(a) && w.isSatisfiable(a)) {\n\t\t\t\tworkflows.add(w);\n\t\t\t\tSimLogger.log(Level.FINEST, \"New workflow created with action \" + a);\n\t\t\t\treturn w;\n\t\t\t}\n\t\t} catch(ClassNotFoundException e) {\n\t\t\tSimLogger.log(Level.SEVERE, \"Class not found for workflow class: \" + workflowClassName);\n\t\t\te.printStackTrace();\n\t\t} catch(InstantiationException e) {\n\t\t\tSimLogger.log(Level.SEVERE, \"Default Constructor not found for workflow class: \" + workflowClassName);\n\t\t\te.printStackTrace();\n\t\t} catch(IllegalAccessException e) {\n\t\t\tSimLogger.log(Level.SEVERE, \"Default Constructor not found for workflow class: \" + workflowClassName);\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tSimLogger.log(Level.FINE, \"No workflow can be found to satisify action \" + a +\n\t\t \". Action is execution is cancelled.\");\n\t\treturn null;\n\t}", "protected SearchResult getJiraIssues() throws JiraAccessException {\r\n\tAsynchronousJiraRestClientFactory factory = new AsynchronousJiraRestClientFactory();\r\n\ttry {\r\n\t URI jiraServerUri = new URI(getJiraUrl());\r\n\t JiraRestClient restClient = factory.createWithBasicHttpAuthentication(jiraServerUri, getJiraUsername(),\r\n\t\t getJiraPassword());\r\n\t return restClient.getSearchClient().searchJql(\"project = SITEWHERE\", 1000, 0, null).get();\r\n\t} catch (URISyntaxException e) {\r\n\t throw new JiraAccessException(e);\r\n\t} catch (InterruptedException e) {\r\n\t throw new JiraAccessException(e);\r\n\t} catch (ExecutionException e) {\r\n\t throw new JiraAccessException(e);\r\n\t}\r\n }", "protected ActivityPart getActivityPart() {\n\t\treturn (ActivityPart) getHost();\n\t}", "protected ActivityModule getActivityModule() {\n return new ActivityModule(this);\n }", "interface TaskStackBuilderImpl {\n PendingIntent getPendingIntent(Context context, Intent[] intentArr, int i, int i2, Bundle bundle);\n }", "UsedExceptions getExceptions();", "public abstract Map<IBinder, ClientTransactionItem> getActivitiesToBeDestroyed();", "private void openActivity() {\n }", "public ActivityType getActivityType() {\n return activityType;\n }", "public interface ActivityConstants {\n public static final int SCAN_ACTIVITY = 1001;\n public static final int PREVIOUS_ORDERS_ACTIVITY = 1002;\n public static final String PREFS_NAME = \"LoginData\";\n public static final String PREFS_LOGGED = \"LoggedIn\";\n}", "public List<ExoSocialActivity> getSpaceActivitiesForUpgrade(Identity spaceIdentity, int index, int limit);", "@SuppressWarnings({ \"all\", \"unchecked\", \"rawtypes\" })\npublic interface IXActivity extends VertxPojo, Serializable {\n\n /**\n * Setter for <code>DB_ETERNAL.X_ACTIVITY.KEY</code>. 「key」- 操作行为主键\n */\n public IXActivity setKey(String value);\n\n /**\n * Getter for <code>DB_ETERNAL.X_ACTIVITY.KEY</code>. 「key」- 操作行为主键\n */\n public String getKey();\n\n /**\n * Setter for <code>DB_ETERNAL.X_ACTIVITY.TYPE</code>. 「type」- 操作类型\n */\n public IXActivity setType(String value);\n\n /**\n * Getter for <code>DB_ETERNAL.X_ACTIVITY.TYPE</code>. 「type」- 操作类型\n */\n public String getType();\n\n /**\n * Setter for <code>DB_ETERNAL.X_ACTIVITY.SERIAL</code>. 「serial」- 变更记录号\n */\n public IXActivity setSerial(String value);\n\n /**\n * Getter for <code>DB_ETERNAL.X_ACTIVITY.SERIAL</code>. 「serial」- 变更记录号\n */\n public String getSerial();\n\n /**\n * Setter for <code>DB_ETERNAL.X_ACTIVITY.DESCRIPTION</code>. 「description」-\n * 操作描述信息\n */\n public IXActivity setDescription(String value);\n\n /**\n * Getter for <code>DB_ETERNAL.X_ACTIVITY.DESCRIPTION</code>. 「description」-\n * 操作描述信息\n */\n public String getDescription();\n\n /**\n * Setter for <code>DB_ETERNAL.X_ACTIVITY.MODEL_ID</code>. 「modelId」-\n * 组所关联的模型identifier,用于描述\n */\n public IXActivity setModelId(String value);\n\n /**\n * Getter for <code>DB_ETERNAL.X_ACTIVITY.MODEL_ID</code>. 「modelId」-\n * 组所关联的模型identifier,用于描述\n */\n public String getModelId();\n\n /**\n * Setter for <code>DB_ETERNAL.X_ACTIVITY.MODEL_KEY</code>. 「modelKey」-\n * 组所关联的模型记录ID,用于描述哪一个Model中的记录\n */\n public IXActivity setModelKey(String value);\n\n /**\n * Getter for <code>DB_ETERNAL.X_ACTIVITY.MODEL_KEY</code>. 「modelKey」-\n * 组所关联的模型记录ID,用于描述哪一个Model中的记录\n */\n public String getModelKey();\n\n /**\n * Setter for <code>DB_ETERNAL.X_ACTIVITY.MODEL_CATEGORY</code>.\n * 「modelCategory」- 关联的category记录,只包含叶节点\n */\n public IXActivity setModelCategory(String value);\n\n /**\n * Getter for <code>DB_ETERNAL.X_ACTIVITY.MODEL_CATEGORY</code>.\n * 「modelCategory」- 关联的category记录,只包含叶节点\n */\n public String getModelCategory();\n\n /**\n * Setter for <code>DB_ETERNAL.X_ACTIVITY.TASK_NAME</code>. 「taskName」- 任务名称\n */\n public IXActivity setTaskName(String value);\n\n /**\n * Getter for <code>DB_ETERNAL.X_ACTIVITY.TASK_NAME</code>. 「taskName」- 任务名称\n */\n public String getTaskName();\n\n /**\n * Setter for <code>DB_ETERNAL.X_ACTIVITY.TASK_SERIAL</code>. 「taskSerial」-\n * 任务单号\n */\n public IXActivity setTaskSerial(String value);\n\n /**\n * Getter for <code>DB_ETERNAL.X_ACTIVITY.TASK_SERIAL</code>. 「taskSerial」-\n * 任务单号\n */\n public String getTaskSerial();\n\n /**\n * Setter for <code>DB_ETERNAL.X_ACTIVITY.RECORD_OLD</code>. 「recordOld」-\n * 变更之前的数据(用于回滚)\n */\n public IXActivity setRecordOld(String value);\n\n /**\n * Getter for <code>DB_ETERNAL.X_ACTIVITY.RECORD_OLD</code>. 「recordOld」-\n * 变更之前的数据(用于回滚)\n */\n public String getRecordOld();\n\n /**\n * Setter for <code>DB_ETERNAL.X_ACTIVITY.RECORD_NEW</code>. 「recordNew」-\n * 变更之后的数据(用于更新)\n */\n public IXActivity setRecordNew(String value);\n\n /**\n * Getter for <code>DB_ETERNAL.X_ACTIVITY.RECORD_NEW</code>. 「recordNew」-\n * 变更之后的数据(用于更新)\n */\n public String getRecordNew();\n\n /**\n * Setter for <code>DB_ETERNAL.X_ACTIVITY.SIGMA</code>. 「sigma」- 用户组绑定的统一标识\n */\n public IXActivity setSigma(String value);\n\n /**\n * Getter for <code>DB_ETERNAL.X_ACTIVITY.SIGMA</code>. 「sigma」- 用户组绑定的统一标识\n */\n public String getSigma();\n\n /**\n * Setter for <code>DB_ETERNAL.X_ACTIVITY.LANGUAGE</code>. 「language」- 使用的语言\n */\n public IXActivity setLanguage(String value);\n\n /**\n * Getter for <code>DB_ETERNAL.X_ACTIVITY.LANGUAGE</code>. 「language」- 使用的语言\n */\n public String getLanguage();\n\n /**\n * Setter for <code>DB_ETERNAL.X_ACTIVITY.ACTIVE</code>. 「active」- 是否启用\n */\n public IXActivity setActive(Boolean value);\n\n /**\n * Getter for <code>DB_ETERNAL.X_ACTIVITY.ACTIVE</code>. 「active」- 是否启用\n */\n public Boolean getActive();\n\n /**\n * Setter for <code>DB_ETERNAL.X_ACTIVITY.METADATA</code>. 「metadata」-\n * 附加配置数据\n */\n public IXActivity setMetadata(String value);\n\n /**\n * Getter for <code>DB_ETERNAL.X_ACTIVITY.METADATA</code>. 「metadata」-\n * 附加配置数据\n */\n public String getMetadata();\n\n /**\n * Setter for <code>DB_ETERNAL.X_ACTIVITY.CREATED_AT</code>. 「createdAt」-\n * 创建时间\n */\n public IXActivity setCreatedAt(LocalDateTime value);\n\n /**\n * Getter for <code>DB_ETERNAL.X_ACTIVITY.CREATED_AT</code>. 「createdAt」-\n * 创建时间\n */\n public LocalDateTime getCreatedAt();\n\n /**\n * Setter for <code>DB_ETERNAL.X_ACTIVITY.CREATED_BY</code>. 「createdBy」-\n * 创建人\n */\n public IXActivity setCreatedBy(String value);\n\n /**\n * Getter for <code>DB_ETERNAL.X_ACTIVITY.CREATED_BY</code>. 「createdBy」-\n * 创建人\n */\n public String getCreatedBy();\n\n /**\n * Setter for <code>DB_ETERNAL.X_ACTIVITY.UPDATED_AT</code>. 「updatedAt」-\n * 更新时间\n */\n public IXActivity setUpdatedAt(LocalDateTime value);\n\n /**\n * Getter for <code>DB_ETERNAL.X_ACTIVITY.UPDATED_AT</code>. 「updatedAt」-\n * 更新时间\n */\n public LocalDateTime getUpdatedAt();\n\n /**\n * Setter for <code>DB_ETERNAL.X_ACTIVITY.UPDATED_BY</code>. 「updatedBy」-\n * 更新人\n */\n public IXActivity setUpdatedBy(String value);\n\n /**\n * Getter for <code>DB_ETERNAL.X_ACTIVITY.UPDATED_BY</code>. 「updatedBy」-\n * 更新人\n */\n public String getUpdatedBy();\n\n // -------------------------------------------------------------------------\n // FROM and INTO\n // -------------------------------------------------------------------------\n\n /**\n * Load data from another generated Record/POJO implementing the common\n * interface IXActivity\n */\n public void from(IXActivity from);\n\n /**\n * Copy data into another generated Record/POJO implementing the common\n * interface IXActivity\n */\n public <E extends IXActivity> E into(E into);\n\n @Override\n public default IXActivity fromJson(io.vertx.core.json.JsonObject json) {\n setOrThrow(this::setKey,json::getString,\"KEY\",\"java.lang.String\");\n setOrThrow(this::setType,json::getString,\"TYPE\",\"java.lang.String\");\n setOrThrow(this::setSerial,json::getString,\"SERIAL\",\"java.lang.String\");\n setOrThrow(this::setDescription,json::getString,\"DESCRIPTION\",\"java.lang.String\");\n setOrThrow(this::setModelId,json::getString,\"MODEL_ID\",\"java.lang.String\");\n setOrThrow(this::setModelKey,json::getString,\"MODEL_KEY\",\"java.lang.String\");\n setOrThrow(this::setModelCategory,json::getString,\"MODEL_CATEGORY\",\"java.lang.String\");\n setOrThrow(this::setTaskName,json::getString,\"TASK_NAME\",\"java.lang.String\");\n setOrThrow(this::setTaskSerial,json::getString,\"TASK_SERIAL\",\"java.lang.String\");\n setOrThrow(this::setRecordOld,json::getString,\"RECORD_OLD\",\"java.lang.String\");\n setOrThrow(this::setRecordNew,json::getString,\"RECORD_NEW\",\"java.lang.String\");\n setOrThrow(this::setSigma,json::getString,\"SIGMA\",\"java.lang.String\");\n setOrThrow(this::setLanguage,json::getString,\"LANGUAGE\",\"java.lang.String\");\n setOrThrow(this::setActive,json::getBoolean,\"ACTIVE\",\"java.lang.Boolean\");\n setOrThrow(this::setMetadata,json::getString,\"METADATA\",\"java.lang.String\");\n setOrThrow(this::setCreatedAt,key -> {String s = json.getString(key); return s==null?null:java.time.LocalDateTime.parse(s);},\"CREATED_AT\",\"java.time.LocalDateTime\");\n setOrThrow(this::setCreatedBy,json::getString,\"CREATED_BY\",\"java.lang.String\");\n setOrThrow(this::setUpdatedAt,key -> {String s = json.getString(key); return s==null?null:java.time.LocalDateTime.parse(s);},\"UPDATED_AT\",\"java.time.LocalDateTime\");\n setOrThrow(this::setUpdatedBy,json::getString,\"UPDATED_BY\",\"java.lang.String\");\n return this;\n }\n\n\n @Override\n public default io.vertx.core.json.JsonObject toJson() {\n io.vertx.core.json.JsonObject json = new io.vertx.core.json.JsonObject();\n json.put(\"KEY\",getKey());\n json.put(\"TYPE\",getType());\n json.put(\"SERIAL\",getSerial());\n json.put(\"DESCRIPTION\",getDescription());\n json.put(\"MODEL_ID\",getModelId());\n json.put(\"MODEL_KEY\",getModelKey());\n json.put(\"MODEL_CATEGORY\",getModelCategory());\n json.put(\"TASK_NAME\",getTaskName());\n json.put(\"TASK_SERIAL\",getTaskSerial());\n json.put(\"RECORD_OLD\",getRecordOld());\n json.put(\"RECORD_NEW\",getRecordNew());\n json.put(\"SIGMA\",getSigma());\n json.put(\"LANGUAGE\",getLanguage());\n json.put(\"ACTIVE\",getActive());\n json.put(\"METADATA\",getMetadata());\n json.put(\"CREATED_AT\",getCreatedAt()==null?null:getCreatedAt().toString());\n json.put(\"CREATED_BY\",getCreatedBy());\n json.put(\"UPDATED_AT\",getUpdatedAt()==null?null:getUpdatedAt().toString());\n json.put(\"UPDATED_BY\",getUpdatedBy());\n return json;\n }\n\n}", "private Intent m34056c(Context context) {\n Intent intent = new Intent(\"miui.intent.action.APP_PERM_EDITOR\");\n intent.putExtra(\"extra_pkgname\", context.getPackageName());\n if (m34054a(context, intent)) {\n return intent;\n }\n intent.setClassName(\"com.miui.securitycenter\", \"com.miui.permcenter.permissions.AppPermissionsEditorActivity\");\n if (m34054a(context, intent)) {\n return intent;\n }\n return m34053a(context);\n }", "public interface ActivityDetails {\n\n /**\n * Get the profile associated with the user.\n *\n * @return profile containing attributes for the user\n */\n HumanProfile getUserProfile();\n\n /**\n * Get the profile associated with the application.\n *\n * @return profile containing attributes for the application\n */\n ApplicationProfile getApplicationProfile();\n\n /**\n * Deprecated. Please use getRememberMeId() instead.\n *\n * @return user ID.\n */\n @Deprecated\n String getUserId();\n\n /**\n * Return the remember-me ID, which is a unique, stable identifier for a user in the context of an application/user\n * interaction. You can be use it to identify returning users. Note that it is different for the same user in\n * different applications.\n *\n * @return user ID.\n */\n String getRememberMeId();\n\n\n /**\n * Time and date of the activity.\n *\n * @return time and date of the activity\n */\n Date getTimestamp();\n\n /**\n * Receipt id identifying a completed activity.\n *\n * @return receipt id\n */\n String getReceiptId();\n \n /**\n * @deprecated From v2.1 onwards you should use getUserProfile().getSelfie()\n * JPEG selfie in Base64 string.\n *\n * @return JPEG selfie image in Base64 string format\n */\n @Deprecated\n String getBase64Selfie();\n\n}", "private Activity getActivity() {\n return this;\n }", "public String getActivity(){\n return Activity;\n }", "private Intent m34057d(Context context) {\n Intent intent = new Intent();\n intent.putExtra(Constants.FLAG_PACKAGE_NAME, context.getPackageName());\n intent.setClassName(\"com.color.safecenter\", \"com.color.safecenter.permission.floatwindow.FloatWindowListActivity\");\n if (m34054a(context, intent)) {\n return intent;\n }\n intent.setClassName(\"com.coloros.safecenter\", \"com.coloros.safecenter.sysfloatwindow.FloatWindowListActivity\");\n if (m34054a(context, intent)) {\n return intent;\n }\n intent.setClassName(\"com.oppo.safe\", \"com.oppo.safe.permission.PermissionAppListActivity\");\n if (m34054a(context, intent)) {\n return intent;\n }\n return m34053a(context);\n }", "public static void joinSingleLiveActivity(Context cnx, LiveResult item){\n\n\n loge(\"ACTIVITYUTILS\", toGson(item) );\n\n Intent intent = new Intent(cnx, HostPKLiveActivity.class);\n\n intent.putExtra(Global.Constants.TAB_KEY, 3);\n intent.putExtra(Global.Constants.KEY_IS_ROOM_OWNER, false);\n intent.putExtra(Global.Constants.KEY_CREATE_ROOM, false);\n\n intent.putExtra(Global.Constants.KEY_ROOM_NAME, item.getAdd_broadcast_title());\n intent.putExtra(Global.Constants.KEY_ROOM_ID, item.getRoom_id());\n\n intent.putExtra(Global.Constants.KEY_ROOM_OWNER_ID, item.getUser_id());\n intent.putExtra(Global.Constants.USER_PROFILE, item.getImage());\n intent.putExtra(Global.Constants.USERNAME, item.getUser_name());\n intent.putExtra(Global.Constants.TAB_KEY, Integer.parseInt(item.getBroadcasting_type()));\n intent.putExtra(Global.Constants.BROADCAST_ID, item.getAdd_broadcast_id());\n intent.putExtra(Global.Constants.BROADCASTERID, item.getUser_id());\n\n intent.putExtra(Global.Constants.USER_GENDER, item.getGender());\n intent.putExtra(Global.Constants.USER_AGE, item.getAge());\n\n putUserLevel(intent, item.getDiamond(), item.getLevel(), item.getHeart(), item.getMy_xp());\n\n intent.putExtra(Global.Constants.COUNTDOWN, item.getCount_down_in_sec());\n\n cnx.startActivity(intent);\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic String execute() throws Exception {\n\t\tif(this.client == null)\n\t\t\tthis.client = this.bpmUserClientUtil.getClient();\n\t\t\n\t\tString hisId = this.getSelfHistoryId();\n\t\tActivityInstHistory his = client.getActivityInstHistory(hisId);\n\t\t\t\n\t\tList<ActivityInst> insts = client.getActivityInstListByOutActvityInstHistory(hisId, null);\n\t\n\t\ttotalCount = insts.size();\n\t\tfor(int i=0; i<insts.size(); i++){\n\t\t\tMap<String, Object> map = new HashMap<String, Object>();\n\t\t\tActivityInst inst = insts.get(i);\n\t\t\tif(!inst.isCanTakeBack()){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif(\"suspended\".equals(inst.getState())){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tString name = inst.getActivityDef().getName();\n\t\t\tSystem.out.println(name);\n\t\t\tmap.put(\"name\", name);\n\t\t\tmap.put(\"arriveTime\", DateUtils.format(inst.getArrivedTime(),\n\t\t\t\t\t\"yyyy-MM-dd HH:mm:ss\"));\n\t\t\tif(inst.getStartTime() != null)\n\t\t\t\tmap.put(\"startTime\", DateUtils.format(inst.getStartTime(),\"yyyy-MM-dd HH:mm:ss\"));\n\t\t\telse\n\t\t\t\tmap.put(\"startTime\", \"\");\n\t\t\tmap.put(\"status\", this.getStatus(inst));\n\t\t\tList performers = (List)client.getActivityInstRightAttribute(inst.getActivityInstId(), OARightConstants.ACTIVITYINST_RIGHT_ATT_PERFORMER, null);\n\t\t\tSystem.out.println(inst.getActivityInstId());\n\t\t\tPerson p = (Person) performers.get(0);\n\t\t\tString person = p.getName() + '/' + p.getOrgs()[0].getName();\n\t\t\tmap.put(\"person\", person);\n\t\t\tmap.put(\"instId\", inst.getActivityInstId());\n\t\t\tmap.put(\"historyId\", his.getActivityHistoryId());\n\t\t\tlist.add(map);\n\t\t}\n\t\t\n\t\treturn SUCCESS;\n\t}", "public interface MeetingsActivityView {\n void startMainActivity();\n\n void startMeetingDetailsActivity();\n\n void startMeetingAddActivity();\n\n void errorInfo(String msg);\n\n void errorMeetingCompletedInfo(String msg);\n void successMeetingCompletedInfo(String msg);\n\n\n void startGetMeetings();\n}", "public ExoSocialActivity getActivity(String activityId) throws ActivityStorageException;", "public Integer getActivitytypeid() {\n return activitytypeid;\n }", "private Intent setIntentDataForActivities(int activity)\n {\n\t\tIntent i=new Intent();\n\t\tfor(int j=0;j<Name.length;j++)\n\t\t{\n\t\t Log.d(\"Data sent from DashBoard\", \"depName= \"+Designation[j]+ \" \"+\"realNumber= \"+extension[j]+\" \"+\"username= \"+Name[j]+\" \");\n\t\t}\n\t\tif(activity==0)\n\t\t{\n\t\t i = new Intent(this, EXT_Board.class);\n\t\t i.putExtra(\"Name\", Name);\n\t i.putExtra(\"Designation\", Designation);\n\t i.putExtra(\"Extension\",extension);\n\t \n\t\t}\n\t\telse if(activity==1)\n\t\t{\n\t\t\t i = new Intent(this, Dialer_main.class);\n\t\t\t i.putExtra(\"Name\", Name);\n\t\t i.putExtra(\"Designation\", Designation);\n\t\t i.putExtra(\"Extension\",extension);\n\t\t \n\t\t}\n\t\telse if(activity==2)\n\t\t{\n\t\t\t i = new Intent(this, Settings_Password.class);\n\t\t\t i.putExtra(\"Name\", Name);\n\t\t i.putExtra(\"Designation\", Designation);\n\t\t i.putExtra(\"Extension\",extension);\n\t\t \n\t\t}\n\t\telse if(activity==3)\n\t\t{\n\t\t\t i = new Intent(this, Settings_Call_Routingg.class);\n\t\t\t i.putExtra(\"Name\", Name);\n\t\t i.putExtra(\"Designation\", Designation);\n\t\t i.putExtra(\"Extension\",extension);\n\t\t\n\t\t}\n\t\treturn i;\n }", "public Vector listActivityTypeActivity() throws SQLException {\n Debug.print(\"Inside the getUserAndMemberId\");\n Vector vObj = new Vector();\n try {\n makeConnection();\n String slelctStr = \"SELECT A.activity_type_id,B.specification_id,B.specification_name, A.transaction_type_id FROM \"+ \n DBHelper.USEA_ACTIVITY_CATEGORY+\" A, \"+DBHelper.USEA_SPECIFICATION_MASTER+\" B \"+\n \" WHERE A.activity_type_id = B.activity_type_id AND A.activity_type_name = ? and B.active_status = ? order by B.specification_name\";\n PreparedStatement prepStmt = con.prepareStatement(slelctStr);\n prepStmt.setString(1, \"Activity\");\n prepStmt.setBoolean(2, true);\n \n rs = prepStmt.executeQuery();\n System.out.println(\"Inside the listActivityCategory \");\n while (rs.next()) {\n \n this.specificationId = rs.getString(2);\n this.specificationName = rs.getString(3);\n String txnTypeId = rs.getString(4);\n \n String [] activityList = {specificationId,specificationName,txnTypeId};\n vObj.add(activityList);\n }\n releaseConnection();\n }catch (SQLException e){\n e.printStackTrace();\n }finally {\n releaseConnection();\n }\n return vObj;\n }", "@Bean\n public ProblemModule problemModule() {\n return new ProblemModule();\n }", "private Vulnerabilite convertIssueToVul(Issue issue, ComposantSonar composant)\r\n {\r\n Vulnerabilite retour = new Vulnerabilite();\r\n retour.setComposant(composant.getNom());\r\n retour.setStatus(issue.getStatus());\r\n retour.setDateCreation(issue.getCreationDate());\r\n retour.setSeverite(issue.getSeverity());\r\n retour.setMessage(issue.getMessage());\r\n retour.setLot(composant.getLot());\r\n retour.setAppli(composant.getAppli());\r\n retour.setClarity(Statics.fichiersXML.getLotsRTC().computeIfAbsent(retour.getLot(), s -> ModelFactory.getModel(LotSuiviRTC.class)).getProjetClarity());\r\n retour.setLib(extractLib(retour.getMessage()));\r\n return retour;\r\n }", "public interface WorkflowTransitionTabProvider\n{\n Iterable<WorkflowTransitionTab> getTabs(ActionDescriptor action, JiraWorkflow workflow);\n\n @Nullable\n String getTabContentHtml(String panelKey, ActionDescriptor action, JiraWorkflow workflow);\n\n class WorkflowTransitionTab\n {\n private final String label;\n private final String count;\n private final WebPanelModuleDescriptor module;\n\n public WorkflowTransitionTab(final String label, final String count, final WebPanelModuleDescriptor module)\n {\n this.label = label;\n this.count = count;\n this.module = module;\n }\n\n public String getLabel()\n {\n return label;\n }\n\n public String getCount()\n {\n return count;\n }\n\n public WebPanelModuleDescriptor getModule()\n {\n return module;\n }\n }\n}", "public String toString()\n\t{\treturn \"Issue\" ;\n\t}", "public Context getActivityContext(){\n return mActivityContext;\n }", "protected interface Activity {\r\n boolean isActive(File dir);\r\n }", "int getIssueType();", "private void setActivity(int relType){\n\t\tActivity act = new Activity();\n\t\tActivityDefinition actDef = new ActivityDefinition();\n\t\tactDef.setType(INTERACT_TYPE);\n\t\tactDef.setInteractionType(INTERACT_TYPE);\n\t\t//InteractionComponent iac = new InteractionComponent();\n\t\tact.setDefinition(actDef);\n\t\t\n\t\tHashMap<String, String> names = new HashMap<String, String>();\n\t\t//names.put(\"en\",\"Identifying problems\");\n\t\tnames.put(\"en\", IntlConfiguration.getValue(\"scoretype.\"+ relType, new Locale(\"en\")));\n\t\tnames.put(\"de\", IntlConfiguration.getValue(\"scoretype.\"+ relType, new Locale(\"de\")));\n\n\t\tactDef.setName(names);\n\t\tthis.setObject(act);\n\t\n\t}", "protected abstract Activity getActivity(final T androidComponent);", "@Override\r\n\tpublic Activity getActivity() {\n\t\treturn this;\r\n\t}", "public List<Interview> getActiveInterviews() {\n QueryBase query = new AccessibleInterviews(getDefaultAdminUser(), 2, \n \"desc\", null, 0, Integer.MAX_VALUE);\n \n List<InterviewFilter> filters = new ArrayList<InterviewFilter>(1);\n InterviewFilter filter = new ByActive();\n filter.include(\"true\");\n filters.add(filter);\n \n QueryFilterListBinder filteredQuery = \n new QueryFilterListBinder(query, filters);\n filteredQuery.init(2, \"desc\", 0, Integer.MAX_VALUE);\n QueryResult result = filteredQuery.executeQuery();\n \n return result.getList();\n }", "private void exportMeetingViaIntention(MeetingItem item) {\n Intent intent = new Intent(Intent.ACTION_INSERT);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n intent.setType(\"vnd.android.cursor.item/event\");\n intent.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, item.getMeeting().getStartdate().getMillis());\n intent.putExtra(CalendarContract.EXTRA_EVENT_END_TIME, item.getMeeting().getEnddate().getMillis());\n intent.putExtra(Events.TITLE, item.getMeeting().getTitle());\n intent.putExtra(Events.DESCRIPTION, getMeetingDescription(item));\n intent.putExtra(Events.EVENT_TIMEZONE, \"Europe/Amsterdam\");\n intent.putExtra(Events.EVENT_LOCATION, item.getMeeting().getLocation());\n intent.putExtra(Events.ACCESS_LEVEL, Events.ACCESS_PRIVATE);\n intent.putExtra(Events.AVAILABILITY, Events.AVAILABILITY_BUSY);\n App.getContext().startActivity(intent);\n }", "void mo26168a(Activity activity, String[] strArr, IPermissionCallback nVar);", "ActivityConcept createActivityConcept();", "public interface ProblemDefinition {\n\tManifest getInitialState();\n\tString getDescription();\n\tint getBoatSize();\n\tboolean validate(Stack<Node> path);\n}", "public List<ExoSocialActivity> getSpaceActivities(Identity spaceIdentity, int index, int limit);", "private String[] getManifestPermissions(Activity paramActivity) {\n }", "public Map<IcActivity, Boolean> getActivities(String groupFilter, IapiTool ApiTool, IcUsers user);" ]
[ "0.58308345", "0.5575855", "0.54960144", "0.54007816", "0.53866255", "0.53103626", "0.53067553", "0.52809155", "0.5266447", "0.52513695", "0.5176857", "0.51420814", "0.5130328", "0.5101156", "0.509285", "0.5088939", "0.50865734", "0.50708723", "0.50597656", "0.5053903", "0.5044407", "0.5034649", "0.50313854", "0.50039905", "0.4984616", "0.4980053", "0.49752185", "0.4933188", "0.49204448", "0.4914541", "0.49100482", "0.49087733", "0.49082088", "0.48845756", "0.4852245", "0.48329222", "0.48323134", "0.48248526", "0.48149145", "0.4813417", "0.48026794", "0.479816", "0.47973922", "0.4790574", "0.478733", "0.47713068", "0.4770916", "0.47642967", "0.475895", "0.47581092", "0.4757663", "0.47536334", "0.47513485", "0.4743179", "0.47423843", "0.4738846", "0.4736796", "0.47221094", "0.47108868", "0.4706846", "0.4703144", "0.468149", "0.467999", "0.46776807", "0.46641326", "0.46617338", "0.46591917", "0.46585974", "0.46565914", "0.46525073", "0.46489173", "0.46464044", "0.4636554", "0.46324503", "0.4626604", "0.46255958", "0.46239397", "0.46235627", "0.4620812", "0.4619014", "0.4608143", "0.46075377", "0.46054745", "0.46022895", "0.46012563", "0.4600398", "0.45947784", "0.4588012", "0.458623", "0.45746896", "0.4571559", "0.4567778", "0.456485", "0.45642292", "0.4563275", "0.45632726", "0.45622465", "0.45581734", "0.4555766", "0.45531926" ]
0.7094887
0
provides access to photos
public List<Photo> getPhotos() { return photos; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fotos(){}", "List<Photo> homePagePhotos();", "public void getPhoto() {\n Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n\n //for startActivityForResult, the second parameter, requestCode is used to identify this particular intent\n startActivityForResult(intent, 1);\n }", "private void invokeGetPhoto() {\n // invoke the image gallery using an implicit intent.\n Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);\n // Show only images, no videos or anything else\n photoPickerIntent.setType(\"image/*\");\n photoPickerIntent.setAction(Intent.ACTION_GET_CONTENT);\n // Always show the chooser (if there are multiple options available)\n startActivityForResult(Intent.createChooser(photoPickerIntent, \"Choose a picture\"), REQUEST_IMAGE_CAPTURE);\n }", "private void getPhotos(){\n Boolean isSDPresent = android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED);\n if(isSDPresent)\n new GetAllImagesAsync().execute(MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n else\n Toast.makeText(this,\"There is no external storage present\", Toast.LENGTH_SHORT).show();\n }", "private void getImagesFromServer() {\n trObtainAllPetImages.setUser(user);\n trObtainAllPetImages.execute();\n Map<String, byte[]> petImages = trObtainAllPetImages.getResult();\n Set<String> names = petImages.keySet();\n\n for (String petName : names) {\n byte[] bytes = petImages.get(petName);\n Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, Objects.requireNonNull(bytes).length);\n int index = user.getPets().indexOf(new Pet(petName));\n user.getPets().get(index).setProfileImage(bitmap);\n ImageManager.writeImage(ImageManager.PET_PROFILE_IMAGES_PATH, user.getUsername() + '_' + petName, bytes);\n }\n }", "@DSComment(\"Private Method\")\n @DSBan(DSCat.PRIVATE_METHOD)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:33:59.900 -0500\", hash_original_method = \"BDD10C58ECCC962A5941D61E3DCCB1CC\", hash_generated_method = \"CC96DF6BBA141BCD4483A4EED9B38592\")\n \nprivate Photos() {}", "public int getPhotos() {\n return photos;\n }", "public void getImageFromAlbum() {\n\t\tIntent intent = new Intent();\n\t\tintent.addCategory(Intent.CATEGORY_OPENABLE);\n\t\tintent.setType(\"image/*\");\n\t\t// 根据版本号不同使用不同的Action\n\t\tif (Build.VERSION.SDK_INT < 19) {\n\t\t\tintent.setAction(Intent.ACTION_GET_CONTENT);\n\t\t} else {\n\t\t\tintent.setAction(Intent.ACTION_OPEN_DOCUMENT);\n\t\t}\n\t\tstartActivityForResult(intent, WriteOpinionActivity.RESULT_LOAD_IMAGE);\n\n\t}", "public void getImage(View view){\n if(Build.VERSION.SDK_INT > 19) {\n Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);\n intent.setType(\"image/*\");\n intent.setFlags(Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION);\n intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n startActivityForResult(intent, 100);\n } else {\n Intent intent = new Intent(Intent.ACTION_GET_CONTENT);\n intent.setType(\"image/*\");\n intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n startActivityForResult(intent, 100);\n }\n }", "public void OnPhotos (View View)\n {\n \tIntent intent = new Intent(this, EditPhotos.class);\n \tintent.putExtra(EXTRA_URI, uri);\n \t\tstartActivity(intent);\n }", "private void getPhotos(final View view ) {\r\n final String placeId = Detail.getInstance().getPlaceId();\r\n final Task<PlacePhotoMetadataResponse> photoMetadataResponse = mGeoDataClient.getPlacePhotos(placeId);\r\n photoMetadataResponse.addOnCompleteListener(new OnCompleteListener<PlacePhotoMetadataResponse>() {\r\n @Override\r\n public void onComplete(@NonNull Task<PlacePhotoMetadataResponse> task) {\r\n try {\r\n // Get the list of photos.\r\n PlacePhotoMetadataResponse photos = task.getResult();\r\n // Get the PlacePhotoMetadataBuffer (metadata for all of the photos).\r\n PlacePhotoMetadataBuffer photoMetadataBuffer = photos.getPhotoMetadata();\r\n // Get the first photo in the list.\r\n final LinearLayout ll = (LinearLayout) view.findViewById(R.id.photos_table);\r\n if (photoMetadataBuffer == null) {\r\n Toast.makeText(mContext, \"No photos found\", Toast.LENGTH_SHORT);\r\n\r\n pm.setText(\"No photos found!\");\r\n return;\r\n }\r\n\r\n for ( int i=0; i < photoMetadataBuffer.getCount(); i++ ){\r\n PlacePhotoMetadata photoMetadata = photoMetadataBuffer.get(i).freeze();\r\n // Get the attribution text.\r\n CharSequence attribution = photoMetadata.getAttributions();\r\n // Get a full-size bitmap for the photo.\r\n Task<PlacePhotoResponse> photoResponse = mGeoDataClient.getPhoto(photoMetadata);\r\n photoResponse.addOnCompleteListener(new OnCompleteListener<PlacePhotoResponse>() {\r\n @Override\r\n public void onComplete(@NonNull Task<PlacePhotoResponse> task) {\r\n PlacePhotoResponse photo = task.getResult();\r\n Bitmap bitmap = photo.getBitmap();\r\n System.out.println(\"Photo url: \" + bitmap);\r\n photoURLs.add(bitmap);\r\n ImageView img = new ImageView(mContext);\r\n LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(1000, 1000);\r\n\r\n lp.setMargins(10, 5, 10, 5);\r\n img.setLayoutParams(lp);\r\n img.setImageBitmap(bitmap);\r\n //img.getLayoutParams().width = 1000;\r\n //img.setMaxWidth(1000);\r\n ll.addView(img);\r\n }\r\n });\r\n\r\n }\r\n\r\n\r\n System.out.println(\"Total number of photos: \"+ photoURLs.size());\r\n photoMetadataBuffer.release();\r\n pm.setText(\"No photos found!\");\r\n\r\n } catch ( Exception e) {\r\n pm.setText(\"No photos found!\");\r\n }\r\n }\r\n });\r\n }", "public ArrayList<String> getPhotos() {return photos;}", "private void dispatchGetPictureFromGalleryIntent() {\n Intent pickPhoto = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n if (pickPhoto.resolveActivity(getContext().getPackageManager()) != null) {\n this.startActivityForResult(pickPhoto, PICK_IMAGE);\n }\n }", "private void loadPhotosClicked() {\n Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);\n intent.addCategory(Intent.CATEGORY_OPENABLE);\n intent.setType(\"image/jpeg\");\n intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);\n\n startActivityForResult(Intent.createChooser(intent, \"Choose Photos\"), RQS_OPEN_PHOTO_TREE);\n }", "public void setPhotos(ArrayList<PlacePhoto> photos) {\n this.photos = photos;\n }", "public RealmResults<PhotoGalleryModel> getPhotos( ) {\n return realm.where(PhotoGalleryModel.class).findAll();\n\n }", "@GET\n @Produces(\"application/json\")\n public List<Photos> getPhotos() {\n \tPhotosDAO dao = new PhotosDAO();\n List photos = dao.getPhotos();\n return photos;\n }", "public void loadPictures(View view) {\n\n //creates a pop-up that notifies the users of the permissions requesting, giving the user a choice to either deny or allow permission\n String[] permissions = {Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE};\n\n ActivityCompat.requestPermissions(MainActivity.this,\n new String[]{permissions[0], permissions[1], permissions[2]}, 1);\n\n }", "public void importImageFromGallery(){\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && ContextCompat.checkSelfPermission(mActivity, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_DENIED) {\n mActivity.requestPermissions(new String[]{android.Manifest.permission.WRITE_EXTERNAL_STORAGE}, NoteConstants.WRITE_EXTERNAL_STORAGE_PERMISSION_REQUESTCODE);\n }\n else {\n Intent pickPhoto = new Intent(Intent.ACTION_PICK,\n android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n mActivity.startActivityForResult(pickPhoto, NoteConstants.GALLERY_IMPORT_ACTIVITY_REQUESTCODE);\n }\n }", "public void invokeSelectPhotosAction() {\n\t\tfinal File root = new File(Environment.getExternalStorageDirectory()\n\t\t\t\t+ File.separator + PgrsConstants.DIRECTORY_CAMERA_IMAGE\n\t\t\t\t+ File.separator);\n\t\troot.mkdirs();\n\t\tfinal String fname = PgrsHelper.getInstance()\n\t\t\t\t.getUniqueImageFilename();\n\t\tfinal File sdImageMainDirectory = new File(root, fname);\n\t\toutputFileUri = Uri.fromFile(sdImageMainDirectory);\n\n\t\t// Camera.\n\t\tfinal List<Intent> cameraIntents = new ArrayList<Intent>();\n\t\tfinal Intent captureIntent = new Intent(\n\t\t\t\tandroid.provider.MediaStore.ACTION_IMAGE_CAPTURE);\n\t\tfinal PackageManager packageManager = getPackageManager();\n\t\tfinal List<ResolveInfo> listCam = packageManager.queryIntentActivities(\n\t\t\t\tcaptureIntent, 0);\n\t\tfor (ResolveInfo res : listCam) {\n\t\t\tfinal String packageName = res.activityInfo.packageName;\n\t\t\tfinal Intent intent = new Intent(captureIntent);\n\t\t\tintent.setComponent(new ComponentName(res.activityInfo.packageName,\n\t\t\t\t\tres.activityInfo.name));\n\t\t\tintent.setPackage(packageName);\n\t\t\tintent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);\n\t\t\tcameraIntents.add(intent);\n\t\t}\n\n\t\t// Filesystem.\n\t\tIntent galleryIntent = null;\n\t\tif (Build.VERSION.SDK_INT < 19) {\n\t\t\tgalleryIntent = new Intent();\n\t\t\tgalleryIntent.setType(\"image/*\");\n\t\t\tgalleryIntent.setAction(Intent.ACTION_GET_CONTENT);\n\n\t\t} else {\n\n\t\t\tgalleryIntent = new Intent(\n\t\t\t\t\tIntent.ACTION_PICK,\n\t\t\t\t\tandroid.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n\t\t}\n\n\t\t// Set Common Flags to Gallery Intent\n\t\tif (Build.VERSION.SDK_INT > Build.VERSION_CODES.GINGERBREAD_MR1) {\n\t\t\tgalleryIntent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);\n\t\t}\n\t\tgalleryIntent.putExtra(Intent.CATEGORY_OPENABLE, true);\n\n\t\t// Chooser of filesystem options.\n\t\tfinal Intent chooserIntent = Intent.createChooser(galleryIntent,\n\t\t\t\tPgrsConstants.INTENT_TITLE_PICK_PHOTOS);\n\n\t\t// Add the camera options.\n\t\tchooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS,\n\t\t\t\tcameraIntents.toArray(new Parcelable[] {}));\n\n\t\tstartActivityForResult(chooserIntent,\n\t\t\t\tPgrsConstants.REQUEST_CODE_PICK_PICTURES_FOR_COMPLAINTS);\n\t}", "public ArrayList<PlacePhoto> getPhotos() {\n return photos;\n }", "private void dispatchGalleryIntent() {\n Intent pickPhoto = new Intent(Intent.ACTION_PICK,\n MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n pickPhoto.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n startActivityForResult(pickPhoto, REQUEST_CHOOSE_PHOTO_NUM);\n }", "private void galleryAddPic() {\n Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);\n mediaScanIntent.setData(currentImageUri);\n this.sendBroadcast(mediaScanIntent);\n }", "private void requestTakePhotoPermissions() {\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA)\n != PackageManager.PERMISSION_GRANTED || ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)\n != PackageManager.PERMISSION_GRANTED || ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE)\n != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.CAMERA,\n Manifest.permission.READ_EXTERNAL_STORAGE,\n Manifest.permission.WRITE_EXTERNAL_STORAGE},\n REQUEST_PERMISSON_CAMERA);\n return;\n } else {\n initViews();\n }\n\n }", "public void onImageGalleryClicked(View v){\n //invoke the image gallery using an implicit intent\n Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);\n\n //decides where to store pictures\n File pictureDirectory = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);\n String pictureDirectoryPath = pictureDirectory.getPath();\n\n //gets URI representation\n Uri data = Uri.parse(pictureDirectoryPath);\n\n //sets the data and type of media to look for\n photoPickerIntent.setDataAndType(data,\"image/*\");\n startActivityForResult(photoPickerIntent, Image_Gallery_Request);\n }", "private void retrieveFavoritePhotos() {\n showProgress(this.mProgressBar, this.mRlContent);\n this.mFavoritePhotosViewModel.retrievePhotos();\n }", "@GetMapping(\"images/album/{idOrTitle}/photos\")\n\tprivate List<PhotoEntity> getImagesFromAlbum(@PathVariable String idOrTitle) {\n\t\tList<PhotoEntity> list = new ArrayList<PhotoEntity>();\n\t\tPhotosetEntity photoset = null;\n\t\t\n\t\tlog.info(\"Request to retrieve photos from photoset...\");\n\t\t\n\t\t// Authorize edel-read or do not retrieve anything\n\t\tif (util.authEdelRead() != null) {\n\t\t\t\n\t\t\tphotoset = service.getPhotosetByIdOrTitle(idOrTitle);\n\t\t\t\n\t\t\t// If photoset is not null, set the list of PhotoEntity\n\t\t\tif (photoset != null) {\n\t\t\t\tlist = service.getPhotosFromPhotoset(photoset);\n\t\t\t\tlog.info(\"Request completed with photoset.\");\n\t\t\t} else {\n\t\t\t\tlog.warn(\"Request completed with no photoset.\");\n\t\t\t}\n\t\t} else {\n\t\t\tlog.warn(\"Request completed with failed Authorization.\");\n\t\t}\n\t\t\n\t\treturn list;\n\t}", "private void setPhotoAttcher() {\n\n }", "public void uploadImg(View view){\n Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);\n intent.addCategory(Intent.CATEGORY_OPENABLE);\n intent.setType(\"image/*\");\n intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select Picture\"), SELECT_PICTURE);\n }", "@Override\n public void imageFromGallery() {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select picture\"), PICK_IMAGE);\n }", "private void galleryAddPic() {\n\t}", "public void opengallery() {\n Intent gallery = new Intent();\n gallery.setType(\"image/*\");\n gallery.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(getIntent().createChooser(gallery, \"Choose image\"), PICK_IMAGE);\n\n }", "void addPhoto(User user, Photo photo);", "@Override\n\t\tpublic List<String> getPhotos() throws RemoteException {\n\t\t\treturn null;\n\t\t}", "@Override\n public FlickrResponse searchPhoto(String tags) throws IOException {\n return flickrService.searchPhoto(tags);\n }", "@Override\n\t\t\t\t\t\t\tpublic void success(Collection<Photo> result) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}", "private void addWithGallery() {\n if (PermissionUtils.isPermissionGranted(Manifest.permission.READ_EXTERNAL_STORAGE)) {\n openFilePicker();\n } else {\n PermissionUtils.requestPermission(\n this,\n Manifest.permission.READ_EXTERNAL_STORAGE,\n FILES_PERMISSION_REQUEST);\n }\n }", "@Override\n public void onClick(View v) {\n Intent photoPickerIntent = new Intent();\n photoPickerIntent.setType(\"image/*\");\n photoPickerIntent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(photoPickerIntent, GALLERY_REQUEST);\n }", "public void gallery(View view) {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select Picture\"), REQUEST_IMAGE_GALLERY);\n\n\n }", "public interface PhotoService {\n\n /**\n * Add saved photo to a given user.\n * @param user current user's model object\n * @param photo photo model object\n */\n void addPhoto(User user, Photo photo);\n\n /**\n * Remove saved photo from a given user.\n * @param user current user's model object.\n * @param photoId NASA's API photo identifier.\n */\n void removePhoto(User user, String photoId);\n}", "@Override\n public void onClick(View v) {\n Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);\n //Where do we want to find the data\n File pictureDirectory = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);\n //Get the name of the directory\n String pictureDirectoryPath = pictureDirectory.getPath();\n //Get a URI representation of the Path because this is what android needs to deal with\n Uri data = Uri.parse(pictureDirectoryPath);\n //Set the data (where we want to look for this media) and the type (what media do we want to look for).Get all image types\n photoPickerIntent.setDataAndType(data, \"image/*\");\n //We invoke the image gallery and receive something from it\n if (photoPickerIntent.resolveActivity(getPackageManager()) != null) {\n startActivityForResult(photoPickerIntent, IMAGE_GALLERY_REQUEST);\n }\n\n }", "private void openGallery() {\n\n Intent galleryIntent = new Intent(Intent.ACTION_GET_CONTENT);\n galleryIntent.setType(\"image/*\");\n startActivityForResult(galleryIntent, REQUESCODE);\n }", "public void refreshPhotos() {\n\t\tif(AccessibleUsersList.masterUserList.getUsers() != null) {\n\t\t\tforceListRefreshOn(PhotoListDisplay);\n\t\t\tPhotoListDisplay.setItems(listOfPhotos);\n\t\t}\n\t}", "@OnClick(R.id.iv_add_profile_picture)\n public void changePicture() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n int permissionCheck = ContextCompat.checkSelfPermission(getApplicationContext(),\n android.Manifest.permission.READ_EXTERNAL_STORAGE);\n if (permissionCheck == PackageManager.PERMISSION_GRANTED) {\n selectImageFromGallery();\n } else {\n Toast.makeText(getApplicationContext(),\n getString(R.string.permission_denied), Toast.LENGTH_SHORT).show();\n }\n } else {\n selectImageFromGallery();\n }\n }", "public void uploadPhoto(View view) {\n Intent i = new Intent(\n Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n\n startActivityForResult(i, GET_FROM_GALLERY);\n\n }", "public photoGallery(String pics, File osm, int size) {\n pictureFilePath = pics;\n osmFilePath = osm;\n sizeOfGallery = size;\n gallery = new photo[size];\n }", "private void openGallery() {\n\n Intent galleryIntent = new Intent(Intent.ACTION_GET_CONTENT);\n galleryIntent.setType(\"image/*\");\n startActivityForResult(galleryIntent, REQUESCODE);\n }", "private void uploadImage() {\n if(checkPermissions()){ // if permission is granted we move on with the code\n Intent gallery = new Intent();\n gallery.setType(\"image/\");\n gallery.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(gallery,\"Select Image With: \"),CHOOSE_IMAGE_FROM_GALLERY);\n }else{\n requestPermissionFromUser(); // if permission is not granted we go and request a permission from the user\n }\n }", "private void takePhoto() {\n Intent cameraIntent = new Intent(Intent.ACTION_PICK);\n cameraIntent.setType(\"image/*\");\n //startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);\n startActivityForResult(cameraIntent, GALLERY_PIC_REQUEST);\n }", "private void imagePic(){\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select Picture\"),1);\n\n }", "@Override\n public String getPicPhoto() {\n return pic_filekey;\n }", "@GetMapping(\"/{id}/photos\")\n public GenericResponse getUserPhotos(@PathVariable(value = \"id\") String fbId) {\n // lookup user separately, so that exception is thrown when user does not exist\n userRepository.findById(fbId)\n .orElseThrow(() -> new ResourceNotFoundException(\"User\", \"fbId\", fbId));\n return new GenericResponse(photoRepository.findAllByUserId(fbId).orElse(new ArrayList<>()));\n }", "private void openGallery(){\n Intent gallery = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.INTERNAL_CONTENT_URI);\n startActivityForResult(gallery, PICK_IMAGE);\n }", "public void sharePic(View view) {\n if (ContextCompat.checkSelfPermission(this,\n Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},\n MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE);\n } else {\n // Permission has already been granted\n Intent intent1 = new Intent(Intent.ACTION_PICK,\n android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n intent1.putExtra(\"sender\", \"share_pic\");\n if (intent1.resolveActivity(getPackageManager()) != null) {\n // Create the File where the photo should go\n File photoFile = null;\n try {\n photoFile = createImageFile();\n } catch (IOException ex) {\n // Error occurred while creating the File\n }\n // Continue only if the File was successfully created\n if (photoFile != null) {\n Uri photoURI = FileProvider.getUriForFile(this,\n \"com.classup.provider\",\n photoFile);\n intent1.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);\n startActivityForResult(intent1, ACTIVITY_SELECT_IMAGE);\n }\n }\n }\n }", "public interface PhotosView extends BaseView {\n\n void onPhotosSuccess(List<Photo> photos);\n\n}", "public static void pickPhotoFromGallery(Context context) {\n try {\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {\n Intent intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n ((Activity) context).startActivityForResult(intent, PICK_PHOTO_KITKAT);\n } else {\n Intent intent = new Intent(Intent.ACTION_GET_CONTENT, null);\n intent.setType(\"image/*\");\n ((Activity) context).startActivityForResult(intent, PICK_PHOTO);\n }\n } catch (ActivityNotFoundException e) {\n e.printStackTrace();\n }\n }", "@Override\n public void onClick(View view) {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, getString(R.string.photo_selector)), RESULT_PHOTO_OK);\n }", "@Override\n public void onClick(View view) {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, getString(R.string.photo_selector)), RESULT_PHOTO_OK);\n }", "public void onImageClick(View view) {\n Intent photo_picker = new Intent(Intent.ACTION_PICK,\n android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n photo_picker.setType(\"image/jpeg\");\n startActivityForResult(photo_picker,PHOTO_PICK);\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n switch (requestCode) {\n case PICK_FROM_GALLERY_REQUEST_CODE:\n if (resultCode == RESULT_OK) {\n Uri targetUri = data.getData();\n String path = ImageFilePath.getPath(this, data.getData());\n Bitmap bitmap;\n try {\n bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), targetUri);\n Bitmap finalBitmap = BitmapMods.modifyOrientation(bitmap, path);\n mImages.add(BitmapMods.getResizedBitmap(finalBitmap, 400));\n initializeRecyclerView();\n } catch (Exception e) {\n onPhotoError();\n e.printStackTrace();\n }\n }\n break;\n\n case PICK_FROM_CAMERA_REQUEST_CODE:\n if (resultCode == RESULT_OK) {\n try {\n @SuppressWarnings(\"ConstantConditions\") Bitmap photo = (Bitmap) data.getExtras().get(\"data\");\n mImages.add(photo);\n initializeRecyclerView();\n } catch (Exception e) {\n onPhotoError();\n e.printStackTrace();\n }\n }\n }\n }", "public interface UploadPhotosView extends MvpView {\n\n /**\n * 提交数据\n * 个人图片\n */\n void commitData();\n\n /**\n * 提交数据成功\n */\n void commitDataSuccess();\n void showLoading();\n //void showError();\n\n void uploadPhotos();\n\n /**\n * photoModel指向的图片上传成功\n */\n void onUploadSuccess();\n\n /**\n * photoModel指向的图片上传失败\n\n */\n void onUploadError();\n\n //照片不存在\n void noPicFound(String path);\n\n void updateProgress(long current, long total);\n}", "@Override\n\t protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t if(requestCode == RESULT_LOAD_IMAGE && resultCode == RESULT_OK && null != data) {\n\t \tprofile_photo.setVisibility(View.VISIBLE);\n\t \tUri selectedImage = data.getData();\n\t String[] filePathColumn = { MediaStore.Images.Media.DATA };\n\n\t Cursor cursor = getContentResolver().query(selectedImage,\n\t filePathColumn, null, null, null);\n\t cursor.moveToFirst();\n\n\t int columnIndex = cursor.getColumnIndex(filePathColumn[0]);\n\t String picturePath = cursor.getString(columnIndex);\n\t cursor.close();\n\t \n\t ImageView imageView = (ImageView) findViewById(R.id.profile_photo);\n\t imageView.setImageBitmap(BitmapFactory.decodeFile(picturePath));\n\t }\n\t }", "private void showGalleryChooser() {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select Picture\"), PICK_IMAGE_REQUEST);\n }", "public void choosePicture() {\n\n Intent intent = new Intent();\n intent.setType(\"image/*\"); //inserting all images inside this Image folder\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(intent, 1);\n\n }", "private void galleryIntent() {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);//\n startActivityForResult(Intent.createChooser(intent, \"Select Photo\"), SELECT_PHOTO);\n }", "private void showPhoto(String objectId) {\n\t\tParseQuery<ParseObject> query = ParseQuery.getQuery(\"UserPhoto\");\n\t\tquery.whereEqualTo(\"objectId\", objectId);\n\t\tquery.getFirstInBackground(new GetCallback<ParseObject>() {\n\n\t\t\t@Override\n\t\t\tpublic void done(ParseObject object, ParseException e) {\n\t\t\t\tif (object != null) {\n\t\t\t\t\t// Get image file data\n\t\t\t\t\tParseFile file = (ParseFile) object.get(\"imageFile\");\n\t\t\t\t\tfile.getDataInBackground(new GetDataCallback() {\n\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void done(byte[] data, ParseException e) {\n\t\t\t\t\t\t\tif (e == null) {\n\t\t\t\t\t\t\t\t// Show photo in image view\n\t\t\t\t\t\t\t\tfinal ImageView imageView = (ImageView) findViewById(R.id.imageView1);\n\t\t\t\t\t\t\t\tBitmap bmp = BitmapFactory.decodeByteArray(data,0,data.length);\n\t\t\t\t\t\t\t\timageView.setImageBitmap(bmp);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tLog.d(\"Image file load error\", e.toString());\n\t\t\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t \n\t\t});\n\t}", "private void initPhotos(View v) {\n Bite b = BiteLab.get(getActivity()).getBite(mBiteId);\n mFirstPhoto = new Image\n (this, v, R.id.first_image_button\n , BiteLab.get(getActivity()).getFirstImageFile(b));\n mSecondPhoto = new Image\n (this, v, R.id.second_image_button\n , BiteLab.get(getActivity()).getSecondImageFile(b));\n mThirdPhoto = new Image\n (this, v, R.id.third_image_button\n , BiteLab.get(getActivity()).getThirdImageFile(b));\n }", "private void OpenGallery() {\n Intent pickImage = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n startActivityForResult(pickImage, RequestCode);\n }", "public List<String> getPhotoUrls() {\n return photoUrls;\n }", "@Override\n public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {\n super.onRequestPermissionsResult(requestCode, permissions, grantResults);\n\n if(requestCode == 1) {\n if(grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {\n getPhoto();\n }\n }\n }", "public void openImage() {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(intent, IMAGE_REQUEST);\n }", "public void openGallery(){\n Intent intentImg=new Intent(Intent.ACTION_GET_CONTENT);\n intentImg.setType(\"image/*\");\n startActivityForResult(intentImg,200);\n }", "void imageChooser() {\n\n\n Intent i = new Intent();\n i.setType(\"image/*\");\n i.setAction(Intent.ACTION_GET_CONTENT);\n\n\n startActivityForResult(Intent.createChooser(i, \"Select Picture\"), SELECT_PICTURE);\n }", "private void openGallery() {\n Intent gallery = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.INTERNAL_CONTENT_URI);\n startActivityForResult(gallery, REQUEST_IMAGE_SELECT);\n }", "@Override\n\tpublic void addPhotos(Iterable<Photo> photos) {\n\t\t\n\t}", "private void galleryIntent()\r\n {\r\nIntent gallery=new Intent();\r\ngallery.setType(\"image/*\");\r\ngallery.setAction(Intent.ACTION_GET_CONTENT);\r\n\r\nstartActivityForResult(Intent.createChooser(gallery,\"Select Picture \"),PICK_IMAGE );\r\n }", "@Override\n public void onClick(View view) {\n File file = new File(pathFoto);\n final Intent intent = new Intent(Intent.ACTION_VIEW).setDataAndType(FileProvider.getUriForFile(getApplicationContext(), \"com.B3B.farmbros.android.fileprovider\", file), \"image/*\").addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n startActivity(intent);\n }", "public void OpenGallery(){\n Intent gallery = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n startActivityForResult(gallery, PICK_IMAGE);\n }", "public void getImage(View view)\n {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select Picture\"), PICK_IMAGE);\n\n }", "private Cursor initilizeData(){\n\t String[] dataToAccess = new String[]{\n\t\t \tMediaStore.Images.Media._ID,\t\t\t// This is image file ID\n\t\t MediaStore.Images.Media.DISPLAY_NAME, // filename\n\t\t MediaStore.Images.Media.DATE_TAKEN\t\t// creation date\n\t\t };\n\t String limitSize = MediaStore.Images.Media.DATE_TAKEN + \" desc limit 25\"; // desc: says descending order (in reverse newest first), limit 5: 5, e.g., can also do: \"%s limit 5\"\n\t \n\t // Make the query.\n\t System.out.println(dataToAccess.toString());\n\t Context c = getActivity().getApplicationContext();\n\t mImageRef = c.getContentResolver().query(\n\t \t\tMediaStore.Images.Media.EXTERNAL_CONTENT_URI, // Get the base URI for all of the images\n\t dataToAccess, \t// Which columns to return\n\t \"\", \t// Which rows to return (all rows)\n\t null, \t// Selection arguments (none)\n\t limitSize // Ordering\n\t \t);\n\t \n\t\t// make sure there is something to move to! \n\t\t// \t(otherwise, this will crash if there are no photos) \n\t System.out.println(\"Count: \" + mImageRef.getCount());\n\t\tif (mImageRef.getCount() > 0)\n\t\t\tmImageRef.moveToFirst();\n\t\t\n\t\t\n\t\treturn mImageRef;\n\t}", "@RequestMapping(value = \"/{userID}\", method = RequestMethod.GET)\n\tpublic @ResponseBody List<Photo> getPhotos(@PathVariable long userID) {\n\t\treturn photoServices.getPhotos(userID);\n\t}", "public static void use_photo(Activity activity, int requestCode) {\r\n Intent intent = new Intent(Intent.ACTION_PICK);\r\n intent.setType(\"image/*\");\r\n activity.startActivityForResult(intent, requestCode);\r\n }", "public void changePhoto(View view) {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select Picture\"), PICK_IMAGE_REQUEST);\n }", "private void dispatchLoadPhotoIntent() {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Choose Picture\"), REQUEST_LOAD_PHOTO);\n }", "private void selectImageFromGallery() {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, getString(R.string.select_picture)),\n REQUEST_IMAGE_OPEN);\n }", "@GET(\"/tags/{query}/media/recent\" + CLIENT_ID)\n public void searchPhotos(@Path(\"query\") String query, Callback<WebResponse<ArrayList<InstagramPhoto>>> callback);", "@GET(\"{roverName}/photos\")\n Call<NasaApiResponse> getPhotos(\n @Path(\"roverName\") String roverName,\n @Query(\"sol\") int sol,\n @Query(\"page\") int page,\n @Query(\"api_key\") String apiKey);", "boolean canTakeNewPhoto();", "@Override\n public void onClick(View v) {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n ((MainActivity) getActivity()).startActivityForResult(\n Intent.createChooser(intent, \"Select Picture\"),\n MainActivity.GALLERY_CODE);\n\n }", "public void uploadPic(View view) {\n Intent si=new Intent();\n si.setType(\"image/*\");\n si.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(si,1);\n\n\n }", "void imageChooser() {\n\n // create an instance of the\n // intent of the type image\n Intent i = new Intent();\n i.setType(\"image/*\");\n i.setAction(Intent.ACTION_GET_CONTENT);\n\n\n // pass the constant to compare it\n // with the returned requestCode\n startActivityForResult(Intent.createChooser(i, \"Select Picture\"), SELECT_PICTURE);\n }", "public String getPhoto() {\r\n return photo;\r\n }", "public String getPhoto() {\r\n return photo;\r\n }", "GetImagesResult getImages(GetImagesRequest getImagesRequest);", "public interface PhotoGalleryView extends LoadingView {\n\n void showPhotos(ArrayList<PhotoGalleryItem> arPhotos);\n\n void openFullSizePhoto(int position, ArrayList<PhotoGalleryItem> ar);\n\n void setLoadedCount(int loadedCount, int size);\n\n void showToolbarLoading();\n\n void onAdd(ArrayList<PhotoGalleryItem> ar);\n\n void setPosition(int position);\n}", "public String getPhotoPath() {\n return photoPath;\n }", "@ApiModelProperty(value = \"Photo URL, you'll need to add the token to the url (as ?access_token=) or use the header like you would normally\")\n public String getPhoto() {\n return photo;\n }", "public int getNumPhotos() {\n\t\treturn photos.size();\n\t}", "@Override\n public void onComplete(@NonNull Task<PlacePhotoMetadataResponse> task) {\n try{\n PlacePhotoMetadataResponse photos = task.getResult();\n\n // Get the PlacePhotoMetadataBuffer (metadata for all of the photos).\n photoMetadataBuffer = photos.getPhotoMetadata();\n MyAdapter.photoMetadataBuffer = photos.getPhotoMetadata();\n\n Log.d(\"MainActivity\",photoMetadataBuffer.toString());\n\n Log.d(\"MainActivity\", \" Number of photos \" + photoMetadataBuffer.getCount());\n\n\n // Get the first photo in the list.\n MyAdapter.myPhotos = null;\n if(photoMetadataBuffer.getCount() == 0){\n getYelpReviews();\n MyAdapter.myPhotos = null;\n }\n else{\n myPhotos = new Bitmap[photoMetadataBuffer.getCount()];\n Log.d(\"MainActivity\", \" Number of photos \" + photoMetadataBuffer.getCount());\n\n int i = 0;\n for(i=0;i<photoMetadataBuffer.getCount();i++){\n PlacePhotoMetadata photoMetadata = photoMetadataBuffer.get(i);\n // Get a full-size bitmap for the photo.\n Task<PlacePhotoResponse> photoResponse = mGeoDataClient.getPhoto(photoMetadata);\n\n final int finalI = i;\n photoResponse.addOnCompleteListener(new OnCompleteListener<PlacePhotoResponse>() {\n @Override\n public void onComplete(@NonNull Task<PlacePhotoResponse> task) {\n PlacePhotoResponse photo = task.getResult();\n myPhotos[finalI] = photo.getBitmap();\n Log.d(\"MainActivity\",\"Completed\" + finalI);\n if(finalI == photoMetadataBuffer.getCount()-1){\n getYelpReviews();\n\n }\n }\n });\n\n MyAdapter.myPhotos = myPhotos;\n }\n }\n } catch (Exception e){\n Log.d(\"MainActivity\",\"Some Error Occured\" + e.toString());\n }\n\n }" ]
[ "0.7258191", "0.6811539", "0.6635939", "0.6572377", "0.6442383", "0.6430226", "0.6387549", "0.63810897", "0.63670355", "0.63652086", "0.63280165", "0.6327501", "0.63242286", "0.63099056", "0.63079524", "0.6287416", "0.6278328", "0.6254995", "0.62534136", "0.6252953", "0.62503815", "0.6218117", "0.6206793", "0.6197587", "0.6196271", "0.6186027", "0.6175092", "0.61719936", "0.6167839", "0.61507046", "0.61335266", "0.6101395", "0.6073325", "0.6065051", "0.6064744", "0.6052314", "0.60423315", "0.6034074", "0.6032348", "0.6026405", "0.60142004", "0.6011654", "0.6001277", "0.59902835", "0.59898305", "0.598831", "0.59848803", "0.59801227", "0.5975686", "0.597471", "0.5971042", "0.5967955", "0.5967165", "0.5961062", "0.5947795", "0.59451485", "0.59431434", "0.5939605", "0.5939605", "0.59382486", "0.5936411", "0.59336984", "0.5927268", "0.5918928", "0.59139526", "0.59128726", "0.5909606", "0.58848524", "0.58738524", "0.5869866", "0.5868955", "0.58607334", "0.58559316", "0.5851731", "0.58482575", "0.58448577", "0.5834995", "0.5833085", "0.5824285", "0.58217126", "0.5819463", "0.58126706", "0.581114", "0.580328", "0.5799433", "0.57971287", "0.5796919", "0.57911456", "0.5788561", "0.57826614", "0.57679766", "0.5762724", "0.57581687", "0.57581687", "0.5754175", "0.5751846", "0.57501876", "0.57399917", "0.5730086", "0.5729115" ]
0.65052074
4
returns date of the last data loading from server
public String getLastUpdate() { return lastUpdate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Date getLastServerUpdate();", "long getLastFetchTimeMs();", "private Date computeLastDate() {\n\t\tSyncHistory history = historyDao.loadLastOk();\n\t\tif (history != null) {\n\t\t\treturn history.getTime();\n\t\t}\n\t\treturn new Date(-1);\n\t}", "default long getLastFetchTimeMs() {\n return 0;\n }", "public Date getLastRequest() {\n\t\treturn _last_request;\n\t}", "@Override\n\tpublic synchronized Date getLastUpdate() {\n\t\treturn getDiskLastModifiedDate();\n\t}", "public java.util.Date getLastUpdatedDataTime() {\n return this.lastUpdatedDataTime;\n }", "void saveLastServerUpdate(Date date);", "public Date getLoadDate() {\n return (Date)getAttributeInternal(LOADDATE);\n }", "long getLastAccessedTime();", "long getLastAccessed( );", "public Date getLastUsed() {\r\n\t\treturn lastUsed;\r\n\t}", "long getFetchedDate();", "public long getLastReadTime() {\n return LAST_READ_TIME;\n }", "@SuppressWarnings(\"unused\")\n Date getLastUpdateTime();", "Date getForLastUpdate();", "public Date getLastUpdate() {\r\n return lastUpdate;\r\n }", "private static long getLastReadTime() throws IOException {\n if (isFirstLaunch()) {\n return -1;\n } else {\n List<String> line = FileUtils.readLines(new File(\"couchbase-sync.state\"));\n return Long.parseLong(line.get(0).split(\"\\t\")[1]);\n }\n }", "public int getDownloadPtime();", "Date getLastAccessDate();", "public java.util.Date getLastUsedDate() {\n\t\treturn this.lastUsedDate;\n\t}", "public Date getLastupdatedate() {\n return lastupdatedate;\n }", "public Date getLastUpdateDate()\n {\n return (Date)getAttributeInternal(LASTUPDATEDATE);\n }", "long getLastUpdatedTime();", "@Override\n\tpublic long getLastAccessedTime() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic long getLastAccessedTime() {\n\t\treturn 0;\n\t}", "public long getLastUpdate() {\n return this.lastUpdate;\n }", "long getLastPersistenceTime();", "public final Date getLastModifiedAt( )\n\t{\n\t\treturn new Date( this.data.getLong( \"lastModifiedAt\" ) );\n\t}", "@Override\n\tpublic Date getLastServiced() {\n\t\treturn lastServiced;\n\t}", "public String getLastUpdateDate() {\r\n\t\treturn lastUpdateDate;\r\n\t}", "@Override\n\tpublic java.util.Date getLastSavePoint() {\n\t\treturn _keHoachKiemDemNuoc.getLastSavePoint();\n\t}", "public long getLastUpdateDate() {\n return (Long)content.get(LAST_UPDATE_DATE);\n }", "public Date getLastlogintime() {\n return lastlogintime;\n }", "public Date getLastUpdated() {\n return lastUpdated;\n }", "public Date getLastUpdated() {\n return lastUpdated;\n }", "public Date getLastUpdated() {\n return lastUpdated;\n }", "public Date getLastModified() {\n\t\treturn header.getDate(HttpHeader.LAST_MODIFIED);\n\t}", "public long getDateRecordLastUpdated(){\n return dateRecordLastUpdated;\n }", "public void setDatasetLastAddedToNow() {\n this.datasetLastAdded = new Date();\n }", "public long getLastUpdateTs() {\n return lastUpdateTs;\n }", "public long getLastUpdateTime() {\n return this.lastUpdateTime;\n }", "public Date getLastUpdateTime() {\r\n return lastUpdateTime;\r\n }", "@Override\r\n\tpublic Date getApp_latest_logon_dt() {\n\t\treturn super.getApp_latest_logon_dt();\r\n\t}", "public Date getLastModified() {\n\t\treturn new Date(file.lastModified());\n\t}", "@Override\n public long getLastModifiedTime() {\n return this.processor.getLastModifiedTime();\n }", "public long getLastUpdateTime() {\n return lastUpdateTime;\n }", "public Date getLastModified() {\n return _lastModified;\n }", "public Integer getLastUpdate() {\n return lastUpdate;\n }", "public Date getLastOnlineTime() {\n return lastOnlineTime;\n }", "long getRetrievedTime();", "public Date getLast_seen() {\n return last_seen;\n }", "public Date getLastUpdateDate() {\r\n return lastUpdateDate;\r\n }", "public Date getLastUpdateTime() {\n return lastUpdateTime;\n }", "public Date getLastUpdateTime() {\n return lastUpdateTime;\n }", "public Date getLastUpdateDate() {\n return (Date)getAttributeInternal(LASTUPDATEDATE);\n }", "public Date getLastUpdateDate() {\n return (Date)getAttributeInternal(LASTUPDATEDATE);\n }", "public Date getLastUpdateDate() {\n return (Date)getAttributeInternal(LASTUPDATEDATE);\n }", "public Date getLastUpdateDate() {\n return (Date)getAttributeInternal(LASTUPDATEDATE);\n }", "public Date getLastUpdateDate() {\n return (Date)getAttributeInternal(LASTUPDATEDATE);\n }", "public Date getLastUpdateDate() {\n return (Date)getAttributeInternal(LASTUPDATEDATE);\n }", "public Date getLastUpdateDate() {\n return (Date)getAttributeInternal(LASTUPDATEDATE);\n }", "public DateTime getLastSynced() {\n\t\treturn mLastSynced;\n\t}", "String getDate() { return epoch; }", "public Date getLastTimeLanded() {\n \t\r\n \treturn lastTimeLanded;\r\n }", "public String getCacheLastUpdated() {\n return cacheLastUpdated;\n }", "public long getLastModified()\r\n/* 283: */ {\r\n/* 284:424 */ return getFirstDate(\"Last-Modified\");\r\n/* 285: */ }", "public String getRebillLastDate()\n\t{\n\t\tif(response.containsKey(\"last_date\")) {\n\t\t\treturn response.get(\"last_date\");\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public Date getLastSaved()\r\n {\r\n return (m_lastSaved);\r\n }", "public Date getFlastupdatetime() {\n return flastupdatetime;\n }", "Date getLastTime();", "public Date getDataGatheringDateTime() { return this.dataGatheringDateTime; }", "public long getLastAccessTime();", "public Date getLastAccess() {\n return lastAccess;\n }", "public Date getLastUpdateDt() {\n\t\treturn this.lastUpdateDt;\n\t}", "public Date getLastUpdateDate() {\n return lastUpdateDate;\n }", "long getLastHeartbeat();", "public Date getLastAccessTime() {\n return lastAccessTime;\n }", "@SuppressWarnings(\"unused\")\n public Date getLastUpdateTime() {\n final LocationClient locationClient = getLocationClient();\n return locationClient == null ? null: locationClient.getLastUpdateTime();\n }", "public String getLastDateHistory( String code) {\n String query = \"SELECT * FROM \"+ code +\"R where time > '2015-06-01T00:00:00Z'\";\n QueryResult list = InfluxDaoConnector.getPoints(query,dbName);\n\n if (!checker(list))\n return null;\n\n int size = list.getResults().get(0).getSeries().get(0).getValues().size();\n\n\n return (String) list.getResults().get(0).getSeries().get(0).getValues().get(size-1).get(0);\n\n }", "public String getMapLastUpdateDt() {\n\t\treturn this.mapLastUpdateDt;\n\t}", "public java.sql.Timestamp getLastModified() {\r\n\t\treturn new java.sql.Timestamp(file.lastModified());\r\n\t}", "public java.lang.String getDate_last_update() {\n return date_last_update;\n }", "private long getLastCacheUpdateTimeMillis() {\n return this.fileManager.getFromPreferences(this.context, SETTINGS_KEY);\n }", "protected long getLastDLRow() {\n List<String> res = dbconnector.execRead(\"SELECT id FROM DW_station_state \" +\n \"ORDER BY id DESC \" +\n \"LIMIT 1\").get(0);\n return Long.parseLong(res.get(0));\n }", "@JsonProperty(\"last_used\")\n public Date getLastUsed() {\n return lastUsed;\n }", "@java.lang.Override\n public com.google.protobuf.Timestamp getLastRefreshTime() {\n return lastRefreshTime_ == null\n ? com.google.protobuf.Timestamp.getDefaultInstance()\n : lastRefreshTime_;\n }", "public DateAdp Modified_latest() {return modified_latest;}", "public Date getLastModifiedDate() {\n\t\treturn this.lastModifiedDate;\n\t\t\n\t}", "long getLastAccessAt();", "public Instant getLastUpdate() {\n return lastUpdate;\n }", "public Date getLastSuccess() {\n\t\treturn _last_success;\n\t}", "Date getWorkfileLastChangedDate();", "public java.util.Date getLastModified () {\r\n\t\treturn lastModified;\r\n\t}", "public Timestamp getLastLogintime() {\n return lastLogintime;\n }", "public int getLoadTime(){\n return m_LoadTime;\n }", "public LocalDateTime getLastUpdateDate() {\n return this.lastUpdateDate;\n }", "private String getLatestMarketData() {\n\t\treturn latestMarketData;\n\t}", "public long lastReadBytes()\r\n/* 199: */ {\r\n/* 200:384 */ return this.lastReadBytes;\r\n/* 201: */ }", "public Date getLastUpdateDate() {\n return (Date) getAttributeInternal(LASTUPDATEDATE);\n }" ]
[ "0.70720005", "0.69080085", "0.67112595", "0.6616576", "0.6526778", "0.64294493", "0.63879806", "0.6318847", "0.62857324", "0.62469816", "0.6228559", "0.62085015", "0.6206835", "0.61702096", "0.6169272", "0.616797", "0.6153777", "0.61329234", "0.605944", "0.60417503", "0.60337704", "0.60304695", "0.5990396", "0.5981189", "0.59759283", "0.59759283", "0.5970557", "0.59629107", "0.59624827", "0.59615755", "0.59614974", "0.59584415", "0.59549606", "0.5940057", "0.5926678", "0.5926678", "0.5926678", "0.59228915", "0.5909941", "0.5903623", "0.5899944", "0.58983433", "0.5895048", "0.5893813", "0.58810735", "0.58701175", "0.58698237", "0.58666825", "0.58665717", "0.58663744", "0.5865289", "0.5849581", "0.5844247", "0.5841286", "0.5841286", "0.5815712", "0.5815712", "0.5815712", "0.5815712", "0.5815712", "0.5815712", "0.5815712", "0.58153105", "0.5812068", "0.5809291", "0.5806871", "0.5806243", "0.58036476", "0.580347", "0.57961786", "0.5795548", "0.579267", "0.57903606", "0.5789965", "0.5787258", "0.5786194", "0.57850397", "0.5779371", "0.57675755", "0.5767139", "0.5765327", "0.5765042", "0.5757256", "0.57520586", "0.5749902", "0.5730525", "0.5730271", "0.5727631", "0.57274103", "0.57091975", "0.57014835", "0.56983423", "0.5695222", "0.5691306", "0.56858915", "0.5680582", "0.5668636", "0.56606346", "0.5656857", "0.5651164" ]
0.59037966
39
no not check parameters
public void checkParameters() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void validateInputParameters(){\n\n }", "private void checkForEmptyLine() throws OutmatchingParametersToMethodCall {\n if (this.params.isEmpty() && method.getParamAmount() != 0) {\n throw new OutmatchingParametersToMethodCall();\n } else if (method.getParamAmount() == 0 && !this.params.isEmpty()) {\n throw new OutmatchingParametersToMethodCall();\n }\n }", "public final void nonRedefinissableParEnfant(){\n\n }", "@Override\r\n\tprotected void processIsNotDefinedMsg(InNotDefinedMsg arg0) {\n\t\t\r\n\t}", "abstract public boolean argsNotFull();", "@Override\n\tpublic boolean isParam() {\n\t\treturn false;\n\t}", "protected void missingParams() {\r\n throw new IllegalStateException(\r\n \"Function is missing parameters: \" + getName());\r\n }", "public no(np paramnp)\r\n/* 13: */ {\r\n/* 14:30 */ this.b = paramnp;\r\n/* 15: */ }", "@Override\n\tpublic boolean hasParameterGuard() {\n\t\treturn true;\n\t}", "protected abstract boolean checkedParametersAppend();", "private static void checkArg(Object paramObject) {\n/* 687 */ if (paramObject == null)\n/* 688 */ throw new NullPointerException(\"Argument must not be null\"); \n/* */ }", "public abstract void\n bypassValidation_();", "boolean isNoOp();", "protected void validatePreamp(int[] param) {\n }", "protected int checkParam(Object o, String name)\n {\n if (o == null) {\n System.err.println(format(\"Parameter %s is not set\", name));\n return 1;\n }\n return 0;\n }", "AstroArg empty();", "@Override\n\tpublic void visit(NotExpression arg0) {\n\t\t\n\t}", "@Override\n\tprotected void validateParameterValues() {\n\t\t\n\t}", "@Override\n\t\tpublic void checkPreconditions() {\n\t\t}", "public void sum(){ //np param\n System.out.println(\"SUM method with no params\");\n\n }", "public boolean method_218() {\r\n return false;\r\n }", "boolean hasParameters();", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\r\n public boolean isValidParameterCount(int parameterCount) {\n return parameterCount> 0;\r\n }", "public no() {}", "private static void checkArg(Object s) {\n if (s == null) {\n throw new NullPointerException(\"Argument must not be null\");\n }\n }", "private void validateParameters() {\r\n if (command == null) {\r\n throw new BuildException(\r\n \"'command' parameter should not be null for coverity task.\");\r\n }\r\n\r\n }", "@Test\n public void noUpdateWhenNotValidParams() {\n }", "@Override\n public boolean validate(final String param) {\n return false;\n }", "protected void a(int paramInt1, int paramInt2, boolean paramBoolean, yz paramyz) {}", "public boolean method_216() {\r\n return false;\r\n }", "public org.apache.spark.ml.param.Param<java.lang.String> handleInvalid () { throw new RuntimeException(); }", "private void assertNullHandling(UMLMessageArgument msgArg) throws Exception\r\n\t{\r\n\t\tif(msgArg!=null)\r\n\t\t\tassertFalse(msgArg.equals((UMLMessageArgument)null));\r\n\t\tif(msgArg!=null)\r\n\t\t\tassertFalse(msgArg.equals((Object)null));\r\n\t\tif(msgArg!=null)\r\n\t\t\tassertFalse(msgArg.equals((UMLSymbol)null));\r\n\t}", "void unavailable();", "void unavailable();", "static void return_not_sign(String passed){\n\t\tif(!S)\n\t\t\tcomplete_return_requirements();\n\t}", "public boolean method_2434() {\r\n return false;\r\n }", "public void verifyNoMatching(AcBatchFlight e)\n {\n }", "public boolean isNoOp() {\n\t\treturn false;\n\t}", "public boolean method_2453() {\r\n return false;\r\n }", "protected void validateParameter(String... param) throws NavigationException {\r\n\t\tif (param.length > 0){\r\n\t\t\tfor(int i = 0; i < param.length; i++){\r\n\t\t\t\tif (param[i] != null && param[i].isEmpty()) {\r\n\t\t\t\t\tthrow new NavigationException(\"parametro no enviado\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public boolean method_214() {\r\n return false;\r\n }", "private FunctionParametersValidator() {}", "protected boolean func_70041_e_() { return false; }", "boolean hasParameterValue();", "@Override\n\tpublic void check() {\n\t\t\n\t}", "@Override\n\tpublic void check() {\n\t\t\n\t}", "@Override\n\tprotected boolean validateRequiredParameters() throws Exception {\n\t\treturn true;\n\t}", "static void call_when_parity_not(String passed){\n\t\tif(!P)\n\t\t\tcomplete_call_req(passed.substring(4));\n\t}", "abstract void checkWhetherFunction(int nParamsUsed, SyntaxUnit use);", "abstract protected boolean checkMethod();", "public void smell() {\n\t\t\n\t}", "public void doNothing(){\n\t}", "public boolean method_210() {\r\n return false;\r\n }", "public boolean method_4088() {\n return false;\n }", "void checkValid();", "Not createNot();", "Not createNot();", "protected void validate() {\n // no op\n }", "private void checkParams(String[] params) throws MethodCallWithNonexistentParameter,\n OutmatchingParametersToMethodCall, OutmatchingParameterType, InconvertibleTypeAssignment {\n ArrayList<Variable> methodParams = this.method.getMethodParameters();\n if (params.length != methodParams.size()) {\n // not enough params somewhere, or more than enough.\n throw new OutmatchingParametersToMethodCall();\n }\n int i = 0;\n for (String toBeParam : params) {\n toBeParam = toBeParam.trim();\n Variable toBeVariable = findParamByName(toBeParam);\n VariableVerifier.VerifiedTypes type = methodParams.get(i).getType();\n if (toBeVariable == null) {\n VariableVerifier.VerifiedTypes typeOfString = VariableVerifier.VerifiedTypes.getTypeOfString(toBeParam);\n if (!type.getConvertibles().contains(typeOfString)) {\n throw new MethodCallWithNonexistentParameter();\n }\n } else {\n checkTypes(toBeVariable, methodParams.get(i));\n checkValue(toBeVariable);\n }\n i++;\n }\n }", "public boolean method_108() {\r\n return false;\r\n }", "static void call_without_condition(String passed){\n\t\tcomplete_call_req(passed.substring(5));\n\t}", "public boolean method_4093() {\n return false;\n }", "@Override\n\tpublic boolean checkInput() {\n\t\treturn true;\n\t}", "public boolean method_4102() {\n return false;\n }", "void check();", "void check();", "boolean _non_existent();", "private static void ensureNoParameters(final TransferEncoding encoding) {\n if (!encoding.getParameters().isEmpty()) {\n throw new UnknownTransferEncodingException(\"The transfer encoding should not have parameters: \" + encoding);\n }\n }", "static void return_not_zero(String passed){\n\t\tif(!Z)\n\t\t\tcomplete_return_requirements();\n\t}", "void negarAnalise();", "public boolean method_196() {\r\n return false;\r\n }", "protected void validateAttenuator(int[] param) {\n }", "@Test\n public void testBeforeInsert_NoArgs() {\n assertFalse(pool.beforeInsert(drools1, OBJECT1));\n verify(mgr1, never()).beforeInsert(any(), any());\n\n assertFalse(pool.beforeInsert(droolsDisabled, OBJECT1));\n verify(mgr1, never()).beforeInsert(any(), any());\n }", "protected void validate_return(java.lang.String[] param){\r\n \r\n }", "private void checkParams() throws InvalidParamException{\r\n String error = svm.svm_check_parameter(this.problem, this.param);\r\n if(error != null){\r\n throw new InvalidParamException(\"Invalid parameter setting!\" + error);\r\n }\r\n }", "static void return_not_parity(String passed){\n\t\tif(!P)\n\t\t\tcomplete_return_requirements();\n\t}", "static void ignore() {\n }", "@Override public void action() {\n //Do Nothing\n assert(checkRep());\n }", "default boolean isSpecial() { return false; }", "private void validArguments(Graph graph){\n\t\tif(graph.getEdge(0).isDirected()){\n\t\t\tthrow new IllegalDirectedGraph(\"Error: MinimalSpanningTree calculation only for undirected Graph\");\n\t\t}\n\t\t\n\t\t// Prüfen auf gewichtete Graphen -> Muss gesetzt sein und darf nich kleiner als 1 sein\n\t\tfor(Edge edge : graph.getEdgeSet()){\n\t\t\tif(edge.getAttribute(\"weight\") == null){\n\t\t\t\tthrow new IllegalWeightedGraph(\"Jede Kante muss gewichtet sein\");\n\t\t\t}\n\t\t\tif((int)edge.getAttribute(\"weight\") < 1){\n\t\t\t\tthrow new IllegalWeightedGraph(\"Gewichtung darf nicht 0 oder negativ sein\");\n\t\t\t}\n\t\t}\n\t}", "private boolean validateParams(int amount) {\n\t\tString paramArray[] = {param1,param2,param3,param4,param5,param6};\r\n\t\tfor(int i = 0; i < amount; i++) {\r\n\t\t\tif(paramArray[i] == null) {\r\n\t\t\t\t//Error\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private boolean checkParams(String[] params){\r\n\t\tfor(String param:params){\r\n\t\t\tif(param == \"\" || param == null || param.isEmpty()){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public void nullstill();", "static void call_when_sign_not(String passed){\n\t\tif(!S)\n\t\t\tcomplete_call_req(passed.substring(3));\n\t}", "@Override\n\tpublic boolean checkData() {\n\t\treturn false;\n\t}", "@Override\n\tprotected void check() throws SiDCException, Exception {\n\t\tif (entity == null) {\n\t\t\tthrow new SiDCException(APIStatus.ILLEGAL_ARGUMENT, \"illegal of request.\");\n\t\t}\n\t\tif (StringUtils.isBlank(entity.getStatus())) {\n\t\t\tthrow new SiDCException(APIStatus.ILLEGAL_ARGUMENT, \"illegal of status.\");\n\t\t}\n\t\tif (StringUtils.isBlank(entity.getLangcode())) {\n\t\t\tthrow new SiDCException(APIStatus.ILLEGAL_ARGUMENT, \"illegal of lang code.\");\n\t\t}\n\t}", "void check() throws YangException;", "private static void notPossible () {\r\n\t\tSystem.out.println(\"This operation is not possible\");\r\n\t}", "@Override\n\tpublic boolean isHaveParam() {\n\t\treturn param !=null;\n\t}", "interface NoParametersListener {\n\tvoid execute();\n}", "protected abstract Object validateParameter(Object constraintParameter);", "@Override\n public void checkRebuildParameter(PubDTO pub) throws PubHandlerAssemblyException {\n\n }", "@Override\n public void checkRebuildParameter(PubDTO pub) throws PubHandlerAssemblyException {\n\n }", "public void checkFields(){\n }", "protected void validateFact(Fact[] param) {\r\n\r\n }", "public boolean isParameterProvided();", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "private static void m9058c(String str) {\n StackTraceElement stackTraceElement = Thread.currentThread().getStackTrace()[3];\n String className = stackTraceElement.getClassName();\n String methodName = stackTraceElement.getMethodName();\n throw ((IllegalArgumentException) m9050a(new IllegalArgumentException(\"Parameter specified as non-null is null: method \" + className + \".\" + methodName + \", parameter \" + str)));\n }", "private void checkNotUnknown() {\n if (isUnknown())\n throw new AnalysisException(\"Unexpected 'unknown' value!\");\n }" ]
[ "0.6637809", "0.61247027", "0.60731965", "0.6062472", "0.60473776", "0.60427004", "0.60159206", "0.5991197", "0.5966438", "0.59577364", "0.5955091", "0.59387887", "0.5915402", "0.58858204", "0.58741397", "0.5870773", "0.58670956", "0.58637524", "0.5849069", "0.58276176", "0.58110356", "0.5807824", "0.57928413", "0.5788471", "0.5785398", "0.57807475", "0.57778347", "0.5776042", "0.5771057", "0.5752559", "0.5748015", "0.5730278", "0.57275164", "0.5718185", "0.5718185", "0.5713644", "0.5713374", "0.57028973", "0.56881887", "0.5685791", "0.56799525", "0.5678005", "0.567681", "0.56750613", "0.5674285", "0.5668287", "0.5668287", "0.56660956", "0.5647962", "0.5643729", "0.56434554", "0.5640506", "0.5633417", "0.56273085", "0.5617849", "0.5609201", "0.56063044", "0.56063044", "0.5598227", "0.5582984", "0.5576364", "0.55720806", "0.55712295", "0.55682975", "0.55625445", "0.5562306", "0.5562306", "0.5560834", "0.55604726", "0.5559977", "0.55586934", "0.5549505", "0.55484647", "0.55447125", "0.5532297", "0.5524697", "0.5522785", "0.5506388", "0.5504849", "0.5498121", "0.5479194", "0.54756415", "0.5471165", "0.54701036", "0.5468842", "0.5456526", "0.54534227", "0.5443023", "0.54429793", "0.5436932", "0.5436702", "0.54352117", "0.54318786", "0.54318786", "0.543073", "0.5424557", "0.54212123", "0.5407441", "0.5405428", "0.54042727" ]
0.69343275
0
build the URL with user preferences
public static String getUrlMovie(Context context) { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); return CommonConstants.MOVIE_URL_PREFIX.replace("#size#", sharedPreferences.getString(context.getString(R.string.key_pref_size), CommonConstants.THEMOVIEDB_SIZE_W185) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String initUrlParameter() {\n StringBuffer url = new StringBuffer();\n url.append(URL).append(initPathParameter());\n return url.toString();\n }", "public void createURL(){\n urlDB = ( PREFACE + server + \"/\" + database + options);\n }", "private URL createURLaddUser() {\n try {\n String urlString;\n\n urlString = \"http://cs262.cs.calvin.edu:8081/fitness/users\";\n\n return new URL(urlString);\n\n } catch (Exception e) {\n Toast.makeText(this, \"Failed to make URL\", Toast.LENGTH_SHORT).show();\n }\n\n return null;\n }", "private static URL buildURL(List<String> args) throws MalformedURLException {\n\n\t\tfinal String IDList = args.stream().map(id -> id.toString() + \",\").reduce(\"\", String::concat);\n\n\t\treturn new URL(String.format(BASE_URL, IDList));\n\t}", "private String buildURL(String[] components) {\n\t\tfinal String BASE_URL = \"http://www.campusdish.com/en-US/CSMA/WilliamMary/Menus/\";\n\t\tfinal String ORG_ID = \"&OrgID=231624\";\n\t\tfinal String STATIC_PARAMS = \"&ShowPrice=False&ShowNutrition=True\";\n\t\t\n\t\tHashMap<String, String> location_map = new HashMap<String, String>();\n\t\tHashMap<String, Integer> time_map = new HashMap<String, Integer>();\n\t\t\n\t\tlocation_map.put(\"Sadler\", \"SadlerCenterRFoC.htm?LocationName=Sadler%20Center%20RFoC\");\n\t\tlocation_map.put(\"Commons\", \"CommonsFreshFoodCompany.htm?LocationName=Commons%20Fresh%20Food%20Company\");\n\t\tlocation_map.put(\"Marketplace\", \"Marketplace.htm?LocationName=Marketplace\");\n\t\ttime_map.put(\"Breakfast\", 1);\n\t\ttime_map.put(\"Lunch\", 16);\n\t\ttime_map.put(\"Dinner\", 17);\n\t\t\t\n\t\treturn BASE_URL + location_map.get(components[0]) + ORG_ID + \"&Date=\" + components[1] + \"&MealID=\" + time_map.get(components[2]) + STATIC_PARAMS;\n\t}", "private static String buildGetUserInfodUrl(String userId){\n Uri.Builder uriBuilder = END_POINT.buildUpon()\n .appendQueryParameter(\"method\", GETUSERINFO_METHOD)\n .appendQueryParameter(\"api_key \", API_KEY)\n .appendQueryParameter(\"user_id\", userId);\n return uriBuilder.build().toString();\n }", "WebURL createURL()\n {\n String url = getDir().getURL().getString() + \"!/\" + _cmt._rev.getId().getName();\n return WebURL.getURL(url);\n }", "private String getURL() {\n String url = profileLocation.getText().toString();\n if (url == null || url.length() == 0) {\n return url;\n }\n // if it's not the last (which should be \"Raw\") choice, we'll use the prefix\n if (!url.contains(\"://\")) { // if there is no (http|jr):// prefix, we'll assume it's a http://bit.ly/ URL\n url = \"http://bit.ly/\" + url;\n }\n return url;\n }", "public void configureURL(View view) {\n\n //get url from edit text\n urlString = urlText.getText().toString();\n\n if((urlString.contains(\"https://\") && urlString.length()>8) || (urlString.contains(\"http://\") && urlString.length()>7)) {\n PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putString(\"urlString_\"+alarmID, urlString).apply();\n\n //determine if from configureURLButton or searchButton (require different actions)\n boolean fromConfigureURLButton;\n if(view.getTag().toString().equals(\"configure\")) {\n fromConfigureURLButton = true;\n } else {\n fromConfigureURLButton = false;\n }\n\n Intent intent = new Intent(getApplicationContext(), WebAlarmActivity.class);\n intent.putExtra(\"urlString\", urlString);\n intent.putExtra(\"fromConfigureURLButton\", fromConfigureURLButton);\n intent.putExtra(\"alarmID\", alarmID);\n startActivity(intent);\n } else {\n Toast.makeText(getApplicationContext(), \"Your URL is malformed!\", Toast.LENGTH_SHORT).show();\n }\n\n\n }", "public String formURL(){\n String target = feedURL + \"?s=\" + marketInformation.getTickers().stream().reduce( (a, b) -> a + \",\" + b).get();\n // p0 is just the prices ordered the same as the request\n target += \"&f=p0\";\n return target;\n }", "private String buildRedirectionDetailsBaseUrl( )\n {\n UrlItem urlRedirectionDetails = new UrlItem( MultiviewFormResponseDetailsJspBean.getMultiviewRecordDetailsBaseUrl( ) );\n\n if ( !CollectionUtils.isEmpty( _listFormFilterDisplay ) )\n {\n for ( IFormFilterDisplay formFilterDisplay : _listFormFilterDisplay )\n {\n // Add all the filters values\n String strFilterValue = formFilterDisplay.getValue( );\n if ( !StringUtils.isEmpty( strFilterValue ) )\n {\n String strFilterFullName = FormsConstants.PARAMETER_URL_FILTER_PREFIX + formFilterDisplay.getParameterName( );\n urlRedirectionDetails.addParameter( strFilterFullName, strFilterValue );\n }\n }\n }\n\n // Add the selected panel technical code\n urlRedirectionDetails.addParameter( FormsConstants.PARAMETER_SELECTED_PANEL, _strSelectedPanelTechnicalCode );\n\n // Add sort filter data to the url\n addFilterSortConfigToUrl( urlRedirectionDetails );\n\n return urlRedirectionDetails.getUrl( );\n }", "String buildAuthorizeUrl(LastFmAuthParameters parameters);", "private static String buildUrlString(String base, Map<String, String> params) {\n if (params == null || params.isEmpty()) return API_URL + base;\n //construct get parameters list\n StringBuilder get = new StringBuilder();\n boolean first = true;\n for (String param : params.keySet()) {\n if (!first) get.append('&'); else first = false;\n //add the parameter\n get.append(param);\n String value = params.get(param);\n if (value != null) {\n get.append('=');\n get.append(value);\n }\n }\n //return the full string\n if (get.length() == 0) return API_URL + base;\n return API_URL + base + \"?\" + get.toString();\n }", "String constructUrl() {\n StringBuilder builder = new StringBuilder(256);\n builder.append(parts[DB_PREFIX]);\n \n if(notEmpty(parts[DB_ALT_DBNAME])) {\n builder.append(parts[DB_ALT_DBNAME]);\n builder.append('@');\n } else if(\"jdbc:oracle:thin:\".equals(parts[DB_PREFIX])) {\n builder.append('@');\n } else {\n // most formats\n builder.append(\"//\"); // NOI18N\n }\n \n builder.append(parts[DB_HOST]);\n\n if(notEmpty(parts[DB_INSTANCE_NAME])) {\n builder.append('\\\\');\n builder.append(parts[DB_INSTANCE_NAME]);\n }\n \n if(notEmpty(parts[DB_PORT])) {\n builder.append(':'); // NOI18N\n builder.append(parts[DB_PORT]);\n }\n\n if(notEmpty(parts[DB_PRIMARY_DBNAME])) {\n if(\"jdbc:oracle:thin:\".equals(parts[DB_PREFIX])) {\n builder.append(':'); // NOI18N\n } else {\n builder.append('/'); // NOI18N\n }\n builder.append(parts[DB_PRIMARY_DBNAME]);\n }\n\n char propertyInitialSeparator = ';';\n char propertySeparator = ';';\n if(\"jdbc:mysql:\".equals(parts[DB_PREFIX])) {\n propertyInitialSeparator = '?';\n propertySeparator = '&';\n } else if(\"jdbc:informix-sqli:\".equals(parts[DB_PREFIX])) {\n propertyInitialSeparator = ':';\n }\n \n Set<Map.Entry<String, String>> entries = props.entrySet();\n Iterator<Map.Entry<String, String>> entryIterator = entries.iterator();\n if(entryIterator.hasNext()) {\n builder.append(propertyInitialSeparator);\n Map.Entry<String, String> entry = entryIterator.next();\n builder.append(entry.getKey());\n String value = entry.getValue();\n if(notEmpty(value)) {\n builder.append('=');\n builder.append(value);\n }\n }\n \n while(entryIterator.hasNext()) {\n builder.append(propertySeparator);\n Map.Entry<String, String> entry = entryIterator.next();\n builder.append(entry.getKey());\n String value = entry.getValue();\n if(notEmpty(value)) {\n builder.append('=');\n builder.append(value);\n }\n }\n \n return builder.toString();\n }", "String makePlanCommunityUrl();", "private String getURL() {\n\t\t// TODO : Generate URL\n\t\treturn null;\n\t}", "private String urlBuilder(){\n String timelineURL = \"curgas/timeline.json\";\n final RequestBuilder.UrlBuilder url = new RequestBuilder.UrlBuilder();\n url.setUrl(timelineURL);\n url.appendUrlQuery(\"apikey\", Constants.API_KEY);\n url.appendUrlQuery(\"sort\", SORT_TYPE);\n url.appendUrlQuery(\"jumlah\",TOTAL_POSTS);\n url.appendUrlQuery(\"page\",Integer.toString(PAGE_LOADED));\n\n String buildURL = url.build();\n\n return buildURL;\n }", "@Override\n\tpublic String buildURL(String string) {\n\t\treturn null;\n\t}", "private String getOriginUrl() {\n Uri.Builder builder = url.buildUpon();\n for (Param p : queryParams) {\n builder.appendQueryParameter(p.key, p.value);\n }\n return builder.build().toString();\n }", "@Override\n public String getUrl() {\n StringBuilder sb = new StringBuilder(baseUrl);\n if (mUrlParams.size() > 0) {\n sb.append(\"?\");\n for (String key : mUrlParams.keySet()) {\n sb.append(key);\n sb.append(\"=\");\n sb.append(mUrlParams.get(key));\n sb.append(\"&\");\n }\n }\n String result = sb.substring(0, sb.length() - 1);\n return result;\n }", "private String buildPaginatorUrl( )\n {\n UrlItem url = new UrlItem( JSP_FORMS_MULTIVIEW );\n url.addParameter( FormsConstants.PARAMETER_CURRENT_SELECTED_PANEL, _strSelectedPanelTechnicalCode );\n\n return url.getUrl( );\n }", "public String buildLoginUrl() {\n\t\tfinal GoogleAuthorizationCodeRequestUrl url = flow\n\t\t\t\t.newAuthorizationUrl();\n\t\treturn url.setRedirectUri(CALLBACK_URI).setState(stateToken).build();\n\t}", "String getJoinUrl();", "public String toQueryUrl() {\n StringBuilder urlBuilder = new StringBuilder();\n Set<Map.Entry<String, Object>> entrySet = params.entrySet();\n int i = entrySet.size();\n for (Map.Entry<String, Object> entry : entrySet) {\n try {\n if (null != entry.getValue()) {\n urlBuilder.append(entry.getKey()).append('=')\n .append(URLEncoder.encode(String.valueOf(entry.getValue()), DEFAULT_ENC));\n if (i > 1) {\n urlBuilder.append('&');\n }\n }\n i--;\n } catch (UnsupportedEncodingException e) {\n throw new RuntimeException(e);\n }\n }\n \n return urlBuilder.toString();\n }", "private String buildSearchURL(String companyTicker) {\n Uri.Builder builder = new Uri.Builder();\n builder.scheme(\"https\")\n .authority(\"finance.google.com\")\n .appendPath(\"finance\")\n .appendPath(\"info\")\n .appendQueryParameter(\"client\", \"iq\")\n .appendQueryParameter(\"q\", companyTicker);\n String myUrl = builder.build().toString();\n return myUrl; // return a url\n }", "private String makeServerUrl(){\n\t\tURL url = null;\n\t\t\n\t\t//Make sure we have a valid url\n\t\tString complete = this.preferences.getString(\"server\", \"\");\n\t\ttry {\n\t\t\turl = new URL( complete );\n\t\t} catch( Exception e ) {\n\t\t\tonCreateDialog(DIALOG_INVALID_URL).show();\n\t\t\treturn null;\n\t\t}\n\t\treturn url.toExternalForm();\n\t}", "private String getURL(int rad) {\n \t\tLocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);\n \n \t\t// Define a listener that responds to location updates\n \t\tLocationListener locationListener = new LocationListener() {\n \t\t\tpublic void onLocationChanged(Location location) {\n \t\t\t\t// Called when a new location is found by the network location provider.\n \t\t\t\tcurrentLocation = String.valueOf(location.getLatitude()) + \"+\" + String.valueOf(location.getLongitude());\n \t\t\t}\n \n \t\t\tpublic void onStatusChanged(String provider, int status, Bundle extras) {}\n \n \t\t\tpublic void onProviderEnabled(String provider) {}\n \n \t\t\tpublic void onProviderDisabled(String provider) {}\n \t\t};\n \n \t\t// Register the listener with the Location Manager to receive location updates\n \t\tlocationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener);\n \n \t\tfinal String android_id = Secure.getString(getBaseContext().getContentResolver(),\n \t\t\t\tSecure.ANDROID_ID);\n \t\t//final String user = \"aaa\"; //idk how to deal with making users unique right now\n \t\tString url = \"http://18.238.2.68/cuisinestream/phonedata.cgi?user=\"+android_id+\"&location=\"+currentLocation+\"&radius=\"+rad;\n \t\treturn url;\n \t}", "public void setURL() {\n\t\tURL = Constant.HOST_KALTURA+\"/api_v3/?service=\"+Constant.SERVICE_KALTURA_LOGIN+\"&action=\"\n\t\t\t\t\t\t+Constant.ACTION_KALTURA_LOGIN+\"&loginId=\"+Constant.USER_KALTURA+\"&password=\"+Constant.PASSWORD_KALTURA+\"&format=\"+Constant.FORMAT_KALTURA;\n\t}", "String makePlanCommunityParticipationUrl();", "private URL createURL() {\n try {\n Log.d(\"URL\", \"create\");\n String urlString = \"http://cs262.cs.calvin.edu:8084/cs262dCleaningCrew/task/cjp27\";\n return new URL(urlString);\n } catch (Exception e) {\n Toast.makeText(this, getString(R.string.connection_error), Toast.LENGTH_SHORT).show();\n }\n\n return null;\n }", "java.lang.String getProfileURL();", "private URL buildPm10URL() {\n URL url = null;\n try {\n String urlString = OBSERVATORY_URL\n + API_KEY\n + String.format(VARIABLE_QUERY_FORMAT, PM10_VARIABLE);\n url = new URL(urlString);\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n return url;\n }", "public String setUrl() throws JSONException {\n url = baseUrl + searchName;\n for(int i = 0; i < typesCheckList.size(); i++) {\n if(typesObj.has(typesCheckList.get(i))){\n url += typesObj.getString(typesCheckList.get(i));\n }\n }\n if(V)System.out.println(url);\n return url;\n }", "public DIDURL build() {\n\t\t\treturn url.deepClone(true);\n\t\t}", "public String makeURL(String destlat, String destlog) {\n return \"https://maps.googleapis.com/maps/api/directions/json\" + \"?origin=\" + String.valueOf(mLastLocation.getLatitude()) + \",\" + String.valueOf(mLastLocation.getLongitude()) + \"&destination=\" + destlat + \",\" + destlog + \"&sensor=false&mode=walking&alternatives=true&key=\" + getResources().getString(R.string.google_map_key_for_server);\n }", "private GenericUrl generateAPIURL(Vital vitalToSync, OAuth oAuth) {\n GenericUrl url = null;\n switch (vitalToSync.getWearableType()) {\n case FITBIT:\n url = generateFitbitVitalConnectUrl(vitalToSync, oAuth);\n break;\n case WITHINGS:\n //TODO: Create withings URL\n url = new GenericUrl(withingsBaseURL);\n logger.warn(\"WITHINGS CONNECTION NOT IMPLEMENTED\");\n break;\n }\n return url;\n }", "public String makeURL(double sourcelat, double sourcelog, double destlat,\n\t\t\tdouble destlog) {\n\t\tStringBuilder urlString = new StringBuilder();\n\t\turlString.append(\"http://maps.googleapis.com/maps/api/directions/json\");\n\t\turlString.append(\"?origin=\");// from\n\t\turlString.append(Double.toString(sourcelat));\n\t\turlString.append(\",\");\n\t\turlString.append(Double.toString(sourcelog));\n\t\turlString.append(\"&destination=\");// to\n\t\turlString.append(Double.toString(destlat));\n\t\turlString.append(\",\");\n\t\turlString.append(Double.toString(destlog));\n\t\turlString.append(\"&sensor=false&mode=driving&alternatives=true\");\n\t\treturn urlString.toString();\n\t}", "private URL buildSearchUrl(final String model) {\n final UrlBuilder urlBuilder = UrlBuilder.empty() //\n .withScheme(\"http\") //\n .withHost(\"ark.intel.com\") //\n .withPath(\"/search\") //\n .addParameter(\"q\", model);\n return urlBuilder.toUrl();\n }", "public static String buildNewsAndPoliticPodcastUrl(){\n Uri builtURI = Uri.parse(LISTEN_NOTE_BASE_URL).buildUpon()\n .appendPath(BEST_PODCAST)\n .appendQueryParameter(GENRE_ID, NEWS_POLITIC)\n .build();\n\n return builtURI.toString();\n }", "@Nonnull protected StringBuilder doBuildURL(@Nonnull final StringBuilder builder) {\n return builder;\n }", "protected String constructURL(LatLng... points) {\n\t\tCalendar c = Calendar.getInstance();\n\t\tint hour = c.get(Calendar.HOUR_OF_DAY);\n\t\tlong time = Math.round(c.getTimeInMillis() / 1000);\n\t\tif(hour > 0 && hour < 6) {\n\t\t\ttime = 1343340000;\n\t\t}\n\t\tLatLng start = points[0];\n\t\tLatLng dest = points[1];\n\t\tString sJsonURL = \"http://maps.googleapis.com/maps/api/directions/json?\";\n\n\t\tfinal StringBuffer mBuf = new StringBuffer(sJsonURL);\n\t\tmBuf.append(\"origin=\");\n\t\tmBuf.append(start.latitude);\n\t\tmBuf.append(',');\n\t\tmBuf.append(start.longitude);\n\t\tmBuf.append(\"&destination=\");\n\t\tmBuf.append(dest.latitude);\n\t\tmBuf.append(',');\n\t\tmBuf.append(dest.longitude);\n\t\tmBuf.append(\"&sensor=true&mode=\");\n\t\tmBuf.append(_mTravelMode.getValue());\n\t\tmBuf.append(\"&departure_time=\");\n\t\tmBuf.append(time);\n\n return mBuf.toString();\n\t}", "private static String buildUrl(LatLng minPoint, LatLng maxPoint, int page){\n Uri.Builder uriBuilder = END_POINT.buildUpon()\n .appendQueryParameter(\"method\", SEARCH_METHOD)\n .appendQueryParameter(\"bbox\", minPoint.longitude + \",\" + minPoint.latitude + \",\" + maxPoint.longitude + \",\" + maxPoint.latitude) // box in which we are searching\n .appendQueryParameter(\"extras\", \"geo, url_o, url_c, url_m, url_s, description\") // extra additional parameters\n .appendQueryParameter(\"page\", \"\" + page); // page number to return\n return uriBuilder.build().toString();\n }", "private String generateUrlParameters(HashMap<String, String> parameters) {\n\n\t\tString urlAttachment = \"?\";\n\n\t\tObject[] keys = parameters.keySet().toArray();\n\n\t\tfor(Object key : keys)\n\n\t\t\turlAttachment += key.toString() + \"=\" + parameters.get(key) + \"&\";\n\n\t\treturn urlAttachment;\n\t}", "String createUrl() throws JspException {\n\t\tAssert.state(this.value != null, \"No value set\");\n\t\tHttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest();\n\t\tHttpServletResponse response = (HttpServletResponse) this.pageContext.getResponse();\n\n\t\tStringBuilder url = new StringBuilder();\n\t\tif (this.type == UrlType.CONTEXT_RELATIVE) {\n\t\t\t// add application context to url\n\t\t\tif (this.context == null) {\n\t\t\t\turl.append(request.getContextPath());\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (this.context.endsWith(\"/\")) {\n\t\t\t\t\turl.append(this.context, 0, this.context.length() - 1);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\turl.append(this.context);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (this.type != UrlType.RELATIVE && this.type != UrlType.ABSOLUTE && !this.value.startsWith(\"/\")) {\n\t\t\turl.append('/');\n\t\t}\n\t\turl.append(replaceUriTemplateParams(this.value, this.params, this.templateParams));\n\t\turl.append(createQueryString(this.params, this.templateParams, (url.indexOf(\"?\") == -1)));\n\n\t\tString urlStr = url.toString();\n\t\tif (this.type != UrlType.ABSOLUTE) {\n\t\t\t// Add the session identifier if needed\n\t\t\t// (Do not embed the session identifier in a remote link!)\n\t\t\turlStr = response.encodeURL(urlStr);\n\t\t}\n\n\t\t// HTML and/or JavaScript escape, if demanded.\n\t\turlStr = htmlEscape(urlStr);\n\t\turlStr = (this.javaScriptEscape ? JavaScriptUtils.javaScriptEscape(urlStr) : urlStr);\n\n\t\treturn urlStr;\n\t}", "Builder addUrl(String value);", "private void buildTimeChartUrl() {\n url = \"http://q.lizone.net/index/index/fenshi/label/\" + dataItem.label + \"/\";//api 2.0\n }", "public abstract String toURLParam();", "private GenericUrl generateFitbitVitalConnectUrl(Vital vitalToSync, OAuth oAuth) {\n final String user_id = oAuth.getUser_id();\n String additionalPart = vitalToSync.getType().getFitbitURL();\n return new GenericUrl(fitBitBaseURL + \"/\" + user_id + additionalPart);\n }", "private String genFeedURL(String startDate, String endDate) {\n\t\treturn String.format(\"%sfeed?start_date=%s&end_date=%s&detailed=false&api_key=%s\", \n\t\t\t\tconfig.getApiBaseURL(), startDate, endDate, config.getAPIKey());\n\t}", "private String generateURL(Integer instanceID, String key) {\n\t\treturn \"http://\" + databaseInstances[instanceID] + \"/target?targetID=\" + key;\n\t}", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "private String generateUrl(List<String> codes) {\n StringBuilder builder = new StringBuilder();\n for (String code : codes) {\n builder.append(\",\");\n builder.append(recognizeType(code));\n builder.append(code);\n }\n builder = builder.delete(0, 1);\n return prefix + builder.toString();\n }", "protected void appendQueryProperties(StringBuilder targetUrl, Map<String, Object> model, String encodingScheme)\n throws UnsupportedEncodingException {\n String fragment = null;\n int anchorIndex = targetUrl.indexOf(\"#\");\n if (anchorIndex > -1) {\n fragment = targetUrl.substring(anchorIndex);\n targetUrl.delete(anchorIndex, targetUrl.length());\n }\n\n // If there aren't already some parameters, we need a \"?\".\n boolean first = (targetUrl.toString().indexOf('?') < 0);\n for (Map.Entry<String, Object> entry : queryProperties(model).entrySet()) {\n Object rawValue = entry.getValue();\n Iterator<Object> valueIter;\n if (rawValue != null && rawValue.getClass().isArray()) {\n valueIter = Arrays.asList(ObjectUtils.toObjectArray(rawValue)).iterator();\n }\n else if (rawValue instanceof Collection) {\n valueIter = ((Collection<Object>) rawValue).iterator();\n }\n else {\n valueIter = Collections.singleton(rawValue).iterator();\n }\n while (valueIter.hasNext()) {\n Object value = valueIter.next();\n if (first) {\n targetUrl.append('?');\n first = false;\n }\n else {\n targetUrl.append('&');\n }\n String encodedKey = urlEncode(entry.getKey(), encodingScheme);\n String encodedValue = (value != null ? urlEncode(value.toString(), encodingScheme) : \"\");\n targetUrl.append(encodedKey).append('=').append(encodedValue);\n }\n }\n\n // Append anchor fragment, if any, to end of URL.\n if (fragment != null) {\n targetUrl.append(fragment);\n }\n }", "private static String getBaseUrl() {\n StringBuilder url = new StringBuilder();\n url.append(getProtocol());\n url.append(getHost());\n url.append(getPort());\n url.append(getVersion());\n url.append(getService());\n Log.d(TAG, \"url_base: \" + url.toString());\n return url.toString();\n }", "String getQueryRequestUrl();", "@Nonnull public URL buildURL() throws MalformedURLException {\n installTrustStore();\n \n if (disableNameChecking) {\n final HostnameVerifier allHostsValid = new HostnameVerifier() {\n public boolean verify(final String hostname, final SSLSession session) {\n return true;\n }\n }; \n HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid); \n }\n \n final StringBuilder builder = new StringBuilder(getURL());\n if (getPath() != null) {\n builder.append(getPath());\n }\n\n return new URL(doBuildURL(builder).toString());\n }", "public String generateURL(HashMap<String, String> params) throws java.security.NoSuchAlgorithmException{\n\t\tDBA = params.get(\"merchantName\");\n\t\tRETURN_URL = params.get(\"returnURL\");\n\t\tTRANSACTION_TYPE = params.get(\"transactionType\");\n\t\tDISCOVER_IMAGE = params.get(\"acceptDiscover\").toUpperCase().startsWith(\"Y\") ? \"discvr.gif\" : \"spacer.gif\";\n\t\tAMEX_IMAGE = params.get(\"acceptAmex\").toUpperCase().startsWith(\"Y\") ? \"amex.gif\" : \"spacer.gif\";\n\t\tAMOUNT = params.get(\"amount\");\n\t\tPROTECT_AMOUNT = params.get(\"protectAmount\");\n\t\tREBILLING = params.get(\"rebilling\").toUpperCase().startsWith(\"Y\") ? \"1\" : \"0\";\n\t\tREB_PROTECT = params.get(\"rebProtect\");\n\t\tREB_AMOUNT = params.get(\"rebAmount\");\n\t\tREB_CYCLES = params.get(\"rebCycles\");\n\t\tREB_FIRST_DATE = params.get(\"rebStartDate\");\n\t\tREB_EXPR = params.get(\"rebFrequency\");\n\t\tCUSTOM_ID1 = params.get(\"customID1\");\n\t\tPROTECT_CUSTOM_ID1 = params.get(\"protectCustomID1\");\n\t\tCUSTOM_ID2 = params.get(\"customID2\");\n\t\tPROTECT_CUSTOM_ID2 = params.get(\"protectCustomID2\");\n\t\tSHPF_FORM_ID = params.get(\"paymentTemplate\");\n\t\tRECEIPT_FORM_ID = params.get(\"receiptTemplate\");\n\t\tREMOTE_URL = params.get(\"receiptTempRemoteURL\");\n\t\tCARD_TYPES = setCardTypes();\n\t\tRECEIPT_TPS_DEF = \"SHPF_ACCOUNT_ID SHPF_FORM_ID RETURN_URL DBA AMEX_IMAGE DISCOVER_IMAGE SHPF_TPS_DEF\";\n\t\tRECEIPT_TPS_STRING = setReceiptTpsString();\n\t\tRECEIPT_TAMPER_PROOF_SEAL = calcURLTps(RECEIPT_TPS_STRING);\n\t\tRECEIPT_URL = setReceiptURL();\n\t\tBP10EMU_TPS_DEF = addDefProtectedStatus(\"MERCHANT APPROVED_URL DECLINED_URL MISSING_URL MODE TRANSACTION_TYPE TPS_DEF\");\n\t\tBP10EMU_TPS_STRING = setBp10emuTpsString();\n\t\tBP10EMU_TAMPER_PROOF_SEAL = calcURLTps(BP10EMU_TPS_STRING);\n\t\tSHPF_TPS_DEF = addDefProtectedStatus(\"SHPF_FORM_ID SHPF_ACCOUNT_ID DBA TAMPER_PROOF_SEAL AMEX_IMAGE DISCOVER_IMAGE TPS_DEF SHPF_TPS_DEF\");\n\t\tSHPF_TPS_STRING = setShpfTpsString();\n\t\tSHPF_TAMPER_PROOF_SEAL = calcURLTps(SHPF_TPS_STRING);\n\t\treturn calcURLResponse();\n\t}", "private void buildBS60Url() {\n url = \"http://q.lizone.net/index/index/BSline/res/60/label/\" + dataItem.label;//API 2.0\n }", "private String getTokenizedUrl() {\n SharedPreferences sharedPreferences = getSharedPreferences();\n String tokenKey = MainActivity.sharedPrefKeys.TOKENIZED_URL.toString();\n\n if (sharedPreferences.contains(tokenKey)) {\n return sharedPreferences.getString(tokenKey, \"\");\n }\n return \"\";\n }", "private String generateQueryString(Map<String, String> args) {\n StringBuilder url = new StringBuilder();\n\n // Create the query string (?foo=bar&key1=val1\n url.append(\"?\");\n for (Iterator<Map.Entry<String, String>> it = args.entrySet().iterator(); it.hasNext(); ) {\n Map.Entry<String, String> entry = it.next();\n\n url.append(urlEncode(entry.getKey()));\n url.append(\"=\");\n url.append(urlEncode(entry.getValue()));\n if (it.hasNext()) {\n // More parameters are coming, add a separator\n url.append(\"&\");\n }\n }\n\n return url.toString();\n }", "public String createHrefForUser(final String name) {\n\t\treturn this.userUrlPrefix + name;\n\t}", "@Override\r\n\tprotected String getUrl() {\n\t\tif(tipo==PROFIT_DATOS_COMERCIALES){\r\n\t\t\treturn urlWS + \"/ProfitResumen\";\r\n\t\t}else{\r\n\t\t\treturn urlWS + \"/ProfitDataAdicional\";\r\n\t\t}\r\n\t}", "String getRequestURL();", "private String makeUrlFromInput(String bookQueryText) {\n\n // Replace white spaces with a + symbol to make it compatible to be used in the JSON\n // request URL\n bookQueryText.replaceAll(\" \", \"+\");\n\n StringBuilder urlBuilder = new StringBuilder();\n urlBuilder = urlBuilder.append(GBOOKS_REQUEST_URL_PART1)\n .append(bookQueryText)\n .append(GBOOKS_REQUEST_URL_PART2);\n\n // First encode into UTF-8, then back to a form easily processed by the API\n // This is mainly to avoid issues with spaces and other special characters in the URL\n String finalUrl = Uri.encode(urlBuilder.toString()).replaceAll(\"\\\\+\", \"%20\")\n .replaceAll(\"\\\\%21\", \"!\")\n .replaceAll(\"\\\\%3A\", \":\")\n .replaceAll(\"\\\\%2F\", \"/\")\n .replaceAll(\"\\\\%3F\", \"?\")\n .replaceAll(\"\\\\%26\", \"&\")\n .replaceAll(\"\\\\%3D\", \"=\")\n .replaceAll(\"\\\\%27\", \"'\")\n .replaceAll(\"\\\\%28\", \"(\")\n .replaceAll(\"\\\\%29\", \")\")\n .replaceAll(\"\\\\%20\", \"\\\\+\")\n .replaceAll(\"\\\\%7E\", \"~\");\n return finalUrl;\n }", "public static URL buildUrl(int sorting) {\r\n String baseUrl;\r\n switch(sorting) {\r\n case(SORT_POPULAR):\r\n baseUrl = BASE_URL + POPULAR_MOVIES;\r\n break;\r\n case(SORT_TOP_RATED):\r\n baseUrl = BASE_URL + TOP_RATED_MOVIES;\r\n break;\r\n default:\r\n baseUrl = BASE_URL + POPULAR_MOVIES;\r\n }\r\n Uri builtUri = Uri.parse(baseUrl).buildUpon()\r\n .appendQueryParameter(API_PARAM, API_KEY)\r\n .build();\r\n\r\n URL url = null;\r\n try {\r\n url = new URL(builtUri.toString());\r\n } catch (MalformedURLException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n return url;\r\n }", "@Override\r\n public List<String> buildRequestUrl(String resource, Endpoint endpoint) {\r\n //log = LoggerFactory.getLogger(ScopusAuthorSearchProvider.class);\r\n namespaceDC = Namespace.getNamespace(\"dc\", \"http://purl.org/dc/elements/1.1/\");\r\n namespacePRISM = Namespace.getNamespace(\"prism\", \"http://prismstandard.org/namespaces/basic/2.0/\");\r\n namespaceATOM = Namespace.getNamespace(\"atom\", \"http://www.w3.org/2005/Atom\");\r\n String url = null;\r\n Matcher m = Pattern.compile(PATTERN).matcher(resource);\r\n if (m.find()) {\r\n url = resource;\r\n apiKeyParam = m.group(4);\r\n } else {\r\n Preconditions.checkState(StringUtils.isNotBlank(resource));\r\n String id = resource.substring(resource.lastIndexOf('/') + 1);\r\n url = String.format(API, id.replace('_', '+'));\r\n }\r\n return Collections.singletonList(url);\r\n }", "private String composeUri(String mode, String botName, String kind,\n String fileName) throws URISyntaxException {\n String uri = \"https://\" + host;\n uri += sep(mode);\n uri += sep(appId);\n uri += sep(botName);\n uri += sep(kind);\n uri += sep(fileName);\n return uri;\n }", "String getQueryStateUrl();", "@Override\n\tprotected String url() {\n\t\treturn \"user\";\n\t}", "public static URL getUrlForPostAccChange()\r\n {\r\n String strUrl = getBaseURL() +\"account_services/api/1.0/account/user\";\r\n return str2url( strUrl );\r\n }", "private String getRequestUrl(String query) {\n\n StringBuilder builder = new StringBuilder();\n float lat, lng;\n\n // check for location, if not found, check for locally saved location\n if (location != null) {\n lat = location.lat;\n lng = location.lng;\n } else {\n lat = SharedPrefs.get(C.sp_last_lat);\n lng = SharedPrefs.get(C.sp_last_long);\n }\n String locationStr;\n // if even that is not found, search near Bangalore\n if (lat == -1 || lng == -1) {\n locationStr = \"near=Bengaluru\";\n } else {\n locationStr = \"ll=\" + lat + \",\" + lng;\n }\n\n builder.append(C.API_SEARCH)\n .append(\"client_id=\").append(C.FS_CLIENT_ID).append(\"&\")\n .append(\"client_secret=\").append(C.FS_CLIENT_SECRET).append(\"&\")\n .append(\"v=20191231&\")\n .append(\"limit=20&\")\n .append(\"intent=checkin&\")\n .append(locationStr);\n\n if (query != null) {\n builder.append(\"&query=\").append(query);\n }\n\n return builder.toString();\n\n }", "private static URIBuilder createURIBuilder(String path) {\n\t\tURIBuilder builder = new URIBuilder();\n\t\tif(path.contains(\"?\")) {\n\t\t\tString uri = path.substring(0, path.indexOf(\"?\"));\n\t\t\tString queryParamName = path.substring(path.indexOf(\"?\") + 1, path.indexOf(\"=\"));\n\t\t\tString queryParamValue = path.substring(path.indexOf(\"=\") + 1);\n\t\t\tbuilder.setScheme(\"http\").setHost(HOST).setPath(uri).setParameter(queryParamName, queryParamValue);\n\t\t}\n\t\telse {\n\t\t\tbuilder.setScheme(\"http\").setHost(HOST).setPath(path);\n\t\t}\n\t\treturn builder;\n\t}", "protected static String toExternalForm(PURL u) {\n\n\t// pre-compute length of StringBuffer\n\tint len = u.getProtocol().length() + 1;\n\tif (u.getAuthority() != null && u.getAuthority().length() > 0)\n\t len += 2 + u.getAuthority().length();\n\tif (u.getPath() != null) {\n\t len += u.getPath().length();\n\t}\n\tif (u.getQuery() != null) {\n\t len += 1 + u.getQuery().length();\n\t}\n\tif (u.getRef() != null) \n\t len += 1 + u.getRef().length();\n\n\tStringBuffer result = new StringBuffer(len);\n\tresult.append(u.getProtocol());\n result.append(\":\");\n if (u.getAuthority() != null && u.getAuthority().length() > 0) {\n result.append(\"//\");\n result.append(u.getAuthority());\n }\n if (u.getPath() != null) {\n result.append(u.getPath());\n }\n if (u.getQuery() != null) {\n result.append('?');\n result.append(u.getQuery());\n }\n\tif (u.getRef() != null) {\n\t result.append(\"#\");\n result.append(u.getRef());\n\t}\n\treturn result.toString();\n }", "String getUrl();", "String getUrl();", "String getUrl();", "String getUrl();", "String getUrl();", "public String generateQueryParams() {\n if (petition.getParamsMap().entrySet().size() == 0)\n return \"\";\n else {\n boolean first = true;\n StringBuffer queryParams = new StringBuffer(\"?\");\n Iterator<Map.Entry<String, String>> it = petition.getParamsMap()\n .entrySet().iterator();\n // just iterate the map and fill the httpParams with its content\n while (it.hasNext()) {\n if (!first)\n queryParams.append(\"&\");\n else\n first = false;\n Map.Entry<String, String> e = (Entry<String, String>) it.next();\n String key = URLEncoder.encode(e.getKey());\n String value = URLEncoder.encode(e.getValue());\n queryParams.append(String.format(\"%s=%s\", key, value));\n\n }\n return queryParams.toString();\n }\n }", "public String getURL(){\r\n\t\t \r\n\t\t\r\n\t\treturn rb.getProperty(\"url\");\r\n\t}", "@Override\n public String createEndpointUri() {\n \n Properties scProps = utils.obtainServerConfig();\n String baseUri = scProps.getProperty(TARGET_SERVER_PROPERTY_NAME);\n String accessToken = scProps.getProperty(AUTH_TOKEN_PROPERTY_NAME);\n String sourceName = scProps.getProperty(SOURCES_PROPERTY_NAME);\n String sendPings = scProps.getProperty(SEND_PING_PROPERTY_NAME);\n if (StringUtils.isEmpty(baseUri) || StringUtils.isEmpty(accessToken)) {\n throw new IllegalArgumentException(\"source.config file is missing or does not contain sufficient \" +\n \"information from which to construct an endpoint URI.\");\n }\n if (StringUtils.isEmpty(sourceName) || sourceName.contains(\",\")) {\n throw new IllegalArgumentException(\"Default vantiq: endpoints require a source.config file with a single\" +\n \" source name. Found: '\" + sourceName + \"'.\");\n }\n \n try {\n URI vantiqURI = new URI(baseUri);\n this.setEndpointUri(baseUri);\n String origScheme = vantiqURI.getScheme();\n \n StringBuilder epString = new StringBuilder(vantiqURI.toString());\n epString.append(\"?sourceName=\").append(sourceName);\n this.sourceName = sourceName;\n epString.append(\"&accessToken=\").append(accessToken);\n this.accessToken = accessToken;\n if (sendPings != null) {\n epString.append(\"&sendPings=\").append(sendPings);\n this.sendPings = Boolean.parseBoolean(sendPings);\n }\n if (origScheme.equals(\"http\") || origScheme.equals(\"ws\")) {\n epString.append(\"&noSsl=\").append(\"true\");\n noSsl = true;\n }\n epString.replace(0, origScheme.length(), \"vantiq\");\n URI endpointUri = URI.create(String.valueOf(epString));\n return endpointUri.toString();\n } catch (URISyntaxException mue) {\n throw new IllegalArgumentException(TARGET_SERVER_PROPERTY_NAME + \" from server config file is invalid\",\n mue);\n }\n }", "public String getAuthorizationUrl(final TrueNTHOAuthConfig config) {\n\n\tfinal String baseURL = config.getBaseAuthorizationURL();\n\n\tfinal String callback = OAuthEncoder.encode(config.getCallback());\n\n\tif (config.hasScope()) {\n\t return baseURL + String.format(SCOPED_AUTHORIZE_URL, config.getApiKey(), callback, OAuthEncoder.encode(config.getScope()));\n\t} else {\n\t return baseURL + String.format(AUTHORIZE_URL, config.getApiKey(), callback);\n\t}\n\n }", "protected String constructLoginURL(HttpServletRequest request) {\n String delimiter = \"?\";\n if (authenticationProviderUrl.contains(\"?\")) {\n delimiter = \"&\";\n }\n String loginURL = authenticationProviderUrl + delimiter\n + originalUrlQueryParam + \"=\"\n + request.getRequestURL().toString();\n return loginURL;\n }", "URL getRepositoryWebUrl(ProgrammingExerciseParticipation participation);", "public String generateQueryPath(String str, AVRequestParams aVRequestParams) {\n return buildUrl(str, aVRequestParams);\n }", "private String getJiaoDaUrl(MesItemHolder holder) {\n StringBuilder url = new StringBuilder(holder.getBaseUrl());\n if(holder.isPull()){\n url.append(\"?modcode=jygl_xjhxxck&subsyscode=zpfw&type=searchXjhxx&xjhType=all\");\n }else{\n\n url.append(\"?ype=goPager&requestPager=pager&pageMethod=next&currentPage=\"+(holder.getPager()-1));\n }\n return url.toString();\n }", "public static URL getUrlForProfileSync(){\r\n\t\tString strUrl = getBaseURL() + \"mip_services/core/api/1.0/profile/enhanced\";\r\n\t\treturn str2url(strUrl);\r\n\t}", "public static URL getUrlForHuProfile()\r\n {\r\n String strUrl = getBaseURL() + \"mip_services/core/api/1.0/profile\";\r\n return str2url( strUrl );\r\n }", "public static URL getUrlForReg()\r\n {\r\n String strUrl = getBaseURL() + \"account_services/api/1.0/account\";\r\n return str2url( strUrl );\r\n }", "FullUriTemplateString baseUri();", "private static String composeApiUrl(String string){\r\n\t\treturn API_BASE + API_VERSION + string;\r\n\t}", "String getQueryResultsUrl();", "protected abstract String getUrl();", "private String buildGetUrl(final String job, final String securityToken) {\n\n final RemoteJenkinsServer remoteServer = this.findRemoteHost(this.getRemoteJenkinsName());\n String urlString = remoteServer.getAddress()\n .toString();\n\n urlString += \"/job/\";\n urlString += this.encodeValue(job);\n\n // don't try to include a security token in the URL if none is provided\n if (!securityToken.equals(\"\")) {\n this.addToQueryString(\"token=\" + encodeValue(securityToken));\n }\n return urlString;\n }", "public static URL buildUrl() {\n Uri builtUri = Uri.parse(CONTENT_JSON_URL).buildUpon()\n .build();\n\n URL url = null;\n try {\n url = new URL(builtUri.toString());\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n return url;\n }", "public static URL buildUrl(int id) {\n if (id == R.id.sort_by_popular) {\n SORT_BY = \"popular\";\n }\n if (id == R.id.sort_by_top_rated) {\n SORT_BY = \"top_rated\";\n }\n\n Uri.Builder builder = new Uri.Builder();\n builder.scheme(\"http\")\n .authority(\"api.themoviedb.org\")\n .appendPath(\"3\")\n .appendPath(\"movie\")\n .appendPath(SORT_BY)\n .appendQueryParameter(PARAM_QUERY, Constants.API_KEY)\n .build();\n\n// Uri builtUri = new Uri.Builder().scheme(\"http\")\n// .authority(\"api.themoviedb.org\")\n// .appendPath(\"3\")\n// .appendPath(SORT_BY)\n// .appendQueryParameter(PARAM_QUERY, Constants.API_KEY)\n// .build();\n//\n// Uri.parse(MOVIE_DB_BASE_URL+SORT_BY).buildUpon()\n// .appendQueryParameter(PARAM_QUERY, Constants.API_KEY)\n// .build();\n Log.d(\"BUILDURL\", builder.toString());\n URL url = null;\n try {\n url = new URL(builder.toString());\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n\n return url;\n }" ]
[ "0.6475864", "0.63547844", "0.63289493", "0.62744504", "0.62160456", "0.61953235", "0.61698204", "0.61419415", "0.6135551", "0.6078034", "0.6069312", "0.6031199", "0.60159034", "0.5973115", "0.5944241", "0.5944043", "0.58508277", "0.5846201", "0.58171284", "0.5811259", "0.58022094", "0.5775556", "0.57726115", "0.5768494", "0.5760553", "0.57564753", "0.5732613", "0.56605977", "0.56581914", "0.564616", "0.5626852", "0.55767596", "0.55720294", "0.55688554", "0.55294853", "0.5509442", "0.55045956", "0.5487561", "0.54821265", "0.54677397", "0.54665387", "0.54652166", "0.54352903", "0.5424814", "0.5418302", "0.54137284", "0.5413046", "0.54094386", "0.5399615", "0.5375873", "0.5369945", "0.5369945", "0.5369945", "0.5369945", "0.5369945", "0.5369945", "0.5355051", "0.5347486", "0.5340522", "0.533942", "0.53339565", "0.53225327", "0.5319206", "0.53183883", "0.5316769", "0.5312062", "0.53070927", "0.53066754", "0.5306253", "0.53061515", "0.5303272", "0.53008026", "0.5295919", "0.5288683", "0.52778727", "0.5273419", "0.52712834", "0.5268994", "0.5268939", "0.5268939", "0.5268939", "0.5268939", "0.5268939", "0.526683", "0.5259508", "0.5258528", "0.5257768", "0.52538943", "0.52516437", "0.5246615", "0.5242199", "0.5241239", "0.5239786", "0.5238635", "0.52342564", "0.5234243", "0.523293", "0.5231896", "0.5229792", "0.52261317", "0.5225106" ]
0.0
-1
build the URL with user preferences and actual page
public static String getUrlList(Context context) { return CommonConstants.THEMOVIEDB_URL_LIST .replace("#sort#", PreferenceManager.getDefaultSharedPreferences(context).getString( context.getString(R.string.key_pref_sort), CommonConstants.THEMOVIEDB_SORT_POPULARITY_DES) ) .replace("#page#", String.valueOf(((MainActivity) context).mPage)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String buildURL(String[] components) {\n\t\tfinal String BASE_URL = \"http://www.campusdish.com/en-US/CSMA/WilliamMary/Menus/\";\n\t\tfinal String ORG_ID = \"&OrgID=231624\";\n\t\tfinal String STATIC_PARAMS = \"&ShowPrice=False&ShowNutrition=True\";\n\t\t\n\t\tHashMap<String, String> location_map = new HashMap<String, String>();\n\t\tHashMap<String, Integer> time_map = new HashMap<String, Integer>();\n\t\t\n\t\tlocation_map.put(\"Sadler\", \"SadlerCenterRFoC.htm?LocationName=Sadler%20Center%20RFoC\");\n\t\tlocation_map.put(\"Commons\", \"CommonsFreshFoodCompany.htm?LocationName=Commons%20Fresh%20Food%20Company\");\n\t\tlocation_map.put(\"Marketplace\", \"Marketplace.htm?LocationName=Marketplace\");\n\t\ttime_map.put(\"Breakfast\", 1);\n\t\ttime_map.put(\"Lunch\", 16);\n\t\ttime_map.put(\"Dinner\", 17);\n\t\t\t\n\t\treturn BASE_URL + location_map.get(components[0]) + ORG_ID + \"&Date=\" + components[1] + \"&MealID=\" + time_map.get(components[2]) + STATIC_PARAMS;\n\t}", "private String buildPaginatorUrl( )\n {\n UrlItem url = new UrlItem( JSP_FORMS_MULTIVIEW );\n url.addParameter( FormsConstants.PARAMETER_CURRENT_SELECTED_PANEL, _strSelectedPanelTechnicalCode );\n\n return url.getUrl( );\n }", "private String buildRedirectionDetailsBaseUrl( )\n {\n UrlItem urlRedirectionDetails = new UrlItem( MultiviewFormResponseDetailsJspBean.getMultiviewRecordDetailsBaseUrl( ) );\n\n if ( !CollectionUtils.isEmpty( _listFormFilterDisplay ) )\n {\n for ( IFormFilterDisplay formFilterDisplay : _listFormFilterDisplay )\n {\n // Add all the filters values\n String strFilterValue = formFilterDisplay.getValue( );\n if ( !StringUtils.isEmpty( strFilterValue ) )\n {\n String strFilterFullName = FormsConstants.PARAMETER_URL_FILTER_PREFIX + formFilterDisplay.getParameterName( );\n urlRedirectionDetails.addParameter( strFilterFullName, strFilterValue );\n }\n }\n }\n\n // Add the selected panel technical code\n urlRedirectionDetails.addParameter( FormsConstants.PARAMETER_SELECTED_PANEL, _strSelectedPanelTechnicalCode );\n\n // Add sort filter data to the url\n addFilterSortConfigToUrl( urlRedirectionDetails );\n\n return urlRedirectionDetails.getUrl( );\n }", "private String initUrlParameter() {\n StringBuffer url = new StringBuffer();\n url.append(URL).append(initPathParameter());\n return url.toString();\n }", "private String getURL() {\n String url = profileLocation.getText().toString();\n if (url == null || url.length() == 0) {\n return url;\n }\n // if it's not the last (which should be \"Raw\") choice, we'll use the prefix\n if (!url.contains(\"://\")) { // if there is no (http|jr):// prefix, we'll assume it's a http://bit.ly/ URL\n url = \"http://bit.ly/\" + url;\n }\n return url;\n }", "WebURL createURL()\n {\n String url = getDir().getURL().getString() + \"!/\" + _cmt._rev.getId().getName();\n return WebURL.getURL(url);\n }", "private String getURL() {\n\t\t// TODO : Generate URL\n\t\treturn null;\n\t}", "String buildAuthorizeUrl(LastFmAuthParameters parameters);", "private URL createURLaddUser() {\n try {\n String urlString;\n\n urlString = \"http://cs262.cs.calvin.edu:8081/fitness/users\";\n\n return new URL(urlString);\n\n } catch (Exception e) {\n Toast.makeText(this, \"Failed to make URL\", Toast.LENGTH_SHORT).show();\n }\n\n return null;\n }", "public void configureURL(View view) {\n\n //get url from edit text\n urlString = urlText.getText().toString();\n\n if((urlString.contains(\"https://\") && urlString.length()>8) || (urlString.contains(\"http://\") && urlString.length()>7)) {\n PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putString(\"urlString_\"+alarmID, urlString).apply();\n\n //determine if from configureURLButton or searchButton (require different actions)\n boolean fromConfigureURLButton;\n if(view.getTag().toString().equals(\"configure\")) {\n fromConfigureURLButton = true;\n } else {\n fromConfigureURLButton = false;\n }\n\n Intent intent = new Intent(getApplicationContext(), WebAlarmActivity.class);\n intent.putExtra(\"urlString\", urlString);\n intent.putExtra(\"fromConfigureURLButton\", fromConfigureURLButton);\n intent.putExtra(\"alarmID\", alarmID);\n startActivity(intent);\n } else {\n Toast.makeText(getApplicationContext(), \"Your URL is malformed!\", Toast.LENGTH_SHORT).show();\n }\n\n\n }", "@Override\n public String getUrl() {\n StringBuilder sb = new StringBuilder(baseUrl);\n if (mUrlParams.size() > 0) {\n sb.append(\"?\");\n for (String key : mUrlParams.keySet()) {\n sb.append(key);\n sb.append(\"=\");\n sb.append(mUrlParams.get(key));\n sb.append(\"&\");\n }\n }\n String result = sb.substring(0, sb.length() - 1);\n return result;\n }", "java.lang.String getProfileURL();", "private static String buildUrl(LatLng minPoint, LatLng maxPoint, int page){\n Uri.Builder uriBuilder = END_POINT.buildUpon()\n .appendQueryParameter(\"method\", SEARCH_METHOD)\n .appendQueryParameter(\"bbox\", minPoint.longitude + \",\" + minPoint.latitude + \",\" + maxPoint.longitude + \",\" + maxPoint.latitude) // box in which we are searching\n .appendQueryParameter(\"extras\", \"geo, url_o, url_c, url_m, url_s, description\") // extra additional parameters\n .appendQueryParameter(\"page\", \"\" + page); // page number to return\n return uriBuilder.build().toString();\n }", "private static URL buildURL(List<String> args) throws MalformedURLException {\n\n\t\tfinal String IDList = args.stream().map(id -> id.toString() + \",\").reduce(\"\", String::concat);\n\n\t\treturn new URL(String.format(BASE_URL, IDList));\n\t}", "public void createURL(){\n urlDB = ( PREFACE + server + \"/\" + database + options);\n }", "String createUrl() throws JspException {\n\t\tAssert.state(this.value != null, \"No value set\");\n\t\tHttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest();\n\t\tHttpServletResponse response = (HttpServletResponse) this.pageContext.getResponse();\n\n\t\tStringBuilder url = new StringBuilder();\n\t\tif (this.type == UrlType.CONTEXT_RELATIVE) {\n\t\t\t// add application context to url\n\t\t\tif (this.context == null) {\n\t\t\t\turl.append(request.getContextPath());\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (this.context.endsWith(\"/\")) {\n\t\t\t\t\turl.append(this.context, 0, this.context.length() - 1);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\turl.append(this.context);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (this.type != UrlType.RELATIVE && this.type != UrlType.ABSOLUTE && !this.value.startsWith(\"/\")) {\n\t\t\turl.append('/');\n\t\t}\n\t\turl.append(replaceUriTemplateParams(this.value, this.params, this.templateParams));\n\t\turl.append(createQueryString(this.params, this.templateParams, (url.indexOf(\"?\") == -1)));\n\n\t\tString urlStr = url.toString();\n\t\tif (this.type != UrlType.ABSOLUTE) {\n\t\t\t// Add the session identifier if needed\n\t\t\t// (Do not embed the session identifier in a remote link!)\n\t\t\turlStr = response.encodeURL(urlStr);\n\t\t}\n\n\t\t// HTML and/or JavaScript escape, if demanded.\n\t\turlStr = htmlEscape(urlStr);\n\t\turlStr = (this.javaScriptEscape ? JavaScriptUtils.javaScriptEscape(urlStr) : urlStr);\n\n\t\treturn urlStr;\n\t}", "public String buildLoginUrl() {\n\t\tfinal GoogleAuthorizationCodeRequestUrl url = flow\n\t\t\t\t.newAuthorizationUrl();\n\t\treturn url.setRedirectUri(CALLBACK_URI).setState(stateToken).build();\n\t}", "String getJoinUrl();", "public HomeSection enterUrl(){\r\n\t\tGlobal.driver.get(CONSTANT.proUrl);\r\n\t\treturn new HomeSection();\r\n\t}", "public String formURL(){\n String target = feedURL + \"?s=\" + marketInformation.getTickers().stream().reduce( (a, b) -> a + \",\" + b).get();\n // p0 is just the prices ordered the same as the request\n target += \"&f=p0\";\n return target;\n }", "String makePlanCommunityUrl();", "protected abstract String getUrl();", "String getQueryStateUrl();", "private static String buildUrlString(String base, Map<String, String> params) {\n if (params == null || params.isEmpty()) return API_URL + base;\n //construct get parameters list\n StringBuilder get = new StringBuilder();\n boolean first = true;\n for (String param : params.keySet()) {\n if (!first) get.append('&'); else first = false;\n //add the parameter\n get.append(param);\n String value = params.get(param);\n if (value != null) {\n get.append('=');\n get.append(value);\n }\n }\n //return the full string\n if (get.length() == 0) return API_URL + base;\n return API_URL + base + \"?\" + get.toString();\n }", "private static String buildGetUserInfodUrl(String userId){\n Uri.Builder uriBuilder = END_POINT.buildUpon()\n .appendQueryParameter(\"method\", GETUSERINFO_METHOD)\n .appendQueryParameter(\"api_key \", API_KEY)\n .appendQueryParameter(\"user_id\", userId);\n return uriBuilder.build().toString();\n }", "URL getRepositoryWebUrl(ProgrammingExerciseParticipation participation);", "private String getJiaoDaUrl(MesItemHolder holder) {\n StringBuilder url = new StringBuilder(holder.getBaseUrl());\n if(holder.isPull()){\n url.append(\"?modcode=jygl_xjhxxck&subsyscode=zpfw&type=searchXjhxx&xjhType=all\");\n }else{\n\n url.append(\"?ype=goPager&requestPager=pager&pageMethod=next&currentPage=\"+(holder.getPager()-1));\n }\n return url.toString();\n }", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "String getQueryRequestUrl();", "String makePlanCommunityParticipationUrl();", "String getRequestedUrl();", "private String getOriginUrl() {\n Uri.Builder builder = url.buildUpon();\n for (Param p : queryParams) {\n builder.appendQueryParameter(p.key, p.value);\n }\n return builder.build().toString();\n }", "String getQueryResultsUrl();", "String getRequestURL();", "@Override // com.zhihu.android.app.p1311ui.fragment.BaseFragment\n public String onPb3PageUrl() {\n return C6969H.m41409d(\"G6F82DE1FAA22A773A9418447E2ECC0E86D86C11BB63CE43DE91E994BCD\") + this.f90220J;\n }", "public String getCorrectURL() {\n\t\treturn defineCorrectURL(); \t\r\n\t}", "protected String getAdminUsersPageUrl() {\n return new StringBuilder(getBaseUrl())\n .append(reverseRouter.with(UsersController::users))\n .toString();\n }", "@Override\n\tpublic String buildURL(String string) {\n\t\treturn null;\n\t}", "public static URL getUrlForHuProfile()\r\n {\r\n String strUrl = getBaseURL() + \"mip_services/core/api/1.0/profile\";\r\n return str2url( strUrl );\r\n }", "private String urlBuilder(){\n String timelineURL = \"curgas/timeline.json\";\n final RequestBuilder.UrlBuilder url = new RequestBuilder.UrlBuilder();\n url.setUrl(timelineURL);\n url.appendUrlQuery(\"apikey\", Constants.API_KEY);\n url.appendUrlQuery(\"sort\", SORT_TYPE);\n url.appendUrlQuery(\"jumlah\",TOTAL_POSTS);\n url.appendUrlQuery(\"page\",Integer.toString(PAGE_LOADED));\n\n String buildURL = url.build();\n\n return buildURL;\n }", "private String getHref(HttpServletRequest request)\n {\n String respath = request.getRequestURI();\n if (respath == null)\n \trespath = \"\";\n String codebaseParam = getRequestParam(request, CODEBASE, null);\n int idx = respath.lastIndexOf('/');\n if (codebaseParam != null)\n if (respath.indexOf(codebaseParam) != -1)\n idx = respath.indexOf(codebaseParam) + codebaseParam.length() - 1;\n String href = respath.substring(idx + 1); // Exclude /\n href = href + '?' + request.getQueryString();\n return href;\n }", "CartogramWizardShowURL (String url)\n\t{\n\t\tmUrl = url;\n\t\n\t}", "public String createHrefForUser(final String name) {\n\t\treturn this.userUrlPrefix + name;\n\t}", "protected String constructLoginURL(HttpServletRequest request) {\n String delimiter = \"?\";\n if (authenticationProviderUrl.contains(\"?\")) {\n delimiter = \"&\";\n }\n String loginURL = authenticationProviderUrl + delimiter\n + originalUrlQueryParam + \"=\"\n + request.getRequestURL().toString();\n return loginURL;\n }", "@Override\n\tprotected String url() {\n\t\treturn \"user\";\n\t}", "private String fetchUrl() {\n\t\tString url;\n\t\tint depth;\n\t\tdo\n\t\t{\n\t\t\tLandingPage lp = this.pagesToVisit.remove(0);\n\t\t\turl = lp.getUrl();\n\t\t\tdepth = lp.getDepth();\n\t\t\t\n\t\t}while(this.pagesVisited.containsKey(url) || !(isvalidURL(url)));\n\t\tthis.pagesVisited.put(url,depth);\n\t\treturn url;\n\t}", "String constructUrl() {\n StringBuilder builder = new StringBuilder(256);\n builder.append(parts[DB_PREFIX]);\n \n if(notEmpty(parts[DB_ALT_DBNAME])) {\n builder.append(parts[DB_ALT_DBNAME]);\n builder.append('@');\n } else if(\"jdbc:oracle:thin:\".equals(parts[DB_PREFIX])) {\n builder.append('@');\n } else {\n // most formats\n builder.append(\"//\"); // NOI18N\n }\n \n builder.append(parts[DB_HOST]);\n\n if(notEmpty(parts[DB_INSTANCE_NAME])) {\n builder.append('\\\\');\n builder.append(parts[DB_INSTANCE_NAME]);\n }\n \n if(notEmpty(parts[DB_PORT])) {\n builder.append(':'); // NOI18N\n builder.append(parts[DB_PORT]);\n }\n\n if(notEmpty(parts[DB_PRIMARY_DBNAME])) {\n if(\"jdbc:oracle:thin:\".equals(parts[DB_PREFIX])) {\n builder.append(':'); // NOI18N\n } else {\n builder.append('/'); // NOI18N\n }\n builder.append(parts[DB_PRIMARY_DBNAME]);\n }\n\n char propertyInitialSeparator = ';';\n char propertySeparator = ';';\n if(\"jdbc:mysql:\".equals(parts[DB_PREFIX])) {\n propertyInitialSeparator = '?';\n propertySeparator = '&';\n } else if(\"jdbc:informix-sqli:\".equals(parts[DB_PREFIX])) {\n propertyInitialSeparator = ':';\n }\n \n Set<Map.Entry<String, String>> entries = props.entrySet();\n Iterator<Map.Entry<String, String>> entryIterator = entries.iterator();\n if(entryIterator.hasNext()) {\n builder.append(propertyInitialSeparator);\n Map.Entry<String, String> entry = entryIterator.next();\n builder.append(entry.getKey());\n String value = entry.getValue();\n if(notEmpty(value)) {\n builder.append('=');\n builder.append(value);\n }\n }\n \n while(entryIterator.hasNext()) {\n builder.append(propertySeparator);\n Map.Entry<String, String> entry = entryIterator.next();\n builder.append(entry.getKey());\n String value = entry.getValue();\n if(notEmpty(value)) {\n builder.append('=');\n builder.append(value);\n }\n }\n \n return builder.toString();\n }", "private String makeServerUrl(){\n\t\tURL url = null;\n\t\t\n\t\t//Make sure we have a valid url\n\t\tString complete = this.preferences.getString(\"server\", \"\");\n\t\ttry {\n\t\t\turl = new URL( complete );\n\t\t} catch( Exception e ) {\n\t\t\tonCreateDialog(DIALOG_INVALID_URL).show();\n\t\t\treturn null;\n\t\t}\n\t\treturn url.toExternalForm();\n\t}", "public abstract String getURL();", "String getUrl();", "String getUrl();", "String getUrl();", "String getUrl();", "String getUrl();", "String getServerUrl();", "public static URL getUrlForPostAccChange()\r\n {\r\n String strUrl = getBaseURL() +\"account_services/api/1.0/account/user\";\r\n return str2url( strUrl );\r\n }", "private URL buildPm10URL() {\n URL url = null;\n try {\n String urlString = OBSERVATORY_URL\n + API_KEY\n + String.format(VARIABLE_QUERY_FORMAT, PM10_VARIABLE);\n url = new URL(urlString);\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n return url;\n }", "public String generateQueryParams() {\n if (petition.getParamsMap().entrySet().size() == 0)\n return \"\";\n else {\n boolean first = true;\n StringBuffer queryParams = new StringBuffer(\"?\");\n Iterator<Map.Entry<String, String>> it = petition.getParamsMap()\n .entrySet().iterator();\n // just iterate the map and fill the httpParams with its content\n while (it.hasNext()) {\n if (!first)\n queryParams.append(\"&\");\n else\n first = false;\n Map.Entry<String, String> e = (Entry<String, String>) it.next();\n String key = URLEncoder.encode(e.getKey());\n String value = URLEncoder.encode(e.getValue());\n queryParams.append(String.format(\"%s=%s\", key, value));\n\n }\n return queryParams.toString();\n }\n }", "public abstract String getUrl();", "public String toQueryUrl() {\n StringBuilder urlBuilder = new StringBuilder();\n Set<Map.Entry<String, Object>> entrySet = params.entrySet();\n int i = entrySet.size();\n for (Map.Entry<String, Object> entry : entrySet) {\n try {\n if (null != entry.getValue()) {\n urlBuilder.append(entry.getKey()).append('=')\n .append(URLEncoder.encode(String.valueOf(entry.getValue()), DEFAULT_ENC));\n if (i > 1) {\n urlBuilder.append('&');\n }\n }\n i--;\n } catch (UnsupportedEncodingException e) {\n throw new RuntimeException(e);\n }\n }\n \n return urlBuilder.toString();\n }", "private String getTokenizedUrl() {\n SharedPreferences sharedPreferences = getSharedPreferences();\n String tokenKey = MainActivity.sharedPrefKeys.TOKENIZED_URL.toString();\n\n if (sharedPreferences.contains(tokenKey)) {\n return sharedPreferences.getString(tokenKey, \"\");\n }\n return \"\";\n }", "private String buildSearchURL(String companyTicker) {\n Uri.Builder builder = new Uri.Builder();\n builder.scheme(\"https\")\n .authority(\"finance.google.com\")\n .appendPath(\"finance\")\n .appendPath(\"info\")\n .appendQueryParameter(\"client\", \"iq\")\n .appendQueryParameter(\"q\", companyTicker);\n String myUrl = builder.build().toString();\n return myUrl; // return a url\n }", "public static URL getUrlForStartUpInfo(){\r\n\t\tString idCountry = P.getCountryId();\r\n\t\tint idBrand = Config.BRAND_ID_BE;\r\n\t\tString strUrl = getBaseURL() + \"account_services/api/1.0/static_content/app_startup_info/client_type/3/brand_id/\"+idBrand+\"/country/\"+idCountry;\r\n\t\treturn str2url(strUrl);\r\n\t}", "private String getURL(int rad) {\n \t\tLocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);\n \n \t\t// Define a listener that responds to location updates\n \t\tLocationListener locationListener = new LocationListener() {\n \t\t\tpublic void onLocationChanged(Location location) {\n \t\t\t\t// Called when a new location is found by the network location provider.\n \t\t\t\tcurrentLocation = String.valueOf(location.getLatitude()) + \"+\" + String.valueOf(location.getLongitude());\n \t\t\t}\n \n \t\t\tpublic void onStatusChanged(String provider, int status, Bundle extras) {}\n \n \t\t\tpublic void onProviderEnabled(String provider) {}\n \n \t\t\tpublic void onProviderDisabled(String provider) {}\n \t\t};\n \n \t\t// Register the listener with the Location Manager to receive location updates\n \t\tlocationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener);\n \n \t\tfinal String android_id = Secure.getString(getBaseContext().getContentResolver(),\n \t\t\t\tSecure.ANDROID_ID);\n \t\t//final String user = \"aaa\"; //idk how to deal with making users unique right now\n \t\tString url = \"http://18.238.2.68/cuisinestream/phonedata.cgi?user=\"+android_id+\"&location=\"+currentLocation+\"&radius=\"+rad;\n \t\treturn url;\n \t}", "public String generateURL(HashMap<String, String> params) throws java.security.NoSuchAlgorithmException{\n\t\tDBA = params.get(\"merchantName\");\n\t\tRETURN_URL = params.get(\"returnURL\");\n\t\tTRANSACTION_TYPE = params.get(\"transactionType\");\n\t\tDISCOVER_IMAGE = params.get(\"acceptDiscover\").toUpperCase().startsWith(\"Y\") ? \"discvr.gif\" : \"spacer.gif\";\n\t\tAMEX_IMAGE = params.get(\"acceptAmex\").toUpperCase().startsWith(\"Y\") ? \"amex.gif\" : \"spacer.gif\";\n\t\tAMOUNT = params.get(\"amount\");\n\t\tPROTECT_AMOUNT = params.get(\"protectAmount\");\n\t\tREBILLING = params.get(\"rebilling\").toUpperCase().startsWith(\"Y\") ? \"1\" : \"0\";\n\t\tREB_PROTECT = params.get(\"rebProtect\");\n\t\tREB_AMOUNT = params.get(\"rebAmount\");\n\t\tREB_CYCLES = params.get(\"rebCycles\");\n\t\tREB_FIRST_DATE = params.get(\"rebStartDate\");\n\t\tREB_EXPR = params.get(\"rebFrequency\");\n\t\tCUSTOM_ID1 = params.get(\"customID1\");\n\t\tPROTECT_CUSTOM_ID1 = params.get(\"protectCustomID1\");\n\t\tCUSTOM_ID2 = params.get(\"customID2\");\n\t\tPROTECT_CUSTOM_ID2 = params.get(\"protectCustomID2\");\n\t\tSHPF_FORM_ID = params.get(\"paymentTemplate\");\n\t\tRECEIPT_FORM_ID = params.get(\"receiptTemplate\");\n\t\tREMOTE_URL = params.get(\"receiptTempRemoteURL\");\n\t\tCARD_TYPES = setCardTypes();\n\t\tRECEIPT_TPS_DEF = \"SHPF_ACCOUNT_ID SHPF_FORM_ID RETURN_URL DBA AMEX_IMAGE DISCOVER_IMAGE SHPF_TPS_DEF\";\n\t\tRECEIPT_TPS_STRING = setReceiptTpsString();\n\t\tRECEIPT_TAMPER_PROOF_SEAL = calcURLTps(RECEIPT_TPS_STRING);\n\t\tRECEIPT_URL = setReceiptURL();\n\t\tBP10EMU_TPS_DEF = addDefProtectedStatus(\"MERCHANT APPROVED_URL DECLINED_URL MISSING_URL MODE TRANSACTION_TYPE TPS_DEF\");\n\t\tBP10EMU_TPS_STRING = setBp10emuTpsString();\n\t\tBP10EMU_TAMPER_PROOF_SEAL = calcURLTps(BP10EMU_TPS_STRING);\n\t\tSHPF_TPS_DEF = addDefProtectedStatus(\"SHPF_FORM_ID SHPF_ACCOUNT_ID DBA TAMPER_PROOF_SEAL AMEX_IMAGE DISCOVER_IMAGE TPS_DEF SHPF_TPS_DEF\");\n\t\tSHPF_TPS_STRING = setShpfTpsString();\n\t\tSHPF_TAMPER_PROOF_SEAL = calcURLTps(SHPF_TPS_STRING);\n\t\treturn calcURLResponse();\n\t}", "private String generateUrl(String code) {\n return prefix + recognizeType(code) + code;\n }", "public static String buildNewsAndPoliticPodcastUrl(){\n Uri builtURI = Uri.parse(LISTEN_NOTE_BASE_URL).buildUpon()\n .appendPath(BEST_PODCAST)\n .appendQueryParameter(GENRE_ID, NEWS_POLITIC)\n .build();\n\n return builtURI.toString();\n }", "private GenericUrl generateFitbitVitalConnectUrl(Vital vitalToSync, OAuth oAuth) {\n final String user_id = oAuth.getUser_id();\n String additionalPart = vitalToSync.getType().getFitbitURL();\n return new GenericUrl(fitBitBaseURL + \"/\" + user_id + additionalPart);\n }", "public String toString() {\n StringBuffer buf = new StringBuffer();\n\n // Append context-path\n buf.append(contextPath);\n\n // Append real path (path besides control params, think \"niceuri\")\n if (realPath != null) {\n buf.append(realPath);\n }\n\n // Append \"control-parameters\"\n if (!pathParams.isEmpty()) {\n buf.append(\"/\");\n for (Iterator iter = pathParams.keySet().iterator(); iter.hasNext();) {\n String name = (String) iter.next();\n String[] values = (String[]) pathParams.get(name);\n buf.append(name);\n buf.append(\"/\");\n buf.append(PathParser.encodeValues(values));\n\n if (iter.hasNext()) {\n buf.append(\"/\");\n }\n }\n }\n\n // Append servlet-path (infoglue-action)\n if (webWorkAction != null) {\n buf.append(\"/\");\n buf.append(webWorkAction);\n }\n\n // Append query-parameters\n if (!queryParams.isEmpty()) {\n buf.append(\"?\");\n for (Iterator iter = queryParams.keySet().iterator(); iter.hasNext();) {\n // Iterating over names\n String name = (String) iter.next();\n String[] values = (String[]) queryParams.get(name);\n for (int i = 0; i < values.length; i++) {\n // Iterating over values\n buf.append(name);\n buf.append(\"=\");\n buf.append(values[i]);\n if (i < values.length - 1) {\n buf.append(\"&\");\n }\n }\n if (iter.hasNext()) {\n buf.append(\"&\");\n }\n }\n }\n\n // Append local navigation (reference)\n if (local != null && local.length() > 0) {\n buf.append(\"#\");\n buf.append(local);\n }\n if (log.isDebugEnabled()) {\n log.debug(\"Generated URL: \" + buf.toString());\n }\n return buf.toString();\n }", "@Test\n\tpublic void checkDetailedURLGeneration() {\n\t\tint neoID=1234;\n\t\tString expected = genDetailedURL(neoID);\n\t\tString result = urlHelper.getDetailedNeoInfoURL(neoID);\n\t\tassertEquals(expected,result);\n\t}", "public static URL getUrlForProfileSync(){\r\n\t\tString strUrl = getBaseURL() + \"mip_services/core/api/1.0/profile/enhanced\";\r\n\t\treturn str2url(strUrl);\r\n\t}", "String getLearnMoreHelpPageUrl();", "public String getPreViewUrl();", "private URL createURL() {\n try {\n Log.d(\"URL\", \"create\");\n String urlString = \"http://cs262.cs.calvin.edu:8084/cs262dCleaningCrew/task/cjp27\";\n return new URL(urlString);\n } catch (Exception e) {\n Toast.makeText(this, getString(R.string.connection_error), Toast.LENGTH_SHORT).show();\n }\n\n return null;\n }", "private String generateQueryString(Map<String, String> args) {\n StringBuilder url = new StringBuilder();\n\n // Create the query string (?foo=bar&key1=val1\n url.append(\"?\");\n for (Iterator<Map.Entry<String, String>> it = args.entrySet().iterator(); it.hasNext(); ) {\n Map.Entry<String, String> entry = it.next();\n\n url.append(urlEncode(entry.getKey()));\n url.append(\"=\");\n url.append(urlEncode(entry.getValue()));\n if (it.hasNext()) {\n // More parameters are coming, add a separator\n url.append(\"&\");\n }\n }\n\n return url.toString();\n }", "private String setReferralzz(){\n String uid = mAuth.getCurrentUser().getUid();\n String link = INVITE_LINK+uid;\n FIRDynamicLinkComponents referalLink = new FIRDynamicLinkComponents(new NSURL(link) ,\"https://fingertipsandcompany.page.link\");\n\n FIRDynamicLinkIOSParameters iOSParameters = new FIRDynamicLinkIOSParameters(BUNDLE_ID);\n iOSParameters.setMinimumAppVersion(\"1.0.1\");\n iOSParameters.setAppStoreID(\"1496752335\");\n referalLink.setIOSParameters(iOSParameters);\n\n FIRDynamicLinkAndroidParameters androidParameters = new FIRDynamicLinkAndroidParameters(BUNDLE_ID);\n androidParameters.setMinimumVersion(125);\n referalLink.setAndroidParameters(androidParameters);\n\n\n referalLink.shorten(new VoidBlock3<NSURL, NSArray<NSString>, NSError>() {\n @Override\n public void invoke(NSURL shortURL, NSArray<NSString> nsStrings, NSError nsError) {\n if (nsError != null){\n System.out.println(\"Referal Link Shorter Error-------------------->\"+nsError);\n return;\n }\n mInvitationURL = shortURL.getAbsoluteString();\n System.out.println(\"Generated Referral Link \");\n\n }\n });\n\n return mInvitationURL;\n\n }", "public static String computeURL(PageContext pageContext, String forward, String href, String page, String action,\n Map<String, String> params, String anchor, boolean redirect, boolean encodeSeparator, String destinationPage)\n throws MalformedURLException\n {\n\n // TODO All the computeURL() methods need refactoring!\n\n // Validate that exactly one specifier was included\n int n = 0;\n if (forward != null)\n {\n n++;\n }\n if (href != null)\n {\n n++;\n }\n if (page != null)\n {\n n++;\n }\n if (action != null)\n {\n n++;\n }\n if (n != 1)\n {\n throw new MalformedURLException(messages.getMessage(\"computeURL.specifier\"));\n }\n\n // Look up the module configuration for this request\n ModuleConfig config = (ModuleConfig) pageContext.getRequest().getAttribute(Globals.MODULE_KEY);\n if (config == null)\n { // Backwards compatibility hack\n config = (ModuleConfig) pageContext.getServletContext().getAttribute(Globals.MODULE_KEY);\n pageContext.getRequest().setAttribute(Globals.MODULE_KEY, config);\n }\n\n // Calculate the appropriate URL\n StringBuffer url = new StringBuffer();\n HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();\n\n String mgnlaction = null;\n\n if (destinationPage != null && href == null)\n {\n url.append(destinationPage);\n }\n\n if (forward != null)\n {\n ForwardConfig fc = config.findForwardConfig(forward);\n if (fc == null)\n {\n throw new MalformedURLException(messages.getMessage(\"computeURL.forward\", forward));\n }\n if (fc.getRedirect())\n {\n redirect = true;\n }\n\n mgnlaction = forward;\n\n }\n else if (href != null)\n {\n url.append(href);\n }\n else if (action != null)\n {\n mgnlaction = RequestUtils.getActionMappingURL(action, pageContext);\n // url.append(RequestUtils.getActionMappingURL(action, pageContext));\n\n }\n else\n /* if (page != null) */{\n\n mgnlaction = RequestUtils.pageURL(request, page);\n // url.append(request.getContextPath());\n // url.append(RequestUtils.pageURL(request, page));\n }\n\n if (mgnlaction != null)\n {\n // remove parameters (how ugly is struts 1 :( )\n if (mgnlaction.contains(\"?\"))\n {\n String actionparams = StringUtils.substringAfter(mgnlaction, \"?\");\n\n String[] paramz = StringUtils.split(actionparams, \"&\");\n for (String string : paramz)\n {\n if (StringUtils.contains(string, \"=\"))\n {\n params.put(StringUtils.substringBefore(string, \"=\"), StringUtils.substringAfter(string, \"=\"));\n }\n\n }\n mgnlaction = StringUtils.substringBefore(mgnlaction, \"?\");\n }\n\n if (mgnlaction.endsWith(\".do\"))\n {\n mgnlaction = StringUtils.substringBeforeLast(mgnlaction, \".do\");\n }\n\n params.put(PARAMETER_MGNLACTION, mgnlaction);\n }\n\n // Add anchor if requested (replacing any existing anchor)\n if (anchor != null)\n {\n String temp = url.toString();\n int hash = temp.indexOf('#');\n if (hash >= 0)\n {\n url.setLength(hash);\n }\n url.append('#');\n url.append(encode(anchor));\n }\n\n // Add dynamic parameters if requested\n if ((params != null) && (params.size() > 0))\n {\n\n // Save any existing anchor\n String temp = url.toString();\n int hash = temp.indexOf('#');\n if (hash >= 0)\n {\n anchor = temp.substring(hash + 1);\n url.setLength(hash);\n temp = url.toString();\n }\n else\n {\n anchor = null;\n }\n\n // Define the parameter separator\n String separator = null;\n if (redirect)\n {\n separator = \"&\";\n }\n else if (encodeSeparator)\n {\n separator = \"&amp;\";\n }\n else\n {\n separator = \"&\";\n }\n\n // Add the required request parameters\n boolean question = temp.indexOf('?') >= 0;\n Iterator keys = params.keySet().iterator();\n while (keys.hasNext())\n {\n String key = (String) keys.next();\n Object value = params.get(key);\n if (value == null)\n {\n if (!question)\n {\n url.append('?');\n question = true;\n }\n else\n {\n url.append(separator);\n }\n url.append(encode(key));\n url.append('='); // Interpret null as \"no value\"\n }\n else if (value instanceof String)\n {\n if (!question)\n {\n url.append('?');\n question = true;\n }\n else\n {\n url.append(separator);\n }\n url.append(encode(key));\n url.append('=');\n url.append(encode((String) value));\n }\n else if (value instanceof String[])\n {\n String values[] = (String[]) value;\n for (int i = 0; i < values.length; i++)\n {\n if (!question)\n {\n url.append('?');\n question = true;\n }\n else\n {\n url.append(separator);\n }\n url.append(encode((key)));\n url.append('=');\n url.append(encode(values[i]));\n }\n }\n else\n /* Convert other objects to a string */{\n if (!question)\n {\n url.append('?');\n question = true;\n }\n else\n {\n url.append(separator);\n }\n url.append(encode(key));\n url.append('=');\n url.append(encode(value.toString()));\n }\n }\n\n // Re-add the saved anchor (if any)\n if (anchor != null)\n {\n url.append('#');\n url.append(encode(anchor));\n }\n\n }\n\n // Perform URL rewriting to include our session ID (if any)\n if (pageContext.getSession() != null)\n {\n HttpServletResponse response = (HttpServletResponse) pageContext.getResponse();\n if (redirect)\n {\n return (response.encodeRedirectURL(url.toString()));\n }\n else\n {\n return (response.encodeURL(url.toString()));\n }\n }\n else\n {\n return (url.toString());\n }\n\n }", "public abstract String toURLParam();", "public String setUrl() throws JSONException {\n url = baseUrl + searchName;\n for(int i = 0; i < typesCheckList.size(); i++) {\n if(typesObj.has(typesCheckList.get(i))){\n url += typesObj.getString(typesCheckList.get(i));\n }\n }\n if(V)System.out.println(url);\n return url;\n }", "@Override\r\n\tpublic void getCurrentUrl() {\n\t\t\r\n\t}", "protected static String toExternalForm(PURL u) {\n\n\t// pre-compute length of StringBuffer\n\tint len = u.getProtocol().length() + 1;\n\tif (u.getAuthority() != null && u.getAuthority().length() > 0)\n\t len += 2 + u.getAuthority().length();\n\tif (u.getPath() != null) {\n\t len += u.getPath().length();\n\t}\n\tif (u.getQuery() != null) {\n\t len += 1 + u.getQuery().length();\n\t}\n\tif (u.getRef() != null) \n\t len += 1 + u.getRef().length();\n\n\tStringBuffer result = new StringBuffer(len);\n\tresult.append(u.getProtocol());\n result.append(\":\");\n if (u.getAuthority() != null && u.getAuthority().length() > 0) {\n result.append(\"//\");\n result.append(u.getAuthority());\n }\n if (u.getPath() != null) {\n result.append(u.getPath());\n }\n if (u.getQuery() != null) {\n result.append('?');\n result.append(u.getQuery());\n }\n\tif (u.getRef() != null) {\n\t result.append(\"#\");\n result.append(u.getRef());\n\t}\n\treturn result.toString();\n }", "String url();", "java.lang.String getBookingURL();", "private final Map<String, String> getUrls(String themeDir, UrlBuilder urlBuilder) {\n // The urls that are accessible to the templates. \n // NB We are not using our menu object mechanism to build menus here, because we want the \n // view to control which links go where, and the link text and title.\n Map<String, String> urls = new HashMap<String, String>();\n \n urls.put(\"home\", urlBuilder.getHomeUrl());\n \n urls.put(\"about\", urlBuilder.getPortalUrl(Route.ABOUT));\n if (ContactMailServlet.getSmtpHostFromProperties() != null) {\n urls.put(\"contact\", urlBuilder.getPortalUrl(Route.CONTACT));\n }\n urls.put(\"search\", urlBuilder.getPortalUrl(Route.SEARCH)); \n urls.put(\"termsOfUse\", urlBuilder.getPortalUrl(Route.TERMS_OF_USE)); \n urls.put(\"login\", urlBuilder.getPortalUrl(Route.LOGIN)); \n urls.put(\"logout\", urlBuilder.getLogoutUrl()); \n urls.put(\"siteAdmin\", urlBuilder.getPortalUrl(Route.LOGIN)); \n \n urls.put(\"siteIcons\", urlBuilder.getPortalUrl(themeDir + \"/site_icons\"));\n return urls;\n }", "PagesAddress(String url) {\n applicationUrl = url;\n }", "public static void buildAuthorizeURI(HttpServletRequest req,HttpServletResponse resp) throws IOException\n\t{\n\t\tHttpSession session=req.getSession();\n\t\t//generate random string for the state param in authorize query\n\t String state=randomStringGenerator(6);\n\t \n\t //generate random string for the nonce parameters in authorize query(Implicit flow/Hybrid flow)\n\t String nonce=randomStringGenerator(6);\n\t String response_type=authPickFlow(5);\n\t //store the state value as key and response_type as value in session and cross verified the state value in response to avoid CSRF attack\n\t //parallely process the future request based on response_type by passing the state parameter from the response and get the required response_type\n\t session.setAttribute(state, response_type);\n\t //It is on the session to verified the ID Token(Implict flow,Hybrid Flow)\n\t session.setAttribute(nonce,nonce);\n\t // System.out.println(state+\":\"+(String) session.getAttribute(state));\n\t //Build the URI with clientID,scope,state,redirectURI,response type\n\t\tString url=\"http://localhost:8080/OPENID/msOIDC/authorize?client_id=mano.lmfsktkmyj&scope=openid profile&state=\"+state+\"&redirect_uri=http://localhost:8080/OPENID/msPhoneBook/response1&response_type=\"+response_type+\"&nonce=\"+nonce;\n\t\t//Redirect the browser to msOIDC authorization endpoint\n\t\tresp.sendRedirect(url);\n\t}", "public void setURL() {\n\t\tURL = Constant.HOST_KALTURA+\"/api_v3/?service=\"+Constant.SERVICE_KALTURA_LOGIN+\"&action=\"\n\t\t\t\t\t\t+Constant.ACTION_KALTURA_LOGIN+\"&loginId=\"+Constant.USER_KALTURA+\"&password=\"+Constant.PASSWORD_KALTURA+\"&format=\"+Constant.FORMAT_KALTURA;\n\t}", "private GenericUrl generateAPIURL(Vital vitalToSync, OAuth oAuth) {\n GenericUrl url = null;\n switch (vitalToSync.getWearableType()) {\n case FITBIT:\n url = generateFitbitVitalConnectUrl(vitalToSync, oAuth);\n break;\n case WITHINGS:\n //TODO: Create withings URL\n url = new GenericUrl(withingsBaseURL);\n logger.warn(\"WITHINGS CONNECTION NOT IMPLEMENTED\");\n break;\n }\n return url;\n }", "protected URI getPageURI(String uid, UriInfo uriInfo) {\n\t\tUriBuilder builder = UriBuilder.fromUri(uriInfo.getBaseUri());\n\t\tbuilder.path(\"uid\");\n\t\tbuilder.path(uid);\n\t\treturn builder.build();\n\t}", "private String generateUrl(List<String> codes) {\n StringBuilder builder = new StringBuilder();\n for (String code : codes) {\n builder.append(\",\");\n builder.append(recognizeType(code));\n builder.append(code);\n }\n builder = builder.delete(0, 1);\n return prefix + builder.toString();\n }", "public static URL getUrlForProfileAndPolicySync(){\r\n\t\tString strUrl = getBaseURL() + \"mip_services/core/api/1.0/sync\";\r\n\t\treturn str2url(strUrl);\r\n\t}", "@Override\n\tpublic String getUrl()\n\t{\n\t\treturn url;\n\t}", "public interface Constants {\n String LIEPIN_HOST =\"https://h.liepin.com\";\n String SEARCH_URL =\"https://h.liepin.com/cvsearch/soResume/\";\n //String WORK_EXPERIENCE_URL =\"https://h.liepin.com/resume/showresumedetail/showresumeworkexps/\";\n String WORK_EXPERIENCE_URL =\"https://h.liepin.com/resume/showresumedetail/showworkexps/\";\n String ANCHOR_TAG =\"<div class=\\\"resume-work\\\" id=\\\"workexp_anchor\\\">\";\n String GET_METHOD =\"GET\";\n String POST_METHOD =\"POST\";\n}", "public String getURL(){\r\n\t\t \r\n\t\t\r\n\t\treturn rb.getProperty(\"url\");\r\n\t}", "private String generateUrlParameters(HashMap<String, String> parameters) {\n\n\t\tString urlAttachment = \"?\";\n\n\t\tObject[] keys = parameters.keySet().toArray();\n\n\t\tfor(Object key : keys)\n\n\t\t\turlAttachment += key.toString() + \"=\" + parameters.get(key) + \"&\";\n\n\t\treturn urlAttachment;\n\t}", "protected String getAdminPersonalDataPageUrl(long userId) {\n return new StringBuilder(getBaseUrl())\n .append(reverseRouter.with(EditPersonalDataController::get)\n .pathParam(\"userId\", userId))\n .toString();\n }" ]
[ "0.6304108", "0.6258693", "0.6159047", "0.6066027", "0.5935755", "0.58911484", "0.58466995", "0.58135444", "0.5787581", "0.57514447", "0.57011676", "0.56885743", "0.56731063", "0.56653684", "0.56645995", "0.56635267", "0.56093603", "0.55765224", "0.5565709", "0.55390316", "0.55381936", "0.55376166", "0.553486", "0.5531872", "0.5529269", "0.5513609", "0.5485287", "0.5483606", "0.5483606", "0.5483606", "0.5483606", "0.5483606", "0.5483606", "0.54801077", "0.5468758", "0.54630303", "0.5448407", "0.5444546", "0.54273725", "0.5426417", "0.5411366", "0.5383596", "0.537186", "0.53666735", "0.53554136", "0.53341734", "0.5332167", "0.53296596", "0.5316607", "0.5316575", "0.53082144", "0.5305094", "0.5302809", "0.5295547", "0.52924705", "0.52924705", "0.52924705", "0.52924705", "0.52924705", "0.52677006", "0.52663344", "0.52571994", "0.5239596", "0.5231681", "0.5230914", "0.52303433", "0.52267885", "0.5223943", "0.5220565", "0.5211768", "0.5191638", "0.51890856", "0.5185529", "0.51850873", "0.51780903", "0.51763743", "0.5172091", "0.5166548", "0.5161883", "0.51612765", "0.5154445", "0.5153905", "0.51476175", "0.5139185", "0.51224744", "0.51213914", "0.51189786", "0.5117827", "0.51138467", "0.51072776", "0.5107224", "0.51070833", "0.51064265", "0.51057214", "0.5105632", "0.5097815", "0.5096282", "0.5091235", "0.5085026", "0.5084979", "0.50798655" ]
0.0
-1
Sets whether this provider is currently enabled or not. Note that this is specific to the provider only, and is not related to global location settings. This is a hint to the Location Manager that this provider will generally be unable to fulfill incoming requests. This provider may still receive callbacks to onSetRequest while not enabled, and must decide whether to attempt to satisfy those requests or not. Some guidelines: providers should set their own enabled/disabled status based only on state "owned" by that provider. For instance, providers should not take into account the state of the location master setting when setting themselves enabled or disabled, as this state is not owned by a particular provider. If a provider requires some additional user consent that is particular to the provider, this should be use to set the enabled/disabled state. If the provider proxies to another provider, the child provider's enabled/disabled state should be taken into account in the parent's enabled/disabled state. For most providers, it is expected that they will be always enabled.
public void setEnabled(boolean enabled) { synchronized (mBinder) { if (mEnabled == enabled) { return; } mEnabled = enabled; } ILocationProviderManager manager = mManager; if (manager != null) { try { manager.onSetEnabled(mEnabled); } catch (RemoteException | RuntimeException e) { Log.w(mTag, e); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void setEnabled(Context context, boolean enabled);", "@Override public void setEnabled(boolean enabled) {\n super.setEnabled(enabled);\n\n m_globalEnabled = enabled;\n checkEnabled();\n }", "public void setEnabled(boolean value) {\n m_Enabled = value;\n }", "public void setEnabled(boolean value) {\n this.enabled = value;\n }", "public void setEnabled(boolean newValue) {\n this.isEnabled = newValue;\n if (newValue) {\n if (isInternalSensor) {\n InternalSensors.getInstance().enableInternalSensor(this);\n } else {\n // TODO: enable external sensors\n }\n } else {\n saveSensor();\n if (isInternalSensor) {\n InternalSensors.getInstance().disableInternalSensor(this);\n } else {\n // TODO: disable external sensors\n }\n }\n }", "final public void setEnabled(boolean value) {\n enabledType = value ? ENABLED_ANY : ENABLED_NONE;\n }", "public boolean setEnabled(boolean enable);", "public void setEnabled(Boolean value) { this.myEnabled = value.booleanValue(); }", "public void setEnabled(final boolean enabled);", "public void enable() {\r\n m_enabled = true;\r\n }", "public void setEnabled(boolean aFlag) { _enabled = aFlag; }", "@Override\r\n public void setEnabled(final boolean b) {\r\n _enabled = b;\r\n }", "public void setLocationProviderEnabled(String provider, boolean enabled) {\n Settings.Secure\n .setLocationProviderEnabled(mContext.getContentResolver(), provider, enabled);\n }", "@Override\n\t\tpublic void onProviderEnabled(String provider) {\n\t\t\tsetGpsEnabled();\n\t\t\t// SmIcLog.e(TAG, \"Location ProviderEnabled:\" + provider);\n\t\t}", "@Override\n public boolean isEnabled() {\n synchronized (mLocationListeners) {\n return mEnabledProviders.contains(getName());\n }\n }", "public void setEnabled(boolean enabled);", "public void setEnabled(boolean enabled);", "@Override\n public void setEnabled(boolean enabled) {\n }", "public synchronized void setEnabled(boolean enabled)\n {\n if (requestQueue != null)\n {\n requestQueue.setEnabled(enabled);\n }\n }", "public boolean locationSettingsEnabled() {\n \tif (mLocationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)\n \t\t\t&& mLocationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER)) {\n \t\treturn true;\n \t} else {\n \t\treturn false;\n \t}\n }", "public void setEnabled(Boolean enabled) {\r\n this.enabled = enabled;\r\n }", "public void setEnabled(boolean enabled) {\n\t\tthis.enabled = enabled;\n\t\tfireChange();\n\t}", "public void setEnabled(boolean enabled) {\n mEnabled = enabled;\n }", "@Override\n public void setEnabled(boolean val) {\n super.setEnabled(val);\n mEnabled = val;\n }", "@ReactMethod\n public void setEnabled(Boolean enabled) {\n wifi.setWifiEnabled(enabled);\n }", "void setEnabled(boolean enabled);", "void setEnabled(boolean enabled);", "void setEnabled(boolean enabled);", "void setEnabled(boolean enabled);", "@SuppressLint(\"SetJavaScriptEnabled\")\n public void setGeolocationEnabled(final boolean enabled) {\n if (enabled) {\n getSettings().setJavaScriptEnabled(true);\n getSettings().setGeolocationEnabled(true);\n setGeolocationDatabasePath();\n }\n\n mGeolocationEnabled = enabled;\n }", "public void setEnabled(boolean enabled) {\r\n this.enabled = enabled;\r\n }", "public void setEnabled(boolean enabled) {\r\n this.enabled = enabled;\r\n }", "public void setEnabled(Boolean enabled) {\n this.enabled = enabled;\n }", "public void setEnabled(Boolean enabled) {\n this.enabled = enabled;\n }", "public void setEnabled(Boolean enabled) {\n this.enabled = enabled;\n }", "public void setEnabled(Boolean enabled) {\n this.enabled = enabled;\n }", "public void enable()\r\n\t{\r\n\t\tenabled = true;\r\n\t}", "public final void setEnabled( boolean enabled )\n {\n this.enabled = enabled;\n }", "public void setEnabled(boolean enabled) {\n this.enabled = enabled;\n }", "@Override\n\tpublic void setEnabled(boolean flag) {\n\t\t\n\t}", "@SuppressWarnings(\"unused\")\n private void setMyLocationEnabled(final JSONArray args, final CallbackContext callbackContext) throws JSONException {\n Boolean isEnabled = false;\n isEnabled = args.getBoolean(1);\n map.setMyLocationEnabled(isEnabled);\n map.getUiSettings().setMyLocationButtonEnabled(isEnabled);\n this.sendNoResult(callbackContext);\n }", "public void enable ( ) {\r\n\t\tenabled = true;\r\n\t}", "public void setEnabled(boolean enabled) {\n this.enabled = enabled;\n }", "public void setEnabled(boolean enabled) {\n this.enabled = enabled;\n }", "public void setEnabled(boolean enabled) {\n this.enabled = enabled;\n }", "public void setEnabled(boolean enabled) {\n this.enabled = enabled;\n }", "public void setEnabled(boolean enabled) {\n this.enabled = enabled;\n }", "public void setEnabled(final boolean theFlag) {\n myEnabled = theFlag;\n }", "@Override\n\t\t\t\tpublic void onProviderEnabled(String provider)\n\t\t\t\t\t{\n\n\t\t\t\t\t}", "public void setEnabled(boolean enabled) {\r\n\t\tthis.enabled = enabled;\r\n\t}", "private void setMyLocationEnabled(boolean enabled) {\n try {\n mMap.setMyLocationEnabled(enabled);\n } catch (SecurityException e) {\n e.printStackTrace();\n }\n }", "@Override\n\t public void onProviderEnabled(String provider)\n\t {\n\t \n\t }", "@ReactMethod\n public void setEnabled(final boolean isEnabled) {\n MainThreadHandler.runOnMainThread(new Runnable() {\n @Override\n public void run() {\n try {\n if (isEnabled) {\n BugReporting.setState(Feature.State.ENABLED);\n } else {\n BugReporting.setState(Feature.State.DISABLED);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n });\n\n }", "public void setEnabled(boolean enabled) {\r\n\t}", "boolean updateEnabling();", "public void onProviderEnabled(String provider) {\r\n controller.onProviderEnabled(provider);\r\n }", "public boolean setEnabled(boolean notifyEnabled) {\n boolean oldState = this.enabled;\n this.enabled = notifyEnabled;\n return oldState;\n }", "public void setEnabled(String enabled) {\r\n\t\tthis.enabled = enabled;\r\n\t}", "public Builder setEnabled(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n enabled_ = value;\n onChanged();\n return this;\n }", "protected abstract void enable();", "public void setEnabled(Boolean isEnabled) {\r\r\n\t\tthis._isEnabled = isEnabled;\r\r\n\t}", "@Override\r\n\t\tpublic void onProviderEnabled(String provider)\r\n\t\t{\n\t\t\t\r\n\t\t}", "public void onProviderEnabled(String provider) {\n\t\t\t\n\t\t}", "public void onProviderEnabled(String provider) {\n\t\t\t\n\t\t}", "public void onProviderEnabled(String provider) {\n\t\t\t\n\t\t}", "@Override\n\t\t\tpublic void onProviderEnabled(String arg0) {\n\t\t\t}", "public void onProviderEnabled(String provider) {}", "public void onProviderEnabled(String provider) {\n Log.i(TAG, \"Provider \" + provider + \" enabled.\");\n // No need to notify the native side. It's enough to start sending\n // valid position fixes again.\n }", "public void onProviderEnabled(String provider) {\n\n\t\t\t\t}", "public void onProviderEnabled(String provider) {\n }", "public void onProviderEnabled(String provider) {\n }", "public void setEnabled(UIEvent.Type aType, boolean aValue) { getEventAdapter(true).setEnabled(aType, aValue); }", "@Override\n\t\tpublic void onProviderEnabled(String provider) {\n\n\t\t}", "@Override\n\t\tpublic void onProviderEnabled(String provider) {\n\n\t\t}", "final public void setEnabled(int value) {\n enabledType = value;\n }", "public void onProviderEnabled(String provider) {\n\t\t\t}", "public void onProviderEnabled(String provider)\n {\n }", "@Override\r\n\t\tpublic void onProviderEnabled(String provider) {\n\t\t\t\r\n\t\t}", "public void setEnabled(java.lang.Boolean enabled) {\n this.enabled = enabled;\n }", "public void onProviderEnabled(String provider) {\n\t\t}", "public void onProviderEnabled(String provider) {\n\t\t}", "public void onProviderEnabled(String provider) {\n\t\t\n\t}", "@Override\n public void onProviderEnabled(String s) {\n }", "@Override\n public void onProviderEnabled(String s) {\n }", "@Override\n\t\tpublic void onProviderEnabled(String provider) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void onProviderEnabled(String provider) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void onProviderEnabled(String provider) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void onProviderEnabled(String provider) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void onProviderEnabled(String provider) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void onProviderEnabled(String provider) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void onProviderEnabled(String provider) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void onProviderEnabled(String provider) {\n\t\t\t\n\t\t}", "@Override\n\tpublic void onProviderEnabled(String provider)\n\t{\n\t}", "public void setEnabled(boolean enabled) {\n mBundle.putBoolean(KEY_ENABLED, enabled);\n }", "public void setEnable (boolean state) {\n impl.setEnable (state);\n }", "@Override\n public void onProviderEnabled(String provider) {\n }", "@Override\n public void onProviderEnabled(String provider) {\n }", "@Override\n public void onProviderEnabled(String provider) {\n }", "public synchronized void setEnabled(boolean enabled) {\n \t\t\tlistenerEnabled = enabled;\n \t\t}", "public void onProviderEnabled(String provider) {\n\t }" ]
[ "0.6709732", "0.6626273", "0.6509627", "0.6473704", "0.6425163", "0.63837606", "0.6369306", "0.6321361", "0.62503976", "0.62428075", "0.62276155", "0.6212615", "0.6200915", "0.6199663", "0.61584514", "0.6113469", "0.6113469", "0.6105584", "0.6101369", "0.6073249", "0.60696065", "0.60577124", "0.60531276", "0.60513204", "0.60311633", "0.6029718", "0.6029718", "0.6029718", "0.6029718", "0.60117227", "0.600529", "0.600529", "0.6001029", "0.6001029", "0.6001029", "0.6001029", "0.5996041", "0.5986768", "0.59700924", "0.59681463", "0.5952978", "0.5943109", "0.5932268", "0.5932268", "0.5932268", "0.5932268", "0.5932268", "0.5929473", "0.5907697", "0.5904995", "0.59002817", "0.5897541", "0.5896386", "0.58884746", "0.5884609", "0.58831877", "0.5851926", "0.58391255", "0.58385706", "0.5834627", "0.58268875", "0.5824139", "0.5823785", "0.5823785", "0.5823785", "0.5819197", "0.5813659", "0.5811744", "0.58104134", "0.58102715", "0.58102715", "0.5807581", "0.5799153", "0.5799153", "0.5798565", "0.57940185", "0.5789666", "0.5770564", "0.57644904", "0.573481", "0.573481", "0.5734631", "0.57314724", "0.57314724", "0.5730127", "0.5730127", "0.5730127", "0.5730127", "0.5730127", "0.5730127", "0.5730127", "0.5730127", "0.572439", "0.57239115", "0.5720984", "0.571686", "0.571686", "0.571686", "0.5715533", "0.5707027" ]
0.7290461
0
Sets the provider properties that may be queried by clients. Generally speaking, providers should try to avoid changing their properties after construction.
public void setProperties(ProviderPropertiesUnbundled properties) { synchronized (mBinder) { mProperties = properties.getProviderProperties(); } ILocationProviderManager manager = mManager; if (manager != null) { try { manager.onSetProperties(mProperties); } catch (RemoteException | RuntimeException e) { Log.w(mTag, e); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setProvider(String value) { _provider = value; }", "public void setProvider(String provider) {\n\t\tthis.provider = provider;\n\t}", "public void setProvider(String provider) {\n\t\tthis.provider = provider;\n\t}", "protected void setProvider() {\n fs.getClient().setKeyProvider(cluster.getNameNode().getNamesystem()\n .getProvider());\n }", "public Builder setProvider(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n provider_ = value;\n onChanged();\n return this;\n }", "public void setProvider(String provider) {\r\n this.provider = provider == null ? null : provider.trim();\r\n }", "public static void setProvider(String providerName) {\n provider = providerName;\n logger.debug(\"Provider set to : \" + providerName);\n }", "public void setProviderContext(Context providerContext) {\r\n mProviderContext = providerContext;\r\n }", "public void setProvider(DownloadProvider newValue) {\n DownloadProvider oldValue = provider;\n provider = newValue;\n firePropertyChange(PROVIDER_CHANGED_PROPERTY, oldValue, newValue);\n }", "public void setProviderId(String value) { _providerId = value; }", "void setProvider(modelProvidersI IDProvider);", "public void setQueryProvider(JpaNativeQueryProvider queryProvider) {\r\n\t\tLOG.info(DOLLAR + INSIDE_METHOD + DOLLAR);\r\n\t\tthis.queryProvider = queryProvider;\r\n\t\tLOG.info(DOLLAR + OUTSIDE_METHOD + DOLLAR);\r\n\t}", "@Override\r\n\t\tpublic void setClientInfo(Properties properties)\r\n\t\t\t\tthrows SQLClientInfoException {\n\t\t\t\r\n\t\t}", "public Providers(){\r\n\t\tsuper();\r\n\t}", "public void setProvider(String value) {\n setAttributeInternal(PROVIDER, value);\n }", "public void setConfigProvider(ConfigProvider configProvider) {\n this.configProvider = configProvider;\n }", "void updateProviders(List<Provider> providers) {\n this.providers = providers;\n }", "public void setProviderUrl(String providerUrl) {\r\n this.providerUrl = providerUrl;\r\n }", "@Override\n\tpublic void setAuthProvider(AuthProvider arg0) {\n\t}", "@Override\r\n\tpublic void setProperties(Properties properties) \r\n\t{\n\t}", "public void setDrivesProvider(DrivesProvider provider) {\r\n\t\tif (Threading.isInitialized()) throw new IllegalStateException(ERROR_ALREADY_INITIALIZED);\r\n\t\tdrivesProvider = provider;\r\n\t}", "public void setProperties(Properties properties);", "Provider updateProvider(Provider prov) throws RepoxException;", "Provider updateProvider(Provider prov) throws RepoxException;", "protected Provider() {}", "protected Provider(String providerClass, String version) {\n assert !(null == providerClass || \"\".equals(providerClass.trim())) : \"Provider class must be given!\";\n this.providerClass = providerClass;\n this.version = version;\n this.vendorSpecificProperties = initPropertyNames();\n }", "public void setProviderURL (URL url) {\n impl.setProviderURL (url);\n }", "@JsonProperty(\"provider\")\n public String getProvider() { return _provider; }", "public MailProvider(ProviderProperties providerProperties) {\n super(providerProperties);\n }", "@Override\r\n\tpublic void setProperties(Properties properties) {\n\t\t\r\n\t}", "public synchronized void setProvider(FontProvider fontProvider) {\n/* 136 */ this.fontInfoByName = createFontInfoByName(fontProvider.getFontInfo());\n/* 137 */ this.fontProvider = fontProvider;\n/* */ }", "@objid (\"a3188449-2f95-4e02-a233-e2e48fa5e5b0\")\n void setProvider(ProvidedInterface value);", "public Builder setProviderBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n provider_ = value;\n onChanged();\n return this;\n }", "@Override\r\n\tpublic void setProperties(Properties arg0) {\n\r\n\t}", "@Test @DisplayName(\"Injector - setting (direct)\")\n void injectorSetters() throws Exception {\n val injector = injector(inj -> {\n inj.set(\"text\", \"some text\");\n inj.set(\"label\", \"a label\");\n inj.set(\"attrs\", Map.of(\"alpha\", \"one\"));\n });\n\n val injected = injector.inject(new OtherObject());\n assertEquals(\"some text\", injected.getText());\n assertEquals(\"a label\", injected.label);\n assertEquals(Map.of(\"alpha\", \"one\"), injected.getAttrs());\n }", "protected XmlPropertiesProvider() {\n // do nothing for now\n }", "public Builder setProviderName(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n providerName_ = value;\n onChanged();\n return this;\n }", "@PostConstruct\n public void init() {\n oAuthProviders.registerProvider(this);\n }", "@Override\n\tpublic void setProperties(Properties p) {\n\t\t\n\t}", "@Override\r\n\tpublic void setFilterQueryProvider(FilterQueryProvider filterQueryProvider) {\n\t\tsuper.setFilterQueryProvider(filterQueryProvider);\r\n\t}", "public void setProperties(Map properties);", "public Builder setProviderId(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n providerId_ = value;\n onChanged();\n return this;\n }", "public void setOpbConnectionProvider(final OpbConnectionProvider provider) {\r\n this.opbConnectionProvider = provider;\r\n }", "public void setProperties(Properties properties)\n {\n this.properties = properties;\n }", "void setProvider(JainTcapProvider provider);", "public DefaultConnectionProvider() {\n loadProperties();\n }", "public void setProperties(Map<String, Object> properties) {\n mProperties = properties;\n }", "public void setProviderTypeService(ProviderTypeService providerTypeService) {\n this.providerTypeService = providerTypeService;\n }", "public void setProviderRef(ContentProvider provider) {\n if (providerRef != null) {\n Log.w(\n TAG,\n String.format(\n \"Reference to Provider instance \" + \"with authority %s already set\", authority));\n }\n providerRef = new WeakReference<>(provider);\n }", "public void setParameters(Properties props) {\n\n\t}", "@Override\n public void initialize(Map<String, String> propertyValues) {\n // Set the configurable properties\n properties.setValues(propertyValues);\n }", "public void setProperties(Properties properties) {\n this.properties=properties;\n }", "public Provider getProvider() {\r\n Provider provider = new Provider();\r\n provider.setProviderId(this.loginId);\r\n provider.setProviderPassword(this.loginPassword);\r\n provider.setProviderEmail(this.email);\r\n provider.setProviderPhone(this.phone);\r\n provider.setProviderBirth(this.birth);\r\n provider.setProviderGender(this.gender);\r\n provider.setAuthentication(this.authentication);\r\n provider.setProviderAccountPayment(this.accountPayment);\r\n provider.setUrl(this.urlAvatar);\r\n // Address add = new Address();\r\n // add.setBuildingName(this.buildingName);\r\n // add.setDistrictName(this.districtName);\r\n // add.setHomeNumber(this.homeNumber);\r\n // add.setStreetName(this.streetName);\r\n // add.setWardName(this.wardName);\r\n this.address = CustomerBLO.toStringAddres(homeNumber, buildingName, streetName, wardName, districtName);\r\n provider.setProviderAddress(this.address);\r\n provider.setLoginDate(new Date());\r\n provider.setDetail(this.detail);\r\n provider.setProviderName(this.loginName);\r\n return provider;\r\n\r\n }", "public Provider() {\n\t\t\tsuper(SCHEME);\n\t\t}", "public void setProperties(org.LexGrid.commonTypes.Properties properties) {\n this.properties = properties;\n }", "public void setProperties(Map<String, Object> properties) {\n this.properties = properties;\n }", "public SessionProviderImpl(CredentialsProvider cp) {\n this.cp = cp;\n }", "public void setServiceProviderCode(String serviceProviderCode)\n\t{\n\t\tthis.serviceProviderCode = serviceProviderCode;\n\t}", "public void setServiceProviderCode(String serviceProviderCode) \n\t{\n\t\tthis.serviceProviderCode = serviceProviderCode;\n\t}", "public void setNameProvider(NameProvider nameProvider2) {\n\t\tnameProvider = nameProvider2;\n\t}", "public static void setPoolProvider(PoolProvider provider) {\n SharedRedisPools.poolProvider = provider;\n }", "public void configure(PropertiesGetter properties) {\n\t\t// TODO Auto-generated method stub\n\n\t}", "DataProviders retrieveProviders() throws RepoxException;", "DataProviders retrieveProviders() throws RepoxException;", "public void setInlineProperties(final EntityProviderWriteProperties inlineProperties) {\n this.inlineProperties = inlineProperties;\n }", "@Override\n public void onProviderEnabled(String provider) {\n }", "ProviderManagerExt()\n {\n load();\n }", "public void setProperty(Properties properties) {\r\n this.properties = properties;\r\n }", "public Provider() {\n super(PROVIDER_NAME, 0.1, \"WebID-TLS Provider\");\n }", "void setCryptProvider(java.lang.String cryptProvider);", "PropertiesImpl(BytesClientImpl client) {\n this.service =\n RestProxy.create(PropertiesService.class, client.getHttpPipeline(), client.getSerializerAdapter());\n this.client = client;\n }", "public void setConfiguration(Properties props);", "private void initializeWithProviderConfiguration() {\n List<JRProvider> socialProviders = mSessionData.getSocialProviders();\n if (socialProviders == null || socialProviders.size() == 0) {\n JREngageError err = new JREngageError(\n \"Cannot load the Publish Activity, no social providers are configured.\",\n JREngageError.ConfigurationError.CONFIGURATION_INFORMATION_ERROR,\n JREngageError.ErrorType.CONFIGURATION_INFORMATION_MISSING);\n mSessionData.triggerPublishingDialogDidFail(err);\n return;\n }\n \n // Configure the properties of the UI\n mActivityObject.shortenUrls(new JRActivityObject.ShortenedUrlCallback() {\n public void setShortenedUrl(String shortenedUrl) {\n mShortenedActivityURL = shortenedUrl;\n \n if (mSelectedProvider == null) return;\n \n if (mSelectedProvider.getSocialSharingProperties().\n getAsBoolean(\"content_replaces_action\")) {\n updatePreviewTextWhenContentReplacesAction();\n } else {\n updatePreviewTextWhenContentDoesNotReplaceAction();\n }\n updateCharacterCount();\n }\n });\n createTabs();\n }", "@Override\n public void onProviderEnabled(String provider) {\n\n }", "@Override\n public void onProviderEnabled(String provider) {\n\n }", "public void setProperties(Map<String, String> properties) {\n this.properties = properties;\n }", "public DependencyManager(@Nonnull ServerCubeCache cubeProvider) {\n\t\tthis.cubeProvider = cubeProvider;\n\t\tthis.requiredMap = new HashMap<>();\n\t}", "@Override\n public void onProviderEnabled(String provider) {\n }", "@Override\n public void onProviderEnabled(String provider) {\n }", "@Override\n public void onProviderEnabled(String provider) {\n }", "void setDataProvider(AbstractDataProvider<WorkerDTO> provider);", "protected void setProperties(P[] properties) {\n\t\tthis.properties = properties;\n\t}", "@Override\n \t\tpublic void onProviderEnabled(String provider) {\n \t\t\t\n \t\t}", "@Test\n\tvoid setIamProviderForTest() {\n\t\tnew UserOrgResource().setIamProvider(new IamProvider[] { Mockito.mock(IamProvider.class) });\n\t}", "public Provider1Builder() {\r\n provider1 = new Provider1();\r\n }", "@Override\n \t\tpublic void onProviderEnabled(String provider) {\n \t\t}", "@Override\n\t\t\tpublic void onProviderEnabled(String provider) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\t\tpublic void onProviderEnabled(String provider)\n\t\t\t\t\t{\n\n\t\t\t\t\t}", "public void setupProperties() {\n // left empty for subclass to override\n }", "public void init(IConfigProvider configProvider) {\n\t\tif (isInitialized) {\n\t\t\tthrow new RuntimeException(\"Connection provider is already initialized\");\n\t\t}\n\t\tthis.provider = configProvider;\n\n\t\tif (configProvider.isCacheEnabled()) {\n\t\t\t_initRedisConfig(configProvider.getRedisSettings());\n\t\t}\n\n\t\tfor (IConfigInitializer configInitializer : customInitializers) {\n\t\t\tconfigInitializer.init(configProvider);\n\t\t}\n\n\t\tthis.isInitialized = true;\n\t\tLOGGER.info(\"External Configs has been initialized\");\n\t}", "@Override\r\n\tpublic void setProperty(Properties prop) {\n\t}", "@Override\n public void onProviderEnabled(String provider) {\n }", "@Override\n public void onProviderEnabled(String provider) {\n }", "@Override\n public void onProviderEnabled(String provider) {\n }", "@Override\n public void onProviderEnabled(String provider) {\n }", "@Override\n public void onProviderEnabled(String provider) {\n }", "@ProviderType\npublic interface Properties {\n\n\t/**\n\t * Returns a new builder of {@link TextProperty}.\n\t *\n\t * @param id the {@link Property#getId()} of the property\n\t * @param name the {@link Property#getName()} of the property\n\t * @return the new instance\n\t */\n\tTextProperty.Builder text(@NotNull String id, @NotNull String name);\n\n\t/**\n\t * Returns a new builder of {@link TextareaProperty}.\n\t *\n\t * @param id the {@link Property#getId()} of the property\n\t * @param name the {@link Property#getName()} of the property\n\t * @return the new instance\n\t */\n\tTextareaProperty.Builder textarea(@NotNull String id, @NotNull String name);\n\n\t/**\n\t * Returns a new builder of {@link BooleanProperty}.\n\t *\n\t * @param id the {@link Property#getId()} of the property\n\t * @param name the {@link Property#getName()} of the property\n\t * @return the new instance\n\t */\n\tBooleanProperty.Builder bool(@NotNull String id, @NotNull String name);\n\n\t/**\n\t * Returns a new builder of {@link DateProperty}.\n\t *\n\t * @param id the {@link Property#getId()} of the property\n\t * @param name the {@link Property#getName()} of the property\n\t * @return the new instance\n\t */\n\tDateProperty.Builder date(@NotNull String id, @NotNull String name);\n}", "void setProvincia(String provincia);", "public void setSslProvider(String sslProvider) {\n this.sslProvider = sslProvider;\n }", "public JerseyInitializer() {\n this.register(new JacksonJsonProvider(ObjectMapperFactory.create()));\n this.property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);\n this.property(ServerProperties.BV_DISABLE_VALIDATE_ON_EXECUTABLE_OVERRIDE_CHECK, true);\n this.packages(true, \"com.hh.resources\");\n }" ]
[ "0.675546", "0.6341913", "0.6341913", "0.63372344", "0.6077239", "0.59981495", "0.5997269", "0.59463626", "0.5922124", "0.58850753", "0.58549875", "0.58365", "0.58341265", "0.5787949", "0.57530427", "0.57474303", "0.5701231", "0.5682339", "0.5646244", "0.5634562", "0.5584947", "0.5569984", "0.5569866", "0.5569866", "0.55458397", "0.55381864", "0.5536774", "0.5529183", "0.5511677", "0.55081725", "0.5494506", "0.5486505", "0.54581034", "0.5438969", "0.53893995", "0.5343476", "0.5307665", "0.5295287", "0.52935237", "0.52795655", "0.5277016", "0.5260412", "0.5240069", "0.5238968", "0.5224142", "0.52191836", "0.521485", "0.5210339", "0.51984847", "0.5196383", "0.519071", "0.5189164", "0.51865", "0.51672834", "0.5167092", "0.516087", "0.5159737", "0.51559716", "0.5154776", "0.51452494", "0.51363784", "0.5132327", "0.51266265", "0.51266265", "0.5109841", "0.5097453", "0.509371", "0.5092659", "0.5090855", "0.5090083", "0.50874627", "0.50838757", "0.508337", "0.5079121", "0.5079121", "0.50715923", "0.50709647", "0.50657773", "0.50657773", "0.50657773", "0.50585634", "0.5046856", "0.5046402", "0.50307614", "0.50298464", "0.50238335", "0.50194824", "0.5016219", "0.50038433", "0.49946788", "0.49921727", "0.49915457", "0.49915457", "0.49915457", "0.49915457", "0.49915457", "0.49877277", "0.4985581", "0.4983272", "0.49822488" ]
0.6820161
0
Sets a list of additional packages that should be considered as part of this location provider for the purposes of generating locations. This should generally only be used when another package may issue location requests on behalf of this package in the course of providing location. This will inform location services to treat the other packages as location providers as well.
public void setAdditionalProviderPackages(List<String> packageNames) { synchronized (mBinder) { mAdditionalProviderPackages.clear(); mAdditionalProviderPackages.addAll(packageNames); } ILocationProviderManager manager = mManager; if (manager != null) { try { manager.onSetAdditionalProviderPackages(mAdditionalProviderPackages); } catch (RemoteException | RuntimeException e) { Log.w(mTag, e); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setPackages(final String... packageNames) {\n packages = transformToUnique(packageNames);\n }", "@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:32:42.019 -0500\", hash_original_method = \"E5A69925BDA73DD9E81D8A1F8F42F257\", hash_generated_method = \"BC29193EBB18DD714A911DC3105CD009\")\n \n public void addPackageNames(Set<String> packageNames){\n \taddTaint(packageNames.getTaint());\n }", "public WorldUps.UDeliveryLocation.Builder addPackagesBuilder() {\n return getPackagesFieldBuilder().addBuilder(\n WorldUps.UDeliveryLocation.getDefaultInstance());\n }", "public Builder addAllPackages(\n java.lang.Iterable<? extends WorldUps.UDeliveryLocation> values) {\n if (packagesBuilder_ == null) {\n ensurePackagesIsMutable();\n com.google.protobuf.AbstractMessageLite.Builder.addAll(\n values, packages_);\n onChanged();\n } else {\n packagesBuilder_.addAllMessages(values);\n }\n return this;\n }", "public java.util.List<? extends WorldUps.UDeliveryLocationOrBuilder> \n getPackagesOrBuilderList() {\n return packages_;\n }", "public abstract void setLocations(java.util.Set locations);", "public java.util.List<? extends WorldUps.UDeliveryLocationOrBuilder> \n getPackagesOrBuilderList() {\n if (packagesBuilder_ != null) {\n return packagesBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(packages_);\n }\n }", "public void addJarsToThisLocator(List<String> jarFullPaths, String[] groups) throws IOException {\n addJarsToThisLocator(getDeployedBy(), Instant.now().toString(), jarFullPaths, groups);\n }", "public BinderConfiguration setPackagesToScan(Set<String> packagesToScan) {\n this.packagesToScan.addAll(packagesToScan);\n return this;\n }", "public String[] provides() { return new String[] { Location.TYPE }; }", "public Builder addPackages(WorldUps.UDeliveryLocation value) {\n if (packagesBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensurePackagesIsMutable();\n packages_.add(value);\n onChanged();\n } else {\n packagesBuilder_.addMessage(value);\n }\n return this;\n }", "public void setPriorityItems(String... packageNames) {\n mAdapter.setPriorityItems(packageNames != null ? Arrays.asList(packageNames) : null);\n }", "@Experimental\n void setRemoteLocations(@ParamName(\"locations\") List<RemoteLocation> locations);", "java.util.List<? extends WorldUps.UDeliveryLocationOrBuilder> \n getPackagesOrBuilderList();", "public java.util.List<WorldUps.UDeliveryLocation> getPackagesList() {\n return packages_;\n }", "public void setPackages(List<JagexPackage> list) {\n this.jagexPackages.clear();\n this.jagexPackages.addAll(list);\n }", "public java.util.List<WorldUps.UDeliveryLocation> getPackagesList() {\n if (packagesBuilder_ == null) {\n return java.util.Collections.unmodifiableList(packages_);\n } else {\n return packagesBuilder_.getMessageList();\n }\n }", "public void setLookupLocators( LookupLocator[] locs ) throws RemoteException {\n\t\tlog.config(\"set lookup locators\");\n\t\ttry {\n\t\t\tPersistentData data = io.readState();\n\t\t\tdisco.setLocators( locs );\n\t\t\tdata.locators = locs;\n\t\t\tio.writeState( data );\n\t\t} catch( ClassNotFoundException ex ) {\n\t\t\tlog.throwing( getClass().getName(), \"setLookupLocators\", ex);\n\t\t\tthrow new RemoteException(ex.toString());\n\t\t} catch( IOException ex ) {\n\t\t\tlog.throwing( getClass().getName(), \"setLookupLocators\", ex);\n\t\t\tthrow new RemoteException(ex.toString());\n\t\t}\n\t}", "java.util.List<WorldUps.UDeliveryLocation> \n getPackagesList();", "public void addLookupLocators( LookupLocator[] locs ) throws RemoteException {\n\t\tlog.config(\"adding lookup locators\");\n\t\ttry {\n\t\t\tPersistentData data = io.readState();\n\t\t\tdisco.addLocators( locs );\n\t\t\tVector v = mergeArrays( data.locators, locs );\n\t\t\tdata.locators = new LookupLocator[ v.size() ];\n\t\t\tv.copyInto( data.locators );\n\t\t\tio.writeState( data );\n\t\t} catch( ClassNotFoundException ex ) {\n\t\t\tlog.throwing( getClass().getName(), \"addLookupLocators\", ex);\n\t\t\tthrow new RemoteException(ex.toString());\n\t\t} catch( IOException ex ) {\n\t\t\tlog.throwing( getClass().getName(), \"addLookupLocators\", ex);\n\t\t\tthrow new RemoteException(ex.toString());\n\t\t}\n\t}", "public void setPriorityItems(List<String> packageNames) {\n mAdapter.setPriorityItems(packageNames);\n }", "private Collection getPackagesProvidedBy(BundlePackages bpkgs) {\n ArrayList res = new ArrayList();\n // NYI Improve the speed here!\n for (Iterator i = bpkgs.getExports(); i.hasNext();) {\n ExportPkg ep = (ExportPkg) i.next();\n if (ep.pkg.providers.contains(ep)) {\n res.add(ep);\n }\n }\n return res;\n }", "public void setLocations(Resource[] locations) {\n\t\tthis.locations = locations;\n\t}", "void updateProviders(List<Provider> providers) {\n this.providers = providers;\n }", "public void addLocations(List<Location> listOfLocation)\n {\n this.locationLst.addAll(listOfLocation);\n }", "public WorldUps.UDeliveryLocationOrBuilder getPackagesOrBuilder(\n int index) {\n return packages_.get(index);\n }", "public WorldUps.UDeliveryLocation.Builder addPackagesBuilder(\n int index) {\n return getPackagesFieldBuilder().addBuilder(\n index, WorldUps.UDeliveryLocation.getDefaultInstance());\n }", "public Builder addPackages(\n WorldUps.UDeliveryLocation.Builder builderForValue) {\n if (packagesBuilder_ == null) {\n ensurePackagesIsMutable();\n packages_.add(builderForValue.build());\n onChanged();\n } else {\n packagesBuilder_.addMessage(builderForValue.build());\n }\n return this;\n }", "WorldUps.UDeliveryLocationOrBuilder getPackagesOrBuilder(\n int index);", "public void setExcludePackages(final String... packageNames) {\n excludePackages = transformToUnique(packageNames);\n }", "private void enableLocation(){\n if(PermissionsManager.areLocationPermissionsGranted(this))\n {\n initializeLocationEngine();\n initializeLocationLayer();\n\n\n }else{\n permissionsManager = new PermissionsManager(this);\n permissionsManager.requestLocationPermissions(this);\n }\n }", "public void setLocations(Resource[] locations) {\n this._locations = locations;\n }", "public Builder addPackages(\n int index, WorldUps.UDeliveryLocation value) {\n if (packagesBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensurePackagesIsMutable();\n packages_.add(index, value);\n onChanged();\n } else {\n packagesBuilder_.addMessage(index, value);\n }\n return this;\n }", "void addImports(Set<String> allImports) {\n allImports.add(\"io.ebean.typequery.\" + propertyType);\n }", "private void setUpLocationPickers() {\n }", "public void setScanPackages(List<String> scanPackages) {\n\t\tthis.scanPackages = scanPackages;\n\t}", "private List resolvePackages(Iterator pkgs) {\n ArrayList res = new ArrayList();\n\n while (pkgs.hasNext()) {\n ExportPkg provider = null;\n ImportPkg ip = (ImportPkg)pkgs.next();\n if (ip.provider != null) {\n framework.listeners.frameworkError(ip.bpkgs.bundle,\n new Exception(\"resolvePackages: InternalError1!\"));\n }\n if (Debug.packages) {\n Debug.println(\"resolvePackages: check - \" + ip.pkgString());\n }\n provider = (ExportPkg)tempProvider.get(ip.name);\n if (provider != null) {\n if (Debug.packages) {\n Debug.println(\"resolvePackages: \" + ip.name + \" - has temporary provider - \"\n + provider);\n }\n if (provider.zombie && provider.bpkgs.bundle.state == Bundle.UNINSTALLED) {\n if (Debug.packages) {\n Debug.println(\"resolvePackages: \" + ip.name +\n \" - provider not used since it is an uninstalled zombie - \"\n + provider);\n }\n provider = null;\n } else if (!ip.okPackageVersion(provider.version)) {\n if (Debug.packages) {\n Debug.println(\"resolvePackages: \" + ip.name +\n \" - provider has wrong version - \" + provider +\n \", need \" + ip.packageRange + \", has \" + provider.version);\n }\n provider = null;\n }\n } else {\n for (Iterator i = ip.pkg.providers.iterator(); i.hasNext(); ) {\n ExportPkg ep = (ExportPkg)i.next();\n tempBlackListChecks++;\n if (tempBlackList.contains(ep)) {\n tempBlackListHits++;\n continue;\n }\n\t if (ep.zombie) {\n // TBD! Should we refrain from using a zombie package and try a new provider instead?\n continue;\n }\n if (ip.okPackageVersion(ep.version)) {\n if (Debug.packages) {\n Debug.println(\"resolvePackages: \" + ip.name + \" - has provider - \" + ep);\n }\n HashMap oldTempProvider = (HashMap)tempProvider.clone();\n if (!checkUses(ep)) {\n tempProvider = oldTempProvider;\n tempBlackList.add(ep);\n continue;\n }\n provider = ep;\n break;\n }\n }\n if (provider == null) {\n provider = pickProvider(ip);\n }\n if (provider != null) {\n tempProvider.put(ip.pkg.pkg, provider);\n }\n }\n if (provider == null) {\n if (ip.resolution == Constants.RESOLUTION_MANDATORY) {\n res.add(ip);\n } else {\n if (Debug.packages) {\n Debug.println(\"resolvePackages: Ok, no provider for optional \" + ip.name);\n }\n }\n }\n }\n return res;\n }", "public boolean loadAdditionalPackages( String canonicalNameClassOrPkg) throws Exception;", "public void setFrameworkPackages(final List<FrameworkPackage> frameworkPackages) {\n this.frameworkPackages = frameworkPackages;\n for (final FrameworkPackage frameworkPackage : frameworkPackages) {\n addDependencies(frameworkPackage.getDependenciesList());\n }\n }", "public void addPackage(Package pkg) {\r\n myPackages.add(pkg);\r\n }", "@Override\n public void setInstallations(final NSISInstallation... installations) {\n Jenkins.getInstance().getDescriptorByType(NSIS.DescriptorImpl.class).setInstallations(installations);\n }", "public void addCustExt() {\n String toAdd = customExt.getText();\n String[] extensions = toAdd.split(\",\");\n ExtensionsAdder.addExtensions(extensions);\n }", "public Builder setPackages(\n int index, WorldUps.UDeliveryLocation value) {\n if (packagesBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensurePackagesIsMutable();\n packages_.set(index, value);\n onChanged();\n } else {\n packagesBuilder_.setMessage(index, value);\n }\n return this;\n }", "private String createPackageList( final String eePackages,\n final String userPackages,\n final String platformPackages )\n {\n final StringBuilder packages = new StringBuilder();\n packages.append( eePackages );\n \n // append used defined packages\n if( userPackages != null && userPackages.trim().length() > 0 )\n {\n if( packages.length() > 0 )\n {\n packages.append( \",\" );\n }\n packages.append( userPackages );\n }\n // append platform specific packages\n if( platformPackages != null && platformPackages.trim().length() > 0 )\n {\n if( packages.length() > 0 )\n {\n packages.append( \",\" );\n }\n packages.append( platformPackages );\n }\n return packages.toString();\n }", "public void putLibraryPackages(String variantName, Collection<String> libraryPackages) {\n libraryPackageMap.put(variantName, libraryPackages);\n }", "private void setupLocationProvider() {\n final LocationManager locManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);\n mGPSLocationProvider = new AppLocationProvider(locManager, LocationManager.GPS_PROVIDER, 1000L);\n mGPSLocationProvider.start();\n\n mActiveLocationProvider = new AppLocationProvider(locManager, LocationManager.NETWORK_PROVIDER, 1000L);\n mActiveLocationProvider.start();\n }", "@Override\n\tpublic void addParties(ArrayList<Party> others) {\n\n\t}", "public ContributorTrackingSet(NavigatorContentService aContentService, Object[] elements) {\n for (int i = 0; i < elements.length; i++) super.add(elements[i]);\n contentService = aContentService;\n }", "public String getPackages() {\n\t\treturn this.packages;\n\t}", "public Set<String> getPackagesToScan() {\n return Collections.unmodifiableSet(packagesToScan);\n }", "private void populateAvailableProviders() {\n allAvailableProviders = new HashSet<Provider>();\n\n DataType dataType = DataType.valueOfIgnoreCase(this.dataType);\n try {\n for (Provider provider : DataDeliveryHandlers.getProviderHandler()\n .getAll()) {\n\n ProviderType providerType = provider.getProviderType(dataType);\n if (providerType != null) {\n allAvailableProviders.add(provider);\n }\n }\n } catch (RegistryHandlerException e) {\n statusHandler.handle(Priority.PROBLEM,\n \"Unable to retrieve the list of providers.\", e);\n }\n }", "public static void registerEcorePackages() {\n\t\tInjector injector = new MMapDslStandaloneSetup().createInjectorAndDoEMFRegistration();\n\n\t\t// obtain a resourceset from the injector\n\t\tXtextResourceSet resSet = injector.getInstance(XtextResourceSet.class);\n\n\t\t// Associate the \"mindmap\" extension with the XMI resource format\n\t\tResource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(\"requirements\", new XMIResourceFactoryImpl());\n\t\t\n\t\t// Initialize the model\n\t\tMindmapPackage.eINSTANCE.eClass();\n\n\t\t// Initialize the model\n\t\tRequirementsPackage.eINSTANCE.eClass();\n\t\t\n\t\t// Retrieve the default factory singleton\n // MindmapFactory factory = MindmapFactory.eINSTANCE;\t\t\n\n // Initialize the EMFTVM package \n\t\torg.eclipse.m2m.atl.emftvm.EmftvmPackage.eINSTANCE.eClass();\n\t\t\n\t\t// Associate the \"emftvm\" extension with the EMFTVM resource format\n\t\tResource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(\"emftvm\", new EMFTVMResourceFactoryImpl());\n\t}", "public CompilationBuilder setClasspathList(String ...parts) {\n\t\tif(parts!=null && parts.length>0) {\n\t\t\tcompilerConfiguration.setClasspathList(new ArrayList<String>(Arrays.asList(parts)));\n\t\t}\n\t\treturn this;\n\t}", "@Override\n\tpublic void insertClientPackages(Map<String , Object> packageList) {\n\t\tsampleDao.insertClientPackage(packageList);\n\t}", "private void startLocationUpdates() {\n mSettingsClient.checkLocationSettings(mLocationSettingsRequest)\n .addOnSuccessListener(this, new OnSuccessListener<LocationSettingsResponse>() {\n @Override\n public void onSuccess(LocationSettingsResponse locationSettingsResponse) {\n Log.i(TAG, \"All location settings are satisfied.\");\n\n //noinspection MissingPermission\n if (ActivityCompat.checkSelfPermission(ChooseParty.this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(ChooseParty.this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(ChooseParty.this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n REQUEST_PERMISSIONS_REQUEST_CODE);\n }\n mFusedLocationClient.requestLocationUpdates(mLocationRequest,\n mLocationCallback, Looper.myLooper());\n\n }\n })\n .addOnFailureListener(this, new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n int statusCode = ((ApiException) e).getStatusCode();\n switch (statusCode) {\n case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:\n Log.i(TAG, \"Location settings are not satisfied. Attempting to upgrade \" +\n \"location settings \");\n try {\n // Show the dialog by calling startResolutionForResult(), and check the\n // result in onActivityResult().\n ResolvableApiException rae = (ResolvableApiException) e;\n rae.startResolutionForResult(ChooseParty.this, REQUEST_CHECK_SETTINGS);\n } catch (IntentSender.SendIntentException sie) {\n Log.i(TAG, \"PendingIntent unable to execute request.\");\n }\n break;\n case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:\n String errorMessage = \"Location settings are inadequate, and cannot be \" +\n \"fixed here. Fix in Settings.\";\n Log.e(TAG, errorMessage);\n Toast.makeText(ChooseParty.this, errorMessage, Toast.LENGTH_LONG).show();\n mRequestingLocationUpdates = false;\n }\n }\n });\n }", "void addPackagesRecursive(String... packageNames) {\n for (String packageName : packageNames) {\n List<Class<? extends TestCase>> addedClasses = testCaseClassesInPackage(packageName);\n if (addedClasses.isEmpty()) {\n Log.w(LOG_TAG, \"Invalid Package: '\" + packageName\n + \"' could not be found or has no tests\");\n }\n testCaseClasses.addAll(addedClasses);\n }\n }", "void setClassPathElements(java.util.List classPathElements);", "private void setNeedHookPackage(Context context) {\n ArrayList<String> NeedHookPackage = new ArrayList<String>();\n try {\n// 根据context对象获取当前apk路径\n String path = findApkFile(context, modulePackage).toString();\n// 简单暴力使用zip来解包获取config文件,之前采用getSource发现加入免重启功能后导致获取原包路径失败,因此换用这种方案\n ZipFile zipFile = new ZipFile(path);\n ZipEntry zipEntry = zipFile.getEntry(\"assets/config\");\n// 读流数据转化成arraylist\n InputStream inputStream = zipFile.getInputStream(zipEntry);\n InputStreamReader in = new InputStreamReader(inputStream);\n BufferedReader br = new BufferedReader(in);\n String line;\n StringBuilder sb = new StringBuilder();\n while ((line = br.readLine()) != null) {\n sb.append(line);\n if (line.contains(\".name\")) {\n String[] new_line = line.split(\"=\");\n NeedHookPackage.add(new_line[1]);\n }\n }\n hookPackages = NeedHookPackage;\n } catch (Exception e) {\n Logger.loge(e.toString());\n }\n }", "public void addAliases(String... aliases) {\n this.aliases.addAll(Lists.newArrayList(aliases));\n Collections.sort(this.aliases);\n }", "private void addSources() {\n FeatureCollection emptyFeature = FeatureCollection.fromFeatures(new Feature[] {});\n\n if (mapboxMap.getSourceAs(LocationLayerConstants.LOCATION_SOURCE) == null) {\n mapboxMap.addSource(new GeoJsonSource(\n LocationLayerConstants.LOCATION_SOURCE,\n emptyFeature,\n new GeoJsonOptions().withMaxZoom(16))\n );\n }\n\n if (mapboxMap.getSourceAs(LocationLayerConstants.LOCATION_ACCURACY_SOURCE) == null) {\n mapboxMap.addSource(new GeoJsonSource(\n LocationLayerConstants.LOCATION_ACCURACY_SOURCE,\n emptyFeature,\n new GeoJsonOptions().withMaxZoom(16))\n );\n }\n }", "List<String> getSystemPackages();", "public Builder addAllExtraJavacopts(\n java.lang.Iterable<java.lang.String> values) {\n ensureExtraJavacoptsIsMutable();\n com.google.protobuf.AbstractMessageLite.Builder.addAll(\n values, extraJavacopts_);\n onChanged();\n return this;\n }", "void setOsPSet(Set<String> osPs);", "private void addSuggestedBrandOwners() {\n Activity activity = getActivity();\n if (brandOwner == null || activity == null) {\n return;\n }\n String[] allBrandOwners = allBrandOwnersLoaded ? ObjectCache.getBrandOwners(activity, client, true,\n false) : null;\n BrandOwnerAdapter brandOwnerAdapter = new BrandOwnerAdapter(activity, R.layout\n .dropdown_brand_owner_item, suggestedBrandOwners, allBrandOwners);\n brandOwner.setAdapter(brandOwnerAdapter);\n }", "private void setExtraMapElements() {\n \t\tif (mGoogleMap == null && mLocationsList == null) {\n \t\t\treturn;\n \t\t}\n \t\tfor (int i = 0; i < mLocationsList.size(); i++) {\n \t\t\tMarkerOptions marker = new MarkerOptions().position(mLocationsList\n \t\t\t\t\t.get(i).mPosition);\n \t\t\tif (mLocationsList.get(i).mIcono != 0) {\n \t\t\t\tmarker.icon(BitmapDescriptorFactory.fromResource(mLocationsList\n \t\t\t\t\t\t.get(i).mIcono));\n \t\t\t}\n \t\t\tif (mLocationsList.get(i).mContenido.mNombre != null) {\n \t\t\t\tmarker.title(mLocationsList.get(i).mContenido.mNombre);\n \t\t\t}\n \t\t\tif (mLocationsList.get(i).mContenido.mSnippet != null) {\n \t\t\t\tmarker.snippet(mLocationsList.get(i).mContenido.mSnippet);\n \t\t\t}\n \n \t\t\tmGoogleMap.addMarker(marker);\n \t\t}\n \t\tmGoogleMap.setInfoWindowAdapter(new MarkerAdapter());\n \t}", "WorldUps.UDeliveryLocation getPackages(int index);", "public RTWLocation append(Object... list);", "public void setPackageTypes(Set<PackageType> packageTypeSet) {\r\n\t\tif (this.packageTypeSet.isEmpty())\r\n\t\t\tthis.packageTypeSet = new TreeSet<>();\r\n\t\tthis.packageTypeSet.clear();\r\n\t\tthis.packageTypeSet.addAll(packageTypeSet);\r\n\t\tinitialize();\r\n\t}", "public void injectGps()\r\n\t{\r\n\t\tif (mInjectGps == false) {\r\n\t\t\tLog.d(TAG, \"on injectGps\");\r\n\t\t\tmLocationManager.sendExtraCommand(\"gps\", \"force_xtra_injection\", null);\r\n\t\t\tmInjectGps = true;\r\n\t\t}\r\n\t}", "private void fineLocationPermissionGranted() {\n UtilityService.addGeofences(this);\n UtilityService.requestLocation(this);\n }", "String[] getSupportedAnnotationPackages();", "public void setExtensions( String extensions[] )\n\t{\n\t\tthis.extensions = extensions;\n\t}", "private void _loadProvidersLocked() {\n if (GpsLocationProvider.isSupported()) {\n // Create a gps location provider\n mGpsLocationProvider = new GpsLocationProvider(mContext);\n LocationProviderImpl.addProvider(mGpsLocationProvider);\n }\n\n // Load fake providers if real providers are not available\n File f = new File(LocationManager.PROVIDER_DIR);\n if (f.isDirectory()) {\n File[] subdirs = f.listFiles();\n for (int i = 0; i < subdirs.length; i++) {\n if (!subdirs[i].isDirectory()) {\n continue;\n }\n\n String name = subdirs[i].getName();\n\n if (LOCAL_LOGV) {\n Log.v(TAG, \"Found dir \" + subdirs[i].getAbsolutePath());\n Log.v(TAG, \"name = \" + name);\n }\n\n // Don't create a fake provider if a real provider exists\n if (LocationProviderImpl.getProvider(name) == null) {\n LocationProviderImpl provider = null;\n try {\n File classFile = new File(subdirs[i], \"class\");\n // Look for a 'class' file\n provider = LocationProviderImpl.loadFromClass(classFile);\n\n // Look for an 'kml', 'nmea', or 'track' file\n if (provider == null) {\n // Load properties from 'properties' file, if present\n File propertiesFile = new File(subdirs[i], \"properties\");\n\n if (propertiesFile.exists()) {\n provider = new TrackProvider(name);\n ((TrackProvider)provider).readProperties(propertiesFile);\n\n File kmlFile = new File(subdirs[i], \"kml\");\n if (kmlFile.exists()) {\n ((TrackProvider) provider).readKml(kmlFile);\n } else {\n File nmeaFile = new File(subdirs[i], \"nmea\");\n if (nmeaFile.exists()) {\n ((TrackProvider) provider).readNmea(name, nmeaFile);\n } else {\n File trackFile = new File(subdirs[i], \"track\");\n if (trackFile.exists()) {\n ((TrackProvider) provider).readTrack(trackFile);\n }\n }\n }\n }\n }\n if (provider != null) {\n LocationProviderImpl.addProvider(provider);\n }\n // Grab the initial location of a TrackProvider and\n // store it as the last known location for that provider\n if (provider instanceof TrackProvider) {\n TrackProvider tp = (TrackProvider) provider;\n mLastKnownLocation.put(tp.getName(), tp.getInitialLocation());\n }\n } catch (Exception e) {\n Log.e(TAG, \"Exception loading provder \" + name, e);\n }\n }\n }\n }\n\n updateProvidersLocked();\n }", "@Override\n public Iterable<Location> listLocations() {\n return ImmutableSet.<Location>of();\n }", "public Set<String> getPackagesToScan() {\n return packagesToScan;\n }", "private void setupLocation() {\n\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&\n ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n\n // Permission is not granted.\n if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_FINE_LOCATION) &&\n ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_COARSE_LOCATION)) {\n\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION},\n LOCATION_PERMISSION_REQUEST);\n } else {\n // Request the permission\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION},\n LOCATION_PERMISSION_REQUEST);\n }\n } else {\n // Permission has already been granted\n }\n }", "public WorldUps.UDeliveryLocationOrBuilder getPackagesOrBuilder(\n int index) {\n if (packagesBuilder_ == null) {\n return packages_.get(index); } else {\n return packagesBuilder_.getMessageOrBuilder(index);\n }\n }", "public void setLatLongs(final LatLongs latLongs) {\n\t\tlatLongsStorage.setDocument(latLongs);\n\t\tupdateLocationViewList(0);\n\t}", "@SuppressWarnings( {\"MissingPermission\"})\n private void enableLocationPlugin() {\n if (PermissionsManager.areLocationPermissionsGranted(this)) {\n // Create an instance of LOST location engine\n initializeLocationEngine();\n\n locationPlugin = new LocationLayerPlugin(mapView, map, locationEngine);\n locationPlugin.setLocationLayerEnabled(LocationLayerMode.TRACKING);\n } else {\n permissionsManager = new PermissionsManager(this);\n permissionsManager.requestLocationPermissions(this);\n }\n }", "private void setupAddLocation() {\n GoogleApiAvailability apiAvailability = GoogleApiAvailability.getInstance();\n int resultCode = apiAvailability.isGooglePlayServicesAvailable(this);\n if (resultCode != ConnectionResult.SUCCESS) {\n // remove add location linear\n mAddLocationLinear.setVisibility(View.INVISIBLE);\n }\n\n }", "@Override\n\tpublic void ignorePackage(String packageName) {\n\t\tignorePackages.add(packageName);\n\t}", "public void addImports(Iterable<String> imports) {\n\t\tif (imports != null) {\n\t\t\tfor (String importIRIString : imports) {\n\t\t\t\tadditionalImports.add(IRI.create(importIRIString));\n\t\t\t}\n\t\t}\n\t}", "protected final void setSupportedLocales(Locale[] locales) {\n supportedLocales = locales;\n }", "public BinderConfiguration addPackageToScan(String packageToScan) {\n packagesToScan.add(packageToScan);\n return this;\n }", "public void setLocators(String locators) {\n agentConfig.setLocators(locators);\n }", "public void setAdditionalLocation(String additionalLocation) {\n\t\tthis.additionalLocation = additionalLocation;\n\t}", "public PackageFilter(Set<PackageType> packageTypes) {\r\n\t\tif ((packageTypes == null) || (packageTypes.isEmpty()))\r\n\t\t\tpackageTypeSet = EMPTY_PACKAGE_TYPE_SET; \r\n\t\telse {\r\n\t\t\tpackageTypeSet = new TreeSet<>();\r\n\t\t\tpackageTypeSet.addAll(packageTypes);\r\n\t\t\tinitialize();\r\n\t\t}\r\n\t}", "protected void addLocationPropertyDescriptor(Object object) {\n\t\titemPropertyDescriptors.add\n\t\t\t(createItemPropertyDescriptor\n\t\t\t\t(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\n\t\t\t\t getResourceLocator(),\n\t\t\t\t getString(\"_UI_SecuritySchema_location_feature\"),\n\t\t\t\t getString(\"_UI_PropertyDescriptor_description\", \"_UI_SecuritySchema_location_feature\", \"_UI_SecuritySchema_type\"),\n\t\t\t\t CorePackage.Literals.SECURITY_SCHEMA__LOCATION,\n\t\t\t\t true,\n\t\t\t\t false,\n\t\t\t\t false,\n\t\t\t\t ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,\n\t\t\t\t null,\n\t\t\t\t null));\n\t}", "private void populateProviderList()\n {\n synchronized(activeProvidersByName) {\n if(ModuleManager.getInstance() != null) {\n List<ModuleURN> providerUrns = ModuleManager.getInstance().getProviders();\n for(ModuleURN providerUrn : providerUrns) {\n String providerName = providerUrn.providerName();\n if(providerUrn.providerType().equals(MDATA) && !providerName.equals(MarketDataCoreModuleFactory.IDENTIFIER) && !activeProvidersByName.containsKey(providerName)) {\n List<ModuleURN> instanceUrns = ModuleManager.getInstance().getModuleInstances(providerUrn);\n if(!instanceUrns.isEmpty()) {\n ModuleURN instanceUrn = instanceUrns.get(0);\n ModuleInfo info = ModuleManager.getInstance().getModuleInfo(instanceUrn);\n if(info.getState() == ModuleState.STARTED) {\n ModuleProvider provider = new ModuleProvider(providerName,\n AbstractMarketDataModule.getFeedForProviderName(providerName));\n SLF4JLoggerProxy.debug(this,\n \"Creating market data provider proxy for {}\",\n providerName);\n addProvider(provider);\n }\n }\n }\n }\n }\n }\n }", "protected String[] getPackageNamesToUpdate(File resourcesFolder, String... packageNames) {\n if(packageNames != null && packageNames.length > 0){\n return packageNames;\n } \n List<String> packages = new ArrayList<String>();\n for(File packageFolder : guvnorUtils.listDirectories(resourcesFolder)){\n packages.add(packageFolder.getName());\n }\n return packages.toArray(new String[packages.size()]);\n }", "InstallerRegistry (GeneralPlatformInstall[] platformInstalls) {\n assert platformInstalls != null;\n this.platformInstalls = Arrays.asList(platformInstalls);\n this.lookup = null;\n }", "private void updateTargetProductGeocoding() {\n }", "public WorldUps.UDeliveryLocation getPackages(int index) {\n return packages_.get(index);\n }", "@Override\n public boolean setOrderAddresses(User user, String address, ArrayList<String> shoppickup) {\n if(!setShippingAddress(user, address)){\n return false;\n }\n // aggiorno indirizzo ritiro per tutti e soli quelli nella lista shoppickup\n for (String rit: shoppickup) {\n String[] prod_shop = rit.split(\"_\");\n\n if (prod_shop.length != 2 || !setShopPickup(user, prod_shop[0], prod_shop[1])) {\n // errore inserimento nel database o stringa passata errata\n return false;\n }\n }\n\n\n return true;\n }", "public void setLoadedBootstrapExtensions(BootstrapExtension...bootstrapExtensions) {\r\n \tthis.loadedBootstrapExtensions = bootstrapExtensions;\r\n }", "synchronized void registerPackages(Iterator exports, Iterator imports) {\n while (exports.hasNext()) {\n ExportPkg pe = (ExportPkg)exports.next();\n Pkg p = (Pkg)packages.get(pe.name);\n if (p == null) {\n p = new Pkg(pe.name);\n packages.put(pe.name, p);\n }\n p.addExporter(pe);\n if (Debug.packages) {\n Debug.println(\"registerPackages: export, \" + pe);\n }\n }\n while (imports.hasNext()) {\n ImportPkg pe = (ImportPkg)imports.next();\n Pkg p = (Pkg)packages.get(pe.name);\n if (p == null) {\n p = new Pkg(pe.name);\n packages.put(pe.name, p);\n }\n p.addImporter(pe);\n if (Debug.packages) {\n Debug.println(\"registerPackages: import, \" + pe);\n }\n }\n }", "private void updateWsdlExtensors(String port1, String port2) {\n try {\n Definition def = bus.getExtension(WSDLManager.class)\n .getDefinition(wsdlLocation);\n Map<?, ?> map = def.getAllServices();\n for (Object o : map.values()) {\n Service service = (Service)o;\n Map<?, ?> ports = service.getPorts();\n for (Object p : ports.values()) {\n Port port = (Port)p;\n List<?> l = port.getExtensibilityElements();\n for (Object e : l) {\n if (e instanceof SOAPAddress) {\n String add = ((SOAPAddress)e).getLocationURI();\n int idx = add.indexOf(\":\" + port1);\n if (idx != -1) {\n add = add.substring(0, idx) + \":\" + port2\n + add.substring(idx + port1.length() + 1);\n ((SOAPAddress)e).setLocationURI(add);\n }\n }\n }\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void setSubPackages(LinkedList subPackages) {\n m_subPackages = subPackages;\n }", "void setSPExtAttributeValues(\n String realm, \n String fedId, \n Map spExtvalues,\n String location\n ) throws AMConsoleException;", "public void initializeLocations() {\n dataGraphLocation.setItems(FXCollections.observableArrayList(_locationData.getAll()));\n }" ]
[ "0.60418355", "0.59564054", "0.5919794", "0.5806557", "0.56579196", "0.5630494", "0.55973256", "0.55614847", "0.5456344", "0.54517", "0.5317131", "0.5299748", "0.52898705", "0.5278419", "0.52496195", "0.5239673", "0.5223749", "0.51969576", "0.5131879", "0.5107708", "0.5086962", "0.503691", "0.5035275", "0.5021812", "0.49844813", "0.49410665", "0.49407792", "0.49285716", "0.49258485", "0.49209404", "0.49208853", "0.49107945", "0.48904496", "0.48880088", "0.4885432", "0.48794216", "0.48778325", "0.4843252", "0.48056716", "0.47834525", "0.47754264", "0.47724771", "0.47634518", "0.4755746", "0.4754205", "0.4753671", "0.4743506", "0.4718045", "0.47042578", "0.4690799", "0.46476185", "0.46139124", "0.46129578", "0.46126786", "0.46025616", "0.45960134", "0.45900324", "0.4588502", "0.4586907", "0.45829275", "0.4575581", "0.4569191", "0.45691743", "0.45583242", "0.45561486", "0.45492667", "0.4540148", "0.4539225", "0.45361286", "0.4529409", "0.45173004", "0.45163754", "0.45089048", "0.45087394", "0.45081553", "0.45067626", "0.45060492", "0.45047206", "0.45027772", "0.45004636", "0.4500199", "0.44986272", "0.446226", "0.4461086", "0.4459092", "0.44585863", "0.44582576", "0.444693", "0.44387838", "0.4437864", "0.4436406", "0.4433382", "0.44224122", "0.44119903", "0.44102147", "0.4406777", "0.43917796", "0.43885228", "0.43857342", "0.4384541" ]
0.78680736
0
Returns true if this provider has been set as enabled. This will be true unless explicitly set otherwise.
public boolean isEnabled() { return mEnabled; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "final public boolean isEnabled() {\n return enabledType!=ENABLED_NONE;\n }", "public boolean isEnabled()\n {\n return mSettings.getBoolean(ENABLED, true);\n }", "public boolean isEnable() {\n return _enabled;\n }", "public Boolean isEnable() {\n\t\treturn enable;\n\t}", "public boolean isEnable() {\n return enable;\n }", "public Boolean isEnable() {\n return this.enable;\n }", "public boolean isEnabled()\r\n\t{\r\n\t\treturn enabled;\r\n\t}", "public boolean isEnabled ( ) {\r\n\t\treturn enabled;\r\n\t}", "public boolean isEnabled() {\n return mBundle.getBoolean(KEY_ENABLED, true);\n }", "public boolean isEnabled() {\r\n\t\treturn enabled;\r\n\t}", "public boolean isEnabled() {\r\n\t\treturn enabled;\r\n\t}", "public boolean isEnabled() {\n\t\treturn enabled;\n\t}", "public static boolean isEnabled()\n\t{\n\t\treturn App.getSPAPI().getBool(SPKey.ENABLED);\n\t}", "boolean hasEnabled();", "@Override\n public boolean isEnabled() {\n synchronized (mLocationListeners) {\n return mEnabledProviders.contains(getName());\n }\n }", "public boolean enabled(){\n return enabled;\n }", "public boolean isEnabled() {\n\n return enabled;\n }", "public boolean enabled() {\n return m_enabled;\n }", "public boolean isProviderEnabled(String provider){\n\t\tif(provider.equals(GPS_PROVIDER))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public Boolean isEnabled() {\r\r\n\t\treturn _isEnabled;\r\r\n\t}", "public boolean isEnabled() {\r\n return enabled;\r\n }", "public boolean isEnabled() {\r\n return enabled;\r\n }", "@Override\n\tpublic boolean isEnabled() {\n\t\treturn this.enabled;\n\t}", "public static boolean isEnabled() {\n return true;\n }", "public boolean isEnabled() {\n return enabled;\n }", "public boolean isEnabled() {\n return enabled;\n }", "public boolean isEnabled() {\n return enabled;\n }", "public boolean isEnabled() {\n return enabled;\n }", "public boolean isEnabled() {\n return enabled;\n }", "public boolean isEnabled() {\n return enabled;\n }", "public boolean isEnabled() {\n return enabled;\n }", "public boolean isEnabled() {\n return enabled;\n }", "public boolean isEnabled() {\n return enabled;\n }", "public boolean isEnabled() {\n return enabled;\n }", "public boolean isEnabled(){\n\t\treturn mEnabled;\n\t}", "public Boolean enabled() {\n return this.enabled;\n }", "public boolean isEnabled() {\r\n\t\treturn sensor.isEnabled();\r\n\t}", "public boolean getEnabled(){\r\n\t\treturn enabled;\r\n\t}", "public boolean isEnabled() {\r\n return m_enabled;\r\n }", "public Boolean isEnabled() {\n return this.enabled;\n }", "public Boolean isEnabled() {\n return this.enabled;\n }", "public Boolean isEnabled() {\n return this.enabled;\n }", "public boolean getIsEnabledState() {\r\n\t\tif (McsElement.getElementByPartAttributeValueAndParentElement(driver,\r\n\t\t\t\t\"div\", \"@class\", PURCHASING_PRODUCT_WINDOW_CLASS, \"input\", \"@name\",\r\n\t\t\t\t\"isEnabled\", true, false).getAttribute(\"checked\") == null) {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public boolean isEnabled () {\n return impl.isEnabled ();\n }", "@Override\n\tpublic boolean isEnabled() {\n\t\treturn enabled;\n\t}", "@Override\n\tpublic boolean isEnabled() {\n\t\treturn enabled;\n\t}", "@Override\n\tpublic boolean isEnabled() {\n\t\treturn enabled;\n\t}", "public boolean isEnabled() {\n return enabled;\n }", "public boolean isEnabled() {\n return enabled;\n }", "public boolean isGpsEnable() {\r\n\t\treturn lm.isProviderEnabled(LocationManager.GPS_PROVIDER);\r\n\t}", "public boolean isEnabled() {\n for (Transmitter t : getTransmitters()) {\n if (t.getTxStatus() == TxStatus.ENABLED) {\n return true;\n }\n }\n\n return false;\n }", "public boolean getIsEnabled() {\n\t\tString useKey = null;\n\t\ttry {\n\t\t\tuseKey = metadataVocab.getTranslatedValue(\"dlese_collect\", \"key\", getKey());\n\t\t} catch (Throwable e) {\n\t\t\tuseKey = getKey();\n\t\t}\n\n\t\tSimpleLuceneIndex index = getIndex();\n\t\tif (index == null)\n\t\t\treturn true;\n\t\tRepositoryManager rm = (RepositoryManager) index.getAttribute(\"repositoryManager\");\n\t\tif (rm == null)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn rm.isSetEnabled(useKey);\n\t}", "public boolean isEnabled() {\n boolean enabled = parent.getDefaultEnabled();\n String propName = parent.getToggleProperty();\n if (propName != null) {\n Project proj = parent.getProject();\n if (proj != null) {\n String propValue = proj.getProperty(propName);\n if (propValue != null) {\n Boolean booleanValue = new Boolean(propValue);\n enabled = booleanValue.booleanValue();\n }\n }\n }\n\n return enabled;\n }", "public boolean isEnabled() {\n\t\treturn true;\n\t}", "public boolean locationSettingsEnabled() {\n \tif (mLocationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)\n \t\t\t&& mLocationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER)) {\n \t\treturn true;\n \t} else {\n \t\treturn false;\n \t}\n }", "public boolean hasEnabled() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public String getEnabled() {\r\n\t\treturn enabled;\r\n\t}", "public boolean isEnabled() {\n return m_Enabled;\n }", "public boolean hasEnabled() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean isLockerEnable(){\n return getBooleanValue(KEY_LOCKER_ENABLE);\n }", "public boolean isEnabled() {\n return myEnabled;\n }", "public boolean enabled() {\r\n\t\treturn engaged;\r\n\t}", "public Boolean enabled() {\n return this.innerProperties() == null ? null : this.innerProperties().enabled();\n }", "public Boolean getEnabled() {\n return enabled;\n }", "public Boolean getEnabled() {\r\n return enabled;\r\n }", "public java.lang.Boolean getEnabled() {\n return enabled;\n }", "public String isEnabled() {\n return this.isEnabled;\n }", "public boolean getEnabled() {\r\n \t\tif (status == AlternativeStatus.ADOPTED) {\r\n \t\t\treturn true;\r\n \t\t} else {\r\n \t\t\treturn false;\r\n \t\t}\r\n \t}", "public boolean getEnabled() {\n return enabled;\n }", "public boolean isEnabled() {\n return isEnabled;\n }", "public Boolean isEnabled() {\n return this.isEnabled;\n }", "public boolean isEnabled() {\n return enabled;\n }", "public boolean isEnabled(){\n return enabled;\n }", "@Override\n public boolean isEnabled() {\n return this.enabled;\n }", "public boolean hasProvider() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean getEnabled() {\n\t\treturn mCurrentState != STATE.DISABLED;\n\t}", "public Boolean getIsEnable() {\n\t\treturn isEnable;\n\t}", "@Override\n\tpublic boolean isEnabled() {\n\t\treturn isEnabled;\n\t}", "public Boolean getEnabled() {\n return this.enabled;\n }", "public Boolean getEnabled() {\n return this.enabled;\n }", "public Boolean enable() {\n return this.enable;\n }", "public boolean isEnabled() {\n\t\treturn false;\r\n\t}", "public boolean isEnabled() {\n\t\treturn false;\r\n\t}", "public boolean isEnabled() {\n\t\treturn false;\n\t}", "public boolean isEnabled() {\n\t\treturn false;\n\t}", "boolean getEnabled();", "boolean getEnabled();", "boolean getEnabled();", "public boolean isEnabled() { return _enabled; }", "public boolean isEnabled() {\n\t\tboolean isLicensed = isLicensed();\n\t\t// Enabled only if there is an input email\n\t\tboolean noInputFields = Const.isEmpty(inIPAddress);\n\t\treturn isLicensed && !noInputFields;\n\t}", "public boolean hasProvider() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "@DISPID(37)\r\n\t// = 0x25. The runtime will prefer the VTID if present\r\n\t@VTID(42)\r\n\tboolean enabled();", "public boolean isEnabled() { return this.myEnabled; }", "@DISPID(79)\r\n\t// = 0x4f. The runtime will prefer the VTID if present\r\n\t@VTID(77)\r\n\tboolean enabled();", "protected boolean isGpsEnabled() {\n Log.i(LOG_TAG, \"IN isGpsDisabled\");\n LocationManager locMgr = (LocationManager) mContext.getSystemService(mContext.LOCATION_SERVICE);\n return locMgr.isProviderEnabled(LocationManager.GPS_PROVIDER);\n }", "public String getIsEnable() {\n return isEnable;\n }", "public boolean isEnabled(FeatureFlagsProvider featureFlagsProvider) {\n try {\n return featureFlagsProvider.isFeatureEnabled(getFeatureFlagString());\n } catch (NullPointerException e) {\n return getDefaultValue();\n }\n }", "private boolean isEnabled() {\n return isEnabled;\n }", "protected boolean checkEnabledPermission() {\r\n ClientSecurityManager manager = ApplicationManager.getClientSecurityManager();\r\n if (manager != null) {\r\n if (this.enabledPermission == null) {\r\n if ((this.buttonKey != null) && (this.parentForm != null)) {\r\n this.enabledPermission = new FormPermission(this.parentForm.getArchiveName(), \"enabled\",\r\n this.buttonKey, true);\r\n }\r\n }\r\n try {\r\n // Checks to show\r\n if (this.enabledPermission != null) {\r\n manager.checkPermission(this.enabledPermission);\r\n }\r\n this.restricted = false;\r\n return true;\r\n } catch (Exception e) {\r\n this.restricted = true;\r\n if (e instanceof NullPointerException) {\r\n ToggleButton.logger.error(null, e);\r\n }\r\n if (ApplicationManager.DEBUG_SECURITY) {\r\n ToggleButton.logger.debug(this.getClass().toString() + \": \" + e.getMessage(), e);\r\n }\r\n return false;\r\n }\r\n } else {\r\n return true;\r\n }\r\n }" ]
[ "0.7733411", "0.75985646", "0.7498483", "0.7472427", "0.74616647", "0.7440103", "0.7377633", "0.7361547", "0.7324868", "0.7308171", "0.7308171", "0.7295568", "0.7282895", "0.7265551", "0.7230315", "0.71823835", "0.71736526", "0.71449494", "0.71092117", "0.7097016", "0.7095424", "0.7095424", "0.7094644", "0.70669013", "0.7051195", "0.7051195", "0.7051195", "0.7051195", "0.7051195", "0.7051195", "0.7051195", "0.7051195", "0.7051195", "0.7051195", "0.70151937", "0.70086956", "0.7005091", "0.699586", "0.6987866", "0.6983334", "0.6983334", "0.6983334", "0.69822484", "0.6964971", "0.6956384", "0.6956384", "0.6956384", "0.6948043", "0.6948043", "0.69403356", "0.69196624", "0.6914946", "0.69143724", "0.69106555", "0.6901849", "0.6899591", "0.6887179", "0.6887016", "0.6871319", "0.68668014", "0.6850066", "0.6849289", "0.68475026", "0.68288267", "0.68275255", "0.68245625", "0.68189585", "0.68162745", "0.6815415", "0.6814714", "0.6805286", "0.679145", "0.6789849", "0.67662966", "0.67619073", "0.6752741", "0.67224175", "0.67206186", "0.6710518", "0.6710518", "0.6701508", "0.6686768", "0.6686768", "0.6685195", "0.6685195", "0.6683358", "0.6683358", "0.6683358", "0.66813517", "0.6680608", "0.66595834", "0.6655905", "0.6632217", "0.6616162", "0.6580852", "0.6572032", "0.65275216", "0.6516387", "0.6505765" ]
0.69190866
51
Reports a new location from this provider.
public void reportLocation(Location location) { ILocationProviderManager manager = mManager; if (manager != null) { try { manager.onReportLocation(location); } catch (RemoteException | RuntimeException e) { Log.w(mTag, e); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void saveLocation(Location newLocation) {\n FileOutputStream outputStream = null;\n Log.d(\"debugMode\", \"writing new location to memory\");\n byte[] writeLine = (\"\\n\"+ newLocation.returnFull()).getBytes();\n try {\n outputStream = openFileOutput(\"Locations.txt\", MODE_APPEND);\n outputStream.write(writeLine);\n outputStream.close();\n Log.d(\"debugMode\", \"New location saved\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void onNewLocationFromGPS(Location location) {\n gpsLocationFound = true;\n currentLocation = location;\n this.setLocationText(getLocationForPrint(location.getLatitude(),\n location.getLongitude()));\n requestForValidationOfQibla();\n }", "public void onLocationChanged(Location location) {\n lastKnownLocation = location;\n geofenceHelper(getContext());\n }", "@Override\n public void update(Location location) {\n System.out.println(\"We are hiring a new employee! \" + getName());\n }", "@Override\n \tpublic void onLocationChanged(Location location) {\n \t\tthis.location = location;\n \t}", "@Override\n public void onLocationChanged(Location location) {\n updateLocation(location);\n }", "@Override\n public final void onLocationChanged(@NonNull Location location) {\n Log.i(TAG, \"Location has changed, new location is \" + location);\n if( LocationTracker.sLocation == null){\n LocationTracker.sLocation = new Location(location);\n }\n mIsLocationFound = true;\n onLocationFound(location);\n }", "@Override\n public void onLocationResult(LocationResult locationResult) {\n Location location = locationResult.getLastLocation();\n if (location != null) {\n onLocationChanged(location);\n }\n }", "public void updateLocation();", "public void onLocationChanged(Location location) {\n sendResult(location);\n }", "public void onLocationChanged(Location location) {\n\t\t\t\tupdatenewlocation(location);\n\t\t\t\t\n\t\t\t}", "public void getLocationInfo() {\n startLocationService();\n }", "@Override\n\tpublic void locationChanged(Location newLocation) {\n\t\tshowOnMap(newLocation);\n\t\tgiveNavigationInstructions(newLocation);\n\t}", "@Override\n public void onLocationChanged(Location location) {\n setChanged();\n notifyObservers(location);\n }", "@Override\n\t\tpublic void onLocationChanged(Location location) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void onLocationChanged(Location location) {\n\t\t\t\n\t\t}", "@Override\n public void onLocationChanged(Location location) {\n }", "@Override\n public void onLocationResult(LocationResult locationResult) {\n super.onLocationResult(locationResult);\n Log.d(TAG, \"onLocationResult: \");\n if (locationResult != null) {\n Log.d(TAG, \"onLocationResult: loaction!==null\");\n myLocation = locationResult.getLastLocation();\n showMarker();//de show hinh len\n }\n }", "@Override\n public void onLocationChanged(Location location) {\n setLocation(location);\n mLastUpdateTime = DateFormat.getTimeInstance().format(new Date());\n mTime = new SimpleDateFormat(K.TIMESTAMP_FORMAT_STRING).format(Calendar\n .getInstance().getTime()).toString();\n androidLocationUI.updateUI();\n if (application.isLogging()) {\n new Thread(new Runnable() {\n @Override\n public void run() {\n saveData();\n }\n }).start();\n }\n }", "@Override\n public void onLocationChange(Location loc) {\n user.setRelativePosition(loc.getX(), loc.getY());\n map.addStep(new PointF(loc.getX(), loc.getY()));\n //messageHandler.sendEmptyMessage(MESSAGE_REFRESH);\n }", "public void onLocationChanged(Location location) {\r\n currentLocation = new GeoPoint(location);\r\n DatabaseInteractor.sendPosition(act, PreferenceData.getUserId(act), currentLocation.getLatitude(), currentLocation.getLongitude());\r\n\t\tguidoMap.showMyLocation();\r\n }", "@Override\n public void updateLocation(Location location) {\n if (location != null ) {\n Timber.e(\"updated location %1$s %2$s\", location.getLatitude(), location.getLongitude());\n\n CameraPosition cameraPosition = new CameraPosition.Builder().target(\n new LatLng(location.getLatitude(), location.getLongitude())).zoom(20).build();\n\n googleMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));\n\n LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());\n\n MarkerOptions markerOptions = new MarkerOptions();\n markerOptions.position(latLng);\n points.add(latLng);\n Polyline route = googleMap.addPolyline(new PolylineOptions()\n .width(30)\n .color(R.color.colorMapLine)\n .geodesic(false)\n .zIndex(1000));\n route.setPoints(points);\n\n writeToFile(\"Lati: \" + location.getLatitude() + \" , Longi: \" + location.getLongitude(), context);\n\n Timber.e(\"Main Activity updated location %1$s %2$s\", location.getLatitude(), location.getLongitude());\n Toast.makeText(MainActivity.this, \"Lati: \" + location.getLatitude() + \" , Longi: \" + location.getLongitude(), Toast.LENGTH_LONG).show();\n }\n }", "public void setLocation(Point newLocation) {\r\n this.p = newLocation;\r\n }", "@Override\n public boolean addNewLocation(JacocDBLocation toAdd)\n {\n\tlocationList.add(toAdd);\n\n\treturn writeLocationObjectToDB(toAdd);\n }", "public void addLocationObserver(String location);", "@Override\n public void onLocationChanged(Location location) {\n t.append(\"\\n \" + location.getLongitude() + \"\\n\" + location.getLatitude() + \"\\n\" + location.getAccuracy() + \"\\n\" + location.getTime());\n latitude = Double.toString(location.getLatitude());\n longitude =Double.toString(location.getLongitude());\n }", "@Override\r\n\tpublic void onLocationChange(Location loc) {\n\t\tuser.setRelativePosition(loc.getX(), loc.getY());\r\n\t\tmap.addStep(new PointF(loc.getX(),loc.getY()));\r\n\t\tmessageHandler.sendEmptyMessage(MESSAGE_REFRESH);\r\n\t}", "public void onLocationChanged(Location location) {\n \t \n \t }", "@Override\n \t\t\tpublic void onLocationChanged(Location loc) {\n \t \n \t\t\t}", "public void onLocationChanged(Location location) {\n \t\tprintMyCurrentLocationAsString(location);\n \t\t\n\t\t\n \t}", "void onNewLocationRecieved(LocationWrapper locationWrapper, LocationType type);", "@Override\n public void onLocationChanged(@NonNull Location location) {\n }", "@Override\n public void onLocationChanged(Location location) {\n if(!firstLocCheck){\n drive = new Drive(location.getLatitude(),location.getLongitude(),Car.carList.get(carIndex),startTime);\n firstLocCheck = true;\n } else {\n Drive.curLat = location.getLatitude();\n Drive.curLong = location.getLongitude();\n }\n System.out.println(\"Location has changed\");\n System.out.println(location.getLatitude() + \" | \" + location.getLongitude());\n\n //updateLoc(location);\n //locProvider = location.getProvider();\n }", "@Override\n public void onLocationChanged(Location location) {\n count++;\n }", "public void setEventLocation(String newLoc) {\n\t\tthis.location = newLoc;\n\t}", "@Override\r\n\t\t\tpublic void onFinish() {\n\t\t\t\tLog.i(tag, \"Locatie bepalen..\");\r\n\t\t\t\tlm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5000,\r\n\t\t\t\t\t\tminDistanceMeters, locationListener);\r\n\t\t\t}", "@Override\n public void onLocationChanged(Location location) {\n }", "@Override\n public void onLocationChanged(Location location) {\n drawUserMarker(location);\n }", "private void getLocation() {\n\n }", "@Override\n\tpublic void onLocationChanged(Location loc)\n\t{\n\t}", "@Override \n public void onLocationChanged(Location location) { \n mostRecentLocation = location; \n }", "@Override\r\n public void onSuccess(Location location) {\n if (location != null) {\r\n onLocationChanged(location);\r\n }\r\n }", "@Override\r\n public void onLocationChanged(Location location) {\r\n // - Update local variables\r\n setLocationData(location);\r\n\r\n if (location != null) {\r\n Log.e(TAG, \"== location != null\");\r\n // - Send result through a broadcast\r\n sendBroadcastToActivity(currentLat, currentLng);\r\n }\r\n }", "public void onLocationChanged(Location location) {\n \t\t\t\tcurrentLocation = String.valueOf(location.getLatitude()) + \"+\" + String.valueOf(location.getLongitude());\n \t\t\t}", "private void writeActualLocation(Location location)\n {\n //textLat.setText( \"Lat: \" + location.getLatitude() );\n //textLong.setText( \"Long: \" + location.getLongitude() );\n //T.t(MapsActivity.this, \"\" + \"Lat: \" + location.getLatitude() + \"\" + \"Long: \" + location.getLongitude());\n markerLocation(new LatLng(location.getLatitude(), location.getLongitude()));\n }", "void onLocationChanged( String newLocation ) {\n Uri uri = mUri;\n if (null != uri) {\n long date = WeatherContract.WeatherEntry.getDateFromUri(uri);\n Uri updatedUri = WeatherContract.WeatherEntry.buildWeatherLocationWithDate(newLocation, date);\n mUri = updatedUri;\n getLoaderManager().restartLoader(DETAILED_WEATHER_LOADER, null, this);\n }\n }", "@Override\n public void onLocationChanged(Location location) {\n Location location1 = location;\n\n }", "@Override\r\n public void onLocationChanged(Location location) {\n\r\n sendLocationUpdates(location);\r\n }", "public void getLocation(){\n }", "public void sendLastLocation() {\n\t\tif (listeners.size() == 0)\n\t\t\treturn;\n\n\t\tLocation locationToSend = getLastKnownLocation();\n\n\t\tif (locationToSend != null) {\n\t\t\toldLocation = locationToSend;\n\t\t\tfor(Listener ls: listeners){\n\t\t\t\tls.newLocation(locationToSend);\n\t\t\t}\n\t\t\tlog.debug(\"LocationReceiver send last location\");\n\t\t}\n\t}", "public void add_location() {\n if (currentLocationCheckbox.isChecked()) {\n try {\n CurrentLocation locationListener = new CurrentLocation();\n LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);\n Location location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n if (location != null) {\n int latitude = (int) (location.getLatitude() * 1E6);\n int longitude = (int) (location.getLongitude() * 1E6);\n currentLocation = new GeoPoint(latitude, longitude);\n }\n } catch (SecurityException e) {\n e.printStackTrace();\n }\n } else {\n currentLocation = null;\n }\n\n }", "@Override\n\tpublic void setLocation(String l) {\n\t\tlocation = l;\n\t\t\n\t}", "public void setLocation(Location loc) {\n this.location = loc;\n }", "@Override\n public boolean getLocation(Location l) {\n synchronized (mLocationListeners) {\n Location loc = mMockProviderLocation.get(getName());\n if (loc == null) {\n return false;\n }\n l.set(loc);\n return true;\n }\n }", "public void onLocationChanged(Location location) {\n \t\tif(lastKnownLoc == null){//if there is no prev location, use this\r\n \t\t\tlastKnownLoc = location;\r\n \t\t}else{\r\n \t\t\tif(lastKnownLoc.hasAccuracy() && location.hasAccuracy()){//if both the current location and the new one have an accuracy\r\n \t\t\t\tif(lastKnownLoc.getAccuracy() <= location.getAccuracy()){//use the one that is more accurate\r\n \t\t\t\tlastKnownLoc = location;\r\n \t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\tmap.addOverlay(location);\r\n \t\t//gpsText.setText(\"Latitude:\"+ lastKnownLoc.getLatitude() + \"\\nLongitude:\" + lastKnownLoc.getLongitude());\r\n }", "public void onLocationChanged(Location location) {\n \n \t}", "@Override\n public void setLocation(String location) {\n this.location = location;\n }", "@Override\r\n\tpublic void newLocationHasBeenCalculated(final String LocationCalculated) {\n\t\tfinal TextView ts = (TextView) findViewById(R.id.virtualSpot);\r\n\t\td(\"newLocation = \" + LocationCalculated);\r\n\t\t//currVS.setText(\"LocationCalculated\");\r\n\t\trunOnUiThread(new Runnable() {\r\n @Override\r\n public void run() {\r\n \tts.setText(LocationCalculated);\r\n \t\r\n \tcurrentVirtualSpot = mapOfVirtualSpots.get(LocationCalculated);\r\n \t\tif (location != -1 && currentVirtualSpot != null){\r\n \t\t\troute = ninethFloor.getRoute(currentVirtualSpot.getFirstPOI(), \"\"+location);\t\r\n \t\t\tdirectionDescription = route.getDirections();\r\n \t\t\tts.setText(directionDescription);\r\n \t\t}\r\n }\r\n });\r\n\t\t\r\n\t}", "@Override\n public void onLocationChanged(Location location) {\n OnLocationChanged(location.getLatitude(), location.getLongitude());\n }", "@Override\r\n\t\t\tpublic void onLocationChanged(Location location) {\n\t\t\t\tLog.d(\"demo\", \"Lat:\" + location.getLatitude() + \" Long:\"+location.getLongitude());\r\n\t\t\t}", "public void onLocationChanged(Location location) {\n\t\t\tsendGPS(location);\r\n\t\t}", "public void convertToLocation() {\r\n\t\tdouble longitude = Double.MIN_VALUE;\r\n\t\tdouble latitude = Double.MIN_VALUE;\r\n\r\n\t\tdistance += 0.75;\r\n\t\tsteps = meter.getSteps();\r\n\r\n\t\tDataLogger.getInstance().setCurrDistance(distance);\r\n\r\n\t\tlatitude = 0.75 * Math.cos(orientation) * 0.000009\r\n\t\t\t\t+ DataLogger.getInstance().getPrevLatitude();\r\n\t\tlongitude = 0.75 * Math.sin(orientation) * 0.0000136\r\n\t\t\t\t+ DataLogger.getInstance().getPrevLongitude();\r\n\r\n\t\tDataLogger.getInstance().addLocation(latitude, longitude,\r\n\t\t\t\tjava.lang.System.currentTimeMillis());\r\n\r\n\t\tLog.d(TAG, \"Called convertToLocation\");\r\n\t}", "@SuppressLint(\"MissingPermission\")\n private void requestLocationUpdate() {\n }", "@Override\n public void onMyLocationChange(Location arg0) {\n }", "@Override\n public void locationFetched(Location mLocation, Location oldLocation, String time, String locationProvider) {\n GetAccurateLocationApplication.mCurrentLocation = mLocation;\n GetAccurateLocationApplication.oldLocation = oldLocation;\n GetAccurateLocationApplication.locationProvider = locationProvider;\n GetAccurateLocationApplication.locationTime = time;\n }", "@Override\n public void onLocationChanged(Location location) {\n //Log.i(TAG, \"New Location: \" + location.getLatitude() + \" \" + location.getLongitude());\n if (isDrawing) {\n //We are drawing so add a point and move the camera accordingly\n currentDrawing.addPoint(new LatLng(location.getLatitude(), location.getLongitude()), currentColor);\n LatLng userLocation = new LatLng(location.getLatitude(), location.getLongitude());\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(userLocation, 20));\n }\n }", "public void onLocationChanged(Location location) {\n }", "@Override\n\tpublic void onLocationChanged(Location location) {\n\t\tphysAddr = this.initLocationManager();\n\t}", "@Override\n\t\tpublic void onLocationChanged(Location location) {\n\t\t\tif (location != null)\n\t\t\t{\n\t\t\t\tdouble mLat = location.getLatitude();\n\t\t\t\tdouble mLng = location.getLongitude();\n\t\t\t\tLog.i(\"Geo Test: \", Double.toString(mLng) + Double.toString(mLat));\n\t\t\t\tParseGeoPoint point = new ParseGeoPoint(mLat, mLng);\n\t\t\t\tuser.put(\"lastKnownLocation\", point);\n\t\t\t\tuser.saveInBackground();\n\t\t\t\t\n\t lm.removeUpdates(this);\n\t\t\t}\n\t\t}", "public void geolocTransfered() {\n\t\tthis.geolocTransfered = true;\n\t}", "private void updateWithNewLocation(Location location)\n {\n\n float fLatitude = (float)0.0;\n float fLongitude = (float)0.0;\n float fHepe=(float)10000.0;\n byte ucNapUsed = 0;\n byte ucWiperErrorCode = 0;\n\n if (Config.LOGD) Log.d(TAG,\"Network Location callback\");\n\n if( location != null)\n {\n //read params from location structure return by WPS\n fLatitude = (float)(location.getLatitude());\n fLongitude = (float)(location.getLongitude());\n fHepe = location.getAccuracy();\n\n if(bScanCompleted == true)\n {\n ucNapUsed= (byte)aResults.size();\n }\n else\n {\n ucNapUsed = 50;\n }\n\n }\n else\n {\n ucWiperErrorCode = 99;\n }\n startWiperReport();\n native_notify_wiper_position(fLatitude,fLongitude,fHepe,ucNapUsed,ucWiperErrorCode);\n endWiperReport();\n\n }", "@Override\n public void handleLocationChange(Location newLocation) {\n super.handleLocationChange(newLocation);\n MainActivity mainActivity = (MainActivity) getActivity();\n mainActivity.getGeofenceMonitor().handleLocationChange(newLocation);\n setCamera();\n if(mainActivity.getGeofenceMonitor().currentLocation != null) {\n if(debugMode) {\n TextView txt_lat = (TextView) view.findViewById(R.id.txt_lat);\n TextView txt_long = (TextView) view.findViewById(R.id.txt_long);\n txt_lat.setVisibility(View.VISIBLE);\n txt_long.setVisibility(View.VISIBLE);\n txt_lat.setText(\"Latitude: \" + mainActivity.getGeofenceMonitor().currentLocation.getLatitude());\n txt_long.setText(\"Longitude: \" + mainActivity.getGeofenceMonitor().currentLocation.getLongitude());\n }\n setUpMapIfNeeded();\n }\n }", "private void setLastLocation() {\n\n if (ContextCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n // Permission has already been granted\n mFusedLocationClient.getLastLocation()\n .addOnSuccessListener(this, new OnSuccessListener<Location>() {\n @Override\n public void onSuccess(Location location) {\n // Got last known location. In some rare situations this can be null.\n if (location != null) {\n lastLatitude = Double.toString(location.getLatitude());\n lastLongitude = Double.toString(location.getLongitude());\n //lastLocation = Double.toString(location.getLatitude()) + \",\" + Double.toString(location.getLongitude()) ;\n //String b = lastLocation;\n // Get into right format\n // Logic to handle location object\n }\n }\n });\n }\n }", "@Override\n public String getLocation() {\n return location;\n }", "@Override\n public void onSuccess(Location location) {\n }", "public EventHandle createReportLocationEvent(){\n reportLocationEventName = name+\"_reportLocactionEvnt\";\n reportLocation = ECAAgent.getDefaultECAAgent().createPrimitiveEvent(\n reportLocationEventName, // Event name\n \"MAKEFITS.Track\", // class Name\n EventModifier.END, // Event Modifier\n \"void setLatitudeLongitude(Latitude,Longitude)\", // Method signature\n this); // Instance (track1, track2,...,or trackN)\n return (PrimitiveEventHandle) reportLocation;\n }", "@Override\n public void onLocationChanged(Location location) {\n\n }", "@Override\n public void onLocationChanged(Location location) {\n\n }", "@Override\n public void onMapLongClick(LatLng point){\n location = new cLocation(point, this);\n\n //Open a dialog for the user to allow the user to set the name for the saved location\n DialogFragment dialog = new AddLocationDialog();\n dialog.show(getFragmentManager(), getText(R.string.map_ask_add).toString());\n }", "public void onLocationChanged(Location newlocation) {\n\t\t\t\t\n\t\t\t\tif (newlocation != null) \n\t\t\t\t{\n\t\t\t\t\tlocationManager.removeUpdates(this);\n\t\t\t\t\tpoint=getGeoPoint(newlocation);\n\t\t\t\t\t//String altitiude = \"Altitiude: \" + newlocation.getAltitude();\n\t\t\t\t\t//String accuracy = \"Accuracy: \" + newlocation.getAccuracy();\n\t\t\t\t\t//String time = \"Time: \" + newlocation.getTime();\n\t\t\t\t\tmapController.animateTo(point);\n\t\t\t\t\t\n\t\t\t\t\tlatitudes= String.valueOf(newlocation.getLatitude() * 1E6);\n\t\t\t\t\tlongitudes= String.valueOf (newlocation.getLongitude() * 1E6);\n\t\t\t\t\tnameValuePairs.add(new BasicNameValuePair(\"latd\",latitudes));\n\t\t\t\t\tnameValuePairs.add(new BasicNameValuePair(\"lotd\",longitudes));\n\t\t\t\t\tnameValuePairs.add(new BasicNameValuePair(\"id\",LoginId));\n\t\t\t\t\tArrayList<NameValuePair> result=db.getServerData(nameValuePairs,\"updatecoordinates.php\");\n\t\t\t\t\tnameValuePairs.clear();\n\t\t\t\t\tfor(int i=0;i<result.size();i++)\n\t\t\t\t\t{\n\t\t\t\t\t\ts=result.get(i).getName();\n\t\t\t\t\t\tif(s.equals(\"Error\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tToast tt=Toast.makeText(MapViewActivity.this, \"Co-Ords Updated\", 3000);\n\t\t\t\t\t\t\ttt.setGravity(Gravity.CENTER, 0, 15);\n\t\t\t\t\t\t\ttt.show();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tToast tt=Toast.makeText(MapViewActivity.this, \"Co-Ords Updated Error\", 3000);\n\t\t\t\t\t\t\ttt.setGravity(Gravity.CENTER, 0, 15);\n\t\t\t\t\t\t\ttt.show();break;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tresult.clear();\n\t\t\t\t\t\n\t\t\t\t\tmapView.invalidate();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "@Override\n public void onLocationChanged(Location loc)\n {\n \t\n \tint lat = (int) (loc.getLatitude() * 1E6);\n\t\t\tint lng = (int) (loc.getLongitude() * 1E6);\n\t\t\t point = new GeoPoint(lat, lng);\n\t\t\t \n\t\t\t /** remove the previous overlay so the another\n\t\t\t can be added **/\n\t\t\t itemizedOverlay.removeOverlay(0);\n\t\t\t \n\t\t\n\t\t\t //this follows the same steps in the OnCreate function at start up.\n\t\t\t // //Initialize a normal MapOVerlay item with new point.\n\t\t\t OverlayItem overlayitem = new OverlayItem(point, \"kiddda!\", \"sasri kal!\");\n\t\t \n\t\t itemizedOverlay.addOverlay(overlayitem);\n\t\t mapOverlays.add(itemizedOverlay);\n\t\t // move to new point.\n\t\t\tcontroller.animateTo(point); \n\t\t\t \n\t\n\t\t\t//debug message to say the location has been read.\n\t\t\tLog.i(\"Listener\", \"location read\");\n\t\t\t \n\t\t\n\n\t\t \n // String Text = \"My current location is: \" +\n\t\t\tLog.i(\"service check\",\" Latitude = \" + loc.getLatitude() +\n \" Longitude = \" + loc.getLongitude());\n \n // Toast.makeText( getApplicationContext(), Text, Toast.LENGTH_LONG).show();\n \n }", "public abstract void updateLocation(Location location, String newLocationName, int newLocationCapacity);", "@Override\n public geo_location getLocation() {\n return location;\n }", "public void setLocation(String location);", "@SuppressLint(\"MissingPermission\")\n private void requestNewLocationData() {\n LocationRequest mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(5);\n mLocationRequest.setFastestInterval(0);\n mLocationRequest.setNumUpdates(1);\n\n // setting LocationRequest\n // on FusedLocationClient\n FusedLocationProviderClient mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);\n mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n }", "@Override\n public void onLocationChanged(Location location) {\n mMyLocationSubject.onNext(location);\n mPreferences.edit()\n .putString(PREFERENCES_KEY_POS_LAT, Double.toString(location.getLatitude()))\n .putString(PREFERENCES_KEY_POS_LONG, Double.toString(location.getLongitude()))\n .apply();\n }", "public void onSuccess(Location location) {\n if (location != null) {\n //onLocationChanged(location);\n }\n }", "@SuppressLint(\"MissingPermission\")\n private void requestNewLocationData() {\n LocationRequest mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(5);\n mLocationRequest.setFastestInterval(0);\n mLocationRequest.setNumUpdates(1);\n\n // setting LocationRequest\n // on FusedLocationClient\n mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);\n mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n }", "@SuppressLint(\"MissingPermission\")\n private void requestNewLocationData() {\n LocationRequest mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(5);\n mLocationRequest.setFastestInterval(0);\n mLocationRequest.setNumUpdates(1);\n\n // setting LocationRequest\n // on FusedLocationClient\n mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);\n mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n }", "public void setLocation(String location){\n this.location = location;\n }", "public void setLocation(String location){\n this.location = location;\n }", "@Override\r\n public void onLocationChanged(Location location) {\r\n Log.i(TAG, \"Location changed : \" + location);\r\n if (location != null) {\r\n mCurrentLocation = location;\r\n updateUI();\r\n }\r\n }", "private void checkLocationandAddToMap() {\n if (ActivityCompat.checkSelfPermission(getActivity(), android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getActivity(), android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n //Requesting the Location permission\n ActivityCompat.requestPermissions(getActivity(), new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION}, LOCATION_REQUEST_CODE);\n return;\n }\n\n locationManager = (LocationManager) getActivity().getSystemService(LOCATION_SERVICE);\n criteria = new Criteria();\n bestProvider = locationManager.getBestProvider(criteria, true);\n\n\n //Fetching the last known location using the Fus\n Location location = locationManager.getLastKnownLocation(bestProvider);\n\n\n if (location != null) {\n\n onLocationChanged(location);\n\n\n } else {\n //This is what you need:\n locationManager.requestLocationUpdates(bestProvider, 1000, 0, (LocationListener) getActivity());\n }\n\n\n }", "@Override\n\tpublic void onLocationChanged(Location arg0) {\n\n\t}", "@Override\n\tpublic void onLocationChanged(Location arg0) {\n\n\t}", "private void saveLocation()\n {\n willLocationBeSaved = !willLocationBeSaved;\n }", "@Override\n public void onLocationChanged(Location location) {\n mLastLocation = location;\n\n\n }", "@Override\r\n\tpublic void onLocationChanged(Location location) {\n\t if(location!=null){\r\n\t //Toast.makeText(mContext,\"Location provider = \"+location.getProvider(), Toast.LENGTH_SHORT).show();\r\n if (LocationManager.GPS_PROVIDER.equals(location.getProvider())) {\r\n double [] latlng =Common.adjustLatLng(location.getLatitude(), location.getLongitude());\r\n location.setLatitude(latlng[0]);\r\n location.setLongitude(latlng[1]);\r\n Common.saveLocation(location);\r\n super.onLocationChanged(location);\r\n }else if(\"lbs\".equals(location.getProvider())){\r\n Common.saveLocation(location);\r\n super.onLocationChanged(location);\r\n }\r\n\t }\r\n\t}", "public void onLocationChanged(Location argLocation) {\n\t GeoPoint myGeoPoint = new GeoPoint(\r\n\t (int)(argLocation.getLatitude()*1000000),\r\n\t (int)(argLocation.getLongitude()*1000000));\r\n\t /*\r\n\t * it will show a message on \r\n\t * location change\r\n\t Toast.makeText(getBaseContext(),\r\n\t \"New location latitude [\" +argLocation.getLatitude() +\r\n\t \"] longitude [\" + argLocation.getLongitude()+\"]\",\r\n\t Toast.LENGTH_SHORT).show();\r\n\t */\r\n\r\n\t mapController.animateTo(myGeoPoint);\r\n\r\n\t }", "@Override\n public void onLocationChanged(Location location) {\n Log.i(LOG_TAG, \"Location Change\");\n Location target = new Location(\"target\");\n String closePoint;\n int closestIndex = -1;// Default to none\n float minDistance = 1000; // Default to high value\n\n // Focus camera on initial location\n if (mapReady == true && initialCameraSet == true) {\n LatLng initialLocation = new LatLng(location.getLatitude(), location.getLongitude());\n gMap.moveCamera(CameraUpdateFactory.newLatLng(initialLocation));\n initialCameraSet = false; // Initial location already displayed\n }\n // Check if spot is close\n for (int i = 0; i < LocationsClass.spotsCoordinates.length; ++i) {\n target.setLatitude(LocationsClass.spotsCoordinates[i].latitude);\n target.setLongitude(LocationsClass.spotsCoordinates[i].longitude);\n if (location.distanceTo(target) < minDistance) {\n closestIndex = i; //Save closes index\n minDistance = location.distanceTo(target); // update minDistance\n }\n }\n\n if (minDistance < 200 && minDistance > 20) {\n Toast.makeText(getActivity(), \"Location: \" + LocationsClass.spotNames[closestIndex] +\n \" is within 200 meters!\\n\" + \"Go check it out!\", Toast.LENGTH_LONG).show();\n// pointsOfInterests.get(closestIndex).showInfoWindow();\n// gMap.getUiSettings().setMapToolbarEnabled(true);\n popNotification = true; // Allow notification to trigger when user reaches destination\n } else if (minDistance < 20) {\n if (closestIndex != currentUserLocation) {\n int locationId = getResources().getIdentifier(\"loc_\"+closestIndex, \"drawable\", getActivity().getPackageName());\n showArrivalNotification(locationId, LocationsClass.spotNames[closestIndex]);\n currentUserLocation = closestIndex; // Update user location\n }\n }\n\n if (hotspotIndex != -1) {\n pointsOfInterests.get(hotspotIndex).showInfoWindow();\n gMap.getUiSettings().setMapToolbarEnabled(true);\n }\n }" ]
[ "0.6424591", "0.63641703", "0.6307821", "0.6272385", "0.62704176", "0.6203512", "0.6157715", "0.614938", "0.61415035", "0.6118279", "0.60678905", "0.60585713", "0.604057", "0.60389614", "0.60278225", "0.60278225", "0.6015524", "0.5972525", "0.59724146", "0.59688276", "0.5968581", "0.5960894", "0.594839", "0.5945903", "0.59443444", "0.59292406", "0.5922844", "0.5919789", "0.59181935", "0.5903241", "0.58917916", "0.5890837", "0.5884735", "0.58669597", "0.5866597", "0.58653873", "0.5864504", "0.5845827", "0.5843993", "0.5842932", "0.5825366", "0.57965446", "0.5793512", "0.57872957", "0.5781097", "0.5772564", "0.57645357", "0.5751955", "0.5740297", "0.57330304", "0.5730445", "0.57285357", "0.5727392", "0.5713541", "0.57000935", "0.5700067", "0.5698875", "0.5693757", "0.56911635", "0.568419", "0.5681854", "0.5680385", "0.5676065", "0.56727254", "0.56681156", "0.56665254", "0.56606436", "0.56595904", "0.56554425", "0.5644678", "0.56421876", "0.56341094", "0.56339294", "0.5617991", "0.5615644", "0.56153584", "0.56115425", "0.56115425", "0.5598296", "0.5597028", "0.55908984", "0.5580417", "0.55733067", "0.5565526", "0.55635095", "0.5560431", "0.5559909", "0.5554215", "0.5554215", "0.55509984", "0.55509984", "0.55509055", "0.5545484", "0.5545075", "0.5545075", "0.5541171", "0.5538704", "0.55360615", "0.5530351", "0.55288637" ]
0.70749074
0
call once so that providers designed for APIs preQ are not broken
protected void onInit() { onEnable(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onProviderInstalled() {\n }", "private void requestBucks() {\n\n\t}", "protected void onFirstUse() {}", "protected Provider() {}", "public interface ProviderRepoxRestClient {\n /**\n * Creates a provider in Repox and assigns it to the specific Aggregator\n * \n * @param prov\n * Provider definition\n * @param agr\n * Aggregator reference\n * @return created provider\n * @throws RepoxException\n */\n Provider createProvider(Provider prov, Aggregator agr) throws RepoxException;\n\n /**\n * Moves a provider in Repox and assigns it to the new Aggregator\n * \n * @param providerId\n * provider id\n * @param aggregatorId\n * aggregator id\n * @return created provider\n * @throws RepoxException\n */\n Provider moveProvider(String providerId, String aggregatorId) throws RepoxException;\n\n /**\n * Deletes a provider from Repox\n * \n * @param providerId\n * the Provider reference\n * @return successful?\n * @throws RepoxException\n */\n String deleteProvider(String providerId) throws RepoxException;\n\n /**\n * Updates a provider within Repox\n * \n * @param prov\n * Provider object to update\n * @return updated provider\n * @throws RepoxException\n */\n Provider updateProvider(Provider prov) throws RepoxException;\n\n /**\n * Retrieves all available providers within Repox\n * \n * @return an object containing all provider references\n * @throws RepoxException\n */\n DataProviders retrieveProviders() throws RepoxException;\n\n /**\n * Retrieves all available providers within Repox given a specific Aggregator\n * \n * @param agr\n * Aggregator reference\n * @return an object containing all provider references\n * @throws RepoxException\n */\n DataProviders retrieveAggregatorProviders(Aggregator agr) throws RepoxException;\n\n /**\n * Retrieve a Provider given a specific Id\n * \n * @param providerId\n * @return specific provider\n * @throws RepoxException\n */\n eu.europeana.uim.repox.rest.client.xml.Provider retrieveProvider(String providerId)\n throws RepoxException;\n\n /**\n * Retrieve a Provider given a specific mnemonic\n * \n * @param mnemonic\n * @return specific provider\n * @throws RepoxException\n */\n eu.europeana.uim.repox.rest.client.xml.Provider retrieveProviderByMetadata(String mnemonic)\n throws RepoxException;\n}", "@Override\n public void afterPropertiesSet() throws Exception {\n this.allowedPosNames = apiService.findApiNamesByType(ApiType.RETAILPRO_API);\n if(this.allowedPosNames.size() == 0){\n throw new IllegalStateException(\"Should have at least one API\"); \n }\n this.defaultApiForPosSoftware = allowedPosNames.iterator().next();\n }", "private void onProviderInstallerNotAvailable() {\n Toast.makeText(this, \"Unable to update your security settings and SSL security may not avialble\", Toast.LENGTH_SHORT).show();\n }", "private APIClient() {\n }", "protected abstract void beforeCall();", "@ScheduledApiChange(when = \"5.0\", details = \"Default implementation will be removed.\")\n default void preparationSuccessful(@Nonnull Module module,\n @Nonnull Client client,\n @Nonnull Set<TCSResource<?>> resources) {\n }", "public interface IFyberClient {\n\n String HEADER_API_KEY = \"X-Fyber-API-Key\";\n String QUERY_HASH_KEY = \"hashkey\";\n String HASH_NAME = \"X-Sponsorpay-Response-Signature\";\n\n\n @GET(\"/feed/v1/offers.{format}\")\n Observable<OfferListResponse> getOffers(@Header(HEADER_API_KEY) String apiKey, // Why? Because Unlike in most cases api key is not constant\n @NonNull @Path(\"format\") String format,\n @NonNull @Query(\"appid\") Integer appid,\n @NonNull @Query(\"uid\") String uid,\n @NonNull @Query(\"os_version\") String osVersion,\n @NonNull @Query(\"locale\") String locale,\n // @NonNull @Query(\"hashkey\") String hashkey, added in interceptor\n @NonNull @Query(\"timestamp\") Long timestamp,\n @NonNull @Query(\"google_ad_id\") String googleAdId,\n @NonNull @Query(\"google_ad_id_limited_tracking_enabled\") Boolean googleAdIdLimitedTrackingEnabled,\n @Nullable @Query(\"ip\") String ip,\n @Nullable @Query(\"pub0\") String pub0,\n @Nullable @Query(\"page\") Integer page,\n @Nullable @Query(\"offer_types\") String offerTypes,\n @Nullable @Query(\"ps_time\") Long psTime,\n @Nullable @Query(\"device\") String device);\n\n\n @GET(\"http://ifcfg.me/ip\")\n Observable<ResponseBody> getIp();\n}", "private WAPIHelper() { }", "@Override \n public void onProviderDisabled(String provider) { \n }", "private PluginAPI() {\r\n\t\tsuper();\r\n\t}", "@Override\n public void onProviderEnabled(String arg0) {\n\n }", "@Override\npublic void onProviderEnabled(String provider) {\n\n}", "@Override\r\n public void onProviderEnabled(String provider) {\n\r\n }", "@Override\npublic void onProviderDisabled(String provider) {\n\n}", "public void mo55177a() {\n long unused = C3615m3.this.f1452k = System.currentTimeMillis();\n if (C3615m3.this.f1443b) {\n C3615m3.this.m1171c(new MDExternalError(MDExternalError.ExternalError.SDK_INITIALIZATION_IN_PROGRESS), this.f1467a);\n } else if (!C3615m3.this.f1447f.mo55921b() || C3615m3.this.f1447f.mo55918a()) {\n C3615m3.this.f1449h.updateFilePath(C3595k3.m1060d().mo55511a());\n boolean unused2 = C3615m3.this.f1443b = true;\n C3615m3.this.f1448g.mo55372a(C3615m3.this.f1442a, C3615m3.this.f1443b);\n if (C3723s4.m1629b() || C3723s4.m1628a()) {\n C3490e3.m665e(\"SDK Upgrade - delete UUID and local configuration storage\");\n C3661o5.m1405a();\n Pair<String, Boolean> a = C3729t0.m1642a();\n if (a != null) {\n AnalyticsBridge.getInstance().reportDeleteStorageEvent((String) a.first, ((Boolean) a.second).booleanValue());\n }\n }\n C3723s4.m1630c();\n C3615m3.this.m1172c(this.f1467a);\n C3580j createApiToken = ModelFactory.getInstance().createApiToken(this.f1468b);\n if (createApiToken == null) {\n boolean unused3 = C3615m3.this.f1443b = false;\n C3615m3.this.f1448g.mo55372a(C3615m3.this.f1442a, C3615m3.this.f1443b);\n C3615m3.this.m1158a((C3665p2) new C3593k1(C3586j3.C3587a.API_TOKEN_PARSE_ERROR), this.f1467a);\n C3615m3.this.clearAndDisconnect();\n } else if (!C3615m3.this.f1442a || C3604l2.m1115c().mo55538b() == null || !C3604l2.m1115c().mo55538b().mo55850a().equals(createApiToken.mo55850a())) {\n C3604l2.m1115c().mo55537a(createApiToken);\n if (!C3604l2.m1115c().mo55538b().mo55850a().equals(C3659o3.m1391f().mo55687a(C3815z4.C3816a.API_TOKEN))) {\n C3659o3.m1391f().mo55689a(C3815z4.C3816a.API_TOKEN, C3604l2.m1115c().mo55538b().mo55850a());\n C3659o3.m1391f().mo55689a(C3815z4.C3816a.ACCESS_TOKEN, (String) null);\n }\n C3490e3.m665e(\"SDK init started\");\n AnalyticsBridge.getInstance().reportInitEvent();\n C3767w0.m1812b().mo55893a();\n C3646n3.m1337m().mo55661a(60000, 3, 60000, 0, 512, 3);\n C3615m3.this.m1150a(this.f1467a);\n } else {\n boolean unused4 = C3615m3.this.f1443b = false;\n C3615m3.this.f1448g.mo55372a(C3615m3.this.f1442a, C3615m3.this.f1443b);\n C3615m3.this.m1163b(new MDExternalError(MDExternalError.ExternalError.SDK_IS_ALREADY_INITIALIZED), this.f1467a);\n }\n } else {\n C3615m3.this.m1163b(new MDExternalError(MDExternalError.ExternalError.SDK_IS_KILLED), this.f1467a);\n C3461c3.m562g().clearAndDisconnect();\n }\n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n public void onProviderInstallFailed(int errorCode, Intent intent) {\n }", "@Override\r\n public void onProviderDisabled(String provider) {\n\r\n }", "@Override\n public void onProviderDisabled(String arg0) {\n\n }", "public void clearSupportsPreauthOverage() {\n genClient.clear(CacheKey.supportsPreauthOverage);\n }", "private void initSharedPre() {\n\t}", "@Override\n public void onProviderEnabled(String provider) {\n\n }", "@Override\n public void onProviderEnabled(String provider) {\n\n }", "@Override\n public void onProviderEnabled(String provider) {\n\n }", "@Override\n public void onProviderEnabled(String provider) {\n\n }", "public API() {}", "private Aliyun() {\n\t\tsuper();\n\t}", "@Override\r\n\tpublic void onProviderEnabled(String arg0) {\n\r\n\t}", "private PredictRequest() {\n\t}", "@Override\n public void testCreateRequestListSomeFilteredBySourceSystem(){\n }", "@Override\n\tprotected RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException {\n\t\treturn null;\n\t}", "private ParkingLotApi()\r\n {\r\n }", "protected void setupLocal() {}", "protected void beforeConsume() {\n // Do nothing\n }", "default void beforeUse() {\n\t}", "@Override\r\n\tprotected void prepare()\r\n\t{\r\n\r\n\t}", "public void referToSocialServices(){\r\n\t\t//here is some code that we do not have access to\r\n\t}", "@Override\n public void preRun() {\n super.preRun();\n }", "@Override\n \tpublic void onProviderEnabled(String provider) {\n \n \t}", "private void m10989Qx() {\n LbsManagerProxy.init(VivaBaseApplication.m8749FZ().getApplicationContext(), AppStateModel.getInstance().isInChina());\n LbsManagerProxy.setAutoStop(true);\n LbsManagerProxy.recordLocation(false, false);\n LbsManagerProxy.resetLocation();\n LbsManagerProxy.recordLocation(true, false);\n }", "@Before\n\tpublic void setUp() {\n accessToken = \"123\";\n xeroTenantId = \"xyz\";\n \n // Init projectApi client\n // NEW Sandbox for API Mocking\n\t\tdefaultClient = new ApiClient(\"https://ba3fd247-8fc6-4d7c-bcd1-bdbea4ea1803.mock.pstmn.io/payroll.xro/2.0\",null,null,null,null);\n payrollUkApi = PayrollUkApi.getInstance(defaultClient); \n \n\t}", "public interface MarketQueryV4API\n{\n public boolean isV4ToV3MDConversionEnabled();\n\n public boolean isMDXSupportedSession(String session);\n\n public void subscribeCurrentMarketV4(int classKey, EventChannelListener clientListener)\n throws SystemException, CommunicationException, AuthorizationException, DataValidationException;\n\n public void unsubscribeCurrentMarketV4(int classKey, EventChannelListener clientListener)\n throws SystemException, CommunicationException, AuthorizationException, DataValidationException;\n\n public void subscribeRecapLastSaleV4(int classKey, EventChannelListener clientListener)\n throws SystemException, CommunicationException, AuthorizationException, DataValidationException;\n\n public void unsubscribeRecapLastSaleV4(int classKey, EventChannelListener clientListener)\n throws SystemException, CommunicationException, AuthorizationException, DataValidationException;\n\n public void subscribeTickerV4(int classKey, EventChannelListener clientListener)\n throws SystemException, CommunicationException, AuthorizationException, DataValidationException;\n\n public void unsubscribeTickerV4(int classKey, EventChannelListener clientListener)\n throws SystemException, CommunicationException, AuthorizationException, DataValidationException;\n\n public void subscribeNBBOForClassV2(String sessionName, int classKey, EventChannelListener clientListener)\n throws SystemException, CommunicationException, AuthorizationException, DataValidationException;\n\n public void unsubscribeNBBOForClassV2(String sessionName, int classKey, EventChannelListener clientListener)\n throws SystemException, CommunicationException, AuthorizationException, DataValidationException;\n\n /**\n * Get the NBBOStruct for a product key for a session name.\n * @param sessionName to subscribe to.\n * @param productKey to query.\n * @return the NBBOStruct for a product key.\n * @throws UserException sent by server.\n */\n public NBBOStruct getNbboSnapshotForProduct(String sessionName, int productKey) throws UserException;\n\n /**\n * Get the NBBOStruct for a product key for a session name within a period of subscription time.\n * @param timeout to limit the subscribtion time in millisecond.\n * @param sessionName to subscribe to.\n * @param productKey to query.\n * @return the NBBOStruct for a product key.\n * @throws UserException sent by server.\n */\n public NBBOStruct getNbboSnapshotForProduct(int timeout, String sessionName, int productKey)\n throws UserException;\n}", "private EagerlySinleton()\n\t{\n\t}", "private PluginsInternal() {}", "@Override\r\n\tpublic void onProviderDisabled(String arg0) {\n\r\n\t}", "@Override\n public final void lookupAPI(int address) {\n }", "@Override\n\tpublic void onProviderEnabled(String arg0) {\n\t\t\n\t}", "@Override\n\tpublic void onProviderEnabled(String arg0) {\n\t\t\n\t}", "@Override\n\tpublic void onProviderEnabled(String arg0) {\n\t\t\n\t}", "public void testPrioritizeContention() throws Exception\n {\n ResourceContentionManager rcm = rezmgr.getContentionManager();\n\n // Handler impl used for testing...\n class Handler implements ResourceContentionHandler\n {\n public boolean called = false;\n\n public int ret = 1;\n\n public ResourceUsage req = null;\n\n public ResourceUsage[] own = null;\n\n public String proxy = null;\n\n public void reset(int ret)\n {\n this.ret = ret;\n called = false;\n req = null;\n own = null;\n proxy = null;\n }\n\n /**\n * Returns based on value of <i>ret</i>.\n * <ol>\n * <li>-1 then null\n * <li>0 then [0]\n * <li>1 then [owners.length] with requester at front\n * </ol>\n */\n public ResourceUsage[] resolveResourceContention(ResourceUsage requester, ResourceUsage owners[])\n {\n called = true;\n req = requester;\n own = owners;\n\n if (ret == -1)\n return null;\n else if (ret == 0)\n return new ResourceUsage[0];\n else\n {\n ResourceUsage[] prior = new ResourceUsage[owners.length];\n prior[0] = requester;\n System.arraycopy(owners, 0, prior, 1, owners.length - 1);\n return prior;\n }\n }\n\n public void resourceContentionWarning(ResourceUsage newRequest, ResourceUsage[] currentReservations)\n {\n // does nothing for now\n }\n\n }\n ResourceManager.Client client = new ResourceManager.Client(new DummyClient(), new Proxy(),\n new ResourceUsageImpl(new AppID(1, 4), 1), new Context(new AppID(1, 4)));\n ResourceManager.Client clients[] = {\n new ResourceManager.Client(new DummyClient(), new Proxy(), new ResourceUsageImpl(new AppID(2, 2), 2),\n new Context(new AppID(2, 2))),\n new ResourceManager.Client(new DummyClient(), new Proxy(), new ResourceUsageImpl(new AppID(1, 1), 1),\n new Context(new AppID(1, 1))),\n new ResourceManager.Client(new DummyClient(), new Proxy(), new ResourceUsageImpl(new AppID(4, 4), 4),\n new Context(new AppID(4, 4))),\n new ResourceManager.Client(new DummyClient(), new Proxy(), new ResourceUsageImpl(new AppID(3, 3), 3),\n new Context(new AppID(3, 3))),\n new ResourceManager.Client(new DummyClient(), new Proxy(), new ResourceUsageImpl(new AppID(2, 2), 2),\n new Context(new AppID(2, 2))),\n new ResourceManager.Client(new DummyClient(), new Proxy(), new ResourceUsageImpl(new AppID(4, 5), 4),\n new Context(new AppID(4, 5))),\n new ResourceManager.Client(new DummyClient(), new Proxy(), new ResourceUsageImpl(new AppID(5, 5), 5),\n new Context(new AppID(5, 5))),\n new ResourceManager.Client(new DummyClient(), new Proxy(), new ResourceUsageImpl(new AppID(4, 3), 4),\n new Context(new AppID(4, 3))), };\n ResourceUsage usages[] = new ResourceUsage[clients.length];\n for (int i = 0; i < clients.length; ++i)\n usages[i] = clients[i].resusage;\n\n try\n {\n ResourceManager.Client[] prioritized;\n\n // Call with null handler\n int r = 0;\n prioritized = rezmgr.prioritizeContention(client, clients);\n assertNotNull(\"Should not return null (given no handler)\", prioritized);\n assertEquals(\"Unexpected array size (given no handler)\", clients.length + 1, prioritized.length);\n int last = 256;\n for (int i = 0; i < prioritized.length; ++i)\n System.out.println(((Context) prioritized[i].context).priority + \" \"\n + position(clients, prioritized[i]));\n for (int i = 0; i < prioritized.length; ++i)\n {\n int prior = prioritized[i].getUsagePriority();\n assertTrue(\"Expected sorted by priority (given no handler) [\" + i + \"]\", last >= prior);\n // If same priority as last, verify that ordering is correct\n // Current definition is to go based upon original order in\n // owner list\n if (last == prior)\n {\n assertTrue(\"Expected equal priority to maintin existing order\",\n position(clients, prioritized[i]) > position(clients, prioritized[i - 1]));\n }\n\n last = prior;\n }\n\n // Add Handler\n Handler handler = new Handler();\n rcm.setResourceContentionHandler(handler);\n\n // Expect manager to prioritize\n handler.reset(-1);\n r = 1;\n prioritized = rezmgr.prioritizeContention(client, clients);\n assertTrue(\"Expected handler to be called\", handler.called);\n assertSame(\"Expected given requester to be used\", client.resusage, handler.req);\n assertNotNull(\"Expected owners array to be non-null\", handler.own);\n assertEquals(\"Expected owners length to be same as specified\", clients.length, handler.own.length);\n for (int i = 0; i < clients.length; ++i)\n assertEquals(\"Unexpected owner id passed to handler\", usages[i], handler.own[i]);\n assertNotNull(\"Should not return null (given null)\", prioritized);\n assertEquals(\"Unexpected array size (given null)\", clients.length + 1, prioritized.length);\n last = 256;\n for (int i = 0; i < prioritized.length; ++i)\n {\n int prior = prioritized[i].getUsagePriority();\n assertTrue(\"Expected sorted by priority (given null) [\" + i + \"]\", last >= prior);\n last = prior;\n }\n\n // Expect empty array\n handler.reset(0);\n r = 2;\n prioritized = rezmgr.prioritizeContention(client, clients);\n assertTrue(\"Expected handler to be called\", handler.called);\n assertSame(\"Expected given requester to be used\", client.resusage, handler.req);\n assertNotNull(\"Expected owners array to be non-null\", handler.own);\n assertEquals(\"Expected owners length to be same as specified\", clients.length, handler.own.length);\n for (int i = 0; i < clients.length; ++i)\n assertEquals(\"Unexpected owner id passed to handler\", usages[i], handler.own[i]);\n assertNotNull(\"Should not return null (given 0)\", prioritized);\n assertEquals(\"Unexpected array size (given 0)\", 0, prioritized.length);\n\n // Expect specified array\n handler.reset(1);\n r = 3;\n prioritized = rezmgr.prioritizeContention(client, clients);\n assertTrue(\"Expected handler to be called\", handler.called);\n assertSame(\"Expected given requester to be used\", client.resusage, handler.req);\n assertNotNull(\"Expected owners array to be non-null\", handler.own);\n assertEquals(\"Expected owners length to be same as specified\", clients.length, handler.own.length);\n for (int i = 0; i < clients.length; ++i)\n assertEquals(\"Unexpected owner id passed to handler\", usages[i], handler.own[i]);\n assertNotNull(\"Should not return null\", prioritized);\n assertEquals(\"Unexpected array size\", clients.length, prioritized.length);\n assertEquals(\"Unexpected array entry [0]\", client, prioritized[0]);\n // Actually, just expect to be sorted by AppID\n // When we have same AppID, might be reordered...\n // Let's assign priority numbers to each AppID...\n // And then make sure that clients are sorted accordingly\n // !!! Minor issue here... is if AppID is represented more than once\n // in array returned by handler... which one is used to specify\n // priority?\n // First position or last? Here we assume last.\n // TODO (TomH) Resolve with new resource contention\n /*\n * Hashtable idprior = new Hashtable(); for(int i = 0; i <\n * handler.own.length; ++i) idprior.put(handler.own[i].getAppID(),\n * new Integer(handler.own.length-i)); last = handler.own.length+1;\n * for(int i = 1; i < prioritized.length; ++i) { Integer p =\n * (Integer)idprior.get(((Context)prioritized[i].context).id);\n * assertNotNull(\"AppID wasn't passed to handler to begin with\", p);\n * int prior = p.intValue();\n * assertTrue(\"Expected clients to be in priority order\", last >=\n * prior); last = prior; }\n */\n\n // Replace the handler\n Handler replace = new Handler();\n rcm.setResourceContentionHandler(replace);\n handler.reset(0);\n replace.reset(0);\n prioritized = rezmgr.prioritizeContention(client, clients);\n assertTrue(\"Replacement handler should be called\", replace.called);\n assertFalse(\"Original handler should NOT be called\", handler.called);\n handler = replace;\n\n // Check for empty owners\n handler.reset(-1);\n prioritized = rezmgr.prioritizeContention(client, new ResourceManager.Client[0]);\n assertTrue(\"Expected handler to be called\", handler.called);\n assertTrue(\"Expected empty owners\", handler.own.length == 0);\n assertNotNull(\"Should not return null (no owners)\", prioritized);\n assertEquals(\"Unexpected array size (no owners)\", 1, prioritized.length);\n assertEquals(\"Unexpected entry (no owners)\", client, prioritized[0]);\n\n // Remove the handler\n rcm.setResourceContentionHandler(null);\n handler.reset(0);\n prioritized = rezmgr.prioritizeContention(client, clients);\n assertFalse(\"Handler was removed, should not be called\", handler.called);\n assertNotNull(\"Should not return null (removed)\", prioritized);\n assertEquals(\"Unexpected array size (removed)\", clients.length + 1, prioritized.length);\n last = 256;\n for (int i = 0; i < prioritized.length; ++i)\n {\n int prior = prioritized[i].getUsagePriority();\n assertTrue(\"Expected sorted by priority (removed) [\" + i + \"]\", last >= prior);\n last = prior;\n }\n }\n finally\n {\n // Clear handler\n rcm.setResourceContentionHandler(null);\n }\n\n }", "private RESTBackend()\n\t\t{\n\t\t\t\n\t\t}", "public void prepareForDeferredProcessing() {\n\n }", "public final GoogleApiClient mo27395a() {\n Preconditions.m21864a(!this.f19581k.isEmpty(), (Object) \"must call addApi() to add at least one API\");\n ClientSettings b = mo27396b();\n Api api = null;\n Map f = b.mo27765f();\n C1253b bVar = new C1253b();\n C1253b bVar2 = new C1253b();\n ArrayList arrayList = new ArrayList();\n boolean z = false;\n for (Api api2 : this.f19581k.keySet()) {\n Object obj = this.f19581k.get(api2);\n boolean z2 = f.get(api2) != null;\n bVar.put(api2, Boolean.valueOf(z2));\n zaq zaq = new zaq(api2, z2);\n arrayList.add(zaq);\n AbstractClientBuilder d = api2.mo27327d();\n Api api3 = api2;\n Client a = d.mo27090a(this.f19580j, this.f19585o, b, obj, zaq, zaq);\n bVar2.put(api3.mo27324a(), a);\n if (d.mo27330a() == 1) {\n z = obj != null;\n }\n if (a.providesSignIn()) {\n if (api == null) {\n api = api3;\n } else {\n String b2 = api3.mo27325b();\n String b3 = api.mo27325b();\n StringBuilder sb = new StringBuilder(String.valueOf(b2).length() + 21 + String.valueOf(b3).length());\n sb.append(b2);\n sb.append(\" cannot be used with \");\n sb.append(b3);\n throw new IllegalStateException(sb.toString());\n }\n }\n }\n if (api != null) {\n if (!z) {\n Preconditions.m21869b(this.f19571a == null, \"Must not set an account in GoogleApiClient.Builder when using %s. Set account in GoogleSignInOptions.Builder instead\", api.mo27325b());\n Preconditions.m21869b(this.f19572b.equals(this.f19573c), \"Must not set scopes in GoogleApiClient.Builder when using %s. Set account in GoogleSignInOptions.Builder instead.\", api.mo27325b());\n } else {\n String b4 = api.mo27325b();\n StringBuilder sb2 = new StringBuilder(String.valueOf(b4).length() + 82);\n sb2.append(\"With using \");\n sb2.append(b4);\n sb2.append(\", GamesOptions can only be specified within GoogleSignInOptions.Builder\");\n throw new IllegalStateException(sb2.toString());\n }\n }\n zaaw zaaw = new zaaw(this.f19580j, new ReentrantLock(), this.f19585o, b, this.f19586p, this.f19587q, bVar, this.f19588r, this.f19589s, bVar2, this.f19583m, zaaw.m21483a((Iterable<Client>) bVar2.values(), true), arrayList, false);\n synchronized (GoogleApiClient.f19570a) {\n GoogleApiClient.f19570a.add(zaaw);\n }\n if (this.f19583m >= 0) {\n zaj.m21619b(this.f19582l).mo27627a(this.f19583m, zaaw, this.f19584n);\n }\n return zaaw;\n }", "public interface GoogleApi {\n\n @Headers(\"Content-Type: application/json\")\n @POST(VISION_CLOUD)\n Call<VisionRespose> processImage64(@Header(\"Content-Length\") String bodyLength, @Query(\"key\") String apiKey, @Body VisionRequest visionRequest);\n\n @Headers(\"Content-Type: application/json\")\n @POST(VISION_CLOUD)\n Call<LogoResponse> processLogoImage64(@Header(\"Content-Length\") String bodyLength, @Query(\"key\") String apiKey, @Body VisionRequest visionRequest);\n\n @Headers(\"Content-Type: application/json\")\n @GET(TRANSLATION_CLOUD)\n Call<TranslationResponse> translateQuery(@Query(\"key\") String apiKey, @Query(\"source\") String source, @Query(\"target\") String target, @Query(\"q\") List<String> queries);\n}", "@Override\n\tprotected void setupInfoKeys()\n\t{\n\t\tthrow new UnsupportedOperationException(\"not yet implemented\");\n\t}", "@Override\n public void onProviderDisabled(String provider) {\n\n }", "@Override\n public void onProviderDisabled(String provider) {\n\n }", "@Override\n public void onProviderDisabled(String provider) {\n\n }", "@Override\n public void onProviderDisabled(String provider) {\n\n }", "@Override\n public void onProviderDisabled(String provider) {\n\n }", "private NativeSupport() {\n\t}", "public void onProviderEnabled(String provider) {\n\n\n\n }", "public api() {}", "public FakeBasicProxyPreparer() {\n\tsuper();\n }", "@Override\n public void onProviderEnabled(String provider) {\n }", "@Override\n public void onProviderEnabled(String provider) {\n }", "@Override\n public void onProviderEnabled(String provider) {\n }", "@Override\n public void onProviderEnabled(String provider) {\n }", "@Override\n public void onProviderEnabled(String provider) {\n }", "@Override\n \tpublic void onProviderDisabled(String provider) {\n \n \t}", "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void earlyStartup() {\n\t}", "private Quantify()\n {\n throw new UnsupportedOperationException(\"Instantiation of utility classes is not supported.\");\n }", "private stendhal() {\n\t}", "private C3P0Helper() { }", "protected void onPrepareRequest(HttpUriRequest request) throws IOException {\n\t\t// Nothing.\n\t}", "public boolean enforceApiDeadlines() {\n return false;\n }", "@Override\r\n\tpublic void onProviderEnabled(String arg0) {\n\t\t\r\n\t}", "private ProtomakEngineTestHelper() {\r\n\t}", "@Override\n\tpublic void onProviderDisabled(String arg0) {\n\t\t\n\t}", "@Override\n\tpublic void onProviderDisabled(String arg0) {\n\t\t\n\t}", "@Override\n\tpublic void onProviderDisabled(String arg0) {\n\t\t\n\t}", "ResilientExecutionUtil() {\n // do nothing\n }", "protected abstract void initUnSupportedFeatures();", "@Override\n\tpublic void onProviderEnabled(String arg0) {\n\n\t}", "public void onProviderDisabled(String provider) {\n\n\n\n }", "ProviderManagerExt()\n {\n load();\n }", "private static final void u() {\n try {\n Object object = StaticLoggerBinder.REQUESTED_API_VERSION;\n Object object2 = v;\n int n10 = ((String[])object2).length;\n int n11 = 0;\n boolean bl2 = false;\n while (true) {\n if (n11 >= n10) {\n if (bl2) return;\n object2 = new StringBuilder();\n String string2 = \"The requested version \";\n ((StringBuilder)object2).append(string2);\n ((StringBuilder)object2).append((String)object);\n object = \" by your slf4j binding is not compatible with \";\n ((StringBuilder)object2).append((String)object);\n object = v;\n object = Arrays.asList(object);\n object = object.toString();\n ((StringBuilder)object2).append((String)object);\n object = ((StringBuilder)object2).toString();\n i.h.h.i.c((String)object);\n object = \"See http://www.slf4j.org/codes.html#version_mismatch for further details.\";\n i.h.h.i.c((String)object);\n return;\n }\n String string3 = object2[n11];\n boolean bl3 = ((String)object).startsWith(string3);\n if (bl3) {\n bl2 = true;\n }\n ++n11;\n }\n }\n catch (Throwable throwable) {\n String string4 = \"Unexpected problem occured during version sanity check\";\n i.h.h.i.d(string4, throwable);\n return;\n }\n catch (NoSuchFieldError noSuchFieldError) {\n return;\n }\n }", "@Override\r\n\tpublic void onProviderDisabled(String arg0) {\n\t\t\r\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n public void prepareInputDiscovery() {\n // Make sure to clear the additional inputs potentially left over from an old build (in case we\n // ran discoverInputs, but not beginExecution).\n clearAdditionalInputs();\n }", "@Override\r\n public void onProviderEnabled(String provider) {\n }" ]
[ "0.57637477", "0.5714664", "0.5709221", "0.5659692", "0.55559695", "0.5532933", "0.5445306", "0.5387648", "0.5386671", "0.53703326", "0.5356937", "0.533573", "0.53276443", "0.532357", "0.5313189", "0.5307628", "0.5289031", "0.5265886", "0.5260403", "0.52542835", "0.52506477", "0.5240312", "0.52396613", "0.520514", "0.5199244", "0.5197608", "0.5197608", "0.5197608", "0.5197608", "0.51962596", "0.5191539", "0.5191248", "0.5189966", "0.51858777", "0.51856196", "0.51818824", "0.51762897", "0.51750976", "0.5172237", "0.51659137", "0.51538205", "0.5150793", "0.5148101", "0.5146659", "0.51427215", "0.51424587", "0.51397383", "0.51365256", "0.51322", "0.5129728", "0.51290405", "0.51290405", "0.51290405", "0.51159006", "0.51157606", "0.5114994", "0.5112692", "0.5109763", "0.51016504", "0.5098334", "0.5098334", "0.5098334", "0.5098334", "0.5098334", "0.50968844", "0.5086761", "0.5085913", "0.5085422", "0.50851583", "0.50851583", "0.50851583", "0.50851583", "0.50851583", "0.50835127", "0.5083061", "0.5071061", "0.50669783", "0.5066275", "0.50631267", "0.5061809", "0.5061466", "0.50584483", "0.50573707", "0.50559807", "0.50559807", "0.50559807", "0.5049493", "0.5048451", "0.50444746", "0.50422734", "0.5041773", "0.5038882", "0.5036827", "0.5036557", "0.5036557", "0.5036557", "0.5036557", "0.5036557", "0.5036557", "0.5035395", "0.5030675" ]
0.0
-1
Implements location provider specific custom commands. The return value will be ignored on Android Q and above.
protected boolean onSendExtraCommand(@Nullable String command, @Nullable Bundle extras) { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean sendExtraCommand(String provider, String command, Bundle extras) {\n checkPermissionsSafe(provider);\n // and check for ACCESS_LOCATION_EXTRA_COMMANDS\n if ((mContext.checkCallingPermission(ACCESS_LOCATION_EXTRA_COMMANDS)\n != PackageManager.PERMISSION_GRANTED)) {\n throw new SecurityException(\"Requires ACCESS_LOCATION_EXTRA_COMMANDS permission\");\n }\n\n synchronized (mLocationListeners) {\n LocationProviderImpl impl = LocationProviderImpl.getProvider(provider);\n if (provider == null) {\n return false;\n }\n \n return impl.sendExtraCommand(command, extras);\n }\n }", "public String[] provides() { return new String[] { Location.TYPE }; }", "public interface LocationProvider {\r\n\t\r\n\t/**\r\n\t * Returns the current location.\r\n\t * \r\n\t * @return the current location\r\n\t */\r\n\tpublic Location getCurrentLocation();\r\n\t\r\n\t/**\r\n\t * Returns the previous locations, not including the current location.\r\n\t * \r\n\t * @return the previous locations\r\n\t */\r\n\tpublic List<Location> getPreviousLocations();\r\n\t\r\n\t/**\r\n\t * Tells if this location manager is prepared for the first speed checks, i.e., if it has received at\r\n\t * least two location updates.\r\n\t * \r\n\t * @return true if sufficient locations are available\r\n\t */\r\n\tpublic boolean isReady();\r\n\r\n}", "@SuppressLint(\"MissingPermission\")\n private void requestLocationUpdate() {\n }", "public interface LocationCallback {\n \n void lacksPermission();\n void withLocation(Location location);\n}", "private void setupLocationProvider() {\n final LocationManager locManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);\n mGPSLocationProvider = new AppLocationProvider(locManager, LocationManager.GPS_PROVIDER, 1000L);\n mGPSLocationProvider.start();\n\n mActiveLocationProvider = new AppLocationProvider(locManager, LocationManager.NETWORK_PROVIDER, 1000L);\n mActiveLocationProvider.start();\n }", "public interface PositionProviderInterface {\n \n /**\n * getting positions from internal GPS\n */\n public static final int TYPE_INTERNAL_GPS = 0;\n \n /**\n * getting positions from external (BT) GPS\n */\n public static final int TYPE_EXTERNAL_GPS = 1;\n \n /**\n * getting positions from cable GPS\n */\n public static final int TYPE_CABLE_GPS = 2;\n \n /**\n * network-based location (Cell ID)\n */\n public static final int TYPE_NETWORK = 3;\n \n /**\n * simulator\n */\n public static final int TYPE_SIMULATOR = 99;\n\n \n /**\n * set where in Core updates from this provider are handled\n * @param coreHandler\n */\n public void setUpdatesHandler(UpdatesHandler coreHandler);\n \n /**\n * signal the platform to start updating this provider\n */\n public void resumeUpdates();\n \n /**\n * signal the platform to stop updating this provider\n */\n public void stopUpdates();\n \n /**\n * get provider type\n * @return one of the TYPE_* constants\n * \n * @see {@link #TYPE_INTERNAL_GPS} {@link #TYPE_EXTERNAL_GPS},\n * {@link #TYPE_CABLE_GPS}, {@link #TYPE_NETWORK}, {@link #TYPE_SIMULATOR}\n */\n public int getType();\n}", "@Override\n public ExtensionResult doSendLocation(ExtensionRequest extensionRequest) {\n Map<String, String> output = new HashMap<>();\n QuickReplyBuilder quickReplyBuilder = new QuickReplyBuilder.Builder(\"\")\n .add(\"location\", \"location\").build();\n output.put(OUTPUT, quickReplyBuilder.string());\n ExtensionResult extensionResult = new ExtensionResult();\n extensionResult.setAgent(false);\n extensionResult.setRepeat(false);\n extensionResult.setSuccess(true);\n extensionResult.setNext(true);\n extensionResult.setValue(output);\n return extensionResult;\n }", "@Override\n public void onPermissionGranted(PermissionGrantedResponse response) {\n\n final ProgressDialog progressDialog = new ProgressDialog(InfoActivity.this);\n progressDialog.setMessage(\"Getting your location...\");\n progressDialog.show();\n SmartLocation.with(InfoActivity.this).location().oneFix().start(new OnLocationUpdatedListener() {\n @Override\n public void onLocationUpdated(Location location) {\n latitudeStr = String.valueOf(location.getLatitude());\n longitudeStr = String.valueOf(location.getLongitude());\n progressDialog.dismiss();\n Toast.makeText(InfoActivity.this, location.getLatitude() + \" \" + location.getLongitude(), Toast.LENGTH_SHORT).show();\n }\n });\n }", "public Location getLocation() {\n /* if ( Build.VERSION.SDK_INT >= 23 &&\n ContextCompat.checkSelfPermission( mContext, android.Manifest.permission.ACCESS_FINE_LOCATION ) != PackageManager.PERMISSION_GRANTED ) {\n Toast.makeText(mContext,\"Permission is not granted so returning back \",Toast.LENGTH_LONG).show();\n// showSettingsAlert();\n return null ;\n }*/\n\n try {\n\n locationManager = (LocationManager) mContext.getSystemService(LOCATION_SERVICE);\n\n Criteria criteria = new Criteria();\n provider = locationManager.getBestProvider(criteria, false);\n if(provider != null) {\n Location location = locationManager.getLastKnownLocation(provider);\n\n // Initialize the location fields\n if (location != null) {\n System.out.println(\"Provider \" + provider + \" has been selected.\");\n onLocationChanged(location);\n resumeGpsService();\n }\n }else {\n// ISSUtils.checkPermission(mContext);\n }\n\n\n }catch (SecurityException secx) {\n secx.printStackTrace();\n// ISSUtils.checkPermission(mContext);\n showSettingsAlert();\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n\n return location;\n }", "private void location(String[] command) {\n\t\tSystem.out\n\t\t\t\t.println(\"Sending last known location information via Twitter.\");\n\t\tTwitterComm.sendDirectMessage(Constants.AUTH_USER,\n\t\t\t\tConstants.CH_LOCATIONTEXT + \"\\n\"\n\t\t\t\t\t\t+ Alfred.getLocation().toString());\n\t}", "@Override\n public void onMyLocationChange(Location arg0) {\n }", "public abstract String getLocation();", "@Override\n public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {\n super.onRequestPermissionsResult(requestCode, permissions, grantResults);\n if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {\n getCurrentLocation();\n } else {\n Toast.makeText(this, \"Permision Denied\", Toast.LENGTH_SHORT).show();\n }\n }", "@Override\n public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults){\n switch (requestCode){\n case MY_PERMISSIONS_LOCATIONS: {\n if(grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED){\n mFusedClient.requestLocationUpdates(mLocationRequest,mLocationCallback, Looper.myLooper());\n }\n } else {\n Toast.makeText(this, \"permission denied\", Toast.LENGTH_LONG).show();\n }\n return;\n }\n }\n }", "private void registerForGPS() {\n Log.d(NAMAZ_LOG_TAG, \"registerForGPS:\");\n Criteria criteria = new Criteria();\n criteria.setAccuracy(Criteria.ACCURACY_COARSE);\n criteria.setPowerRequirement(Criteria.POWER_LOW);\n criteria.setAltitudeRequired(false);\n criteria.setBearingRequired(false);\n criteria.setSpeedRequired(false);\n criteria.setCostAllowed(true);\n LocationManager locationManager = ((LocationManager) getSystemService(Context.LOCATION_SERVICE));\n String provider = locationManager.getBestProvider(criteria, true);\n\n if(!isLocationEnabled()) {\n showDialog(\"Location Access\", getResources().getString(R.string.location_enable), \"Enable Location\", \"Cancel\", 1);\n } else {\n ActivityCompat.requestPermissions(QiblaDirectionActivity.this,\n new String[]{Manifest.permission. ACCESS_FINE_LOCATION},\n MY_PERMISSIONS_REQUEST_LOCATION);\n }\n\n /* if (provider != null) {\n locationManager.requestLocationUpdates(provider, MIN_LOCATION_TIME,\n MIN_LOCATION_DISTANCE, qiblaManager);\n }\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,\n MIN_LOCATION_TIME, MIN_LOCATION_DISTANCE, qiblaManager);\n locationManager.requestLocationUpdates(\n LocationManager.NETWORK_PROVIDER, MIN_LOCATION_TIME,\n MIN_LOCATION_DISTANCE, qiblaManager);*/\n /*Location location = locationManager\n .getLastKnownLocation(LocationManager.GPS_PROVIDER);\n if (location == null) {\n location = ((LocationManager) getSystemService(Context.LOCATION_SERVICE))\n .getLastKnownLocation(LocationManager.GPS_PROVIDER);\n }*/\n\n }", "@Override\n public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {\n super.onRequestPermissionsResult(requestCode, permissions, grantResults);\n switch (requestCode) {\n case LOCATION_REQUEST_CODE:\n if(grantResults.length>0&& grantResults[0] == PackageManager.PERMISSION_GRANTED){\n fetchLastLocation();\n }\n break;\n }\n }", "public String getLocationFormatted(String locationType) {\n if (ActivityCompat.checkSelfPermission(MainActivity.this, ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n return null;\n } else if (!locationType.equals(\"hike\") && !locationType.equals(\"weather\")) {\n Toast.makeText(this, \"Your location type is invalid\", Toast.LENGTH_LONG).show();\n }\n\n if (locationType.equals(\"hike\")) {\n\n client.getLastLocation().addOnSuccessListener(MainActivity.this, new OnSuccessListener<Location>() {\n @Override\n public void onSuccess(Location location) {\n if (location != null) {\n userLocation = \"\" + location.getLatitude() + \",\" + location.getLongitude();\n } else {\n Toast.makeText(MainActivity.this, \"Hikes: Could not get your location\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n } else if (locationType.equals(\"weather\")) {\n client.getLastLocation().addOnSuccessListener(MainActivity.this, new OnSuccessListener<Location>() {\n\n @Override\n public void onSuccess(Location location) {\n if (location != null) {\n userLocation = \"lat=\" + (int) location.getLatitude() + \"&lon=\" + (int) location.getLongitude();\n Intent messageIntent = new Intent(MainActivity.this, WeatherActivity.class);\n messageIntent.putExtra(\"BTN_STRING_LOC\", userLocation);\n MainActivity.this.startActivity(messageIntent); //this is not needed here, but is helpful for readability\n } else {\n Toast.makeText(MainActivity.this, \"Weather: Could not get your location\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }\n return userLocation; //default return - could not launch into the appropriate activity\n }", "@Override//an ok la tu dong bat len can cai requet\n public boolean onMyLocationButtonClick() {\n if (Util.isGpsOpen(context)) {\n\n getMyLocation();//cho nay da co gps(di chuyen den vi tri cua minh va lay vi tri cua minh)\n\n return true;//no bat roi he thong lam tiesp ,\n } else {//bat GPS\n\n reqquestGps();\n return false;\n }\n//return true;\n// return false;//false la de mình lam xong no lam iep lý tiep con true thì no dung ơ ngay cho do\n }", "private void getDeviceLocation( ) {\n\n if (searchLocationMarker != null) {\n searchLocationMarker.remove();\n }\n\n mFusedLocationProviderClient =\n LocationServices.getFusedLocationProviderClient(this);\n //Task locationResult = mFusedLocationProviderClient.getLastLocation();\n try {\n if (mLocationPermissionGranted) {\n Task locationResult = mFusedLocationProviderClient.getLastLocation();\n locationResult.addOnCompleteListener(this, new OnCompleteListener() {\n @Override\n public void onComplete(@NonNull Task task) {\n if (task.isSuccessful()) {\n // Set the map's camera position to the current location of the device.\n System.out.println(\"Current location retrieved successfully!\");\n mLastKnownLocation = (Location) task.getResult(); // location?\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()), DEFAULT_ZOOM));\n searchLocationMarker = mMap.addMarker(new MarkerOptions()\n .position(new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()))\n .title(\"Current Location\")\n .icon(BitmapDescriptorFactory.fromBitmap(\n getBitmapFromVectorDrawable(\n MainActivity.this, R.drawable.ic_current_location_marker))));\n getNearbyStations(mLastKnownLocation.getLatitude(), mLastKnownLocation.getLongitude());\n\n } else {\n Log.d(TAG, \"Current location is null. Using defaults.\");\n Log.e(TAG, \"Exception: %s\", task.getException());\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(mDefaultLocation, DEFAULT_ZOOM));\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n searchLocationMarker = mMap.addMarker(new MarkerOptions()\n .position(mDefaultLocation)\n .title(\"Current Location\")\n .icon(BitmapDescriptorFactory.fromBitmap(\n getBitmapFromVectorDrawable(\n MainActivity.this, R.drawable.ic_current_location_marker))));\n }\n }\n });\n }\n } catch(SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n\n }", "@Override\n public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {\n super.onRequestPermissionsResult(requestCode, permissions, grantResults);\n\n switch (requestCode) {\n case MY_LOCATION:\n if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {\n if (ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n gMap.setMyLocationEnabled(true);\n }\n } else {\n Toast.makeText(getActivity().getApplicationContext(), \"Bit Chat requires location permissions to be granted\", Toast.LENGTH_LONG).show();\n getActivity().finish();\n }\n break;\n }\n }", "private void getLocationPermission() {\n Log.wtf(TAG, \"getLocationPermission() has been instantiated\");\n\n Log.d(TAG, \"getLocationPermission: getting location permissions\");\n String[] permissions = {\n FINE_LOCATION,\n COARSE_LOCATION\n };\n\n if (ContextCompat.checkSelfPermission(getActivity(), FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n if (ContextCompat.checkSelfPermission(getActivity(), COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n Log.d(TAG, \"getLocationPermission: Permission granted\");\n initMap();\n\n } else {\n Log.d(TAG, \"getLocationPermission: requesting permission\");\n requestPermissions(permissions, LOCATION_PERMISSION_REQUEST_CODE);\n }\n } else {\n Log.d(TAG, \"getLocationPermission: requesting permission\");\n requestPermissions(permissions, LOCATION_PERMISSION_REQUEST_CODE);\n }\n }", "@Override\n public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {\n //switch\n switch (requestCode) {\n case ACCESS_REQUEST_LOCATION: {\n // If request is cancelled, the result arrays are empty.\n if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {\n // permission was granted.\n Log.i(getResources().getString(R.string.app_name),\n \"Location Permission granted by user.\");\n setLocationUpdateFunction();\n } else {\n // permission denied, boo! Disable the functionality that depends on this permission.\n Log.e(getResources().getString(R.string.app_name),\n \"No Location Permission granted by user.\");\n //toast message telling the user to enable location permissions\n Toast.makeText(this, \"You have not enabled Location services for this app, please enable them in this apps settings\", Toast.LENGTH_LONG);\n }\n return;\n }\n\n }\n }", "@Override\n public void onProviderDisabled(String s) {\n Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);\n startActivity(intent);\n }", "@Override\n\tpublic void onLocationChanged(TencentLocation arg0, int arg1,\n\t\t\tString arg2) {\n\t\tif (arg1 == TencentLocation.ERROR_OK && mChangedListener != null) {\n\t\t\tLog.e(\"maplocation\", \"location: \" + arg0.getCity() + \" \" + arg0.getProvider());\n\t\t\tLocation location = new Location(arg0.getProvider());\n\t\t\tlocation.setLatitude(arg0.getLatitude());\n\t\t\tlocation.setLongitude(arg0.getLongitude());\n\t\t\tlocation.setAccuracy(arg0.getAccuracy());\n\t\t\tmChangedListener.onLocationChanged(location);\n\t\t\tif(mainActivity.isAlutoLocationAllow())\n\t\t\t\tmapControl.MoveCameraPosition(location.getLatitude(),location.getLongitude());\n\t\t}\n\t}", "@Override\n public void onClick(View v) {\n boolean isGPSEnabled = locationManager.isProviderEnabled(locationManager.GPS_PROVIDER);\n //create boolean isNetworkEnabled equal to result returned from isProviderEnabled() method, sending locationManager.NETWORK_PROVIDER as paremeter\n boolean isNetworkEnabled = locationManager.isProviderEnabled(locationManager.NETWORK_PROVIDER);\n\n //if statement to determine if both booleans are false\n if (!isGPSEnabled && !isNetworkEnabled && ActivityCompat.checkSelfPermission(MainActivity.this, Manifest.permission_group.LOCATION) != PackageManager.PERMISSION_GRANTED) {\n //toast message to tell the user that network and location are not available/enabled\n Toast.makeText(MainActivity.this, \"Network and Location not Available\", Toast.LENGTH_LONG).show();\n return;\n } else {\n //create Criteria object critera\n Criteria criteria = new Criteria();\n\n //string provider equal to value returned from method\n String provider = locationManager.getBestProvider(criteria, true);\n\n fabLocation.setClickable(false);\n\n //call locationupdater\n locationManager.requestLocationUpdates(provider, 0, 0, locationListener);\n }\n }", "@Override\n\tpublic void onLocationChanged(Location arg0) {\n\n\t}", "@Override\n\tpublic void onLocationChanged(Location arg0) {\n\n\t}", "protected void getLocation() {\n if (isLocationEnabled(Navigate.this)) {\n locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);\n criteria = new Criteria();\n bestProvider = String.valueOf(locationManager.getBestProvider(criteria, true)).toString();\n\n //You can still do this if you like, you might get lucky:\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n Location location = locationManager.getLastKnownLocation(bestProvider);\n if (location != null) {\n Log.e(\"TAG\", \"GPS is on\");\n latitude = location.getLatitude();\n longitude = location.getLongitude();\n } else {\n //This is what you need:\n locationManager.requestLocationUpdates(bestProvider, 1000, 0, this);\n }\n } else {\n// final AlertDialog.Builder builder = new AlertDialog.Builder(this);\n// builder.setMessage(\"Your GPS seems to be disabled, do you want to enable it?\")\n// .setCancelable(false)\n// .setPositiveButton(\"Yes\", new DialogInterface.OnClickListener() {\n// public void onClick(final DialogInterface dialog, final int id) {\n// startActivity(new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS));\n// }\n// })\n// .setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n// public void onClick(final DialogInterface dialog, final int id) {\n// dialog.cancel();\n// }\n// });\n// final AlertDialog alert = builder.create();\n// alert.show();\n }\n }", "@Override\r\n\tpublic void onStatusChanged(String provider, int status, Bundle extras) {\r\n\t\tswitch (status) {\r\n\t\tcase LocationProvider.AVAILABLE:\r\n\t\t\t\r\n\t\t\tbreak;\r\n\t\tcase LocationProvider.OUT_OF_SERVICE:\r\n\t\t\t\r\n\t\t\tbreak;\r\n\t\tcase LocationProvider.TEMPORARILY_UNAVAILABLE:\r\n\t\t\t\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "private void enableLocation(){\n if(PermissionsManager.areLocationPermissionsGranted(this))\n {\n initializeLocationEngine();\n initializeLocationLayer();\n\n\n }else{\n permissionsManager = new PermissionsManager(this);\n permissionsManager.requestLocationPermissions(this);\n }\n }", "public interface ILocationPolicyManager\r\n extends IInterface\r\n{\r\n public static abstract class Stub extends Binder\r\n implements ILocationPolicyManager\r\n {\r\n\r\n public static ILocationPolicyManager asInterface(IBinder ibinder)\r\n {\r\n if(ibinder == null)\r\n return null;\r\n IInterface iinterface = ibinder.queryLocalInterface(\"android.location.ILocationPolicyManager\");\r\n if(iinterface != null && (iinterface instanceof ILocationPolicyManager))\r\n return (ILocationPolicyManager)iinterface;\r\n else\r\n return new Proxy(ibinder);\r\n }\r\n\r\n public IBinder asBinder()\r\n {\r\n return this;\r\n }\r\n\r\n public boolean onTransact(int i, Parcel parcel, Parcel parcel1, int j)\r\n throws RemoteException\r\n {\r\n switch(i)\r\n {\r\n default:\r\n return super.onTransact(i, parcel, parcel1, j);\r\n\r\n case 1598968902: \r\n parcel1.writeString(\"android.location.ILocationPolicyManager\");\r\n return true;\r\n\r\n case 1: // '\\001'\r\n parcel.enforceInterface(\"android.location.ILocationPolicyManager\");\r\n setUidPolicy(parcel.readInt(), parcel.readInt());\r\n parcel1.writeNoException();\r\n return true;\r\n\r\n case 2: // '\\002'\r\n parcel.enforceInterface(\"android.location.ILocationPolicyManager\");\r\n i = getUidPolicy(parcel.readInt());\r\n parcel1.writeNoException();\r\n parcel1.writeInt(i);\r\n return true;\r\n\r\n case 3: // '\\003'\r\n parcel.enforceInterface(\"android.location.ILocationPolicyManager\");\r\n parcel = getUidsWithPolicy(parcel.readInt());\r\n parcel1.writeNoException();\r\n parcel1.writeIntArray(parcel);\r\n return true;\r\n\r\n case 4: // '\\004'\r\n parcel.enforceInterface(\"android.location.ILocationPolicyManager\");\r\n setUidNavigationStart(parcel.readInt());\r\n parcel1.writeNoException();\r\n return true;\r\n\r\n case 5: // '\\005'\r\n parcel.enforceInterface(\"android.location.ILocationPolicyManager\");\r\n setUidNavigationStop(parcel.readInt());\r\n parcel1.writeNoException();\r\n return true;\r\n\r\n case 6: // '\\006'\r\n parcel.enforceInterface(\"android.location.ILocationPolicyManager\");\r\n boolean flag = checkUidNavigationScreenLock(parcel.readInt());\r\n parcel1.writeNoException();\r\n if(flag)\r\n i = 1;\r\n else\r\n i = 0;\r\n parcel1.writeInt(i);\r\n return true;\r\n\r\n case 7: // '\\007'\r\n parcel.enforceInterface(\"android.location.ILocationPolicyManager\");\r\n boolean flag1 = isUidForeground(parcel.readInt());\r\n parcel1.writeNoException();\r\n if(flag1)\r\n i = 1;\r\n else\r\n i = 0;\r\n parcel1.writeInt(i);\r\n return true;\r\n\r\n case 8: // '\\b'\r\n parcel.enforceInterface(\"android.location.ILocationPolicyManager\");\r\n boolean flag2 = checkUidLocationOp(parcel.readInt(), parcel.readInt());\r\n parcel1.writeNoException();\r\n if(flag2)\r\n i = 1;\r\n else\r\n i = 0;\r\n parcel1.writeInt(i);\r\n return true;\r\n\r\n case 9: // '\\t'\r\n parcel.enforceInterface(\"android.location.ILocationPolicyManager\");\r\n registerListener(ILocationPolicyListener.Stub.asInterface(parcel.readStrongBinder()));\r\n parcel1.writeNoException();\r\n return true;\r\n\r\n case 10: // '\\n'\r\n parcel.enforceInterface(\"android.location.ILocationPolicyManager\");\r\n unregisterListener(ILocationPolicyListener.Stub.asInterface(parcel.readStrongBinder()));\r\n parcel1.writeNoException();\r\n return true;\r\n\r\n case 11: // '\\013'\r\n parcel.enforceInterface(\"android.location.ILocationPolicyManager\");\r\n setLocationPolicies((LocationPolicy[])parcel.createTypedArray(LocationPolicy.CREATOR));\r\n parcel1.writeNoException();\r\n return true;\r\n\r\n case 12: // '\\f'\r\n parcel.enforceInterface(\"android.location.ILocationPolicyManager\");\r\n parcel = getLocationPolicies();\r\n parcel1.writeNoException();\r\n parcel1.writeTypedArray(parcel, 1);\r\n return true;\r\n\r\n case 13: // '\\r'\r\n parcel.enforceInterface(\"android.location.ILocationPolicyManager\");\r\n boolean flag3;\r\n if(parcel.readInt() != 0)\r\n flag3 = true;\r\n else\r\n flag3 = false;\r\n setRestrictBackground(flag3);\r\n parcel1.writeNoException();\r\n return true;\r\n\r\n case 14: // '\\016'\r\n parcel.enforceInterface(\"android.location.ILocationPolicyManager\");\r\n boolean flag4 = getRestrictBackground();\r\n parcel1.writeNoException();\r\n if(flag4)\r\n i = 1;\r\n else\r\n i = 0;\r\n parcel1.writeInt(i);\r\n return true;\r\n\r\n case 15: // '\\017'\r\n parcel.enforceInterface(\"android.location.ILocationPolicyManager\");\r\n boolean flag5;\r\n if(parcel.readInt() != 0)\r\n flag5 = true;\r\n else\r\n flag5 = false;\r\n setFakeGpsFeatureOnState(flag5);\r\n return true;\r\n\r\n case 16: // '\\020'\r\n parcel.enforceInterface(\"android.location.ILocationPolicyManager\");\r\n break;\r\n }\r\n boolean flag6;\r\n if(parcel.readInt() != 0)\r\n flag6 = true;\r\n else\r\n flag6 = false;\r\n if(parcel.readInt() != 0)\r\n parcel = (Location)Location.CREATOR.createFromParcel(parcel);\r\n else\r\n parcel = null;\r\n setPhoneStationary(flag6, parcel);\r\n return true;\r\n }\r\n\r\n private static final String DESCRIPTOR = \"android.location.ILocationPolicyManager\";\r\n static final int TRANSACTION_checkUidLocationOp = 8;\r\n static final int TRANSACTION_checkUidNavigationScreenLock = 6;\r\n static final int TRANSACTION_getLocationPolicies = 12;\r\n static final int TRANSACTION_getRestrictBackground = 14;\r\n static final int TRANSACTION_getUidPolicy = 2;\r\n static final int TRANSACTION_getUidsWithPolicy = 3;\r\n static final int TRANSACTION_isUidForeground = 7;\r\n static final int TRANSACTION_registerListener = 9;\r\n static final int TRANSACTION_setFakeGpsFeatureOnState = 15;\r\n static final int TRANSACTION_setLocationPolicies = 11;\r\n static final int TRANSACTION_setPhoneStationary = 16;\r\n static final int TRANSACTION_setRestrictBackground = 13;\r\n static final int TRANSACTION_setUidNavigationStart = 4;\r\n static final int TRANSACTION_setUidNavigationStop = 5;\r\n static final int TRANSACTION_setUidPolicy = 1;\r\n static final int TRANSACTION_unregisterListener = 10;\r\n\r\n public Stub()\r\n {\r\n attachInterface(this, \"android.location.ILocationPolicyManager\");\r\n }\r\n }\r\n\r\n private static class Stub.Proxy\r\n implements ILocationPolicyManager\r\n {\r\n\r\n public IBinder asBinder()\r\n {\r\n return mRemote;\r\n }\r\n\r\n public boolean checkUidLocationOp(int i, int j)\r\n throws RemoteException\r\n {\r\n Parcel parcel;\r\n Parcel parcel1;\r\n parcel = Parcel.obtain();\r\n parcel1 = Parcel.obtain();\r\n parcel.writeInterfaceToken(\"android.location.ILocationPolicyManager\");\r\n parcel.writeInt(i);\r\n parcel.writeInt(j);\r\n mRemote.transact(8, parcel, parcel1, 0);\r\n parcel1.readException();\r\n i = parcel1.readInt();\r\n boolean flag;\r\n if(i != 0)\r\n flag = true;\r\n else\r\n flag = false;\r\n parcel1.recycle();\r\n parcel.recycle();\r\n return flag;\r\n Exception exception;\r\n exception;\r\n parcel1.recycle();\r\n parcel.recycle();\r\n throw exception;\r\n }\r\n\r\n public boolean checkUidNavigationScreenLock(int i)\r\n throws RemoteException\r\n {\r\n Parcel parcel;\r\n Parcel parcel1;\r\n parcel = Parcel.obtain();\r\n parcel1 = Parcel.obtain();\r\n parcel.writeInterfaceToken(\"android.location.ILocationPolicyManager\");\r\n parcel.writeInt(i);\r\n mRemote.transact(6, parcel, parcel1, 0);\r\n parcel1.readException();\r\n i = parcel1.readInt();\r\n boolean flag;\r\n if(i != 0)\r\n flag = true;\r\n else\r\n flag = false;\r\n parcel1.recycle();\r\n parcel.recycle();\r\n return flag;\r\n Exception exception;\r\n exception;\r\n parcel1.recycle();\r\n parcel.recycle();\r\n throw exception;\r\n }\r\n\r\n public String getInterfaceDescriptor()\r\n {\r\n return \"android.location.ILocationPolicyManager\";\r\n }\r\n\r\n public LocationPolicy[] getLocationPolicies()\r\n throws RemoteException\r\n {\r\n Parcel parcel;\r\n Parcel parcel1;\r\n parcel = Parcel.obtain();\r\n parcel1 = Parcel.obtain();\r\n LocationPolicy alocationpolicy[];\r\n parcel.writeInterfaceToken(\"android.location.ILocationPolicyManager\");\r\n mRemote.transact(12, parcel, parcel1, 0);\r\n parcel1.readException();\r\n alocationpolicy = (LocationPolicy[])parcel1.createTypedArray(LocationPolicy.CREATOR);\r\n parcel1.recycle();\r\n parcel.recycle();\r\n return alocationpolicy;\r\n Exception exception;\r\n exception;\r\n parcel1.recycle();\r\n parcel.recycle();\r\n throw exception;\r\n }\r\n\r\n public boolean getRestrictBackground()\r\n throws RemoteException\r\n {\r\n Parcel parcel;\r\n Parcel parcel1;\r\n parcel = Parcel.obtain();\r\n parcel1 = Parcel.obtain();\r\n int i;\r\n parcel.writeInterfaceToken(\"android.location.ILocationPolicyManager\");\r\n mRemote.transact(14, parcel, parcel1, 0);\r\n parcel1.readException();\r\n i = parcel1.readInt();\r\n boolean flag;\r\n if(i != 0)\r\n flag = true;\r\n else\r\n flag = false;\r\n parcel1.recycle();\r\n parcel.recycle();\r\n return flag;\r\n Exception exception;\r\n exception;\r\n parcel1.recycle();\r\n parcel.recycle();\r\n throw exception;\r\n }\r\n\r\n public int getUidPolicy(int i)\r\n throws RemoteException\r\n {\r\n Parcel parcel;\r\n Parcel parcel1;\r\n parcel = Parcel.obtain();\r\n parcel1 = Parcel.obtain();\r\n parcel.writeInterfaceToken(\"android.location.ILocationPolicyManager\");\r\n parcel.writeInt(i);\r\n mRemote.transact(2, parcel, parcel1, 0);\r\n parcel1.readException();\r\n i = parcel1.readInt();\r\n parcel1.recycle();\r\n parcel.recycle();\r\n return i;\r\n Exception exception;\r\n exception;\r\n parcel1.recycle();\r\n parcel.recycle();\r\n throw exception;\r\n }\r\n\r\n public int[] getUidsWithPolicy(int i)\r\n throws RemoteException\r\n {\r\n Parcel parcel;\r\n Parcel parcel1;\r\n parcel = Parcel.obtain();\r\n parcel1 = Parcel.obtain();\r\n int ai[];\r\n parcel.writeInterfaceToken(\"android.location.ILocationPolicyManager\");\r\n parcel.writeInt(i);\r\n mRemote.transact(3, parcel, parcel1, 0);\r\n parcel1.readException();\r\n ai = parcel1.createIntArray();\r\n parcel1.recycle();\r\n parcel.recycle();\r\n return ai;\r\n Exception exception;\r\n exception;\r\n parcel1.recycle();\r\n parcel.recycle();\r\n throw exception;\r\n }\r\n\r\n public boolean isUidForeground(int i)\r\n throws RemoteException\r\n {\r\n Parcel parcel;\r\n Parcel parcel1;\r\n parcel = Parcel.obtain();\r\n parcel1 = Parcel.obtain();\r\n parcel.writeInterfaceToken(\"android.location.ILocationPolicyManager\");\r\n parcel.writeInt(i);\r\n mRemote.transact(7, parcel, parcel1, 0);\r\n parcel1.readException();\r\n i = parcel1.readInt();\r\n boolean flag;\r\n if(i != 0)\r\n flag = true;\r\n else\r\n flag = false;\r\n parcel1.recycle();\r\n parcel.recycle();\r\n return flag;\r\n Exception exception;\r\n exception;\r\n parcel1.recycle();\r\n parcel.recycle();\r\n throw exception;\r\n }\r\n\r\n public void registerListener(ILocationPolicyListener ilocationpolicylistener)\r\n throws RemoteException\r\n {\r\n IBinder ibinder;\r\n Parcel parcel;\r\n Parcel parcel1;\r\n ibinder = null;\r\n parcel = Parcel.obtain();\r\n parcel1 = Parcel.obtain();\r\n parcel.writeInterfaceToken(\"android.location.ILocationPolicyManager\");\r\n if(ilocationpolicylistener == null)\r\n break MISSING_BLOCK_LABEL_28;\r\n ibinder = ilocationpolicylistener.asBinder();\r\n parcel.writeStrongBinder(ibinder);\r\n mRemote.transact(9, parcel, parcel1, 0);\r\n parcel1.readException();\r\n parcel1.recycle();\r\n parcel.recycle();\r\n return;\r\n ilocationpolicylistener;\r\n parcel1.recycle();\r\n parcel.recycle();\r\n throw ilocationpolicylistener;\r\n }\r\n\r\n public void setFakeGpsFeatureOnState(boolean flag)\r\n throws RemoteException\r\n {\r\n int i;\r\n Parcel parcel;\r\n i = 1;\r\n parcel = Parcel.obtain();\r\n parcel.writeInterfaceToken(\"android.location.ILocationPolicyManager\");\r\n if(!flag)\r\n i = 0;\r\n parcel.writeInt(i);\r\n mRemote.transact(15, parcel, null, 1);\r\n parcel.recycle();\r\n return;\r\n Exception exception;\r\n exception;\r\n parcel.recycle();\r\n throw exception;\r\n }\r\n\r\n public void setLocationPolicies(LocationPolicy alocationpolicy[])\r\n throws RemoteException\r\n {\r\n Parcel parcel;\r\n Parcel parcel1;\r\n parcel = Parcel.obtain();\r\n parcel1 = Parcel.obtain();\r\n parcel.writeInterfaceToken(\"android.location.ILocationPolicyManager\");\r\n parcel.writeTypedArray(alocationpolicy, 0);\r\n mRemote.transact(11, parcel, parcel1, 0);\r\n parcel1.readException();\r\n parcel1.recycle();\r\n parcel.recycle();\r\n return;\r\n alocationpolicy;\r\n parcel1.recycle();\r\n parcel.recycle();\r\n throw alocationpolicy;\r\n }\r\n\r\n public void setPhoneStationary(boolean flag, Location location)\r\n throws RemoteException\r\n {\r\n int i;\r\n Parcel parcel;\r\n i = 1;\r\n parcel = Parcel.obtain();\r\n parcel.writeInterfaceToken(\"android.location.ILocationPolicyManager\");\r\n if(!flag)\r\n i = 0;\r\n parcel.writeInt(i);\r\n if(location == null)\r\n break MISSING_BLOCK_LABEL_68;\r\n parcel.writeInt(1);\r\n location.writeToParcel(parcel, 0);\r\n_L1:\r\n mRemote.transact(16, parcel, null, 1);\r\n parcel.recycle();\r\n return;\r\n parcel.writeInt(0);\r\n goto _L1\r\n location;\r\n parcel.recycle();\r\n throw location;\r\n }\r\n\r\n public void setRestrictBackground(boolean flag)\r\n throws RemoteException\r\n {\r\n int i;\r\n Parcel parcel;\r\n Parcel parcel1;\r\n i = 0;\r\n parcel = Parcel.obtain();\r\n parcel1 = Parcel.obtain();\r\n parcel.writeInterfaceToken(\"android.location.ILocationPolicyManager\");\r\n if(flag)\r\n i = 1;\r\n parcel.writeInt(i);\r\n mRemote.transact(13, parcel, parcel1, 0);\r\n parcel1.readException();\r\n parcel1.recycle();\r\n parcel.recycle();\r\n return;\r\n Exception exception;\r\n exception;\r\n parcel1.recycle();\r\n parcel.recycle();\r\n throw exception;\r\n }\r\n\r\n public void setUidNavigationStart(int i)\r\n throws RemoteException\r\n {\r\n Parcel parcel;\r\n Parcel parcel1;\r\n parcel = Parcel.obtain();\r\n parcel1 = Parcel.obtain();\r\n parcel.writeInterfaceToken(\"android.location.ILocationPolicyManager\");\r\n parcel.writeInt(i);\r\n mRemote.transact(4, parcel, parcel1, 0);\r\n parcel1.readException();\r\n parcel1.recycle();\r\n parcel.recycle();\r\n return;\r\n Exception exception;\r\n exception;\r\n parcel1.recycle();\r\n parcel.recycle();\r\n throw exception;\r\n }\r\n\r\n public void setUidNavigationStop(int i)\r\n throws RemoteException\r\n {\r\n Parcel parcel;\r\n Parcel parcel1;\r\n parcel = Parcel.obtain();\r\n parcel1 = Parcel.obtain();\r\n parcel.writeInterfaceToken(\"android.location.ILocationPolicyManager\");\r\n parcel.writeInt(i);\r\n mRemote.transact(5, parcel, parcel1, 0);\r\n parcel1.readException();\r\n parcel1.recycle();\r\n parcel.recycle();\r\n return;\r\n Exception exception;\r\n exception;\r\n parcel1.recycle();\r\n parcel.recycle();\r\n throw exception;\r\n }\r\n\r\n public void setUidPolicy(int i, int j)\r\n throws RemoteException\r\n {\r\n Parcel parcel;\r\n Parcel parcel1;\r\n parcel = Parcel.obtain();\r\n parcel1 = Parcel.obtain();\r\n parcel.writeInterfaceToken(\"android.location.ILocationPolicyManager\");\r\n parcel.writeInt(i);\r\n parcel.writeInt(j);\r\n mRemote.transact(1, parcel, parcel1, 0);\r\n parcel1.readException();\r\n parcel1.recycle();\r\n parcel.recycle();\r\n return;\r\n Exception exception;\r\n exception;\r\n parcel1.recycle();\r\n parcel.recycle();\r\n throw exception;\r\n }\r\n\r\n public void unregisterListener(ILocationPolicyListener ilocationpolicylistener)\r\n throws RemoteException\r\n {\r\n IBinder ibinder;\r\n Parcel parcel;\r\n Parcel parcel1;\r\n ibinder = null;\r\n parcel = Parcel.obtain();\r\n parcel1 = Parcel.obtain();\r\n parcel.writeInterfaceToken(\"android.location.ILocationPolicyManager\");\r\n if(ilocationpolicylistener == null)\r\n break MISSING_BLOCK_LABEL_28;\r\n ibinder = ilocationpolicylistener.asBinder();\r\n parcel.writeStrongBinder(ibinder);\r\n mRemote.transact(10, parcel, parcel1, 0);\r\n parcel1.readException();\r\n parcel1.recycle();\r\n parcel.recycle();\r\n return;\r\n ilocationpolicylistener;\r\n parcel1.recycle();\r\n parcel.recycle();\r\n throw ilocationpolicylistener;\r\n }\r\n\r\n private IBinder mRemote;\r\n\r\n Stub.Proxy(IBinder ibinder)\r\n {\r\n mRemote = ibinder;\r\n }\r\n }\r\n\r\n\r\n public abstract boolean checkUidLocationOp(int i, int j)\r\n throws RemoteException;\r\n\r\n public abstract boolean checkUidNavigationScreenLock(int i)\r\n throws RemoteException;\r\n\r\n public abstract LocationPolicy[] getLocationPolicies()\r\n throws RemoteException;\r\n\r\n public abstract boolean getRestrictBackground()\r\n throws RemoteException;\r\n\r\n public abstract int getUidPolicy(int i)\r\n throws RemoteException;\r\n\r\n public abstract int[] getUidsWithPolicy(int i)\r\n throws RemoteException;\r\n\r\n public abstract boolean isUidForeground(int i)\r\n throws RemoteException;\r\n\r\n public abstract void registerListener(ILocationPolicyListener ilocationpolicylistener)\r\n throws RemoteException;\r\n\r\n public abstract void setFakeGpsFeatureOnState(boolean flag)\r\n throws RemoteException;\r\n\r\n public abstract void setLocationPolicies(LocationPolicy alocationpolicy[])\r\n throws RemoteException;\r\n\r\n public abstract void setPhoneStationary(boolean flag, Location location)\r\n throws RemoteException;\r\n\r\n public abstract void setRestrictBackground(boolean flag)\r\n throws RemoteException;\r\n\r\n public abstract void setUidNavigationStart(int i)\r\n throws RemoteException;\r\n\r\n public abstract void setUidNavigationStop(int i)\r\n throws RemoteException;\r\n\r\n public abstract void setUidPolicy(int i, int j)\r\n throws RemoteException;\r\n\r\n public abstract void unregisterListener(ILocationPolicyListener ilocationpolicylistener)\r\n throws RemoteException;\r\n}", "public void requestLocationPermision(){\n\n // Forma de actuar diferente si la versión del dispositivo en Marshmallow\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {\n Log.d(TAG, \"Versión 23\");\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n //Si no tenemos permiso, lo pedimos\n\n if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_FINE_LOCATION)) {\n // Show an expanation to the user *asynchronously* -- don't block\n // this thread waiting for the user's response! After the user\n // sees the explanation, try again to request the permission.\n Log.d(TAG, \"Show an expanation\");\n new AlertDialog.Builder(this)\n .setMessage(getString(R.string.show_explanation))\n .setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(new String[] {Manifest.permission.ACCESS_FINE_LOCATION},\n REQUEST_CODE_ASK_PERMISSIONS);\n }\n }\n })\n .create()\n .show();\n\n } else{\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, REQUEST_CODE_ASK_PERMISSIONS);\n }\n } else{\n Log.d(TAG, \"Tenemos permiso\");\n\n String provider = Settings.Secure.getString(getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED);\n if (!provider.contains(\"gps\")) {\n //Si el GPS no esta activo, pedimos su iniciación\n AlertNoGps();\n }\n\n //Inicializacion de los providers\n for (String s : locationManager.getAllProviders()) {\n int minDistance = 2;\n int checkInterval = 2;\n locationManager.requestLocationUpdates(s, checkInterval,\n minDistance, this);\n Location actualLocation = locationManager.getLastKnownLocation(s);\n //Comprobamos si es una mejor localización\n if (actualLocation!=null){\n if (isBetterLocation(actualLocation)){\n Log.d(TAG, \"Mejor localización -> \" + s + \" - \"+ actualLocation);\n bestLocation = actualLocation;\n }\n }\n }\n\n mMap.setMyLocationEnabled(true);\n setLocation();\n }\n } else{\n //Comprobacion de permisos\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n Log.d(TAG, \"Tenemos permiso\");\n\n String provider = Settings.Secure.getString(getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED);\n\n if (!provider.contains(\"gps\")) {\n //Si el GPS no esta activo, pedimos su iniciación\n AlertNoGps();\n }\n\n //Inicializacion de los providers\n for (String s : locationManager.getAllProviders()) {\n int minDistance = 2;\n int checkInterval = 2;\n locationManager.requestLocationUpdates(s, checkInterval,\n minDistance, this);\n Location actualLocation = locationManager.getLastKnownLocation(s);\n if (actualLocation!=null){\n if (isBetterLocation(actualLocation)){\n Log.d(TAG, \"Mejor localización -> \" + s + \" - \"+ actualLocation);\n bestLocation = actualLocation;\n }\n }\n }\n\n mMap.setMyLocationEnabled(true);\n setLocation();\n }\n }\n\n }", "private void getLocation() { \n LocationManager locationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE); \n Criteria criteria = new Criteria(); \n criteria.setAccuracy(Criteria.ACCURACY_FINE); \n criteria.setAltitudeRequired(false); \n criteria.setBearingRequired(false); \n criteria.setCostAllowed(true);\n criteria.setPowerRequirement(Criteria.POWER_LOW); \n String provider = locationManager.getBestProvider(criteria,true); \n \n //In order to make sure the device is getting location, request updates. locationManager.requestLocationUpdates(provider, 1, 0, this); \n mostRecentLocation = locationManager.getLastKnownLocation(provider); \n }", "@Override\n public boolean onMyLocationButtonClick() {\n LocationManager manager = (LocationManager) getContext().getSystemService(Context.LOCATION_SERVICE);\n if (!manager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {\n // If Location disable create a alert dialog\n AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getContext());\n alertDialogBuilder.setMessage(\"Location is disabled in your device. Would you like to enable it?\")\n // Have to respond to this message not cancelable\n .setCancelable(false)\n // If yes open setting page to enable location\n .setPositiveButton(\"Yes\",\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // intent calls the android activity of location settings\n Intent callGPSSettingIntent = new Intent(\n android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);\n startActivity(callGPSSettingIntent);\n }\n });\n //if no close the dialog\n alertDialogBuilder.setNegativeButton(\"Maybe Later\",\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n dialog.cancel();\n }\n });\n AlertDialog alert = alertDialogBuilder.create();\n alert.show();\n }\n\n return false;\n }", "@Override\n public void onGeolocationPermissionsShowPrompt(String origin,\n GeolocationPermissions.Callback callback) {\n String perm = Manifest.permission.ACCESS_FINE_LOCATION;\n if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M ||\n ContextCompat.checkSelfPermission(Main2Activity.this, perm) == PackageManager.PERMISSION_GRANTED) {\n // we're on SDK < 23 OR user has already granted permission\n callback.invoke(origin, true, false);\n } else {\n if (!ActivityCompat.shouldShowRequestPermissionRationale(Main2Activity.this, perm)) {\n // ask the user for permission\n ActivityCompat.requestPermissions(Main2Activity.this, new String[]{perm}, REQUEST_FINE_LOCATION);\n\n // we will use these when user responds\n mGeolocationOrigin = origin;\n mGeolocationCallback = callback;\n }\n }\n }", "@Override\n public void onRequestPermissionsResult(int requestCode,\n @NonNull String[] permissions,\n @NonNull int[] grantResults) {\n switch (requestCode) {\n case REQUEST_LOCATION_PERMISSION:\n // If the permission is granted, get the location,\n // otherwise, write a message to the log\n if (grantResults.length > 0\n && grantResults[0] == PackageManager.PERMISSION_GRANTED) {\n getLocation();\n } else {\n Log.d(\"HackCMU19\", \"location permission denied\");\n }\n break;\n }\n }", "private void getLocationPermission() {\n /*\n * Request location permission, so that we can get the location of the\n * device. The result of the permission request is handled by a callback,\n * onRequestPermissionsResult.\n */\n Log.d(TAG, \"Permission Result\");\n String[] permissions = {ACCESS_FINE_LOCATION,\n ACCESS_COURSE_LOCATION};\n\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n ACCESS_FINE_LOCATION) == PERMISSION_GRANTED) {\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n ACCESS_COURSE_LOCATION) == PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(this,\n permissions,\n LOCATION_PERMISSION_REQUEST_CODE);}\n } else{\n ActivityCompat.requestPermissions(this,\n permissions,\n LOCATION_PERMISSION_REQUEST_CODE);\n }\n }", "private void setLocationUpdateFunction() {\n fabLocation.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n //create boolean isGPSEnabled equal to result returned from isProviderEnabled() method, sending locationManager.GPS_PROVIDER as paremeter\n boolean isGPSEnabled = locationManager.isProviderEnabled(locationManager.GPS_PROVIDER);\n //create boolean isNetworkEnabled equal to result returned from isProviderEnabled() method, sending locationManager.NETWORK_PROVIDER as paremeter\n boolean isNetworkEnabled = locationManager.isProviderEnabled(locationManager.NETWORK_PROVIDER);\n\n //if statement to determine if both booleans are false\n if (!isGPSEnabled && !isNetworkEnabled && ActivityCompat.checkSelfPermission(MainActivity.this, Manifest.permission_group.LOCATION) != PackageManager.PERMISSION_GRANTED) {\n //toast message to tell the user that network and location are not available/enabled\n Toast.makeText(MainActivity.this, \"Network and Location not Available\", Toast.LENGTH_LONG).show();\n return;\n } else {\n //create Criteria object critera\n Criteria criteria = new Criteria();\n\n //string provider equal to value returned from method\n String provider = locationManager.getBestProvider(criteria, true);\n\n fabLocation.setClickable(false);\n\n //call locationupdater\n locationManager.requestLocationUpdates(provider, 0, 0, locationListener);\n }\n }\n });\n }", "private void askPermissionsAndShowMyLocation() {\n boolean isGPSEnabled = false;\n // flag for network status\n boolean isNetworkEnabled = false;\n // flag for GPS status\n boolean canGetLocation = false;\n LocationManager locationManager;\n\n locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);\n\n // getting GPS status\n isGPSEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);\n\n // getting network status\n isNetworkEnabled = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);\n if (Build.VERSION.SDK_INT >= 23) {\n // flag for GPS status\n if (!isGPSEnabled && !isNetworkEnabled) {\n// no network provider is enabled\n final Intent data = new Intent();\n data.putExtra(\"latitude\", latitude);\n data.putExtra(\"longitude\", longitude);\n\n setResult(Activity.RESULT_CANCELED, data);\n finish();\n } else {\n// if (accessCoarsePermission != PackageManager.PERMISSION_GRANTED\n// || accessFinePermission != PackageManager.PERMISSION_GRANTED)\n\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&\n ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // The Permissions to ask user.\n String[] permissions = new String[]{Manifest.permission.ACCESS_COARSE_LOCATION,\n Manifest.permission.ACCESS_FINE_LOCATION};\n // Show a dialog asking the user to allow the above permissions.\n ActivityCompat.requestPermissions(this, permissions,\n REQUEST_ID_ACCESS_COURSE_FINE_LOCATION);\n\n return;\n }\n this.showMyLocation();\n }\n\n } else {\n if (!isGPSEnabled && !isNetworkEnabled) {\n// no network provider is enabled\n final Intent data = new Intent();\n data.putExtra(\"latitude\", latitude);\n data.putExtra(\"longitude\", longitude);\n\n setResult(Activity.RESULT_CANCELED, data);\n finish();\n } else {\n this.showMyLocation();\n }\n\n\n }\n // Show current location on Map.\n }", "private void getLocation() {\n\n }", "@Override\n public void onMyLocationClick(@NonNull Location location) {\n }", "private void getLocation() {\n //if you don't have permission for location services yet, ask\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this, new String[]\n {Manifest.permission.ACCESS_FINE_LOCATION},\n REQUEST_LOCATION_PERMISSION);\n //have the app ask for location permission\n } else {\n fusedLocationClient.requestLocationUpdates\n (getLocationRequest(), mLocationCallback,\n null /* Looper */);\n //uses the type of request and the location callback to update the location\n /**fusedLocationClient.getLastLocation().addOnSuccessListener(\n new OnSuccessListener<Location>() {\n @Override\n public void onSuccess(Location location) {\n TextView error = findViewById(R.id.errorMsg);\n error.setVisibility(View.VISIBLE);\n\n if (location != null) {\n lastLocation = location;\n error.setText(\"location: \" + lastLocation.getLatitude());\n } else {\n error.setText(\"location not available\");\n }\n }\n });**/\n }\n }", "@Override\n public void onReceiveLocation(BDLocation location) {\n }", "@Override\n public void onFailure(Exception e) {\n int statusCode = ((ApiException) e).getStatusCode();\n switch (statusCode) {\n case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:\n try {\n ResolvableApiException rae = (ResolvableApiException) e;\n Toast.makeText(MainActivity.this, \"Location Setting Incorrect\", LENGTH_SHORT).show();\n // Call startResolutionForResult to display a pop-up asking the user to enable related permission.\n rae.startResolutionForResult(MainActivity.this, 0);\n } catch (IntentSender.SendIntentException sie) {\n Toast.makeText(MainActivity.this, (CharSequence) sie, LENGTH_SHORT).show();\n }\n break;\n default:\n break;\n }\n }", "@Override\n public void onLocationChanged(Location location) {\n }", "@Override\n public void onLocationChanged(Location location) {\n\n }", "@Override\n public void onLocationChanged(Location location) {\n\n }", "public void getLocationPermission() {\n if (!isPermissionGranted())\n // get the location permission from user\n // this will prompt user a dialog to give the location permission\n requestPermissionLauncher.launch(Manifest.permission.ACCESS_FINE_LOCATION);\n /*ActivityCompat.requestPermissions(activity,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);*/\n }", "private synchronized void initLocation() {\n if (locationManager == null) {\n LocationManager manager =\n (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);\n\n Criteria criteriaCoarse = new Criteria();\n /* \"Coarse\" accuracy means \"no need to use GPS\".\n * Typically a gShots phone would be located in a building,\n * and GPS may not be able to acquire a location.\n * We only care about the location to determine the country,\n * so we don't need a super accurate location, cell/wifi is good enough.\n */\n criteriaCoarse.setAccuracy(Criteria.ACCURACY_COARSE);\n criteriaCoarse.setPowerRequirement(Criteria.POWER_LOW);\n String providerName =\n manager.getBestProvider(criteriaCoarse, /*enabledOnly=*/true);\n \n \n List<String> providers = manager.getAllProviders();\n for (String providerNameIter : providers) {\n try {\n LocationProvider provider = manager.getProvider(providerNameIter);\n } catch (SecurityException se) {\n // Not allowed to use this provider\n Logger.w(\"Unable to use provider \" + providerNameIter);\n continue;\n }\n Logger.i(providerNameIter + \": \" +\n (manager.isProviderEnabled(providerNameIter) ? \"enabled\" : \"disabled\"));\n }\n\n /* Make sure the provider updates its location.\n * Without this, we may get a very old location, even a\n * device powercycle may not update it.\n * {@see android.location.LocationManager.getLastKnownLocation}.\n */\n manager.requestLocationUpdates(providerName,\n /*minTime=*/0,\n /*minDistance=*/0,\n new LoggingLocationListener(),\n Looper.getMainLooper());\n locationManager = manager;\n locationProviderName = providerName;\n }\n assert locationManager != null;\n assert locationProviderName != null;\n }", "@SuppressLint(\"MissingPermission\")\n private void configureLocation() {\n\n locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 1000, 1, (android.location.LocationListener) locationListener);\n location = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);\n Toast.makeText(getApplicationContext(), \"net acquired\", Toast.LENGTH_LONG).show();\n }", "@Override\n \tpublic void onGeolocationPermissionsShowPrompt(String origin,Callback callback) {\n\t \tsuper.onGeolocationPermissionsShowPrompt(origin, callback);\n\t \tcallback.invoke(origin, true, false);\n \t}", "private void getLocationPermission() {\n if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n //request location permission\n ActivityCompat.requestPermissions(this, new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION\n }, LOCATION_REQUEST_CODE);\n }\n fetchLastLocation();\n }", "@Override\r\n public void activate(OnLocationChangedListener arg0) {\n mChangedListener = arg0;\r\n int err = locationManager.requestLocationUpdates(locationRequest, this);\r\n switch (err) {\r\n case 1:\r\n setTitle(\"设备缺少使用腾讯定位服务需要的基本条件\");\r\n break;\r\n case 2:\r\n setTitle(\"manifest 中配置的 key 不正确\");\r\n break;\r\n case 3:\r\n setTitle(\"自动加载libtencentloc.so失败\");\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n }", "@Override\n public void onLocationChanged(Location location) {\n }", "private void setupLocation() {\n\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&\n ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n\n // Permission is not granted.\n if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_FINE_LOCATION) &&\n ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_COARSE_LOCATION)) {\n\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION},\n LOCATION_PERMISSION_REQUEST);\n } else {\n // Request the permission\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION},\n LOCATION_PERMISSION_REQUEST);\n }\n } else {\n // Permission has already been granted\n }\n }", "public void requestLocation() {\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) !=\n PackageManager.PERMISSION_GRANTED) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION,\n Manifest.permission.INTERNET}, 12);\n }\n return;\n }\n //this line updates location\n mMap.setMyLocationEnabled(true);\n providerClient.requestLocationUpdates(locationRequest, locationCallback, getMainLooper());\n }", "@Override\n public void onLocationChanged( final Location location ) {\n if (location!=null) {\n // sore last location as member, in case it is needed somewhere (in e.g. your adjusted project)\n MainActivity.this.lastKnownLocaton = location;\n if ( MainActivity.this.architectView != null ) {\n // check if location has altitude at certain accuracy level & call right architect method (the one with altitude information)\n if ( location.hasAltitude() && location.hasAccuracy() && location.getAccuracy()<7) {\n MainActivity.this.architectView.setLocation( location.getLatitude(), location.getLongitude(), location.getAltitude(), location.getAccuracy() );\n } else {\n MainActivity.this.architectView.setLocation( location.getLatitude(), location.getLongitude(), location.hasAccuracy() ? location.getAccuracy() : 1000 );\n }\n }\n }\n }", "@SuppressLint(\"MissingPermission\")\n @AfterPermissionGranted(PERMISSION_LOCATION_ID)\n private void getCurrentLocation() {\n Task<Location> task = fusedLocationProviderClient.getLastLocation();\n task.addOnSuccessListener(new OnSuccessListener<Location>() {\n @Override\n public void onSuccess(Location location) {\n if(location != null) {\n currentLat = location.getLatitude();\n currentLong = location.getLongitude();\n\n String placeType = \"museum\";\n\n int radius = ProfileFragment.getRadius();\n\n String url = \"https://maps.googleapis.com/maps/api/place/nearbysearch/json\" +\n \"?location=\" + currentLat + \",\" + currentLong +\n \"&radius=\" + radius +\n \"&type=\" + placeType +\n \"&key=\" + getResources().getString(R.string.maps_api_key);\n\n new NearbyMuseumTask().execute(url);\n\n mapFragment.getMapAsync(new OnMapReadyCallback() {\n @Override\n public void onMapReady(GoogleMap googleMap) {\n map = googleMap;\n setMapUISettings();\n\n map.animateCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(currentLat,currentLong), 12\n ));\n }\n });\n }\n }\n });\n }", "private void getLocation() {\n if(ContextCompat.checkSelfPermission(this,Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED){\n if(ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_FINE_LOCATION)){\n new AlertDialog.Builder(this)\n .setTitle(\"Location Permission Required\")\n .setMessage(\"This app needs permission to use your location\")\n .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n ActivityCompat.requestPermissions(RestaurantsActivity.this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n MY_PERMISSIONS_LOCATIONS);\n }\n })\n .create()\n .show();\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n MY_PERMISSIONS_LOCATIONS);\n }\n }\n }", "private void askForLocationPermission() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n //this code will be executed on devices running on DONUT (NOT ICS) or later\n askForPermission(Manifest.permission.ACCESS_FINE_LOCATION, Extra.LOCATION);\n }\n }", "private void locationPermission() {\n if(Build.VERSION.SDK_INT<23){\n locationPermission = true;\n startService(new Intent(this, LocationService.class));\n }else{\n if(checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED\n && checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED){\n locationPermission = true;\n startService(new Intent(this, LocationService.class));\n return;\n }\n\n if(shouldShowRequestPermissionRationale(Manifest.permission.ACCESS_COARSE_LOCATION) && shouldShowRequestPermissionRationale(Manifest.permission.ACCESS_FINE_LOCATION)){\n Snackbar.make(drawer,\"Location access is required to show your friend and questions on map.\",Snackbar.LENGTH_INDEFINITE)\n .setAction(\"OK\", new View.OnClickListener() {\n @TargetApi(Build.VERSION_CODES.M)\n @Override\n public void onClick(View v) {\n requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION,Manifest.permission.ACCESS_COARSE_LOCATION},LOCATION_PERMISSION_CODE);\n }\n })\n .show();\n }else{\n requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION,Manifest.permission.ACCESS_COARSE_LOCATION},LOCATION_PERMISSION_CODE);\n }\n }\n }", "private void initLocation() {\n BaiduLocationHolder.OPTION.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);\n //可选,默认高精度,设置定位模式,高精度,低功耗,仅设备\n\n BaiduLocationHolder.OPTION.setCoorType(\"bd09ll\");\n //可选,默认gcj02,设置返回的定位结果坐标系\n\n int span = 1000;\n BaiduLocationHolder.OPTION.setScanSpan(span);\n //可选,默认0,即仅定位一次,设置发起定位请求的间隔需要大于等于1000ms才是有效的\n\n BaiduLocationHolder.OPTION.setIsNeedAddress(true);\n //可选,设置是否需要地址信息,默认不需要\n\n BaiduLocationHolder.OPTION.setOpenGps(true);\n //可选,默认false,设置是否使用gps\n\n BaiduLocationHolder.OPTION.setLocationNotify(true);\n //可选,默认false,设置是否当GPS有效时按照1S/1次频率输出GPS结果\n\n BaiduLocationHolder.OPTION.setIsNeedLocationDescribe(true);\n //可选,默认false,设置是否需要位置语义化结果,可以在BDLocation.getLocationDescribe里得到,结果类似于“在北京天安门附近”\n\n BaiduLocationHolder.OPTION.setIsNeedLocationPoiList(true);\n //可选,默认false,设置是否需要POI结果,可以在BDLocation.getPoiList里得到\n\n BaiduLocationHolder.OPTION.setIgnoreKillProcess(false);\n //可选,默认true,定位SDK内部是一个SERVICE,并放到了独立进程,设置是否在stop的时候杀死这个进程,默认不杀死\n\n BaiduLocationHolder.OPTION.SetIgnoreCacheException(false);\n //可选,默认false,设置是否收集CRASH信息,默认收集\n\n BaiduLocationHolder.OPTION.setEnableSimulateGps(false);\n //可选,默认false,设置是否需要过滤GPS仿真结果,默认需要\n\n// BaiduLocationHolder.OPTION.setWifiValidTime(5*60*1000);\n //可选,7.2版本新增能力,如果您设置了这个接口,首次启动定位时,会先判断当前WiFi是否超出有效期,超出有效期的话,会先重新扫描WiFi,然后再定位\n\n BaiduLocationHolder.CLIENT.setLocOption(BaiduLocationHolder.OPTION);\n }", "@Override\n\tpublic void onLocationChanged(android.location.Location arg0) {\n\t\t\n\t}", "private void getDeviceLocation() {\n /*\n * Get the best and most recent location of the device, which may be null in rare\n * cases when a location is not available.\n */\n mFusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(this);\n try {\n if (mLocationPermissionGranted){\n Task location = mFusedLocationProviderClient.getLastLocation();\n location.addOnCompleteListener(new OnCompleteListener() {\n @Override\n public void onComplete(@NonNull Task task) {\n if (task.isSuccessful()){\n Location currentLocation = (Location) task.getResult();\n if (currentLocation != null){\n\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(currentLocation.getLatitude(),currentLocation.getLongitude()), DEFAULT_ZOOM));\n\n } else {\n /*\n AlertDialog alertDialog = new AlertDialog.Builder(MapActivity.this).create();s\n alertDialog.setMessage(\"Activa ubicación\");\n alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, \"OK\",\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n }\n });\n alertDialog.show();\n */\n Toast.makeText(MapActivity.this, \"Tu ubicación es nula\", Toast.LENGTH_SHORT).show();\n }\n } else Toast.makeText(MapActivity.this, \"Error al obtener la ubicación\", Toast.LENGTH_LONG).show();\n }\n });\n }else Toast.makeText(MapActivity.this, \"Da permiso para acceder a la ubicación\", Toast.LENGTH_LONG).show();\n } catch (SecurityException e){\n Toast.makeText(MapActivity.this, \"Seleciona un punto en el mapa primero\", Toast.LENGTH_LONG).show();\n }\n }", "@Override\n public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,@NonNull int[] grantResults) {\n if (requestCode != PermissionUtils.REQUEST_CODE) {\n return;\n }\n if (PermissionUtils.isPermissionGranted(new String[]{\n Manifest.permission.ACCESS_FINE_LOCATION}, grantResults)) {\n //If you have permission, go to the code to get the location value\n initGoogleMapLocation();\n } else {\n Toast.makeText(this, \"Stop apps without permission to use location information\", Toast.LENGTH_SHORT).show();\n //finish();\n }\n }", "@Override\n\t\tpublic void onLocationChanged(Location location) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void onLocationChanged(Location location) {\n\t\t\t\n\t\t}", "public Location myLocation() {\n\n // Acquire a reference to the system Location Manager\n LocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);\n Criteria criteria = new Criteria();\n criteria.setHorizontalAccuracy(Criteria.ACCURACY_FINE);\n String provider = locationManager.getBestProvider(criteria, true);\n // Define a listener that responds to location updates\n LocationListener locationListener = new LocationListener() {\n\n //When the location of the device changes\n public void onLocationChanged(Location location) {\n\n //Display the current location\n double latitude = location.getLatitude();\n double longitude = location.getLongitude();\n MapProjection mapProjection = MapProjection.getDefault();\n GridPoint gp = mapProjection.toGridPoint(latitude,longitude);\n mGPSon.setText(\"Latitude: \"+Math.round(gp.x)+\"\\nLongitude: \"+Math.round(gp.y));\n\n }\n\n //When the status of the GNSS receiver changes\n public void onStatusChanged(String provider, int status, Bundle extras) {\n\n\n\n }\n\n //When the location provider is enabled\n public void onProviderEnabled(String provider) {\n\n\n\n }\n\n //When the location provider is disabled\n public void onProviderDisabled(String provider) {\n\n\n\n }\n\n };\n // Register the listener with the Location Manager to receive location updates\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,0,0,locationListener);\n // Obtain the current location\n Location myLocation = locationManager.getLastKnownLocation(provider);\n\n //Only if the current location is passed\n if (myLocation != null) {\n\n //Project the Location object to a GridPoint object\n double latitude = myLocation.getLatitude();\n double longitude = myLocation.getLongitude();\n MapProjection mapProjection = MapProjection.getDefault();\n GridPoint gp = mapProjection.toGridPoint(latitude, longitude);\n //Update the real-time latitude and longitude\n mGPSon.setText(\"Latitude: \" + Math.round(gp.x) + \"\\nLongitude: \" + Math.round(gp.y));\n return myLocation;\n\n } else {\n\n //If GPS is off, notify the user to turn it on\n Toast.makeText(MainActivity.this,\"Turn on GPS.\",Toast.LENGTH_SHORT).show();\n return null;\n\n }\n\n }", "@Override\n public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {\n super.onRequestPermissionsResult(requestCode, permissions, grantResults);\n switch (requestCode) {\n case 1:\n if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {\n if (ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n mMap.setMyLocationEnabled(true);\n }\n\n } else {\n Toast.makeText(getContext(), \"This app needs location permission to be granted!,\",\n Toast.LENGTH_LONG).show();\n getActivity().finish();\n }\n break;\n }\n }", "void onNewLocationRecieved(LocationWrapper locationWrapper, LocationType type);", "@Override\n public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {\n Log.d(TAG, \"onRequestPermissionsResult()\");\n super.onRequestPermissionsResult(requestCode, permissions, grantResults);\n if (requestCode == REQ_PERMISSION) {\n if (grantResults.length > 0\n && grantResults[0] == PackageManager.PERMISSION_GRANTED) {\n // Permission granted\n getLastKnownLocation();\n\n } else {\n // Permission denied\n permissionsDenied();\n }\n }\n }", "private void showMyLocation() {\n\n LocationManager locationManager = (LocationManager) activity.getSystemService(LOCATION_SERVICE);\n\n String locationProvider = this.getEnabledLocationProvider();\n\n if (locationProvider == null) {\n return;\n }\n\n // Millisecond\n final long MIN_TIME_BW_UPDATES = 1000;\n // Met\n final float MIN_DISTANCE_CHANGE_FOR_UPDATES = 1;\n\n Location myLocation = null;\n try {\n // This code need permissions (Asked above ***)\n\n /* locationManager.requestLocationUpdates(\n locationProvider,\n MIN_TIME_BW_UPDATES,\n MIN_DISTANCE_CHANGE_FOR_UPDATES, (android.location.LocationListener) this); */\n\n\n // Getting Location.\n myLocation = locationManager\n .getLastKnownLocation(locationProvider);\n }\n // With Android API >= 23, need to catch SecurityException.\n catch (SecurityException e) {\n\n Log.e(\"ActivityTackeSegment\", \"Show My Location Error:\" + e.getMessage());\n e.printStackTrace();\n return;\n }\n\n if (myLocation != null) {\n\n// // Add a marker in Sydney and move the camera\n// LatLng sydney = new LatLng(-34, 151);\n// myMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\"));\n// myMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n// Toast.makeText(getActivity(),\"Je suis a Sydney\",Toast.LENGTH_SHORT);\n\n\n LatLng latLng = new LatLng(myLocation.getLatitude(), myLocation.getLongitude());\n // LatLng latLng = new LatLng(-34, 151);\n //myMap.addMarker(new MarkerOptions().position(latLng).title(\"Marker in Sydney\"));\n // myMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, 14));\n\n CameraPosition cameraPosition = new CameraPosition.Builder()\n .target(latLng) // Sets the center of the map to location user\n .zoom(currentZoom) // Sets the zoom\n .bearing(0) // Sets the orientation of the camera to east\n .tilt(40) // Sets the tilt of the camera to 30 degrees\n .build(); // Creates a CameraPosition from the builder\n myMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));\n\n /*\n // Add Marker to Map\n MarkerOptions option = new MarkerOptions();\n option.title(\"My Location\");\n option.snippet(\"....\");\n option.position(latLng);\n Marker currentMarker = myMap.addMarker(option);\n currentMarker.showInfoWindow();\n */\n } else {\n\n Log.i(\"ActivityTrackerFragment\", \"Location not found\");\n }\n\n }", "@Override\r\n\tpublic void onLocationChanged(Location location) {\n\t if(location!=null){\r\n\t //Toast.makeText(mContext,\"Location provider = \"+location.getProvider(), Toast.LENGTH_SHORT).show();\r\n if (LocationManager.GPS_PROVIDER.equals(location.getProvider())) {\r\n double [] latlng =Common.adjustLatLng(location.getLatitude(), location.getLongitude());\r\n location.setLatitude(latlng[0]);\r\n location.setLongitude(latlng[1]);\r\n Common.saveLocation(location);\r\n super.onLocationChanged(location);\r\n }else if(\"lbs\".equals(location.getProvider())){\r\n Common.saveLocation(location);\r\n super.onLocationChanged(location);\r\n }\r\n\t }\r\n\t}", "@Override\n public void onExplanationNeeded(List <String> permissionsToExplain) {\n Toast.makeText(this, \"You have to enable location on your device to use the map navigation\", Toast.LENGTH_LONG).show();\n }", "private void getLocationPermission(){\n if(ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED){\n locationAccess = true;\n } else {\n locationAccess = false;\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, REQUEST_LOCATION_PERMISSION);\n }\n }", "@Override\n public void onSuccess(Location location) {\n Log.e(\"onRequestPermissions\", \"Success\");\n if (location != null) {\n wayLatitude = location.getLatitude();\n wayLongitude = location.getLongitude();\n Log.e(\"getLocation\", String.valueOf(wayLongitude));\n }\n }", "public interface IMapPresenterActivityCallback {\n\n public static enum LocationType{\n currentLocation,\n searchedLocation\n }\n\n /**\n * Notify the presenter that activity is ready\n * */\n void onActivityReady();\n\n\n /**\n * Notify the presenter about new coordinates that were received*/\n\n void onNewLocationRecieved(LocationWrapper locationWrapper, LocationType type);\n}", "@Override\n public void onProviderDisabled(String provider) {\n Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);\n startActivity(intent);\n }", "@Override\n \t\t\tpublic void onLocationChanged(Location loc) {\n \t \n \t\t\t}", "@Override\n\tpublic void onLocationChanged(Location loc)\n\t{\n\t}", "private Location getLocation() {\n try {\n locationManager = (LocationManager) getContext().getSystemService(Context.LOCATION_SERVICE);\n\n isGPSEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);\n\n isNetworkEnabled = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);\n\n\n if (!isGPSEnabled && !isNetworkEnabled) {\n\n } else {\n this.canGetLocation = true;\n\n if (isNetworkEnabled) {\n\n if (ActivityCompat.checkSelfPermission(getActivity(), android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getActivity(), android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n Log.d(TAG, \"nagy nulla\");\n return null;\n }\n locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 60000, 3, locationListener);\n\n if (locationManager != null){\n location = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);\n if (location != null){\n latitude = location.getLatitude();\n longitude = location.getLongitude();\n }\n }\n }\n\n if (isGPSEnabled){\n if (location == null){\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 60000, 3, locationListener);\n if (locationManager != null){\n location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n if (location != null){\n latitude = location.getLatitude();\n longitude = location.getLongitude();\n }\n }\n }\n } else {\n //showAlertDialog();\n }\n }\n }catch(Exception e){\n e.printStackTrace();\n }\n return location;\n }", "@Override\n public String getLocation() {\n return location;\n }", "private void inputLocation() {\n// boolean googleMapExist= (ConnectionResult.SUCCESS==GooglePlayServicesUtil.isGooglePlayServicesAvailable(mContext));\n//\n// if(googleMapExist) {\n// org.wowtalk.Log.w(\"google map exist\");\n// Intent mapIntent = new Intent(mContext, PickLocActivity.class);\n// mapIntent.putExtra(\"auto_loc\", true);\n// mContext.startActivityForResult(mapIntent, REQ_INPUT_LOC);\n// } else {\n //org.wowtalk.Log.w(\"google map not exist\");\n Intent mapIntent = new Intent(mContext, PickLocActivityWithAMap.class);\n mapIntent.putExtra(\"auto_loc\", true);\n mContext.startActivityForResult(mapIntent, REQ_INPUT_LOC);\n //}\n }", "private void getDeviceLocation(){\n\n Log.d(TAG, \"getDeviceLocation: getting device current location\");\n mFusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(this);\n try{\n if(mLocationPermissionGaranted){\n\n final Task location = mFusedLocationProviderClient.getLastLocation();\n location.addOnCompleteListener(task -> {\n if(task.isSuccessful()){\n Log.d(TAG, \"onComplete: found location!\");\n Location currentLocation = (Location) task.getResult();\n System.out.println(currentLocation);\n if (currentLocation !=null) {\n if (numDispositivo==1) {\n disp_Lat1 = Double.toString(currentLocation.getLatitude());\n disp_Long1 = Double.toString(currentLocation.getLongitude());\n }\n if (numDispositivo==2) {\n disp_Lat2 = Double.toString(currentLocation.getLatitude());\n disp_Long2 = Double.toString(currentLocation.getLongitude());\n }\n }\n System.out.println(disp_Lat1+\"-\"+disp_Long1);\n System.out.println(disp_Lat2+\"-\"+disp_Long2);\n Guardar();\n\n }else{\n Log.d(TAG, \"onComplete: current location is null\");\n Toast.makeText(FormularioCurso.this, \"unable to get current location\", Toast.LENGTH_SHORT).show();\n }\n });\n }\n }catch (SecurityException e){\n Log.e(TAG, \"getDeviceLocation: SecurityException: \" + e.getMessage() );\n }\n }", "@ExpoMethod\n public void getLastKnownPositionAsync(final Map<String, Object> options, final Promise promise) {\n // Check for permissions\n if (isMissingForegroundPermissions()) {\n promise.reject(new LocationUnauthorizedException());\n return;\n }\n getLastKnownLocation(location -> {\n if (LocationHelpers.isLocationValid(location, options)) {\n promise.resolve(LocationHelpers.locationToBundle(location, Bundle.class));\n } else {\n promise.resolve(null);\n }\n });\n }", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n Toast.makeText(getContext(), \"location: \" + location, Toast.LENGTH_LONG).show();\n EventBus.getDefault().post(new LocationEvent(location));\n }\n }", "@Override\n public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {\n switch (requestCode) {\n case LOCATION_REQUEST_CODE:\n // If request is denied, the result arrays are empty.\n if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {\n //Permission Granted\n fetchLastLocation();\n } else {\n AlertDialog alertDialog = new AlertDialog.Builder(MapsActivity.this).create();\n alertDialog.setTitle(\" Location Permission Denied!\");\n alertDialog.setMessage(\"\\nDefault Birmingham Location Used:\\n New Street Train Station\");\n alertDialog.setButton(AlertDialog.BUTTON_POSITIVE, \"OK\",\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n }\n });\n alertDialog.show();\n //Set default current location of New Street\n Location defaultLocation = new Location(\"LocationManager.GPS_PROVIDER\");\n defaultLocation.setLatitude(52.478060);\n defaultLocation.setLongitude(-1.898493);\n currentLocation = defaultLocation;\n supportMapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.fragment_content);\n supportMapFragment.getMapAsync(MapsActivity.this);\n break;\n }\n }\n }", "@Override\n public void onLocationAvailability(LocationAvailability availability) {\n }", "private void getLocationPermission(){\n Log.d(TAG, \"getLocationPermission: getting location permission.\");\n String[] permissions = {Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION};\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n FINE_LOCATION)== PackageManager.PERMISSION_GRANTED){\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n COURSE_LOCATION)== PackageManager.PERMISSION_GRANTED){\n mLocationPermissionGaranted = true;\n getDeviceLocation();\n }else{\n ActivityCompat.requestPermissions(this, permissions, LOCATION_PERMISSION_REQUEST_CODE);\n }\n }else{\n ActivityCompat.requestPermissions(this, permissions, LOCATION_PERMISSION_REQUEST_CODE);\n }\n }", "public void getDeviceLocation() {\n try {\n if (locationPermissionGranted) {\n Task<Location> locationResult = fusedLocationProviderClient.getLastLocation();\n locationResult.addOnCompleteListener(getActivity(), new OnCompleteListener<Location>() {\n @Override\n public void onComplete(@NonNull Task<Location> task) {\n if (task.isSuccessful()) {\n // Set the map's camera position to the current location of the device.\n lastKnownLocation = task.getResult();\n\n if (lastKnownLocation != null) {\n if (checkInLACounty(lastKnownLocation) != -1) {\n // geofenceHelper(getContext());\n lastKnownLocationInLA = true;\n sharedViewModel.setCountyData(\"Los Angeles County\");\n backLA.setVisibility(View.INVISIBLE);\n } else if (lastKnownLocationInLA) {\n lastKnownLocationInLA = false;\n sharedViewModel.setCountyData(\"Not in Los Angeles County\");\n\n backLA.setVisibility(View.VISIBLE);\n\n AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getContext());\n alertDialogBuilder.setTitle(\"Friendly Warning\");\n alertDialogBuilder.setMessage(\"Out of Los Angeles County \\n(Current Service Area)\");\n AlertDialog alertDialog = alertDialogBuilder.create();\n alertDialog.show(); // Show Dialog\n }\n } else {\n sharedViewModel.setCountyData(\"Los Angeles County\");\n }\n\n } else {\n Log.d(TAG, \"Current location is null. Using defaults.\");\n Log.e(TAG, \"Exception: %s\", task.getException());\n map.moveCamera(CameraUpdateFactory\n .newLatLngZoom(defaultLocation, DEFAULT_ZOOM));\n map.getUiSettings().setMyLocationButtonEnabled(false);\n }\n }\n });\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage(), e);\n }\n }", "private void locationManager()\n\t{\n mMap.setMyLocationEnabled(true);\n\n // Getting LocationManager object from System Service LOCATION_SERVICE\n LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);\n\n // Creating a criteria object to retrieve provider\n Criteria criteria = new Criteria();\n\n // Getting the name of the best provider\n String provider = locationManager.getBestProvider(criteria, true);\n\n // Getting Current Location\n Location location = locationManager.getLastKnownLocation(provider);\n\n if(location!=null){\n onLocationChanged(location);\n }\n locationManager.requestLocationUpdates(provider, 20000, 0, this);\n\t\t\n\t}", "@SuppressLint(\"MissingPermission\")\n private void doStuff() {\n LocationManager locationManager = (LocationManager) getApplicationContext().getSystemService(Context.LOCATION_SERVICE);\n if (locationManager != null) {\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, (LocationListener) this);\n }\n\n }", "@Override\n public void\n onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {\n super.onRequestPermissionsResult(requestCode, permissions, grantResults);\n\n if (requestCode == PERMISSION_ID) {\n if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {\n getLastLocation1();\n }\n }\n }", "private void getDeviceLocation() {\n try {\n if (mLocationPermissionGranted) {\n Task<Location> locationResult = mFusedLocationProviderClient.getLastLocation();\n locationResult.addOnCompleteListener(getActivity(), new OnCompleteListener() {\n @Override\n public void onComplete(@NonNull Task task) {\n if (task.isSuccessful()) {\n // Set the map's camera position to the current location of the device.\n mLastKnownLocation = (Location) task.getResult();\n if (mLastKnownLocation != null) {\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()), DEFAULT_ZOOM));\n\n\n }\n\n } else {\n Log.d(TAG, \"Current location is null. Using defaults.\");\n Log.e(TAG, \"Exception: %s\", task.getException());\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(mDefaultLocation, DEFAULT_ZOOM));\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n }\n }\n });\n }\n\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n } catch (NullPointerException e) {\n Log.e(\"....\", \"Null pointer exception\");\n }\n }", "@Override\n public void onSuccess(Location location) {\n boolean isMock = false;\n if (location != null) {\n // Logic to handle location object\n\n if (Build.VERSION.SDK_INT >= 18) {\n isMock = location.isFromMockProvider();\n } else {\n if (\"0\".equals(Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ALLOW_MOCK_LOCATION)))\n isMock = false;\n else {\n isMock = true;\n }\n }\n }\n promise.resolve(isMock);\n return;\n }", "private void enableMyLocation() {\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n // Permission to access the location is missing.\n PermissionUtils.requestPermission(this, LOCATION_PERMISSION_REQUEST_CODE,\n Manifest.permission.ACCESS_FINE_LOCATION, true);\n mMap.setMyLocationEnabled(true);\n } else if (mMap != null) {\n // Access to the location has been granted to the app.\n mMap.setMyLocationEnabled(true);\n }\n Log.i(\"Current Location\", \"Location Enabled:\" + mMap.isMyLocationEnabled());\n LocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);\n LocationListener locationListener = new OrderLocationListener();\n\n // Register the listener with the Location Manager to receive location updates\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 9000, 0, locationListener);\n Location location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n\n makeUseOfNewLocation(location);\n\n location = LocationServices.FusedLocationApi.getLastLocation(client);\n\n makeUseOfNewLocation(location);\n\n }", "public interface CommandProvider {\n /**\n * Provide command hospital command.\n *\n * @param uri the uri\n * @return the hospital command\n */\n HospitalCommand provideCommand(String uri);\n}", "private void getLocationPermission() {\n /*\n * Request location permission, so that we can get the location of the\n * device. The result of the permission request is handled by a callback,\n * onRequestPermissionsResult.\n */\n mLocationPermissionGranted = false;\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "private void getLocationPermission() {\n /*\n * Request location permission, so that we can get the location of the\n * device. The result of the permission request is handled by a callback,\n * onRequestPermissionsResult.\n */\n mLocationPermissionGranted = false;\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "@Override\n public void onRequestPermissionsResult(int requestCode,\n @NonNull String[] permissions,\n @NonNull int[] grantResults) {\n switch (requestCode) {\n case REQUEST_LOCATION_PERMISSION:\n if (grantResults.length > 0\n && grantResults[0]\n == PackageManager.PERMISSION_GRANTED) {\n enableMyLocation();\n break;\n }\n }\n }" ]
[ "0.63090014", "0.63052756", "0.6033582", "0.5956299", "0.59519506", "0.59454703", "0.59011406", "0.5864944", "0.58593625", "0.5844429", "0.58232915", "0.5761106", "0.57592154", "0.5732133", "0.57271075", "0.57249916", "0.5634948", "0.56288725", "0.562216", "0.5616608", "0.56150466", "0.5601803", "0.5590849", "0.5578877", "0.55751306", "0.55740523", "0.5565372", "0.5565372", "0.5561103", "0.55549604", "0.55543447", "0.5549141", "0.5547476", "0.5538911", "0.5536715", "0.55363363", "0.55353653", "0.5533474", "0.55273074", "0.55139536", "0.55062646", "0.5505001", "0.5494588", "0.5473505", "0.54720914", "0.54622835", "0.54463786", "0.54463786", "0.54418063", "0.5436732", "0.5430568", "0.54246753", "0.5418408", "0.54106635", "0.54097915", "0.5409364", "0.5408903", "0.5407222", "0.5406229", "0.540597", "0.5404068", "0.5398084", "0.5397518", "0.53968704", "0.53855455", "0.5377658", "0.53775626", "0.53775626", "0.5377521", "0.5369017", "0.536703", "0.53655154", "0.5357291", "0.53514194", "0.5343878", "0.5343351", "0.53426754", "0.5342019", "0.5339076", "0.53368354", "0.53368217", "0.5334716", "0.5331517", "0.5328234", "0.53264785", "0.5325974", "0.5323791", "0.5321695", "0.53182125", "0.5309921", "0.5307226", "0.5306807", "0.5304805", "0.5304736", "0.52998203", "0.5298113", "0.52952796", "0.52920204", "0.52910256", "0.52910256", "0.5288221" ]
0.0
-1
RTKTODO: launch app view DebugHelper.dump("onHandleClickIntent "+getClassName());
@Override public void onHandleClickIntent(Context c) { c.sendBroadcast(new Intent(ConstantsDef.LAUNCH_APP_CUSTOMIZED_PAGE_INTENT)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tprotected void onHandleIntent(Intent arg0) {\n\t\t\n\t}", "void mo21580A(Intent intent);", "@Override\n\tprotected void onHandleIntent(Intent intent) {\n\n\t}", "@Override\n protected void onHandleIntent(Intent intent) {\n\n }", "@Override\n protected void onHandleIntent(Intent workIntent) {\n }", "@Override\n\t public void onClick(View v) {\n\t \t try{\n\t \t\t PackageManager pm = getPackageManager();\n\t \t\t Intent intent = pm.getLaunchIntentForPackage(\"com.getpebble.android\");\n\t \t\t startActivity(intent);\n\t \t }finally{;}\n\t }", "@Override\n public void onClick(View view) {\n\n startActivity(getIntent());\n }", "@Override\n\t \t\t\tpublic void onClick(View arg0) {\n\t \t\t\t\tList<PackageInfo> packages = getPackageManager().getInstalledPackages(0);\n\t \t\t\t\tstartActivity(getPackageManager().getLaunchIntentForPackage(packages.get(0).applicationInfo.packageName)); \n\t \t\t\t}", "private void handleIntent() {\n // Get the intent set on this activity\n Intent intent = getIntent();\n\n // Get the uri from the intent\n Uri uri = intent.getData();\n\n // Do not continue if the uri does not exist\n if (uri == null) {\n return;\n }\n\n // Let the deep linker do its job\n Bundle data = mDeepLinker.buildBundle(uri);\n if (data == null) {\n return;\n }\n\n // See if we have a valid link\n DeepLinker.Link link = DeepLinker.getLinkFromBundle(data);\n if (link == null) {\n return;\n }\n\n // Do something with the link\n switch (link) {\n case HOME:\n break;\n case PROFILE:\n break;\n case PROFILE_OTHER:\n break;\n case SETTINGS:\n break;\n }\n\n String msg;\n long id = DeepLinker.getIdFromBundle(data);\n if (id == 0) {\n msg = String.format(\"Link: %s\", link);\n } else {\n msg = String.format(\"Link: %s, ID: %s\", link, id);\n }\n\n Toast.makeText(this, msg, Toast.LENGTH_LONG).show();\n }", "@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\tcallintentforattachment();\n\t\t\t\t}", "@Override\r\nprotected void onNewIntent(Intent intent) {\n\tsuper.onNewIntent(intent);\r\nSystem.out.println(\"onNewIntent\");\r\n}", "@Override\n\t\t\t\t\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\t\t\t\t\tMainActivity sct = (MainActivity) act;\n\t\t\t\t\t\t\t\t\tsct.onItemClick(posit2, 11);\n\t\t\t\t\t\t\t\t}", "@Override\n protected void onNewIntent(Intent intent){\n handleIntent(intent);\n }", "public void onClick2(View v) {\n\n\n PackageManager pm = getPackageManager();\n Intent intent = pm.getLaunchIntentForPackage(\"com.lee.test\");\n\n if (intent != null) {\n intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(intent);\n }else {\n Toast.makeText(MainActivity.this,\"空intent\",Toast.LENGTH_SHORT).show();\n }\n\n\n }", "private void showViewToursActivity() {\n//\t\tIntent intent = new intent(this, ActivityViewTours.class);\n System.out.println(\"Not Yet Implemented\");\n }", "public void onClick(View v)\n\t\t\t\t { // Method of the interface to implement. This method is called when the view has been clicked.\n\t\t\t\t\t /**\n\t\t\t\t\t * Activities are activated by asynchronous messages called intents. An Intent object holds the content of the\n\t\t\t\t\t * message. It names the action being requested and specifies the URI of the data to act on, among other things. An\n\t\t\t\t\t * activity is launched (or given something new to do) by passing an Intent object to Context.startActivity() or\n\t\t\t\t\t * Activity.startActivityForResult(). The responding activity can look at the initial intent that caused it to be\n\t\t\t\t\t * launched by calling its getIntent() method. One activity often starts another.\n\t\t\t\t\t * <p>\n\t\t\t\t\t * The most significant use of Intent is in launching of activities, where it can be thought of as the glue between\n\t\t\t\t\t * activities. It is basically a passive data structure holding an abstract description of an action to be performed.\n\t\t\t\t\t * <p>\n\t\t\t\t\t * There are two primary forms of Intents in use namely; Explicit and Implicit. The former has a specified component\n\t\t\t\t\t * that has an exact class to run.The later doesn't have a specified component and the system determines the best\n\t\t\t\t\t * available component to run for the Intent. IntentResolution maps an Intent to an Activity that can handle it.\n\t\t\t\t\t * <p>\n\t\t\t\t\t * In our case, the intent resolution mechanism basically revolves around matching an Intent against all of the\n\t\t\t\t\t * <intent-filter> descriptions in the installed application packages.\n\t\t\t\t\t */\n\t\t\t\t\t Intent intent = new Intent(RedFlashLight.this, GreenFlashLight.class);\n\t\t\t\t\t startActivity(intent); // Launch an activity\n\t\t\t\t }", "@Override\n protected void onNewIntent(Intent intent) {\n }", "public final void mo25517a(Intent intent) {\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tLog.i(\"click\", \"ll_click\");\n\t\t\t}", "@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\n\t\t\t\t\tstartActivity(intent);\n\t\t\t\t}", "@Test\n public void triggerIntent_hasExtras() {\n onView(withId(getResourceId(\"switchActivity\"))).check(matches(notNullValue() ));\n onView(withId(getResourceId(\"switchActivity\"))).check(matches(withText(\"Change Page\")));\n onView(withId(getResourceId(\"switchActivity\"))).perform(click());\n intended(hasExtra(\"Developer\", \"Oguzhan Orhan\"));\n }", "@Override\n public void onNewIntent(Intent intent) {\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tsetResult(0x717,intent);\n\t\t\t\tfinish();\n\t\t\t}", "@Override\r\n\t public void onClick(View v) {\n\t\tBundle bundle = new Bundle();\r\n\t\tbundle.putString(\"msgKind\", \"CALLLOG\");\r\n\t\tbundle.putStringArray(\"msgValue\", callLogStr);\r\n\t\tIntent intent = new Intent(DisplayChoice.this, Display.class);\r\n\t\tintent.putExtras(bundle);\r\n\t\tstartActivity(intent);\r\n\t }", "protected abstract Intent getIntent();", "@Override\n public void onClick(View v) {\n Intent intent = new Intent(LaunchActivity.this, MainActivity.class);\n startActivity(intent);\n }", "@Override\n\tpublic void nativeMouseClicked(NativeMouseEvent e) {\n\t\t\n\t}", "@Override\n public void onClick(View v) {\n incidentalIntent = new Intent(getApplicationContext(),IncidentalTaskActivity.class);\n startActivity(incidentalIntent);\n }", "@DISPID(-2147412104)\n @PropGet\n java.lang.Object onclick();", "protected Intent getStravaActivityIntent()\n {\n return new Intent(this, MainActivity.class);\n }", "public void onNewIntent(Intent intent) {\n }", "private /* synthetic */ void a(Intent intent) {\n this.a.startActivity(intent);\n }", "public void onClick(View arg0) {\n\t\t\t\t\n\t\t\t}", "public void onClickFeature (View v)\n\t{\n\t\tint id = v.getId ();\n\t\tswitch (id) {\n\t\tcase R.id.home_btn_feature1 :\n\t\t\tstartActivity (new Intent(getApplicationContext(), ReminderViewController.class));\n\t\t\tbreak;\n\t\tcase R.id.home_btn_feature2 :\n\t\t\tIntent intent = new Intent(this, MapsActivity.class);\n\t\t\tintent.putExtra(AppConstants.BUNDLE_EXTRA_KEY_CONTEXT, AppConstants.CONTEXT_MAP_FROM_MAPS);\n\t\t\tstartActivity(intent);\n\t\t\t//startActivity (new Intent(getApplicationContext(), MapViewController.class));\n\t\t\tbreak;\n\t\tcase R.id.home_btn_feature3 :\n\t\t\tstartActivity (new Intent(getApplicationContext(), NotificationViewController.class));\n\t\t\tbreak;\n\t\tcase R.id.home_btn_feature4 :\n\t\t\tstartActivity (new Intent(getApplicationContext(), SettingsViewController.class));\n\t\t\tbreak;\n\t\t\t/*case R.id.home_btn_feature5 :\n startActivity (new Intent(getApplicationContext(), F5Activity.class));\n break;\n case R.id.home_btn_feature6 :\n startActivity (new Intent(getApplicationContext(), F6Activity.class));\n break;*/\n\t\tdefault: \n\t\t\tbreak;\n\t\t}\n\t}", "public void onClick(View v) {\n\n\n\n startActivity(myIntent);\n }", "@Override\r\n public void onClick(View v) {\r\n IntentIntegrator Integrator=new IntentIntegrator(MainStore.this);\r\n Integrator.initiateScan();\r\n }", "@Override\n\tprotected void OnClick() {\n\t\t\n\t}", "@Override\n public void onNewIntent(Activity activity, Intent data) {\n }", "@Override\r\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tServiceAdditionActivity.setclass(\"house\");\r\n\t\t\t\tstartActivity(new Intent(ServiceActivity.this,ServiceAdditionActivity.class));\r\n\t\t\t}", "private void openActivity() {\n }", "public void onIntentReceived(final String payload) {\n this.WriteLine(\"--- Intent received by onIntentReceived() ---\");\n this.WriteLine(payload);\n this.WriteLine();\n }", "@Override\n public void onClick(View view) {\n\n Intent intent = new Intent(mContext, HelpDetails.class);\n intent.putExtra(\"hid\", item.getHelpId());\n mContext.startActivity(intent);\n\n\n // Toast.makeText(mContext, \"clicked\", Toast.LENGTH_SHORT).show();\n // Toast.makeText(mContext, \"\"+user_id, Toast.LENGTH_SHORT).show();\n\n }", "@Override\n public void onClick(View view) {\n Intent intent = new Intent(MainActivity.this, TriggerActivity.class);\n startActivity(intent);\n }", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tLog.e(\"test\", \"点击开关\");\r\n\t\t\t}", "public void mo1401a(Intent intent) {\n }", "@Override\n\t\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1,\n\t\t\t\t\t\tint arg2, long arg3) {\n\t\t\t\t\t Intent prefIntent = new Intent(intent);\n\t\t\t prefIntent.setComponent(new ComponentName(\n\t\t\t rList.get(arg2).activityInfo.packageName, rList.get(arg2).activityInfo.name));\n\t\t\t Test.this.startActivity(prefIntent);\n\t\t\t\t}", "@Override\r\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tServiceAdditionActivity.setclass(\"busness\");\r\n\t\t\t\tstartActivity(new Intent(ServiceActivity.this,ServiceAdditionActivity.class));\r\n\t\t\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent intent = new Intent();\n\t\t\t\tintent.setClass(MenberCenterApp.this, CollectionBodyApp.class);\n\t\t\t\tstartActivity(intent);\n\t\t\t}", "@Override\r\n public void onClick(View view) {\n }", "@Override\r\n public void onClick(View view) {\n }", "@Override\r\n public void onClick(View view) {\n }", "@Override\n public void performAction(View view) {\n startActivity(new Intent(MainActivity.this, MyInfoActivity.class));\n }", "@Override\r\n \t\t\tpublic void onClick(View arg0) {\n \t\t\t\tIntent intent = new Intent(AppDownloaded.this, AppManager.class);\r\n \t\t\t\tstartActivity(intent);\r\n \t\t\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tputExtra();\n\t\t\t\t\n\t\t\t}", "@Override\n public void onClick(View view) {\n Intent intent = ClassActivity.newIntent(getActivity(), mClass.getId());\n getActivity().startActivity( intent );\n }", "@Override\r\n public void onClick(View view) {\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n public void onClick(View v) {\n routineIntent = new Intent(getApplicationContext(), RoutineTaskActivity.class);\n startActivity(routineIntent);\n }", "public void onAnyClick(Class t) {\n Intent i = new Intent(this, t);\n sm.playStapler();\n // Launch a specified activity\n startActivity(i);\n }", "@Override\n\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\tIntent startSearch=new Intent(Launcher.this, SearchActivity.class);\n\t\t\t\t\tstartActivity(startSearch);\n\t\t\t\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tstartActivity(new Intent(getApplicationContext(),\tLauncher.class));\n\t\t\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tonIntentClass(activity, MainActivity.class, true);\n\t\t\t}", "@Override\n public void onClick(View view) {\n }", "@Override\n public void onClick(View view) {\n }", "@Override\r\n\t public void onClick(View v) {\n\t\tBundle bundle = new Bundle();\r\n\t\tbundle.putString(\"msgKind\", \"SMSLOG\");\r\n\t\tbundle.putStringArray(\"msgValue\", smsLogStr);\r\n\t\tIntent intent = new Intent(DisplayChoice.this, Display.class);\r\n\t\tintent.putExtras(bundle);\r\n\t\tstartActivity(intent);\r\n\t }", "@Override\r\n\tpublic void onNaviTurnClick() {\n\r\n\t}", "public void onClick(View arg0) {\n\t\t\tClass ourClass5;\n\t\t\ttry {\n\t\t\t\tourClass5 = Class.forName(\"com.first.aid.abcd.Nek\");\n\t\t\t\tIntent intentVijf = new Intent(vijfde.this, ourClass5);\n\t\t\t\tintentVijf.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);\n\t\t\t\tstartActivity(intentVijf);\t\n\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "@Override\r\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tboolean isHave=\n\t\t\t\thasApplication(LoginActivity.this,\"com.hsic.tmj.myyhqworkspace\");\n\t\t\t\tif(!isHave){\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t\tComponentName componetName = new ComponentName(\n\t\t\t\t\t\t//这个是另外一个应用程序的包名\n\t\t\t\t\t\t\"com.hsic.tmj.myyhqworkspace\",\n\t\t\t\t\t\t//这个参数是要启动的Activity\n\t\t\t\t\t\t\"com.hsic.tmj.myyhqworkspace.LoginActivity\");\n// Intent intent= new Intent(\"chroya.foo\");\n\t\t\t\tIntent intent= new Intent();\n\t\t\t\t//我们给他添加一个参数表示从apk1传过去的\n\t\t\t\tBundle bundle = new Bundle();\n\t\t\t\tbundle.putString(\"arge1\", \"这是跳转过来的!来自apk1\");\n\t\t\t\tintent.putExtras(bundle);\n\t\t\t\tintent.setComponent(componetName);\n\t\t\t\tstartActivity(intent);\n\t\t\t\t\n\t\t\t}", "public void goTestActivity()\n\t {\n\t }", "public void onLinksClick(View v){\n // Launch the Links activity\n onAnyClick(Links.class);\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tstartActivity(new Intent(MainActivity.this,\n\t\t\t\t\t\tcom.itcuties.android.apps.MainActivity.class));\n\n\t\t\t}", "void intentHasBeenReceivedThroughTheBroadCast(Intent intent);", "public void getintent() {\n Intent intent = this.getIntent();\n acceptDetailsModel = (AcceptDetailsModel) intent.getSerializableExtra(\"menu_item\");\n }", "public void onClick(View arg0) {\r\n\t\t\t\t}", "@Override\n public void onClick(View view) {\n\n }", "@Override\n public void onClick(View arg0) {\n }", "@Override\n public void onClick(View arg0) {\n }", "@Override\n public void onClick(View arg0) {\n }", "@Override\n public void onClick(View arg0) {\n }", "@Override\n public void onClick(View arg0) {\n }", "public void recordInProductHelpMenuItemClicked() {\n RecordUserAction.record(\"Android.ChromeHome.IPHMenuItemClicked\");\n }", "@Override public void onClick(View arg0) {\n\n }", "@Override\n public void onClick(View view) {\n Intent Getintent = new Intent(Intent.ACTION_VIEW, Uri.parse(\"http://feedback.avriant.com\"));\n startActivity(Getintent);\n }", "@Override\n public void onClick(View view) {\n }", "@Override\n public void onClick(View view) {\n }", "@Override\n public void onClick(View view) {\n }", "@Override\n public void onClick(View view) {\n }", "@Override\n public void onClick(View view) {\n }", "@Override\n public void onClick(View view) {\n }", "@Override\n public void onClick(View view) {\n }", "@Override\n public void onClick(View view) {\n }", "@Override\n public void onClick(View view) {\n }", "@Override\n public void onClick(View view) {\n }", "@Override\n public void onClick(View view) {\n }", "public void onContactClick(View v){\n // Launch the Contact activity\n onAnyClick(Contact.class);\n }", "@Override\n\tpublic void onClick(View arg0) {\n\t\t\n\t}", "@Override\n\tpublic void onClick(View arg0) {\n\t\t\n\t}" ]
[ "0.69495386", "0.6948937", "0.6898266", "0.686478", "0.6710177", "0.648903", "0.6351326", "0.633338", "0.63175124", "0.62764925", "0.6254319", "0.62395036", "0.6237234", "0.6201771", "0.6183463", "0.61820287", "0.61733305", "0.6159055", "0.61486423", "0.61485827", "0.6147788", "0.6129754", "0.612042", "0.60950214", "0.60937345", "0.6093201", "0.606845", "0.6045286", "0.6036958", "0.60357296", "0.6019607", "0.6014721", "0.6006238", "0.6002642", "0.5993792", "0.59859395", "0.59850824", "0.5980494", "0.5968177", "0.59671813", "0.59585375", "0.5957863", "0.59572285", "0.59540826", "0.59399587", "0.593258", "0.5931812", "0.5926624", "0.5924987", "0.5924987", "0.5924987", "0.59143144", "0.59142953", "0.5913094", "0.59126735", "0.59097755", "0.5909182", "0.5909182", "0.5909182", "0.5907307", "0.5901919", "0.589785", "0.5890073", "0.5889137", "0.58885366", "0.58885366", "0.58879423", "0.5880554", "0.58793217", "0.58726937", "0.58708817", "0.5867587", "0.58649564", "0.58629775", "0.5858015", "0.5856687", "0.58552456", "0.5853872", "0.5849181", "0.5849181", "0.5849181", "0.5849181", "0.5849181", "0.58443016", "0.5844016", "0.58435744", "0.5842617", "0.5842617", "0.5842617", "0.5842617", "0.5840744", "0.5840744", "0.5840744", "0.5840744", "0.5840744", "0.5840744", "0.5840744", "0.5838034", "0.5837778", "0.5837778" ]
0.6642029
5
No args constructor for use in serialization
public Region() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "MyEncodeableWithoutPublicNoArgConstructor() {}", "public ObjectSerializationEncoder() {\n // Do nothing\n }", "@SuppressWarnings(\"unused\")\n public NoConstructor() {\n // Empty\n }", "defaultConstructor(){}", "public Data() {}", "private SerializerFactory() {\n // do nothing\n }", "public JsonFactory() { this(null); }", "private SingleObject(){}", "public CompactSerializable() {\n }", "public Data() {\n \n }", "public Payload() {}", "void DefaultConstructor(){}", "public Data() {\n }", "public Data() {\n }", "private SingleObject()\r\n {\r\n }", "public CustomDateSerializer() {\n this(null);\n }", "public ClassOne(){\n\t\tthis.age = 55;\t\t// this value won't come while de-serialization.\n\t\tSystem.out.println (\"Default Constructor Running\");\n\t}", "private Instantiation(){}", "public Payload() {\n\t}", "O() { super(null); }", "protected abstract T _createEmpty(DeserializationContext ctxt);", "private SerializationUtils() {\n\n }", "Reproducible newInstance();", "private JsonUtils()\r\n {\r\n // Private constructor to prevent instantiation\r\n }", "public MinecraftJson() {\n }", "public Constructor(){\n\t\t\n\t}", "public \n PipedObjectReader() \n {}", "private JsonUtils() {\n\t\tsuper();\n\t}", "private void __sep__Constructors__() {}", "public Pleasure() {\r\n\t\t}", "public AvroPerson() {}", "private SingleObject(){\n }", "public Pojo1110110(){\r\n\t}", "public NetworkData() {\n }", "public JSONBuilder() {\n\t\tthis(null, null);\n\t}", "public Member() {}", "@SuppressWarnings(\"unchecked\")\n\tpublic UserSerializer() {\n\t\tsuper();\n\t\tmapSerializer.putAll(BeanRetriever.getBean(\"mapSerializerStrategy\", Map.class));\n\t}", "public JSONLoader() {}", "private SerializationUtils() {\n\t\tthrow new AssertionError();\n\t}", "public WCSResponseSerializer()\r\n {\r\n }", "public Clade() {}", "public ClaseJson() {\n }", "private Sequence() {\n this(\"<Sequence>\", null, null);\n }", "public Item() {}", "protected AbstractReadablePacket() {\n this.constructor = createConstructor();\n }", "public Generic(){\n\t\tthis(null);\n\t}", "public MetaDataContract()\n {\n }", "public JobPayload()\n {\n \n }", "public SpeakerSerivceImpl() {\n\t\tSystem.out.println(\"No args in constructor\");\n\t}", "public Person() {}", "public Item(){}", "private Converter()\n\t{\n\t\tsuper();\n\t}", "public JSONUtils() {\n\t\tsuper();\n\t}", "public Value() {}", "private Message(){\n // default constructor\n }", "@objid (\"d5a0862c-6231-11e1-b31a-001ec947ccaf\")\n private ObjIdCollectionSerializer() {\n }", "private NaturePackage() {}", "public ParamJson() {\n\t\n\t}", "public InitialData(){}", "public PersonRecord() {}", "public LargeObjectAvro() {}", "protected abstract void construct();", "public D() {}", "@SuppressWarnings(\"unused\")\n public Item() {\n }", "private Item(){}", "private JSONHelper() {\r\n\t\tsuper();\r\n\t}", "public JAXBConverter() {\n\t}", "public Member() {\n //Empty constructor!\n }", "public AbstractBinaryInteraction() {\n\n\t}", "public FileObject() {\n\t}", "public BabbleValue() {}", "public StringData() {\n\n }", "private AggregDayLogSerializer() {\n\t throw new UnsupportedOperationException(\n\t \"This class can't be instantiated\");\n\t }", "public Mapping() { this(null); }", "public Postoj() {}", "public Node() {}", "public Node() {}", "public Node() {}", "public Node() {}", "public StudentRecord() {}", "@Override\n\tpublic Response construct() {\n\t\treturn null;\n\t}", "public Person()\n {\n //intentionally left empty\n }", "public XObject(){\r\n }", "public XObject(){\n }", "public TeeWriter() {\r\n ; // nothing to do\r\n }", "public ObjectUtils() {\n super();\n }", "public Value() {\n }", "public JsonField() {\n }", "public Identity()\n {\n super( Fields.ARGS );\n }", "MessageSerializer<T> create();", "public CSSTidier() {\n\t}", "public Value(){}", "private NewsWriter() {\n }", "public UE2_0_3Serializer(){\n\t\txstream = new XStream(/*new DomDriver()*/);\n\t}", "public SensorData() {\n\n\t}", "public Pasien() {\r\n }", "public Node() {\n\t}", "public LocalObject() {}", "@SuppressWarnings(\"unused\")\r\n\tprivate Person() {\r\n\t}", "public Book() {}", "public Item() {\n\t}" ]
[ "0.74630904", "0.7387007", "0.7210724", "0.7029566", "0.7018587", "0.6977819", "0.69339114", "0.6881743", "0.6739828", "0.6727297", "0.6717886", "0.67169136", "0.669586", "0.669586", "0.66750634", "0.66246814", "0.6604095", "0.6532946", "0.65235436", "0.6500072", "0.6466648", "0.64311725", "0.6420696", "0.63329536", "0.6331174", "0.63080406", "0.6303669", "0.6297327", "0.6289062", "0.62796336", "0.62715524", "0.6246891", "0.6236601", "0.6236527", "0.62337124", "0.621766", "0.62073123", "0.6205364", "0.62028056", "0.61931217", "0.61913615", "0.61901313", "0.6187056", "0.618604", "0.61813384", "0.61712974", "0.6168396", "0.61616594", "0.6159333", "0.61513215", "0.6150306", "0.6144834", "0.6137297", "0.61357254", "0.6134681", "0.61235094", "0.6122921", "0.61144346", "0.6113325", "0.6103046", "0.6093859", "0.6088237", "0.60865474", "0.60842085", "0.6079729", "0.6075916", "0.6066694", "0.6050046", "0.60495526", "0.60494757", "0.60476506", "0.6045192", "0.60441047", "0.6041579", "0.60395074", "0.6038388", "0.6038388", "0.6038388", "0.6038388", "0.6036713", "0.6032801", "0.6030977", "0.60247785", "0.6018193", "0.60155535", "0.60124946", "0.6011776", "0.60107607", "0.6008726", "0.60062283", "0.60036933", "0.5999471", "0.5998251", "0.5996513", "0.59922075", "0.5991442", "0.59912944", "0.5989887", "0.5989741", "0.598915", "0.59881556" ]
0.0
-1
Get a readonly map with all context values.
public static Map<String, String> getMapping() { return data.get(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Map<String, Object> context() {\n return unmodifiableMap(context);\n }", "Map<String, String> getAllAsMap() {\n return Collections.unmodifiableMap(settings);\n }", "Map<String, String> getAllAsMap() {\n return Collections.unmodifiableMap(settings);\n }", "public final Map<String, Object> getInternalMap() {\n\t\treturn values;\n\t}", "public Map<Object, Object> getGlobalMap() {\n return Collections.unmodifiableMap(globalMap);\n }", "public Map<String, Object> state() {\n return Collections.unmodifiableMap(values);\n }", "Map<String, Object> getContext();", "public Map<String, ?> getAll() {\r\n SharedPreferences sharedPreferences = ctx.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE);\r\n return sharedPreferences.getAll();\r\n }", "public Map<String, Object> getContextMap(MessageInfo messageInfo) {\n Map<String, Object> internalMap = (Map<String, Object>) messageInfo.getMap()\n .get(AuthenticationFramework.ATTRIBUTE_AUTH_CONTEXT);\n\n if (internalMap == null) {\n internalMap = new HashMap<>();\n messageInfo.getMap().put(AuthenticationFramework.ATTRIBUTE_AUTH_CONTEXT, internalMap);\n }\n\n return internalMap;\n }", "public Map<String, Counter> getMap(){\n\t\treturn map;\n\t}", "public static Map<String, String> getMapping() {\n\t\treturn ThreadContext.getMapping();\n\t}", "@Override\n public Map<String, ?> getAll() {\n return Collections.emptyMap();\n }", "protected Map createPropertiesMap() {\n return new HashMap();\n }", "public Map<ComponentId, CHILD> getComponentMap() {\n return Collections.unmodifiableMap(producerById);\n }", "Map<String, Constant> getConstantMap();", "public Map<Integer, Coord> getGlobalMap(){\n\t\tif(mapExists){\r\n\t\t\tMap<Integer, Coord> realCoordMap = new HashMap<Integer, Coord>();\r\n\t\t\tfor(Map.Entry<Integer, Coord> c : this.globalMap.entrySet()){\r\n\t\t\t\t//core.Debug.p(\"c: id\" + c.getKey() + \", v:\" + c.getValue().toString() + \", r:\"+ realCoord(c.getValue()).toString());\r\n\t\t\t\trealCoordMap.put(c.getKey(), realCoord(c.getValue()));\r\n\t\t\t}\r\n\t\t\treturn realCoordMap;\r\n\t\t}\r\n\t\telse return null;\r\n\t}", "public ScopedMap() {\n\t\tmap = new ArrayList<HashMap<K, V>>();\n\n\t}", "public Map<K,V> getMap() {\n Map<K,V> results = new HashMap<K,V>(valueMap.size());\n\n synchronized(theLock) {\n for (Map.Entry<K,CacheableObject> entry : valueMap.entrySet()) {\n if (! isExpired(entry.getValue())) {\n results.put(entry.getKey(), entry.getValue().cachedObject);\n }\n }\n }\n\n return results;\n }", "public Map<String, Object> getInfoMap() {\n\t\tMap<String, Object> paramMap = new HashMap<String, Object>();\n\t\tthis.putInMap(paramMap);\n\t\treturn paramMap;\n\t}", "Collection<T> getAll() {\n _readLock.lock();\n try {\n return ImmutableList.copyOf(_toMap.values());\n } finally {\n _readLock.unlock();\n }\n }", "public Map<String, Object> getInfoMap()\n {\n Map<String, Object> paramMap = new HashMap<String, Object>();\n this.putInMap(paramMap);\n return paramMap;\n }", "public Collection values() {\n return map.values();\n }", "public abstract Map getAttributes();", "default Map<String, Object> getProperties()\r\n {\r\n return emptyMap();\r\n }", "@Override\n protected Map<String, Object> getBeansMap()\n {\n return TestUtility.getStateData();\n }", "public static Map<String, Object> getJsonldContext() {\n if (jsonldContext == null) {\n jsonldContext = new HashMap<String, Object>();\n Map<String, String> map = get().getNsPrefixMap();\n for (Map.Entry<String, String> entry : map.entrySet()) {\n jsonldContext.put(entry.getKey(), entry.getValue());\n }\n }\n return jsonldContext;\n }", "public Map<String, Object> getTempState() {\n // Create the tempState if it doesn't exist.\n if (tempState == null)\n tempState = new HashMap<String, Object>();\n return tempState;\n }", "public Map<Integer, State> getMyStateMap() { return myStateMap; }", "public Map<String, ZAttrHandler> getVarMap() {\r\n if (attrMap==null) attrMap = new ZAttrHandlerMapper(this).map();\r\n return attrMap;\r\n }", "public Collection<String> valuesOfMap() {\n Map<String, String> tempMap = createSimpleMap(\"Fondue\",\"Cheese\");\n\t\treturn tempMap.values();\n\t}", "public Map<String, Object> getAttributesMap() {\n\t\treturn this.staticAttributes;\n\t}", "public abstract Map<String, Object> getAttributes();", "public Map<String, Object> getAttributes();", "public Map<String, Object> getAttributes();", "public IntToIntMap getStaticMap() {\n return staticMap;\n }", "public Map<Resource, Boolean> getResourceToReadOnlyMap()\n {\n return resourceToReadOnlyMap;\n }", "public Map<String, Integer> getDataMap() {\n\t\tMap<String, Integer> dataMap = new HashMap<>();\n\t\tdataMap.putAll(temperature.getDataMap());\n\t\tdataMap.putAll(wind.getDataMap());\n\t\tdataMap.putAll(precipitation.getDataMap());\n\t\tdataMap.putAll(condition.getDataMap());\n\t\tdataMap.putAll(hazard.getDataMap());\n\t\tdataMap.putAll(wave.getDataMap());\n\t\t\n\t\treturn dataMap;\n\t}", "public Map<String, Collection<V>> asUnmodifiableMap() {\n return Collections.unmodifiableMap(map);\n }", "protected Map<String, String> getVarMap() {\n\t\treturn myVarMap;\n\t}", "private Map<String, List<String>> getDictionary() {\n\t\tMap<String, List<String>> dictMap = dictionary.getMultiValueDict();\n\t\treturn dictMap;\n\t}", "@UnsupportedAppUsage\n public Map<String, Object> getMap() {\n return this.mMap;\n }", "public Map<String,Object> getAttributeMap() {\r\n return Maps.newHashMap(attributeMap);\r\n }", "public static Map<String, Object> toMap() {\n return toMap(null);\n }", "public Map<String, MessageContainer> getContextMessageContainers() {\n\n Map<String, MessageContainer> contextMessageContainer = new HashMap<>();\n fileContextMap.entrySet().stream().filter(entry -> CollectionUtils\n .isNotEmpty(entry.getValue().getMessageContainer().getErrorMessageList())).forEach(\n entry -> contextMessageContainer.put(\n entry.getKey(), entry.getValue()\n .getMessageContainer()));\n messageContainerMap.entrySet().stream()\n .filter(entry -> CollectionUtils.isNotEmpty(entry.getValue().getErrorMessageList()))\n .forEach(entry -> contextMessageContainer.put(entry.getKey(), entry.getValue()));\n return contextMessageContainer;\n }", "@Contract(value = \" -> new\", pure = true)\n @Nonnull\n public static <K, V> Map<K, V> createSoftMap() {\n return Maps.newSoftHashMap();\n }", "public Map<String, INode> getNodeMap() {\n\n return Collections.unmodifiableMap(nodeMap);\n }", "public Map<String, String> getAttributes();", "public Iterable<Map.Entry<String,Double>> getConstants() {\r\n return Collections.unmodifiableMap(constants).entrySet();\r\n }", "public Map<Diff<K>, Diff<V>> getMap() {\r\n return map;\r\n }", "public Map<String, String> getData() {\n if (data == null) data = new HashMap<>();\n return data;\n }", "public Map<String, String> getValueData(){\n\t\treturn valueCache;\n\t}", "public Map<Object, Object> getExtraMap() {\n return extraMap;\n }", "Map<String, String> getCombinedMap() {\n Map<String, String> all = new HashMap<String, String>(plainProps);\n all.putAll(xProps);\n all.putAll(xxProps);\n all.putAll(sysProps);\n return all;\n }", "public Map<Object, Object> getUserMap() {\n\t\treturn userMap;\n\t}", "public Map<String, Object> getGlobals() {\n return Collections.unmodifiableMap(globals);\n }", "public int[][] giveMap(){\n\t\treturn map;\n\t}", "public Map getProperties();", "public Map<Integer, Integer> getMemoryDataMap(){\n return dataMemory.getMemoryMap();\n }", "public Map initMap(){\n\t\tif (map == null){\n\t\t\tmap = createMap();\n\t\t}\n\t\treturn map;\n\t}", "Map<String, Object> getRequestContextLocalAttrs();", "public Map<String,Value> collect(TaskRuntimeContext runtimeContext);", "@Contract(value = \" -> new\", pure = true)\n @Nonnull\n public static <K, V> Map<K, V> createSoftValueMap() {\n return new SoftValueHashMap<>(canonicalStrategy());\n }", "public Map<ResourceId, ResourceConfig> getResourceMap() {\n return _resourceMap;\n }", "@SuppressWarnings(\"unchecked\")\n public Map<String, String> getMapContextPath() {\n FacesContext facesContext = FacesContext.getCurrentInstance();\n ExternalContext extenalContext = facesContext.getExternalContext();\n HttpServletRequest request = (HttpServletRequest) extenalContext.getRequest();\n return (Map<String, String>) request.getSession().getAttribute(\"MAP_CONTEXT_PATH\");\n //xxx_temp end\n }", "public Map<String, Object> getVariables();", "LinkedHashMap<Long, City> getAllCitiesMap();", "public Map getServicesInUseMap() {\n \t\tsynchronized (contextLock) {\n \t\t\treturn servicesInUse;\n \t\t}\n \t}", "public Map<String, Value> getValues() {\n while (m_values.size() <= m_level) {\n m_values.add(new HashMap<String, Value>());\n }\n return m_values.get(m_level);\n }", "protected Map<String,List<PageViewVO>> initializePageMap() {\n\t\tMap<String,List<PageViewVO>> pm = new HashMap<>();\n\t\tfor (Section sect : Section.values()) {\n\t\t\tpm.put(sect.name(), new ArrayList<>());\n\t\t}\n\t\treturn pm;\n\t}", "public HashMap<String, String> getMap() {\n return _map;\n }", "Map getIDPEXDataMap();", "java.util.Map<java.lang.String, java.lang.String> getAttributesMap();", "@Override\n public Map<String, Class> getDictionary() {\n synchronized (mapper) {\n LinkedHashMap<String, Class> dictionary = new LinkedHashMap<>();\n mapper.fillDictionary(null, dictionary);\n return dictionary;\n }\n }", "@Override\n public Map makeMap() {\n Map<Integer,String> testMap = new HashingMap<>();\n return testMap;\n }", "Map<String, Object> getPropertiesAsMap();", "public Map<State, StatePolicyProperties> getStateMap() {\r\n return mStateMap;\r\n }", "@Override\n\tpublic Map<String, ?> getValues() {\n\t\treturn null;\n\t}", "public static Object contextToHold () {\n\n return Lists.list ( Reflection.contextToHold (),\n Annotations.contextToHold());\n }", "public Map<T, V> populateMap() {\n Map<T, V> map = new HashMap<>();\n for (int i = 0; i < entryNumber; i++) {\n cacheKeys[i] = (T) Integer.toString(random.nextInt(1000000000));\n String key = cacheKeys[i].toString();\n map.put((T) key, (V) Integer.toString(random.nextInt(1000000000)));\n }\n return map;\n }", "public Map<String, Object> getCurrentData() throws Exception;", "public Map<String, Object> getTagMap();", "public static Map<String, String> getPassMap() {\r\n return passMap;\r\n }", "public Map getAttributes() {\n Map common = channel.getAttributes();\n \n if(map == null) {\n map = new HashMap(common);\n }\n return map;\n }", "java.util.Map<java.lang.Integer, java.lang.Integer>\n getInfoMap();", "public PropertyMap createPCDATAMap()\n {\n checkState();\n return super.createPCDATAMap();\n }", "private static <N extends Node> SortedMap<ImmutableContextSet, SortedSet<N>> createMap() {\n return new ConcurrentSkipListMap<>(ContextSetComparator.reverse());\n }", "public Map<Integer, Item> getAllItems() {\n\t\treturn hashOperations.entries(KEY);\n\t}", "private Map<String, AttributeInfo> getUserSchemaMap() {\n if (userSchemaMap == null) {\n schema();\n }\n return userSchemaMap;\n }", "public Map<Integer, Integer> getRegisterDataMap(){\n return registerFile.getRegisterMap();\n }", "public Map<String, String> getAttributes() {\n return Collections.unmodifiableMap(attributes);\n }", "public static Map createDefaultContext(Object root, MemberAccess memberAccess) {\n return addDefaultContext(root, memberAccess, null, null, new OgnlContext(null, null, memberAccess));\n }", "public Map<String, Object> getInfo();", "public Map<TextAttribute,?> getAttributes(){\n return (Map<TextAttribute,?>)getRequestedAttributes().clone();\n }", "Map<String, Object> getAttributes();", "Map<String, Object> getAttributes();", "Map<String, Object> getAttributes();", "public Map<String, StatefullComponent> getFieldsMap() {\n\t\treturn null;\r\n\t}", "java.util.Map<java.lang.String, java.lang.String>\n getVarsMap();", "private Map<String, DataContainer> getDataContainerMap() {\r\n\r\n if (this.dataContainerMap == null) {\r\n if (this.dataContainerList == null) {\r\n parse();\r\n }\r\n\r\n this.dataContainerMap = new HashMap<>();\r\n for (DataContainer dataContainer : this.dataContainerList) {\r\n this.dataContainerMap.put(dataContainer.getVariableName(), dataContainer);\r\n }\r\n }\r\n return this.dataContainerMap;\r\n }", "public HashMap<String, String> getResultMap() {\n return resultMap;\n }" ]
[ "0.7852539", "0.6702883", "0.6702883", "0.668971", "0.66003", "0.64448905", "0.641207", "0.6361862", "0.63534254", "0.6234397", "0.61816967", "0.6136481", "0.6093967", "0.60763216", "0.6068179", "0.6057902", "0.6049152", "0.6010305", "0.59783137", "0.59741706", "0.59640115", "0.5948699", "0.5925758", "0.5869813", "0.58474886", "0.58425635", "0.58394057", "0.5838161", "0.5837123", "0.58310646", "0.58307886", "0.58227336", "0.58115786", "0.58115786", "0.58065605", "0.58050376", "0.5802365", "0.5801358", "0.57795155", "0.57748604", "0.57739395", "0.5773152", "0.5761805", "0.5756398", "0.5749163", "0.574883", "0.5726264", "0.5725842", "0.5720567", "0.57119113", "0.5710051", "0.5702334", "0.56994516", "0.56923395", "0.56918037", "0.5686998", "0.5686586", "0.5676538", "0.56704086", "0.5650949", "0.56482744", "0.5642039", "0.56336796", "0.56329364", "0.5620659", "0.56152236", "0.56110966", "0.55924565", "0.5589572", "0.55826336", "0.5570884", "0.556877", "0.55671024", "0.55660135", "0.556457", "0.5563648", "0.55623406", "0.5560331", "0.5559616", "0.5552323", "0.5550912", "0.5542089", "0.55371493", "0.55264384", "0.55217546", "0.5519364", "0.55086166", "0.5505524", "0.5502461", "0.5499533", "0.5497699", "0.5487596", "0.54873407", "0.5482691", "0.5482691", "0.5482691", "0.54726315", "0.54695743", "0.54636765", "0.5458383" ]
0.5553904
79
Put a new context value.
public static void put(final String key, final Object value) { Map<String, String> map = new HashMap<String, String>(data.get()); if (value == null) { map.remove(key); } else { map.put(key, value.toString()); } data.set(Collections.<String, String> unmodifiableMap(map)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void putContext(String key, String value) {\n context.get().put(key, value);\n }", "public void addContextData( String key,\n String value );", "public abstract void setValue(ELContext context, Object value);", "public static void put(String key,Object value){\n getThreadContext().put(key,value);\n }", "public static void setContext(String key, String value) {\r\n scenarioContext.put(key, value);\r\n }", "public abstract void set(T v, String context);", "public void set(String key, Object value) {\r\n\t\tthis.context.setValue(key, value);\r\n\t}", "public static void put(final String key, final Object value) {\n\t\tThreadContext.put(key, value);\n\t}", "public void setContext(String namespace, String key, String value) {\n if (context == null) {\n context = new HashMap<String, Map<String, String>>();\n }\n\n Map<String, String> namespaceMap = context.get(namespace);\n if (namespaceMap == null) {\n namespaceMap = new HashMap<String, String>();\n context.put(namespace, namespaceMap);\n }\n\n namespaceMap.put(key, value);\n }", "public static void write(Context context, String key, String value) {\n\t\tSharedPreferences sp = context.getSharedPreferences(Constant.PRE_CSDN_APP, Context.MODE_PRIVATE);\n\t\tsp.edit().putString(key, value).commit();\n\t}", "void put(@NonNull String key, @NonNull T value);", "public abstract void setValue(Context c, Object v) throws PropertyException;", "default void update(T context) {\n add(context);\n }", "public final void ecmaPut(Context cx, Object id, Object value)\n {\n if (cx == null) cx = Context.getCurrentContext();\n XMLName xmlName = lib.toXMLNameOrIndex(cx, id);\n if (xmlName == null) {\n long index = ScriptRuntime.lastUint32Result(cx);\n // XXX Fix this cast\n put((int)index, this, value);\n return;\n }\n putXMLProperty(xmlName, value);\n }", "protected abstract void setContextAttribute(String name, Object value);", "void add(T context);", "public void put(String key, T value);", "@Override\n public void put(K key, V value) {\n root = putHelper(key,value,root);\n }", "public void set(T v) {\n\t\tset(v, ModSettings.currentContext);\n\t}", "void putRemoteConnectionContextObject( String key, Object value );", "private void storeValue(Object value)\n {\n if (getParent() instanceof ValueSupport)\n {\n ((ValueSupport) getParent()).setValue(value);\n }\n\n if (getVar() != null)\n {\n getContext().setVariable(getVar(), value);\n }\n }", "void setContext(Map<String, Object> context);", "public void put(Key key,Value value){\n\t\troot = insert(root,key,value);\n\t}", "void set(ExecutionContext context, String propertyName, Value propertyValue);", "public final void setValue(com.mendix.systemwideinterfaces.core.IContext context, java.lang.String value)\r\n\t{\r\n\t\tgetMendixObject().setValue(context, MemberNames.Value.toString(), value);\r\n\t}", "public void put(String key, T value) {\r\n\t\troot = put (root, key, value, 0);\r\n\t}", "void put(K key, V value);", "void put(K key, V value);", "public void context_save(long context) {\n context_save(nativeHandle, context);\n }", "public void putRoleValue(String key, String value){\n SharedPreferences sharedPreference = context.getSharedPreferences(LOGIN, Context.MODE_PRIVATE);\n SharedPreferences.Editor editor=sharedPreference.edit();\n editor.putString(key,value);\n editor.apply();\n }", "protected abstract void put(K key, V value);", "synchronized public static void putLong(Context context, String key, long value, boolean commit) {\r\n\t\tensurePreferencesEditor(context);\r\n\t\tsPreferencesEditor.putLong(key, value);\r\n\t\tif (commit) {\r\n\t\t\tsPreferencesEditor.commit();\r\n\t\t}\r\n\t\tif (sInstance != null) {\r\n\t\t\tsInstance.mSettings.put(key, value);\r\n\t\t}\r\n\t}", "void putValue(String key, Object data);", "@Override\n public void put(K key, V value) {\n root = put(root, key, value);\n }", "public V put(K key, V value);", "void put(String name, Object value);", "public abstract V put(K key, V value);", "public Builder setContext(final Map<String, String> value) {\n _context = value;\n return this;\n }", "public static void putString(String key, String value, Context context) {\n checkForNullKey(key);\n checkForNullValue(value);\n getSharedPreferences(context).edit().putString(key, value).apply();\n }", "Object put(Object key, Object value);", "static void addPropToTomcat(String name, Object value) throws Exception {\r\n context.bind(tomcatContextLocation + name, value);\r\n addedProps.add(tomcatContextLocation + name);\r\n }", "@Override\n public Object put(String name, Object value) {\n this.request.setAttribute(name, value);\n return super.put(name, value);\n }", "public Value put(Key key, Value thing) ;", "public static void setSetting(Context context, String key, String value) {\n SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);\n SharedPreferences.Editor editor = sp.edit();\n editor.putString(key, value);\n editor.commit();\n }", "public static void setSetting(Context context, String key, long value) {\n SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);\n SharedPreferences.Editor editor = sp.edit();\n editor.putLong(key, value);\n editor.commit();\n }", "void put(String key, Object value);", "@Override\n public void putValue(String key, Object value) {\n\n }", "V put(K key, V value);", "public void put(Key key, Value val);", "public void put(@NotNull String token, @NotNull UserContext userContext){\n tokenCache.put(token, userContext);\n }", "public void put(Object key, Object value) throws AspException\n {\n throw new AspReadOnlyException(\"Request.ServerVariables\");\n }", "V put(final K key, final V value);", "public void putKV(String key, String value) throws Exception;", "public static void setShared(Context context, String name, String value) {\n SharedPreferences prefs = PreferenceManager\n .getDefaultSharedPreferences(context);\n SharedPreferences.Editor editor = prefs.edit();\n editor.putString(name, value);\n editor.commit();\n }", "public Builder setContextValue(int value) {\n \n context_ = value;\n onChanged();\n return this;\n }", "private static final void putValue(final ContentValues v, Object value) {\n if (value instanceof String) {\n v.put(\"value\", (String) value);\n } else {\n v.put(\"value\", (Integer) value);\n }\n }", "public boolean put(String key, String value);", "public void put(Value key, Value value) {\n\t\tstorage.put(key, value);\n\t}", "private void addToGeoLocationContext(String key, Object value) {\n if (key != null && value != null && !key.isEmpty() ||\n (value instanceof String) && !((String) value).isEmpty()) {\n this.geoLocationPairs.put(key, value);\n }\n }", "public void put(int key, int value) {\n store[key] = value; // update operation= overwritten \n }", "@Override\r\n\tpublic void addValue(final IScope scope, final T value) {}", "public void put(GlobalTransaction tx, TransactionContext transactionContext)\n {\n if (tx == null)\n {\n log.error(\"key (GlobalTransaction) is null\");\n return;\n }\n gtx2ContextMap.put(tx, transactionContext);\n }", "public void setValue(K key, V value);", "public void setContexts(final String val) {\n contexts = val;\n }", "public Context addValue(String value) {\n String squery = getQueryString();\n if (getURI() == null && squery != null) {\n setQueryString(squery + value);\n }\n return this;\n }", "public static void setSharePreferenceValue(Context context, String prefId, String prefValue) {\n SharedPreferences pref = context.getSharedPreferences(PREFERENCES, PREFERENCE_MODE);\n SharedPreferences.Editor editor = pref.edit();\n\n editor.putString(prefId, prefValue);\n editor.commit();\n }", "public void put(String property, Object value)\n\t{\n\t\tglobal.put(property, global, value);\n\t}", "public void set_context(VariableSymbolTable context);", "public abstract void setValue(ELContext context,\n Object base,\n Object property,\n Object value);", "default void putEternally(@NonNull final String key, @NonNull final T value) {\n put(key, value, Duration.ofMillis(Long.MAX_VALUE));\n }", "boolean put(K key, V value);", "String put(Integer key, String value);", "void put(String key, int value) throws StorageException, ValidationException, KeyValueStoreException;", "@Override\r\n public V put(K key, V value){\r\n \r\n // Declare a temporay node and instantiate it with the key and\r\n // previous value of that key\r\n TreeNode<K, V> tempNode = new TreeNode<>(key, get(key));\r\n \r\n // Call overloaded put function to either place a new node\r\n // in the tree or update the exisiting value for the key\r\n root = put(root, key, value);\r\n \r\n // Return the previous value of the key through the temporary node\r\n return tempNode.getValue();\r\n }", "public static void saveToPrefs(Context context,String key, String value) {\n SharedPreferences prefs = getSettings();\n final SharedPreferences.Editor editor = prefs.edit();\n editor.putString(key, value);\n editor.apply();\n }", "public void setValue (Context c, Object v) throws PropertyException\n {\n throw new PropertyException(\"Cannot set the value of a function: \" + _vname);\n }", "public void put (String key, Object value) {\n if (trace) {\n getProfiler().checkPoint(\n String.format(\" %s='%s' [%s]\", key, value, Thread.currentThread().getStackTrace()[2])\n );\n }\n getMap().put (key, value);\n synchronized (this) {\n notifyAll();\n }\n }", "<T> void put(String key, T data);", "public int put(K key, V value) {\n return put(key, value, 1);\n }", "public static void set(FHIRRequestContext context) {\n contexts.set(context);\n if (log.isLoggable(Level.FINEST)) {\n log.finest(\"FHIRRequestContext.set: \" + context.toString());\n }\n }", "public void put(Object key, Object value) throws AspException\n {\n throw new AspReadOnlyException(\"Request\");\n }", "synchronized public static void putString(Context context, String key, String value, boolean commit) {\r\n\t\tensurePreferencesEditor(context);\r\n\t\tsPreferencesEditor.putString(key, value);\r\n\t\tif (commit) {\r\n\t\t\tsPreferencesEditor.commit();\r\n\t\t}\r\n\t\tif (sInstance != null) {\r\n\t\t\tsInstance.mSettings.put(key, value);\r\n\t\t}\r\n\t}", "@Override\n\tpublic void addAttributeContext(Attr key, String value) {\n\t\t\n\t\tif ( transLogModelThreadLocal.get().isTransLoggingOn() ) {\n\t\t\ttransLogModelThreadLocal.get().getAttributesConText().put(key, value);\n\t\t}\n\t}", "public void put(Object key, Object value) throws AspException\n {\n throw new AspReadOnlyException(\"Request.QueryString\");\n }", "@Override\n public Symbol put(String key, Symbol value) {\n value.setIndex(this.local++);\n return super.put(key, value);\n }", "public void put(T data){\r\n\t\tthis.data = data;\r\n\t}", "@Override\n\tpublic void put(S key, T val) {\n\t\t\n\t}", "public static void putBoolean(Context context, String key, boolean value) {\n getPreferenceEditor(getSharePreferences(context)).putBoolean(key, value).apply();\n }", "public void map(Object key, Text value, Context context) throws IOException, InterruptedException{\n val = value.toString();\n\t\tarr = val.split(\"\\\\s+\");\n\t\tprova.set(Long.parseLong(arr[1]));\n\t\tcontext.write(prova,one);\n\t\t\n }", "public static void setOtherPlayer(String value, Context context) {\n SharedPreferences prefs = context.getSharedPreferences(PREF, Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = prefs.edit();\n editor.putString(\"OtherPlayer\", value);\n editor.commit();\n }", "public void propertyPut(String k, int v) { m_exprCache.put(k,v); }", "public void put(Key key, Value value) {\n\t\tNode entry = new Node(key, value, current_node);\n\t\tcurrent_node = entry; size++;\n\t}", "public V put(K key, V value) {\r\n\t\t// if (this.contains(key)){\r\n\t\t// return this.changeValue(key, value);\r\n\t\t// } else {\r\n\t\treturn linearProbing(key, value);\r\n\t}", "public void put(String key, Object value)\n\t{\n\t\tverifyParseState();\n\t\tvalues.put(key, ValueUtil.createValue(value));\n\t}", "public static void setPrefStringData(Context context, String key, String value) {\n SharedPreferences appInstallInfoSharedPref = context.\n getSharedPreferences(APP_CONFIG_PREF, Context.MODE_PRIVATE);\n SharedPreferences.Editor appInstallInfoEditor = appInstallInfoSharedPref.edit();\n appInstallInfoEditor.putString(key, value);\n appInstallInfoEditor.apply();\n }", "synchronized public static void putInt(Context context, String key, int value, boolean commit) {\r\n\t\tensurePreferencesEditor(context);\r\n\t\tsPreferencesEditor.putInt(key, value);\r\n\t\tif (commit) {\r\n\t\t\tsPreferencesEditor.commit();\r\n\t\t}\r\n\t\tif (sInstance != null) {\r\n\t\t\tsInstance.mSettings.put(key, value);\r\n\t\t}\r\n\t}", "private void addToMobileContext(String key, String value) {\n if (key != null && value != null && !key.isEmpty() && !value.isEmpty()) {\n this.mobilePairs.put(key, value);\n }\n }", "void put(@NonNull String key, @NonNull T value, @NonNull LocalDateTime expiresAt);", "@Override\n public KVMessage put(String key, String value) {\n KVMessage rtn;\n persistWithoutUniqueCheck(key, value);\n rtn = new Message(KVMessage.StatusType.PUT_SUCCESS, key, value, null);\n return rtn;\n }", "public void putObject(long index, T value) {\n\t\tValueStoragePage<T> page = getOrCreatePage(getPageID(index));\n\t\tint n = page.getSize();\n\t\tpage.addObject(getPageOffset(index), value);\n\t\tnumProperties += page.getSize() - n;\n\t}", "public void put(Object key,Object value) {\n map.put(key,value);\n hashtable.put(key,value);\n }" ]
[ "0.7971816", "0.68549347", "0.66925126", "0.66729563", "0.6639439", "0.6483358", "0.6379533", "0.62048084", "0.61738133", "0.6161076", "0.61524445", "0.605999", "0.60394377", "0.60067695", "0.6005029", "0.59965456", "0.5964303", "0.5956682", "0.5951199", "0.5915999", "0.58962613", "0.5884698", "0.5883247", "0.58732164", "0.5810789", "0.5781264", "0.57632726", "0.57632726", "0.5761342", "0.57373667", "0.5736222", "0.57306504", "0.5704607", "0.5703052", "0.57013434", "0.5688939", "0.56798744", "0.5673577", "0.5668012", "0.5663875", "0.5640219", "0.56262493", "0.5626034", "0.5624017", "0.5623839", "0.5608783", "0.55890906", "0.55870265", "0.55762786", "0.5556882", "0.5555989", "0.554579", "0.5541383", "0.55366355", "0.55300725", "0.5483626", "0.5449943", "0.54490554", "0.54444534", "0.5442581", "0.543782", "0.5408402", "0.53913695", "0.5390835", "0.5377425", "0.53726095", "0.5366854", "0.5366695", "0.53554076", "0.5354859", "0.5336831", "0.5335763", "0.5327651", "0.5322333", "0.53126204", "0.53067917", "0.5306291", "0.52989775", "0.52955", "0.52915424", "0.5285859", "0.52823204", "0.5276092", "0.52688974", "0.5263813", "0.5256388", "0.52559114", "0.52524465", "0.5251809", "0.5235942", "0.5233471", "0.52329826", "0.5232026", "0.522723", "0.5226619", "0.52250797", "0.52228725", "0.5217113", "0.521534", "0.52116644", "0.5208505" ]
0.0
-1
Remove a context value if existing.
public static void remove(final String key) { Map<String, String> map = new HashMap<String, String>(data.get()); map.remove(key); data.set(map.isEmpty() ? Collections.<String, String> emptyMap() : Collections.<String, String> unmodifiableMap(map)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public V remove(K key, V value) {\n if (get(root, key) == value) {\n return delete(root, key).val;\n }\n return null;\n }", "public void removeContext(LoggerContext context) {\n/* 86 */ for (Map.Entry<String, AtomicReference<WeakReference<LoggerContext>>> entry : CONTEXT_MAP.entrySet()) {\n/* 87 */ LoggerContext ctx = ((WeakReference<LoggerContext>)((AtomicReference<WeakReference<LoggerContext>>)entry.getValue()).get()).get();\n/* 88 */ if (ctx == context) {\n/* 89 */ CONTEXT_MAP.remove(entry.getKey());\n/* */ }\n/* */ } \n/* */ }", "public boolean removeContext(String key) {\n return context.get().remove(key) != null;\n }", "public T remove(T value){\n\t return value;\n\t}", "public static void remove() {\n contexts.remove();\n log.finest(\"FHIRRequestContext.remove invoked.\");\n }", "@Override\n public V remove(K key, V value) {\n V val = get(key);\n if (val != null && value != null && val.equals(value)) {\n root = removeHelper(root, key);\n size -= 1;\n }\n return val;\n// throw new UnsupportedOperationException(\"Unsupported operation, sorry!\");\n }", "public void removeValue(Object value)\n\t{\n\t\tif (values.contains(value))\n\t\t{\n\t\t\tvalues.remove(value + \"\");\n\t\t}\n\t}", "public void removeValuePreferenceValue(Context context, String fileKey, Integer mode, String key) {\n SharedPreferences sharedPreferences = context.getSharedPreferences(fileKey, mode);\n sharedPreferences.edit()\n .remove(key)\n .apply();\n }", "public final void remove(@NotNull T value) {\n\t\tObject priorValue;\n\t\tboolean replaced;\n\t\tdo {\n\t\t\tpriorValue = this.value.get();\n\t\t\tObject newValue = remove(priorValue, value);\n\t\t\treplaced = this.value.compareAndSet(priorValue, newValue);\n\t\t} while (!replaced);\n\t}", "void removeValue(String key);", "@Override\n public V remove(K key, V value) {\n if (key == null) return null;\n if (get(key) != value) {\n return get(key);\n }\n root = remove(root, key);\n return get(key);\n }", "public static void remove(Context context, String key) {\n SharedPreferences sp = context.getSharedPreferences(FILE_NAME, Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sp.edit();\n editor.remove(key);\n SharedPreferencesCompat.apply(editor);\n }", "Property removeValue(PropertyValue<?, ?> value);", "@Override\n public void removeValue(String key) {\n SharedPreferences.Editor editor = preferences.edit();\n editor.remove(key);\n editor.apply();\n }", "@Override\n public V remove(K key, V value) {\n Node saveRemove = new Node(null,null);\n root = removeHelper(key,value,root,saveRemove);\n return saveRemove.value;\n }", "public void RemoveValue(int value)\n {\n // Check if the value already exists\n if(_valuesToPut.contains(value))\n {\n _valuesToPut.remove(value);\n }\n }", "public int remove(K key, V value) {\n return remove(key, value, 1);\n }", "@Override\n public boolean isEntryRemovedInContext(Object key) {\n return true;\n }", "public boolean remove(Object value)\r\n {\r\n if (!contains(value))\r\n return false;\r\n root = remove(root, value);\r\n return true;\r\n }", "public boolean remove(Object value) {\n\t\treturn false;\n\t}", "@Override\n\tpublic void removeValue(String arg0) {\n\t}", "@Override\n\tpublic void removeContext(final org.apache.logging.log4j.spi.LoggerContext context) {\n\t\tif (context instanceof LoggerContext) {\n\t\t\tselector.removeContext((LoggerContext) context);\n\t\t}\n\t}", "private void removeContext(final String contextId) {\n synchronized (contexts) {\n contexts.remove(contextId);\n LOGGER.info(\"cleared context '\" + contextId + \"'\");\n }\n }", "public static Object remove(String key){\n return getThreadContext().remove(key);\n }", "public void removeContext(String namespace, String key) {\n Map<String, String> namespaceMap = context.get(namespace);\n if (namespaceMap != null) {\n namespaceMap.remove(key);\n }\n }", "public void remove(Value v)\n\t{\n\t\tif (this.cache.containsKey(v.getKey()))\n\t\t{\n\t\t\tthis.cache.remove(v.getKey());\n\t\t}\n\t\telse\n\t\t{\n//\t\t\tthis.lock.writeLock().lock();\n\t\t\tthis.db.remove(v.getKey());\n//\t\t\tthis.lock.writeLock().unlock();\n\t\t}\n//\t\tthis.lock.writeLock().lock();\n\t\tthis.keys.remove(v.getKey());\n//\t\tthis.lock.writeLock().unlock();\n\t}", "public void deleteConfigurationValue(String name);", "public void removeInterpretedBy( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.remove(this.model, this.getResource(), INTERPRETEDBY, value);\r\n\t}", "public void removeValue(EObject container, EStructuralFeature structuralFeature, Object value) {\n\t\tDEModelLocker.activateWriter(this);\n\t\t\n\t\ttry {\n\t\t\tEList<?> currentListValue = getManyValueOrFail(container, structuralFeature);\n\t\t\t\n\t\t\t//Schedule remove\n\t\t\tscheduleRemove(container, container, structuralFeature, value);\n\t\t\t\n\t\t\t//Perform remove\n\t\t\tcurrentListValue.remove(value);\n\t\t\t//Remove on opposite reference is performed automatically.\n\t\t} finally {\n\t\t\tDEModelLocker.deactivateWriter(this);\n\t\t}\n\t}", "@Override\n public void removePreferenceAndUpdateWidget(Context ctx) {\n IngredientSharedPreference.removePreferences(ctx);\n updateWidget(ctx);\n }", "public Future<CtxModelObject> remove(CtxIdentifier identifier);", "public void removeFromEvents(final SessionContext ctx, final SapEvent value)\n\t{\n\t\tEVENTSHANDLER.removeValue( ctx, this, value );\n\t}", "@Request(id = 23, retryable = false, response = ResponseMessageConst.BOOLEAN)\n Object remove(String name, Data key, @Nullable Data currentValue, int completionId);", "UserSettings remove(String key);", "@Override\n\tpublic void contextDeleted(String context, boolean toolPlacement) {\n\t}", "public boolean remove(T value) {\n checkForNull(value);\n\n if (!childrenValueSet.contains(value)) {\n return false;\n }\n\n childrenValueSet.remove(value);\n\n Iterator<Tree<T>> iterator = children.iterator();\n while (iterator.hasNext()) {\n if (value.equals(iterator.next().getValue())) {\n iterator.remove();\n incModificationCount();\n\n return true;\n }\n }\n\n return false;\n }", "public boolean removeSelectedValue( final T selectedValue ) {\r\n List< T > selectedValues = getSelectedValuesChoicesObject();\r\n return selectedValues.remove( selectedValue );\r\n }", "boolean remove(Object key, Object value);", "@Override\n public V remove(K key) {\n return delete(root, key).val;\n }", "public void remove(Object key, Object value) {\n map.get(key).remove(value);\n }", "public void removeInterpretedBy(Contact value) {\r\n\t\tBase.remove(this.model, this.getResource(), INTERPRETEDBY, value);\r\n\t}", "@Override\n\tpublic void remove(String k, Value v)\n\t{\n\t\t\n\t}", "@Override\n\tpublic void remove(String k, Value v)\n\t{\n\t\t\n\t}", "public void removeDataItem(E value) {\n\t\tdata.remove(value);\n\t}", "public void removeParameterValue(String serviceProviderCode, String parameterName, String parameterValue,\r\n\t\t\tString callerID) throws AAException, RemoteException;", "public static boolean remove(Context context){\n SharedPreferences.Editor editor= getSharedPreferences(context)\n .edit();\n editor.putString(USERNAME,null);\n editor.putString(PASSWORD,null);\n editor.putString(GENDER,null);\n editor.putString(ADDRESS,null);\n editor.commit();\n return true;\n }", "public static void remove(Context c, String key) {\n if (c == null) return;\n SharedPreferences sharedPreferences = c.getSharedPreferences(SharedPrefsUtil.FILE_USER, Context.MODE_PRIVATE);\n Editor editor = sharedPreferences.edit();\n editor.remove(key);\n editor.apply();\n }", "default void remove(String key, Object value) {\n\t\tSearchCritera searchCritera = new SearchCritera(key, value);\n\t\tremove(() -> searchCritera);\n\t}", "void remove(KeyType key, ValueType value);", "private void deleteOne(String value){\n\t\tnumCache.put(value, numCache.get(value) - 1);\n\t\tif (numCache.get(value) == 0){\n\t\t\tnumCache.remove(value);\n\t\t}\n\t}", "public boolean removeItem(int value) {\n if (root == null) {\n return false;\n } else {\n return remove(value, root, null);\n }\n }", "public V remove(K key, V value) {\n if (key == null || !keySet.contains(key))\n return null;\n int index = reduce(key, buckets.size());\n ArrayList<Entry> items = buckets.get(index);\n for (Entry e : items) {\n if (e.key.equals(key)) {\n if (e.value.equals(value)) {\n\n items.remove(e);\n keySet.remove(key);\n numEntries--;\n return e.value;\n }\n }\n }\n return null;\n }", "public static void removeUserAge(Context context) {\n\n context.getSharedPreferences(FILE_NAME, 0)\n .edit()\n .remove(USER_AGE_KEY)\n .apply();\n }", "@Override\n\tpublic boolean remove(Object value) {\n\t\ttry {\n\t\t\tremove(indexOf(value));\n\t\t}catch(IndexOutOfBoundsException e){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public void unset(String target){\n\t\tif (target == null){\n\t\t\tLog.e(NAME, \"Invalid parameters for 'unset' method!\");\n\t\t\treturn;\n\t\t}\n\t\tif (valueCache.containsKey(target)){\n\t\t\tString value = valueCache.get(target);\n\t\t\tdeleteOne(value);\n\t\t\tvalueCache.remove(target);\n\t\t}\n\t}", "boolean remove(final K key, final V value);", "public void unsetValue()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_attribute(VALUE$12);\n }\n }", "@Override\n public boolean remove(T item) {\n //find the node with the value\n Node n = getRefTo(item);\n //make sure it actually is in the set\n if(n == null)\n return false;\n //reassign the value from the first node to the removed node\n n.value = first.value;\n //take out the first node\n remove();\n return true;\n }", "public boolean remove(int val) {\r\n return set.remove(val);\r\n }", "@Override\n public V remove(K key) {\n V val = get(key);\n if (val != null) {\n root = removeHelper(root, key);\n size -= 1;\n }\n return val;\n// throw new UnsupportedOperationException(\"Unsupported operation, sorry!\");\n }", "public void test_removeTypedValue_accuracy() {\n instance.addTypedValue(typedValue);\n assertTrue(\"The TypedValue is not added properly.\", instance.containsTypedValue(typedValue));\n\n instance.removeTypedValue(typedValue);\n assertFalse(\"The element is not removed properly.\", instance.containsTypedValue(typedValue));\n }", "@Override\n\tpublic boolean remove(Object value) {\n\t\tint index = indexOf(value);\n\n\t\tif (index == -1) {\n\t\t\treturn false;\n\t\t}\n\n\t\tremove(index);\n\t\treturn true;\n\t}", "public boolean remove(T value) {\n int prevSize = size;\n root = remove( value, root );\n\n return prevSize != size;//return true if size changed\n\n }", "public static void clearPreferencesTheKey(Context context,String key){\n SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);\n SharedPreferences.Editor editor = preferences.edit();\n editor.remove(key);\n editor.commit();\n }", "public boolean remove(String key, V value) {\n Collection<V> values = map.get(key);\n\n if (values != null) {\n return values.remove(value);\n }\n\n return false;\n }", "public abstract void removeAction(Context context, NAAction action);", "Entry<Key, Value> remove(Entry<Key, Value> entry);", "public HiveRemoveUserFromInitiative(Context context){\n this.context = context;\n }", "public void removeTime( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.remove(this.model, this.getResource(), TIME, value);\r\n\t}", "void removeRemoteConnectionContextObject( String key );", "public static void clearContext() {\n log.debug(\"Clearing the current HTTP Request Headers context\");\n context.remove();\n }", "public void removeUserDefinedFrame(UserDefinedFrame value) {\r\n\t\tBase.remove(this.model, this.getResource(), USERDEFINEDFRAME, value);\r\n\t}", "public static void removeUserWeight(Context context) {\n\n context.getSharedPreferences(FILE_NAME, 0)\n .edit()\n .remove(USER_WEIGHT_KEY)\n .apply();\n }", "@Override\n public T remove(Object key) {\n // Do I have an entry for it?\n Map.Entry<String, T> entry = entries.get((String) key);\n if (entry != null) {\n entries.remove(key);\n // Change the underlying map.\n return map.remove(prefix + key);\n }\n return null;\n }", "private TreeNode remove(TreeNode node, Object value)\r\n {\r\n int diff = ((Comparable<Object>)value).compareTo(node.getValue());\r\n if (diff == 0) // base case\r\n node = removeRoot(node);\r\n else if (diff < 0)\r\n node.setLeft(remove(node.getLeft(), value));\r\n else // if (diff > 0)\r\n node.setRight(remove(node.getRight(), value));\r\n return node;\r\n }", "public void removeRuleRef(org.semanticwb.model.RuleRef value);", "public void removeHasSynchronizedText(SynchronizedText value) {\r\n\t\tBase.remove(this.model, this.getResource(), HASSYNCHRONIZEDTEXT, value);\r\n\t}", "public Object remove();", "private DeleteByValue() {}", "private DeleteByValue() {}", "Form removeProperty(String key);", "public void instanceRemoved(Contextual<?> bean, CreationalContext<?> context, Object instance);", "public void removeUniqueFileIdentifier( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.remove(this.model, this.getResource(), UNIQUEFILEIDENTIFIER, value);\r\n\t}", "void remove(ThreadLocal<?> key) {\n cleanUp();\n\n for (int index = key.hash & mask;; index = next(index)) {\n Object reference = table[index];\n\n if (reference == key.reference) {\n // Success!\n table[index] = TOMBSTONE;\n table[index + 1] = null;\n tombstones++;\n size--;\n return;\n }\n\n if (reference == null) {\n // No entry found.\n return;\n }\n }\n }", "public boolean remove(int val) {\n if (map.containsKey(val)) {\n map.remove(val);\n return true;\n }\n return false;\n }", "public V remove(K key){\n\t\tV v=null;\n\t\tNode n=searchkey(root, key);\n\t\tif(n!=null)\n\t\t{v=n.value;}\n\t\troot =deletehelp(root, key);\n\t\t\n\t\treturn v;\n\t\t\n\t\t\n\t}", "protected void clearContextTx(String context)\n\t{\n\t\tString sql = \"DELETE FROM MNEME_QUESTION WHERE CONTEXT=?\";\n\n\t\tObject[] fields = new Object[1];\n\t\tfields[0] = context;\n\n\t\tif (!this.sqlService.dbWrite(sql, fields))\n\t\t{\n\t\t\tthrow new RuntimeException(\"clearContext: dbWrite failed\");\n\t\t}\n\t}", "public String remove(String key, String value) throws DictionaryException {\n\t\tSystem.out.println(\"Going to remove value : \" + value + \" for Key : \" + key);\n\t\tMap<String, List<String>> dictMap = getDictionary();\n\t\tif (dictMap != null && dictMap.isEmpty() != true) {\n\t\t\tif (dictMap.containsKey(key)) {\n\t\t\t\tList<String> membersList = dictMap.get(key);\n\t\t\t\tif (membersList.contains(value)) {\n\t\t\t\t\tmembersList.remove(value);\n\t\t\t\t\tif (membersList != null && membersList.isEmpty())\n\t\t\t\t\t\tdictMap.remove(key);\n\t\t\t\t} else {\n\t\t\t\t\tthrow new DictionaryException(ExceptionConstant.VALUE_EXIST_ERROR);\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\tthrow new DictionaryException(ExceptionConstant.KEY_EXIST_ERROR);\n\t\t}\n\t\treturn ApplicationMessage.REMOVE_SUCCESS_MSG;\n\n\t}", "public void removeCurrent( )\n {\n // Implemented by student.\n }", "public void removeLength( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.remove(this.model, this.getResource(), LENGTH, value);\r\n\t}", "public static void removeUserTargetWeight(Context context) {\n\n context.getSharedPreferences(FILE_NAME, 0)\n .edit()\n .remove(USER_TARGETWEIGHT_KEY)\n .apply();\n }", "@Override\n\tpublic V remove(Object key) {\n\t\treturn null;\n\t}", "@Override\n\tpublic V remove(Object key) {\n\t\treturn null;\n\t}", "public void removedetails(){\n SharedPreferences.Editor editor = userDetails.edit();\n editor.clear();\n editor.commit();\n\n }", "public static void removeUserHeight(Context context) {\n\n context.getSharedPreferences(FILE_NAME, 0)\n .edit()\n .remove(USER_HEIGHT_KEY)\n .apply();\n }", "public void removeUniqueFileIdentifier(java.lang.String value) {\r\n\t\tBase.remove(this.model, this.getResource(), UNIQUEFILEIDENTIFIER, value);\r\n\t}", "public void removeEncodedBy(Contact value) {\r\n\t\tBase.remove(this.model, this.getResource(), ENCODEDBY, value);\r\n\t}", "public void removeInvolvedPerson(InvolvedPerson value) {\r\n\t\tBase.remove(this.model, this.getResource(), INVOLVEDPERSON, value);\r\n\t}", "Object remove();", "public static void removeUserGender(Context context) {\n\n context.getSharedPreferences(FILE_NAME, 0)\n .edit()\n .remove(USER_GENDER_KEY)\n .apply();\n }", "public void removeGeneralEncapsulatedObject(DataObject value) {\r\n\t\tBase.remove(this.model, this.getResource(), GENERALENCAPSULATEDOBJECT, value);\r\n\t}" ]
[ "0.62733376", "0.6225391", "0.61636686", "0.6034623", "0.5972314", "0.5936324", "0.5897838", "0.58686435", "0.58138686", "0.57999843", "0.57183725", "0.57161456", "0.57021916", "0.5686105", "0.55454874", "0.55454874", "0.5492868", "0.54778427", "0.54548264", "0.5407586", "0.53992134", "0.53913057", "0.53166604", "0.531235", "0.53041977", "0.52916867", "0.5277524", "0.5251165", "0.5243319", "0.5225266", "0.5216141", "0.5214076", "0.52126265", "0.52044654", "0.5202273", "0.5162025", "0.51378095", "0.512642", "0.511678", "0.5112393", "0.5103398", "0.508443", "0.508443", "0.5081182", "0.5075163", "0.50748324", "0.5074488", "0.50714445", "0.5055548", "0.5051973", "0.5046321", "0.5029605", "0.5028423", "0.5021587", "0.50204486", "0.5018898", "0.5013698", "0.5008038", "0.5004555", "0.50026655", "0.49815238", "0.49790898", "0.49739313", "0.4969093", "0.4966503", "0.49662733", "0.4966124", "0.49632657", "0.49475586", "0.49376422", "0.49011865", "0.48979753", "0.48773605", "0.48715413", "0.48639166", "0.48635197", "0.4862185", "0.48583224", "0.48576137", "0.48576137", "0.48553872", "0.48520482", "0.4850079", "0.48494512", "0.48479527", "0.48447716", "0.48406494", "0.4836594", "0.4835197", "0.48106563", "0.4810547", "0.4808535", "0.4808535", "0.4803072", "0.47868598", "0.47742102", "0.4769966", "0.4769726", "0.4766771", "0.47629994", "0.47614205" ]
0.0
-1
Remove all existing context values.
public static void clear() { data.set(Collections.<String, String> emptyMap()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void clearContext() {\n log.debug(\"Clearing the current HTTP Request Headers context\");\n context.remove();\n }", "public void removeVars(){\n this.values = new HashMap<>();\n }", "@Override\n public void removeAllValues() {\n Map<String, ?> map = preferences.getAll();\n Iterator<String> iterator = map.keySet().iterator();\n while (iterator.hasNext()) {\n removeValue(iterator.next());\n }\n }", "public static void clearAllPreferences(Context context){\n SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);\n SharedPreferences.Editor editor = preferences.edit();\n editor.clear();\n editor.commit();\n }", "public void clear()\r\n {\r\n otherValueMap.clear();\r\n }", "public void clear() {\n context = null;\n nestedElements.clear();\n }", "public void clear() {\n values.clear();\n }", "void clear(@NonNull ContextSet contextSet);", "protected void clearContexts() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.icu.impl.coll.CollationDataBuilder.clearContexts():void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.icu.impl.coll.CollationDataBuilder.clearContexts():void\");\n }", "public Builder clearContext() {\n \n context_ = 0;\n onChanged();\n return this;\n }", "public static void clear() {\n\t\tThreadContext.clear();\n\t}", "public void removeContext(LoggerContext context) {\n/* 86 */ for (Map.Entry<String, AtomicReference<WeakReference<LoggerContext>>> entry : CONTEXT_MAP.entrySet()) {\n/* 87 */ LoggerContext ctx = ((WeakReference<LoggerContext>)((AtomicReference<WeakReference<LoggerContext>>)entry.getValue()).get()).get();\n/* 88 */ if (ctx == context) {\n/* 89 */ CONTEXT_MAP.remove(entry.getKey());\n/* */ }\n/* */ } \n/* */ }", "public void resetContexto()\r\n {\r\n this.contexto = null;\r\n }", "public static void remove() {\n contexts.remove();\n log.finest(\"FHIRRequestContext.remove invoked.\");\n }", "public void clearAll(boolean clearContext, TaskMonitor monitor);", "public void clear() {\n synchronized (LOCK) {\n myValues.clear();\n }\n }", "public static void clean() {\n kryoThreadLocalContext.remove();\n }", "public void unsetEntityContext() {\n _ctx = null;\n }", "private static void clear() {\n Context context = Leanplum.getContext();\n if (context != null) {\n SharedPreferences.Editor editor = context.getSharedPreferences(\n \"__leanplum__\", Context.MODE_PRIVATE).edit();\n if (editor != null) {\n editor.clear();\n editor.apply();\n }\n\n editor = context.getSharedPreferences(\"__leanplum_push__\", Context.MODE_PRIVATE).edit();\n if (editor != null) {\n editor.clear();\n editor.apply();\n }\n }\n }", "public void delContextNodes();", "public void evictAll() {\n cacheManager.getCache(DomainValueRepository.DomainValueCache.DOMAIN_VALUE_BY_DOMAIN_ID).clear();\n }", "protected void resetValues() {\n synchronized (values) {\n values.removeAll(new ArrayList(values));\n }\n }", "@Override\n public void resetAllValues() {\n }", "public static void clearPreferences(Context context) {\n SharedPreferences.Editor editor = getSharedPreferences(context).edit();\n editor.clear();\n editor.apply();\n }", "public void clearAllPreferenceData() {\n sharedPreferences.edit().clear().apply();\n }", "public void clear(IClientContext context) throws Exception;", "public Builder clearContext() {\n \n context_ = getDefaultInstance().getContext();\n onChanged();\n return this;\n }", "public Builder clearContext() {\n \n context_ = getDefaultInstance().getContext();\n onChanged();\n return this;\n }", "void exit() {\n\t\tfor (ScopedProvider<?> e : scopedProviders.keySet()) {\n\t\t\tsynchronized(e) {\n\t\t\t\te.values.clear();\n\t\t\t}\n\t\t}\n\t}", "public void reset() {\n\t\treset(ModSettings.currentContext);\n\t}", "private void clearTemporaryData() {\n\n numbers.stream().forEach(n -> {\n n.setPossibleValues(null);\n n.setUsedValues(null);\n });\n }", "void deleteAllRelatedContext(String contextMetaDataId);", "public com.dj.model.avro.LargeObjectAvro.Builder clearContextId() {\n contextId = null;\n fieldSetFlags()[0] = false;\n return this;\n }", "public void clearLinks(){\r\n varContextObject=null; \r\n varContextFields=null; \r\n }", "static void clearCache() {\n CONFIG_VALUES = null;\n RUN_MODE = null;\n }", "public final void clear() {\r\n variablesCache.clear();\r\n }", "public static void clear(){\n preferences.edit().clear().apply();\n }", "public static void clearAllSavedUserData() {\n cacheUser = null;\n cacheAccessToken = null;\n getSharedPreferences().edit().clear().commit();\n }", "@Override\r\n\tpublic void clearAll() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void clearAll() {\n\t\t\r\n\t}", "private static void clearHolder() {\n log.debug(\"Clear ApplicationContext in SpringContextHolder:\"\n + applicationContext);\n applicationContext = null;\n }", "public void clearAll() {\n\t\tuserMap.clear();\n\t}", "protected void clearData() {\n getValues().clear();\n getChildIds().clear();\n getBTreeMetaData().setDirty(this);\n }", "protected void clearContextTx(String context)\n\t{\n\t\tString sql = \"DELETE FROM MNEME_QUESTION WHERE CONTEXT=?\";\n\n\t\tObject[] fields = new Object[1];\n\t\tfields[0] = context;\n\n\t\tif (!this.sqlService.dbWrite(sql, fields))\n\t\t{\n\t\t\tthrow new RuntimeException(\"clearContext: dbWrite failed\");\n\t\t}\n\t}", "public void reset(String context) {\n\t\tset(defaultValue, context);\n\t}", "private void clearLocals() {\n this.map = null;\n this.inputName = null;\n }", "public void clear() {\n\t\tif(this.values!=null){\n\t\t\tthis.values.clear();\n\t\t}\n\t}", "public void clear() {\n helpers.clear();\n islandKeysCache.clear();\n setDirty();\n }", "private void clean() {\n aggregatedValues.clear();\n this.numMessageSent = 0;\n this.numMessageReceived = 0;\n }", "public synchronized void resetCustomValues() {\n customValues = null;\n }", "public void clearAllPreference() {\n editor.clear();\n editor.apply();\n }", "@Override\r\n\tpublic void clearALL() {\n\t\tjavaScriptWindow.propertyTable = null;\r\n\r\n\t}", "public static void clear() {\r\n for (ConfigurationOption<?> opt : OPTIONS.values()) {\r\n opt.clear();\r\n }\r\n }", "public final synchronized void removeAllAttributes() {\n\t if ( m_cache != null)\n\t \tm_cache.clear();\n\t m_cache = null;\n\t}", "public void resetValues() {\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(CUREDIFFICULTY, null);\n editor.putInt(CURETARGETSCORE, 0);\n editor.putInt(CURRSCOREFINDCURE, 0);\n editor.apply();\n System.out.println(sharedPreferences.getAll());\n\n }", "@Override\n\tpublic void clearAll() {\n\t\t\n\t}", "private <T extends IEntity> void clearRetrieveValues(T entity) {\n Key pk = entity.getPrimaryKey();\n entity.clear();\n entity.setPrimaryKey(pk);\n }", "public void removeAllData() {\n dbHelper.removeAllData(db);\n }", "public synchronized void resetMemoryValues() {\n memoryValues = null;\n }", "public void clear()\r\n {\r\n for (int i = 0; i < values.length; i++)\r\n keys[i] = null;\r\n size = 0;\r\n }", "public void clearHash() {\r\n\t\tinternedTexts.clear();\r\n\t\tinternedAttributes.clear();\r\n\t}", "public void clearCachedArguments() {\n\t\tObject[] args = getCachedArguments();\n\t\tfor (int i = 0; i < args.length; i++) {\n\t\t\targs[i] = null;\n\t\t}\n\t}", "private void clear() {\n\t\t\tkeySet.clear();\n\t\t\tvalueSet.clear();\n\t\t\tsize = 0;\n\t\t}", "public void clearAll();", "public void clearAll();", "@Override\n public void removeAttributes()\n {\n attributes.clear();\n }", "private void clearAll( )\n {\n for( Vertex v : vertexMap.values( ) )\n v.reset( );\n }", "public void reset() {\r\n properties.clear();\r\n }", "public void clearContext(String namespace) {\n if (context != null) {\n context.remove(namespace);\n }\n }", "public void removeAllSharedPreference(Context context, String fileKey, Integer mode) {\n SharedPreferences sharedPreferences = context.getSharedPreferences(fileKey, mode);\n sharedPreferences.edit()\n .clear()\n .apply();\n }", "public void clean(){\n preprocessorActionsPerFile.clear();\n }", "public static void clearAll(Context ctx){\n \t\t// delete files\n \t\tfor( File f : getCachedFiles(ctx) ){\n \t\t\tf.delete();\n \t\t}\n \t}", "public void resetVariables(){\n\t\tthis.queryTriplets.clear();\n\t\tthis.variableList.clear();\n\t\tthis.prefixMap.clear();\n\t}", "public void clearAllNotClientCacheKeyOrDatabaseKey() {\n\t}", "void reset(){\n if (vars!=null){\n vars.clear();\n }\n if (gVars!=null){\n gVars.clear();\n }\n }", "public void unsetEntityContext() {\n testAllowedOperations(\"unsetEntityContext\");\n }", "public static void clearApplicationData(Context context) {\r\n File cache = context.getCacheDir();\r\n File appDir = new File(cache.getParent());\r\n if (appDir.exists()) {\r\n String[] children = appDir.list();\r\n for (String s : children) {\r\n if (!s.equals(\"lib\")) {\r\n deleteDir(new File(appDir, s));\r\n }\r\n }\r\n }\r\n }", "public static void unsetExecutionContext() {\r\n\t\tServletLoggingOutput.servlets.set(null);\r\n\t}", "public void clean();", "public void clean();", "public void clean();", "public void clean();", "public void clear(){\n\t\tMap<?, ?> bindings = m_bindings.getBindings();\n\t\tif (bindings == null) {\n\t\t\tif(log.isInfoEnabled()){\n\t\t\t\tlog.info(\"clear: no bindings!\");\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tbindings.clear();\t\n\t\tm_bindings.remove();\t\t\n\t}", "public void Clean()\n\t{\n\t\tstorage.clear();\n\t}", "public void reset() {\r\n\t\tscopedContext = new NamedScopeEvaluationContext();\r\n\t\texpressionParser = new SpelExpressionParser();\r\n\t\t\r\n\t\t// init named contexts\r\n\t\tscopedContext.addContext(\"model\", model);\r\n\t}", "public void clear() {\n\t\tconfigurationToButtonMap.clear();\n\t\tselected.clear();\n\t\tsuper.removeAll();\n\t}", "public synchronized void removeAll() {\r\n\t\tif (trackedResources == null)\r\n\t\t\treturn;\r\n\t\tPair<IPath, IResourceChangeHandler>[] entries = (Pair<IPath, IResourceChangeHandler>[]) trackedResources.toArray(new Pair[trackedResources.size()]);\r\n\t\tfor (Pair<IPath, IResourceChangeHandler> entry : entries) {\r\n\t\t\tremoveResource(entry.first, entry.second);\r\n\t\t}\r\n\t}", "public void clean()\r\n {\r\n this.extension = null;\r\n this.extensionValueList = null;\r\n this.extensionLabelList = null;\r\n this.archivoVO = null;\r\n this.archivoVOValueList = null;\r\n this.archivoVOLabelList = null;\r\n this.nuevoNombre = null;\r\n this.nuevoNombreValueList = null;\r\n this.nuevoNombreLabelList = null;\r\n this.action = null;\r\n this.actionValueList = null;\r\n this.actionLabelList = null;\r\n }", "public void removeProperties() {\n HttpSession session = (HttpSession) _currentSession.get();\n if (session != null) {\n \n // Removing the attributes directly throws a ConcurentModificationException in Tomcat\n ArrayList attributeNames = new ArrayList();\n Enumeration enuAttributes = session.getAttributeNames();\n while (enuAttributes.hasMoreElements()) {\n String nextAttribute = (String) enuAttributes.nextElement();\n attributeNames.add(nextAttribute);\n }\n Iterator itAttributes = attributeNames.iterator();\n while (itAttributes.hasNext()) {\n String nextAttribute = (String) itAttributes.next();\n session.removeAttribute(nextAttribute);\n }\n }\n }", "protected void clear() {\r\n setValue(getDefault());\r\n }", "public void clearRequestContext() {\r\n if (SeamUtilities.isSeamEnvironment()) {\r\n try {\r\n getRequestMap().clear();\r\n } catch (IllegalStateException ise) {\r\n // Can be thrown in Seam example applications as a result of\r\n // eg. logout, which has already invalidated the session.\r\n if (redirectRequested()) {\r\n throw new RedirectException(redirectTo());\r\n }\r\n }\r\n }\r\n }", "public void clearProduction() {\n genClient.clear(CacheKey.production);\n }", "public static void clearPreferencesTheKey(Context context,String key){\n SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);\n SharedPreferences.Editor editor = preferences.edit();\n editor.remove(key);\n editor.commit();\n }", "@Override\n\tpublic void contextDeleted(String context, boolean toolPlacement) {\n\t}", "public void clearPrefs() {\n getSharedPreferencesEditor().clear().apply();\n }", "private void clearInsertingValues() {\n mapFieldsIntegers.clear();\n mapFieldsStrings.clear();\n }", "public void clearAllResponseData() {\n myExpData.clear();\n }", "@SneakyThrows\n public void deleteKeysFromMemory() {\n Preferences.userRoot().clear();\n }", "void invalidateProperties() {\n super.invalidateProperties();\n token_ = null;\n }", "public PolicyVariables clearRuleVariablesEntries() {\n this.ruleVariables = null;\n return this;\n }", "public static void removeAll() {\n\t\tgetPersistence().removeAll();\n\t}" ]
[ "0.6809294", "0.6513132", "0.64969534", "0.63810915", "0.63729113", "0.6193308", "0.6185488", "0.61840457", "0.60609365", "0.60284036", "0.60163075", "0.6004637", "0.6003392", "0.6001635", "0.59944725", "0.5988579", "0.5980323", "0.59563726", "0.59459656", "0.59280723", "0.59152853", "0.59093565", "0.58990854", "0.5868644", "0.58681977", "0.5864114", "0.5845705", "0.5845705", "0.58340555", "0.581732", "0.5813836", "0.5786818", "0.5778438", "0.57584494", "0.5738148", "0.5722096", "0.5718988", "0.5718227", "0.5703637", "0.5703637", "0.5702445", "0.5699117", "0.5681261", "0.5679778", "0.5679095", "0.5677276", "0.5672163", "0.5668146", "0.5661985", "0.56548554", "0.5654095", "0.56401366", "0.56286573", "0.56216323", "0.5605053", "0.55771554", "0.556609", "0.55660313", "0.5547022", "0.5546663", "0.5544497", "0.55175877", "0.5515109", "0.5512048", "0.5512048", "0.55112344", "0.55045164", "0.55044585", "0.5503395", "0.5502819", "0.5484678", "0.54823977", "0.54815316", "0.5471896", "0.54663634", "0.546274", "0.5451217", "0.54404455", "0.5425739", "0.5425739", "0.5425739", "0.5425739", "0.5421726", "0.54210544", "0.54204226", "0.5419696", "0.54153454", "0.54097176", "0.54076415", "0.5399164", "0.5393583", "0.5391607", "0.5388382", "0.5384462", "0.5382778", "0.53782475", "0.5366758", "0.5362462", "0.5355187", "0.5355066", "0.5353432" ]
0.0
-1
Set the directory where package lists for offline linking are stored. The directory will contain a directory for each library that will be linked offline. In each library directory will be the package list and a file named url that contains the URL where the documentation is hosted.
public Javadoc packageLists(File directory) { this.packageLists = directory; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setPackageUrl(String packageUrl);", "public static void setDownloadDirectory(String downloadDirectory) {\n DownloadManager.downloadDirectory = downloadDirectory;\n }", "void setDirectory(File dir);", "void setAppRootDirectory(String rootDir);", "public void setRootDir(String rootDir);", "@FXML\n private void setDirectoryOfPostVersionLists() {\n setPathToRootOfPostVersionLists();\n indexPostVersionListsInRootPath();\n }", "public static String createDownloadDirectory() {\n \tvar downloadDirectory = Configuration.toString(\"downloadDirectory\");\n \tif (downloadDirectory == null) {\n \t\tdownloadDirectory = \"../../Downloads\";\n \t}\n return downloadDirectory;\n }", "@Override\r\n\t\tpublic void setDir(String dir)\r\n\t\t\t{\n\t\t\t\t\r\n\t\t\t}", "public static String getDownloadDirectory() {\n return downloadDirectory;\n }", "public String getPackageDownloadUrl();", "public void filesLocation (String externalFolder) {\n externalStaticFileFolder = externalFolder;\n }", "abstract public void setRingResourcesDir(String path);", "private void addPackageDirFiles(WebFile aDir, List aList)\n{\n boolean hasNonPkgFile = false;\n for(WebFile child : aDir.getFiles())\n if(child.isDir() && child.getType().length()==0)\n addPackageDirFiles(child, aList);\n else hasNonPkgFile = true;\n if(hasNonPkgFile || aDir.getFileCount()==0) aList.add(aDir);\n}", "void downloadingFolder(String remoteFolder);", "public void setCacheDirectory(String directory) {\n this.localRepository = directory;\n this.customized = true;\n }", "public void setDir(File dir) {\n this.dir = dir;\n }", "@attribute(value = \"\", required = true)\t\r\n\tpublic void setDir(String dir) {\r\n\t\tthis.dir = new File(dir);\r\n\t}", "void setKarafInstallDir(String installDir);", "private Directories() {\n\n\t}", "public void setApplicationDir( String path ) {\r\n SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);\r\n Editor editor = preferences.edit();\r\n editor.putString(LibraryConstants.PREFS_KEY_BASEFOLDER, path);\r\n editor.commit();\r\n resetManager();\r\n }", "public static String downloadDir() {\n\n String downloads = stringValue(\"treefs.downloads\");\n if(isNullOrEmpty(downloads)) {\n // default home location\n downloads = home() + File.separator + \"downloads\";\n } else {\n downloads = home() + File.separator + downloads;\n }\n\n System.out.println(\"downloadDir=\" + downloads);\n return downloads;\n }", "private static void setupLibrary() {\r\n /*\r\n * For using over http:// and https://\r\n */\r\n DAVRepositoryFactory.setup();\r\n /*\r\n * For using over svn:// and svn+xxx://\r\n */\r\n SVNRepositoryFactoryImpl.setup();\r\n\r\n /*\r\n * For using over file:///\r\n */\r\n FSRepositoryFactory.setup();\r\n }", "public void setDir(File d) {\r\n this.dir = d;\r\n }", "@Override\n public void setUrl(String url) {\n if (LOGGER.isDebugEnabled()) {\n LOGGER.debug(\"Directory manager \" + directoryManager);\n }\n try {\n super.setUrl(directoryManager.replacePath(url));\n } catch (Exception e) {\n LOGGER.error(\"Exception thrown when setting URL \", e);\n throw new IllegalStateException(e);\n }\n }", "public void setDefDir(String d) {\n\n\t\tdefDir = d;\n\n\t}", "@Override\n public void setOutputDir(String outputDir) {\n this.outputDir = outputDir;\n }", "public void setDir(File dir)\n {\n this.dir = dir;\n }", "private static File setYdfDirectory()\r\n/* 27: */ throws IOException\r\n/* 28: */ {\r\n/* 29: 32 */ log.finest(\"OSHandler.setYdfDirectory\");\r\n/* 30: 33 */ ydfDirectory = new File(USER_HOME + \"/\" + \".yourdigitalfile\");\r\n/* 31: 34 */ ydfDirectory.mkdir();\r\n/* 32: 35 */ return ydfDirectory;\r\n/* 33: */ }", "public static void setRootDirectory(String rootDirectory) {\n\t\tROOT_DIRECTORY = new File(rootDirectory);\n\t\tAPPS_DIRECTORY = new File(ROOT_DIRECTORY, \"apps\");\n\t\tDATA_DIRECTORY = new File(ROOT_DIRECTORY, \"data\");\n\t\tPREFERENCES_DIRECTORY = new File(ROOT_DIRECTORY, \"prefs\");\n\t\tLOG_DIRECTORY = new File(ROOT_DIRECTORY, \"logs\");\n\t}", "public DirectoryFileLocator() {\r\n this(System.getProperty(\"user.dir\"));\r\n }", "public void setDataDirectory(String dataDirectory) {\n this.dataDirectory = dataDirectory;\n }", "public void setLogFilesUrls() {\n String s = \"\";\n s = s + makeLink(\"NODE-\" + getNodeName() + \"-out.log\");\n s = s + \"<br>\" + makeLink(\"NODE-\" + getNodeName() + \"-err.log\");\n s = s + \"<br>\" + makeLink(\"log-\" + getNodeName() + \".html\");\n logFilesUrls = s;\n }", "public void setOutputDirectory(String dir) {\n\t\tnew LabeledText(\"Output directory:\").setText(dir);\n\t}", "public static void init() {\n\n\t\tcontentDirectory = new Document();\n\n\t\t//For ass\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\t\t//list of links to places (on reddit for example) to scrape from\n\t\tArrayList<String> redditAssLinks = new ArrayList<>();\n\t\tredditAssLinks.add(\"http://www.reddit.com/r/fffffffuuuuuuuuuuuu\"); //add sites here\n\n\t\tredditAssLinks.add(\"http://www.reddit.com/r/memes\");\n\t\tredditAssLinks.add(\"https://www.reddit.com/r/funnymeme/\");\n\t\tredditAssLinks.add(\"https://www.reddit.com/r/adviceanimals\");\n\t\tredditAssLinks.add(\"https://www.reddit.com/r/vertical\");\n\t\tredditAssLinks.add(\"https://www.reddit.com/r/firstworldproblems\");\n\t\tDocument redditAssDoc = new Document();\n\t\tredditAssDoc.append(\"reddit\", redditAssLinks);\n\n\t\t//could also append this when imgur implementation is ready:\n\t\t//contentDirectory.append(\"ass\", imgurAssDoc);\n\t\tcontentDirectory.append(\"ass\", redditAssDoc);\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\n\t\t//for workout\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\t\tArrayList<String> redditWorkoutLinks = new ArrayList<>();\n\t\tredditWorkoutLinks.add(\"http://www.reddit.com/r/gymfails\");\n\t\tredditWorkoutLinks.add(\"http://www.reddit.com/r/gymmemes\");\n\t\tredditWorkoutLinks.add(\"https://www.reddit.com/r/bodybuilding/\");\n\t\tredditWorkoutLinks.add(\"https://www.reddit.com/r/weightlifting\");\n\t\tDocument redditWorkoutDoc = new Document();\n\t\tredditWorkoutDoc.append(\"reddit\", redditWorkoutLinks);\n\n\t\tcontentDirectory.append(\"workout\", redditWorkoutDoc);\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\n\t\t//for minecraft\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\t\tArrayList<String> redditMinecraftLinks = new ArrayList<>();\n\t\tredditMinecraftLinks.add(\"http://www.reddit.com/r/Minecraft/\");\n\t\tredditMinecraftLinks.add(\"http://www.reddit.com/r/MinecraftSuggestions\");\n\t\tDocument redditMinecraftDoc = new Document();\n\t\tredditMinecraftDoc.append(\"reddit\", redditMinecraftLinks);\n\n\t\tcontentDirectory.append(\"minecraft\", redditMinecraftDoc);\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\n\n\t\t//for minecraft\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\t\tArrayList<String> redditKSPLinks = new ArrayList<>();\n\t\tredditKSPLinks.add(\"https://www.reddit.com/r/KerbalSpaceProgram/\");\n\t\tredditKSPLinks.add(\"https://www.reddit.com/r/KSPMemes\");\n\t\tredditKSPLinks.add(\"http://www.reddit.com/r/KerbalAcademy\");\n\t\tredditKSPLinks.add(\"https://www.reddit.com/r/RealSolarSystem/\");\n\t\tDocument redditKSPDoc = new Document();\n\t\tredditKSPDoc.append(\"reddit\", redditKSPLinks);\n\n\t\tcontentDirectory.append(\"KSP\", redditKSPDoc);\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\n\t\t//for weed\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\t\tArrayList<String> redditWeedLinks = new ArrayList<>();\n\t\tredditWeedLinks.add(\"https://www.reddit.com/r/weed/\");\n\t\tredditWeedLinks.add(\"https://www.reddit.com/r/trees/\");\n\t\tredditWeedLinks.add(\"https://www.reddit.com/r/Picturesoftrees/\");\n\t\tredditWeedLinks.add(\"https://www.reddit.com/r/bakedart/\");\n\t\tredditWeedLinks.add(\"https://www.reddit.com/r/treecomics/\");\n\t\tredditWeedLinks.add(\"https://www.reddit.com/r/nugs/\");\n\t\tredditWeedLinks.add(\"https://www.reddit.com/r/nugporn/\");\n\t\tredditWeedLinks.add(\"https://www.reddit.com/r/TokeSpot/\");\n\n\t\tDocument redditWeedDoc = new Document();\n\t\tredditWeedDoc.append(\"reddit\", redditWeedLinks);\n\n\t\tcontentDirectory.append(\"weed\", redditWeedDoc);\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\n\t\t//for drug\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\t\tArrayList<String> redditDrugLinks = new ArrayList<>();\n\t\tredditDrugLinks.add(\"https://www.reddit.com/r/DrugArt/\");\n\t\tredditDrugLinks.add(\"https://www.reddit.com/r/trippy/\");\n\t\tredditDrugLinks.add(\"https://www.reddit.com/r/drugmemes/\");\n\t\tDocument redditDrugDoc = new Document();\n\t\tredditDrugDoc.append(\"reddit\", redditDrugLinks);\n\n\t\tcontentDirectory.append(\"drug\", redditDrugDoc);\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\n\t\t//for cute animals\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\t\tArrayList<String> redditCanimalLinks = new ArrayList<>();\n\t\tredditCanimalLinks.add(\"https://www.reddit.com/r/aww/\");\n\t\tredditCanimalLinks.add(\"http://www.reddit.com/r/cats/\");\n\t\tredditCanimalLinks.add(\"https://www.reddit.com/r/babyanimals/\");\n\t\tredditCanimalLinks.add(\"https://www.reddit.com/r/AnimalsBeingBros\");\n\t\tredditCanimalLinks.add(\"https://www.reddit.com/r/woof_irl/\");\n\t\tDocument reddiCanimalDoc = new Document();\n\t\treddiCanimalDoc.append(\"reddit\", redditCanimalLinks);\n\n\t\tcontentDirectory.append(\"canimal\", reddiCanimalDoc);\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\n\n\t}", "public String getDir();", "public void setDir(File dir) {\n _sourceDir = dir;\n }", "public void setHtmldir(String htmldir) \r\n {\r\n this.htmldir = htmldir;\r\n }", "private static void addDirectoryToLibraryPath(String dir) throws IOException {\n try {\n Field field = ClassLoader.class.getDeclaredField(\"usr_paths\");\n field.setAccessible(true);\n String[] paths = (String[]) field.get(null);\n for (String path: paths) {\n if (dir.equals(path)) {\n return;\n }\n }\n String[] tmp = new String[paths.length + 1];\n System.arraycopy(paths, 0, tmp, 0, paths.length);\n tmp[paths.length] = dir;\n field.set(null, tmp);\n } catch (IllegalAccessException e) {\n throw new IOException(\"Failed to get permissions to set library path.\");\n } catch (NoSuchFieldException e) {\n throw new IOException(\"Failed to get field handle to set library path.\");\n }\n }", "public GoogleNewsSitemapGenerator(URL baseUrl, File baseDir) {\n\t\tthis(new SitemapGeneratorOptions(baseUrl, baseDir));\n\t}", "protected File getCacheDirectory() {\n \t\treturn Activator.getDefault().getStateLocation().append(\"cache\").toFile(); //$NON-NLS-1$\n \t}", "public void setFileDirectory(String directory) {\n settings.put(\"fileDirectory\", directory);\n }", "protected void setRootPath(String root) {\n this.root = new File(root);\n this.appsDir = new File(this.root, APPS_ROOT);\n this.m2Dir = new File(M2_ROOT);\n }", "public void setDirectory(final String directory) {\n directoryProperty().set(directory);\n }", "public GoogleNewsSitemapGenerator(String baseUrl, File baseDir)\n\t\t\tthrows MalformedURLException {\n\t\tthis(new SitemapGeneratorOptions(baseUrl, baseDir));\n\t}", "public void updateLabtainersPath(){\n labsPath = new File(labtainerPath + File.separator + \"labs\");\n labChooser.setCurrentDirectory(labsPath); \n }", "private String downloadFolder(){\n\t\tFile home = new File(System.getProperty(\"user.home\"));\n\t\tFile folder = new File (home,\"Downloads/PaluDownloads\");\n\t\tif (!folder.exists()){\n\t\t\tfolder.mkdir();\n\t\t}\n\t\treturn folder.getAbsolutePath();\n\t}", "public abstract void setOutputUrl(String outputUrl);", "public void setISdirectory(File directory)\n {\n is_directory = directory;\n }", "abstract File getResourceDirectory();", "abstract public void setDataResourcesDir(String path);", "public PackageServer() {\n\t\t\n\t\t// Create the release folder\n\t\tLOGGER.debug(\"Creating directory: {}\", RELEASE_FOLDER);\n\t\tif (PackageUtils.createDirectory(RELEASE_FOLDER)) {\n\t\t\tLOGGER.debug(\"Created: {}\", RELEASE_FOLDER);\n\t\t} else {\n\t\t\tLOGGER.debug(\"Failed creating: {}\", RELEASE_FOLDER);\n\t\t}\n\t}", "public void setDir( final File dir )\n {\n m_dir = dir;\n }", "public void setFileUrl(String fileUrl);", "protected void copyJavadocsToWebsite() {\n\n try {\n\n File javadocSourceDir = getJavadocSourceGenerationDir();\n if (!javadocSourceDir.isDirectory()) {\n sendException(\"The Javadoc source directory was not found: \" +\n javadocSourceDir.getCanonicalPath());\n }\n\n //==========================================\n // Copies the Javadoc to the build output dir, so it\n // is included in the final website's .jar\n //==========================================\n File javadocTargetDir = new File(getProjectBuildOutputDir().getCanonicalPath() + \"/public/javadoc\");\n FileUtils.deleteDirectory(javadocTargetDir);\n\n FileUtils.copyDirectory(javadocSourceDir, javadocTargetDir);\n log(\"Javadoc copied to the build output dir: \" + javadocTargetDir.getAbsolutePath());\n\n //==========================================\n // We also copy the Javadoc to the source directory of\n // the website, so it is available if we launch the\n // website from an IDE.\n // This source directory is ignored in Git.\n //==========================================\n javadocTargetDir = new File(getProjectBaseDir().getCanonicalPath() + \"/src/main/resources/public/javadoc\");\n FileUtils.deleteDirectory(javadocTargetDir);\n\n FileUtils.copyDirectory(javadocSourceDir, javadocTargetDir);\n log(\"Javadoc copied to the website source dir: \" + javadocTargetDir.getAbsolutePath());\n\n } catch (Exception ex) {\n throw SpincastStatics.runtimize(ex);\n }\n }", "void folderDownloaded(String remoteFolder);", "File getTargetDirectory();", "abstract public void setTopResourcesDir(String path);", "public void setDirectory(final String directory) {\n\t\tthis.directory = directory;\n\t}", "public void setImageDir(File imageRepDir) {\n\t\tFileDataPersister.getInstance().put(\"gui.configuration\", \"image.repository\", imageRepDir.getPath());\n\t\tRepository.getInstance().setRepository(imageRepDir);\n\t\tthis.getSelectedGraphEditor().repaint();\n\t}", "IParser setServerBaseUrl(String theUrl);", "protected abstract String getDirectory(URL url);", "public void setLobFolder(URI uriLobFolder) throws IOException;", "private native void setDefaultRealmFileDirectory(String fileDir, AssetManager assets);", "private void setDefaultPath(){\n\t\tdownloadPath = System.getProperty(\"user.home\") + File.separator + \"Downloads\" + File.separator;\n\t\tif(!downloadPath.endsWith(File.separator)){\n\t\t\tdownloadPath += File.separator;\n\t\t}\n\t\tcurrentPath.setText(downloadPath);\n\t\tcurrentPath.setToolTipText(downloadPath);\n\t}", "public void setSource(URL url) throws IOException {\n\t\tFile f = new File(url.getFile());\n\t\tif (f.isAbsolute()) {\n\t\t\tsourceFile = url;\n\t\t\timg = ImageIO.read(f);\n\t\t\tthis.isRelativePath = false;\n\t\t} else {\n\t\t\tsourceFile = new URL(SymbologyFactory.SymbolLibraryPath\n\t\t\t\t\t+ File.separator + f.getPath());\n\t\t\timg = ImageIO.read(f);\n\t\t\tthis.isRelativePath = true;\n\t\t}\n\t}", "public URL setURL(URL url) {\r\n if (url == null)\r\n throw new IllegalArgumentException(\r\n \"A null url is not an acceptable value for a PackageSite\");\r\n URL oldURL = url;\r\n myURL = url;\r\n return oldURL;\r\n }", "public void loadExternalRepositories() {\n\t\tString envExternalRepsString = System.getenv(\"ODFI_DOCBOOK_STYLESHEETS_REPS\");\r\n\t\tif (envExternalRepsString!=null) {\r\n\t\t\tString[] externalEnvReps = envExternalRepsString.split(\"\"+File.pathSeparatorChar);\r\n\t\t\tfor (String rep : externalEnvReps) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.loadRepository(rep);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// Remove wrong URL\r\n\t\t\t\t\t//it.remove();\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t/*\r\n\t\t// Load Preferences with Environment variable if there is one, otherwise don't touch it\r\n\t\t//---------------------\r\n\t\tString envExternalReps = System.getenv(DocbookPlugin.ENV_EXTERNAL_REPS);\r\n\t\tif (envExternalReps!=null) {\r\n\t\t\tDocbookPlugin.getDefault().getPreferenceStore().setDefault(\"reps.external.env\", envExternalReps);\r\n\t\t}\r\n\t\t\r\n\t\t// Do we have any manually added stylesheets repositories?\r\n\t\t//-----------------------\r\n\t\tString externalAddedRepsString = DocbookPlugin.getDefault().getPreferenceStore().getString(\"reps.external.added\");\r\n\t\tString externalEnvRepsString = DocbookPlugin.getDefault().getPreferenceStore().getString(\"reps.external.env\");\r\n\r\n\t\t\r\n\t\t// Parse the repositories\r\n\t\t//----------------------------------\r\n\t\tString[] externalEnvReps = externalEnvRepsString.split(\";\");\r\n\t\tArrayIterator<String> it = new ArrayIterator<String>(externalEnvReps);\r\n\t\twhile (it.hasNext()) {\r\n\t\t\tString rep = it.next();\r\n\t\t\ttry {\r\n\t\t\t\tthis.loadRepository(rep);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\t// Remove wrong URL\r\n\t\t\t\t//it.remove();\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tString[] externalAddedReps = externalAddedRepsString.split(\";\");\r\n\t\tit = new ArrayIterator<String>(externalAddedReps);\r\n\t\twhile (it.hasNext()) {\r\n\t\t\tString rep = it.next();\r\n\t\t\ttry {\r\n\t\t\t\tthis.loadRepository(rep);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\t// Remove wrong URL\r\n\t\t\t\t//it.remove();\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} \r\n\t\t}\r\n\t\t\r\n\t\t// Resave in case we cleaned them\r\n\t\t//-------------------------------------\r\n\t\t*/\r\n\t\t\r\n\t\t\r\n\t}", "public LabsManager(File directory)\n {\n this.directory = directory;\n }", "private void setPathToRootOfPostVersionLists() {\n if (postBlockTypeToInvestigate == PostBlockTypeToInvestigate.Text) {\n pathToSelectedRootOfPostVersionLists = Paths.get(\"testdata\", \"files to investigate\", \"text\");\n } else if (postBlockTypeToInvestigate == PostBlockTypeToInvestigate.Code) {\n pathToSelectedRootOfPostVersionLists = Paths.get(\"testdata\", \"files to investigate\", \"code\");\n }\n }", "abstract File getTargetDirectory();", "public static void setPreferenceDirectory(String dir) {\n\t\tPREF_DIR = dir;\n\t}", "public void customRootDir() {\n //Be careful with case when res is false which means dir is not valid.\n boolean res = KOOM.getInstance().setRootDir(this.getCacheDir().getAbsolutePath());\n }", "public Builder setDirName(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n dirName_ = value;\n onChanged();\n return this;\n }", "public void setLocalCacheDirectory(String dir) {\n\t\tlocalCacheDirectory = dir;\n\t\tif(dir == null) {\n\t\t\tcache.clear();\n\t\t\tSystem.out.println(\"INFO: Local cache directory is disabled\");\n\t\t}\n\t\telse {\n\t\t\tString indexFileName = localCacheDirectory + File.separator + \"service.idx\"; \n\t\t\ttry {\n\t\t\t\tFile indexFile = new File(indexFileName);\n\t\n\t\t\t\tcache = new Properties();\t\t\t\t\n\t\t\t\n\t\t\t\tcache.load(new FileInputStream(indexFile));\n\t\n\t\t\t\tSystem.out.println(\"INFO: Cache has been initialized with \" + cache.size() + \" entries\");\n\t\t\t} catch(FileNotFoundException e) {\n\t\t\t\tSystem.err.println(\"ERROR: Cache index file \" + indexFileName + \" cannot be found\");\n\t\t\t\tlocalCacheDirectory = null;\n\t\t\t} catch(IOException e) {\n\t\t\t\tSystem.err.println(\"ERROR: Cache index file \" + indexFileName + \" has an invalid format\");\n\t\t\t\tlocalCacheDirectory = null;\n\t\t\t}\t\n\t\t}\n\t}", "public Path getDataDirectory();", "public void setClassesDirs(FileCollection classesDirs) {\n this.classesDirs = classesDirs;\n }", "public ClassPathManager() {\n projectCP = new LinkedList<File>();\n buildCP = new LinkedList<File>();\n projectFilesCP = new LinkedList<File>();\n externalFilesCP = new LinkedList<File>();\n extraCP = new LinkedList<File>();\n// systemCP = new LinkedList<File>();\n// openFilesCP = new LinkedList<File>();\n }", "public void setURL(String url);", "abstract public void setMspluginsDir(String path);", "public DirectoryFileLocator(String dirname) {\r\n this(new File(dirname));\r\n }", "public DirectoryFileLocator(File dir) {\r\n directory = dir;\r\n }", "String getDir();", "public void addFeedIntoFolder(String feedURL, String name);", "public ResourcePath() {\n //_externalFolder = \"file:///C:/Program%20Files/ESRI/GPT9/gpt/\";\n //_localFolder = \"gpt/\";\n}", "public void setToDir(File dir) {\n _destDir = dir;\n }", "public void setOutput(File file){\n outputDir = file;\n }", "public void setOutputDirectory(File outputDirectory) {\n\t\tthis.outputDirectory = outputDirectory;\n\t}", "public void createModuleGeneratedXMLPath() {\n\t\tString[] onlyFolderNames = new String[] {\n\t\t\tmInstance.getModuleGeneratedXMLPath(),\n\t\t\tmModuleName\n\t\t};\n\t\t\n\t\tmModuleGeneratedXMLPath = StringUtils.makeFilePath (onlyFolderNames, false);\n\t}", "public static void main(final String[] args) {\n String docletProjectRootDir = new File(System.getProperty(\"user.dir\")).getAbsolutePath();\n docletProjectRootDir = docletProjectRootDir.replaceAll(\"\\\\\\\\\", \"/\");\n\n String repositoryRootDir = new File(System.getProperty(\"user.dir\")).getParentFile().getParent();\n repositoryRootDir = repositoryRootDir.replaceAll(\"\\\\\\\\\", \"/\");\n\n final String projectDir = repositoryRootDir + \"/../org.eclipse.ease.modules/plugins/org.eclipse.ease.modules.platform\";\n\n // @formatter:off\n final String[] javadocargs = {\n \"-sourcepath\", \"/home/saul/eclipse-workspace/debrief/org.mwc.debrief.scripting/src:/home/saul/eclipse-workspace/debrief/org.mwc.cmap.legacy/src:/home/saul/eclipse-workspace/debrief/org.mwc.debrief.legacy/src\",\n \"-root\", \"/home/saul/eclipse-workspace/debrief/org.mwc.debrief.scripting\",\n \"-doclet\", ModuleDoclet.class.getName(),\n \"-docletpath\", docletProjectRootDir + \"/lib\",\n\n \"-failOnHTMLError\", \"false\",\n \"-failOnMissingDocs\", \"false\",\n\n \"-linkoffline\", \"https://docs.oracle.com/en/java/javase/11/docs/api/\", \"package-list\",\n\t\t\t\t//\"-link\", \"https://docs.oracle.com/javase/8/docs/api\",\n\t\t\t\t\"--ignore-source-errors\",\n\n \"-subpackages\",\n \"org.mwc.debrief.scripting.wrappers\"\n };\n\t\t// @formatter:on\n\n\t\tfinal DocumentationTool systemDocumentationTool = getSystemDocumentationTool();\n\t\tfinal DocumentationTool.DocumentationTask toolTask = systemDocumentationTool.getTask(null, null, null, ModuleDoclet.class, List.of(javadocargs), null);\n\t\ttoolTask.call();\n\t}", "void setModBookFilePath(Path modBookFilePath);", "@Override\r\n\t\tpublic String getDir()\r\n\t\t\t{\n\t\t\t\treturn null;\r\n\t\t\t}", "public void setRootDir(File rootDir) {\r\n\t\tthis.rootDir = rootDir;\r\n\t}", "public Builder setPackageImageURL(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n packageImageURL_ = value;\n onChanged();\n return this;\n }", "public void setAsinstalldir(File asinstalldir) {\n\t\tthis.asinstalldir = asinstalldir;\n\t}", "private void setURL(String url) {\n try {\n URL setURL = new URL(url);\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }", "public static void buildFromHttpDir() throws FtpException, IOException {\n\t\tURL url = new URL(\"http://mrms.ncep.noaa.gov/data/3DReflPlus/\");\r\n\t\t\t\r\n\t\tDirectoryScanner scanner = new DirectoryScanner();\r\n\t\tListResults results = scanner.listURL(url);\r\n\t\tSystem.out.println(results.getCount() + \" results found...\");\r\n\t\tfor (URL u : results.getUrlList()) {\r\n\r\n//\t\t\t<entry name=\"BrightBandBottomHeight\" type=\"DIRECT_URL\"\r\n//\t\t\t\t\tlocation=\"http://mrms.ncep.noaa.gov/data/2D/BrightBandBottomHeight/\" />\r\n\r\n\t\t\tString name = u.getFile().split(\"/\")[u.getFile().split(\"/\").length-1];\r\n\t\t\t\r\n\t\t\tSystem.out.println(\" <entry name=\\\"\"+name+\"\\\" type=\\\"REMOTE_DIR\\\" location=\\\"\"+u+\"\\\" />\");\r\n\t\t}\r\n\t}", "public void setHarvestedDataDir(String val) {\n\n\t\tthis.harvestedDataDir = val;\n\n\t}", "public void setServer(URL url) {\n\n\t}", "public static String getTestSetFolderURL() {\n\n\t\treturn baseURL + login_required_string + \"/rest/domains/\" + domain + \"/projects/\" + project + \"/test-set-folders\";\n\t}", "public File getDistributionDir() {\n return distDir;\n }" ]
[ "0.5674875", "0.5631675", "0.5570044", "0.54970586", "0.546472", "0.54085296", "0.53197724", "0.52714103", "0.51997834", "0.5157272", "0.5110308", "0.51017123", "0.5074944", "0.50389165", "0.5037633", "0.50318784", "0.502074", "0.5007591", "0.5005353", "0.5000449", "0.49997905", "0.4991452", "0.4981911", "0.49804524", "0.49765196", "0.49650994", "0.4960989", "0.49585697", "0.49566242", "0.49533153", "0.49413025", "0.49239278", "0.49080405", "0.48939067", "0.48871326", "0.48794132", "0.4861301", "0.48612756", "0.48529026", "0.48505023", "0.48414654", "0.48370883", "0.48335204", "0.480175", "0.47875547", "0.4787079", "0.47798625", "0.47797847", "0.47783056", "0.47774392", "0.47636095", "0.4761788", "0.47596598", "0.47580424", "0.47575748", "0.47441477", "0.47381014", "0.47344244", "0.47344047", "0.47297192", "0.4717297", "0.47158268", "0.4712042", "0.46804622", "0.46774954", "0.4673952", "0.46644366", "0.46478805", "0.46383333", "0.46267125", "0.46158633", "0.46158415", "0.46137974", "0.46125004", "0.46099645", "0.46080178", "0.45999023", "0.45989415", "0.4594451", "0.4587759", "0.45873362", "0.45796773", "0.4572264", "0.4562785", "0.45622003", "0.4556264", "0.45477647", "0.45441285", "0.4532815", "0.45301586", "0.4522475", "0.45183226", "0.4516989", "0.45134908", "0.4511573", "0.45106992", "0.45083025", "0.45029607", "0.45016655", "0.45015934" ]
0.64642507
0
Fill in layout id
@Override protected int getLayoutId() { return R.layout.activity_smart_router; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getLayoutId();", "public abstract int layoutId();", "public abstract int getLayoutId();", "public abstract int getLayoutId();", "public abstract int getLayoutId();", "@LayoutRes\n protected abstract int getLayoutId();", "@Override\n\tpublic int getLayoutId() {\n\t\treturn 0;\n\t}", "protected abstract int getLayoutViewId();", "public abstract\n @LayoutRes\n int getLayoutId();", "@Override\r\n\tprotected int layoutId() {\n\t\treturn R.layout.mine_new_huankuan;\r\n\t}", "public String getLayoutId()\r\n\t{\r\n\t\treturn layoutId;\r\n\t}", "protected abstract int getLayoutResourceId();", "int getActivityLayoutId();", "protected abstract int getItemLayoutId();", "public int getLayoutId() {\n return R.layout.activity_my_resv_detail;\n }", "@Override\n public int getLayoutId() {\n return R.layout.activity_main2;\n }", "private void setComponentsId(){\n this.tableA.setId(1);\n this.horizontalScrollViewB.setId(2);\n this.scrollViewC.setId(3);\n this.scrollViewD.setId(4);\n }", "@Override\n\tprotected int setLayoutID() {\n\t\treturn R.layout.activity_scll_scan;\n\t}", "int getItemViewLayoutId();", "@Override\n protected int getLayoutId() {\n return R.layout.act_fourpart;\n }", "@Override\n protected int getLayoutId() {\n return R.layout.activity_main;\n }", "public int getLayoutId() {\n return R.layout.fq_activity_prepare_live;\n }", "@LayoutRes\n protected abstract int getContentViewId(Bundle savedInstanceState);", "@Override // com.zhihu.android.p1480db.fragment.customview.DbEditorBaseCustomView\n public int getLayoutId() {\n return R.layout.wc;\n }", "public ClientDetailKeeper(int layoutId){\n //get layout id from HouseKeeper Registry\n mActivityLayoutId = layoutId;\n\n }", "public int getContentViewLayoutID() {\n return R.layout.activity_login_main;\n }", "public int getViewId() {\n return 123456;\n }", "@Override\r\n protected int getLayoutId() {\n return R.layout.fragment_settings;\r\n }", "public int getLayoutId() {\n return R.layout.list_item_music_local_scan;\n }", "@Override\r\n protected int getLayoutId() {\n return R.layout.fragment_store_information;\r\n }", "@Override\r\n\tprotected int getLayoutId() {\n\t\treturn R.layout.activity_org_active_detail;\r\n\t}", "@Override // com.zhihu.android.profile.newprofile.p1859ui.card.ProfileBaseCard\n public int getLayoutId() {\n return R.layout.afh;\n }", "@Override\n public int getLayoutId() {\n return R.layout.activity_time_address_manager;\n }", "@Override\n protected int layoutId() {\n return R.layout.activity_appraise_imageshow;\n }", "@Override\n\tpublic int setContentViewId() {\n\t\treturn R.layout.fragment_coursexlist;\n\t}", "public void setLayoutId(String layoutId)\r\n\t{\r\n\t\tthis.layoutId = layoutId;\r\n\t}", "private Id getViewContainerID() {\n if (semantic == null) {\n return Id.invalid();\n }\n return new Id(RefreshIDFactory.getOrCreateID(viewContainer));\n }", "int getViewId();", "public Integer getViewID()\n {\n String x = center.east() + \"_\" + center.north() + \"_\" + scale + \"_\" +\n getWidth() + \"_\" + getHeight();\n java.util.zip.CRC32 id = new java.util.zip.CRC32();\n id.update(x.getBytes());\n return new Long(id.getValue()).intValue();\n }", "public int getLayoutId() {\n return R.layout.activity_portait_capture_preview;\n }", "private void setLayout() {\n\t\ttxtNickname.setId(\"txtNickname\");\n\t\ttxtPort.setId(\"txtPort\");\n\t\ttxtAdress.setId(\"txtAdress\");\n\t\tlblNickTaken.setId(\"lblNickTaken\");\n\n\t\tgrid.setPrefSize(516, 200);\n\t\tbtnLogin.setDisable(true);\n\t\ttxtNickname.setPrefSize(200, 25);\n\t\tlblNickTaken.setPrefSize(250, 10);\n\t\tlblNickTaken.setText(null);\n\t\tlblNickTaken.setTextFill(Color.RED);\n\t\tlblNick.setPrefSize(120, 50);\n\t\ttxtAdress.setText(\"localhost\");\n\t\ttxtPort.setText(\"4455\");\n\t\tlblCardDesign.setPrefSize(175, 25);\n\t\tcomboBoxCardDesign.getSelectionModel().select(0);\n\t\tbtnLogin.setGraphic(imvStart);\n\t}", "public int getLayoutId() {\n return R.layout.activity_coupon_get;\n }", "public static int getViewId() {\n\t\tviewId += 0x00000001;\n\t\treturn viewId;\n\t}", "@Override\n\tprotected int getResourceLayoutId() {\n\t\treturn R.layout.admin;\n\t}", "void setId(int val);", "public void createInitialLayout(IPageLayout layout) {\n \n\t}", "@Override\n\tpublic int setLayout() {\n\t\treturn R.layout.activity_main;\n\t}", "@Override\n protected int getLayoutID() {\n return R.layout.activity_gameplay;\n }", "@Override\n\tprotected int getLayoutId() {\n\t\treturn R.layout.activity_music;\n\t}", "String getLayout();", "@Override\n public void setContentView(int layoutResID){\n }", "public static int generateViewId() {\n return View.generateViewId();\n }", "@Override\n\tpublic int getLayoutId() {\n\t\treturn R.layout.fragment_home;\n\t}", "private void setId(Integer id) { this.id = id; }", "public final int getLayout() {\n return 2130970726;\n }", "protected\n @LayoutRes\n int getItemLayoutId(int position, T t) {\n return mLayoutId;\n }", "@Override\n\tpublic int bindLayout() {\n\t\treturn R.layout.activity_init;\n\t}", "private int setLayoutResId(){\n return R.layout.activity_fragment;\n }", "@Override\n\tpublic void setId(Integer arg0) {\n\n\t}", "@Override\n public int getLayoutId() {\n return R.layout.activity_permission;\n }", "protected abstract void iniciarLayout();", "protected abstract int getResLayout();", "public void setContentView(int layoutResID) {\r\n\t\tLayoutInflater inflator = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\r\n\t\t\r\n\t\tsetContentView(inflator.inflate(layoutResID, null));\r\n\t}", "@Override\n public void setContentView(int layoutResID) {\n if (view_stub != null) {\n LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);\n ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(\n ViewGroup.LayoutParams.MATCH_PARENT,\n ViewGroup.LayoutParams.MATCH_PARENT);\n View stubView = inflater.inflate(layoutResID, view_stub, false);\n view_stub.addView(stubView, lp);\n }\n }", "@Override\n public void setContentView(int layoutResID) {\n if (view_stub != null) {\n LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);\n ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(\n ViewGroup.LayoutParams.MATCH_PARENT,\n ViewGroup.LayoutParams.MATCH_PARENT);\n View stubView = inflater.inflate(layoutResID, view_stub, false);\n view_stub.addView(stubView, lp);\n }\n }", "public abstract int presentViewLayout();", "@Override\n public void setId(int pintId) {\n this.intDynaGraphId = pintId;\n }", "private void initializeLayout(){\n String title = mStrInfo;\n String subtitle = mClientItem.clientName;\n mHomeToolbar.setGymRatToolbarTitle(title, subtitle);\n\n //initialize maids\n initializeMaid();\n\n //initialize bottom navigation\n initializeBottomNavigation();\n }", "public void setViewIdToLevel(int id) {\n mSameHeightViewId = id;\n }", "public abstract void setTemplId(Integer templId);", "private void setId(int value) {\n \n id_ = value;\n }", "public void setId(int id){ this.id = id; }", "private void setId(int value) {\n \n id_ = value;\n }", "protected String getID( DockElement element ){\r\n return element.getFactoryID();\r\n }", "@Override\n\tprotected int initView() {\n\t\treturn R.layout.activity_zhusu_detail;\n\t}", "static public View inflateLayout(int Presid,View PlayoutView) //~1410I~\r\n { //~1410I~\r\n if (Dump.Y) Dump.println(\"AView:inflateLayout2 res=\"+Integer.toHexString(Presid)+\",view=\"+PlayoutView.toString());//~@@@@R~\r\n \tAG.setCurrentView(Presid,PlayoutView); //~1410I~\r\n return PlayoutView; //~1410I~\r\n }", "private void setLayout(){\n Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar1);\n setSupportActionBar(toolbar);\n\n drawerLayoutgesamt = (DrawerLayout) findViewById(R.id.drawerlayoutgesamt);\n drawerToggle = new ActionBarDrawerToggle(MenueDrawer.this,drawerLayoutgesamt,R.string.auf, R.string.zu);\n drawerLayoutgesamt.addDrawerListener(drawerToggle);\n }", "@Override\n protected int getLayoutId() {\n return R.layout.fragment_home;\n }", "protected int getLayoutResourceId() {\n return R.layout.fragment_list;\n }", "public void setLayoutsequence(Long layoutsequence) {\n this.layoutsequence = layoutsequence;\n }", "@Override\n public void createInitialLayout(IPageLayout layout) {\n defineActions(layout);\n defineLayout(layout);\n }", "public void setupLayout() {\n // left empty for subclass to override\n }", "@Override\n\tprotected int getLayoutId() {\n\t\treturn R.layout.item_layout_search_friends;\n\t}", "public void setId(int id) { this.id = id; }", "public void setId(int id) { this.id = id; }", "public void defId(int id) {\r\n\t\tthis.id = id;\r\n\t}", "public void setId(int i) { id = i; }", "@Override\n\tpublic String getLayout() {\n\t\treturn \"main\";\n\t}", "public void layout() {\n TitleLayout ll1 = new TitleLayout(getContext(), sourceIconView, titleTextView);\n\n // All items in ll1 are vertically centered\n ll1.setGravity(Gravity.CENTER_VERTICAL);\n ll1.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,\n LayoutParams.WRAP_CONTENT));\n ll1.addView(sourceIconView);\n ll1.addView(titleTextView);\n\n // Container layout for all the items\n if (mainLayout == null) {\n mainLayout = new LinearLayout(getContext());\n mainLayout.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,\n LayoutParams.WRAP_CONTENT));\n mainLayout.setPadding(adaptSizeToDensity(LEFT_PADDING),\n adaptSizeToDensity(TOP_PADDING),\n adaptSizeToDensity(RIGHT_PADDING),\n adaptSizeToDensity(BOTTOM_PADDING));\n mainLayout.setOrientation(LinearLayout.VERTICAL);\n }\n\n mainLayout.addView(ll1);\n\n if(syncModeSet) {\n mainLayout.addView(syncModeSpinner);\n }\n\n this.addView(mainLayout);\n }", "private void layout() {\n\n\n _abortButton= makeAbortButton();\n _abortButton.addStyleName(\"download-group-abort\");\n _content.addStyleName(\"download-group-content\");\n _detailUI= new DetailUIInfo[getPartCount(_monItem)];\n layoutDetails();\n }", "@Override\n\tpublic int getRootViewId() {\n\t\treturn R.layout.fragment_modify_profile_appeal;\n\t}", "protected void setViewId(View v, int id) {\n\t\tint current_id = v.getId();\n\t\tv.setId(id);\n\t\tfor(int i = 0; i < getChildCount(); i++) {\n\t\t\tRelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams)getChildAt(i).getLayoutParams();\n\t\t\tint rules[] = params.getRules();\n\t\t\tfor(int j = 0; j < rules.length; j++) {\n\t\t\t\tif(rules[j] == current_id) {\n\t\t\t\t\tparams.addRule(j, id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void setGlobalChildTextContainerId(View balloon) {\n int viewId = balloon.getId();\n String currentViewName = getResources().getResourceName(viewId);\n String currentViewNumber = currentViewName.charAt(currentViewName.length() - 1) + \"\";\n String childViewName = \"ballon_\" + currentViewNumber + \"_value\";\n int id = getResources().getIdentifier(childViewName, \"id\", GameActivity.this.getPackageName());\n globalChildTextContainer.put(viewId, id);\n }", "private void setId() {\n id = count++;\n }", "private void milestonesLayoutHandler() {\n layoutMilestones = (LinearLayout) findViewById(R.id.layoutMilestones);\n txtViewMilestonesCountToday = (AutoResizeTextView) findViewById(R.id.txtViewMilestonesCountToday);\n txtMilestonesYesterdayValue = (TextView) findViewById(R.id.txtMilestonesYesterdayValue);\n\n layoutMilestones.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n Toast.makeText(context, \"Coming soon\", Toast.LENGTH_SHORT).show();\n }\n });\n\n txtViewMilestonesCountToday.setText(String.valueOf(userSharedPreferences.getInt(HPIApp.Prefs.SHARED_KEY_MILESTONES_TODAY, 0)));\n txtMilestonesYesterdayValue.setText(\"-\");\n }", "public String getUniqueId() {\n return getCurrentInstance().getViewRoot().createUniqueId();\n }", "static String getPageViewId() {\n if (PAGEVIEW_ID == null) {\n PAGEVIEW_ID = generateRandomId();\n }\n return PAGEVIEW_ID;\n }", "private void setLayout() {\n int orientation = getResources().getConfiguration().orientation;\n // if the orientation is Portrait\n if (orientation == Configuration.ORIENTATION_PORTRAIT) {\n if (!webViewFragment.isAdded()) {\n mLandmarkLayout.setLayoutParams(new LinearLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT));\n mWebPageLayout.setLayoutParams(new LinearLayout.LayoutParams(0, MATCH_PARENT));\n } else {\n mLandmarkLayout.setLayoutParams(new LinearLayout.LayoutParams(0, MATCH_PARENT, 0f));\n mWebPageLayout.setLayoutParams(new LinearLayout.LayoutParams(0, MATCH_PARENT, 3f));\n\n }\n }\n else { // if the orientation is Landscape\n if (!webViewFragment.isAdded()) {\n\n mLandmarkLayout.setLayoutParams(new LinearLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT));\n mWebPageLayout.setLayoutParams(new LinearLayout.LayoutParams(0, MATCH_PARENT));\n } else {\n // Make the LandmarkLayout take 1/3 of the layout's width\n mLandmarkLayout.setLayoutParams(new LinearLayout.LayoutParams(0,\n MATCH_PARENT, 1f));\n // Make the WebPageLayout take 2/3's of the layout's width\n mWebPageLayout.setLayoutParams(new LinearLayout.LayoutParams(0,\n MATCH_PARENT, 2f));\n }\n }\n }", "public void setBSContentView(int layoutResID) {\n checkBSActivityRunning();\n mDrawer.getParentView().removeAllViews();\n if (mDrawer.getBSLayoutInflater() != null) {\n mDrawer.addViewToBS(getBSDrawer().getBSLayoutInflater().inflate(layoutResID, null));\n }\n }", "public abstract Integer getTemplId();" ]
[ "0.7929002", "0.7805487", "0.7734229", "0.7734229", "0.7734229", "0.766309", "0.7336715", "0.7260923", "0.7173747", "0.71210617", "0.69382876", "0.69193274", "0.6882463", "0.68714875", "0.6797015", "0.67045546", "0.6649391", "0.6633429", "0.66094595", "0.66085696", "0.6596171", "0.6576482", "0.64704615", "0.6446657", "0.6419241", "0.63777184", "0.63482827", "0.63192505", "0.6276232", "0.62745774", "0.62386745", "0.62350935", "0.62216747", "0.6208416", "0.6197681", "0.6186875", "0.61353725", "0.6129777", "0.6124755", "0.60470295", "0.6020748", "0.60096455", "0.5997116", "0.5970937", "0.5945397", "0.5937759", "0.59370154", "0.5935723", "0.5935422", "0.5898974", "0.5880895", "0.5874181", "0.58482754", "0.5847574", "0.58312523", "0.58252144", "0.58172786", "0.57796335", "0.57529503", "0.57514", "0.57448053", "0.5742754", "0.5725032", "0.57068086", "0.57068086", "0.57042855", "0.5693034", "0.56732225", "0.5652779", "0.5652702", "0.5646397", "0.56314564", "0.56297857", "0.562444", "0.562317", "0.5618522", "0.56003964", "0.55954295", "0.5594435", "0.5593149", "0.5591956", "0.5591933", "0.5589026", "0.55876535", "0.55876535", "0.5582422", "0.5577908", "0.55730486", "0.5541779", "0.55340326", "0.55264217", "0.55126053", "0.55026424", "0.55006516", "0.5498437", "0.54868466", "0.54837614", "0.54790765", "0.54747534", "0.54729116" ]
0.60598236
39
Initialize the view in the layout
@Override protected void initViews(Bundle savedInstanceState) { this.recyclerView = this.findView(R.id.recycler_view); this.recyclerView.addItemDecoration( new EasyDividerItemDecoration(this, EasyDividerItemDecoration.VERTICAL_LIST)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initView() {\n\n }", "@Override\r\n\tpublic void initView() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void initView() {\n\t\t\r\n\t}", "void initView();", "public void initView(){}", "@Override\n\tpublic void initView() {\n\t\t\n\t}", "@Override\n public void initView() {\n }", "protected abstract void initView();", "@Override\r\n\tprotected void initView() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initView() {\n\t\t\r\n\t}", "@Override\n protected void initView() {\n }", "@Override\n protected void initView() {\n }", "@Override\n\tprotected void initView() {\n\t\t\n\t}", "@Override\n\tprotected void initView() {\n\t\t\n\t}", "@Override\n\tprotected void initView()\n\t{\n\n\t}", "public abstract void initView();", "private void viewInit() {\n }", "@Override\n public void initView() {\n\n }", "protected abstract void initializeView();", "private void initViews() {\n\n }", "public abstract void initViews();", "protected abstract void initViews();", "@Override\r\n\tpublic void initViews() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void initViews() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initViews() {\n\t\t\r\n\t}", "private void initView(){\n\t\tinitSize();\n\t\tinitText();\n\t\tinitBackground();\n\t\tthis.setOnClickListener(this);\n\t\tthis.setOnLongClickListener(this);\n\t}", "@Override\n\tpublic void InitView() {\n\t\t\n\t}", "public void initViews(){\n }", "private void initViews() {\n\n\t}", "public void initView() {\n\t\t view.initView(model);\t \n\t }", "public MainView() {\r\n\t\tinitialize();\r\n\t}", "private void initView() {\n TIMManager.getInstance().addMessageListener(this);\n initAdapter();\n initRefresh();\n }", "private void init() {\n initView();\n setListener();\n }", "public MainView() {\n initComponents();\n \n }", "private void InitView() {\n\t\tmLinearLayout = new LinearLayout(getContext());\n\t\t//mLinearLayout.setBackgroundResource(MusicApplication.getInstance().getBgResource());\n\t\t\n\t\t//Modify by LiYongNam 2012.9.19_start\n\t\tMusicUtil.setBackgroundOfView ( mLinearLayout, getContext() );\t\t\t\t\n\t\t//Modify by LiYongNam 2012.9.19_end\n\t\t\n\t\tmLinearLayout.setOrientation(LinearLayout.VERTICAL);\n\t\tmLinearLayout.setPadding(1, 1, 1, Util.dipTopx(getContext(), 60));\n\t\t// 导航条\n\t\taddTitleBar(-1, \"编辑列表\", R.drawable.check_off, R.drawable.title_bar);\n\n\t\tmControlBar = new ControlBar(getContext());\n\t\tmControlBar.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,\n\t\t\t\tUtil.dipTopx(getContext(), 60)));\n\n//\t\taddControlButton(\"全选\", CONTROL1, 0);\n\t\taddControlButton(\"播放\", CONTROL2, 1);\n\t\taddControlButton(\"加入\", CONTROL3, 2);\n\t\taddControlButton(\"删除\", CONTROL4, 3);\n\n\t}", "private void initView() {\n\t\tsna_viewpager = (ViewPager) findViewById(R.id.sna_viewpager);\r\n\t\thost_bt = (Button) findViewById(R.id.host_bt);\r\n\t\tcomment_bt = (Button) findViewById(R.id.comment_bt);\r\n\t\tback_iv = (ImageView) findViewById(R.id.back_iv);\r\n\t\trelativeLayout_project = (RelativeLayout) findViewById(R.id.relativeLayout_project);\r\n\t\trelativeLayout_addr = (RelativeLayout) findViewById(R.id.relativeLayout_addr);\r\n\t\trelativeLayout_activity = (RelativeLayout) findViewById(R.id.relativeLayout_activity);\r\n\t\trelativeLayout_host = (RelativeLayout) findViewById(R.id.relativeLayout_host);\r\n\t\trelativeLayout_comment = (RelativeLayout) findViewById(R.id.relativeLayout_comment);\r\n\t\tll_point = (LinearLayout) findViewById(R.id.ll_point);\r\n\t\tstoyrName = (TextView) findViewById(R.id.stoyrName);\r\n\t\tstory_addr = (TextView) findViewById(R.id.story_addr);\r\n\t\t\r\n\t}", "@Override\r\n\tprotected void initViews(Bundle savedInstanceState) {\n\t\t\r\n\t}", "protected abstract void initContentView(View view);", "private void init(Context context) {\n getViewTreeObserver().addOnGlobalLayoutListener(this);\n inflate(context, R.layout.new_rp_resultview, this);\n mMainPanel = (ViewAnimator) findViewById(R.id.viewanimator);\n mInfoPanel = (ViewAnimator) findViewById(R.id.va_text);\n \n \n mInfoPanelText1 = (TextView) mInfoPanel.findViewById(R.id.tv1);\n mMainPanel.setDisplayedChild(0);\n\t}", "public View() {\n initComponents();\n }", "private void initView() {\n initRefreshListView(mListview);\n }", "protected void initView(View rootView) {\n\n }", "public MainView() {\n initComponents();\n }", "public MainView() {\n initComponents();\n }", "public void initView() {\n setEllipsize(TruncateAt.MARQUEE);\n setSingleLine(true);\n setMarqueeRepeatLimit(-1);\n setFocusable(true);\n setFocusableInTouchMode(false);\n }", "public ViewInit() {\n initComponents();\n }", "@Override\n\tprotected void initContentView() {\n\t\t\n\t}", "private void initView() {\r\n\t\tviewerGraz.refresh(true);\r\n\t\tviewerGraz.refresh(true);\r\n\t\tviewerKapfenberg.refresh(true);\r\n\t\tviewerLeoben.refresh(true);\r\n\t\tviewerMariazell.refresh(true);\r\n\t\tviewerWien.refresh(true);\r\n\t}", "private void init() {\n refreshLayout = new TurbolinksSwipeRefreshLayout(getContext(), null);\n addView(refreshLayout, 0);\n }", "@Override\r\n\tprotected void initView(View view) {\n\t\trly_personal_info = (RelativeLayout) view.findViewById(R.id.rly_personal_info);\r\n\t\t\r\n\t}", "public ViewSinFaltante() {\n initComponents();\n }", "private void initView() {\n\n LayoutInflater inflater = getLayoutInflater();\n final int screenWidth = MyUtils.getScreenMetrics(this).widthPixels;\n final int screenHeight = MyUtils.getScreenMetrics(this).heightPixels;\n for (int i = 0; i < 3; i++) {\n ViewGroup layout = (ViewGroup) inflater.inflate(\n R.layout.content_layout, myHorizontal, false);\n layout.getLayoutParams().width = screenWidth;\n TextView textView = (TextView) layout.findViewById(R.id.title);\n textView.setText(\"page \" + (i + 1));\n layout.setBackgroundColor(Color.rgb(255 / (i + 1), 255 / (i + 1), 0));\n createList(layout);\n myHorizontal.addView(layout);\n }\n }", "private void initView() {\n\t\tmSeekButton = (Button) findViewById(R.id.seekButton);\r\n\t\tmViewPager = (ViewPager) findViewById(R.id.viewPager);\r\n\t}", "private void initView() {\n\t\timg_back = (ImageView) findViewById(R.id.img_back_updatejob);\n\t\tedt_content = (EditText) findViewById(R.id.edt_content_updatejob);\n\t\tedt_course = (EditText) findViewById(R.id.edt_course_updatejob);\n\t\tbtn_delete = (Button) findViewById(R.id.btn_delete_updatejob);\n\t\tbtn_update = (Button) findViewById(R.id.btn_update_updatejob);\n\t}", "public void InitLayout() {\n SetBackground(R.drawable.can_dfqc_ac_bg);\n this.mTvA = AddText(121, 173, 203, 25);\n this.mTvP = AddText(121, 212, KeyDef.RKEY_RADIO_6S, 25);\n this.mTvMode = AddText(121, Can.CAN_FLAT_RZC, 203, 25);\n this.mTvC = AddText(121, 295, 139, 25);\n this.mTvWind = AddText(121, KeyDef.RKEY_AVIN, 53, 25);\n initValue();\n }", "public ManipularView() {\n initComponents();\n }", "@Override\n protected void initView()\n {\n ed_name = findView(R.id.ed_name);\n ed_bank = findView(R.id.ed_bank);\n ed_bank_card = findView(R.id.ed_bank_card);\n ed_bank_name = findView(R.id.ed_bank_name);\n btn_submit = findView(R.id.btn_submit);\n findView(R.id.ib_back).setOnClickListener(this);\n Toolbar toolbar = findView(R.id.toolbar);\n setSupportActionBar(toolbar);\n\n }", "private void InitView() {\n\n\t\tframe_element = new Frame_element();// 初始化保存框架元素的类\n\n\t\tframe_element\n\t\t\t\t.setRel_body_content((RelativeLayout) findViewById(R.id.rel_body_content));// 保存中间内容框架\n\t\tframe_element\n\t\t\t\t.setRel_top_bar((RelativeLayout) findViewById(R.id.rel_top_bar));// 保存顶部BAR框架\n\n\t\tframe_element\n\t\t\t\t.setRel_frist_bar((RelativeLayout) findViewById(R.id.rel_frist_bar));// 保存顶部首页BAR\n\t\t// 顶部右侧‘更多’按钮点击事件\n\t\timagebtn_more = (ImageButton) findViewById(R.id.imagebtn_more);\n\t\timagebtn_userhead_icon = (ImageButton) findViewById(R.id.imagebtn_userhead_icon);\n\t\timagebtn_more.setOnClickListener(this);\n\t\timagebtn_userhead_icon.setOnClickListener(this);\n\n\t}", "@Override\n\tprotected void initView() {\n\t\tsuper.initView();\n mLnSelectLanguage = (LinearLayout) findViewById(R.id.lnSelectLanguage);\n mBtnContinue = (Button) findViewById(R.id.btnContinue);\n mEdtPhoneNumber = (EditText) findViewById(R.id.edtPhoneNumber);\n mTvNationNameView = (TextView) findViewById(R.id.tvNationNameView);\n mChkAccept = (CheckBox) findViewById(R.id.chkAccept);\n mTvDieuKhoan = (TextView) findViewById(R.id.tvDieuKhoan);\n mTvNotifi1 = (TextView) findViewById(R.id.tvNotifi1);\n Utils.setTextViewHtml(mTvDieuKhoan,getString(R.string.dieukhoan));\n mLnSelectLanguage.setOnClickListener(this);\n mBtnContinue.setOnClickListener(this);\n mTvDieuKhoan.setOnClickListener(this);\n\n\t}", "@Override\n public void init() // set up GUI\n {\n setLayout(new FlowLayout());\n\n customerView = new CustomerView(); // initialize customerView\n \n add(customerView); // add customerView to the GUI\n }", "@Override\n protected void initViewSetup() {\n }", "private void initView() {\n\t\tcb_show = (CheckBox) findViewById(R.id.cb_show);\r\n\t\tbtn_next = (Button) findViewById(R.id.btn_next);\r\n\t}", "@Override\n\tprotected void initView() {\n\t\tsetContentView(R.layout.activity_money_manage);\n\t\t\n\t\tfindViewById(R.id.bt_title_left).setOnClickListener(this);\n\t\tfindViewById(R.id.bt_ok).setOnClickListener(this);\n\t}", "protected abstract void initViews(View mView);", "@Override\n\tprotected int initView() {\n\t\treturn R.layout.activity_zhusu_detail;\n\t}", "@SuppressLint(\"ResourceAsColor\")\r\n\tprivate void initView() {\n\t\tfriendOneBtn = (Button)getActivity().findViewById(R.id.friend_one_btn);\r\n\t\tfriendTwoBtn = (Button) getActivity().findViewById(R.id.friend_two_btn);\r\n\t\tcursorImage = (ImageView)getActivity().findViewById(R.id.cursor);\r\n\t\t// 进入添加好友页\r\n\t\tfriendOneBtn.setOnClickListener(listener);\r\n\t\tfriendTwoBtn.setOnClickListener(listener);\r\n\t\t\r\n\t\tunreadLabel = (TextView) getActivity().findViewById(R.id.unread_msg_number);\r\n unreadAddressLable = (TextView) getActivity().findViewById(R.id.unread_address_number);\r\n ImageView addContactView = (ImageView) getView().findViewById(R.id.iv_new_contact);\r\n\t\t// 进入添加好友页\r\n\t\taddContactView.setOnClickListener(new OnClickListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\tstartActivity(new Intent(getActivity(), AddContactActivity.class));\r\n\t\t\t}\r\n\t\t});\r\n\t}", "private void initView() {\n\n main_ll_rl = (LinearLayout) findViewById(R.id.main_ll_rili);\n main_ll_xw = (LinearLayout) findViewById(R.id.main_ll_xw);\n main_ll_wode = (LinearLayout) findViewById(R.id.main_ll_wd);\n main_ll_self = (LinearLayout) findViewById(R.id.main_ll_self);\n main_ll_hq = (LinearLayout) findViewById(R.id.main_ll_hq);\n main_zt_color = (LinearLayout) findViewById(R.id.main_zt_color);\n\n main_zt_color.setBackgroundColor(Color.parseColor(\"#e9e9ea\"));\n\n imgrl = (ImageView) findViewById(R.id.imgrili);\n imgxw = (ImageView) findViewById(R.id.imgxw);\n imgwd = (ImageView) findViewById(R.id.imgwd);\n imggr = (ImageView) findViewById(R.id.imgself);\n imghq = (ImageView) findViewById(R.id.imghq);\n\n main_rl_tv = (TextView) findViewById(R.id.main_rl_tv);\n main_xw_tv = (TextView) findViewById(R.id.main_xw_tv);\n main_wd_tv = (TextView) findViewById(R.id.main_wd_tv);\n main_gr_tv = (TextView) findViewById(R.id.main_self_tv);\n main_hq_tv = (TextView) findViewById(R.id.main_hq_tv);\n\n main_ll_rl.setOnClickListener(this);\n main_ll_xw.setOnClickListener(this);\n main_ll_wode.setOnClickListener(this);\n main_ll_hq.setOnClickListener(this);\n main_ll_self.setOnClickListener(this);\n }", "private void initView(View view) {\n\t\tif (imageView == null) {\n\t\t\timageView = new MyImageView(getActivity());\n\t\t\tscrollView = (MyScrollView) view.findViewById(R.id.my_scroll_view);\n\t\t}\n\t}", "protected abstract void initializeComponent(View view);", "private void initView() {\n mRetrofit = new Retrofit.Builder()\n .baseUrl(Challenge1Activity.MY_BASE_URL)\n .addConverterFactory(GsonConverterFactory.create())\n .build();\n\n mTextViewDisplayTopRated = findViewById(R.id.text_view_display_toprated_movies);\n\n mTextViewPrev = findViewById(R.id.text_view_prev);\n mTextViewCurrentAndMaxPage = findViewById(R.id.text_view_current_and_max_page);\n mTextViewNext = findViewById(R.id.text_view_next);\n }", "protected void onLoadLayout(View view) {\n }", "@Override protected void initViews() {\n\t\tsetFragments(F_PopularFragment.newInstance(T_HomeActivity.this), F_TimelineFragment.newInstance(T_HomeActivity.this));\n\t}", "private void initView() {\n // set layout for recycle view\n //hasFixedSize true if adapter changes cannot affect the size of the RecyclerView\n recyclerView.setHasFixedSize(true);\n // this layout can be vertical or horizontal by change the second param\n // of LinearLayoutManager, and display up to down by set the third param false\n LinearLayoutManager layoutManager = new LinearLayoutManager(this,\n LinearLayoutManager.VERTICAL, false);\n\n recyclerView.setLayoutManager(layoutManager);\n importData();\n // set adapter for recycle view\n recyclerView.setAdapter(alarmAdapter);\n }", "private void initView() {\n\t\tself_info.setOnClickListener(this);\r\n\t\twhich_org.setOnClickListener(this);\r\n\t\tmember_information.setOnClickListener(this);\r\n\t}", "private void initView() {\n btnLoginFacebook = (RelativeLayout) findViewById(R.id.btnLoginFacebook);\n btnLoginGoogle = (RelativeLayout) findViewById(R.id.btnLoginGoogle);\n txtRegister = (TextViewFontAwesome) findViewById(R.id.txtRegister);\n txtForgotPassword = (TextViewFontAwesome) findViewById(R.id.txtForgotPassword);\n txtLogin = (TextViewFontAwesome) findViewById(R.id.txtLogin);\n txtUsername = (EditText) findViewById(R.id.txtUsername);\n txtPassword = (EditText) findViewById(R.id.txtPassword);\n txtForgotPassword.setPaintFlags(txtForgotPassword.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);\n }", "private void initViews() {\n\t\tet_area = (EditText) findViewById(R.id.et_area);\r\n\t\tbtn_search = (Button) findViewById(R.id.btn_search);\r\n\t\tll_main = (LinearLayout) findViewById(R.id.ll_main);\r\n\t}", "private void initializeLayout(){\n String title = mStrInfo;\n String subtitle = mClientItem.clientName;\n mHomeToolbar.setGymRatToolbarTitle(title, subtitle);\n\n //initialize maids\n initializeMaid();\n\n //initialize bottom navigation\n initializeBottomNavigation();\n }", "private void initView(View view) {\n rlMain = view.findViewById(R.id.rlMain);\n llHeader = view.findViewById(R.id.llHeader);\n tvManually = view.findViewById(R.id.tvManually);\n tbPerson = view.findViewById(R.id.tbPerson);\n viewPagerPerson = view.findViewById(R.id.viewPagerPerson);\n tvPersonHeader = view.findViewById(R.id.tvPersonHeader);\n tvPersonHeader.setText(getString(R.string.choose_vehicle));\n tbPerson.setTabMode(TabLayout.MODE_SCROLLABLE);\n\n isPopulateView();\n\n aRightsMapper = db.getSectionList();\n validateRights();\n setPersonPagerData();\n tvManually.setOnClickListener(this);\n }", "public HomeView() {\n initComponents();\n }", "private void initView() {\n\t\tlogin = (Button) pageViews.get(2).findViewById(R.id.sendbtn);\n\t\tlogin.setOnClickListener(this);\n\t}", "private void initView(View view) {\n mRecyclerView = view.findViewById(R.id.recycler_view);\n mSearchView = view.findViewById(R.id.search_view);\n mFloatingActionButton = view.findViewById(R.id.message_floating_action_button);\n }", "private void initView() {\n\t\tsetContentView(R.layout.activity_main);\n\t\tlv_showdatas = (ListView) findViewById(R.id.lv_datas);\n\t\t\n\t\tmyAdapter = new MyAdapter();\n\t\tlv_showdatas.setAdapter(myAdapter);\n\t\tbt_speak = (Button) findViewById(R.id.bt_speak);\n\t}", "public Layout() {\n super(\"Chitrashala\");\n initComponents();\n }", "private void initBaseLayout()\n {\n add(viewPaneWrapper, BorderLayout.CENTER);\n \n currentLayoutView = VIEW_PANE;\n currentSearchView = SEARCH_PANE_VIEW;\n showMainView(VIEW_PANE);\n showSearchView(currentSearchView);\n }", "@Override\n public void Create() {\n\n initView();\n }", "@Override\n public View initView() {\n\n View picture_menu_page = View.inflate(mActivity, R.layout.picture_menu_page, null);\n\n lv_pitruemenupage_content = (ListView) picture_menu_page.findViewById(R.id.lv_pitruemenupage_content);\n\n gv_pitruemenupage_content = (GridView) picture_menu_page.findViewById(R.id.gv_pitruemenupage_content);\n return picture_menu_page;\n\n }", "private void init() {\n //set view to presenter\n presenter.setView(this, service);\n\n setupView();\n }", "public void init() {\n setLayout(new BorderLayout());\n }", "@Override\n public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {\n super.onViewCreated(view, savedInstanceState);\n initView();\n }", "public AulaView() {\n initComponents();\n }", "private void initView(){\n backBtn = (Button)findViewById(R.id.header_bar_btn_back);\n titleTv = (TextView)findViewById(R.id.header_bar_tv_title);\n confirmBtn = (Button)findViewById(R.id.header_bar_btn_add);\n }", "public InputView()\n\t{\n\t\tthis.layoutView();\n\t\tthis.registerButtons();\n\t}", "private void initView() {\n LayoutInflater inflater = LayoutInflater.from(mContext);\n // Inflate the Ad view. The layout referenced should be the one you created in the last step.\n View adView = inflater.inflate(R.layout.adsplugin_native_gallery_layout, mNativeAdView, false);\n FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.CENTER);\n mNativeAdView.addView(adView, params);\n\n mPB = mNativeAdView.findViewById(R.id.ads_plugin_pb);\n mPB.setVisibility(View.GONE);\n\n mNext = mNativeAdView.findViewById(R.id.ads_plugin_native_next);\n mNext.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n loadNewNativeAd();\n mPB.setVisibility(View.VISIBLE);\n mNext.setVisibility(View.GONE);\n }\n });\n }", "private void initViews() {\n user_name = (LinearLayout)findViewById(R.id.user_name);\n user_photo = (LinearLayout)findViewById(R.id.user_photo);\n user_sex = (LinearLayout)findViewById(R.id.user_sex);\n user_notes = (LinearLayout)findViewById(R.id.user_notes);\n name = (TextView)findViewById(R.id.name);\n sex = (TextView)findViewById(R.id.sex);\n notes = (TextView)findViewById(R.id.notes);\n email = (TextView)findViewById(R.id.email);\n photo = (ImageView)findViewById(R.id.photo);\n }", "private void initView() {\n\t\tfindViewById(R.id.rl_titlebar).setBackgroundColor(getResources().getColor(R.color.deep_blue));\n\t\tImageView mLeftImgv=(ImageView) findViewById(R.id.imgv_leftbtn);\n\t\t((TextView)findViewById(R.id.tv_title)).setText(\"病毒查杀进度\");\n\t\tmLeftImgv.setOnClickListener(this);\n\t\tmLeftImgv.setImageResource(R.drawable.title_back);\n\t\tmProcessTV = (TextView) findViewById(R.id.tv_scanprocess);\n\t\tmScanAppTV = (TextView) findViewById(R.id.tv_scansapp);\n\t\tmCancleBtn = (Button) findViewById(R.id.btn_canclescan);\n\t\tmCancleBtn.setOnClickListener(this);\n\t\tmScanListView = (ListView) findViewById(R.id.lv_scanapps);\n\t\tadapter=new ScanVirusAdapter(mScanAppInfos, this);\n\t\tmScanListView.setAdapter(adapter);\n\t\tmScanningIcon = (ImageView) findViewById(R.id.imgv_scanningicon);\n\t\tstartAnim();\n\t}", "private void initViews() {\n\t\t\r\n\t\tTypeface face = Typeface.createFromAsset(getAssets(), \"Teko_Light.ttf\");\r\n\r\n\t\tet_pin = (EditText) findViewById(R.id.et_pin);\r\n\t\tet_pin.setTypeface(face);\r\n\t\tbtn_admin_login = (Button) findViewById(R.id.btn_admin_login);\r\n\t\tbtn_admin_login.setTypeface(face);\r\n\r\n\t\td = new DialogView();\r\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n initView();\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(getLayoutId(), container, false);\n init(view);\n return view;\n }", "@Override\r\n protected void initView() {\n mTitleTV = (TextView) findViewById(R.id.sub_header_bar_tv);\r\n mBackIBtn = (ImageButton) findViewById(R.id.sub_header_bar_left_ibtn);\r\n mChooseVehicleTypeLL = (LinearLayout) findViewById(R.id.choose_vehicle_type_ll);\r\n mVehicleTypeTV = (TextView) findViewById(R.id.vehicle_type_tv);\r\n mVehicleCodeTV = (TextView) findViewById(R.id.car_plate_districe_coding_tv);\r\n mVehiclePlateNumET = (EditText) findViewById(R.id.vehicle_plate_num_et);\r\n mChooseCityLL = (LinearLayout) findViewById(R.id.choose_city_ll);\r\n mQueryCityTV = (TextView) findViewById(R.id.choose_city_tv);\r\n mVehicleFrameNumET = (EditText) findViewById(R.id.vehicle_frame_num_et);\r\n mVehicleEngineNumET = (EditText) findViewById(R.id.vehicle_engine_num_et);\r\n mVehicleFrameHelpIV = (ImageView) findViewById(R.id.vehicle_frame_info_iv);\r\n mVehicleEngineHelpIV = (ImageView) findViewById(R.id.vehicle_engine_info_iv);\r\n mQueryBtn = (Button) findViewById(R.id.illegal_query_btn);\r\n mVehicleFrameNumLL = (LinearLayout) findViewById(R.id.vehicle_frame_num_ll);\r\n mVehicleEngineNumLL = (LinearLayout) findViewById(R.id.vhicle_engine_num_ll);\r\n }", "public viewOpe() {\n initComponents();\n }", "private void initViews() {\n mTvBalance = findViewById(R.id.tv_receive_client_balance);\n mListView = findViewById(R.id.lv_list_receive_client);\n mFab = findViewById(R.id.fab_receive_receip);\n mTvEmpty = findViewById(R.id.tv_empty_view);\n mIvEmpty = findViewById(R.id.iv_empty_view);\n mEmptyView = findViewById(R.id.empty_view);\n }" ]
[ "0.8457629", "0.8331588", "0.8331588", "0.8288165", "0.82718277", "0.82694733", "0.8258238", "0.82422584", "0.8233692", "0.8233692", "0.82140875", "0.82140875", "0.81440884", "0.81440884", "0.8111374", "0.811104", "0.8084093", "0.8083335", "0.80680656", "0.8024109", "0.7993259", "0.7966747", "0.79645777", "0.79645777", "0.7957949", "0.7934522", "0.7923537", "0.79013556", "0.78935593", "0.7843658", "0.7727462", "0.7714546", "0.7688622", "0.7617785", "0.7547397", "0.75125694", "0.7511716", "0.74767107", "0.74379104", "0.7431831", "0.7425069", "0.7403387", "0.7401193", "0.7401193", "0.7379356", "0.7377937", "0.7359121", "0.7353741", "0.7342586", "0.73344886", "0.7327182", "0.73116255", "0.72946817", "0.7286619", "0.7285382", "0.727535", "0.7268856", "0.7254852", "0.724675", "0.7239904", "0.7235451", "0.7234759", "0.7233712", "0.72107816", "0.7202264", "0.7201137", "0.7192885", "0.71887654", "0.71862286", "0.718247", "0.7181811", "0.71772957", "0.7160341", "0.7157468", "0.71537054", "0.7146012", "0.7144441", "0.7141054", "0.7140343", "0.71374196", "0.7137182", "0.7129541", "0.7121964", "0.7105606", "0.7091117", "0.70848346", "0.7076415", "0.70685995", "0.706213", "0.7058638", "0.7057816", "0.70567524", "0.70483094", "0.7046518", "0.7035732", "0.7032389", "0.7031752", "0.70304215", "0.70220524", "0.7021201", "0.70127195" ]
0.0
-1
Initialize the View of the listener
@Override protected void initListeners() { this.adapter.setOnItemClickListener((view, i) -> { final String className = classes.get(i).getSimpleName(); if (SmartRouterSampleActivity.class.getSimpleName().equals(className)) { SmartRouters.start(this, MainApplication.getScheme() + "://" + "router-0x01?" + "char=z&" + "byte=x&" + "short=2&" + "int=233&" + "float=233.233&" + "double=2333.2333&" + "long=2333&" + "boolean=true&" + "boxedCharacter=Z&" + "boxedByte=u&" + "boxedShort=3&" + "boxedInteger=1233&" + "boxedFloat=1233.233&" + "boxedDouble=12333.2333&" + "boxedLong=12333&" + "boxedBoolean=true&" + "boxedString=CaMnter" ); } else if (CustomRouterActivity.class.getSimpleName().equals(className)) { /* * In Application: * * SmartRouters.register(new Router<CustomRouterActivity>() { * * @Override * public void register(@NonNull Map<String, Class<? extends Activity>> routerMapping) { * routerMapping.put(SmartRouters.getScheme() + "://" + "router-0x02", * CustomRouterActivity.class); * } * * * @Override * public void setFieldValue(@NonNull CustomRouterActivity activity) { * final Intent intent = activity.getIntent(); * final Uri uri = intent.getData(); * if (uri == null) return; * * activity.exampleBoxedString = uri.getQueryParameter("boxedString"); * } * * }); */ SmartRouters.start(this, MainApplication.getScheme() + "://" + "router-0x02?" + "boxedString=CaMnter" ); } else if (RouterCenterActivity.class.getSimpleName().equals(className)) { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("smart-routers://router-0x02?boxedString=CaMnter"))); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void init() {\n initView();\n setListener();\n }", "private void initView() {\n TIMManager.getInstance().addMessageListener(this);\n initAdapter();\n initRefresh();\n }", "private void initView() {\n\n }", "@Override\n public void initView() {\n }", "private void initView(){\n\t\tinitSize();\n\t\tinitText();\n\t\tinitBackground();\n\t\tthis.setOnClickListener(this);\n\t\tthis.setOnLongClickListener(this);\n\t}", "@Override\r\n\tpublic void initView() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void initView() {\n\t\t\r\n\t}", "@Override\n\tpublic void initView() {\n\t\t\n\t}", "public void initView(){}", "@Override\n public void initView() {\n\n }", "@Override\n protected void initView() {\n getPresenter().getRxManager().on(C.EVENT_LOGIN, new Action1<Object>() {\n\n @Override\n public void call(Object o) {\n\n Log.e(TAG, \"call() called with: o = [\" + o.toString() + \"]\"+o.getClass());\n }\n });\n\n }", "@Override\n protected void initView() {\n }", "@Override\n protected void initView() {\n }", "void initView();", "private void viewInit() {\n }", "@Override\r\n\tprotected void initView() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initView() {\n\t\t\r\n\t}", "private void initView() {\n\t\tself_info.setOnClickListener(this);\r\n\t\twhich_org.setOnClickListener(this);\r\n\t\tmember_information.setOnClickListener(this);\r\n\t}", "@Override\n\tprotected void initView() {\n\t\t\n\t}", "@Override\n\tprotected void initView() {\n\t\t\n\t}", "@Override\n\tpublic void InitView() {\n\t\t\n\t}", "@Override\n\tprotected void initView()\n\t{\n\n\t}", "protected abstract void initView();", "private void onViewInit() {\n setFocusable(true);\n setFocusableInTouchMode(true);\n setBackgroundColor(Color.WHITE);\n setOnTouchListener(this);\n onCanvasInit();\n }", "public abstract void initView();", "@SuppressLint(\"ResourceAsColor\")\r\n\tprivate void initView() {\n\t\tfriendOneBtn = (Button)getActivity().findViewById(R.id.friend_one_btn);\r\n\t\tfriendTwoBtn = (Button) getActivity().findViewById(R.id.friend_two_btn);\r\n\t\tcursorImage = (ImageView)getActivity().findViewById(R.id.cursor);\r\n\t\t// 进入添加好友页\r\n\t\tfriendOneBtn.setOnClickListener(listener);\r\n\t\tfriendTwoBtn.setOnClickListener(listener);\r\n\t\t\r\n\t\tunreadLabel = (TextView) getActivity().findViewById(R.id.unread_msg_number);\r\n unreadAddressLable = (TextView) getActivity().findViewById(R.id.unread_address_number);\r\n ImageView addContactView = (ImageView) getView().findViewById(R.id.iv_new_contact);\r\n\t\t// 进入添加好友页\r\n\t\taddContactView.setOnClickListener(new OnClickListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\tstartActivity(new Intent(getActivity(), AddContactActivity.class));\r\n\t\t\t}\r\n\t\t});\r\n\t}", "protected abstract void initializeView();", "private void initViews() {\n\n }", "public void initViews(){\n }", "@Override\r\n\tpublic void initViews() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void initViews() {\n\t\t\r\n\t}", "public void initView() {\n\t\t view.initView(model);\t \n\t }", "private void initView() {\n\t\t//buttonPlayPause = (ImageButton)getView().findViewById(R.id.ButtonTestPlayPause);\n\t\t//buttonPlayPause.setOnClickListener(this);\n\t\t\n\t\t//seekBarProgress = (SeekBar)getView().findViewById(R.id.SeekBarTestPlay);\t\n\t\t//seekBarProgress.setMax(99); // It means 100% .0-99\n\t\t//seekBarProgress.setOnTouchListener(this);\n\t\t//editTextSongURL = (EditText)findViewById(R.id.EditTextSongURL);\n\t\t//editTextSongURL.setText(R.string.testsong_20_sec);\n\t\t\n\t\t//mediaPlayer = new MediaPlayer();\n\t\t//mediaPlayer.setOnBufferingUpdateListener(this);\n\t\t//mediaPlayer.setOnCompletionListener(this);\n\t}", "private void initView() {\n initRefreshListView(mListview);\n }", "@Override\r\n\tprotected void initViews() {\n\t\t\r\n\t}", "private void initViews() {\n\n\t}", "@Override\n protected void initView() {\n pushTxt = (TextView) findViewById(R.id.push_txt);\n pushActivity = (TextView)findViewById(R.id.push_activity);\n pushArticle = (TextView)findViewById(R.id.push_article);\n pushProduce = (TextView)findViewById(R.id.push_produce);\n\n\n pushTxt.setOnClickListener(this);\n pushActivity.setOnClickListener(this);\n pushArticle.setOnClickListener(this);\n pushProduce.setOnClickListener(this);\n }", "@Override\n\tprotected void setUpView() {\n\t\tsuper.setUpView();\n\t\tsetChatFragmentListener(this);\n\t}", "private void initView(View view) {\n mRecyclerView = view.findViewById(R.id.recycler_view);\n mSearchView = view.findViewById(R.id.search_view);\n mFloatingActionButton = view.findViewById(R.id.message_floating_action_button);\n }", "private void initView() {\n\t\tlogin = (Button) pageViews.get(2).findViewById(R.id.sendbtn);\n\t\tlogin.setOnClickListener(this);\n\t}", "@Override\r\n\tprotected void initViewListener() {\n\t\tsuper.initViewListener();\r\n\t\ttitleBarBack.setOnClickListener(this);\r\n\t\tchongzhi.setOnClickListener(this);\r\n\t\thuankuan.setOnClickListener(this);\r\n\t}", "private void initListener() {\n }", "private void initview() {\n\t\tMyOnClickLinstener clickLinstener = new MyOnClickLinstener();\n\t\tdeliverynote_query_back.setOnClickListener(clickLinstener);\n\t\tdate_layout.setOnClickListener(clickLinstener);\n\t\t\n\t\t//listview条目点击事件\n\t\tDeliveryQueryListView.setOnItemClickListener(new OnItemClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onItemClick(AdapterView<?> adapterView, View view, int position,\n\t\t\t\t\tlong arg3) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tIntent intent = new Intent(DeliveryNoteQueryActivity.this, DeliveryNoteDetailActivity.class);\n\t\t\t\tBundle bundle = new Bundle();\n\t\t\t\tDeliveryNote deliveryNote = (DeliveryNote) adapterView.getItemAtPosition(position);\n\t\t\t\tbundle.putString(\"currenttime\",currenttime);\n\t\t\t\tbundle.putSerializable(\"deliveryNote\", deliveryNote);\n\t\t\t\tintent.putExtras(bundle);\n\t\t\t\tstartActivity(intent);\n\t\t\t}\n\t\t});\n\t}", "public void initListener() {\n }", "public abstract void initUiAndListener();", "public abstract void initViews();", "@Override\n public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {\n super.onViewCreated(view, savedInstanceState);\n initView();\n }", "private void init() {\n //set view to presenter\n presenter.setView(this, service);\n\n setupView();\n }", "public ViewSinFaltante() {\n initComponents();\n }", "@Override\n protected void initView() {\n springView.setListener(new SpringView.OnFreshListener() {\n @Override\n public void onRefresh() {\n new Thread(new Runnable() {\n @Override\n public void run() {\n isRefresh = true;\n currentPage = 1;\n handler.sendEmptyMessage(ConstantValue.SHUAXIN_SUCESS);\n }\n }).start();\n }\n\n @Override\n public void onLoadmore() {\n new Thread(new Runnable() {\n @Override\n public void run() {\n isRefresh = false;\n currentPage++;\n handler.sendEmptyMessage(ConstantValue.JIAZAI_SUCESS);\n }\n }).start();\n }\n });\n }", "public ViewInit() {\n initComponents();\n }", "public void initView() {\n setEllipsize(TruncateAt.MARQUEE);\n setSingleLine(true);\n setMarqueeRepeatLimit(-1);\n setFocusable(true);\n setFocusableInTouchMode(false);\n }", "protected abstract void initViews();", "@Override\n protected void initView() {\n ButterKnife.bind(this);\n }", "private void initView(View view) {\n rlMain = view.findViewById(R.id.rlMain);\n llHeader = view.findViewById(R.id.llHeader);\n tvManually = view.findViewById(R.id.tvManually);\n tbPerson = view.findViewById(R.id.tbPerson);\n viewPagerPerson = view.findViewById(R.id.viewPagerPerson);\n tvPersonHeader = view.findViewById(R.id.tvPersonHeader);\n tvPersonHeader.setText(getString(R.string.choose_vehicle));\n tbPerson.setTabMode(TabLayout.MODE_SCROLLABLE);\n\n isPopulateView();\n\n aRightsMapper = db.getSectionList();\n validateRights();\n setPersonPagerData();\n tvManually.setOnClickListener(this);\n }", "private void initListener() {\n mVideoView.setOnPreparedListener(this);\n mVideoView.setOnCompletionListener(this);\n mVideoView.setOnErrorListener(this);\n }", "@Override\n\tprotected void initComponent() {\n\t\tmView.setClickable(true);\n\t\tmView.findViewById(R.id.know_text).setOnClickListener(mOnClickListener);\n\t\tmTitle = (TextView)mView.findViewById(R.id.unknown_title);\n\t}", "@Override\n protected void initView() {\n view.setVideoThumbnail(model.getThumbnail());\n\n if (isInFocus) {\n playOrPauseVideoIfMomentIsInFocus();\n }\n\n view.setMomentTitle(model.getTitle());\n view.setCounterTimeText(\"\" + Math.round((model.getEndTimeMs() - model.getStartTimeMs())/ TimeUtil.MS_IN_SECOND));\n\n view.setState(isInFocus);\n }", "private void initView() {\r\n\t\tviewerGraz.refresh(true);\r\n\t\tviewerGraz.refresh(true);\r\n\t\tviewerKapfenberg.refresh(true);\r\n\t\tviewerLeoben.refresh(true);\r\n\t\tviewerMariazell.refresh(true);\r\n\t\tviewerWien.refresh(true);\r\n\t}", "@Override\n\tprotected void initView() {\n\t\tsuper.initView();\n mLnSelectLanguage = (LinearLayout) findViewById(R.id.lnSelectLanguage);\n mBtnContinue = (Button) findViewById(R.id.btnContinue);\n mEdtPhoneNumber = (EditText) findViewById(R.id.edtPhoneNumber);\n mTvNationNameView = (TextView) findViewById(R.id.tvNationNameView);\n mChkAccept = (CheckBox) findViewById(R.id.chkAccept);\n mTvDieuKhoan = (TextView) findViewById(R.id.tvDieuKhoan);\n mTvNotifi1 = (TextView) findViewById(R.id.tvNotifi1);\n Utils.setTextViewHtml(mTvDieuKhoan,getString(R.string.dieukhoan));\n mLnSelectLanguage.setOnClickListener(this);\n mBtnContinue.setOnClickListener(this);\n mTvDieuKhoan.setOnClickListener(this);\n\n\t}", "private void initView() {\n\t\tstart_anima = new AlphaAnimation(0.3f, 1.0f);\r\n\t\tstart_anima.setDuration(2000);\r\n\t\tview.startAnimation(start_anima);\r\n\t\tstart_anima.setAnimationListener(new AnimationListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onAnimationStart(Animation animation) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onAnimationRepeat(Animation animation) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onAnimationEnd(Animation animation) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\tredirectTo();\r\n\t\t\t}\r\n\t\t});\r\n\t}", "public MainView() {\n initComponents();\n addWindowListener(new AreYouSure());\n }", "@Override\n protected void initView() {\n super.initView();\n searchView = (SearchView) findViewById(R.id.search_view);\n searchView.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n searchView.onActionViewExpanded();\n }\n });\n searchView.setOnCloseListener(new SearchView.OnCloseListener() {\n @Override\n public boolean onClose() {\n mRunnersAdapter.setRunners(mRunners);\n mRunnersAdapter.notifyDataSetChanged();\n return false;\n }\n });\n searchView.setOnQueryTextListener(listenerSearch);\n searchView.setQueryRefinementEnabled(true);\n mListView = (ListView) findViewById(R.id.runners_you_may_know_list);\n\t\t/*final Dialog dialog = CustomLoadingDialog.show(RunnerActivity.this, \"\",\n\t\t\t\t\"\", false, false);*/\n\n // Set adpater for listview\n mRunners = new ArrayList<Runner>();\n mRunnersAdapter = new NewRunnerAdapter(RunnerActivity.this, mRunners,\n mImageLoader);\n\t\t/*mListView.setAdapter(mRunnersAdapter);\n\t\tmListView.setOnItemClickListener(this);*/\n if(mLoadingDialog == null) {\n mLoadingDialog = CustomLoadingDialog.show(RunnerActivity.this, \"\", \"\", false, false);\n }\n loadListRunner();\n\n\n }", "private void init()\n {\n // Add listeners to the view\n addEventListeners();\n addSelectionChangeListeners();\n\n // Add listeners to the model\n addBackgroundImageHandler();\n addFrameWidgetHandler();\n addWidgetShapeChangeHandler();\n\n project.addHandler(this,\n Project.DesignChange.class,\n new AlertHandler()\n {\n\n public void handleAlert(EventObject alert)\n {\n Project.DesignChange chg =\n (Project.DesignChange) alert;\n\n if ((! chg.isAdd) &&\n (chg.element == design))\n {\n closeOpenController();\n }\n }\n });\n\n design.addHandler(this,\n Design.FrameChange.class,\n new AlertHandler()\n {\n\n public void handleAlert(EventObject alert)\n {\n Design.FrameChange chg =\n (Design.FrameChange) alert;\n\n if ((! chg.isAdd) &&\n (chg.element == frame))\n {\n closeOpenController();\n }\n }\n });\n\n design.addHandler(this,\n Design.DeviceTypeChange.class,\n new AlertHandler()\n {\n\n public void handleAlert(EventObject alert)\n {\n Set<DeviceType> dts =\n design.getDeviceTypes();\n int deviceTypes =\n DeviceType.buildDeviceSet(dts);\n\n view.resetDeviceTypes(deviceTypes);\n }\n });\n\n // Add listeners to rename events on project and design\n frame.addHandler(this, NameChangeAlert.class, renameHandler);\n design.addHandler(this,\n NameChangeAlert.class,\n renameHandler);\n\n // Some items should always be enabled.\n // Should be the last call in the constructor\n setInitiallyEnabled(true);\n }", "void initializeView() {\n displayProjectFilter();\n displayTimeFrameFilter();\n\n setUsersIntoComboBox();\n setClientsIntoComboBox();\n setProjectsIntoComboBox();\n setDateRestrictions();\n setValidators();\n setTable();\n\n selectUser();\n selectClient();\n selectProject();\n listenDatePickerStart();\n listenDatePickerEnd();\n\n removeUserFilter();\n removeProjectFilter();\n removeTimeFrameFilter();\n clearAllFilters();\n\n // this is important for hiding user combo box and stuff\n setUpUserRules();\n\n //vBox.translateXProperty().bind((scrollPane.widthProperty().subtract(vBox.widthProperty())).divide(2));\n scrollPane.widthProperty().addListener((observable, oldValue, newValue) -> {\n if (newValue != null) {\n grid.setPrefWidth(newValue.doubleValue() - (oldValue.doubleValue() - scrollPane.getViewportBounds().getWidth()));\n }\n });\n\n //TODO: Refactor this.\n setUpBarChart();\n tbvTasks.getItems().addListener((ListChangeListener.Change<? extends TaskConcrete2> c) -> {\n setUpBarChart();\n });\n\n setToolTipsForButtons();\n changeTableSize();\n }", "public void initView(Bundle bundle) {\n this.mIbLeft.setOnClickListener(new a(this));\n this.mTvTitle.setText(R.string.qr_code);\n this.mZxingview.setDelegate(this);\n }", "private void initview() {\n\t\tbtn_connect = (Button) findViewById(R.id.btn_connect);\n\t\tbtn_disconnect = (Button) findViewById(R.id.btn_disconnect);\n\t\tbtn_send = (Button) findViewById(R.id.pinpad_controller_btn_send);\n\t\tbtn_recv = (Button) findViewById(R.id.pinpad_controller_btn_recv);\n\t\tbtn_clear = (Button) findViewById(R.id.btn_clear);\n\t\tbtn_random = (Button) findViewById(R.id.btn_random);\n\t\tbtn_connect.setOnClickListener(this);\n\t\tbtn_recv.setOnClickListener(this);\n\t\tbtn_send.setOnClickListener(this);\n\t\tbtn_disconnect.setOnClickListener(this);\n\t\tbtn_clear.setOnClickListener(this);\n\t\tbtn_random.setOnClickListener(this);\n\t\ttv_read = (TextView) findViewById(R.id.pinpad_controller_tv_recv);\n\t\tet_send = (EditText) findViewById(R.id.pinpad_controller_et_send);\n\t\ttv_version = (TextView) findViewById(R.id.pinpad_controller_tv_version);\n\t\ttv_version.setText(\"\");\n\t\tsetViewEnabledFalse();\n\t}", "@Override\r\n\tprotected void initListener() {\n\t\tsuper.initListener();\r\n\t}", "public void initListener() {\n this.mSearchView.setOnQueryTextListener(this);\n this.mTopDisplayAdapter.setOnItemClickListener(new BaseSearchContactActivity$$Lambda$2(this));\n this.mSearchAdapter.setOnItemClickListener(new BaseSearchContactActivity$$Lambda$3(this));\n }", "public void initView() {\n ((TextView) _$_findCachedViewById(R.id.tvCancelResv)).setOnClickListener(new MyResvDetailActivity$initView$1(this));\n getResvDetail();\n }", "public MainView() {\n initComponents();\n \n }", "private void initView() {\n mBinding.swipeRefresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {\n @Override\n public void onRefresh() {\n\n mBinding.swipeRefresh.setRefreshing(false);\n }\n });\n\n\n setUpBookingRecycler();\n bindStaticData();\n setUpBookingAdapter();\n }", "public View() {\n initComponents();\n }", "public ManipularView() {\n initComponents();\n }", "public void init(){\n\t\t//Makes the view\n\t\tsetUpView();\n\n\t\t//Make the controller. Links the action listeners to the view\n\t\tnew Controller(this);\n\t\t\n\t\t//Initilize the array list\n\t\tgameInput = new ArrayList<Integer>();\n\t\tuserInput = new ArrayList<Integer>();\n\t\thighScore = new HighScoreArrayList();\n\t}", "protected void initView(View rootView) {\n\n }", "private void initView() {\n mRetrofit = new Retrofit.Builder()\n .baseUrl(Challenge1Activity.MY_BASE_URL)\n .addConverterFactory(GsonConverterFactory.create())\n .build();\n\n mTextViewDisplayTopRated = findViewById(R.id.text_view_display_toprated_movies);\n\n mTextViewPrev = findViewById(R.id.text_view_prev);\n mTextViewCurrentAndMaxPage = findViewById(R.id.text_view_current_and_max_page);\n mTextViewNext = findViewById(R.id.text_view_next);\n }", "@Override\n\tprotected void initView() {\n\t\tlvMsg=(ListView) findViewById(R.id.lv_activity_my_message);\n\t\tivBack = (ImageView) findViewById(R.id.activity_my_message_iv_back);\n\t\tprogressDialog=ProgressDialogHandle.getProgressDialog(this, null);\n\t}", "@Override\n\tpublic void initView() {\n\t\tmylis_show.setTitleText(\"我的物流\");\n\t\tlistView = mylis_listview.getRefreshableView();\n\t\t\n\t}", "private void InitView() {\n\n\t\tframe_element = new Frame_element();// 初始化保存框架元素的类\n\n\t\tframe_element\n\t\t\t\t.setRel_body_content((RelativeLayout) findViewById(R.id.rel_body_content));// 保存中间内容框架\n\t\tframe_element\n\t\t\t\t.setRel_top_bar((RelativeLayout) findViewById(R.id.rel_top_bar));// 保存顶部BAR框架\n\n\t\tframe_element\n\t\t\t\t.setRel_frist_bar((RelativeLayout) findViewById(R.id.rel_frist_bar));// 保存顶部首页BAR\n\t\t// 顶部右侧‘更多’按钮点击事件\n\t\timagebtn_more = (ImageButton) findViewById(R.id.imagebtn_more);\n\t\timagebtn_userhead_icon = (ImageButton) findViewById(R.id.imagebtn_userhead_icon);\n\t\timagebtn_more.setOnClickListener(this);\n\t\timagebtn_userhead_icon.setOnClickListener(this);\n\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_tower_parameter, container, false);\n bind = ButterKnife.bind(this,view);\n EventBus.getDefault().register(this);\n initRecycleView();\n initView();\n initRotationAngle();\n initHookup();\n return view;\n }", "@Override\n\tprotected void initListener() {\n\n\t}", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\t\r\n\t\tinitView();\r\n\t}", "@Override\n public void init(View view) {\n this.view = (BackstoryView) view;\n }", "protected abstract void initializeComponent(View view);", "private void initView() {\n\t\tsetContentView(R.layout.activity_main);\n\t\tlv_showdatas = (ListView) findViewById(R.id.lv_datas);\n\t\t\n\t\tmyAdapter = new MyAdapter();\n\t\tlv_showdatas.setAdapter(myAdapter);\n\t\tbt_speak = (Button) findViewById(R.id.bt_speak);\n\t}", "@Override \n protected void startup() {\n GretellaView view = new GretellaView(this);\n show( view );\n view.initView(); \n }", "public MainView() {\r\n\t\tinitialize();\r\n\t}", "public void start() {\r\n view.addListener(this);\r\n view.makeVisible();\r\n view.display();\r\n }", "private void initListener() {\n initPieceListener();\n initButtonsListener();\n }", "private void initView() {\n\t\tfindViewById(R.id.rl_titlebar).setBackgroundColor(getResources().getColor(R.color.deep_blue));\n\t\tImageView mLeftImgv=(ImageView) findViewById(R.id.imgv_leftbtn);\n\t\t((TextView)findViewById(R.id.tv_title)).setText(\"病毒查杀进度\");\n\t\tmLeftImgv.setOnClickListener(this);\n\t\tmLeftImgv.setImageResource(R.drawable.title_back);\n\t\tmProcessTV = (TextView) findViewById(R.id.tv_scanprocess);\n\t\tmScanAppTV = (TextView) findViewById(R.id.tv_scansapp);\n\t\tmCancleBtn = (Button) findViewById(R.id.btn_canclescan);\n\t\tmCancleBtn.setOnClickListener(this);\n\t\tmScanListView = (ListView) findViewById(R.id.lv_scanapps);\n\t\tadapter=new ScanVirusAdapter(mScanAppInfos, this);\n\t\tmScanListView.setAdapter(adapter);\n\t\tmScanningIcon = (ImageView) findViewById(R.id.imgv_scanningicon);\n\t\tstartAnim();\n\t}", "@Override\r\n\tpublic void initView() {\n\t\tsuper.initView();\r\n\t\tdialog = new BufferDialog(this);\r\n\t\tswitchAntiLost = (Switch) findViewById(R.id.switch_antilost);\r\n\t}", "@Override\n protected void initViewSetup() {\n }", "private void init(View view) {\n tvRecordNotFound = view.findViewById(R.id.tvRecordNotFoundId);\n rvcarslist = view.findViewById(R.id.rvcarslistId);\n ivbackid = view.findViewById(R.id.ivbackid);\n LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity(), RecyclerView.VERTICAL, false);\n rvcarslist.setLayoutManager(layoutManager);\n ridesAdapter = new RidesAdapter(getActivity(), this);\n rvcarslist.setAdapter(ridesAdapter);\n ivbackid.setOnClickListener(this);\n }", "@Override\n public void Create() {\n\n initView();\n }", "@Override\r\n\tpublic void initListener() {\n\r\n\t}", "@Override\n\tpublic void onActivityCreated(@Nullable Bundle savedInstanceState) {\n\t\tinitView();\n\t\tinitListener();\n\t\tinitData();\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void initView() {\n\t\tIntent intent=getIntent();\n\t\tString title=intent.getStringExtra(\"title\");\n\t\tcontext=intent.getStringExtra(\"context\");\n\t\tsetTitle(title);\n\t\tsetGone();\n\t\tsetBack();\n\t\tlist=new ArrayList<GameFighterBean>();\n\t\ttopNewsMoreLV = (LoadListViewnews) findViewById(R.id.lv_more_topnew);\n\t\txuanshou_quanbu_wu = (Button) findViewById(R.id.xuanshou_quanbu_wu);\n\t\txuanshou_quanbu_wu.setVisibility(View.VISIBLE);\n\t\tinitNetwork(context);\n\n\t}", "private void initView() {\n setContentView(R.layout.activity_dvkitdemo);\n\n mStartDiscoveryButton = findViewById(R.id.btn_start_discovery);\n mStopDiscoveryButton = findViewById(R.id.btn_stop_discovery);\n\n mLogTextView = findViewById(R.id.log);\n mScrollView = findViewById(R.id.scroll);\n\n mListView = (ListView) findViewById(R.id.listview);\n List<VirtualDeviceData> virtualDeviceDatas = new LinkedList<VirtualDeviceData>();\n mVirtualDeviceAdapter = new VirtualDeviceAdapter(this, virtualDeviceDatas);\n mListView.setAdapter(mVirtualDeviceAdapter);\n\n if (!mVirtualDeviceMap.isEmpty()) {\n mVirtualDeviceMap.clear();\n }\n }", "private void initListener() {\n un.setOnClickListener(this);\n deux.setOnClickListener(this);\n trois.setOnClickListener(this);\n quatre.setOnClickListener(this);\n cinq.setOnClickListener(this);\n six.setOnClickListener(this);\n sept.setOnClickListener(this);\n huit.setOnClickListener(this);\n neuf.setOnClickListener(this);\n zero.setOnClickListener(this);\n etoile.setOnClickListener(this);\n diaize.setOnClickListener(this);\n efface.setOnClickListener(this);\n setComposer.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n paletteComposition.setVisibility(View.VISIBLE);\n setComposer.setVisibility(View.GONE);\n }\n });\n call_btn.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n if (!tableView.getText().toString().trim().equals(\"\"))\n Utils.call(ComposerContact.this, tableView.getText().toString().trim());\n }\n });\n }", "@Override\n\tpublic void initializeView() {\n\t\tsuper.initializeView();\n\t\tet = (EditText)findViewById(R.id.edit_name);\n\t\tsave=(TextView)findViewById(R.id.save);\n\t\tsave.setOnClickListener(this);\n\t}" ]
[ "0.8122137", "0.8094609", "0.7743935", "0.766224", "0.76592815", "0.76239616", "0.76239616", "0.7587915", "0.7579989", "0.7515585", "0.751415", "0.7512075", "0.7512075", "0.7509346", "0.75064003", "0.74623364", "0.74623364", "0.7399842", "0.73957646", "0.73957646", "0.7346904", "0.73339474", "0.7288159", "0.7244947", "0.7212024", "0.71378297", "0.7122849", "0.711326", "0.70526093", "0.7045906", "0.7045906", "0.70322967", "0.7016897", "0.69739974", "0.6969195", "0.69595224", "0.6952576", "0.6944781", "0.6938483", "0.69204485", "0.6912347", "0.68828595", "0.6868876", "0.6863021", "0.68495554", "0.68320936", "0.68286204", "0.6804605", "0.680215", "0.6791495", "0.67896694", "0.678809", "0.677355", "0.6768856", "0.6768744", "0.67668957", "0.67604333", "0.6757559", "0.67544353", "0.67517275", "0.67395574", "0.6738925", "0.67326576", "0.6730789", "0.672894", "0.67255074", "0.6716772", "0.67157483", "0.6712795", "0.67076844", "0.6706335", "0.6705441", "0.6701963", "0.66937906", "0.6685213", "0.66845745", "0.66705215", "0.666766", "0.6667443", "0.6665949", "0.6662631", "0.665784", "0.6652945", "0.66526157", "0.66505146", "0.66495353", "0.6643007", "0.6642922", "0.6638599", "0.663136", "0.66299105", "0.6619793", "0.6609376", "0.6604899", "0.6586641", "0.65829015", "0.6582497", "0.65746117", "0.6565794", "0.6564692", "0.6560273" ]
0.0
-1
Initialize the Activity data
@Override protected void initData() { this.classes = new ArrayList<>(); this.classes.add(SmartRouterSampleActivity.class); this.classes.add(CustomRouterActivity.class); this.classes.add(RouterCenterActivity.class); this.adapter = new MenuRecyclerViewAdapter(); this.adapter.setList(classes); this.recyclerView.setAdapter(adapter); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initData() {\n\t\tIntent intent = getIntent();\n\t\tjob = (Job) intent.getSerializableExtra(\"job\");\n\t\tedt_content.setText(job.getJobContent());\n\t\tedt_course.setText(job.getCourseName());\n\t}", "@Override\n\tprotected void initData() {\n\t\tisSearch = (boolean) getIntent().getExtras().getBoolean(Constant.IntentKey.isSearch,false);\n\t\t\n\t\tif (isSearch) {//非来自直播列表\n\t\t\tarticleID = getIntent().getExtras().getLong(Constant.IntentKey.articleID);\n//\t\t\tprogressActivity.showLoading();\n\t\t\t\n\t\t\t// 查询发现详情\n\t\t\tobtainDetailRequest();\n\t\t} else {\n\t\t\tsquareLiveModel = (SquareLiveModel) getIntent().getExtras().getSerializable(Constant.IntentKey.squareLiveModel);\n\t\t\t\n\t\t\tinitLoadView();\n\t\t}\n\t\t\n\t\t//启动定时器\n//\t\tinitTimerTask();\n\t}", "@Override\n public void onCreate() {\n initData();\n }", "@Override\n public void onActivityCreated(@Nullable Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n initData(savedInstanceState);\n }", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\tinitData(savedInstanceState);\r\n\t}", "@Override\n\tprotected void initVariable() {\n\t\tapp = (MApplication) this.getApplication();\n\t\tapp.addAllActivity(this);\n\t\tfundcode = this.getIntent().getStringExtra(\"fundcode\");\n\t\tlist = new ArrayList<MoneyChangeBean>();\n\t\tadapter = new RecordDetailsAdapter(getApplicationContext(), list);\n\t\tuserShare = UserSharedData.getInstance(getApplicationContext());\n\t}", "private void initData() {\n\t\tcommentAdapter = new AvCommentAdapter(AvCommentActivity.this);\n\t\tcommentListView.setAdapter(commentAdapter);\n\t\taid = getIntent().getIntExtra(\"comment_aid\", 0);\n\t}", "@Override\n public void onCreate() {\n super.onCreate();\n initData();\n }", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tLogUtil.d(TAG, \"onActivityCreated---------\");\n\t\tinitData(savedInstanceState);\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "private void initData() {\n }", "public void initCampaignData() {\n tozAdCampaignAccount = \"init\";\n tozAdCampaignID = \"init\";\n baseViewIndex = 0;\n finalViewIndex = 0;\n repeatCycle = 0;\n }", "private void initData() {\n\n }", "public void InitData() {\n this.mItemTitleIds = new int[]{R.string.can_rvs_camera, R.string.can_ccaqyxfz};\n this.mItemTypes = new CanScrollCarInfoView.Item[]{CanScrollCarInfoView.Item.POP, CanScrollCarInfoView.Item.SWITCH};\n this.mPopValueIds[0] = new int[]{R.string.can_hjyxfzxt, R.string.can_dccsyxfzxt};\n this.mCarData = new CanDataInfo.LuxgenOd_SetData();\n }", "public void initActivities() {\n a = (Receive) flow.getNode(\"A\");\n b = (Receive) flow.getNode(\"B\");\n c = (Receive) flow.getNode(\"C\");\n x = (Receive) flow.getNode(\"X\");\n y = (Receive) flow.getNode(\"Y\");\n }", "public void initData() {\n }", "public void initData() {\n }", "@Override\r\n\tpublic void initData() {\n\t\tThreadUtils.getSinglePool().execute(new Runnable() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep(2000);\r\n\t\t\t\t\tIntent intent =null;\r\n\t\t\t\t\tChainApplication application = (ChainApplication) getApplicationContext();\r\n\t\t\t\t\tUser user = application.getUserInfo();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(StringUtils.isEmpty(user.getUser_Name()) && StringUtils.isEmpty(HttpManager.getInstance().getToken(HttpManager.KEY_TOKEN))){\r\n\t\t\t\t\t\tintent = new Intent(getActivity(),LoginActivity.class);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tintent = new Intent(getActivity(), MainActivity.class);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstartActivity(intent);\r\n\t\t\t\t\tfinish();\r\n\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}", "private void initData() {\n\t}", "private void initData(){\n\n }", "@Override\n\tpublic void initContext(Activity act) {\n\t\tthis._activity = act;\n\t}", "public void init(Activity activity) {\n setActivity(activity);\n initCispaConnection();\n }", "private void init() {\r\n\r\n analyticsManager = new xxxxAnalytics(getApplicationContext());\r\n\r\n analyticsSender = new AnalyticsSender(this);\r\n\r\n provider = FeedProviderImpl.getInstance(this);\r\n\r\n feedId = getIntent().getExtras().getInt(Constants.FEED_ID);\r\n if (provider != null) {\r\n friendFeed = provider.getFeed(feedId);\r\n }\r\n\r\n unifiedSocialWindowView = findViewById(R.id.linearLayoutForUnifiedSocialWindow);\r\n\r\n\r\n // Get member contacts.\r\n memberContacts = provider.getContacts(feedId);\r\n\r\n lastDiffs = new LinkedBlockingDeque<Integer>();\r\n }", "public void initData(){\n\n String birdname,birdscientificname,birdfamily,birdecosystem;\n Bundle extras = getActivity().getIntent().getExtras();\n if(extras == null) {\n birdname=null;\n birdscientificname=null;\n birdfamily=null;\n birdecosystem=null;\n } else {\n birdname=extras.getString(\"birdname\");\n birdscientificname=extras.getString(\"birdscientificname\");\n birdfamily=extras.getString(\"birdfamily\");\n birdecosystem=extras.getString(\"birdecosystem\");\n }\n\n presenter.initData(birdname,birdscientificname,birdfamily,birdecosystem,imageView1,imageView2,imageView3);\n }", "public void InitData() {\n this.mItemTypes = new CanScrollCarInfoView.Item[]{CanScrollCarInfoView.Item.VALUE, CanScrollCarInfoView.Item.VALUE, CanScrollCarInfoView.Item.VALUE, CanScrollCarInfoView.Item.VALUE, CanScrollCarInfoView.Item.VALUE, CanScrollCarInfoView.Item.VALUE, CanScrollCarInfoView.Item.VALUE, CanScrollCarInfoView.Item.VALUE, CanScrollCarInfoView.Item.VALUE, CanScrollCarInfoView.Item.VALUE, CanScrollCarInfoView.Item.VALUE, CanScrollCarInfoView.Item.VALUE, CanScrollCarInfoView.Item.VALUE};\n this.mItemTitleIds = new int[]{R.string.can_dlxdcgz, R.string.can_gybjd, R.string.can_dczjysxgz, R.string.can_zcbjd, R.string.can_djgzzsd, R.string.can_djxtgr, R.string.can_igbt_wdzt, R.string.can_zkbgz, R.string.can_zbzt, R.string.can_cdszzt, R.string.can_dcdc, R.string.can_dlxdcqd, R.string.can_fzdcdl};\n this.mWarn = new CanDataInfo.DT_V80_BMS_WARN();\n }", "private void initThings() {\n\t\tmyApp = (MyApp) getApplicationContext();\n\t\tnextIntent = new Intent(this, AnimActivity2.class);\n\t\t// nextIntent = new Intent(this, SelectEventActivity.class);\n\t\tnextIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK\n\t\t\t\t| Intent.FLAG_ACTIVITY_CLEAR_TASK);\n\t\tuserDAO = new UserDAO(this);\n\t\tdialog = new CreateDialog(this);\n\t\tprogressDialog = dialog.createProgressDialog(null, \"Logging In\", false,\n\t\t\t\tnull, false);\n\t\ttypeface = myApp.getTypefaceRegular();\n\n\t\t// <<<<<<< HEAD\n\t\t//\n\t\t// GsonBuilder builder = new GsonBuilder();\n\t\t// gson = builder.create();\n\t\t//\n\t\t// queue = Volley.newRequestQueue(this);\n\t\t// =======\n\t\t// >>>>>>> parent of 48afbfc... setup android again\n\t}", "private void InitData() {\n\t}", "private void initializeData() {\n posts = new ArrayList<>();\n posts.add(new Posts(\"Emma Wilson\", \"23 years old\", R.drawable.logo));\n posts.add(new Posts(\"Lavery Maiss\", \"25 years old\", R.drawable.star));\n posts.add(new Posts(\"Lillie Watts\", \"35 years old\", R.drawable.profile));\n }", "@Override\n\tpublic void initData(Bundle savedInstanceState) {\n\t\t\n\t}", "public void InitData() {\n this.mItemTitleIds = new int[]{R.string.can_volvo_cysjysz, R.string.can_volvo_zdsm, R.string.can_door_unlock, R.string.can_volvo_zdhsj, R.string.can_volvo_qxzchsj, R.string.can_volvo_qxychsj, R.string.can_volvo_fxplsz, R.string.can_volvo_dstc, R.string.can_volvo_csaq, R.string.can_volvo_hfqcsz};\n this.mItemTypes = new CanScrollCarInfoView.Item[]{CanScrollCarInfoView.Item.SWITCH, CanScrollCarInfoView.Item.SWITCH, CanScrollCarInfoView.Item.POP, CanScrollCarInfoView.Item.SWITCH, CanScrollCarInfoView.Item.SWITCH, CanScrollCarInfoView.Item.SWITCH, CanScrollCarInfoView.Item.POP, CanScrollCarInfoView.Item.SWITCH, CanScrollCarInfoView.Item.SWITCH, CanScrollCarInfoView.Item.TITLE};\n this.mPopValueIds[2] = new int[]{R.string.can_door_unlock_key2, R.string.can_door_unlock_key1};\n this.mPopValueIds[6] = new int[]{R.string.can_ac_low, R.string.can_ac_mid, R.string.can_ac_high};\n this.mSetData = new CanDataInfo.VolvoXc60_CarSet();\n }", "private void init() {\n sensorEnabled = false;\n activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);\n contextEventHistory = new ArrayList<ContextEvent>(CONTEXT_EVENT_HISTORY_SIZE);\n }", "@Override\n\tpublic void onActivityCreated(@Nullable Bundle savedInstanceState) {\n\t\tinitView();\n\t\tinitListener();\n\t\tinitData();\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "private void initData() {\n\t\tIntent intent = getIntent();\r\n\t\t\r\n\t\tstoid = intent.getStringExtra(\"stoid\");\r\n\t\t\r\n\t\tRequestParams params = new RequestParams();\r\n\t\tparams.addBodyParameter(\"stoid\", stoid);\r\n\t\t\r\n\t\tMyApplication.httpUtils.send(HttpMethod.POST, HttpUrl.STORESINFO, params, new RequestCallBack<String>() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onFailure(HttpException arg0, String arg1) {\r\n\t\t\t\t//Toast.makeText(SnaDetailsActivity.this, \"StoryContentInfo数据加载失败\", Toast.LENGTH_SHORT).show();\r\n\t\t\t}\r\n\r\n\t\t\tpublic void onSuccess(ResponseInfo<String> arg0) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\r\n\t\t\t\t//storycontentinfo = MyApplication.gson.fromJson(json, StoryContentInfo.class);\r\n\t\t\t\ttry {\r\n\t\t\t\t\tString json = arg0.result;\r\n\t\t\t\t\tLog.i(\"json=\", \"dealjson=\"+json);\r\n\t\t\t\t\tJSONObject jsonObject = new JSONObject(arg0.result);\r\n\t\t\t\t\tsto_name = jsonObject.getJSONObject(\"stoinfo\").getString(\"sto_name\");\r\n\t\t\t\t\tsto_addr = jsonObject.getJSONObject(\"stoinfo\").getString(\"sto_addr\");\r\n\t\t\t\t\tproject = jsonObject.getJSONObject(\"stoinfo\").getString(\"sto_content\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tstoyrName.setText(sto_name);\r\n\t\t\t\t\tstory_addr.setText(sto_addr);\r\n\t\t\t\t} catch (JSONException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t}", "@Override\n\tpublic void initData() {\n\n\n\n\t}", "public InitialData(){}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private void init() {\n //getting the item info from the previous activity.\n Intent intent = getIntent();\n Theatre theatreItem = intent.getParcelableExtra(\"Chosen_Theatre\");\n\n if(theatreItem == null){\n throw new Error(\"no chosen theatre\");\n }else {\n AccessTheatreMovies accessMovies = new AccessTheatreMovies();\n movieLists = accessMovies.getMoviesFromTheatre(theatreItem.getName());\n if(movieLists == null){\n throw new Error(\"no available movies for chosen theatre: \" + theatreItem.getName());\n\n }else{\n buildRecyclerView();\n\n }\n }\n\n }", "private void initializeActivity() {\n initializeActionbar();\n initializeActionDrawerToggle();\n setUpNavigationDrawer();\n setStartFragment();\n setFloatingButtonListener();\n setUpShareAppListener();\n hideWindowSoftKeyboard();\n }", "private void initData() {\n getCourse();\n// getMessage();\n\n }", "@Override\n protected void initData() {\n }", "@Override\n protected void initData() {\n }", "@Override\n\tprotected void setupData() {\n\t\tisFirst = getIntent().getExtras().getBoolean(\"IS_FIRST\");\n\t\tcid = getIntent().getExtras().getString(FirstCategoryAct.class.getName());\n\t\tString title;\n\t\tif(isFirst){\n\t\t\ttitle = getIntent().getExtras().getString(\"TITLE_BAR\") + getResources().getString(R.string.tv_article_all);\n\t\t}else{\n\t\t\ttitle = getResources().getString(R.string.tv_article_all2);\n\t\t}\n\t\t\n\t\tsetGCenter(true, title);\n\t\tsetGLeft(true, R.drawable.back_selector);\n\n\t\tgetData(NET_ARTICLE, false);\n\t}", "private void initData() {\n Resources resources = context.getResources();\n settingTitles = resources.getStringArray(R.array.setting_array);\n selectAccent = resources.getStringArray(R.array.accent_array);\n selectAccentDisplay = resources.getStringArray(R.array.accent_display_array);\n selectSpeaker = resources.getStringArray(R.array.speaker_array);\n selectSpeakerDisplay = resources.getStringArray(R.array.speaker_display_array);\n\n positive = resources.getString(R.string.positive);\n negative = resources.getString(R.string.negative);\n answerUnKnown = resources.getString(R.string.unknown);\n answerCalling = resources.getString(R.string.calling);\n answerOpen = resources.getString(R.string.opening);\n answerFound = resources.getString(R.string.founded);\n answerNotFound = resources.getString(R.string.not_found);\n\n String systemLanguage = Util.getSystemLanguage(context).toLowerCase();\n if (systemLanguage.equalsIgnoreCase(\"zh_cn\")) {\n isEnglishEnvironment = false;\n }\n }", "private void initializeData() {\n String[] sportsList = getResources().getStringArray(R.array.track_title);\n String[] sportsInfo = getResources().getStringArray(R.array.track_category);\n\n // Clear the existing data (to avoid duplication).\n mSportsData.clear();\n\n TypedArray trackImageResources =\n getResources().obtainTypedArray(R.array.track_image);\n\n // Create the ArrayList of Sports objects with titles and\n // information about each sport.\n for (int i = 0; i < sportsList.length; i++) {\n for (int j = 0; j < workout.size(); j++) {\n if (workout.get(j).equals(sportsList[i])) {\n mSportsData.add(new Track(sportsList[i], sportsInfo[i], trackImageResources.getResourceId(i, 0)));\n }\n }\n }\n\n // Notify the adapter of the change.\n mAdapter.notifyDataSetChanged();\n\n trackImageResources.recycle();\n }", "public void initData() {\n ConnectivityManager connMgr = (ConnectivityManager)\n getActivity().getSystemService(Context.CONNECTIVITY_SERVICE);\n\n // Get details on the currently active default data network\n NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();\n\n // If there is a network connection, fetch data\n if (networkInfo != null && networkInfo.isConnected()) {\n // Get a reference to the LoaderManager, in order to interact with loaders.\n LoaderManager loaderManager = getLoaderManager();\n\n // number the loaderManager with mPage as may be requesting up to three lots of JSON for each tab\n loaderManager.initLoader(FETCH_STOCK_PICKING_LOADER_ID, null, loadStockPickingFromServerListener);\n } else {\n // Otherwise, display error\n // First, hide loading indicator so error message will be visible\n View loadingIndicator = getView().findViewById(R.id.loading_spinner);\n loadingIndicator.setVisibility(View.GONE);\n\n // Update empty state with no connection error message\n mEmptyStateTextView.setText(R.string.error_no_internet_connection);\n }\n }", "@Override\r\n\tpublic void initData(Bundle savedInstanceState) {\n\r\n\t}", "private void initData() {\n requestServerToGetInformation();\n }", "public void InitData() {\n this.mItemTitleIds = new int[]{R.string.can_vehi_status, R.string.can_csxx, R.string.can_car_drive_info, R.string.can_tyres_tpms, R.string.can_car_set, R.string.can_battery_infos, R.string.can_dtxx, R.string.can_dczxx, R.string.can_bmsgzxx, R.string.can_can_iap};\n this.mItemTypes = new CanScrollCarInfoView.Item[]{CanScrollCarInfoView.Item.TEXT, CanScrollCarInfoView.Item.ICON, CanScrollCarInfoView.Item.ICON, CanScrollCarInfoView.Item.ICON, CanScrollCarInfoView.Item.ICON, CanScrollCarInfoView.Item.TEXT, CanScrollCarInfoView.Item.ICON, CanScrollCarInfoView.Item.ICON, CanScrollCarInfoView.Item.ICON, CanScrollCarInfoView.Item.ICON};\n this.mItemIcons = new int[]{255, R.drawable.can_icon_light, R.drawable.can_icon_tpms, R.drawable.can_golf_icon14, R.drawable.can_icon_setup, 255, R.drawable.can_icon_units, R.drawable.can_icon_hybrid, R.drawable.can_icon_tpms_set, R.drawable.can_icon_factory};\n if (CanJni.GetSubType() != 2) {\n this.mItemVisibles[4] = 0;\n }\n }", "@Override\n public void onCreate (Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_data_sync_step_1);\n\n\n //등장애니..\n overridePendingTransition(R.anim.push_left_in_fast, R.anim.push_left_out_half);\n\n MAC = getIntent().getStringExtra(EXTRA_KEY_MACADDRESS);\n DATA = new BeaconItemDto ();\n DATA.sticker = JobProcessController.getInstance(mActivity, this).getStickerForService(MAC);\n DATA.MAC = MAC;\n DATA.min_temperature_limit = 0;\n DATA.max_temperature_limit = 0;\n\n mLogger = new LoggerData();\n mLoggerNew = new LoggerDataNew();\n\n initBluetoothAdapter ();\n setLayout ();\n initData ();\n }", "private void initializeStateFromLaunchData() {\n if (getIntent() != null) {\n mLaunchedFromChromeIcon =\n getIntent().getBooleanExtra(EXTRA_COMING_FROM_CHROME_ICON, false);\n mLaunchedFromCCT =\n getIntent().getBooleanExtra(EXTRA_CHROME_LAUNCH_INTENT_IS_CCT, false);\n mIntentCreationElapsedRealtimeMs =\n getIntent().getLongExtra(EXTRA_FRE_INTENT_CREATION_ELAPSED_REALTIME_MS, 0);\n }\n }", "void initData(){\n }", "public void InitData() {\n }", "public Activity() {\n title = \"\";\n comment = \"\";\n startTime = (new GregorianCalendar()).getTime();\n endTime = (new GregorianCalendar()).getTime();\n }", "@Override\n\tprotected void initData() {\n\t\trequestUserInfo();\n\t}", "public static void initManagers(Activity activity) {\n mActivity = activity;\n mContext = activity;\n initLog();\n\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n initData();\n // L.e(TAG, \"msg: onCreate\" + city);\n }", "@Override\n\tpublic void initData() {\n\n\t}", "@Override\n\tpublic void initData() {\n\n\t}", "@Override\n\tpublic void initData() {\n\n\t}", "public void initData(){\r\n \r\n }", "public void startInitialize() {\n\n mTextView_ScreenTitle = findViewById(R.id.textview_Title);\n mButton_Back = findViewById(R.id.button_Back);\n mButton_Contact = findViewById(R.id.button_Contact);\n mHelper = new H3GHelper();\n mVolunteerData = new VolunteerModel();\n\n mEditText_FirstName = findViewById(R.id.edittext_FirstName);\n mEditText_LastName = findViewById(R.id.edittext_LastName);\n mEditText_Phone = findViewById(R.id.edittext_Phone);\n mEditText_Gender = findViewById(R.id.edittext_Gender);\n mEditText_DateOfBirth = findViewById(R.id.edittext_DOB);\n mLayout_DateOfBirth = findViewById(R.id.layout_DateOfBirth);\n mEditText_Address = findViewById(R.id.edittext_Address);\n mEditText_City = findViewById(R.id.edittext_City);\n mEditText_State = findViewById(R.id.edittext_State);\n\n mEditText_EmailId = findViewById(R.id.edittext_Email);\n mEditText_PANNumber = findViewById(R.id.edittext_PanNumber);\n mEditText_ApplicantName = findViewById(R.id.edittext_ApplicantName);\n mEditText_BankName = findViewById(R.id.edittext_BankName);\n mEditText_AccountNumber = findViewById(R.id.edittext_AccountNumber);\n\n mEditText_IFSCCode = findViewById(R.id.edittext_IFSCCode);\n mImageView_UserPhoto = findViewById(R.id.imageView_UserPhoto);\n\n }", "private void initDatas() {\n setSupportActionBar(toolbar);\n getSupportActionBar().setHomeButtonEnabled(true); //设置返回键可用\n getSupportActionBar().setDisplayHomeAsUpEnabled(true);\n whichActivity = getIntent().getStringExtra(\"activity\");\n if(whichActivity.equals(\"new_announce_activity\")){\n toolbar.setTitle(\"农田位置\");\n }else{\n toolbar.setTitle(\"农机位置\");\n }\n WebSettings webSettings = webView.getSettings();\n //设置WebView属性,能够执行Javascript脚本\n webSettings.setJavaScriptEnabled(true);\n //设置可以访问文件\n webSettings.setAllowFileAccess(true);\n //设置支持缩放\n webSettings.setBuiltInZoomControls(true);\n //加载需要显示的网页\n webView.loadUrl(\"file:///android_asset/map_choose_point.html\");\n //设置Web视图\n webView.setWebChromeClient(new MyWebChromeClient());\n }", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\t\tSharedPreferences sharedPref=PreferenceManager.getDefaultSharedPreferences(this);\n\t\ttoken=sharedPref.getString(\"token\", null);\t\n\t\tmAdapter=new MessageListViewAdapter(this);\n\t\tdatas=new ArrayList<String>();\n\t\tfor(int i=0;i<5;i++)\n\t\t\tdatas.add(\"消息标题 \"+i);\n\t\tmAdapter.setDatas(datas);\n\t\tlvMsg.setAdapter(mAdapter);\n\t}", "private void initObjects() {\n listUsers = new ArrayList<>();\n usersRecyclerAdapter = new UsersRecyclerAdapter(listUsers,UsersListActivity.this);\n RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());\n recyclerViewUsers.setLayoutManager(mLayoutManager);\n recyclerViewUsers.setItemAnimator(new DefaultItemAnimator());\n recyclerViewUsers.setHasFixedSize(true);\n recyclerViewUsers.setAdapter(usersRecyclerAdapter);\n\n databaseHelper = new HomeDatabaseHelper(activity);\n Intent extras = getIntent();\n emailFromIntent = extras.getStringExtra(\"EMAIL\");\n textViewRole = this.findViewById(R.id.textViewName);\n textViewRole.setText(emailFromIntent);\n getDataFromSQLite();\n }", "protected @Override\r\n abstract void initData();", "private void initializeAuthorizationData() {\n\t\tOAuthDesktopMobileAuthCodeGrant oAuthDesktopMobileAuthCodeGrant = new OAuthDesktopMobileAuthCodeGrant(adsProperties.getProperty(\"api.bing.clientId\", ClientId));\r\n\t\toAuthDesktopMobileAuthCodeGrant.requestAccessAndRefreshTokens(adsProperties.getProperty(\"api.bing.refreshToken\"));\r\n\t\tauthorizationData = new AuthorizationData();\r\n\t\tauthorizationData.setDeveloperToken(adsProperties.getProperty(\"api.bing.developerToken\", DeveloperToken));\r\n\t\tauthorizationData.setAuthentication(oAuthDesktopMobileAuthCodeGrant);\r\n\t\tString customerId = adsProperties.getProperty(\"api.bing.customerId\", CustomerId);\r\n\t\tauthorizationData.setCustomerId(Long.parseLong(customerId));\r\n\t\tString accountId = adsProperties.getProperty(\"api.bing.accountId\", AccountId);\r\n\t\tauthorizationData.setAccountId(Long.parseLong(accountId));\r\n\t}", "@Override\r\n\tpublic void initData() {\n\t}", "@Override \n protected void onNewIntent(Intent intent) {\n super.onNewIntent(intent); \n \n initData();\n }", "@SuppressWarnings(\"static-access\")\n\tprivate void initData() {\n\t\tstartDate = startDate.now();\n\t\tendDate = endDate.now();\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n if (savedInstanceState != null) {\n msgType = savedInstanceState.getString(\"msgType\");\n timeFlag = savedInstanceState.getString(\"time\");\n fromme = savedInstanceState.getBoolean(\"fromme\");\n title = savedInstanceState.getString(\"title\");\n } else {\n initPassData();\n }\n initViews();\n initDeatilsData();\n initListener();\n }", "@Override\n\tprotected void initData(){\n\t\tsuper.initData();\n\t}", "private void initObjects() {\n String emailFromIntent = getIntent().getStringExtra(\"NAMA\");\n textViewName.setText(emailFromIntent);\n }", "public void initialize() {\n\tMain.getPartida().recuperarData();\n\taction();\n\t\n\t}", "@Override\n\tpublic void initData() {\n\n\t\tsuper.initData();\n\t\tinitLsitData();\n\n\t\tviewpager.setAdapter(new MyPagerAdapter());\n\t\tindicator.setViewPager(viewpager);\n\n\t}", "public void initialize() {\n\n fechaDeLaVisita.set(LocalDate.now());\n\n if (medico.get() != null) {\n medico.get().clear();\n } else {\n medico.set(new Medico());\n }\n\n turnoVisita.set(\"\");\n visitaAcompanadaSN.set(false);\n lugarVisita.set(\"\");\n if (causa.get() != null) {\n causa.get().clear();\n } else {\n causa.set(new Causa());\n }\n\n if (promocion.get() != null) {\n promocion.get().clear();\n } else {\n promocion.set(new Promocion());\n }\n\n observacion.set(\"\");\n persistida.set(false);\n persistidoGraf.set(MaterialDesignIcon.SYNC_PROBLEM.graphic());\n\n fechaCreacion.set(LocalDateTime.now());\n\n }", "public void initData() {\n\t\tnotes = new ArrayList<>();\n\t\t//place to read notes e.g from file\n\t}", "@Override\n\tpublic void initData() {\n\t\t\n\t}", "private void initData() {\n\t\tpages = new ArrayList<WallpaperPage>();\n\n\t}", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tinitView();\r\n\t\tgetListDataFromLocal();\r\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "private void init() {\n listView = (ListView) findViewById(R.id.listView);\n listView.setOnItemClickListener(this);\n activityListAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, 0);\n listView.setAdapter(activityListAdapter);\n }", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tsetContentView(R.layout.activity_job_details);\r\n\t\tinit();\r\n\t\tgetData();\r\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void initData() {\n\t\tsuper.initData();\n\t\tgetSynCourseTask(courseType, pageIndex);\n\t}", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tinitView();\n\t\tinitData();\n\t\tinitEvent();\n\t}", "private void initData() {\n\t\tSetTopBarTitle(getString(R.string.os_jsh_wdj_add_ldss));\r\n\t\tregFliter();\r\n\t}", "public LigTvAsyncTask(Activity activity) {\n this.activity = activity;\n context = activity;\n }", "private void init(){\n\n //Load component in the good variables\n spin_day = (Spinner)findViewById(R.id.spinner_day_hospa);\n spin_start = (Spinner)findViewById(R.id.spinner_start_hospa);\n spin_end = (Spinner)findViewById(R.id.spinner_end_hospa);\n spin_service = (Spinner)findViewById(R.id.spinner_service_hospa);\n\n btn_Appointment = (Button)findViewById(R.id.btn_app_hospa);\n\n lv_availability = (ListView)findViewById(R.id.lv_availability_hospa);\n lv_Appointment = (ListView)findViewById(R.id.lv_Appointment_hospa);\n\n tv_main = (TextView)findViewById(R.id.tv_main_hospa);\n\n tv_main.setText(\"Create Appointment with\\n\" + this.companyName);\n\n //Load the days\n loadDays();\n loadHours();\n loadSpinnerDays();\n loadSpinnerHours();\n callEventListener();\n loadListView();\n loadAppointmentList();\n loadSpinnerFromDB();\n }", "public Activity() {\n }", "public MyAdapter(List<Track> myDataset, Activity activity) {\n values = myDataset;\n this.activity = activity;\n }", "public void init() {\n if (mRealm.isClosed()) {\n mRealm = Realm.getDefaultInstance();\n }\n RealmResults<TranslationInfo> translationInfos;\n\n if (isOnlyFavorite) {\n translationInfos = mRealm.where(TranslationInfo.class)\n .equalTo(\"isFavourite\", isOnlyFavorite)\n .findAll();\n } else {\n translationInfos = mRealm.where(TranslationInfo.class)\n .findAll();\n }\n mRvHistoryAdapter.updateData(translationInfos);\n\n }", "@Override\n\tprotected void onCreate(Bundle arg0) {\n\t\tsuper.onCreate(arg0);\n\t\tthis.setContentView(R.layout.realtimedataactivity);\n\t\tinitview();\n\t\tloadData();\n\t}", "private void initData() {\n mListWifi = new ArrayList<Map<String, Object>>();\n mWifiAdmin = new WifiAdmin(mContext);\n\t\tmWifiAdmin.openWifi();\n\t\t\n mboolWifiTest = false;\n \n // Used to save the current state of mobile test item\n SharedPreferences sp = mContext.getSharedPreferences(\n SHAREPREFERCES_NAME, Context.MODE_PRIVATE);\n Editor editor = sp.edit();\n editor.putBoolean(\"wifistate\", mWifiAdmin.mWifiManager.isWifiEnabled());\n editor.commit();\n }" ]
[ "0.736409", "0.71585214", "0.7155287", "0.7144059", "0.71399045", "0.7095835", "0.7072963", "0.7068005", "0.70294726", "0.68826747", "0.6868106", "0.68151057", "0.67813116", "0.67808056", "0.67519146", "0.67519146", "0.6745095", "0.6720896", "0.6683679", "0.6653883", "0.6644446", "0.66155636", "0.65620077", "0.65551627", "0.6552284", "0.65015304", "0.6486496", "0.64533573", "0.64445704", "0.64361846", "0.6431309", "0.6414785", "0.6405026", "0.6402128", "0.6398776", "0.6398776", "0.6398776", "0.6398776", "0.6398776", "0.6398776", "0.6393557", "0.6389062", "0.63835776", "0.6376712", "0.6376712", "0.6363019", "0.6360203", "0.63575643", "0.6334845", "0.63323915", "0.63294506", "0.63260055", "0.63233083", "0.6320367", "0.6319582", "0.63165236", "0.62931985", "0.6276014", "0.62671727", "0.62670857", "0.6266012", "0.6266012", "0.6266012", "0.6255694", "0.625449", "0.6253809", "0.624423", "0.624423", "0.62419176", "0.62385905", "0.6221525", "0.62211806", "0.6216478", "0.62157816", "0.62078", "0.6190316", "0.6185163", "0.6176315", "0.61755997", "0.61721706", "0.6168552", "0.6163873", "0.6159506", "0.6151786", "0.615145", "0.6144932", "0.61370426", "0.6129168", "0.611857", "0.6108511", "0.61081254", "0.60952705", "0.60942197", "0.60699785", "0.606909", "0.60647523", "0.6059301", "0.6057684", "0.60567206", "0.6053005" ]
0.6862317
11
Add your action code here.
public void act() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void action() {\n\t\t\r\n\t}", "public void act() \r\n {\r\n // Add your action code here.\r\n }", "public void act() \r\n {\r\n // Add your action code here.\r\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "@Override\n public void action() {\n }", "@Override\n public void action() {\n }", "@Override\n public void action() {\n }", "@Override\n\tpublic void action() {\n\n\t}", "public void performAction() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}", "private void act() {\n\t\tmyAction.embodiment();\n\t}", "@Override\n\tpublic void action() {\n\t\tSystem.out.println(\"action now!\");\n\t}", "public void setAction(String action) { this.action = action; }", "public void action() {\n }", "@Override\n\tpublic void onActionStart(int action) {\n\t\t\n\t}", "@Override\n\tpublic String getAction() {\n\t\treturn action;\n\t}", "public void initiateAction() {\r\n\t\t// TODO Auto-generated method stub\t\r\n\t}", "@Override\n \tpublic void addActions() {\n \t\t\n \t}", "public void action() {\n action.action();\n }", "public void setAction (String action) {\n this.action = action;\n }", "@Override\r\n\tpublic void visit(SimpleAction action)\r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void setAction() {\n\t}", "@Override\n\tpublic void newAction() {\n\t\t\n\t}", "@Override\r\n\tpublic void execute(ActionContext ctx) {\n\t\t\r\n\t}", "public void act() \r\n {\r\n \r\n // Add your action code here\r\n MovimientoNave();\r\n DisparaBala();\r\n Colisiones();\r\n //muestraPunto();\r\n //archivoTxt();\r\n }", "public void setAction(String action) {\n this.action = action;\n }", "public void setAction(String action) {\n this.action = action;\n }", "@Override\n public String getAction() {\n return null;\n }", "public void includeAction(){\n actions.showActions();\n }", "public abstract Action getAction();", "public void act() \r\n {\r\n // Add your action code here.\r\n tembak();\r\n gerakKiri();\r\n gerakKanan();\r\n \r\n \r\n \r\n }", "public void actionPerformed(ActionEvent e) {\n\t\t\t\taddAction();\n\t\t\t}", "public void setAction(String action) {\n\t\tthis.action = action;\n\t}", "@Override\r\n public void initAction() {\n \r\n }", "@Override\n\tpublic void createAction(Model m) {\n\t\t\n\t}", "public void act() \n {\n // Add your action code here.\n klawisze();\n stawiaj();\n pobierzJablka();\n }", "@Override\n\tpublic void showAction(int id) {\n\t\t\n\t}", "public void setAction(String action);", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\r\n\tpublic void initActions() {\n\t\t\r\n\t}", "@Override\n\tpublic void handleAction(Action action, Object sender, Object target) {\n\t\t\n\t}", "@Override\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent e) {\n\t\t\t\t\n\t\t\t}", "public void createAction() {\n }", "@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t// TODO Auto-generated method stub\r\n\r\n\t}", "private void entryAction() {\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t\t\t}", "@Override\n public void actionPerformed(ActionEvent actionEvent) {\n }", "public abstract void action();", "public abstract void action();", "public abstract void action();", "public abstract void action();", "protected void pushAction(iNamedObject node)\n\t{\n\t}", "@Override\r\n protected void doActionDelegate(int actionId)\r\n {\n \r\n }", "public void handleAction(Action action){\n\t\tSystem.out.println(action.getActionType().getName() + \" : \" + action.getValue());\n\t\tDroneClientMain.runCommand(\"python george_helper.py \" + action.getActionType().getName().toLowerCase() + \" \" + action.getValue());\n\t}", "public void toSelectingAction() {\n }", "@Override\n public void onActionPerformed(String actionName) {\n Log.d(TAG, \"Inside onActionPerformed.\" + actionName);\n\n switch (actionName) {\n case HanselHelper.ACTION_OPEN_PROFILE_ACTIVITY: {\n SmartechHelper.openDeeplink(this, ProfileActivity.class, null);\n }\n break;\n\n case HanselHelper.ACTION_OPEN_REGISTER_ACTIVITY: {\n SmartechHelper.openDeeplink(this, RegisterActivity.class, null);\n }\n break;\n\n default: {\n Log.e(TAG, \"Failed to perform the action.\");\n }\n break;\n }\n }", "@Override\r\n public void actionPerformed( ActionEvent e )\r\n {\n }", "public void actionPerformed( ActionEvent event )\n {\n \n }", "@Override\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\t\n\t\t\t}", "public void actionPerformed(ActionEvent e) {\n action.actionPerformed(e);\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}", "private void appendAction(int action) {\n \t\tContext context = Settlers.getInstance().getContext();\n \t\tappendAction(context.getString(action));\n \t}", "public void actionOffered();", "@Override\n\t\t\t\tpublic void handle(ActionEvent event) {\n\n\t\t\t\t}", "@Override\n\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\n\t\t}", "@Override\n\t\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\t}", "public String getAction() {\n return action;\n }", "public void action() {\n\t\t\n\t\tjugar.setOnAction(f->{\n\n\t\t\tMain.pantallaPersonaje();\n\t\t});\n\t\n\t\tpuntajes.setOnAction(f->{\n\t\t\tMain.pantallaPuntajes();\n\t\t});\n\t\n\t\n\t}", "@Override\r\n\t\tpublic void action()\r\n\t\t{\r\n// throw new UnsupportedOperationException(\"Not supported yet.\");\r\n\t\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\r\n\t\t\t}", "public void executeAction( String actionInfo );", "public void run(IAction action) {\n\t\tMessageDialog.openInformation(window.getShell(), \"AccTrace\",\n\t\t\t\t\"Hello, Eclipse world\");\n\t}", "@Override\r\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\r\n\t\t}", "public void actionPerformed(ActionEvent e) {\n \n // YOUR CODE HERE\n\n }", "@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}", "@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\tSystem.out.print(\"Action: \" + e.getActionCommand() + \"\\n\");\n\t\t\t\t}", "public void run(IAction action) {\n\t\tInstaSearchUI.getWorkbenchWindow().getActivePage().activate( InstaSearchUI.getActiveEditor() );\n\t\tNewSearchUI.openSearchDialog(InstaSearchUI.getWorkbenchWindow(), InstaSearchPage.ID);\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t}", "@Override\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t}", "public void act() \n {\n // Add your action code here.\n tempoUp();\n }", "public void setAction(Action action) {\n this.action = action;\n }" ]
[ "0.740863", "0.7375899", "0.7375899", "0.72850144", "0.72850144", "0.72850144", "0.72850144", "0.72850144", "0.72850144", "0.72850144", "0.72850144", "0.7282202", "0.7282202", "0.7282202", "0.7191179", "0.67611897", "0.6731473", "0.6724928", "0.669374", "0.6676553", "0.6623679", "0.658477", "0.6576499", "0.6560193", "0.65386146", "0.6515366", "0.65012395", "0.6487553", "0.6407427", "0.64015007", "0.63944703", "0.6389889", "0.6389889", "0.6365111", "0.63613826", "0.63460356", "0.6331277", "0.63222015", "0.63094294", "0.6306841", "0.6300606", "0.62613", "0.6248951", "0.6234642", "0.62136644", "0.62119794", "0.6191034", "0.6176691", "0.6157463", "0.61503434", "0.6147327", "0.6138187", "0.6133661", "0.6133661", "0.6132004", "0.6126716", "0.6126716", "0.6126716", "0.6126716", "0.61263317", "0.6121613", "0.61189663", "0.6108093", "0.6107777", "0.6103147", "0.60951686", "0.6095142", "0.6095142", "0.6081154", "0.60690993", "0.60690993", "0.60690993", "0.60690993", "0.60663366", "0.6060178", "0.6055352", "0.6042361", "0.6042361", "0.6042346", "0.6039606", "0.60286534", "0.6026154", "0.60214674", "0.6019301", "0.60178226", "0.6016698", "0.6010541", "0.60061", "0.60061", "0.60061", "0.60061", "0.60061", "0.60061", "0.59999335", "0.59912604", "0.59869885", "0.59869885", "0.59869885", "0.5985203", "0.5981722", "0.59722954" ]
0.0
-1
Randomize the plain array to make the key
public static String randomize(char[] list) { for (int j = 0; j < list.length; j++) { int index = (int) (Math.random() * list.length); char temp = list[j]; list[j] = list[index]; list[index] = temp; } String randomKey = ""; for (int x = 0; x < list.length; x++) { randomKey += (list[x]); } return randomKey; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void scrambleArray(Integer[] a, boolean randomize) {\n\t\tfor (int k = 0; k < a.length; k++)\n\t\t\ta[k] = k;\n\t\tif (randomize) {\n\t\t\tRandom gen = new Random();\n\t\t\tfor (int k = 0; k < a.length; k++) {\n\t\t\t\tswap(a, k, gen.nextInt(a.length));\n\t\t\t}\n\t\t} else {\n\t\t\tint cell = (int) (a.length * 3.14159) % a.length;\n\t\t\tfor (int k = 0; k < a.length; k++) {\n\t\t\t\tswap(a, k, cell);\n\t\t\t\tcell = (int) (cell * 3.14159) % a.length;\n\t\t\t}\n\t\t}\n\n\t}", "private static void scrambleArray(int[] a, boolean randomize) {\n\t\tfor (int k = 0; k < a.length; k++)\n\t\t\ta[k] = k;\n\t\tif (randomize) // use unpredictable random shuffle\n\t\t{\n\t\t\tRandom gen = new Random();\n\t\t\tfor (int k = 0; k < a.length; k++) {\n\t\t\t\tswap(a, k, gen.nextInt(a.length));\n\t\t\t}\n\t\t} else // use repeatable math formula for shuffle\n\t\t{\n\t\t\tint cell = (int) (a.length * 3.14159) % a.length;\n\t\t\tfor (int k = 0; k < a.length; k++) {\n\t\t\t\tswap(a, k, cell);\n\t\t\t\tcell = (int) (cell * 3.14159) % a.length;\n\t\t\t}\n\t\t}\n\n\t}", "public static void knuthShuffle(Comparable[] a) {\n int r, n = a.length;\n for (int i = 1; i < n; i++) {\n r = randInt(0, i);\n exch(a, i, r);\n }\n }", "private int[] shuffle() {\n int len = data_random.length;\n Random rand = new Random();\n for (int i = 0; i < len; i++) {\n int r = rand.nextInt(len);\n int temp = data_random[i];\n data_random[i] = data_random[r];\n data_random[r]=temp;\n }\n return data_random;\n }", "private static void shuffleArray(final int[] a) {\n for (int i = 1; i < a.length; i++) {\n int j = random.nextInt(i);\n int temp = a[i];\n a[i] = a[j];\n a[j] = temp;\n }\n }", "static void shuffleArray(String[] ar)\r\n {\n Random rnd = ThreadLocalRandom.current();\r\n for (int i = ar.length - 1; i > 0; i--)\r\n {\r\n int index = rnd.nextInt(i + 1);\r\n // Simple swap\r\n String a = ar[index];\r\n ar[index] = ar[i];\r\n ar[i] = a;\r\n }\r\n }", "protected String random(String array[]) {\n\t\tRandom generator = new Random();\n\t\tint randomIndex = generator.nextInt(array.length);\n\t\treturn array[randomIndex];\n\t}", "void shuffleArray(String[] ar) {\n for (int i = ar.length - 1; i > 0; i--) {\n int index = rnd.nextInt(i + 1);\n // Simple swap\n String a = ar[index];\n ar[index] = ar[i];\n ar[i] = a;\n }\n }", "private static void __exercise36(final int[] a) {\n final int N = a.length;\n for (int i = 0; i < N; ++i) {\n final int r = i + StdRandom.uniform(N - i);\n final int temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }", "private static char[] shuffle(char[] array) {\n\t\tRandom rand = new Random();\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tint randIndex = rand.nextInt(array.length - 1);\n\t\t\tchar temp = array[i];\n\t\t\tarray[i] = array[randIndex];\n\t\t\tarray[randIndex] = temp;\n\t\t}\n\t\treturn array;\n\t}", "public static void scrambledArray(int[] array){\n Random rand=new Random();// use java.util.random method to scramble the index number\n for(int i=0;i<array.length;i++){\n int num=rand.nextInt(15);\n // swap the two different positioned values by swaping their index number \n int temp=array[i];\n array[i]=array[num];\n array[num]=temp; }\n }", "Actor[] shuffle(Actor[] array) {\n for (int i = array.length; i > 0; i--) {\n int k = rand.nextInt(i);\n Actor tmp = array[k];\n array[k] = array[i - 1];\n array[i - 1] = tmp;\n }\n return array;\n }", "public void scramble(){\r\n for (int i = 0; i < data.length / 2; i++){\r\n int randomIndex1 = (int)(Math.random()*(data.length - 1));\r\n int randomIndex2 = (int)(Math.random()*(data.length - 1));\r\n swap(randomIndex1, randomIndex2);\r\n }\r\n }", "private static void __exercise37(final int[] a) {\n final int N = a.length;\n for (int i = 0; i < N; ++i) {\n final int r = StdRandom.uniform(N);\n final int temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }", "public static String [] randomizeArray(String[] array){\n Random rgen = new Random(); // Random number generator\n\n for (int i=0; i<array.length; i++) {\n int randomPosition = rgen.nextInt(array.length);\n String temp = array[i];\n array[i] = array[randomPosition];\n array[randomPosition] = temp;\n }\n\n return array;\n }", "void myshuffleArray(String[] ar1, String[] ar2) {\n for (int i = ar1.length - 1; i > 0; i--) {\n int index = rnd.nextInt(i+1);\n // Simple swap\n String a1 = ar1[index];\n String a2 = ar2[index];\n ar1[index] = ar1[i];\n ar2[index] = ar2[i];\n ar1[i]=a1;\n ar2[i]=a2;\n }\n }", "private Integer getRandomMapKey() {\r\n\t\tList<Integer> mapKeys = new ArrayList<Integer>(this.compleQuestions.keySet());\r\n\t\tint randomIndex = (int) (Math.random() * mapKeys.size());\r\n\t\treturn mapKeys.get(randomIndex);\r\n\t}", "public void randomize(){\r\n int random = (int) (Math.random()*36);\r\n for(int i = 0;i<7;i++){\r\n for(int j = 0;j<36;j++){\r\n temparray[1] = gameBoard[random];\r\n temparray[2] = gameBoard[j];\r\n gameBoard[j] = temparray[1];\r\n gameBoard[random] = temparray[2];\r\n \r\n }\r\n }\r\n \r\n }", "private static void shuffleArray(int[] ar) {\n Random rnd = ThreadLocalRandom.current();\n for (int i = ar.length - 1; i > 0; i--) {\n int index = rnd.nextInt(i + 1);\n int a = ar[index];\n ar[index] = ar[i];\n ar[i] = a;\n }\n }", "public static void shuffle(Object[] a) {\r\n int N = a.length;\r\n for (int i = 0; i < N; i++) {\r\n int r = i + uniform(N-i); // between i and N-1\r\n Object temp = a[i];\r\n a[i] = a[r];\r\n a[r] = temp;\r\n }\r\n }", "private static void shuffleArray(int[] array)\n {\n int index, temp;\n Random random = new Random();\n for (int i = array.length - 1; i > 0; i--)\n {\n index = random.nextInt(i + 1);\n temp = array[index];\n array[index] = array[i];\n array[i] = temp;\n }\n }", "public static void shuffle( Object[] a ) {\n int N = a.length;\n for ( int i = 0; i < N; i++ ) {\n int r = i + uniform( N - i ); // between i and N-1\n Object temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }", "RandomArrayGenerator() {\n this.defaultLaenge = 16;\n }", "public static void randomize(Object[] v) throws NotImplementedException {\r\n if(v instanceof Integer[]) {\r\n for(int i = 0; i < v.length; i++) {\r\n v[i] = getRandom(Integer.MIN_VALUE, Integer.MAX_VALUE);\r\n }\r\n } else if(v instanceof Short[]) {\r\n for(int i = 0; i < v.length; i++) {\r\n v[i] = (short) getRandom(Short.MIN_VALUE, Short.MAX_VALUE);\r\n }\r\n } else if(v instanceof Boolean[]) {\r\n for(int i = 0; i < v.length; i++) {\r\n v[i] = (getRandom(0, 1) == 1);\r\n }\r\n } else if(v instanceof Character[]) {\r\n for(int i = 0; i < v.length; i++) {\r\n v[i] = (char) getRandom(0, 127); // 255\r\n }\r\n } else if(v instanceof Float[]) {\r\n for(int i = 0; i < v.length; i++) {\r\n v[i] = (float) (-1000.0 + Math.random() * 1000.0);\r\n }\r\n } else {\r\n throw new NotImplementedException();\r\n }\r\n }", "public static void shuffle(String[] arrayList){\n int num=arrayList.length; \n for(int j=0;j<60;j++){ // the number of shuffling>50 times, so I choose 60 times\n for(int i=0;i<num;i++){ \n int index=(int)(Math.random()*num);\n //Swap the position of elements in the array at that index with the first element\n String temp=arrayList[i]; \n arrayList[i]=arrayList[index];\n arrayList[index]=temp;\n }}}", "public void shuffle () {\n this.lives = 6;\n this.attempts.clear();\n this.victory = false;\n this.lose = false;\n Random r = new Random ();\n this._word = _dictionary[r.nextInt(_dictionary.length)];\n // this._word = _dictionary[2]; // Testing purposes\n this.hint.setLength(0);\n for (int i = 0; i < _word.length(); i++) {\n this.hint.append(\"_ \");\n } \n }", "static public <T> void shuffle(T[] a, RNG rng) {\r\n\r\n for (int i = a.length - 1; i > 0; i--) {\r\n int j = (int) rng.random((i + 1));\r\n //System.out.println(j);\r\n T x = a[i];\r\n a[i] = a[j];\r\n a[j] = x;\r\n }\r\n \r\n }", "static void shuffleArray(String[] ar) {\n Random rnd = new Random();\n for (int i = ar.length - 1; i > 0; i--) {\n int index = rnd.nextInt(i + 1);\n // Simple swap\n String a = ar[index];\n ar[index] = ar[i];\n ar[i] = a;\n }\n }", "protected void generateRandomKey(String randomLetters) {\n\n if (randomKeys == null || randomKeys.length == 0) {\n randomLetters = new String(new char[40]).replace(\"\\0\", randomLetters);\n randomKeys = shuffleArray(randomLetters.toCharArray());\n charCount = 0;\n //Log.d(CLASS_NAME, \"Random key generated\"+ new String(randomKeys));\n }\n\n generatedKey = String.valueOf(randomKeys[charCount++]);\n if (randomKeys.length - 1 == charCount) {\n generatedKey = \"All keys are finished\";\n }\n //setting the generatedkey to textview\n TextView generateKeyForTextView = (TextView) findViewById(R.id.textView_key);\n generateKeyForTextView.setText(generatedKey);\n }", "public abstract void randomize();", "T getRandomKey();", "void randomize() {\r\n\t\trandomize(1, this.length());\r\n\t}", "public static <T> void shuffle(T[] array){\n Random rnd = ThreadLocalRandom.current();\n for (int i = array.length - 1; i > 0; i--)\n {\n int index = rnd.nextInt(i + 1);\n // Simple swap\n T a = array[index];\n array[index] = array[i];\n array[i] = a;\n }\n }", "public static <T> void shuffle(T[] array){\n Random rnd = ThreadLocalRandom.current();\n for (int i = array.length - 1; i > 0; i--)\n {\n int index = rnd.nextInt(i + 1);\n // Simple swap\n T a = array[index];\n array[index] = array[i];\n array[i] = a;\n }\n }", "@Override\n public <T> T getRandomElement(T[] array) {\n return super.getRandomElement(array);\n }", "public static void shuffle(int[] array)\n {\n int n = array.length;\n for (int i = 0; i < n; i++)\n {\n // choose index uniformly in [0, i]\n //explicit conversion to int\n int r = (int) (Math.random() * (i + 1));\n swap(array,r,i);\n }\n }", "@Override\n public void randomize(int randomSeed) {\n Random rand = new Random(randomSeed);\n for(int j = size - 1; j > 0; j --){\n int randIndex = rand.nextInt(j);\n \n int [] tmp = data[randIndex];\n data[randIndex] = data[j];\n data[j] = tmp;\n \n int tmpl = labels[randIndex];\n labels[randIndex] = labels[j];\n labels[j] = tmpl;\n \n float tmpw = weights[randIndex];\n weights[randIndex] = weights[j];\n weights[j] = tmpw;\n }\n }", "public static String[] randomizeHand(String[] arrayShuffle){\n String[] combine=new String[5];\n int k=-1;\n for(int i=0;i<5;i++){\n int j=(int)(Math.random()*52);\n if(j==k){continue;} // use if statements to avoid from picking up the same item twice\n else{combine[i]=arrayShuffle[j];k=j;\n }}\n return combine;}", "public static void shuffle(int data[]) {\n\n }", "public static void shuffle(int[] a) {\r\n int N = a.length;\r\n for (int i = 0; i < N; i++) {\r\n int r = i + uniform(N-i); // between i and N-1\r\n int temp = a[i];\r\n a[i] = a[r];\r\n a[r] = temp;\r\n }\r\n }", "public void generateRandomArray() {\n for (int i = 0; i < arraySize; i++) {\n theArray[i] = (int) (Math.random() * 10) + 10;\n }\n }", "void genKey(){\n Random rand = new Random();\n int key_length = 16;\n String key_alpha = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n StringBuilder sb = new StringBuilder(key_length);\n for(int i = 0; i < key_length; i++){\n int j = rand.nextInt(key_alpha.length());\n char c = key_alpha.charAt(j);\n sb.append(c);\n }\n this.key = sb.toString();\n }", "public void shuffle();", "public void randomCivic() {\n\n\t\tpol = new String[polArr.size()];\n\t\tfor (int i = 0; i < polArr.size(); i++) {\n\t\t\tint size = (int) (Math.random() * (polArr.get(i).size() - 1) + 1);\n\t\t\tpol[i] = polArr.get(i).get(size);\n\t\t}\n\t}", "public static void shuffle( int[] a ) {\n int N = a.length;\n \n for ( int i = 0; i < N; i++ ) {\n int r = i + uniform( N - i ); // between i and N-1\n int temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }", "public static void genRandom(int addAmt, int remAmt, int colAmt) {\n Key[] add = new Key[addAmt];\n for (int i = 0; i < addAmt/colAmt + 1; i++) {\n for (int j = 0; j < colAmt; j++) {\n int index = i*colAmt + j;\n if (index >= addAmt) break;\n add[index] = new Key(i, j);\n }\n }\n //System.out.println(\"added!\");\n ArrayTools.shuffle(add);\n Key[] rem = new Key[remAmt];\n for (int i = 0; i < remAmt; i++) {\n rem[i] = add[i];\n }\n //System.out.println(\"removed!\");\n ArrayTools.shuffle(add);\n ArrayTools.shuffle(rem);\n \n int err = 0;\n //LinkedRBTree<Key> tree = new LinkedRBTree<>(Arrays.asList(add));\n RBTree<Key> tree = new RBTree<>();\n for (Key k : add) {\n if (!tree.add(k)) {\n System.err.println(\"Key was not added: \" + k);\n err++;\n }\n }\n for (Key k : rem) {\n if (!tree.remove(k)) {\n System.err.println(\"Key was not removed: \" + k);\n err++;\n }\n }\n for (Key k : rem) {\n if (tree.contains(k)) {\n System.err.println(\"ERROR: Unexpected: \" + k);\n err++;\n }\n }\n //System.out.println(\"checked removed!\");\n Set<Key> remSet = new HashSet<>(ArrayTools.asList(rem));\n for (Key k : add) {\n if (!tree.contains(k) && !remSet.contains(k)) {\n System.err.println(\"ERROR: Expected: \" + k);\n err++;\n }\n }\n if (tree.size() != addAmt - remAmt) {\n System.err.println(\"The expected size of the tree is \" + (addAmt - remAmt) +\n \", but found \" + tree.size() + \" elements!\");\n err++;\n }\n \n //System.out.println(\"checked added!\");\n if (err != 0) {\n System.out.println(\"add: \" + Arrays.toString(add).replaceAll(\"\\\\(\", \"new Key\\\\(\"));\n System.out.println(\"rem: \" + Arrays.toString(rem).replaceAll(\"\\\\(\", \"new Key\\\\(\"));\n fail(\"There were \" + err + \" errors!\");\n }\n //System.out.println(\"DONE\");\n }", "@Test\r\n public void testRandArr() {\r\n System.out.println(\"RandArr\");\r\n int length = 0;\r\n Class sortClass = null;\r\n int[] expResult = null;\r\n int[] result = GenerateArr.RandArr(length, sortClass);\r\n assertArrayEquals(expResult, result);\r\n }", "Randomizer getRandomizer();", "@Override\n\tpublic boolean isRandomizable() {\n\t\treturn false;\n\t}", "public void shuffle() {\n\t\tCollections.shuffle(Arrays.asList(reel));\n\t}", "public void generateRandomMap() {\n\n\t}", "private static void InitRandBag()\n {\n int k=(int)Math.floor(Math.random()*50);\n R[0]=k;\n\n //Generate the rest of the numbers\n for(int i=1;i<950;i++)\n {\n k=k+(int)Math.floor(Math.random()*50);\n R[i]=k;\n }\n\n //Shuffle the list\n for(int i=0;i<950;i++)\n {\n int temp = R[i];\n k = (int)Math.floor(Math.random()*950);\n R[i]=R[k];\n R[k]=temp;\n }\n }", "protected String generateKey(){\n Random bi= new Random();\n String returnable= \"\";\n for(int i =0;i<20;i++)\n returnable += bi.nextInt(10);\n return returnable;\n }", "public void premesaj() {\r\n Collections.shuffle(kup);\r\n }", "void shuffle();", "void shuffle();", "public abstract void shuffled();", "private short[] makeRandomArray(Random r) {\n short[] array = new short[r.nextInt(100)];\n for (int j = 0; j < array.length; j++) {\n array[j] = (short) r.nextInt();\n }\n return array;\n }", "public void randomArray(int size){\n paintIntegers[] arrayNew = new paintIntegers[size];\n paintIntegers.initPaint(arrayNew);\n //updates n\n n = size;\n for(int i = 0; i < arrayNew.length; i++){\n arrayNew[i].val = i + 1;\n }//init the array with 0 to n;\n for(int i = 0; i < arrayNew.length; i++){ // shuffles the array\n //random index past current -> thats why random\n int ridx = i + rand.nextInt(arrayNew.length - i);\n //swap values\n int temp = arrayNew[ridx].val;\n arrayNew[ridx].val = arrayNew[i].val;\n arrayNew[i].val = temp;\n }\n // new origarray array\n origArray = arrayNew.clone();\n }", "private void initializeAndShuffle() {\r\n\t\t\tsuffixes = new byte[256];\r\n\t\t\tfor (int i = 0; i < ALL_BYTE_VALUES.length; i++) {\r\n\t\t\t\tint j = RAND.nextInt(i + 1);\r\n\t\t\t\tif (j != i) {\r\n\t\t\t\t\tsuffixes[i] = suffixes[j];\r\n\t\t\t\t}\r\n\t\t\t\tsuffixes[j] = ALL_BYTE_VALUES[i];\r\n\t\t\t}\r\n\t\t}", "static void shuffleArray(int[] ar) {\n Random rnd = new Random();\n for (int i = ar.length - 1; i > 0; i--) {\n int index = rnd.nextInt(i + 1);\n // Simple swap\n int a = ar[index];\n ar[index] = ar[i];\n ar[i] = a;\n }\n }", "public paintIntegers[] shuffle(paintIntegers[] arr){\n paintIntegers[] arrayNew = new paintIntegers[arr.length];\n paintIntegers.initPaint(arrayNew);\n //updates n\n n = arr.length;\n for(int i = 0; i < arrayNew.length; i++){\n arrayNew[i].val = i + 1;\n }//init the array with 0 to n;\n for(int i = 0; i < arrayNew.length; i++){ // shuffles the array\n //random index past current -> thats why random\n int ridx = i + rand.nextInt(arrayNew.length - i);\n //swap values\n int temp = arrayNew[ridx].val;\n arrayNew[ridx].val = arrayNew[i].val;\n arrayNew[i].val = temp;\n }\n // new origarray array\n return arrayNew.clone();\n }", "public static int[] selectionShuffle(int[] arr) { \n int temp;\n int idx;\n for(int i = 0; i < arr.length; i ++){\n idx = (int) (Math.random() * arr.length);\n temp = arr[i];\n arr[i] = arr[idx];\n arr[idx] = temp;\n }\n return arr;\n }", "public int[] shuffle() {\n\t\tRandom r = new Random();\n\t\tfor (int i = 0; i < this.nums.length; i++) {\n\t\t\tint index = r.nextInt(this.nums.length);\n\t\t\tif (i != index) {\n\t\t\t\tnums[i] = nums[i] ^ nums[index];\n\t\t\t\tnums[index] = nums[i] ^ nums[index];\n\t\t\t\tnums[i] = nums[i] ^ nums[index];\n\t\t\t}\n\t\t}\n\t\treturn nums;\n\t}", "public static int[] shuffle() {\n Random random = new Random();\n for (int i = 0; i < len; i++) {\n int j = random.nextInt(len);\n int temp = nums[i];\n nums[i] = nums[j];\n nums[j] = temp;\n }\n return nums;\n }", "public int[] shuffle() {\n\t\t\tif (originalArr == null)\n\t\t\t\treturn null;\n\t\t\tint randomArr[] = originalArr.clone();\n\t\t\tfor (int i = 1; i < originalArr.length; i++) {\n\t\t\t\tint newIndex = random.nextInt(i + 1);\n\t\t\t\tswap(i, newIndex, randomArr);\n\t\t\t}\n\t\t\treturn randomArr;\n\t\t}", "private static void createPlayfulSet() {\n\n\t\trandomKeys = new ArrayList<>();\n\n\t\trandomKeys.add(GuessRevealerConstants.RANDOM_TEXT1);\n\t\trandomKeys.add(GuessRevealerConstants.RANDOM_TEXT2);\n\t\trandomKeys.add(GuessRevealerConstants.RANDOM_TEXT3);\n\t\trandomKeys.add(GuessRevealerConstants.RANDOM_TEXT4);\n\t\trandomKeys.add(GuessRevealerConstants.RANDOM_TEXT5);\n\t\trandomKeys.add(GuessRevealerConstants.RANDOM_TEXT6);\n\t\trandomKeys.add(GuessRevealerConstants.RANDOM_TEXT7);\n\t\trandomKeys.add(GuessRevealerConstants.END);\n\n\t\trandomCount = randomKeys.size();\n\n\t}", "boolean hasRandomKey();", "@Override\n public <T> T[] shuffle(T[] elements) {\n return super.shuffle(elements);\n }", "public void randomize()\n {\n int max = list.length;\n for (int i=0; i<list.length; i++)\n list[i] = (int)(Math.random() * max) + 1;\n }", "private int[] getRandomEdge(){\n\t\tint[] edge = new int[2];\n\t\tedge[0] = keyPool.get(rand.nextInt(keyPool.size()));\n\t ArrayList<Integer> adj = id[edge[0]].getAdjList();\n\t\tedge[1] = adj.get(rand.nextInt(adj.size())); \n\t\treturn edge;\n\t}", "public String getRandomKey() {\n return randomKey;\n }", "static void randomize(int arr[], Random r) {\n for (int i = arr.length - 1; i > 0; i--) {\n\n // Pick a random index from 0 to i\n int j = r.nextInt(i);\n\n // Swap arr[i] with the element at random index\n int temp = arr[i];\n arr[i] = arr[j];\n arr[j] = temp;\n }\n\n }", "@Test\r\n public void testRandElem() {\r\n System.out.println(\"RandElem\");\r\n int length = 0;\r\n Class sortClass = null;\r\n int[] expResult = null;\r\n int[] result = GenerateArr.RandElem(length, sortClass);\r\n assertArrayEquals(expResult, result);\r\n }", "public static void printRand(String[] arr) {\n\t\tRandom rand = new Random();\n\t\tint derp = arr.length;\n\t\tint[] compare = new int[arr.length];\n\t\tint temp;\n\t\t\n\t\tint ree;\n\t\tfor(int i = 0; i < arr.length;i ++) {\n\t\t\tcompare[i] = i;\n\t\t}\n\t\tfor(int i = 0; i < arr.length; i++) {\n\t\t\tree = rand.nextInt(arr.length);\n\t\t\ttemp = compare[derp - i - 1];\n\t\t\tcompare[derp - i - 1] = compare[ree];\n\t\t\tcompare[ree] = temp;\n\t\t}\n\t\tfor(int i = 0; i < arr.length; i++) {\n\t\t\tSystem.out.print(arr[compare[i]] + \" \");\n\t\t}\n\t}", "public static void shuffle(double[] a) {\r\n int N = a.length;\r\n for (int i = 0; i < N; i++) {\r\n int r = i + uniform(N-i); // between i and N-1\r\n double temp = a[i];\r\n a[i] = a[r];\r\n a[r] = temp;\r\n }\r\n }", "public static void arraySwaping(int array[]) {\r\n\r\n\t\tint temp, randInt;\r\n\r\n\t\tRandom rand = new Random();\r\n\r\n\t\tfor (int i = 0; i < array.length; i++) {\r\n\r\n\t\t\trandInt = rand.nextInt(array.length);\r\n\r\n\t\t\ttemp = array[i];\r\n\t\t\tarray[i] = array[randInt];\r\n\t\t\tarray[randInt] = temp;\r\n\r\n\t\t}\r\n\r\n\t}", "public void shuffle() {\n for (int i = size - 1; i > 0; i--) {\n swap(i, (int)(Math.random() * (i + 1)));\n }\n }", "public void generateKey(int min, int max) {\n double [][] key = new double[CHAR_SET_SIZE][CHAR_SET_SIZE];\n Random rand = new Random(System.currentTimeMillis());\n boolean keyGenerated = false;\n while (!keyGenerated) {\n for (int i = 0; i < key.length; i++) {\n for (int j = 0; j < key.length; j++) {\n // Generate random double between min,max\n key[i][j] = max + (max - min) * rand.nextInt();\n }\n }\n // Ensure the matrix is invertible\n Matrix m = new Matrix(key);\n if (m.det() != 0) {\n keyGenerated = true;\n this.key = key;\n }\n }\n }", "private void random() {\n\n\t}", "public int[] shuffle() {\n int[] result = reset();\n\n Random rand = new Random();\n for (int i = 0; i < result.length; i++) {\n int j = rand.nextInt(result.length - i) + i;\n int tmp = result[i];\n result[i] = result[j];\n result[j] = tmp;\n }\n return result;\n }", "public void randomize(){\r\n\t\tfor(int i = 0;i<this.myQuestions.size();i++){\r\n\t\t\tthis.myQuestions.get(i).randomize();\r\n\t\t}\r\n\t\tCollections.shuffle(this.myQuestions);\r\n\t}", "public void mo2479c() {\n Collections.shuffle(mo2625k(), C0817u.f2167a);\n }", "public int[] shuffle() {\r\n int max = nums.length - 1;\r\n for (int i = 0; i < nums.length; i++) {\r\n int index = new Random().nextInt(max)%(max - i + 1) + i;\r\n int tmp = nums[i];\r\n nums[i] = nums[index];\r\n nums[index] = tmp;\r\n }\r\n return nums;\r\n }", "public void mixArray(int[] v){\n Random rnd = new Random();\n for (int i = v.length - 1; i > 0; i--)\n {\n int index = rnd.nextInt(i + 1);\n // Simple swap\n int a = v[index];\n v[index] = v[i];\n v[i] = a;\n }\n }", "static void initializeArray2() {\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tRandom r = new Random();\n\t\t\tint val = r.nextInt(m);\n\t\t\t// Hash implementation\n\t\t\tint mod = val % m;\n\t\t\tarray[mod] = val;\n\t\t\tresult[1]++;\n\t\t}\n\t}", "public static void shuffle( double[] a ) {\n int N = a.length;\n \n for ( int i = 0; i < N; i++ ) {\n int r = i + uniform( N - i ); // between i and N-1\n double temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }", "static void random(String[]array) {\n\t\tRandom ran=new Random();\n\tfor (int i = 0; i < array.length; i++) {\n\t\tSystem.out.println(array[ran.nextInt(array.length)]);\n\t}\n\t}", "private void shufflePositions() {\r\n\r\n // Inizializzo con il progressivo delle posizioni\r\n for (int i = 0; i < shufflePositions.length; i++) {\r\n shufflePositions[i] = i;\r\n }\r\n\r\n int lastIndex ;\r\n int tempIndex = 0;\r\n int tempVal = 0;\r\n\r\n// // Tecnica 1 - Knuth (gli indici da scambiare sono scelti dall'inizio in un insieme decrescente in cardinalità)\r\n// int lastIndex = shufflePositions.length;\r\n// for (int i = 0; i < shufflePositions.length-1; i++) {\r\n// tempIndex = i+secureRandom.nextInt(lastIndex); // Randomizzo le posizioni del random buffer da cui prendo i valori casuali\r\n// tempVal=shufflePositions[tempIndex];\r\n// shufflePositions[tempIndex]=shufflePositions[i];\r\n// shufflePositions[i] = tempVal; \r\n// lastIndex--;\r\n// } \r\n \r\n //Tecnica 2 - Knuth GAB Modification (gli indici casuali sono scelti dal fondo in un insieme decrescente in cardinalità)\r\n lastIndex = shufflePositions.length-1;\r\n for (int i = 0; i < shufflePositions.length - 1; i++) {\r\n tempIndex = secureRandom.nextInt(lastIndex); // Randomizzo le posizioni del random buffer da cui prendo i valori casuali\r\n tempVal = shufflePositions[tempIndex];\r\n shufflePositions[tempIndex] = shufflePositions[lastIndex];\r\n shufflePositions[lastIndex] = tempVal;\r\n lastIndex--;\r\n }\r\n \r\n// // Tecnica 3 - Algoritmo standard delle collections\r\n// Integer[]tempArray = new Integer[MaxBufferLength];\r\n// for (int i=0;i<MaxBufferLength;i++){\r\n// tempArray[i]=i;\r\n// \r\n// }\r\n// List<Integer> tempList = Arrays.asList(tempArray);\r\n//\r\n// Collections.shuffle(tempList, secureRandom);\r\n// tempArray= (Integer[]) tempList.toArray();\r\n// for (int i=0;i<shufflePositions.length;i++){\r\n// shufflePositions[i]=tempArray[i];\r\n// }\r\n }", "@Test\n public void testKeyGeneration() {\n final int NUM_KEYS = 10;\n Set<byte[]> generatedKeys = new HashSet<>(NUM_KEYS);\n\n for (int i = 0; i < NUM_KEYS; ++i) {\n byte[] newKey = KeyGenerator.instance().generateKey();\n\n assertFalse(\"Duplicate key generated #\" + i, generatedKeys.contains(newKey));\n generatedKeys.add(newKey);\n }\n }", "public void generateIDs() {\n Random randomGenerator = new Random();\n for(int i = 0; i < identificationNumbers.length; i++) {\n for(int j = 0; j < identificationNumbers[i].length; j++)\n identificationNumbers[i][j] = randomGenerator.nextInt(2);\n }\n }", "public static void randomArray(int array[]){\n DecimalFormat twoDig = new DecimalFormat(\"00\");\n System.out.print(\"\\nSample Random Numbers Generated: \");\n for (int i = 0; i < array.length; i++){\n array[i] = (int)(Math.random() * 100);\n System.out.print(twoDig.format(array[i]) + \" \");\n }\n }", "public void shuffle() {\n\t\tCollections.shuffle(inds);\n\t}", "private List<Integer> generateRandom() {\n Integer[] randArr = new Integer[numCols*numRows];\n\n int start = 0;\n int end;\n for(int i = 0; i < myStateMap.size(); i++) {\n int amt = myStateMap.get(i).getAmount();\n end = amt + start;\n for(int j = start; j < end; j++) {\n if(end > randArr.length) {\n break;\n }\n randArr[j] = myStateMap.get(i).getType();\n }\n start = end;\n }\n\n List<Integer> arr = new ArrayList<>(Arrays.asList(randArr));\n Collections.shuffle(arr);\n return arr;\n }", "public final <T> T random(T[] array) {\n return array[random(0, array.length)];\n }", "public int getRandom() {\n Set<Integer> keys = map.keySet();\n Object[] objects = keys.toArray();\n Random rand = new Random();\n int key = rand.nextInt(keys.size());\n return map.get(objects[key]);\n }", "public Substitute(){\n key = new byte[256];\n inverse = new byte[256];\n int[] intermediate = new int[256];\n for(int i = 1; i < 257; i++){\n int index = (int) (Math.random() * 256); //Generate random index between 0 and 255\n while(intermediate[index] != 0) //If that index already has a value, generate another random index\n index = (int) (Math.random() * 256);\n intermediate[index] = i; //Place value of i into generated location\n }\n for(int i = 0; i < intermediate.length; i++)\n key[i] = (byte) (intermediate[i] - 129); //Subtract 129 from each location so all values are from -128 to 127\n\n for(int i = 0; i < key.length; i++){ //Create the inverse mapping\n int index = key[i] + 128; //Location is adding 128 to what's stored in key array\n inverse[index] = (byte) (i - 128); //What's placed in that location is the value of i subtracted by 128\n }\n }", "public void randomize()\n {\n for (int i=0; i<list.length; i++)\n list[i] = (int)(Math.random() * 100) + 1;\n }", "public void shuffle()\r\n\t{\r\n\t\tRandom rand = ThreadLocalRandom.current();\r\n\t\t\r\n\t\tfor (int i = topCard; i > 0; i--)\r\n\t\t{\r\n\t\t\tint index = rand.nextInt(i + 1);\r\n\t\t\tString temp = cards[index];\r\n\t\t\tcards[index] = cards[i];\r\n\t\t\tcards[i] = temp;\r\n\t\t}\r\n\t}", "public static <E> ArrayList<E> scrambleArrayList(ArrayList<E> inArr)\n {\n ArrayList<E> scrambleArr = new ArrayList();\n scrambleArr.addAll(inArr);\n Random rndVar = new Random();\n int size = inArr.size();\n E tempStr;\n\n for(int k = 0; k < size; k++) {\n int i = rndVar.nextInt(size);\n tempStr = scrambleArr.get(i);\n scrambleArr.remove(i);\n scrambleArr.add(tempStr);\n\n } //for\n\n return scrambleArr;\n\n }" ]
[ "0.6716895", "0.66939765", "0.6522732", "0.6499561", "0.64854234", "0.6485137", "0.6427569", "0.6416528", "0.6368836", "0.63670135", "0.636344", "0.6356678", "0.6285415", "0.6250004", "0.62452275", "0.6234803", "0.6230099", "0.6207968", "0.61968374", "0.617841", "0.6154631", "0.61444885", "0.6131088", "0.6126178", "0.61244845", "0.61233425", "0.6102942", "0.60946214", "0.60706204", "0.60669446", "0.6052895", "0.6044235", "0.6034553", "0.6034553", "0.6017371", "0.6012396", "0.60107964", "0.5985038", "0.59795296", "0.5972966", "0.5964795", "0.59508705", "0.5938927", "0.59387743", "0.5920056", "0.59051806", "0.5895857", "0.5892253", "0.5882457", "0.58783543", "0.5842425", "0.58369094", "0.58340937", "0.5824667", "0.5813035", "0.5813035", "0.58095217", "0.58060277", "0.58052546", "0.5800853", "0.5797239", "0.5796523", "0.57829696", "0.57786965", "0.5774807", "0.5770712", "0.5768491", "0.5767438", "0.5765159", "0.5764729", "0.5757669", "0.5755364", "0.5752484", "0.57374024", "0.57349515", "0.57245004", "0.5723572", "0.5719231", "0.57185996", "0.571258", "0.57108", "0.57105196", "0.57063", "0.5678202", "0.56613374", "0.5651132", "0.5642495", "0.5635337", "0.56294334", "0.5628761", "0.5628243", "0.5622727", "0.56196946", "0.5614971", "0.561462", "0.55954516", "0.55815387", "0.55718505", "0.5571223", "0.55702746" ]
0.6567969
2
This test verifies that FootstepData can be sent and received using our current message passing utilities
@Test public void testPassingFootstepData() throws IOException { Random random = new Random(5642769L); // setup comms NetworkPorts port = NetworkPorts.createRandomTestPort(random); // QueueBasedStreamingDataProducer<FootstepData> queueBasedStreamingDataProducer = new QueueBasedStreamingDataProducer<FootstepData>("FootstepData"); PacketCommunicator tcpServer = createAndStartStreamingDataTCPServer(port); FootstepDataConsumer footstepDataConsumer = new FootstepDataConsumer(); PacketCommunicator tcpClient = createStreamingDataConsumer(FootstepDataMessage.class, footstepDataConsumer, port); ThreadTools.sleep(SLEEP_TIME); // queueBasedStreamingDataProducer.startProducingData(); // create test footsteps ArrayList<Footstep> sentFootsteps = createRandomFootsteps(50); for (Footstep footstep : sentFootsteps) { FootstepDataMessage footstepData = HumanoidMessageTools.createFootstepDataMessage(footstep); tcpServer.send(footstepData); // queueBasedStreamingDataProducer.queueDataToSend(footstepData); } ThreadTools.sleep(SLEEP_TIME); tcpClient.disconnect(); tcpServer.disconnect(); // verify received correctly ArrayList<Footstep> receivedFootsteps = footstepDataConsumer.getReconstructedFootsteps(); compareFootstepsSentWithReceived(sentFootsteps, receivedFootsteps); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n\tpublic void testF() {\r\n\t\t\r\n\t\tObjectHandshake h = new ObjectHandshake();\r\n\t\th.setUuid( UuidTool.getOne() );\r\n\t\t\r\n\t\tRunProtocol run = null;\r\n\t\t\r\n\t\trun = new RunProtocol(h, IHandshake.PARTNER_A, 100, 200, true, false);\r\n\t\tassertTrue(run.beginA());\r\n\t\t\r\n\t\trun = new RunProtocol(h, IHandshake.PARTNER_B, 100, 200, true, false);\r\n\t\tassertTrue(run.commitA());\r\n\t\t\r\n\t\trun = new RunProtocol(h, IHandshake.PARTNER_B, 100, 200, true, false);\r\n\t\tassertTrue(run.beginB());\r\n\t\t\r\n\t\trun = new RunProtocol(h, IHandshake.PARTNER_A, 100, 200, true, false);\r\n\t\tassertTrue(run.commitB());\r\n\t\t\r\n\t\tassertEquals(h.getLog(), \"1-8-100-2-8-101-2-2-200-1-2-201-\");\r\n\t}", "@Test\n public void testHandleMessages() throws Exception {\n Controller controller = getController();\n controller.removeOFMessageListeners(OFType.PACKET_IN);\n \n IOFSwitch sw = createMock(IOFSwitch.class);\n expect(sw.getStringId()).andReturn(\"00:00:00:00:00:00:00\").anyTimes();\n expect(sw.getFeaturesReply()).andReturn(new OFFeaturesReply()).anyTimes();\n \n // Build our test packet\n IPacket testPacket = new Ethernet()\n .setSourceMACAddress(\"00:44:33:22:11:00\")\n .setDestinationMACAddress(\"00:11:22:33:44:55\")\n .setEtherType(Ethernet.TYPE_ARP)\n .setPayload(\n new ARP()\n .setHardwareType(ARP.HW_TYPE_ETHERNET)\n .setProtocolType(ARP.PROTO_TYPE_IP)\n .setHardwareAddressLength((byte) 6)\n .setProtocolAddressLength((byte) 4)\n .setOpCode(ARP.OP_REPLY)\n .setSenderHardwareAddress(Ethernet.toMACAddress(\"00:44:33:22:11:00\"))\n .setSenderProtocolAddress(IPv4.toIPv4AddressBytes(\"192.168.1.1\"))\n .setTargetHardwareAddress(Ethernet.toMACAddress(\"00:11:22:33:44:55\"))\n .setTargetProtocolAddress(IPv4.toIPv4AddressBytes(\"192.168.1.2\")));\n byte[] testPacketSerialized = testPacket.serialize();\n \n // Build the PacketIn \n OFPacketIn pi = ((OFPacketIn) new BasicFactory().getMessage(OFType.PACKET_IN))\n .setBufferId(-1)\n .setInPort((short) 1)\n .setPacketData(testPacketSerialized)\n .setReason(OFPacketInReason.NO_MATCH)\n .setTotalLength((short) testPacketSerialized.length);\n \n IOFMessageListener test1 = createMock(IOFMessageListener.class);\n expect(test1.getName()).andReturn(\"test1\").anyTimes();\n expect(test1.isCallbackOrderingPrereq((OFType)anyObject(), (String)anyObject())).andReturn(false).anyTimes();\n expect(test1.isCallbackOrderingPostreq((OFType)anyObject(), (String)anyObject())).andReturn(false).anyTimes();\n expect(test1.receive(eq(sw), eq(pi), isA(FloodlightContext.class))).andThrow(new RuntimeException(\"This is NOT an error! We are testing exception catching.\"));\n IOFMessageListener test2 = createMock(IOFMessageListener.class);\n expect(test2.getName()).andReturn(\"test2\").anyTimes();\n expect(test2.isCallbackOrderingPrereq((OFType)anyObject(), (String)anyObject())).andReturn(false).anyTimes();\n expect(test2.isCallbackOrderingPostreq((OFType)anyObject(), (String)anyObject())).andReturn(false).anyTimes();\n // expect no calls to test2.receive() since test1.receive() threw an exception\n \n replay(test1, test2, sw);\n controller.addOFMessageListener(OFType.PACKET_IN, test1);\n controller.addOFMessageListener(OFType.PACKET_IN, test2);\n try {\n controller.handleMessage(sw, pi, null);\n } catch (RuntimeException e) {\n assertEquals(e.getMessage().startsWith(\"This is NOT an error!\"), true);\n }\n verify(test1, test2, sw);\n \n // verify STOP works\n reset(test1, test2, sw);\n expect(test1.receive(eq(sw), eq(pi), isA(FloodlightContext.class))).andReturn(Command.STOP); \n expect(test1.getId()).andReturn(0).anyTimes();\n expect(sw.getStringId()).andReturn(\"00:00:00:00:00:00:00\").anyTimes();\n expect(sw.getFeaturesReply()).andReturn(new OFFeaturesReply()).anyTimes();\n replay(test1, test2, sw);\n controller.handleMessage(sw, pi, null);\n verify(test1, test2, sw);\n }", "public void testReceiveFeedback() {\n\n\t}", "@Before\n\tpublic void setup() {\n\t\tthis.messaging.receive(\"output\", 100, TimeUnit.MILLISECONDS);\n\t}", "@Test\n\tpublic void runSend(){\n\t\tstandard();\n\t}", "@Test\n public void testSend() throws Exception {\n//TODO: Test goes here...\n message.send(\"hello\", \"Bob\");\n }", "@Test\n public void remoteSendsDataAfterInFinished() throws Exception {\n peer.sendFrame().settings(new Settings());\n peer.acceptFrame();// ACK\n\n peer.acceptFrame();// SYN_STREAM\n\n peer.sendFrame().headers(false, 3, TestUtil.headerEntries(\"a\", \"android\"));\n peer.sendFrame().data(true, 3, new Buffer().writeUtf8(\"robot\"), 5);\n peer.sendFrame().data(true, 3, new Buffer().writeUtf8(\"c3po\"), 4);\n peer.acceptFrame();// RST_STREAM\n\n peer.sendFrame().ping(false, 2, 0);// Ping just to make sure the stream was fastforwarded.\n\n peer.acceptFrame();// PING\n\n peer.play();\n // play it back\n Http2Connection connection = connect(peer);\n Http2Stream stream = connection.newStream(TestUtil.headerEntries(\"b\", \"banana\"), false);\n Assert.assertEquals(Headers.of(\"a\", \"android\"), stream.takeHeaders());\n assertStreamData(\"robot\", stream.getSource());\n // verify the peer received what was expected\n MockHttp2Peer.InFrame synStream = peer.takeFrame();\n Assert.assertEquals(TYPE_HEADERS, synStream.type);\n MockHttp2Peer.InFrame rstStream = peer.takeFrame();\n Assert.assertEquals(TYPE_RST_STREAM, rstStream.type);\n Assert.assertEquals(3, rstStream.streamId);\n MockHttp2Peer.InFrame ping = peer.takeFrame();\n Assert.assertEquals(TYPE_PING, ping.type);\n Assert.assertEquals(2, ping.payload1);\n }", "@Test\n public void testControlResponses() throws Exception {\n createTethering(\"xyz\", NAMESPACES, REQUEST_TIME, DESCRIPTION);\n acceptTethering();\n TetheringControlResponseV2 expectedResponse =\n new TetheringControlResponseV2(Collections.emptyList(), TetheringStatus.ACCEPTED);\n\n expectTetheringControlResponse(\"xyz\", HttpResponseStatus.OK, GSON.toJson(expectedResponse));\n\n // Queue up a couple of messages for the peer\n MessagePublisher publisher =\n new MultiThreadMessagingContext(messagingService).getMessagePublisher();\n String topicPrefix = cConf.get(Constants.Tethering.CLIENT_TOPIC_PREFIX);\n String topic = topicPrefix + \"xyz\";\n TetheringLaunchMessage launchMessage =\n new TetheringLaunchMessage.Builder()\n .addFileNames(DistributedProgramRunner.LOGBACK_FILE_NAME)\n .addFileNames(DistributedProgramRunner.PROGRAM_OPTIONS_FILE_NAME)\n .addFileNames(DistributedProgramRunner.APP_SPEC_FILE_NAME)\n .addRuntimeNamespace(\"default\")\n .build();\n TetheringControlMessage message1 =\n new TetheringControlMessage(\n TetheringControlMessage.Type.START_PROGRAM, Bytes.toBytes(GSON.toJson(launchMessage)));\n publisher.publish(NamespaceId.SYSTEM.getNamespace(), topic, GSON.toJson(message1));\n ProgramRunInfo programRunInfo =\n new ProgramRunInfo.Builder()\n .setNamespace(\"ns\")\n .setApplication(\"app\")\n .setVersion(\"1.0\")\n .setProgramType(\"workflow\")\n .setProgram(\"program\")\n .setRun(\"runId\")\n .build();\n TetheringControlMessage message2 =\n new TetheringControlMessage(\n TetheringControlMessage.Type.STOP_PROGRAM, Bytes.toBytes(GSON.toJson(programRunInfo)));\n publisher.publish(NamespaceId.SYSTEM.getNamespace(), topic, GSON.toJson(message2));\n\n // Poll the server\n HttpRequest.Builder builder =\n HttpRequest.builder(HttpMethod.POST, config.resolveURL(\"tethering/channels/xyz\"))\n .withBody(GSON.toJson(new TetheringControlChannelRequest(null, null)));\n\n // Response should contain 2 messages\n HttpResponse response = HttpRequests.execute(builder.build());\n TetheringControlResponseV2 controlResponse =\n GSON.fromJson(response.getResponseBodyAsString(), TetheringControlResponseV2.class);\n List<TetheringControlMessageWithId> controlMessages = controlResponse.getControlMessages();\n\n Assert.assertEquals(HttpResponseStatus.OK.code(), response.getResponseCode());\n Assert.assertEquals(2, controlMessages.size());\n Assert.assertEquals(message1, controlMessages.get(0).getControlMessage());\n Assert.assertEquals(message2, controlMessages.get(1).getControlMessage());\n\n // Poll again with lastMessageId set to id of last message received from the server\n String lastMessageId = controlMessages.get(1).getMessageId();\n builder =\n HttpRequest.builder(HttpMethod.POST, config.resolveURL(\"tethering/channels/xyz\"))\n .withBody(GSON.toJson(new TetheringControlChannelRequest(lastMessageId, null)));\n\n // There should be no more messages queued up for this client\n response = HttpRequests.execute(builder.build());\n controlResponse =\n GSON.fromJson(response.getResponseBodyAsString(), TetheringControlResponseV2.class);\n Assert.assertEquals(HttpResponseStatus.OK.code(), response.getResponseCode());\n Assert.assertEquals(0, controlResponse.getControlMessages().size());\n }", "@Test\r\n\tpublic void test() {\r\n\t\t// Generate random strings.\r\n\t\tfinal String[] messages = new String[m];\r\n\t\tfor (int i = 0; i < m; ++i)\r\n\t\t\tmessages[i] = random.string(minMessageLength, maxMessageLength);\r\n\r\n\t\t// Glue the messages into random bulks.\r\n\t\tfinal Vector<StringBuilder> bulks = new Vector<StringBuilder>();\r\n\t\tbulks.add(new StringBuilder(\"\"));\r\n\t\tfor (int i = 0; i < m; ++i)\r\n\t\t{\r\n\t\t\tbulks.lastElement().append(MessageHandler.wrapMessage(new Message(messages[i], null)).content);\r\n\t\t\tif (random.floating() > 0.5) bulks.add(new StringBuilder(\"\"));\r\n\t\t}\r\n\r\n\t\tVector<Message> received = new Vector<Message>(m);\r\n\r\n\t\t// Send the fragments.\r\n\t\tfor (int i = 0; i < bulks.size(); ++i) {\r\n\t\t\tPacket[] packets = MessageHandler.unwrapBulk(bulks.get(i).toString());\r\n\t\t\tfor (Packet packet : packets)\r\n\t\t\t\treceived.add(packet.message);\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; i < messages.length; ++i) {\r\n\t\t\tif (!received.get(i).content.equals(messages[i]))\r\n\t\t\t\tfail(\"Received message \" + i + \" [\" + received.get(i).content + \"] does not match sent message [\" + messages[i] + \"].\");\r\n\t\t}\r\n\t}", "@Test\n\tpublic void testFastHaveAllMessage() throws Exception {\n\n\t\t// Given\n\t\tfinal PieceDatabase pieceDatabase = MockPieceDatabase.create (\"00000\", 16384);\n\t\tpieceDatabase.start (true);\n\t\tPeerServices peerServices = mock (PeerServices.class);\n\t\tPeerSetContext peerSetContext = new PeerSetContext (peerServices, pieceDatabase, mock (RequestManager.class), null);\n\t\twhen(peerSetContext.requestManager.piecesAvailable (any (ManageablePeer.class))).thenReturn (true);\n\t\twhen(peerSetContext.requestManager.allocateRequests (any (ManageablePeer.class), anyInt(), eq (false))).thenReturn (new ArrayList<BlockDescriptor>());\n\t\tMockConnection mockConnection = new MockConnection();\n\t\tPeerHandler handler = new PeerHandler (peerSetContext, mockConnection, new PeerID(), new PeerStatistics(), true, false);\n\n\t\t// When\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveAllMessage());\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.haveNoneMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.interestedMessage());\n\t\tmockConnection.mockExpectNoMoreOutput();\n\t\tassertTrue (mockConnection.isOpen());\n\t\tassertEquals (5, handler.getRemoteBitField().cardinality());\n\n\n\t\tpieceDatabase.terminate (true);\n\n\t}", "@Test\n public void placeShipsTest()throws GameException, StatusException, IOException,InterruptedException{\n SVToReadTester aliceGameEngineTester = new SVToReadTester();\n //real protocol engine on alice´s side\n SVProtocolEngine aliceSVProtocolEngine = new SVProtocolEngine(aliceGameEngineTester);\n\n //protocol engine\n ProtocolEngine aliceProtocolEngine = aliceSVProtocolEngine;\n SchiffeVersenken aliceGameEngineSide = aliceSVProtocolEngine;\n\n //bobs game engine Tester\n SVToReadTester bobGameEngineTester = new SVToReadTester();\n ProtocolEngine bobProtocolEngine = new SVProtocolEngine(bobGameEngineTester);\n\n // Setup\n int port = this.getPortNumber();\n // this stream plays TCP server role during connection establishment\n TCPStream aliceSide = new TCPStream(port, true, \"aliceSide\");\n // this stream plays TCP client role during connection establishment\n TCPStream bobSide = new TCPStream(port, false, \"bobSide\");\n // start both stream\n aliceSide.start(); bobSide.start();\n // wait until TCP connection is established\n aliceSide.waitForConnection(); bobSide.waitForConnection();\n\n // launch\n aliceProtocolEngine.handleConnection(aliceSide.getInputStream(), aliceSide.getOutputStream());\n bobProtocolEngine.handleConnection(bobSide.getInputStream(), bobSide.getOutputStream());\n\n Thread.sleep(1000);\n\n // run test scenario // todo\n ArrayList<BattleshipsBoardPosition> positions = aliceSVProtocolEngine.placeShips(ALICE, buildPositions(SHIPPOS1));\n ArrayList<BattleshipsBoardPosition> positions1 = aliceSVProtocolEngine.placeShips(BOB, buildPositions(SHIPPOS1));\n BattleshipsBoardPosition testPos = new BattleshipsBoardPosition(\"A\", 0);\n Assert.assertEquals(\"F\", aliceGameEngineSide.attackPos(BOB, testPos));\n\n}", "@Test\r\n\tpublic void testB() {\r\n\t\t\r\n\t\tObjectHandshake h = new ObjectHandshake();\r\n\t\th.setUuid( UuidTool.getOne() );\r\n\t\t\r\n\t\tRunProtocol run = new RunProtocol(h, IHandshake.PARTNER_A, 100, 200, false, true);\r\n\t\t\r\n\t\tassertTrue(run.beginA());\r\n\t\tassertTrue(run.commitA());\r\n\t\t\r\n\t\tassertTrue(run.beginB());\r\n\t\tassertTrue(run.commitB());\r\n\t}", "@Test\n public void testSend() throws Exception {\n System.out.println(\"send\");\n Sendable s = sendAMessage();\n }", "@Test\r\n\tpublic void testA() {\r\n\t\t\r\n\t\t//The single object\r\n\t\tObjectHandshake h = new ObjectHandshake();\r\n\t\th.setUuid( UuidTool.getOne() );\r\n\t\t\r\n\t\tfinal int ackId = 100;\r\n\t\tfinal int synId = 200;\r\n\t\t\r\n\t\t//The protocol side A\r\n\t\tList<LogData> listA = new ArrayList<LogData>();\r\n\t\tLogParser logA = new LogParser();\r\n\t\tlogA.setList(listA);\r\n\t\tLogProcessor prcA = new LogProcessor(h);\r\n\t\tLogAnalyzer alyA = new LogAnalyzer();\r\n\t\talyA.setList(listA);\r\n\t\talyA.setDryPartner(true);\r\n\t\tprcA.setList(listA);\r\n\t\tprcA.setPartner(ObjectHandshake.PARTNER_A);\r\n\t\tprcA.setAckId(ackId);\r\n\t\tprcA.setSynId(synId);\r\n\t\t\r\n\t\t//The protocol side B\r\n\t\tList<LogData> listB = new ArrayList<LogData>();\r\n\t\tLogParser logB = new LogParser();\r\n\t\tlogB.setList(listB);\r\n\t\tLogProcessor prcB = new LogProcessor(h);\r\n\t\tLogAnalyzer alyB = new LogAnalyzer();\r\n\t\talyB.setList(listB);\r\n\t\talyB.setDryPartner(true);\r\n\t\tprcB.setList(listB);\r\n\t\tprcB.setPartner(ObjectHandshake.PARTNER_B);\r\n\t\tprcB.setAckId(ackId);\r\n\t\tprcB.setSynId(synId);\r\n\t\t\r\n\t\t//Start\r\n\t\tassertEquals(LogAnalyzer.PART_0_REACHED, alyA.analyzeCommunication(0));\r\n\t\tassertEquals(LogAnalyzer.PART_0_REACHED, alyB.analyzeCommunication(0));\r\n\t\t\r\n\t\t//A sends ACK\r\n\t\tprcA.doPart1();\r\n\t\tassertEquals(LogAnalyzer.PART_1_ANALYZED, alyA.analyzeAndSetData());\r\n\t\t\r\n\t\t//B answers ACK + SYN\r\n\t\tlogB.parse(h.getLog());\r\n\t\tassertEquals(LogAnalyzer.PART_1_ANALYZED, alyB.analyzeAndSetData());\r\n\t\tassertEquals(LogAnalyzer.PART_1_REACHED, alyB.analyzeCommunication(ackId));\r\n\t\t\r\n\t\tprcB.doPart2();\r\n\t\t\r\n\t\t//B answers ACK + SYN\r\n\t\tlogB.parse(h.getLog());\r\n\t\tassertEquals(LogAnalyzer.PART_2_ANALYZED, alyB.analyzeAndSetData() );\r\n\t\tassertEquals(LogAnalyzer.PART_2_REACHED, alyB.analyzeCommunication(ackId+1));\r\n\t\t\r\n\t\tprcB.doPart3();\r\n\t\t\r\n\t\tlogB.parse(h.getLog());\r\n\t\tassertEquals(LogAnalyzer.PART_3_ANALYZED, alyB.analyzeAndSetData() );\r\n\t\t\r\n\t\t//A answers SYN\r\n\t\tlogA.parse(h.getLog());\r\n\t\tassertEquals(LogAnalyzer.PART_3_ANALYZED, alyA.analyzeAndSetData() );\r\n\t\tassertEquals(LogAnalyzer.PART_3_REACHED, alyA.analyzeCommunication(synId));\r\n\t\t\r\n\t\tprcA.doPart4();\r\n\t\t\r\n\t\tlogA.parse(h.getLog());\r\n\t\tassertEquals(LogAnalyzer.PART_4_ANALYZED, alyA.analyzeAndSetData() );\r\n\t\tassertEquals(LogAnalyzer.PART_4_REACHED, alyA.analyzeCommunication(synId+1));\r\n\t\t\r\n\t\tassertTrue( alyA.isAckFlag() );\r\n\t\tassertTrue( alyA.isSynFlag() );\r\n\t\tassertFalse( alyA.isFinFlag() );\r\n\t\tassertFalse( alyA.isRstFlag() );\r\n\t\t\r\n\t\tassertTrue( alyB.isAckFlag() );\r\n\t\tassertTrue( alyB.isSynFlag() );\r\n\t\tassertFalse( alyB.isFinFlag() );\r\n\t\tassertFalse( alyB.isRstFlag() );\r\n\t}", "public void testReceiver() throws Exception\n {\n }", "@Test\n public void serverPingsClient() throws Exception {\n peer.sendFrame().settings(new Settings());\n peer.acceptFrame();// ACK\n\n peer.sendFrame().ping(false, 2, 0);\n peer.acceptFrame();// PING\n\n peer.play();\n // play it back\n connect(peer);\n // verify the peer received what was expected\n MockHttp2Peer.InFrame ping = peer.takeFrame();\n Assert.assertEquals(0, ping.streamId);\n Assert.assertEquals(2, ping.payload1);\n Assert.assertEquals(0, ping.payload2);\n Assert.assertTrue(ping.ack);\n }", "@Test\n public void testHL7MessageFlood() throws Exception {\n Socket socket = new Socket(\"localhost\", HL7TestSupport.getPort());\n BufferedOutputStream outputStream = new BufferedOutputStream(new DataOutputStream(socket.getOutputStream()));\n final BufferedInputStream inputStream = new BufferedInputStream(new DataInputStream(socket.getInputStream()));\n int messageCount = 100;\n CountDownLatch latch = new CountDownLatch(messageCount);\n Thread t = new Thread(new Runnable() {\n @Override\n public void run() {\n int response;\n StringBuilder s = new StringBuilder();\n try {\n int i = 0;\n boolean cont = true;\n while (cont && ((response = inputStream.read()) >= 0)) {\n if (response == 28) {\n response = inputStream.read();// read second end byte\n\n if (response == 13) {\n // Responses must arrive in same order\n cont = s.toString().contains(String.format(\"X%dX\", (i++)));\n s.setLength(0);\n latch.countDown();\n }\n } else {\n s.append(((char) (response)));\n }\n } \n } catch (IOException ignored) {\n }\n }\n });\n t.start();\n String in = \"MSH|^~\\\\&|MYSENDER|MYRECEIVER|MYAPPLICATION||200612211200||QRY^A19|X%dX|P|2.4\\r\" + \"QRD|200612211200|R|I|GetPatient|||1^RD|0101701234|DEM||\";\n for (int i = 0; i < messageCount; i++) {\n String msg = String.format(in, i);\n outputStream.write(11);\n outputStream.flush();\n // Some systems send end bytes in a separate frame\n // Thread.sleep(10);\n outputStream.write(msg.getBytes());\n outputStream.flush();\n // Some systems send end bytes in a separate frame\n // Thread.sleep(10);\n outputStream.write(28);\n outputStream.write(13);\n outputStream.flush();\n // Potentially wait after message\n // Thread.sleep(10);\n }\n boolean success = latch.await(20, TimeUnit.SECONDS);\n outputStream.close();\n inputStream.close();\n socket.close();\n assertTrue(success);\n }", "@SmallTest\n @Test\n public void testSendMessages() {\n ArraySet<Communicator.Message> messages = new ArraySet<>();\n messages.add(mParams.commMessage);\n\n mRtpTransport.sendMessages(messages);\n verify(mRtpAdapter).sendRtpHeaderExtensions(mHeaderExtensionCaptor.capture());\n Set<RtpHeaderExtension> extensions = mHeaderExtensionCaptor.getValue();\n assertEquals(1, extensions.size());\n assertTrue(extensions.contains(mParams.extension));\n }", "@Test\n public void serverWritesTrailersWithData() throws Exception {\n peer.setClient(true);\n // Write the mocking script.\n peer.sendFrame().settings(new Settings());\n peer.sendFrame().headers(true, 3, TestUtil.headerEntries(\"client\", \"abc\"));\n peer.acceptFrame();// ACK\n\n peer.acceptFrame();// HEADERS STREAM 3\n\n peer.acceptFrame();// DATA STREAM 3 \"abcde\"\n\n peer.acceptFrame();// HEADERS STREAM 3\n\n peer.play();\n // Play it back.\n Http2Connection connection = connect(peer);\n Http2Stream stream = connection.newStream(TestUtil.headerEntries(\"a\", \"android\"), true);\n stream.enqueueTrailers(Headers.of(\"foo\", \"bar\"));\n BufferedSink sink = Okio.buffer(stream.getSink());\n sink.writeUtf8(\"abcdefghi\");\n sink.close();\n // Verify the peer received what was expected.\n MockHttp2Peer.InFrame headers1 = peer.takeFrame();\n Assert.assertEquals(TYPE_HEADERS, headers1.type);\n MockHttp2Peer.InFrame data1 = peer.takeFrame();\n Assert.assertEquals(TYPE_DATA, data1.type);\n Assert.assertEquals(3, data1.streamId);\n Assert.assertArrayEquals(\"abcdefghi\".getBytes(StandardCharsets.UTF_8), data1.data);\n Assert.assertFalse(data1.inFinished);\n MockHttp2Peer.InFrame headers2 = peer.takeFrame();\n Assert.assertEquals(TYPE_HEADERS, headers2.type);\n Assert.assertTrue(headers2.inFinished);\n }", "@Override\n public void setUp() throws Exception {\n transport = new TFramedTransport(new TSocket(\"123.56.206.195\", 1982));\n\n\n\n TProtocol protocol = new TBinaryProtocol(transport);\n client = new SubjectServ.Client(protocol);\n transport.open();\n }", "@Test\r\n\tpublic void testD() {\r\n\t\t\r\n\t\tObjectHandshake h = new ObjectHandshake();\r\n\t\th.setUuid( UuidTool.getOne() );\r\n\t\t\r\n\t\tRunProtocol run = null;\r\n\t\t\r\n\t\trun = new RunProtocol(h, IHandshake.PARTNER_A);\r\n\t\tassertTrue(run.beginA());\r\n\t\t\r\n\t\trun = new RunProtocol(h, IHandshake.PARTNER_A);\r\n\t\tassertTrue(run.commitA());\r\n\t\t\r\n\t\trun = new RunProtocol(h, IHandshake.PARTNER_B);\r\n\t\tassertTrue(run.beginB());\r\n\t\t\r\n\t\trun = new RunProtocol(h, IHandshake.PARTNER_B);\r\n\t\tassertTrue(run.commitB());\r\n\t\t\r\n\t\tassertEquals(h.getLog(), \"1-1-100-1-1-101-2-2-200-2-2-201-\");\r\n\t}", "@Test\n\tpublic void testSayMessageOnRequest(){\n\t\tSystem.out.println(\"\\nMensajes aleatorios al aparecer el Meesek:\\n\");\n\t\tMrMe.sayMessageOnRequest();\n\t\tMrMe.sayMessageOnRequest();\n\t\tMrMe.sayMessageOnRequest();\n\t}", "@Order(1)\n\t\t@Test\n\t\tpublic void sendMessageInvalidFromAndTo() throws IOException, ParseException {\n\t\t\t boolean response = Requests.createMessageBoolReturn(JSONUtils.createMessageObject(INVALID_USER_ID, INVALID_USER_ID, \"Test message\"));\n\t\t\t assertFalse(response);\n\t\t\t \n\t\t\t \n\t\t}", "public void testSendSimpleMessage() {\n\n resetCounter();\n\n try {\n FixedResolver tr0 = new FixedResolver(\"127.0.0.1\", 54222);\n FixedTransportManager ftm0 = new FixedTransportManager(tr0);\n TestMediaManager tmm0 = new TestMediaManager(ftm0);\n tmm0.setPayloads(getTestPayloads1());\n List<JingleMediaManager> trl0 = new ArrayList<JingleMediaManager>();\n trl0.add(tmm0);\n\n FixedResolver tr1 = new FixedResolver(\"127.0.0.1\", 54567);\n FixedTransportManager ftm1 = new FixedTransportManager(tr1);\n TestMediaManager tmm1 = new TestMediaManager(ftm1);\n tmm1.setPayloads(getTestPayloads1());\n List<JingleMediaManager> trl1 = new ArrayList<JingleMediaManager>();\n trl1.add(tmm1);\n\n JingleManager man0 = new JingleManager(getConnection(0), trl0);\n JingleManager man1 = new JingleManager(getConnection(1), trl1);\n\n // Session 1 waits for connections\n man1.addJingleSessionRequestListener(new JingleSessionRequestListener() {\n /**\n * Called when a new session request is detected\n */\n public void sessionRequested(final JingleSessionRequest request) {\n incCounter();\n System.out.println(\"Session request detected, from \" + request.getFrom());\n }\n });\n\n // Session 0 starts a request\n System.out.println(\"Starting session request, to \" + getFullJID(1) + \"...\");\n JingleSession session0 = man0.createOutgoingJingleSession(getFullJID(1));\n session0.startOutgoing();\n\n Thread.sleep(5000);\n\n assertTrue(valCounter() > 0);\n\n } catch (Exception e) {\n e.printStackTrace();\n fail(\"An error occured with Jingle\");\n }\n }", "public void testMmsSend() throws Exception {\n final String testName = \"test_mms_send\";\n final String message = \"[\" + testName + \"] \";\n int mSendCnt = 0;\n int mReceiveCnt = 0;\n int failCount = 0;\n // parameter index\n final int testCountIndex = 0;\n final int sim1NumberIndex = 1;\n final int sim2NumberIndex = 2;\n final int testMessageIndex = 3;\n final int subJectTextIndex = 4;\n final int attachFileIndex = 5;\n final String parameters[] = {\"test_count\", \"sim1_number\", \"sim2_number\", \"text_message\",\n \"subject_text\", \"attach_file\"};\n // create HashMap to handle parameter string\n Map<String, String> params = new HashMap<String, String>();\n getConfigParameters(parameters, params, testName);\n int testCount = Integer.parseInt(params.get(parameters[testCountIndex]));\n assertTrue(message + \"sim1_number is null\",\n params.get(parameters[sim1NumberIndex]) != null);\n String sim1Number = params.get(parameters[sim1NumberIndex]);\n assertTrue(message + \" sim2Number not null \", sim1Number != null);\n assertTrue(message + \"textMessage is null\",\n params.get(parameters[sim2NumberIndex]) != null);\n String sim2Number = params.get(parameters[sim2NumberIndex]);\n assertTrue(message + \" sim2_number not null \", sim2Number != null);\n assertTrue(message + \"text_message is null\",\n params.get(parameters[testMessageIndex]) != null);\n String textMessage = params.get(parameters[testMessageIndex]);\n assertTrue(message + \" text_message not null \", textMessage != null);\n assertTrue(message + \"subject_text is null\",\n params.get(parameters[subJectTextIndex]) != null);\n String subjectText = params.get(parameters[subJectTextIndex]);\n assertTrue(message + \" subject_text not null \", subjectText != null);\n assertTrue(message + \"attach_file is null\",\n params.get(parameters[attachFileIndex]) != null);\n String attachFile = params.get(parameters[attachFileIndex]);\n assertTrue(message + \" attach_file not null \", attachFile != null);\n // test start\n Log.v(TAG, message + \"test start\");\n for (int i = 0; i < testCount; i++) {\n // Send mms from sim1 to sim2\n Log.i(TAG, \"Send mms from sim1 to sim2\");\n mSendCnt = getCnt(Uri.parse(MMS_SEND_TABLE_URI));\n mReceiveCnt = getCnt(Uri.parse(MMS_INBOX_TABLE_URI));\n sendMMS(sim2Number, subjectText, textMessage, attachFile, 1);\n if (!isSuccessfully(mSendCnt, Uri.parse(MMS_SEND_TABLE_URI))) {\n Log.i(TAG, \"Can not send message from sim1 to sim2\");\n failCount++;\n }\n if (!isSuccessfully(mReceiveCnt, Uri.parse(MMS_INBOX_TABLE_URI))) {\n Log.i(TAG, \"Can not receive message from sim1 to sim2\");\n failCount++;\n }\n SystemClock.sleep(5000);\n Log.i(TAG, \"Send mms from sim2 to sim1\");\n mSendCnt = getCnt(Uri.parse(MMS_SEND_TABLE_URI));\n mReceiveCnt = getCnt(Uri.parse(MMS_INBOX_TABLE_URI));\n sendMMS(sim1Number, subjectText, textMessage, attachFile, 2);\n if (!isSuccessfully(mSendCnt, Uri.parse(MMS_SEND_TABLE_URI))) {\n Log.i(TAG, \"Can not send message from sim2 to sim1\");\n failCount++;\n }\n if (!isSuccessfully(mReceiveCnt, Uri.parse(MMS_INBOX_TABLE_URI))) {\n Log.i(TAG, \"Can not receive message from sim2 to sim1\");\n failCount++;\n }\n assertTrue(\"Send and Receive message failed\", failCount == 0);\n }\n Log.v(TAG, message + \"test end\");\n assertTrue(testName, true);\n }", "@Test\n public void testMarketOrder() throws InterruptedException {\n setUp();\n testMatchingEngine.start();\n\n NewOrder nosB1 = createLimitOrder(\"BUY1\", Side.BUY, 100, 100.1, System.currentTimeMillis());\n clientSession.sendNewOrder(nosB1);\n NewOrder nosB2 = createLimitOrder(\"BUY2\", Side.BUY, 200, 99.99, System.currentTimeMillis());\n clientSession.sendNewOrder(nosB2);\n NewOrder nosB3 = createLimitOrder(\"BUY3\", Side.BUY, 300, 99.79, System.currentTimeMillis());\n clientSession.sendNewOrder(nosB3);\n\n // Sell Order with Qty=150 and Market Order\n NewOrder nosS1 = createMarketOrder(\"SELL1\", Side.SELL, 700, System.currentTimeMillis());\n clientSession.sendNewOrder(nosS1);\n\n List<Event> msg = clientSession.getMessagesInQueue();\n assertEquals(7, msg.size());\n\n Trade t = ( Trade) msg.get(0);\n assertEquals( t.getLastTradedPrice().value() , new Price(100.1).value() );\n assertEquals( t.getLastTradedQty() , 100 );\n t = ( Trade) msg.get(1);\n assertEquals( t.getLastTradedPrice().value() , new Price(100.1).value() );\n assertEquals( t.getLastTradedQty() , 100 );\n t = ( Trade) msg.get(2);\n assertEquals( t.getLastTradedPrice().value() , new Price(99.99).value() );\n assertEquals( t.getLastTradedQty() , 200 );\n t = ( Trade) msg.get(3);\n assertEquals( t.getLastTradedPrice().value() , new Price(99.99).value() );\n assertEquals( t.getLastTradedQty() , 200 );\n t = ( Trade) msg.get(4);\n assertEquals( t.getLastTradedPrice().value() , new Price(99.79).value() );\n assertEquals( t.getLastTradedQty() , 300 );\n t = ( Trade) msg.get(5);\n assertEquals( t.getLastTradedPrice().value() , new Price(99.79).value() );\n assertEquals( t.getLastTradedQty() , 300 );\n Canceled t1 = ( Canceled) msg.get(6);\n assertEquals( t1.getCanceledQty() , 100 );\n }", "@Test \n public void testRouteSuccessful() throws Exception {\n // 1. Arrange.. get the mock endpoint and set an assertion\n MockEndpoint mockOutput = getMockEndpoint(\"mock:output\");\n mockOutput.expectedMessageCount(1);\n\n // 2. Act.. send a message to the start component\n \tString jsonInput= \"{\\\"name\\\": \\\"Sunrise\\\",\\\"quantity\\\": 2}\";\n template.sendBody(\"direct:remote\", jsonInput);\n\n // 3. Assert.. verify that the mock component received 1 message\n assertMockEndpointsSatisfied();\n }", "@Test\n public void UserCanWriteAndSendAMessage() {\n proLogin(proWait);\n handler.getDriver(\"user\").navigate().refresh();\n // User to queue\n waitAndFillInformation(userWait);\n // User from queue\n\n waitAndPickFromQueue(proWait);\n\n // User can write message\n waitChatWindowsAppear(userWait).sendKeys(\"yy kaa koo\");\n\n // Can send it By Pressing Submit\n waitElementPresent(userWait, By.name(\"send\")).submit();\n assertEquals(\"\", waitChatWindowsAppear(userWait).getText());\n assertTrue(waitForTextToAppear(userWait, \"yy kaa koo\"));\n\n // Can send it By Pressing Enter\n waitChatWindowsAppear(userWait).sendKeys(\"kaa koo yy\");\n waitChatWindowsAppear(userWait).sendKeys(Keys.ENTER);\n\n assertEquals(\"\", waitChatWindowsAppear(userWait).getText());\n assertTrue(waitForTextToAppear(userWait, \"kaa koo yy\"));\n endConversationPro(proWait);\n }", "@Test\n public void testClient(){\n received=false;\n uut=new ChatMessageRequest(\"test\",\"test2\",\"test\",MessageTypes.MATCH);\n uut.clientHandle(null,new TestUtilizer());\n assertTrue(received);\n }", "@Test\n\tpublic void testSendingMessages() throws IOException, InvalidHeaderException, InterruptedException, ExecutionException {\n\t\tfinal String[] messages = { \"Hello world!\", \"Hello world! Prepare to die edition...\", \n\t\t\t\t\"This is bound to fail\" };\n\t\tfinal byte[] priorities = { 5, 9, 1 };\n\t\tfinal int[] contexts = { 0, 1, 2 };\n\t\tfinal String[] receivers = { null, \"mary\", \"mallot\" };\n\t\tfinal String[][] queues = new String[][] { \n\t\t\t\t{\"queue 1\", \"queue 2\", \"queue 3\", \"queue 4\" },\n\t\t\t\t{\"queue 5\"},\n\t\t\t\t{\"queue 6\", \"queue 7\" }\t\t\t\n\t\t};\n\t\t\n\t\tFuture<Boolean> result = service.submit(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\tassertTrue(client.SendMessage(messages[0], priorities[0], contexts[0], \n\t\t\t\t\t\tqueues[0]));\n\t\t\t\tassertTrue(client.SendMessage(messages[1], priorities[1], contexts[1], \n\t\t\t\t\t\treceivers[1], queues[1]));\n\t\t\t\tassertFalse(client.SendMessage(messages[2], priorities[2], contexts[2], \n\t\t\t\t\t\treceivers[2], queues[2]));\n\t\t\t\t} catch (Exception e) { fail(\"Exceptions should not be thrown.\"); }\n\t\t\t}\n\t\t}, Boolean.TRUE);\n\t\t\n\t\t// Get the send message request request\n\t\tSendMessageRequest request = (SendMessageRequest) this.getMessage(channel);\n\t\tassertEquals(messages[0], request.getMessage());\n\t\tassertEquals(priorities[0], request.getPriority());\n\t\tassertEquals(false, request.hasReceiver());\n\t\tList<String> queuesList = (List<String>) request.getQueueList();\n\t\tassertEquals(queues[0].length, queuesList.size());\n\t\tfor (int i = 0; i < queuesList.size(); i++ ) assertEquals(queues[0][i], queuesList.get(i));\n\t\t\n\t\tthis.sendMessage(new RequestResponse(Status.SUCCESS), channel);\n\t\t\n\t\t// Get the send message request request\n\t\trequest = (SendMessageRequest) this.getMessage(channel);\n\t\tassertEquals(messages[1], request.getMessage());\n\t\tassertEquals(priorities[1], request.getPriority());\n\t\tassertEquals(receivers[1], request.getReceiver());\n\t\tqueuesList = (List<String>) request.getQueueList();\n\t\tassertEquals(queues[1].length, queuesList.size());\n\t\tfor (int i = 0; i < queuesList.size(); i++ ) assertEquals(queues[1][i], queuesList.get(i));\n\t\t\n\t\tthis.sendMessage(new RequestResponse(Status.SUCCESS), channel);\n\t\t\n\t\t// Get the send message request request\n\t\trequest = (SendMessageRequest) this.getMessage(channel);\n\t\tassertEquals(messages[2], request.getMessage());\n\t\tassertEquals(priorities[2], request.getPriority());\n\t\tassertEquals(receivers[2], request.getReceiver());\n\t\tqueuesList = (List<String>) request.getQueueList();\n\t\tassertEquals(queues[2].length, queuesList.size());\n\t\tfor (int i = 0; i < queuesList.size(); i++ ) assertEquals(queues[2][i], queuesList.get(i));\n\n\t\tthis.sendMessage(new RequestResponse(Status.NO_CLIENT), channel);\n\t\t\n\t\tresult.get();\n\t}", "@Test\n public void testFileComponent() throws InterruptedException {\n fileComponent.expectedMessageCount(0);\n //fileComponent.expectedBodiesReceived(TRANSFORMED_MSG);\n\n dstartProducer.sendBody(MESSAGE);\n\n fileComponent.assertIsSatisfied();\n }", "public void testDispatchTypes() {\n startActivity();\n \n Log.v(TAG,\"testDispatchTypes\");\n SystemDispatcher.Listener listener = new SystemDispatcher.Listener() {\n\n public void onDispatched(String type , Map message) {\n Log.v(TAG,\"testDispatchTypes - received: \" + type);\n\n if (!type.equals(\"Automater::response\")) {\n return;\n }\n\n Payload payload = new Payload();\n payload.name = type;\n payload.message = message;\n\n lastPayload = payload;\n }\n };\n\n SystemDispatcher.addListener(listener);\n\n Map message = new HashMap();\n message.put(\"field1\",\"value1\");\n message.put(\"field2\",10);\n message.put(\"field3\",true);\n message.put(\"field4\",false);\n \n List field5 = new ArrayList(3);\n field5.add(23);\n field5.add(true);\n field5.add(\"stringValue\");\n message.put(\"field5\",field5);\n field5 = new ArrayList(10);\n\n Map field6 = new HashMap();\n field6.put(\"sfield1\", \"value1\");\n field6.put(\"sfield2\", 10);\n field6.put(\"sfield3\", true);\n field6.put(\"sfield4\", false);\n message.put(\"field6\", field6);\n \n assertTrue(lastPayload == null);\n\n SystemDispatcher.dispatch(\"Automater::echo\",message);\n sleep(500);\n\n assertTrue(lastPayload != null);\n assertTrue(lastPayload.message.containsKey(\"field1\"));\n assertTrue(lastPayload.message.containsKey(\"field2\"));\n assertTrue(lastPayload.message.containsKey(\"field3\"));\n assertTrue(lastPayload.message.containsKey(\"field4\"));\n assertTrue(lastPayload.message.containsKey(\"field5\"));\n assertTrue(lastPayload.message.containsKey(\"field6\"));\n\n String field1 = (String) lastPayload.message.get(\"field1\");\n assertTrue(field1.equals(\"value1\"));\n\n int field2 = (int) (Integer) lastPayload.message.get(\"field2\");\n assertEquals(field2,10);\n\n boolean field3 = (boolean)(Boolean) lastPayload.message.get(\"field3\");\n assertEquals(field3,true);\n\n boolean field4 = (boolean)(Boolean) lastPayload.message.get(\"field4\");\n assertEquals(field4,false);\n \n List list = (List) lastPayload.message.get(\"field5\");\n assertEquals(list.size(),3);\n assertEquals(list.get(0), 23);\n assertEquals(list.get(1), true);\n assertTrue((((String) list.get(2)).equals(\"stringValue\")));\n\n Map map = (Map) lastPayload.message.get(\"field6\");\n assertTrue(map.containsKey(\"sfield1\"));\n assertTrue(((String) map.get(\"sfield1\")).equals(\"value1\"));\n assertTrue(map.containsKey(\"sfield2\"));\n assertEquals(map.get(\"sfield2\"), 10);\n assertTrue(map.containsKey(\"sfield3\"));\n assertTrue(map.containsKey(\"sfield4\"));\n \n SystemDispatcher.removeListener(listener);\n }", "@Test\n public void testFinalMessage() throws JAXBException, CamelExecutionException, IOException, InterruptedException {\n startEndpoint.sendBodyAndHeader(fileToString(getClass(), INPUT_MESSAGE_A), \"supplierId\", \"1\");\n mockA.setExpectedMessageCount(1);\n mockB.setExpectedMessageCount(0);\n mockC.setExpectedMessageCount(0);\n mockA.assertIsSatisfied();\n }", "private <T extends QMessage> void sendTestMsg(T msg) {\n\n\t\ttry {\n\t\t\tString token = KeycloakUtils.getAccessToken(\"http://keycloak.genny.life\", \"genny\", \"genny\",\n\t\t\t\t\t\"056b73c1-7078-411d-80ec-87d41c55c3b4\", \"user1\", \"password1\");\n\t\t\tmsg.setToken(token);\n\n\t\t\t/* get the bridge url to publish the message to webcmd channel */\n\t\t\tString bridgetUrl = ENV_GENNY_BRIDGE_URL + \"/api/service?channel=webdata\";\n\n\t\t\tQwandaUtils.apiPostEntity(bridgetUrl, JsonUtils.toJson(msg), token);\n\n\t\t} catch (IOException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\n\t}", "@Test\r\n\tpublic void testC() {\r\n\t\t\r\n\t\tObjectHandshake h = new ObjectHandshake();\r\n\t\th.setUuid( UuidTool.getOne() );\r\n\t\t\r\n\t\tRunProtocol run = null;\r\n\t\t\r\n\t\trun = new RunProtocol(h, IHandshake.PARTNER_A, 100, 200, true, true);\r\n\t\tassertTrue(run.beginA());\r\n\t\t\r\n\t\trun = new RunProtocol(h, IHandshake.PARTNER_B, 100, 200, true, true);\r\n\t\tassertTrue(run.commitA());\r\n\t\t\r\n\t\trun = new RunProtocol(h, IHandshake.PARTNER_B, 100, 200, true, true);\r\n\t\tassertTrue(run.beginB());\r\n\t\t\r\n\t\trun = new RunProtocol(h, IHandshake.PARTNER_A, 100, 200, true, true);\r\n\t\tassertTrue(run.commitB());\r\n\t\t\r\n\t\tassertEquals(h.getLog(), \"1-1-100-2-1-101-2-2-200-1-2-201-\");\r\n\t}", "@Test\n public void serverPingsClientHttp2() throws Exception {\n peer.sendFrame().settings(new Settings());\n peer.acceptFrame();// ACK\n\n peer.sendFrame().ping(false, 2, 3);\n peer.acceptFrame();// PING\n\n peer.play();\n // play it back\n connect(peer);\n // verify the peer received what was expected\n MockHttp2Peer.InFrame ping = peer.takeFrame();\n Assert.assertEquals(TYPE_PING, ping.type);\n Assert.assertEquals(0, ping.streamId);\n Assert.assertEquals(2, ping.payload1);\n Assert.assertEquals(3, ping.payload2);\n Assert.assertTrue(ping.ack);\n }", "@Test\r\n public void simpleFlowAndJMX() throws Exception {\r\n ModuleURN instanceURN = new ModuleURN(PROVIDER_URN, \"mymodule\");\r\n //Set up the data\r\n Object []requestParm = {BigDecimal.ONE, 2, \"three\"};\r\n CopierModule.SynchronousRequest req =\r\n new CopierModule.SynchronousRequest(requestParm);\r\n req.semaphore.acquire();\r\n //Set up the sink listener\r\n BlockingSinkDataListener listener = new BlockingSinkDataListener();\r\n mManager.addSinkListener(listener);\r\n //Create the data flow.\r\n DataFlowID flowID = mManager.createDataFlow(new DataRequest[]{\r\n new DataRequest(CopierModuleFactory.INSTANCE_URN,\r\n req),\r\n new DataRequest(instanceURN, null)\r\n });\r\n //wait for the data to be emitted.\r\n req.semaphore.acquire();\r\n //wait for the data to be received\r\n for(Object o: requestParm) {\r\n assertEquals(o, listener.getNextData());\r\n }\r\n //verify the flow info\r\n DataFlowInfo flowInfo = mManager.getDataFlowInfo(flowID);\r\n assertFlowInfo(flowInfo, flowID, 3, true, false, null, null);\r\n //verify the last 2 flow steps\r\n assertFlowStep(flowInfo.getFlowSteps()[1], instanceURN, true, 3, 0,\r\n null, true, 3, 0, null, instanceURN, null);\r\n assertFlowStep(flowInfo.getFlowSteps()[2],\r\n SinkModuleFactory.INSTANCE_URN, false, 0, 0, null, true, 3, 0,\r\n null, SinkModuleFactory.INSTANCE_URN, null);\r\n //verify the module info to double check that it's auto-created.\r\n assertModuleInfo(mManager, instanceURN, ModuleState.STARTED, null,\r\n new DataFlowID[]{flowID}, true, true, true, true, false);\r\n //verify JMX MXBean Info\r\n final ObjectName on = instanceURN.toObjectName();\r\n final MBeanServer beanServer = getMBeanServer();\r\n assertTrue(beanServer.isRegistered(on));\r\n MBeanInfo beanInfo = beanServer.getMBeanInfo(on);\r\n assertEquals(SimpleAsyncProcessor.class.getName(), beanInfo.getClassName());\r\n assertEquals(Messages.JMX_MXBEAN_DESCRIPTION.getText(), beanInfo.getDescription());\r\n assertEquals(0, beanInfo.getOperations().length);\r\n assertEquals(0, beanInfo.getConstructors().length);\r\n assertEquals(0, beanInfo.getNotifications().length);\r\n assertEquals(0, beanInfo.getDescriptor().getFieldNames().length);\r\n MBeanAttributeInfo[] attributeInfos = beanInfo.getAttributes();\r\n assertEquals(1, attributeInfos.length);\r\n final String validAttribute = SimpleAsyncProcessor.ATTRIB_PREFIX + flowID;\r\n assertEquals(validAttribute, attributeInfos[0].getName());\r\n assertEquals(Integer.class.getName(), attributeInfos[0].getType());\r\n assertEquals(Messages.JMX_ATTRIBUTE_FLOW_CNT_DESCRIPTION.getText(flowID), attributeInfos[0].getDescription());\r\n assertEquals(0, attributeInfos[0].getDescriptor().getFieldNames().length);\r\n assertFalse(attributeInfos[0].isIs());\r\n assertFalse(attributeInfos[0].isWritable());\r\n assertTrue(attributeInfos[0].isReadable());\r\n \r\n //verify Attributes\r\n Object value = beanServer.getAttribute(on, SimpleAsyncProcessor.ATTRIB_PREFIX + flowID);\r\n assertEquals((Integer)0, (Integer)value);\r\n final String invalidAttribute = SimpleAsyncProcessor.ATTRIB_PREFIX + 1;\r\n new ExpectedFailure<AttributeNotFoundException>(invalidAttribute){\r\n @Override\r\n protected void run() throws Exception {\r\n beanServer.getAttribute(on, invalidAttribute);\r\n }\r\n };\r\n new ExpectedFailure<AttributeNotFoundException>(\"blah\"){\r\n @Override\r\n protected void run() throws Exception {\r\n beanServer.getAttribute(on, \"blah\");\r\n }\r\n };\r\n AttributeList attribList = beanServer.getAttributes(on,\r\n new String[]{validAttribute, invalidAttribute});\r\n assertEquals(1, attribList.size());\r\n assertEquals(new Attribute(validAttribute, 0), attribList.get(0));\r\n new ExpectedFailure<AttributeNotFoundException>(){\r\n @Override\r\n protected void run() throws Exception {\r\n beanServer.setAttribute(on, new Attribute(validAttribute, 34));\r\n }\r\n };\r\n new ExpectedFailure<AttributeNotFoundException>(){\r\n @Override\r\n protected void run() throws Exception {\r\n beanServer.setAttribute(on, new Attribute(invalidAttribute, 34));\r\n }\r\n };\r\n AttributeList list = new AttributeList(Arrays.asList(\r\n new Attribute(validAttribute, 12),\r\n new Attribute(invalidAttribute, 13)\r\n ));\r\n assertEquals(0, beanServer.setAttributes(on, list).size());\r\n //verify no operations can be performed\r\n ReflectionException excpt = new ExpectedFailure<ReflectionException>() {\r\n @Override\r\n protected void run() throws Exception {\r\n beanServer.invoke(on, \"getQueueSizes\", null, null);\r\n }\r\n }.getException();\r\n assertTrue(excpt.toString(), excpt.getCause() instanceof NoSuchMethodException);\r\n\r\n //stop the flow\r\n mManager.cancel(flowID);\r\n //verify that the module is deleted.\r\n List<ModuleURN> instances = mManager.getModuleInstances(PROVIDER_URN);\r\n assertTrue(instances.toString(), instances.isEmpty());\r\n //remove the listener\r\n mManager.removeSinkListener(listener);\r\n }", "@Test\n public void peerSetsZeroFlowControl() throws Exception {\n peer.setClient(true);\n // Write the mocking script.\n peer.sendFrame().settings(new Settings().set(Settings.INITIAL_WINDOW_SIZE, 0));\n peer.acceptFrame();// ACK\n\n peer.sendFrame().windowUpdate(0, 10);// Increase the connection window size.\n\n peer.acceptFrame();// PING\n\n peer.sendFrame().ping(true, 1, 0);\n peer.acceptFrame();// HEADERS STREAM 3\n\n peer.sendFrame().windowUpdate(3, 5);\n peer.acceptFrame();// DATA STREAM 3 \"abcde\"\n\n peer.sendFrame().windowUpdate(3, 5);\n peer.acceptFrame();// DATA STREAM 3 \"fghi\"\n\n peer.play();\n // Play it back.\n Http2Connection connection = connect(peer);\n connection.writePingAndAwaitPong();// Ensure the SETTINGS have been received.\n\n Http2Stream stream = connection.newStream(TestUtil.headerEntries(\"a\", \"android\"), true);\n BufferedSink sink = Okio.buffer(stream.getSink());\n sink.writeUtf8(\"abcdefghi\");\n sink.flush();\n // Verify the peer received what was expected.\n peer.takeFrame();// PING\n\n MockHttp2Peer.InFrame headers = peer.takeFrame();\n Assert.assertEquals(TYPE_HEADERS, headers.type);\n MockHttp2Peer.InFrame data1 = peer.takeFrame();\n Assert.assertEquals(TYPE_DATA, data1.type);\n Assert.assertEquals(3, data1.streamId);\n Assert.assertArrayEquals(\"abcde\".getBytes(StandardCharsets.UTF_8), data1.data);\n MockHttp2Peer.InFrame data2 = peer.takeFrame();\n Assert.assertEquals(TYPE_DATA, data2.type);\n Assert.assertEquals(3, data2.streamId);\n Assert.assertArrayEquals(\"fghi\".getBytes(StandardCharsets.UTF_8), data2.data);\n }", "@Test\n\tpublic void testFastHaveNoneMessage() throws Exception {\n\n\t\t// Given\n\t\tfinal PieceDatabase pieceDatabase = MockPieceDatabase.create (\"00000\", 16384);\n\t\tpieceDatabase.start (true);\n\t\tPeerServices peerServices = mock (PeerServices.class);\n\t\tPeerSetContext peerSetContext = new PeerSetContext (peerServices, pieceDatabase, mock (RequestManager.class), null);\n\t\twhen(peerSetContext.requestManager.piecesAvailable (any (ManageablePeer.class))).thenReturn (true);\n\t\tMockConnection mockConnection = new MockConnection();\n\t\tPeerHandler handler = new PeerHandler (peerSetContext, mockConnection, new PeerID(), new PeerStatistics(), true, false);\n\n\t\t// When\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveNoneMessage());\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.haveNoneMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (0));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (1));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (2));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (3));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (4));\n\t\tmockConnection.mockExpectNoMoreOutput();\n\t\tassertTrue (mockConnection.isOpen());\n\t\tassertEquals (0, handler.getRemoteBitField().cardinality());\n\n\n\t\tpieceDatabase.terminate (true);\n\n\t}", "@Test\n public void canCreateWithPayload() {\n // Act\n final EventData eventData = new EventData(PAYLOAD_BYTES);\n\n // Assert\n Assertions.assertNotNull(eventData.getBody());\n Assertions.assertEquals(PAYLOAD, new String(eventData.getBody(), UTF_8));\n }", "@Test\n\tpublic void testFastAllowedFastMessage() throws Exception {\n\n\t\t// Given\n\t\tfinal PieceDatabase pieceDatabase = MockPieceDatabase.create (\"00000\", 16384);\n\t\tpieceDatabase.start (true);\n\t\tfinal BlockDescriptor requestDescriptor = new BlockDescriptor (2, 0, 16384);\n\t\tPeerServices peerServices = mock (PeerServices.class);\n\t\tPeerSetContext peerSetContext = new PeerSetContext (peerServices, pieceDatabase, mock (RequestManager.class), null);\n\t\twhen(peerSetContext.requestManager.piecesAvailable (any (ManageablePeer.class))).thenReturn (true);\n\t\twhen(peerSetContext.requestManager.allocateRequests (any (ManageablePeer.class), anyInt(), eq (true)))\n\t\t\t\t.thenReturn (Arrays.asList (new BlockDescriptor[] { requestDescriptor }))\n\t\t\t\t.thenReturn (new ArrayList<BlockDescriptor>());\n\t\tMockConnection mockConnection = new MockConnection();\n\t\tPeerHandler handler = new PeerHandler (peerSetContext, mockConnection, new PeerID(), new PeerStatistics(), true, false);\n\n\t\t// When\n\t\t// They send an Allowed Fast message, allowing us to make a request while choked\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveAllMessage());\n\t\tmockConnection.mockInput (PeerProtocolBuilder.allowedFastMessage (2));\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.haveNoneMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.interestedMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.requestMessage (requestDescriptor));\n\t\tmockConnection.mockExpectNoMoreOutput();\n\t\tverify(peerSetContext.requestManager).pieceAllowedFast (handler, 2);\n\t\tassertTrue (mockConnection.isOpen());\n\n\n\t\tpieceDatabase.terminate (true);\n\n\t}", "@Test\r\n\tpublic void testG() {\r\n\t\t\r\n\t\tObjectHandshake h = new ObjectHandshake();\r\n\t\th.setUuid( UuidTool.getOne() );\r\n\t\t\r\n\t\tRunProtocol run = null;\r\n\t\t\r\n\t\trun = new RunProtocol(h, IHandshake.PARTNER_A);\r\n\t\tassertTrue(run.beginA());\r\n\t\t\r\n\t\trun = new RunProtocol(h, IHandshake.PARTNER_A);\r\n\t\tassertTrue(run.commitA());\r\n\t\t\r\n\t\trun.reset();\r\n\t\t\r\n\t\trun = new RunProtocol(h, IHandshake.PARTNER_B);\r\n\t\tassertFalse(run.beginB());\r\n\t\t\r\n\t\trun = new RunProtocol(h, IHandshake.PARTNER_B);\r\n\t\tassertFalse(run.commitB());\r\n\t\t\r\n\t\t//analyze the reset\r\n\t\tLogAnalyzer aly = run.getCurrentAnalyzer();\r\n\t\t//The value, the reset occurs\r\n\t\tassertEquals( 200, aly.getCurrentPartValue() );\r\n\t\t//The part is not available\r\n\t\tassertEquals( LogAnalyzer.THE_PART_IS_NOT_KNOWN, aly.getPart() );\r\n\t\t\r\n\t\tassertFalse( aly.isAfterPart0() );\r\n\t\tassertFalse( aly.isAfterPart1() );\r\n\t\t//The parts 0 and 1 run properly\r\n\t\tassertTrue( aly.isAfterPart2() );\r\n\t\t//The part 3 is not reached, because of the reset\r\n\t\tassertFalse( aly.isAfterPart3() );\r\n\t\t\r\n\t\t//There is no part\r\n\t\tassertFalse( aly.isPart1() );\r\n\t\tassertFalse( aly.isPart2() );\r\n\t\tassertFalse( aly.isPart3() );\r\n\t\tassertFalse( aly.isPart4() );\r\n\t\t\r\n\t\t//There are 3 entries in the list.\r\n\t\tassertEquals( 3, aly.getList().size() );\r\n\t\t//The last entry has the RST_FLAG set\r\n\t\tassertEquals( IHandshake.RST_FLAG, aly.getCurrentPartType() );\r\n\t\t\r\n\t\tassertEquals(h.getLog(), \"1-1-100-1-1-101-1-4-200-\");\r\n\t}", "public void testGetMessageSuccess() {\r\n assertNotNull(\"setup fails\", uploadRequestValidator);\r\n ResponseMessage responseMessage = new ResponseMessage(HANDLE_ID, REQUEST_ID);\r\n assertEquals(\"invalid return message\", \"the object is not type of RequestMessage\", uploadRequestValidator\r\n .getMessage(responseMessage));\r\n RequestMessage requestMessage = new RequestMessage(HANDLE_ID, REQUEST_ID);\r\n assertEquals(\"invalid return message\", \"the RequestMesage's type not equal with MessageType.CHECK_UPLOAD_FILE\",\r\n uploadRequestValidator.getMessage(requestMessage));\r\n Object[] args = new Object[2];\r\n args[0] = \"FILEID\";\r\n args[1] = new Long(Long.MAX_VALUE);\r\n requestMessage = new RequestMessage(HANDLE_ID, REQUEST_ID, MessageType.CHECK_UPLOAD_FILE, args);\r\n assertEquals(\"not enough diskspace, should return File size exceeds disk size message string\",\r\n \"File size exceeds disk size\", uploadRequestValidator.getMessage(requestMessage));\r\n args = new Object[2];\r\n args[0] = \"FILEID\";\r\n args[1] = new Long(1);\r\n requestMessage = new RequestMessage(HANDLE_ID, REQUEST_ID, MessageType.CHECK_UPLOAD_FILE, args);\r\n assertNull(\"there is enough diskspace, should return null\", uploadRequestValidator.getMessage(requestMessage));\r\n }", "public static void testIBMMQSendData(){\n\n MQParam param = new MQParam();\n param.setHost(\"10.86.92.194\");\n param.setPort(30099);\n param.setCcsid(1208);\n param.setChannel(\"SVRCONN_GW_OUT\");\n param.setQueueManager(\"ESB_OUT\");\n param.setQueueName(\"EIS.QUEUE.REQUEST.OUT.GCDCHZWMES\");\n param.setUserId(\"mqm\");\n param.setPassword(\"mqm\");\n new Thread(new IBMReceiverThread(param)).run();\n }", "@Test\n public void testSendMessage()\n {\n System.out.println(\"sendMessage\");\n Account sender = new Account(\"Henk\");\n String message = \"Test\";\n Party instance = new Party(sender);\n boolean expResult = true;\n boolean result = instance.sendMessage(sender, message);\n assertEquals(\"The message gave a 'not send' answer.\", expResult, result);\n ArrayList<Message> chat = instance.getChat();\n boolean result2 = false;\n for (Message chatMessage : chat)\n {\n if (chatMessage.getText().equals(message))\n {\n result2 = true;\n break;\n }\n }\n assertEquals(\"The message isn't in the chat.\", expResult, result2);\n }", "@Before\n public void setUp() {\n ofProtocolListener = new OpenflowProtocolListenerFullImpl(connectionAdapter, deviceReplyProcessor);\n connectionAdapter.setMessageListener(ofProtocolListener);\n Mockito.when(connectionAdapter.getRemoteAddress())\n .thenReturn(InetSocketAddress.createUnresolved(\"ofp-junit.example.org\", 6663));\n Mockito.verify(connectionAdapter).setMessageListener(any(OpenflowProtocolListener.class));\n }", "@SmallTest\n @Test\n public void testReceiveMultipleSuccess() {\n testNegotiationSuccess();\n\n // Receive message with typical digit spacing\n mDtmfTransport.onDtmfReceived('A');\n mTestExecutorService.advanceTime(DIGIT_INTERVAL_MILLIS);\n mDtmfTransport.onDtmfReceived('B');\n mTestExecutorService.advanceTime(DIGIT_INTERVAL_MILLIS);\n mDtmfTransport.onDtmfReceived('D');\n mTestExecutorService.advanceTime(DIGIT_INTERVAL_MILLIS);\n mDtmfTransport.onDtmfReceived('C');\n mTestExecutorService.advanceTime(DIGIT_INTERVAL_MILLIS);\n mDtmfTransport.onDtmfReceived('D');\n mTestExecutorService.advanceTime(MSG_TIMEOUT_MILLIS);\n\n verify(mCallback, times(1)).onMessagesReceived(mMessagesCaptor.capture());\n assertEquals(1, mMessagesCaptor.getAllValues().get(0).size());\n assertTrue(mMessagesCaptor.getAllValues().get(0).contains(\n new Communicator.Message(Communicator.MESSAGE_CALL_AUDIO_CODEC,\n Communicator.AUDIO_CODEC_AMR_NB)));\n\n mDtmfTransport.onDtmfReceived('A');\n mTestExecutorService.advanceTime(DIGIT_INTERVAL_MILLIS);\n mDtmfTransport.onDtmfReceived('C');\n mTestExecutorService.advanceTime(DIGIT_INTERVAL_MILLIS);\n mDtmfTransport.onDtmfReceived('D');\n mTestExecutorService.advanceTime(DIGIT_INTERVAL_MILLIS);\n mDtmfTransport.onDtmfReceived('A');\n mTestExecutorService.advanceTime(DIGIT_INTERVAL_MILLIS);\n mDtmfTransport.onDtmfReceived('D');\n mTestExecutorService.advanceTime(DIGIT_INTERVAL_MILLIS);\n\n // Note: Reusing the captor here appends all call arguments on to mMessagesCaptor, so\n // we need to look at index 2 in getAllValues.\n verify(mCallback, times(2)).onMessagesReceived(mMessagesCaptor.capture());\n assertEquals(1, mMessagesCaptor.getAllValues().get(2).size());\n assertTrue(mMessagesCaptor.getAllValues().get(2).contains(\n new Communicator.Message(Communicator.MESSAGE_DEVICE_BATTERY_STATE,\n Communicator.BATTERY_STATE_LOW)));\n }", "@Test\n\tpublic void testFastHandshakePeerIDHaveAll() throws Exception {\n\n\t\t// Given\n\t\tPieceDatabase pieceDatabase = MockPieceDatabase.create (\"1\", 16384);\n\t\tpieceDatabase.start (true);\n\t\tBitField wantedPieces = pieceDatabase.getPresentPieces().not();\n\t\tPeerServices peerServices = mock (PeerServices.class);\n\t\tPeerSetContext peerSetContext = new PeerSetContext (peerServices, pieceDatabase, mock (RequestManager.class), null);\n\t\twhen(peerSetContext.requestManager.piecesAvailable (any (ManageablePeer.class))).thenReturn (false);\n\t\tMockConnection mockConnection = new MockConnection();\n\t\tPeerHandler handler = new PeerHandler (peerSetContext, mockConnection, new PeerID(), new PeerStatistics(), true, false);\n\n\t\t// When\n\t\tmockConnection.mockInput (PeerProtocolBuilder.bitfieldMessage (wantedPieces));\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.haveAllMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (0));\n\t\tmockConnection.mockExpectNoMoreOutput();\n\n\n\t\tpieceDatabase.terminate (true);\n\n\t}", "@Test\n\tpublic void testMessageFromElves() {\n\n\t\tfinal Messenger messenger = new Messenger();\n\t\ttestMessage(\n\t\t\t\tmessenger.messageFromElves(),\n\t\t\t\t\"Much wind pours from your mouth.\"\n\t\t);\n\t}", "@Test\n public final void testAfterSend() throws Exception {\n ChannelController.getInstance().getLocalChannelId(channelId);\n\n final TestChannel channel = new TestChannel();\n\n channel.setChannelId(channelId);\n channel.setServerId(serverId);\n channel.setEnabled(true);\n\n channel.setPreProcessor(new TestPreProcessor());\n channel.setPostProcessor(new TestPostProcessor());\n\n final TestSourceConnector sourceConnector = (TestSourceConnector) TestUtils.createDefaultSourceConnector();\n sourceConnector.setChannel(channel);\n channel.setSourceConnector(sourceConnector);\n channel.setSourceFilterTransformer(TestUtils.createDefaultFilterTransformerExecutor());\n\n final ConnectorProperties connectorProperties = new TestDispatcherProperties();\n ((TestDispatcherProperties) connectorProperties).getQueueConnectorProperties().setQueueEnabled(true);\n ((TestDispatcherProperties) connectorProperties).getQueueConnectorProperties().setSendFirst(true);\n ((TestDispatcherProperties) connectorProperties).getQueueConnectorProperties().setRegenerateTemplate(true);\n\n final DestinationConnector destinationConnector = new TestDispatcher();\n TestUtils.initDefaultDestinationConnector(destinationConnector, connectorProperties);\n destinationConnector.setChannelId(channelId);\n ((TestDispatcher) destinationConnector).setReturnStatus(Status.SENT);\n\n class BlockingTestResponseTransformer extends TestResponseTransformer {\n public volatile boolean waiting = true;\n\n @Override\n public String doTransform(Response response, ConnectorMessage connectorMessage) throws DonkeyException, InterruptedException {\n while (waiting) {\n try {\n Thread.sleep(100);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n return super.doTransform(response, connectorMessage);\n }\n }\n final BlockingTestResponseTransformer responseTransformer = new BlockingTestResponseTransformer();\n \n destinationConnector.setResponseTransformerExecutor(TestUtils.createDefaultResponseTransformerExecutor());\n destinationConnector.getResponseTransformerExecutor().setResponseTransformer(responseTransformer);\n\n DestinationChain chain = new DestinationChain();\n chain.setChannelId(channelId);\n chain.setMetaDataReplacer(sourceConnector.getMetaDataReplacer());\n chain.setMetaDataColumns(channel.getMetaDataColumns());\n chain.addDestination(1, TestUtils.createDefaultFilterTransformerExecutor(), destinationConnector);\n channel.addDestinationChain(chain);\n\n if (ChannelController.getInstance().channelExists(channelId)) {\n ChannelController.getInstance().deleteAllMessages(channelId);\n }\n \n channel.deploy();\n channel.start();\n\n class TempClass {\n public long messageId;\n }\n final TempClass tempClass = new TempClass();\n\n for (int i = 1; i <= TEST_SIZE; i++) {\n responseTransformer.waiting = true;\n\n Thread thread = new Thread() {\n @Override\n public void run() {\n ConnectorMessage sourceMessage = TestUtils.createAndStoreNewMessage(new RawMessage(testMessage), channel.getChannelId(), channel.getServerId()).getConnectorMessages().get(0);\n tempClass.messageId = sourceMessage.getMessageId();\n\n try {\n channel.process(sourceMessage, false);\n } catch (InterruptedException e) {\n throw new AssertionError(e);\n }\n }\n };\n thread.start();\n\n Thread.sleep(100);\n // Assert that the response content was stored\n Connection connection = null;\n PreparedStatement statement = null;\n ResultSet result = null;\n \n try {\n connection = TestUtils.getConnection();\n long localChannelId = ChannelController.getInstance().getLocalChannelId(channelId);\n statement = connection.prepareStatement(\"SELECT * FROM d_mc\" + localChannelId + \" WHERE message_id = ? AND metadata_id = ? AND content_type = ?\");\n statement.setLong(1, tempClass.messageId);\n statement.setInt(2, 1);\n statement.setInt(3, ContentType.SENT.getContentTypeCode());\n result = statement.executeQuery();\n assertTrue(result.next());\n result.close();\n statement.close();\n \n // Assert that the message status was updated to PENDING\n statement = connection.prepareStatement(\"SELECT * FROM d_mm\" + localChannelId + \" WHERE message_id = ? AND id = ? AND status = ?\");\n statement.setLong(1, tempClass.messageId);\n statement.setInt(2, 1);\n statement.setString(3, String.valueOf(Status.PENDING.getStatusCode()));\n result = statement.executeQuery();\n assertTrue(result.next());\n result.close();\n statement.close();\n \n responseTransformer.waiting = false;\n thread.join();\n \n // Assert that the response transformer was run\n assertTrue(responseTransformer.isTransformed());\n \n // Assert that the message status was updated to SENT\n statement = connection.prepareStatement(\"SELECT * FROM d_mm\" + localChannelId + \" WHERE message_id = ? AND id = ? AND status = ?\");\n statement.setLong(1, tempClass.messageId);\n statement.setInt(2, 1);\n statement.setString(3, String.valueOf(Status.SENT.getStatusCode()));\n result = statement.executeQuery();\n assertTrue(result.next());\n result.close();\n statement.close();\n } finally {\n TestUtils.close(result);\n TestUtils.close(statement);\n TestUtils.close(connection);\n }\n }\n\n channel.stop();\n channel.undeploy();\n //ChannelController.getInstance().removeChannel(channel.getChannelId());\n }", "@Test\n public void outgoingWritesAreBatched() throws Exception {\n peer.sendFrame().settings(new Settings());\n peer.acceptFrame();// ACK\n\n peer.acceptFrame();// SYN_STREAM\n\n peer.sendFrame().headers(false, 3, TestUtil.headerEntries(\"a\", \"android\"));\n peer.acceptFrame();// DATA\n\n peer.play();\n // play it back\n Http2Connection connection = connect(peer);\n Http2Stream stream = connection.newStream(TestUtil.headerEntries(\"b\", \"banana\"), true);\n // two outgoing writes\n Sink sink = stream.getSink();\n sink.write(new Buffer().writeUtf8(\"abcde\"), 5);\n sink.write(new Buffer().writeUtf8(\"fghij\"), 5);\n sink.close();\n // verify the peer received one incoming frame\n Assert.assertEquals(TYPE_HEADERS, peer.takeFrame().type);\n MockHttp2Peer.InFrame data = peer.takeFrame();\n Assert.assertEquals(TYPE_DATA, data.type);\n Assert.assertArrayEquals(\"abcdefghij\".getBytes(StandardCharsets.UTF_8), data.data);\n Assert.assertTrue(data.inFinished);\n }", "@Test\r\n\tpublic void oneRejectsData() throws Exception\r\n\t{\r\n\t\tEvenWiser normalWiser = new EvenWiser(WISER_1_PORT, null, false);\r\n\t\tnormalWiser.start();\r\n\t\t\r\n\t\tEvenWiser brokenWiser = new EvenWiser(WISER_2_PORT, null, true);\r\n\t\tbrokenWiser.start();\r\n\t\t\r\n\t\tList<Matcher> matchers = new ArrayList<Matcher>();\r\n\t\tmatchers.add(new CaseMatcher(WISER_1_HOSTPORT, null, \"bob.*@example.com\"));\r\n\t\tmatchers.add(new Matcher(WISER_2_HOSTPORT));\r\n\t\t\r\n\t\tBaton bat = new Baton(matchers, BATON_PORT, null);\r\n\t\tbat.start();\r\n\r\n\t\ttry\r\n\t\t{\r\n\t\t\tSmartClient client = new SmartClient(\"localhost\", BATON_PORT, \"localhost\");\r\n\t\t\tclient.from(\"[email protected]\");\r\n\t\t\tclient.to(\"[email protected]\");\r\n\t\t\tclient.to(\"[email protected]\");\r\n\t\t\tclient.dataStart();\r\n\t\t\tclient.dataWrite(MSG_BODY.getBytes(), MSG_BODY.length());\r\n\t\t\tclient.dataWrite(MSG_BODY.getBytes(), MSG_BODY.length());\r\n\t\t\tclient.dataEnd();\r\n\t\t\t\r\n\t\t\tassert normalWiser.getMessages().size() == 1;\r\n\t\t\tassert brokenWiser.getMessages().size() == 0;\r\n\t\t}\r\n\t\tfinally\r\n\t\t{\r\n\t\t\tbat.stop();\r\n\t\t\tnormalWiser.stop();\r\n\t\t\tbrokenWiser.stop();\r\n\t\t}\r\n\t}", "@Test\r\n\tpublic void test() {\r\n\t\tassertEquals(subscribe.getTopic() , \"room1\");\r\n\t\tassertEquals(subscribe.getTypeMap() , \"Galilei\");\r\n\t\tassertTrue(subscribe.isPossible(server));\r\n\t\tassertTrue(!subscribe2.isPossible(server));\r\n\t}", "public void testInBandBytestreamWithMessageStanzas() throws Exception {\n\n XMPPConnection initiatorConnection = getConnection(0);\n XMPPConnection targetConnection = getConnection(1);\n\n // test data\n Random rand = new Random();\n final byte[] data = new byte[dataSize];\n rand.nextBytes(data);\n final SynchronousQueue<byte[]> queue = new SynchronousQueue<byte[]>();\n\n InBandBytestreamManager targetByteStreamManager = InBandBytestreamManager.getByteStreamManager(targetConnection);\n\n InBandBytestreamListener incomingByteStreamListener = new InBandBytestreamListener() {\n\n public void incomingBytestreamRequest(InBandBytestreamRequest request) {\n InputStream inputStream;\n try {\n inputStream = request.accept().getInputStream();\n byte[] receivedData = new byte[dataSize];\n int totalRead = 0;\n while (totalRead < dataSize) {\n int read = inputStream.read(receivedData, totalRead, dataSize - totalRead);\n totalRead += read;\n }\n queue.put(receivedData);\n }\n catch (Exception e) {\n fail(e.getMessage());\n }\n }\n\n };\n targetByteStreamManager.addIncomingBytestreamListener(incomingByteStreamListener);\n\n InBandBytestreamManager initiatorByteStreamManager = InBandBytestreamManager.getByteStreamManager(initiatorConnection);\n initiatorByteStreamManager.setStanza(StanzaType.MESSAGE);\n\n OutputStream outputStream = initiatorByteStreamManager.establishSession(\n targetConnection.getUser()).getOutputStream();\n\n // verify stream\n outputStream.write(data);\n outputStream.flush();\n outputStream.close();\n\n assertEquals(\"received data not equal to sent data\", data, queue.take());\n\n }", "@Test\n\tpublic void testFastPieceMessageUnrequested() throws Exception {\n\n\t\t// Given\n\t\tfinal PieceDatabase pieceDatabase = MockPieceDatabase.create (\"0\", 16384);\n\t\tpieceDatabase.start (true);\n\t\tPeerServices peerServices = mock (PeerServices.class);\n\t\tPeerSetContext peerSetContext = new PeerSetContext (peerServices, pieceDatabase, mock (RequestManager.class), null);\n\t\twhen(peerSetContext.requestManager.piecesAvailable (any (ManageablePeer.class))).thenReturn (true);\n\t\twhen(peerSetContext.requestManager.allocateRequests (any (ManageablePeer.class), anyInt(), eq (false))).thenReturn (new ArrayList<BlockDescriptor>());\n\t\tMockConnection mockConnection = new MockConnection();\n\t\tPeerHandler handler = new PeerHandler (peerSetContext, mockConnection, new PeerID(), new PeerStatistics(), true, false);\n\t\tBlockDescriptor requestDescriptor = new BlockDescriptor (0, 0, 16384);\n\n\t\t// When\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveAllMessage());\n\t\thandler.connectionReady (mockConnection, true, true);\n\t\tmockConnection.mockInput (PeerProtocolBuilder.pieceMessage (requestDescriptor, ByteBuffer.allocate (16384)));\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.haveNoneMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.interestedMessage());\n\t\tmockConnection.mockExpectNoMoreOutput();\n\t\tverify(peerServices).peerDisconnected (any (ManageablePeer.class));\n\t\tassertFalse (mockConnection.isOpen());\n\n\n\t\tpieceDatabase.terminate (true);\n\n\t}", "@Test\n\tpublic void testFastRequestMessageChokedAllowedFastOverLimit() throws Exception {\n\n\t\t// Given\n\t\tfinal PieceDatabase pieceDatabase = MockPieceDatabase.create (\"111111111111111\", 16384);\n\t\tpieceDatabase.start (true);\n\t\tPeerServices peerServices = mock (PeerServices.class);\n\t\tPeerSetContext peerSetContext = new PeerSetContext (peerServices, pieceDatabase, mock (RequestManager.class), null);\n\t\tMockConnection mockConnection = new MockConnection();\n\t\tPeerHandler handler = new PeerHandler (peerSetContext, mockConnection, new PeerID(), new PeerStatistics(), true, false);\n\t\tBlockDescriptor request = new BlockDescriptor (14, 0, 16384);\n\n\t\t// When\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveNoneMessage());\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.haveAllMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (1));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (2));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (3));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (4));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (6));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (9));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (10));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (12));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (13));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (14));\n\t\tmockConnection.mockExpectNoMoreOutput();\n\n\t\t// When\n\t\t// They request an Allowed Fast piece while choked but over the allowed piece count\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveMessage (0));\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveMessage (1));\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveMessage (2));\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveMessage (3));\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveMessage (4));\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveMessage (5));\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveMessage (6));\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveMessage (7));\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveMessage (8));\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveMessage (9));\n\t\tmockConnection.mockInput (PeerProtocolBuilder.requestMessage (request));\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.rejectRequestMessage (request));\n\t\tmockConnection.mockExpectNoMoreOutput();\n\t\tassertTrue (mockConnection.isOpen());\n\n\n\t\tpieceDatabase.terminate (true);\n\n\t}", "netty.framework.messages.TestMessage.TestRequest getRequest();", "@Test\n public void whatsappFeeTest() {\n // TODO: test whatsappFee\n }", "public void testCase01() {\n\n\t\tMyMockPilot pilot = new MyMockPilot();\n\t\tMyCommandDataListener listener = new MyCommandDataListener();\n\t\tPilotAdapter pilotAdapter = new PilotAdapter(pilot, listener, 0);\n\n\t\tSensorData sensorData = new SensorData();\n\t\tsensorData.yaw = 0;\n\t\tsensorData.roll = 0;\n\t\tsensorData.pitch = 0;\n\t\tsensorData.z = 0;\n\n\t\tpilotAdapter.receive(sensorData);\n\n\t\tassertNotNull(pilot.currentFlightControlData);\n\t\tassertEquals(0, pilot.currentFlightControlData.yaw, 1E-9);\n\t\tassertEquals(0, pilot.currentFlightControlData.roll, 1E-9);\n\t\tassertEquals(0, pilot.currentFlightControlData.pitch, 1E-9);\n\t\tassertEquals(0, pilot.currentFlightControlData.heightAboveGround, 1E-9);\n\n\t\tassertNotNull(listener.currentCommandData);\n\t\tassertEquals(0, listener.currentCommandData.yaw, 1E-9);\n\t\tassertEquals(0, listener.currentCommandData.roll, 1E-9);\n\t\tassertEquals(0, listener.currentCommandData.pitch, 1E-9);\n\t\tassertEquals(0, listener.currentCommandData.z, 1E-9);\n\n\t}", "@Test(timeout = 4000)\n public void test37() throws Throwable {\n String string0 = EWrapperMsgGenerator.receiveFA((-510), \"askExch\");\n assertEquals(\"FA: null askExch\", string0);\n }", "@Test\r\n public void noEmitFromOtherFlows() throws Exception {\r\n ModuleURN instanceURN = new ModuleURN(PROVIDER_URN, \"mymodule\");\r\n FlowSpecificListener listener = new FlowSpecificListener();\r\n mManager.addSinkListener(listener);\r\n //Set up a data flow with this module as an emitter.\r\n //No data should be received from within this data flow\r\n DataFlowID emitOnlyflowID = mManager.createDataFlow(new DataRequest[]{\r\n new DataRequest(instanceURN)\r\n });\r\n //Setup two other data flows\r\n Object[] reqParms1 = {\"firstOne\", BigDecimal.TEN, \"uno\"};\r\n Object[] reqParms2 = {\"secondOne\", BigDecimal.ZERO, \"dos\"};\r\n DataFlowID flowID1 = mManager.createDataFlow(new DataRequest[]{\r\n new DataRequest(CopierModuleFactory.INSTANCE_URN, reqParms1),\r\n new DataRequest(instanceURN)\r\n });\r\n DataFlowID flowID2 = mManager.createDataFlow(new DataRequest[]{\r\n new DataRequest(CopierModuleFactory.INSTANCE_URN, reqParms2),\r\n new DataRequest(instanceURN)\r\n });\r\n //Wait for data from each of the flows\r\n //flowID2\r\n while(!listener.getFlows().contains(flowID2)) {\r\n Thread.sleep(100);\r\n }\r\n for(Object o: reqParms2) {\r\n assertEquals(o, listener.getNextDataFor(flowID2));\r\n }\r\n //flowID1\r\n while(!listener.getFlows().contains(flowID1)) {\r\n Thread.sleep(100);\r\n }\r\n for(Object o: reqParms1) {\r\n assertEquals(o, listener.getNextDataFor(flowID1));\r\n }\r\n //No data should be received for the very first data flow\r\n assertThat(listener.getFlows(), Matchers.not(Matchers.hasItem(emitOnlyflowID)));\r\n //verify queue sizes for all of them via JMX\r\n assertEquals(0, getMBeanServer().getAttribute(instanceURN.toObjectName(), SimpleAsyncProcessor.ATTRIB_PREFIX + emitOnlyflowID));\r\n assertEquals(0, getMBeanServer().getAttribute(instanceURN.toObjectName(), SimpleAsyncProcessor.ATTRIB_PREFIX + flowID1));\r\n assertEquals(0, getMBeanServer().getAttribute(instanceURN.toObjectName(), SimpleAsyncProcessor.ATTRIB_PREFIX + flowID2));\r\n //verify that the data for each flow is delivered in a unique thread.\r\n assertEquals(null, listener.getThreadNameFor(emitOnlyflowID));\r\n assertThat(listener.getThreadNameFor(flowID1),\r\n Matchers.startsWith(SimpleAsyncProcessor.ASYNC_THREAD_NAME_PREFIX + \"-\" + instanceURN.instanceName()));\r\n assertThat(listener.getThreadNameFor(flowID2), \r\n Matchers.startsWith(SimpleAsyncProcessor.ASYNC_THREAD_NAME_PREFIX + \"-\" + instanceURN.instanceName()));\r\n assertThat(listener.getThreadNameFor(flowID1), Matchers.not(\r\n Matchers.equalTo(listener.getThreadNameFor(flowID2))));\r\n assertThat(listener.getThreadNameFor(flowID1), Matchers.not(\r\n Matchers.equalTo(Thread.currentThread().getName())));\r\n //Cancel all the data flows\r\n mManager.cancel(emitOnlyflowID);\r\n mManager.cancel(flowID1);\r\n //verify that we only have a single flow attribute left\r\n List<String> list = getAttributes(instanceURN);\r\n assertEquals(1, list.size());\r\n assertThat(list, Matchers.hasItem(SimpleAsyncProcessor.ATTRIB_PREFIX + flowID2));\r\n mManager.cancel(flowID2);\r\n //verify that the module is deleted.\r\n List<ModuleURN> instances = mManager.getModuleInstances(PROVIDER_URN);\r\n assertTrue(instances.toString(), instances.isEmpty());\r\n mManager.removeSinkListener(listener);\r\n }", "public final void testCall() throws Exception\n {\n \n Logger.getLogger(this.getClass()).info(\"waiting for Remote message...\");\n \n Logger.getLogger(this.getClass()).info(\"press enter to shutdown server\");\n \n //TODO raffaele.picardi: report this class out of this test and remain only Monitor.onWait for itnegration test\n // Monitor.waitOn(WAIT);\n //Init section to transfer in External system\n UMOMessage result=null;\n MuleClient client;\n while (true) {\n try {\n \n client = new MuleClient();\n RemoteDispatcher rd = client.getRemoteDispatcher(MessagesTest.getString(\"EHelloServiceObjectArrayTest.10\")); //$NON-NLS-1$\n \n/* SoapMethod method = new SoapMethod(new QName(\"\", Messages.getString(\"SOAP_METHOD_NAME\")));\n method.addNamedParameter(new QName( Messages.getString(\"NAMED_PARAMETER\")), new javax.xml.namespace.QName( Messages.getString(\"SERVICE_NAMESPACE_URI\"), Messages.getString(\"RETURN_QNAME\")), \"in\");\n method.setReturnType( new javax.xml.namespace.QName(Messages.getString(\"SERVICE_NAMESPACE_URI\"), Messages.getString(\"RETURN_QTYPE_NAME\")));\n method.setReturnClass(Class.forName(Messages.getString(\"RETURN_CLASSNAME\")));\n */\n \n Map props = new HashMap();\n props.put(\"style\", \"wrapped\");\n props.put(\"use\", \"literal\"); \n //props.put(MuleProperties.MULE_SOAP_METHOD, method);\n \n props.put(\"resourceKey\", MessagesTest.getString(\"RESOURCE_KEY\"));\n props.put(WSRFParameter.SERVICE_NAMESPACE , MessagesTest.getString(\"SERVICE_NAMESPACE_URI\"));\n props.put(WSRFParameter.RESOURCE_KEY_NAME , MessagesTest.getString(\"RESOURCE_KEY_NAME\"));\n props.put(WSRFParameter.RETURN_QNAME, MessagesTest.getString(\"RETURN_QNAME\"));\n \n /* props.put(WSRFParameter.RETURN_QTYPE, new javax.xml.namespace.QName(Messages.getString(\"SERVICE_NAMESPACE_URI\"), Messages.getString(\"RETURN_QTYPE_NAME\")));\n \n props.put(WSRFParameter.RETURN_QTYPE, new javax.xml.namespace.QName(Messages.getString(\"SERVICE_NAMESPACE_URI\"), Messages.getString(\"RETURN_QTYPE_NAME\")));\n props.put(WSRFParameter.RETURN_QTYPE, new javax.xml.namespace.QName(Messages.getString(\"SERVICE_NAMESPACE_URI\"), Messages.getString(\"RETURN_QTYPE_NAME\")));\n */\n \n props.put(WSRFParameter.RETURN_CLASS, Class.forName(MessagesTest.getString(\"RETURN_CLASSNAME\")));\n props.put(WSRFParameter.SOAP_ACTION_URI, MessagesTest.getString(\"SOAP_ACTION_URI\"));\n result = rd.sendRemote(\"vm://vmQueue\", new Integer(2), props);\n \n //result = rd.sendRemote(Messages.getString(\"EHelloServiceObjectArrayTest.11\"),\"\", null); //$NON-NLS-1$\n //logger.info(this, \"invoke done.\",\"\"); //$NON-NLS-1$\n System.out.println(\"invoke done.\");\n Thread.sleep(5000);\n } \n catch (UMOException e) \n {\n\n e.printStackTrace();\n } \n catch (InterruptedException e) \n {\n\n e.printStackTrace();\n }\n finally \n {\n if (result != null)\n {\n System.out.println(result.getPayload().toString()); //$NON-NLS-1$\n }\n else\n {\n System.out.println(\"result is null\");\n }\n \n }\n //end section to transfer in External system\n }\n \n }", "@Test\n public void clientPingsServer() throws Exception {\n peer.sendFrame().settings(new Settings());\n peer.acceptFrame();// ACK\n\n peer.acceptFrame();// PING\n\n peer.sendFrame().ping(true, 1, 5);\n peer.play();\n // play it back\n Http2Connection connection = connect(peer);\n long pingAtNanos = System.nanoTime();\n connection.writePingAndAwaitPong();\n long elapsedNanos = (System.nanoTime()) - pingAtNanos;\n Assert.assertTrue((elapsedNanos > 0));\n Assert.assertTrue((elapsedNanos < (TimeUnit.SECONDS.toNanos(1))));\n // verify the peer received what was expected\n MockHttp2Peer.InFrame pingFrame = peer.takeFrame();\n Assert.assertEquals(TYPE_PING, pingFrame.type);\n Assert.assertEquals(0, pingFrame.streamId);\n Assert.assertEquals(1330343787, pingFrame.payload1);// OkOk\n\n Assert.assertEquals(-257978967, pingFrame.payload2);// donut\n\n Assert.assertFalse(pingFrame.ack);\n }", "@Test\n void runWithBroadcastMessageTest() throws Exception {\n\n Prattle.startUp();\n\n\n\n Field initialized = client1.getClass().getDeclaredField(\"initialized\");\n Field input = client1.getClass().getDeclaredField(\"input\");\n Field output = client1.getClass().getDeclaredField(\"output\");\n\n initialized.setAccessible(true);\n input.setAccessible(true);\n output.setAccessible(true);\n\n initialized.set(client1, false);\n when(scanNetNB.hasNextMessage()).thenReturn(true);\n Message msg = Message.makeBroadcastMessage(\"Mandy\", \"test\");\n when(scanNetNB.nextMessage()).thenReturn(msg);\n\n input.set(client1, scanNetNB);\n\n\n client1.run();\n assertEquals(true, client1.isInitialized());\n client1.run();\n Message msgLogOff = Message.makeBroadcastMessage(\"Mandy\", \"Prattle says everyone log off\");\n when(scanNetNB.nextMessage()).thenReturn(msgLogOff);\n client1.run();\n\n Message msgWithDiffName = Message.makeBroadcastMessage(\"Noodle\", \"Hello from Noodle\");\n client1.setName(\"Mandy\");\n System.out.print(client1.getName());\n System.out.print(msgWithDiffName.getName());\n client1.run();\n\n assertEquals(true, client1.isInitialized());\n when(scanNetNB.hasNextMessage()).thenReturn(true);\n when(scanNetNB.nextMessage()).thenReturn(msgWithDiffName);\n input.set(client1, scanNetNB);\n output.set(client1, printNetNB);\n\n ClientRunnable clientRunnable = spy(client1);\n Mockito.doNothing().when(clientRunnable).terminateClient();\n clientRunnable.run();\n\n\n\n\n\n }", "@Test\n public void testDataFlowsets() throws IOException {\n\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n DataOutputStream out = new DataOutputStream(bos);\n\n // Header\n out.writeShort(9); // version\n out.writeShort(5); // count\n out.writeInt(289584773); // sys_uptime\n out.writeInt(691368492); // unix_secs\n out.writeInt(168); // package_sequence\n out.writeInt(20); // source_id\n\n // Template flow set\n out.writeShort(0); // flowset_id == 0\n out.writeShort(44); // length\n\n // Template 1\n out.writeShort(256); // template_id\n out.writeShort(3); // field_count\n out.writeShort(4); // field 1 type - PROTOCOL\n out.writeShort(1); // field 1 length\n out.writeShort(7); // field 2 type - L4_SRC_PORT\n out.writeShort(2); // field 2 length\n out.writeShort(23); // field 3 type - OUT_BYTES\n out.writeShort(4); // field 3 length\n\n // Template 2\n out.writeShort(257); // template_id\n out.writeShort(5); // field_count\n out.writeShort(8); // field 1 type - IPV4_SRC_ADDR\n out.writeShort(4); // field 1 length\n out.writeShort(500); // field 2 type - unknown\n out.writeShort(2); // field 2 length\n out.writeShort(82); // field 3 type - IF_NAME\n out.writeShort(5); // field 3 length\n out.writeShort(62); // field 4 type - IPV6_NEXT_HOP\n out.writeShort(16); // field 4 length\n out.writeShort(80); // field 5 type - IN_DST_MAC\n out.writeShort(6); // field 5 length\n out.close();\n\n // Data flow set 1\n out.writeShort(256); // flowset_id == template 1\n out.writeShort(20); // length\n\n // Record 1\n out.writeByte(17);\n out.writeShort(23);\n out.writeInt(2857383);\n\n // Record 2\n out.writeByte(10);\n out.writeShort(2551);\n out.writeInt(5137183);\n\n out.writeByte(0); // padding\n out.writeByte(0); // padding\n\n List<TSDRLogRecord> records = parseRecords(bos.toByteArray());\n assertEquals(2, records.size());\n\n Map<String, String> attrs = toMap(records.get(0).getRecordAttributes());\n assertEquals(Long.valueOf(691368492L * 1000), records.get(0).getTimeStamp());\n assertEquals(NetflowV9PacketParser.FLOW_SET_LOG_TEXT, records.get(0).getRecordFullText());\n assertEquals(\"9\", attrs.remove(\"version\"));\n assertEquals(\"289584773\", attrs.remove(\"sys_uptime\"));\n assertEquals(\"168\", attrs.remove(\"package_sequence\"));\n assertEquals(\"20\", attrs.remove(\"source_id\"));\n\n assertEquals(\"17\", attrs.remove(\"PROTOCOL\"));\n assertEquals(\"23\", attrs.remove(\"L4_SRC_PORT\"));\n assertEquals(\"2857383\", attrs.remove(\"OUT_BYTES\"));\n assertEmpty(attrs);\n\n attrs = toMap(records.get(1).getRecordAttributes());\n assertEquals(Long.valueOf(691368492L * 1000), records.get(1).getTimeStamp());\n assertEquals(NetflowV9PacketParser.FLOW_SET_LOG_TEXT, records.get(1).getRecordFullText());\n assertEquals(\"9\", attrs.remove(\"version\"));\n assertEquals(\"289584773\", attrs.remove(\"sys_uptime\"));\n assertEquals(\"168\", attrs.remove(\"package_sequence\"));\n assertEquals(\"20\", attrs.remove(\"source_id\"));\n\n assertEquals(\"10\", attrs.remove(\"PROTOCOL\"));\n assertEquals(\"2551\", attrs.remove(\"L4_SRC_PORT\"));\n assertEquals(\"5137183\", attrs.remove(\"OUT_BYTES\"));\n assertEmpty(attrs);\n\n // Second packet - 1 data flowset record\n\n bos = new ByteArrayOutputStream();\n out = new DataOutputStream(bos);\n\n // Header\n out.writeShort(9); // version\n out.writeShort(5); // count\n out.writeInt(289584780); // sys_uptime\n out.writeInt(691368500); // unix_secs\n out.writeInt(168); // package_sequence\n out.writeInt(20); // source_id\n\n // Data flow set 2\n out.writeShort(257); // flowset_id == template 2\n out.writeShort(38); // length\n\n // Record\n out.writeInt(0xa0000020);\n out.writeShort(99);\n out.writeBytes(\"FE1/0\");\n out.write(new byte[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf});\n out.write(new byte[]{0xa, 0xb, 0xc, 0xd, 0x12, 0x4});\n\n out.writeByte(0); // padding\n\n records = parseRecords(bos.toByteArray());\n assertEquals(1, records.size());\n\n attrs = toMap(records.get(0).getRecordAttributes());\n assertEquals(Long.valueOf(691368500L * 1000), records.get(0).getTimeStamp());\n assertEquals(NetflowV9PacketParser.FLOW_SET_LOG_TEXT, records.get(0).getRecordFullText());\n assertEquals(\"9\", attrs.remove(\"version\"));\n assertEquals(\"289584780\", attrs.remove(\"sys_uptime\"));\n assertEquals(\"168\", attrs.remove(\"package_sequence\"));\n assertEquals(\"20\", attrs.remove(\"source_id\"));\n\n assertEquals(\"160.0.0.32\", attrs.remove(\"IPV4_SRC_ADDR\"));\n assertEquals(\"99\", attrs.remove(\"500\"));\n assertEquals(\"FE1/0\", attrs.remove(\"IF_NAME\"));\n assertEquals(\"1:203:405:607:809:a0b:c0d:e0f\", attrs.remove(\"IPV6_NEXT_HOP\"));\n assertEquals(\"0a:0b:0c:0d:12:04\", attrs.remove(\"IN_DST_MAC\"));\n assertEmpty(attrs);\n }", "@Test\n public void actorShouldProcessAllMessages() {\n ActorRef ref1 = system.actorOf(MyTestActor.class);\n\n Actor act = ((MyTestActorSystem)system).giveMeActor(ref1);\n\n ((MyTestActor)act).setRefAs((AbsActorSystem)system);\n\n for (int i = 0; i < 2000; i++) {\n ref1.send(new TrivialMessage(), ref1);\n }\n\n system.stop(ref1);\n\n // messaggi spediti all'attore effettivamente aggiunti alla sua mailBox\n int sendM = ((MyTestActorSystem)system).getNumSendMessages();\n // messaggi presenti nella mailBox dell'attore che sono stati processati\n int reciveM = ((MyTestActorSystem)system).getRecivedMessage();\n\n Assert.assertEquals(\"Devono essere processati tutti i messaggi effettivamente spediti\", sendM, reciveM);\n\n }", "@Test\n public void testSendMessageWithReplyBacktrack(TestContext context) {\n NetClient client = vertx.createNetClient();\n final Async async = context.async();\n\n client.connect(7000, \"localhost\").onComplete(context.asyncAssertSuccess(socket -> {\n\n final FrameParser parser = new FrameParser(parse -> {\n context.assertTrue(parse.succeeded());\n JsonObject frame = parse.result();\n context.assertNotEquals(\"err\", frame.getString(\"type\"));\n context.assertEquals(true, frame.getBoolean(\"send\"));\n context.assertEquals(\"Hello vert.x\", frame.getJsonObject(\"body\").getString(\"value\"));\n client.close();\n async.complete();\n });\n\n socket.handler(parser);\n\n FrameHelper.sendFrame(\"send\", \"hello\", \"#backtrack\", new JsonObject().put(\"value\", \"vert.x\"), socket);\n }));\n }", "@Ignore\n @Test\n public void startSender() throws IOException, InterruptedException {\n\n final int maxPeers = 10;\n PeerDHT[] peers = createPeers(PORT, maxPeers, \"sender\");\n for (PeerDHT peer : peers) {\n peer.peer().bootstrap().inetAddress(InetAddress.getByName(ADDR)).ports(PORT).start().awaitUninterruptibly();\n peer.peer().objectDataReply(new ObjectDataReply() {\n @Override\n public Object reply(final PeerAddress sender, final Object request) throws Exception {\n System.out.println(\"wrong!!!!\");\n return \"wrong!!!!\";\n }\n });\n }\n Number160 keyForID = Number160.createHash(\"key\");\n Msg message = new Msg();\n\n System.out.println(String.format(\"Sending message '%s' to key '%s' converted to '%s'\", message.getType(),\n \"key\", keyForID.toString()));\n FutureSend futureDHT = peers[0].send(keyForID).object(message).requestP2PConfiguration(REQ).start();\n futureDHT.awaitUninterruptibly();\n System.out.println(\"got: \" + futureDHT.object());\n Thread.sleep(Long.MAX_VALUE);\n }", "@Test\n public void serverReadsHeadersDataHeaders() throws Exception {\n peer.sendFrame().settings(new Settings());\n peer.acceptFrame();// ACK\n\n peer.acceptFrame();// SYN_STREAM\n\n peer.acceptFrame();// DATA\n\n peer.acceptFrame();// HEADERS\n\n peer.sendFrame().headers(true, 3, TestUtil.headerEntries(\"a\", \"android\"));\n peer.acceptFrame();// PING\n\n peer.sendFrame().ping(true, 1, 0);// PING\n\n peer.play();\n // play it back\n Http2Connection connection = connect(peer);\n Http2Stream stream = connection.newStream(TestUtil.headerEntries(\"b\", \"banana\"), true);\n BufferedSink out = Okio.buffer(stream.getSink());\n out.writeUtf8(\"c3po\");\n out.close();\n stream.writeHeaders(TestUtil.headerEntries(\"e\", \"elephant\"), false, false);\n connection.writePingAndAwaitPong();\n Assert.assertEquals(0, connection.openStreamCount());\n // verify the peer received what was expected\n MockHttp2Peer.InFrame synStream = peer.takeFrame();\n Assert.assertEquals(TYPE_HEADERS, synStream.type);\n Assert.assertFalse(synStream.outFinished);\n Assert.assertEquals(3, synStream.streamId);\n Assert.assertEquals((-1), synStream.associatedStreamId);\n Assert.assertEquals(TestUtil.headerEntries(\"b\", \"banana\"), synStream.headerBlock);\n MockHttp2Peer.InFrame requestData = peer.takeFrame();\n Assert.assertArrayEquals(\"c3po\".getBytes(StandardCharsets.UTF_8), requestData.data);\n MockHttp2Peer.InFrame nextFrame = peer.takeFrame();\n Assert.assertEquals(TestUtil.headerEntries(\"e\", \"elephant\"), nextFrame.headerBlock);\n }", "@Test\n public void clientCreatesStreamAndServerRepliesWithFin() throws Exception {\n peer.sendFrame().settings(new Settings());\n peer.acceptFrame();// ACK\n\n peer.acceptFrame();// SYN_STREAM\n\n peer.acceptFrame();// PING\n\n peer.sendFrame().headers(true, 3, TestUtil.headerEntries(\"a\", \"android\"));\n peer.sendFrame().ping(true, 1, 0);\n peer.play();\n // play it back\n Http2Connection connection = connect(peer);\n connection.newStream(TestUtil.headerEntries(\"b\", \"banana\"), false);\n Assert.assertEquals(1, connection.openStreamCount());\n connection.writePingAndAwaitPong();// Ensure that the SYN_REPLY has been received.\n\n Assert.assertEquals(0, connection.openStreamCount());\n // verify the peer received what was expected\n MockHttp2Peer.InFrame synStream = peer.takeFrame();\n Assert.assertEquals(TYPE_HEADERS, synStream.type);\n MockHttp2Peer.InFrame ping = peer.takeFrame();\n Assert.assertEquals(TYPE_PING, ping.type);\n }", "@Test\n public void testControlMessagesNotSentWhenTetheringNotAccepted() throws Exception {\n createTethering(\"xyz\", NAMESPACES, REQUEST_TIME, DESCRIPTION);\n\n // Queue up a message for the peer\n TetheringControlMessage controlMessage =\n new TetheringControlMessage(TetheringControlMessage.Type.KEEPALIVE, new byte[0]);\n MessagePublisher publisher =\n new MultiThreadMessagingContext(messagingService).getMessagePublisher();\n String topicPrefix = cConf.get(Constants.Tethering.CLIENT_TOPIC_PREFIX);\n String topic = topicPrefix + \"xyz\";\n publisher.publish(NamespaceId.SYSTEM.getNamespace(), topic, GSON.toJson(controlMessage));\n\n // Poll the server\n HttpRequest.Builder builder =\n HttpRequest.builder(HttpMethod.POST, config.resolveURL(\"tethering/channels/xyz\"))\n .withBody(GSON.toJson(new TetheringControlChannelRequest(null, null)));\n HttpResponse response = HttpRequests.execute(builder.build());\n // Response should not contain any messages because the peer is in PENDING state\n TetheringControlResponseV2 controlResponse =\n GSON.fromJson(response.getResponseBodyAsString(), TetheringControlResponseV2.class);\n Assert.assertTrue(controlResponse.getControlMessages().isEmpty());\n }", "public void testRpcValues() {\n\t\t// Test Values\n\t\tString stationShortName = msg.getStationShortName();\n\t\tStationIDNumber stationIDNumber = msg.getStationIDNumber();\n\t\tString stationLongName = msg.getStationLongName();\n\t\tGPSData stationLocation = msg.getStationLocation();\n\t\tString stationMessage = msg.getStationMessage();\n\n\t\t// Valid Tests\n\t\tassertEquals(Test.MATCH, Test.GENERAL_STRING, stationShortName);\n\t\tassertEquals(Test.MATCH, Test.GENERAL_STATIONIDNUMBER, stationIDNumber);\n\t\tassertEquals(Test.MATCH, Test.GENERAL_STRING, stationLongName);\n\t\tassertEquals(Test.MATCH, VehicleDataHelper.GPS, stationLocation);\n\t\tassertEquals(Test.MATCH, Test.GENERAL_STRING, stationMessage);\n\n\t\t// Invalid/Null Tests\n\t\tSisData msg = new SisData();\n\t\tassertNotNull(Test.NOT_NULL, msg);\n\n\t\tassertNull(Test.NULL, msg.getStationShortName());\n\t\tassertNull(Test.NULL, msg.getStationIDNumber());\n\t\tassertNull(Test.NULL, msg.getStationLongName());\n\t\tassertNull(Test.NULL, msg.getStationLocation());\n\t\tassertNull(Test.NULL, msg.getStationMessage());\n\t}", "@Test\n\tpublic void testFastRequestMessageChokedNotAllowedFast() throws Exception {\n\n\t\t// Given\n\t\tfinal PieceDatabase pieceDatabase = MockPieceDatabase.create (\"111111111111111\", 16384);\n\t\tpieceDatabase.start (true);\n\t\tPeerServices peerServices = mock (PeerServices.class);\n\t\tPeerSetContext peerSetContext = new PeerSetContext (peerServices, pieceDatabase, mock (RequestManager.class), null);\n\t\tMockConnection mockConnection = new MockConnection();\n\t\tPeerHandler handler = new PeerHandler (peerSetContext, mockConnection, new PeerID(), new PeerStatistics(), true, false);\n\t\tBlockDescriptor requestDescriptor = new BlockDescriptor (0, 0, 16384);\n\n\t\t// WHen\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveNoneMessage());\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.haveAllMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (1));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (2));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (3));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (4));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (6));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (9));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (10));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (12));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (13));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (14));\n\t\tmockConnection.mockExpectNoMoreOutput();\n\n\t\t// When\n\t\t// They request a non Allowed Fast piece while choked\n\t\tmockConnection.mockInput (PeerProtocolBuilder.requestMessage (requestDescriptor));\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.rejectRequestMessage (requestDescriptor));\n\t\tmockConnection.mockExpectNoMoreOutput();\n\t\tassertTrue (mockConnection.isOpen());\n\n\n\t\tpieceDatabase.terminate (true);\n\n\t}", "@Test\n public void multipleNetServers() throws Exception {\n String gNode1 = \"graphNode1\";\n String gNode2 = \"graphNode2\";\n\n Map<String, String> rcaConfTags = new HashMap<>();\n rcaConfTags.put(\"locus\", RcaConsts.RcaTagConstants.LOCUS_DATA_NODE);\n IntentMsg msg = new IntentMsg(gNode1, gNode2, rcaConfTags);\n wireHopper2.getSubscriptionManager().setCurrentLocus(RcaConsts.RcaTagConstants.LOCUS_DATA_NODE);\n\n wireHopper1.sendIntent(msg);\n\n WaitFor.waitFor(() ->\n wireHopper2.getSubscriptionManager().getSubscribersFor(gNode2).size() == 1,\n 10,\n TimeUnit.SECONDS);\n GenericFlowUnit flowUnit = new SymptomFlowUnit(System.currentTimeMillis());\n DataMsg dmsg = new DataMsg(gNode2, Lists.newArrayList(gNode1), Collections.singletonList(flowUnit));\n wireHopper2.sendData(dmsg);\n wireHopper1.getSubscriptionManager().setCurrentLocus(RcaConsts.RcaTagConstants.LOCUS_DATA_NODE);\n\n WaitFor.waitFor(() -> {\n List<FlowUnitMessage> receivedMags = wireHopper1.getReceivedFlowUnitStore().drainNode(gNode2);\n return receivedMags.size() == 1;\n }, 10, TimeUnit.SECONDS);\n }", "public void run() {\n assertEquals(sendQuery(\"SFO\"), 7);\n assertEquals(sendQuery(\"RHV\"), 1);\n assertEquals(sendQuery(\"xyzzy\"), 0);\n }", "@Test\n\tpublic void moneyTrnasferSucess() {\n\t\t\n\t\tString accountNumberFrom = createAccount(\"krishna\",4000);\n\t\tString accountNumberTo = createAccount(\"ram\",2000);\n\t\tdouble amountToBeTranfered = 500.0;\n\t\tMoneyTransfer moneyTransfer = new MoneyTransfer();\n\t\tmoneyTransfer.setAccountNumberFrom(Integer.parseInt(accountNumberFrom));\n\t\tmoneyTransfer.setAccountNumberTo(Integer.parseInt(accountNumberTo));\n\t\tmoneyTransfer.setAmount(amountToBeTranfered);\n\t\t\n\t\tString requestBody = gson.toJson(moneyTransfer);\n\t\t\n\t\tRequestSpecification request = RestAssured.given();\n\t\trequest.body(requestBody);\n\t\tResponse response = request.put(\"/transfer\");\n\t\t\n\t\t// This logic is required due to response has been set as mix of Message and return data value. - START\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(amountToBeTranfered);\n\t\tsb.append(\" has been transferred to : \");\n\t\tsb.append(accountNumberTo);\n\t\t// This logic is required due to response has been set as mix of Message and return data value. - END\n\t\t\n\t\tAssertions.assertEquals(sb.toString(), response.asString());\n\t\t\n\t}", "@Test\n public void httpGetPacket() throws Exception {\n int[] receivedData = Utils.stringToHexArr(\"600000000018fd3e2001067c2564a170\"\n + \"020423fffede4b2c2001067c2564a125a190bba8525caa5f\"\n + \"1e1e244cf8b92650000000026012384059210000020405a0\");\n Packet receivedPacket = new Packet(receivedData);\n\n packet.setSeqNumber(receivedPacket.getAckNumber());\n packet.setAckNumber(receivedPacket.getSeqNumber());\n packet.setFlag(Flag.ACK);\n String requestURI = String.format(\"http://[%s]:%d/%s\", DEST_ADDR, DEST_PORT, STUDENT_NUMBER);\n int [] getRequestData = createGETrequest(requestURI);\n packet.setData(getRequestData);\n\n assertEquals(Utils.arrayToString(getRequestData),packet.getData());\n assertEquals(60 + getRequestData.length, packet.getSize());\n assertEquals(Flag.ACK.value, packet.getFlags());\n assertEquals(2,packet.getSeqNumber());\n assertEquals(3,packet.getNextSeqNumber());\n assertEquals(4172883536L + 1, packet.getNextAckNumber());\n\n //Build expected packet\n String ipv6Header = \"6\" +\"00\" + Utils.HexToString(0,20/4)\n + Utils.HexToString(20 + getRequestData.length,16/4) + \"fd\" + \"ff\"\n + Utils.parseAddress(SOURCE_ADDR) + Utils.parseAddress(DEST_ADDR);\n String tcpHeader = \"244c\" + \"1e1e\" + Utils.HexToString(2,8) + Utils.HexToString(4172883536L,8) + \"50\"\n + Utils.HexToString(Flag.ACK.value,2) + \"1000\" + \"0000\" + \"0000\";\n String dataAsString = Utils.arrayToString(getRequestData);\n //Same ipv6Header\n assertEquals(ipv6Header , Utils.arrayToString(packet.getPkt()).substring(0,ipv6Header.length()));\n //Same tcp header\n assertEquals(tcpHeader , Utils.arrayToString(packet.getPkt()).substring(ipv6Header.length(),ipv6Header.length() + tcpHeader.length()));\n //Same data\n assertEquals(dataAsString , Utils.arrayToString(packet.getPkt()).substring(ipv6Header.length() + tcpHeader.length(),\n ipv6Header.length() + tcpHeader.length() + dataAsString.length()));\n\n\n }", "@Test\n public void testSendSetupRequest() {\n String expected = \"SETUP rtsp://172.10.20.30:554/d3abaaa7-65f2-42b4-\" + (((((\"8d6b-379f492fcf0f RTSP/1.0\\r\\n\" + \"transport: MP2T/DVBC/UDP;unicast;client=01234567;\") + \"source=172.10.20.30;\") + \"destination=1.1.1.1;client_port=6922\\r\\n\") + \"cseq: 1\\r\\n\") + \"\\r\\n\");\n HttpRequest request = new io.netty.handler.codec.http.DefaultHttpRequest(RTSP_1_0, SETUP, \"rtsp://172.10.20.30:554/d3abaaa7-65f2-42b4-8d6b-379f492fcf0f\");\n request.headers().add(TRANSPORT, (\"MP2T/DVBC/UDP;unicast;client=01234567;source=172.10.20.30;\" + \"destination=1.1.1.1;client_port=6922\"));\n request.headers().add(CSEQ, \"1\");\n EmbeddedChannel ch = new EmbeddedChannel(new RtspEncoder());\n ch.writeOutbound(request);\n ByteBuf buf = ch.readOutbound();\n String actual = buf.toString(UTF_8);\n buf.release();\n Assert.assertEquals(expected, actual);\n }", "@Test\n public void clientCreatesStreamAndServerReplies() throws Exception {\n peer.sendFrame().settings(new Settings());\n peer.acceptFrame();// ACK\n\n peer.acceptFrame();// SYN_STREAM\n\n peer.acceptFrame();// DATA\n\n peer.sendFrame().headers(false, 3, TestUtil.headerEntries(\"a\", \"android\"));\n peer.sendFrame().data(true, 3, new Buffer().writeUtf8(\"robot\"), 5);\n peer.acceptFrame();// PING\n\n peer.sendFrame().ping(true, 1, 0);// PING\n\n peer.play();\n // play it back\n Http2Connection connection = connect(peer);\n Http2Stream stream = connection.newStream(TestUtil.headerEntries(\"b\", \"banana\"), true);\n BufferedSink out = Okio.buffer(stream.getSink());\n out.writeUtf8(\"c3po\");\n out.close();\n Assert.assertEquals(Headers.of(\"a\", \"android\"), stream.takeHeaders());\n assertStreamData(\"robot\", stream.getSource());\n connection.writePingAndAwaitPong();\n Assert.assertEquals(0, connection.openStreamCount());\n // verify the peer received what was expected\n MockHttp2Peer.InFrame synStream = peer.takeFrame();\n Assert.assertEquals(TYPE_HEADERS, synStream.type);\n Assert.assertFalse(synStream.outFinished);\n Assert.assertEquals(3, synStream.streamId);\n Assert.assertEquals((-1), synStream.associatedStreamId);\n Assert.assertEquals(TestUtil.headerEntries(\"b\", \"banana\"), synStream.headerBlock);\n MockHttp2Peer.InFrame requestData = peer.takeFrame();\n Assert.assertArrayEquals(\"c3po\".getBytes(StandardCharsets.UTF_8), requestData.data);\n }", "@Test\n\tpublic void testFastBitfieldMessage() throws Exception {\n\n\t\t// Given\n\t\tfinal PieceDatabase pieceDatabase = MockPieceDatabase.create (\"00000\", 16384);\n\t\tBitField wantedPieces = pieceDatabase.getPresentPieces().not();\n\t\tpieceDatabase.start (true);\n\t\tPeerServices peerServices = mock (PeerServices.class);\n\t\tPeerSetContext peerSetContext = new PeerSetContext (peerServices, pieceDatabase, mock (RequestManager.class), null);\n\t\twhen(peerSetContext.requestManager.piecesAvailable (any (ManageablePeer.class))).thenReturn (true);\n\t\twhen(peerSetContext.requestManager.allocateRequests (any (ManageablePeer.class), anyInt(), eq (false))).thenReturn (new ArrayList<BlockDescriptor>());\n\t\tMockConnection mockConnection = new MockConnection();\n\t\tPeerHandler handler = new PeerHandler (peerSetContext, mockConnection, new PeerID(), new PeerStatistics(), true, false);\n\n\t\t// When\n\t\tmockConnection.mockInput (PeerProtocolBuilder.bitfieldMessage (wantedPieces));\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.haveNoneMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (0));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (1));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (2));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (3));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (4));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.interestedMessage());\n\t\tmockConnection.mockExpectNoMoreOutput();\n\t\tassertTrue (mockConnection.isOpen());\n\n\n\t\tpieceDatabase.terminate (true);\n\n\t}", "@Test\n\tpublic void testMerklePieceSent() throws Exception {\n\n\t\t// Given\n\t\tint pieceSize = 16384;\n\t\tint totalLength = 16384;\n\t\tPieceDatabase pieceDatabase = MockPieceDatabase.createMerkle (\"1\", pieceSize);\n\t\tpieceDatabase.start (true);\n\t\tMap<String,Integer> extensions = new HashMap<String,Integer>();\n\t\textensions.put (PeerProtocolConstants.EXTENSION_MERKLE, (int)PeerProtocolConstants.EXTENDED_MESSAGE_TYPE_MERKLE);\n\t\tMap<String,Integer> expectedExtensions = new HashMap<String,Integer>();\n\t\texpectedExtensions.put (PeerProtocolConstants.EXTENSION_PEER_METADATA, (int)PeerProtocolConstants.EXTENDED_MESSAGE_TYPE_PEER_METADATA);\n\t\texpectedExtensions.put (PeerProtocolConstants.EXTENSION_MERKLE, (int)PeerProtocolConstants.EXTENDED_MESSAGE_TYPE_MERKLE);\n\t\tBDictionary extra = new BDictionary();\n\t\textra.put (\"metadata_size\", BEncoder.encode (pieceDatabase.getInfo().getDictionary()).length);\n\t\tBitField wantedPieces = pieceDatabase.getPresentPieces().not();\n\t\tPeerServices peerServices = mock (PeerServices.class);\n\t\tPeerSetContext peerSetContext = new PeerSetContext (peerServices, pieceDatabase, mock (RequestManager.class), mock (ExtensionManager.class));\n\t\twhen(peerSetContext.requestManager.piecesAvailable (any (ManageablePeer.class))).thenReturn (false);\n\t\tMockConnection mockConnection = new MockConnection();\n\t\tPeerHandler handler = new PeerHandler (peerSetContext, mockConnection, new PeerID(), new PeerStatistics(), true, true);\n\t\tElasticTree tree = ElasticTree.buildFromLeaves (pieceSize, totalLength, Util.pseudoRandomBlockHashes (pieceSize, totalLength));\n\n\t\t// When\n\t\tmockConnection.mockInput (PeerProtocolBuilder.bitfieldMessage (wantedPieces));\n\t\tmockConnection.mockInput (PeerProtocolBuilder.extensionHandshakeMessage (extensions, null));\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\t//mockConnection.mockDebugParseOutput(true, true);\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.haveAllMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (0));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.extensionHandshakeMessage (expectedExtensions, extra));\n\t\tmockConnection.mockExpectNoMoreOutput();\n\t\tverify(peerSetContext.extensionManager).offerExtensionsToPeer (handler);\n\t\tverify(peerSetContext.extensionManager).enableDisablePeerExtensions (\n\t\t\t\teq (handler),\n\t\t\t\teq (new HashSet<String> (Arrays.asList (PeerProtocolConstants.EXTENSION_MERKLE))),\n\t\t\t\teq (new HashSet<String>()),\n\t\t\t\targThat (new ArgumentMatcher<BDictionary>() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic boolean matches (Object argument) {\n\t\t\t\t\t\treturn ((BDictionary)argument).size() == 0;\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t);\n\n\t\t// When\n\t\tBlockDescriptor descriptor1 = new BlockDescriptor (0, 0, 8192);\n\t\tBlockDescriptor descriptor2 = new BlockDescriptor (0, 8192, 8192);\n\t\tmockConnection.mockInput (PeerProtocolBuilder.requestMessage (descriptor1));\n\t\tmockConnection.mockInput (PeerProtocolBuilder.requestMessage (descriptor2));\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tByteBuffer expectedBlock1 = ByteBuffer.wrap (Util.pseudoRandomBlock (0, 8192, 8192));\n\t\tByteBuffer expectedBlock2 = ByteBuffer.wrap (Util.pseudoRandomBlock (0, 16384, 16384), 8192, 8192);\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.merklePieceMessage (PeerProtocolConstants.EXTENDED_MESSAGE_TYPE_MERKLE, descriptor1, tree.getHashChain(0, pieceSize).getHashes(), expectedBlock1));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.merklePieceMessage (PeerProtocolConstants.EXTENDED_MESSAGE_TYPE_MERKLE, descriptor2, null, expectedBlock2));\n\t\tmockConnection.mockExpectNoMoreOutput();\n\n\n\t\tpieceDatabase.terminate (true);\n\n\t}", "@Test\n public void bufferProcessor_trafficMessageDecode_properJsonMessageReturned() throws JSONException {\n final BufferProcessor bp = new BufferProcessor();\n try (MockedStatic<Logger> mockStaticLogger = mockStatic(Logger.class); MockedStatic<Crc> mockStaticCrc = mockStatic(Crc.class)) {\n mockStaticCrc.when(() -> Crc.checkCrc(any(), anyInt(), anyInt())).thenReturn(true);\n JSONObject jsonResult;\n // TODO: Validate lat, lon, etc.\n // new parameters (isairborne, vspeed) test #1\n bp.put(testTrafficMessage, testTrafficMessage.length);\n jsonResult = new JSONObject(bp.decode(mock(Preferences.class)).get(0));\n assertEquals(\"traffic\", jsonResult.getString(\"type\"));\n assertEquals(true, jsonResult.getBoolean(\"isairborne\"));\n assertEquals(-64, jsonResult.getInt(\"vspeed\"));\n // new parameters (isairborne, vspeed) test #2\n bp.put(setAirborneFlagInCopy(testTrafficMessage, false), testTrafficMessage.length);\n jsonResult = new JSONObject(bp.decode(mock(Preferences.class)).get(0));\n assertEquals(false, jsonResult.getBoolean(\"isairborne\"));\n }\n }", "@Test\n public void testSetUp() throws Exception {\n assertEquals(\"\",packet.getData());\n //Has size 60\n assertEquals(60,packet.getSize());\n //Has no flags set\n assertEquals(0,packet.getFlags());\n }", "public void testBandwith() {\n\t\t\n\t\tlong timeOffset = 0;\n\t\t\n\t\tTransInfo addressOfNode1 = this.node1.getTransLayer().getLocalTransInfo(this.node1.getPort());\n\t\tint messageSize = 1024 * 1024;\n\t\t\n\t\t//Nacheinander\n\t\tDummyMessage message1 = new DummyMessage(messageSize, this.node2.getOverlayID(), this.node1.getOverlayID());\n\t\tDummyMessage message2 = new DummyMessage(messageSize, this.node2.getOverlayID(), this.node1.getOverlayID());\n\t\tDummyMessage message3 = new DummyMessage(messageSize, this.node2.getOverlayID(), this.node1.getOverlayID());\n\t\t\n\t\tthis.node2.sendTestMessage(0 * Simulator.MINUTE_UNIT + timeOffset, message1, addressOfNode1);\n\t\tthis.node3.sendTestMessage(2 * Simulator.MINUTE_UNIT + timeOffset, message2, addressOfNode1);\n\t\tthis.node4.sendTestMessage(4 * Simulator.MINUTE_UNIT + timeOffset, message3, addressOfNode1);\n\t\t\n\t\ttimeOffset += Simulator.HOUR_UNIT;\n\t\t\n\t\t//Um 1 Tick verschoben:\n\t\tDummyMessage message4 = new DummyMessage(messageSize, this.node2.getOverlayID(), this.node1.getOverlayID());\n\t\tDummyMessage message5 = new DummyMessage(messageSize, this.node2.getOverlayID(), this.node1.getOverlayID());\n\t\tDummyMessage message6 = new DummyMessage(messageSize, this.node2.getOverlayID(), this.node1.getOverlayID());\n\t\t\n\t\tthis.node2.sendTestMessage(0 + timeOffset, message4, addressOfNode1);\n\t\tthis.node3.sendTestMessage(1 + timeOffset, message5, addressOfNode1);\n\t\tthis.node4.sendTestMessage(2 + timeOffset, message6, addressOfNode1);\n\t\t\n\t\ttimeOffset += Simulator.HOUR_UNIT;\n\t\t\n\t\t//Um 45 Sekunden verschoben:\n\t\tDummyMessage message7 = new DummyMessage(messageSize, this.node2.getOverlayID(), this.node1.getOverlayID());\n\t\tDummyMessage message8 = new DummyMessage(messageSize, this.node2.getOverlayID(), this.node1.getOverlayID());\n\t\tDummyMessage message9 = new DummyMessage(messageSize, this.node2.getOverlayID(), this.node1.getOverlayID());\n\t\t\n\t\tthis.node2.sendTestMessage( 0 * Simulator.SECOND_UNIT + timeOffset, message7, addressOfNode1);\n\t\tthis.node3.sendTestMessage(45 * Simulator.SECOND_UNIT + timeOffset, message8, addressOfNode1);\n\t\tthis.node4.sendTestMessage(90 * Simulator.SECOND_UNIT + timeOffset, message9, addressOfNode1);\n\t\t\n\t\ttimeOffset += Simulator.HOUR_UNIT;\n\t\t\n\t\tDummyMessage messageA = new DummyMessage(1024 * 1024 * 1024, this.node2.getOverlayID(), this.node1.getOverlayID());\n\t\tthis.node2.sendTestMessage(timeOffset, messageA, addressOfNode1);\n\t\t\n\t\ttimeOffset += (5 * 24 * Simulator.HOUR_UNIT);\n\t\t\n\t\tDummyMessage messageB = new DummyMessage(1024 * 1024, this.node2.getOverlayID(), this.node1.getOverlayID());\n\t\tDummyMessage messageC = new DummyMessage( 100, this.node2.getOverlayID(), this.node1.getOverlayID());\n\t\tDummyMessage messageD = new DummyMessage(1024 * 1024, this.node2.getOverlayID(), this.node1.getOverlayID());\n\t\t\n\t\tDummyMessage messageE = new DummyMessage(1024 * 1024, this.node2.getOverlayID(), this.node1.getOverlayID());\n\t\tDummyMessage messageF = new DummyMessage( 1, this.node2.getOverlayID(), this.node1.getOverlayID());\n\t\tDummyMessage messageG = new DummyMessage(1024 * 1024, this.node2.getOverlayID(), this.node1.getOverlayID());\n\t\t\n\t\tDummyMessage messageH = new DummyMessage(1024 * 1024, this.node2.getOverlayID(), this.node1.getOverlayID());\n\t\tDummyMessage messageI = new DummyMessage( 0, this.node2.getOverlayID(), this.node1.getOverlayID());\n\t\tDummyMessage messageJ = new DummyMessage(1024 * 1024, this.node2.getOverlayID(), this.node1.getOverlayID());\n\t\t\n\t\tDummyMessage messageK = new DummyMessage(1024 * 1024, this.node2.getOverlayID(), this.node1.getOverlayID());\n\t\tDummyMessage messageL = new DummyMessage(1024 * 1024, this.node2.getOverlayID(), this.node1.getOverlayID());\n\t\tDummyMessage messageM = new DummyMessage(1024 * 1024, this.node2.getOverlayID(), this.node1.getOverlayID());\n\t\t\n\t\tthis.node2.sendTestMessage(0 + timeOffset, messageB, addressOfNode1);\n\t\tthis.node2.sendTestMessage(1 + timeOffset, messageC, addressOfNode1);\n\t\tthis.node2.sendTestMessage(2 + timeOffset, messageD, addressOfNode1);\n\t\t\n\t\ttimeOffset += Simulator.HOUR_UNIT;\n\t\t\n\t\tthis.node2.sendTestMessage(0 + timeOffset, messageE, addressOfNode1);\n\t\tthis.node2.sendTestMessage(1 + timeOffset, messageF, addressOfNode1);\n\t\tthis.node2.sendTestMessage(2 + timeOffset, messageG, addressOfNode1);\n\t\t\n\t\ttimeOffset += Simulator.HOUR_UNIT;\n\t\t\n\t\tthis.node2.sendTestMessage(0 + timeOffset, messageH, addressOfNode1);\n\t\tthis.node2.sendTestMessage(1 + timeOffset, messageI, addressOfNode1);\n\t\tthis.node2.sendTestMessage(2 + timeOffset, messageJ, addressOfNode1);\n\t\t\n\t\ttimeOffset += Simulator.HOUR_UNIT;\n\t\t\n\t\tthis.node2.sendTestMessage(0 + timeOffset, messageK, addressOfNode1);\n\t\tthis.node2.sendTestMessage(1 + timeOffset, messageL, addressOfNode1);\n\t\tthis.node2.sendTestMessage(2 + timeOffset, messageM, addressOfNode1);\n\t\t\n\t\ttimeOffset += Simulator.HOUR_UNIT;\n\t\t\n\t\t\n\t\tDummyMessage messageN = new DummyMessage(1024 * 1024, this.node2.getOverlayID(), this.node1.getOverlayID());\n\t\tDummyMessage messageO = new DummyMessage( 100, this.node3.getOverlayID(), this.node1.getOverlayID());\n\t\tDummyMessage messageP = new DummyMessage(1024 * 1024, this.node4.getOverlayID(), this.node1.getOverlayID());\n\t\t\n\t\tDummyMessage messageQ = new DummyMessage(1024 * 1024, this.node2.getOverlayID(), this.node1.getOverlayID());\n\t\tDummyMessage messageR = new DummyMessage( 1, this.node3.getOverlayID(), this.node1.getOverlayID());\n\t\tDummyMessage messageS = new DummyMessage(1024 * 1024, this.node4.getOverlayID(), this.node1.getOverlayID());\n\t\t\n\t\tDummyMessage messageT = new DummyMessage(1024 * 1024, this.node2.getOverlayID(), this.node1.getOverlayID());\n\t\tDummyMessage messageU = new DummyMessage( 0, this.node3.getOverlayID(), this.node1.getOverlayID());\n\t\tDummyMessage messageV = new DummyMessage(1024 * 1024, this.node4.getOverlayID(), this.node1.getOverlayID());\n\t\t\n\t\tDummyMessage messageW = new DummyMessage(1024 * 1024, this.node2.getOverlayID(), this.node1.getOverlayID());\n\t\tDummyMessage messageX = new DummyMessage(1024 * 1024, this.node3.getOverlayID(), this.node1.getOverlayID());\n\t\tDummyMessage messageY = new DummyMessage(1024 * 1024, this.node4.getOverlayID(), this.node1.getOverlayID());\n\t\t\n\t\t\n\t\tthis.node2.sendTestMessage(0 + timeOffset, messageN, addressOfNode1);\n\t\tthis.node3.sendTestMessage(1 + timeOffset, messageO, addressOfNode1);\n\t\tthis.node4.sendTestMessage(2 + timeOffset, messageP, addressOfNode1);\n\t\t\n\t\ttimeOffset += Simulator.HOUR_UNIT;\n\t\t\n\t\tthis.node2.sendTestMessage(0 + timeOffset, messageQ, addressOfNode1);\n\t\tthis.node3.sendTestMessage(1 + timeOffset, messageR, addressOfNode1);\n\t\tthis.node4.sendTestMessage(2 + timeOffset, messageS, addressOfNode1);\n\t\t\n\t\ttimeOffset += Simulator.HOUR_UNIT;\n\t\t\n\t\tthis.node2.sendTestMessage(0 + timeOffset, messageT, addressOfNode1);\n\t\tthis.node3.sendTestMessage(1 + timeOffset, messageU, addressOfNode1);\n\t\tthis.node4.sendTestMessage(2 + timeOffset, messageV, addressOfNode1);\n\t\t\n\t\ttimeOffset += Simulator.HOUR_UNIT;\n\t\t\n\t\tthis.node2.sendTestMessage(0 + timeOffset, messageW, addressOfNode1);\n\t\tthis.node3.sendTestMessage(1 + timeOffset, messageX, addressOfNode1);\n\t\tthis.node4.sendTestMessage(2 + timeOffset, messageY, addressOfNode1);\n\t\t\n\t\ttimeOffset += Simulator.HOUR_UNIT;\n\t\t\n\t\t\n\t\tint numberOfMessages = 100;\n\t\tDummyMessage messages[] = new DummyMessage[numberOfMessages];\n\t\tfor (int i = 0; i < numberOfMessages; i++) {\n\t\t\tmessages[i] = new DummyMessage(1024 * 1024, this.node2.getOverlayID(), this.node1.getOverlayID());\n\t\t\tthis.node2.sendTestMessage(timeOffset + i, messages[i], addressOfNode1);\n\t\t}\n\t\t\n\t\ttimeOffset += numberOfMessages * Simulator.HOUR_UNIT;\n\t\t\n\t\trunSimulation(timeOffset);\n\t\t\n\t\tSystem.out.println(\"\\nBandbreite in Byte pro Sekunde: \" + bandwith);\n\t\t\n\t\tSystem.out.println(\"\\nNacheinander mit gen�gend Abstand:\");\n\t\tSystem.out.println(message1);\n\t\tSystem.out.println(message2);\n\t\tSystem.out.println(message3);\n\t\t\n\t\tSystem.out.println(\"\\nMit einem Tick Abstand:\");\n\t\tSystem.out.println(message4);\n\t\tSystem.out.println(message5);\n\t\tSystem.out.println(message6);\n\t\t\n\t\tSystem.out.println(\"\\nUm 1 Sekunde verschoben:\");\n\t\tSystem.out.println(message7);\n\t\tSystem.out.println(message8);\n\t\tSystem.out.println(message9);\n\t\t\n\t\tSystem.out.println('\\n');\n\t\tSystem.out.println(\"\\nEin Gigabyte:\");\n\t\tSystem.out.println(messageA);\n\t\t\n\t\tSystem.out.println('\\n');\n\t\tSystem.out.println(\"\\nVier mal drei Nachrichten, alle drei von Node2 nach Node1:\");\n\t\tSystem.out.println(\"\\nEin MiByte, 100 Byte, ein MiByte:\");\n\t\tSystem.out.println(messageB);\n\t\tSystem.out.println(messageC);\n\t\tSystem.out.println(messageD);\n\t\t\n\t\tSystem.out.println(\"\\nEin MiByte, 1 Byte, ein MiByte:\");\n\t\tSystem.out.println(messageE);\n\t\tSystem.out.println(messageF);\n\t\tSystem.out.println(messageG);\n\t\t\n\t\tSystem.out.println(\"\\nEin MiByte, 0 Byte, ein MiByte:\");\n\t\tSystem.out.println(messageH);\n\t\tSystem.out.println(messageI);\n\t\tSystem.out.println(messageJ);\n\t\t\n\t\tSystem.out.println(\"\\nEin MiByte, ein MiByte, ein MiByte:\");\n\t\tSystem.out.println(messageK);\n\t\tSystem.out.println(messageL);\n\t\tSystem.out.println(messageM);\n\t\t\n\t\tSystem.out.println('\\n');\n\t\tSystem.out.println(\"\\nVier mal drei Nachrichten, je eine von Node2, Node3 und Node4, alle zu Node1:\");\n\t\tSystem.out.println(\"\\nEin MiByte, 100 Byte, ein MiByte:\");\n\t\tSystem.out.println(messageN);\n\t\tSystem.out.println(messageO);\n\t\tSystem.out.println(messageP);\n\t\t\n\t\tSystem.out.println(\"\\nEin MiByte, 1 Byte, ein MiByte:\");\n\t\tSystem.out.println(messageQ);\n\t\tSystem.out.println(messageR);\n\t\tSystem.out.println(messageS);\n\t\t\n\t\tSystem.out.println(\"\\nEin MiByte, 0 Byte, ein MiByte:\");\n\t\tSystem.out.println(messageT);\n\t\tSystem.out.println(messageU);\n\t\tSystem.out.println(messageV);\n\t\t\n\t\tSystem.out.println(\"\\nEin MiByte, ein MiByte, ein MiByte:\");\n\t\tSystem.out.println(messageW);\n\t\tSystem.out.println(messageX);\n\t\tSystem.out.println(messageY);\n\t\t\n\t\t\n\t\tSystem.out.println('\\n');\n\t\tSystem.out.println(\"\\nMehrere Nachrichten sehr kurz hintereinander (1 Tick Abstand); alle von Node2 zu Node1:\");\n\t\tfor (int i = 0; i < numberOfMessages; i++) {\n\t\t\tSystem.out.println(messages[i]);\n\t\t}\n\t\t\n\t}", "@Test\n\tpublic void testBidirectionalCommunicationWithResponses() {\n\n\t\t// due to TIME_WAIT after closing a connection we cannot reuse a fixed\n\t\t// port since this would cause multiple test runs in a row to fail.\n\t\t// therefore, get two free ports we can use.\n\t\tint port0, port1;\n\t\ttry {\n\t\t\tport0 = PortFinder.findOpen();\n\t\t\tport1 = PortFinder.findOpen();\n\t\t} catch (IOException e2) {\n\t\t\tfail(\"could not allocate local ports\");\n\t\t\treturn;\n\t\t}\n\n\t\tfinal Socket sock1 = new Socket();\n\n\t\tThread adminThread = null;\n\n\t\t// sock0 is \"server\", waiting for sock1 to connect\n\t\ttry {\n\t\t\tfinal ServerSocket tempServer = new ServerSocket();\n\t\t\ttempServer.bind(new InetSocketAddress(\"localhost\", port0));\n\n\t\t\tadminThread = new Thread(new Runnable() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tSocket sock0 = null;\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tsock0 = tempServer.accept();\n\t\t\t\t\t\ttempServer.close();\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\tfail(\"connection failed (3)\");\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\ttempServer.close();\n\t\t\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t\t\t// ignore\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tFullDuplexMPI party0 = null;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tparty0 = new FullDuplexMPI(sock0, System.out, true) {\n\n\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\tpublic IMessage processIncomingMessage(IMessage message) {\n\t\t\t\t\t\t\t\tassertTrue(message instanceof ConfirmationMessage);\n\t\t\t\t\t\t\t\tassertTrue(((ConfirmationMessage) message).STATUS_CODE == party1Counter);\n\t\t\t\t\t\t\t\treturn new ConfirmationMessage(--party1Counter, null);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t\tsendRecursiveAsyncMessages(party0, true);\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tfail(\"connection failed (0)\");\n\t\t\t\t\t}\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// moderate timeout to make sure we eventually get a\n\t\t\t\t\t\t// failure\n\t\t\t\t\t\tlatch.await(20, TimeUnit.SECONDS);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\tfail(\"unexpected interruption\");\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tif (party0 != null) {\n\t\t\t\t\t\t\tparty0.close();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t} catch (IOException e1) {\n\t\t\te1.printStackTrace();\n\t\t\tfail(\"connection failed (2)\");\n\t\t}\n\n\t\tadminThread.start();\n\n\t\tFullDuplexMPI party1 = null;\n\n\t\t// sock1 is \"client\"\n\t\ttry {\n\t\t\tsock1.bind(new InetSocketAddress(\"localhost\", port1));\n\t\t\tsock1.connect(new InetSocketAddress(\"localhost\", port0));\n\t\t\tparty1 = new FullDuplexMPI(sock1, System.out, true) {\n\n\t\t\t\t@Override\n\t\t\t\tpublic IMessage processIncomingMessage(IMessage message) {\n\t\t\t\t\tassertTrue(message instanceof ConfirmationMessage);\n\t\t\t\t\tassertTrue(((ConfirmationMessage) message).STATUS_CODE == party0Counter);\n\t\t\t\t\treturn new ConfirmationMessage(++party0Counter, null);\n\t\t\t\t}\n\t\t\t};\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\tfail(\"connection failed (1)\");\n\t\t}\n\n\t\tassert party1 != null;\n\t\tsendRecursiveAsyncMessages(party1, false);\n\n\t\ttry {\n\t\t\t// moderate timeout to make sure we eventually get a failure\n\t\t\tlatch.await(20, TimeUnit.SECONDS);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t\tfail(\"unexpected interruption (1)\");\n\t\t}\n\n\t\t// check if all messages were acknowledged\n\t\tassertEquals(99, party0Counter);\n\t\tassertEquals(1, party1Counter);\n\n\t\ttry {\n\t\t\tsock1.close();\n\t\t} catch (IOException e) {\n\t\t\t// ignore\n\t\t}\n\t\ttry {\n\t\t\tadminThread.join();\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t\tfail(\"unexpected interruption (2)\");\n\t\t}\n\t}", "private void processMessage(String msg) {\n\t\t\tif (msg.equals(Message.TEST_SERVER)) {\n\t\t\t\tSystem.out.println(\"Server test passed. Testing client...\");\n\t\t\t\tpw.println(Message.TEST_CLIENT);\n\t\t\t}\n\t\t}", "public void testSuccessfulLastCommunicationSMS() {\n\t\t// Arrange\n\t\tPhoneNumberDTO sourceDTO = new PhoneNumberDTO(EXISTING_NUMBER);\n\t\tPhoneNumberDTO destinationDTO = new PhoneNumberDTO(EXISTING_NUMBER2);\n\t\tLastMadeCommunicationDTO lastCommunication = null;\n\t\tGetLastMadeCommunicationService sourceService\n\t\t\t= new GetLastMadeCommunicationService(sourceDTO);\n\t\tGetLastMadeCommunicationService destinationService\n\t\t\t= new GetLastMadeCommunicationService(destinationDTO);\n\t\tSendSMSDTO sendSMSDTO = new SendSMSDTO(\n\t\t\t\tMESSAGE,\n\t\t\t\tEXISTING_NUMBER,\n\t\t\t\tEXISTING_NUMBER2);\n\t\tSMSDTO responseDTO = null;\n\t\tSendSMSService sendService = new SendSMSService(sendSMSDTO);\n\t\tReceiveSMSService receiveService = null;\n\t\t\n\t\t// Act\n\t\tsendService.execute();\n\t\tresponseDTO = sendService.getSMSDTO();\n\t\treceiveService = new ReceiveSMSService(responseDTO);\n\t\treceiveService.execute();\n\t\tsourceService.execute();\n\t\tlastCommunication = sourceService.getLastCommunication();\n\t\ttry {\n\t\t\tdestinationService.execute();\n\t\t\tfail(\"There shouldn't be a last made communication in the \"\n\t\t\t\t\t+ \"destination Phone\");\n\t\t} catch(NoMadeCommunication nmc) { /* Nothing to do here */ }\n\t\t\n\t\t// Assert\n\t\tassertLastCommunication(\n\t\t\t\tlastCommunication,\n\t\t\t\tcommunicationRepresentation.getSMSCommunication(),\n\t\t\t\tEXISTING_NUMBER2,\n\t\t\t\tEXPECTED_SMS_COST,\n\t\t\t\tMESSAGE.length());\n\t}", "public boolean run() throws IOException {\n SapMessage inMsg = null;\n boolean done;\n for(SeqStep step : sequence) {\n\n /* Write all requests - if any */\n if(step.requests != null) {\n for(SapMessage request : step.requests) {\n if(request != null) {\n Log.i(TAG, \"Writing request: \" +\n SapMessage.getMsgTypeName(request.getMsgType()));\n writeSapMessage(request, false); // write the message without flushing\n }\n }\n writeSapMessage(null, true); /* flush the pipe */\n }\n\n /* Handle and validate all responses - if any */\n if(step.hasResponse() == true) {\n done = false;\n boolean foundMatch = false;\n SapMessage responseMatch;\n while(!done) {\n for(SapMessage response : step.responses) {\n if(response != null)\n Log.i(TAG, \"Waiting for the response: \" +\n SapMessage.getMsgTypeName(response.getMsgType()));\n }\n inMsg = readSapMessage();\n if(inMsg != null)\n Log.i(TAG, \"Read message: \" +\n SapMessage.getMsgTypeName(inMsg.getMsgType()));\n else\n assertTrue(\"Failed to read message.\", false);\n\n responseMatch = null;\n for(SapMessage response : step.responses) {\n if(response != null\n && inMsg.getMsgType() == response.getMsgType()\n && compareSapMessages(inMsg, response) == true) {\n foundMatch = true;\n responseMatch = response;\n break;\n }\n }\n\n if(responseMatch != null)\n step.responses.remove(responseMatch);\n\n /* If we are expecting no more responses for this step, continue. */\n if(step.hasResponse() != true) {\n done = true;\n }\n /* Ensure what we received was expected */\n assertTrue(\"wrong message received.\", foundMatch);\n }\n }\n }\n return true;\n }", "@Test\n public void testProcessControlChannelProgramUpdates() throws Exception {\n createTethering(\"xyz\", NAMESPACES, REQUEST_TIME, DESCRIPTION);\n acceptTethering();\n expectTetheringControlResponse(\"xyz\", HttpResponseStatus.OK);\n\n // Add program update Notifications to body\n HttpRequest.Builder builder =\n HttpRequest.builder(HttpMethod.POST, config.resolveURL(\"tethering/channels/xyz\"));\n ProgramRunId programRunId =\n new ProgramRunId(\"system\", \"app\", ProgramType.SPARK, \"program\", \"run\");\n Notification programUpdate =\n new Notification(\n Notification.Type.PROGRAM_STATUS,\n ImmutableMap.of(ProgramOptionConstants.PROGRAM_RUN_ID, GSON.toJson(programRunId)));\n TetheringControlChannelRequest content =\n new TetheringControlChannelRequest(null, ImmutableList.of(programUpdate));\n builder.withBody(GSON.toJson(content));\n HttpResponse response = HttpRequests.execute(builder.build());\n Assert.assertEquals(HttpResponseStatus.OK.code(), response.getResponseCode());\n\n // Check that program update was persisted as a state transition in TMS\n try (CloseableIterator<Message> iterator =\n new MultiThreadMessagingContext(messagingService)\n .getMessageFetcher()\n .fetch(\n NamespaceId.SYSTEM.getNamespace(),\n cConf.get(Constants.AppFabric.PROGRAM_STATUS_EVENT_TOPIC),\n 1,\n null)) {\n Assert.assertTrue(iterator.hasNext());\n Notification notification =\n iterator.next().decodePayload(r -> GSON.fromJson(r, Notification.class));\n Assert.assertEquals(programUpdate, notification);\n Map<String, String> properties = notification.getProperties();\n Assert.assertEquals(\n GSON.toJson(programRunId), properties.get(ProgramOptionConstants.PROGRAM_RUN_ID));\n }\n }", "@Test\n\tpublic void testMessageToSlack() {\n\t\tConfigurationManager config = new ConfigurationManager();\n\t\tHashMap<String, String> parameters = new HashMap<String, String>();\n\t\tRequestObject request = new RequestObject(\"GET\", \"/slack\", parameters);\n\t\tcheckMessageToSlack(config.getConfig(), request, \"\");\n\t\tparameters.put(\"message\", \"HELLO!\");\n\t\tcheckMessageToSlack(config.getConfig(), request, \"\");\n\t\trequest.setMethod(\"POST\");\n\t\tcheckMessageToSlack(config.getConfig(), request, \"HELLO!\");\n\t\tparameters.remove(\"message\");\n\t\tparameters.put(\"asin\", \"ABC123\");\n\t\tcheckMessageToSlack(config.getConfig(), request, \"\");\n\t\tparameters.put(\"message\", \"BYE!\");\n\t\tcheckMessageToSlack(config.getConfig(), request, \"BYE!\");\n\t}", "private synchronized boolean sendBatch() {\n if (fPending.isEmpty()) {\n return true;\n }\n\n final long nowMs = Clock.now();\n\n if (this.fHostSelector != null) {\n host = this.fHostSelector.selectBaseHost();\n }\n\n final String httpurl = MRConstants.makeUrl(host, fTopic, props.getProperty(DmaapClientConst.PROTOCOL),\n props.getProperty(DmaapClientConst.PARTITION));\n\n try {\n\n final ByteArrayOutputStream baseStream = new ByteArrayOutputStream();\n OutputStream os = baseStream;\n final String contentType = props.getProperty(DmaapClientConst.CONTENT_TYPE);\n if (contentType.equalsIgnoreCase(MRFormat.JSON.toString())) {\n JSONArray jsonArray = parseJSON();\n os.write(jsonArray.toString().getBytes());\n os.close();\n\n } else if (contentType.equalsIgnoreCase(CONTENT_TYPE_TEXT)) {\n for (TimestampedMessage m : fPending) {\n os.write(m.fMsg.getBytes());\n os.write('\\n');\n }\n os.close();\n } else if (contentType.equalsIgnoreCase(MRFormat.CAMBRIA.toString())\n || (contentType.equalsIgnoreCase(MRFormat.CAMBRIA_ZIP.toString()))) {\n if (contentType.equalsIgnoreCase(MRFormat.CAMBRIA_ZIP.toString())) {\n os = new GZIPOutputStream(baseStream);\n }\n for (TimestampedMessage m : fPending) {\n\n os.write((\"\" + m.fPartition.length()).getBytes());\n os.write('.');\n os.write((\"\" + m.fMsg.length()).getBytes());\n os.write('.');\n os.write(m.fPartition.getBytes());\n os.write(m.fMsg.getBytes());\n os.write('\\n');\n }\n os.close();\n } else {\n for (TimestampedMessage m : fPending) {\n os.write(m.fMsg.getBytes());\n\n }\n os.close();\n }\n\n final long startMs = Clock.now();\n if (ProtocolType.DME2.getValue().equalsIgnoreCase(protocolFlag)) {\n\n configureDME2();\n\n this.wait(5);\n if (fPending.peek() != null) {\n logSendMessage(fPending.size(), url + subContextPath, nowMs - fPending.peek().timestamp);\n }\n sender.setPayload(os.toString());\n String dmeResponse = sender.sendAndWait(5000L);\n\n logTime(startMs, dmeResponse);\n fPending.clear();\n return true;\n }\n\n if (ProtocolType.AUTH_KEY.getValue().equalsIgnoreCase(protocolFlag)) {\n if (fPending.peek() != null) {\n logSendMessage(fPending.size(), httpurl, nowMs - fPending.peek().timestamp);\n }\n final JSONObject result =\n postAuth(new PostAuthDataObject().setPath(httpurl).setData(baseStream.toByteArray())\n .setContentType(contentType).setAuthKey(authKey).setAuthDate(authDate)\n .setUsername(username).setPassword(password).setProtocolFlag(protocolFlag));\n // Here we are checking for error response. If HTTP status\n // code is not within the http success response code\n // then we consider this as error and return false\n if (result.getInt(JSON_STATUS) < 200 || result.getInt(JSON_STATUS) > 299) {\n return false;\n }\n logTime(startMs, result.toString());\n fPending.clear();\n return true;\n }\n\n if (ProtocolType.AAF_AUTH.getValue().equalsIgnoreCase(protocolFlag)) {\n if (fPending.peek() != null) {\n logSendMessage(fPending.size(), httpurl, nowMs - fPending.peek().timestamp);\n }\n final JSONObject result = post(httpurl, baseStream.toByteArray(), contentType, username, password,\n protocolFlag);\n\n // Here we are checking for error response. If HTTP status\n // code is not within the http success response code\n // then we consider this as error and return false\n if (result.getInt(JSON_STATUS) < 200 || result.getInt(JSON_STATUS) > 299) {\n return false;\n }\n logTime(startMs, result.toString());\n fPending.clear();\n return true;\n }\n\n if (ProtocolType.HTTPNOAUTH.getValue().equalsIgnoreCase(protocolFlag)) {\n if (fPending.peek() != null) {\n logSendMessage(fPending.size(), httpurl, nowMs - fPending.peek().timestamp);\n }\n final JSONObject result = postNoAuth(httpurl, baseStream.toByteArray(), contentType);\n\n // Here we are checking for error response. If HTTP status\n // code is not within the http success response code\n // then we consider this as error and return false\n if (result.getInt(JSON_STATUS) < 200 || result.getInt(JSON_STATUS) > 299) {\n return false;\n }\n logTime(startMs, result.toString());\n fPending.clear();\n return true;\n }\n } catch (InterruptedException e) {\n getLog().warn(\"Interrupted!\", e);\n // Restore interrupted state...\n Thread.currentThread().interrupt();\n } catch (Exception x) {\n getLog().warn(x.getMessage(), x);\n }\n return false;\n }", "public void testGetPostTransferCommand() throws Exception {\n System.out.println(\"getPostTransferCommand\");\n \n String expResult = \"None\";\n String result = instance.getPostTransferCommand();\n assertEquals(expResult, result);\n \n }", "public static void processGraphInformation () {\n\n for (int i = 0; i < data.length(); i++) {\n if (data.charAt(i) == ',')\n cutPoints.add(i);\n }\n if(isNumeric(data.substring(1, cutPoints.get(0))))\n tempPPGWaveBuffer.add(Double.parseDouble(data.substring(1, cutPoints.get(0))));\n for (int j = 0; j < cutPoints.size(); j++) {\n\n if (j==cutPoints.size()-1){\n if(isNumeric(data.substring(cutPoints.get(j)+1,endOfLineIndex )))\n tempPPGWaveBuffer.add(Double.parseDouble(data.substring(cutPoints.get(j)+1,endOfLineIndex )));\n } else{\n if(isNumeric(data.substring(cutPoints.get(j) + 1, cutPoints.get(j+1))))\n tempPPGWaveBuffer.add(Double.parseDouble(data.substring(cutPoints.get(j) + 1, cutPoints.get(j+1))));\n }\n\n }\n graphIn.obtainMessage(handlerState4, Integer.toString(tempSampleTime)).sendToTarget(); //Comment this part to run junit tests\n if (tempSampleTime != 0) {\n tempReceived = true;\n graphIn.obtainMessage(handlerState2, Boolean.toString(tempReceived)).sendToTarget(); //Comment this part to run junit tests\n graphIn.obtainMessage(handlerState1, tempPPGWaveBuffer).sendToTarget(); //Comment this part to run junit tests\n } else {\n tempReceived = false;\n graphIn.obtainMessage(handlerState2, Boolean.toString(tempReceived)).sendToTarget(); //Comment this part to run junit tests\n }\n }", "@Test\n\tpublic void testData() {\n\t\tassertEquals(\"Ciao mamma\", myReply.getData());\n\t}", "@Test\n public void serverFinishesStreamWithHeaders() throws Exception {\n peer.sendFrame().settings(new Settings());\n peer.acceptFrame();// ACK\n\n peer.acceptFrame();// SYN_STREAM\n\n peer.acceptFrame();// PING\n\n peer.sendFrame().headers(true, 3, TestUtil.headerEntries(\"headers\", \"bam\"));\n peer.sendFrame().ping(true, 1, 0);// PONG\n\n peer.play();\n // play it back\n Http2Connection connection = connect(peer);\n Http2Stream stream = connection.newStream(TestUtil.headerEntries(\"a\", \"artichaut\"), false);\n connection.writePingAndAwaitPong();\n Assert.assertEquals(Headers.of(\"headers\", \"bam\"), stream.takeHeaders());\n Assert.assertEquals(Util.EMPTY_HEADERS, stream.trailers());\n Assert.assertEquals(0, connection.openStreamCount());\n // verify the peer received what was expected\n MockHttp2Peer.InFrame synStream = peer.takeFrame();\n Assert.assertEquals(TYPE_HEADERS, synStream.type);\n Assert.assertFalse(synStream.outFinished);\n Assert.assertEquals(3, synStream.streamId);\n Assert.assertEquals((-1), synStream.associatedStreamId);\n Assert.assertEquals(TestUtil.headerEntries(\"a\", \"artichaut\"), synStream.headerBlock);\n }", "@Test\n\tpublic void testFastSuggestPieceMessage() throws Exception {\n\n\t\t// Given\n\t\tfinal PieceDatabase pieceDatabase = MockPieceDatabase.create (\"00000\", 16384);\n\t\tpieceDatabase.start (true);\n\t\tfinal BlockDescriptor requestDescriptor = new BlockDescriptor (2, 0, 16384);\n\t\tPeerServices peerServices = mock (PeerServices.class);\n\t\tPeerSetContext peerSetContext = new PeerSetContext (peerServices, pieceDatabase, mock (RequestManager.class), null);\n\t\twhen(peerSetContext.requestManager.piecesAvailable (any (ManageablePeer.class))).thenReturn (true);\n\t\twhen(peerSetContext.requestManager.allocateRequests (any (ManageablePeer.class), anyInt(), eq (true))).thenReturn (new ArrayList<BlockDescriptor>());\n\t\twhen(peerSetContext.requestManager.allocateRequests (any (ManageablePeer.class), anyInt(), eq (false))).thenReturn (Arrays.asList (new BlockDescriptor[] { requestDescriptor }));\n\t\tMockConnection mockConnection = new MockConnection();\n\t\tPeerHandler handler = new PeerHandler (peerSetContext, mockConnection, new PeerID(), new PeerStatistics(), true, false);\n\n\t\t// When\n\t\t// They suggest a piece and unchoke\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveAllMessage());\n\t\tmockConnection.mockInput (PeerProtocolBuilder.suggestPieceMessage (2));\n\t\tmockConnection.mockInput (PeerProtocolBuilder.unchokeMessage());\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.haveNoneMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.interestedMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.requestMessage (requestDescriptor));\n\t\tmockConnection.mockExpectNoMoreOutput();\n\t\tverify(peerSetContext.requestManager).pieceSuggested (handler, 2);\n\t\tassertTrue (mockConnection.isOpen());\n\n\n\t\tpieceDatabase.terminate (true);\n\n\t}", "@SmallTest\n @Test\n public void testReceiveMessage() {\n ArraySet<RtpHeaderExtension> extension = new ArraySet<>();\n extension.add(mParams.extension);\n mRtpTransport.onRtpHeaderExtensionsReceived(extension);\n\n verify(mCallback).onMessagesReceived(mMessagesCaptor.capture());\n Set<Communicator.Message> messages = mMessagesCaptor.getValue();\n assertEquals(1, messages.size());\n assertTrue(messages.contains(mParams.commMessage));\n }", "@Ignore\n @Test\n public void testSendMessage() throws Exception {\n System.out.println(\"sendMessage\");\n PooledConnection MQConn = null;\n String QueueName = \"\";\n Serializable message = null;\n Map<String, Object> properties = null;\n String expResult = \"\";\n String result = JMSUtil.sendMessage(MQConn, QueueName, message, properties,0);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "@Test public void testVerifyProcessing() throws Exception {\n Data data = new Data(new Long(1l), \"test\");\n gigaSpace.write(data);\n\n // create a template of the processed data (processed)\n Data template = new Data();\n template.setType(new Long(1l));\n template.setProcessed(Boolean.TRUE);\n\n // wait for the result\n Data result = (Data)gigaSpace.take(template, 500);\n // verify it\n assertNotNull(\"No data object was processed\", result);\n assertEquals(\"Processed Flag is false, data was not processed\", Boolean.TRUE, result.isProcessed());\n assertEquals(\"Processed text mismatch\", \"PROCESSED : \" + data.getRawData(), result.getData());\n }", "@Test\n public void simpleTest() throws Exception {\n final String data = \"Simple Text \" + UUID.randomUUID().toString();\n final String queueName = \"simpleQueue\";\n final String addressName = \"simpleAddress\";\n\n // Create a queue bound to a particular address where the test will send to & consume from.\n session.createQueue(new QueueConfiguration(queueName).setAddress(addressName).setRoutingType(RoutingType.ANYCAST));\n\n // Create a producer to send a message to the previously created address.\n ClientProducer producer = session.createProducer(addressName);\n\n // Create a non-durable message.\n ClientMessage message = session.createMessage(false);\n\n // Put some data into the message.\n message.getBodyBuffer().writeString(data);\n\n // Send the message. This send will be auto-committed based on the way the session was created in setUp()\n producer.send(message);\n\n // Close the producer.\n producer.close();\n\n // Create a consumer on the queue bound to the address where the message was sent.\n ClientConsumer consumer = session.createConsumer(queueName);\n\n // Start the session to allow messages to be consumed.\n session.start();\n\n // Receive the message we sent previously.\n message = consumer.receive(1000);\n\n // Ensure the message was received.\n assertNotNull(message);\n\n // Acknowledge the message.\n message.acknowledge();\n\n // Ensure the data in the message received matches the data in the message sent.\n assertEquals(data, message.getBodyBuffer().readString());\n }" ]
[ "0.6641773", "0.63488084", "0.6276477", "0.62407184", "0.6237182", "0.62033784", "0.6148747", "0.6092132", "0.60837424", "0.6068657", "0.6043825", "0.60282475", "0.5960788", "0.5955825", "0.5914987", "0.5904903", "0.59017384", "0.5889577", "0.5888334", "0.58638465", "0.5848128", "0.58456093", "0.58084154", "0.58064675", "0.5805063", "0.58048457", "0.57967937", "0.57908493", "0.5786884", "0.5767099", "0.57614535", "0.5754714", "0.57446516", "0.57293814", "0.57285696", "0.57181835", "0.5708176", "0.5704191", "0.56952447", "0.56919193", "0.5680476", "0.5677311", "0.56757116", "0.5673632", "0.5671909", "0.56650627", "0.5640231", "0.56348777", "0.5612292", "0.5609902", "0.56089175", "0.55919373", "0.55874616", "0.5585875", "0.5583257", "0.5581983", "0.5581747", "0.55727524", "0.5571985", "0.5570591", "0.55698717", "0.5565431", "0.5555866", "0.55544275", "0.55523384", "0.5540255", "0.55363375", "0.5536121", "0.5529132", "0.55218554", "0.5514123", "0.55130994", "0.5508455", "0.5504323", "0.5502481", "0.54987586", "0.54941314", "0.5493304", "0.549233", "0.5487973", "0.54863614", "0.54813385", "0.547444", "0.54649293", "0.5446678", "0.544095", "0.54353994", "0.54166925", "0.54143226", "0.5414127", "0.54017615", "0.5400802", "0.5392427", "0.539091", "0.5389118", "0.53887933", "0.5386067", "0.5383028", "0.53716135", "0.5366871" ]
0.8081721
0
TODO write your implementation code here:
@WebMethod(operationName = "Suma") public Integer Suma(@WebParam(name = "num1") Integer num1, @WebParam(name = "num2") Integer num2) { return num1+num2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "private stendhal() {\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n protected void execute() {\n \n }", "@Override\n protected void initialize() {\n\n \n }", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@Override\n protected void prot() {\n }", "@Override\n protected void execute() {\n \n }", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n\tpublic void apply() {\n\t\t\n\t}", "private void getStatus() {\n\t\t\n\t}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n protected void execute() {\n }", "@Override\n protected void execute() {\n }", "@Override\n protected void execute() {\n }", "@Override\r\n protected void parseDocuments()\r\n {\n\r\n }", "@Override\n public void init() {\n\n }", "@Override\n protected void initialize() \n {\n \n }", "private void strin() {\n\n\t}", "@Override\n public void func_104112_b() {\n \n }", "private void poetries() {\n\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "@Override\n protected void execute() {\n\n }", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void execute() {\r\n\t}", "@Override\n void init() {\n }", "@Override\n public void memoria() {\n \n }", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n protected void getExras() {\n }", "@Override\n public void feedingHerb() {\n\n }", "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "protected MetadataUGWD() {/* intentionally empty block */}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void buscar() {\n\r\n\t\t\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tpublic void function() {\n\t\t\n\t}", "@Override\n public void execute() {\n \n \n }", "@Override\n\t\tpublic void rest() {\n\t\t\t\n\t\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "@Override\n public void init() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "@Override\n\tprotected void prepare() {\n\t\t\n\t}", "private void test() {\n\n\t}", "@Override\npublic void processAttributes() {\n\t\n}", "@Override\n public void settings() {\n // TODO Auto-generated method stub\n \n }", "@Override\n public void initialize() { \n }", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tpublic void call() {\n\t\t\n\t}", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "public void identify() {\n\n\t}", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void apply() {\n }", "@Override\n\tpublic void einkaufen() {\n\t}", "OptimizeResponse() {\n\n\t}", "@Override\n public void preprocess() {\n }", "@Override\n public void onCancelled(CancelledException arg0) {\n }", "@Override\n public void onCancelled(CancelledException arg0) {\n }", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\n protected void end() {\n \n }", "@Override\r\n protected void fetchData() {\n\r\n }", "private void kk12() {\n\n\t}", "@Override\r\n\tprotected void processExecute() {\n\r\n\t}", "public void smell() {\n\t\t\n\t}", "@Override\n protected void init() {\n }" ]
[ "0.61942655", "0.5894476", "0.58358824", "0.5829639", "0.58132845", "0.5806423", "0.57288736", "0.5647916", "0.5627548", "0.5618902", "0.5595637", "0.55871207", "0.5572917", "0.55537754", "0.55461985", "0.5530198", "0.5530198", "0.5517781", "0.5517781", "0.5515668", "0.55030555", "0.5482642", "0.5481567", "0.5481567", "0.5481567", "0.5481567", "0.5481567", "0.5481567", "0.54738134", "0.54549265", "0.54549265", "0.5430074", "0.5429312", "0.5416226", "0.5408378", "0.5393004", "0.53735787", "0.5363888", "0.5363888", "0.5363888", "0.53587604", "0.535558", "0.5355374", "0.53518987", "0.5323913", "0.5318221", "0.5318209", "0.527462", "0.52744526", "0.527306", "0.5272263", "0.52659583", "0.5258595", "0.5256852", "0.52546215", "0.5250249", "0.5248738", "0.524774", "0.5241424", "0.52350694", "0.5234315", "0.52299154", "0.52293706", "0.52264595", "0.5224416", "0.5224416", "0.52238625", "0.5222218", "0.5216701", "0.5215392", "0.52086246", "0.5207807", "0.5205528", "0.52017355", "0.51975626", "0.519462", "0.5191433", "0.5189058", "0.51878804", "0.5179277", "0.51790166", "0.5176582", "0.5174333", "0.5172596", "0.5168614", "0.5168489", "0.51641333", "0.5162229", "0.5158603", "0.5158526", "0.5158526", "0.5151796", "0.51454484", "0.51454484", "0.51454484", "0.51454455", "0.51425576", "0.51379347", "0.5132426", "0.5130047", "0.5128777" ]
0.0
-1
TODO write your implementation code here:
@WebMethod(operationName = "Resta") public Integer Resta(@WebParam(name = "num1") Integer num1, @WebParam(name = "num2") Integer num2) { return num1-num2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "private stendhal() {\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n protected void execute() {\n \n }", "@Override\n protected void initialize() {\n\n \n }", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@Override\n protected void prot() {\n }", "@Override\n protected void execute() {\n \n }", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n\tpublic void apply() {\n\t\t\n\t}", "private void getStatus() {\n\t\t\n\t}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n protected void execute() {\n }", "@Override\n protected void execute() {\n }", "@Override\n protected void execute() {\n }", "@Override\r\n protected void parseDocuments()\r\n {\n\r\n }", "@Override\n public void init() {\n\n }", "@Override\n protected void initialize() \n {\n \n }", "private void strin() {\n\n\t}", "@Override\n public void func_104112_b() {\n \n }", "private void poetries() {\n\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "@Override\n protected void execute() {\n\n }", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void execute() {\r\n\t}", "@Override\n void init() {\n }", "@Override\n public void memoria() {\n \n }", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n protected void getExras() {\n }", "@Override\n public void feedingHerb() {\n\n }", "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "protected MetadataUGWD() {/* intentionally empty block */}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void buscar() {\n\r\n\t\t\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tpublic void function() {\n\t\t\n\t}", "@Override\n public void execute() {\n \n \n }", "@Override\n\t\tpublic void rest() {\n\t\t\t\n\t\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "@Override\n public void init() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "@Override\n\tprotected void prepare() {\n\t\t\n\t}", "private void test() {\n\n\t}", "@Override\npublic void processAttributes() {\n\t\n}", "@Override\n public void settings() {\n // TODO Auto-generated method stub\n \n }", "@Override\n public void initialize() { \n }", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tpublic void call() {\n\t\t\n\t}", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "public void identify() {\n\n\t}", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void apply() {\n }", "@Override\n\tpublic void einkaufen() {\n\t}", "OptimizeResponse() {\n\n\t}", "@Override\n public void preprocess() {\n }", "@Override\n public void onCancelled(CancelledException arg0) {\n }", "@Override\n public void onCancelled(CancelledException arg0) {\n }", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\n protected void end() {\n \n }", "@Override\r\n protected void fetchData() {\n\r\n }", "private void kk12() {\n\n\t}", "@Override\r\n\tprotected void processExecute() {\n\r\n\t}", "public void smell() {\n\t\t\n\t}", "@Override\n protected void init() {\n }" ]
[ "0.61942655", "0.5894476", "0.58358824", "0.5829639", "0.58132845", "0.5806423", "0.57288736", "0.5647916", "0.5627548", "0.5618902", "0.5595637", "0.55871207", "0.5572917", "0.55537754", "0.55461985", "0.5530198", "0.5530198", "0.5517781", "0.5517781", "0.5515668", "0.55030555", "0.5482642", "0.5481567", "0.5481567", "0.5481567", "0.5481567", "0.5481567", "0.5481567", "0.54738134", "0.54549265", "0.54549265", "0.5430074", "0.5429312", "0.5416226", "0.5408378", "0.5393004", "0.53735787", "0.5363888", "0.5363888", "0.5363888", "0.53587604", "0.535558", "0.5355374", "0.53518987", "0.5323913", "0.5318221", "0.5318209", "0.527462", "0.52744526", "0.527306", "0.5272263", "0.52659583", "0.5258595", "0.5256852", "0.52546215", "0.5250249", "0.5248738", "0.524774", "0.5241424", "0.52350694", "0.5234315", "0.52299154", "0.52293706", "0.52264595", "0.5224416", "0.5224416", "0.52238625", "0.5222218", "0.5216701", "0.5215392", "0.52086246", "0.5207807", "0.5205528", "0.52017355", "0.51975626", "0.519462", "0.5191433", "0.5189058", "0.51878804", "0.5179277", "0.51790166", "0.5176582", "0.5174333", "0.5172596", "0.5168614", "0.5168489", "0.51641333", "0.5162229", "0.5158603", "0.5158526", "0.5158526", "0.5151796", "0.51454484", "0.51454484", "0.51454484", "0.51454455", "0.51425576", "0.51379347", "0.5132426", "0.5130047", "0.5128777" ]
0.0
-1
mozliwosc dodania recznego danych do congfig podczas pierwszego rozruchu programu
Config(InfoHandler info){ this.info = info; config_list = new ArrayList<>(); File test = new File(config_path); if(test.exists()){ //plik istnieje info.mode=1; //wlaczenie trybu dla obslugi pliku konfiguracyjnego //tutaj pobieranie informacji z pliku konfiguracyjnego //do ciała funkcji config_file = new DictReader(config_path,info); //tutaj dodajemy funkcjonalnosci config_list.add(config_file.szukaj("%imie")); config_list.add(config_file.szukaj("%dict_path")); config = get_config(); info.mode=0; is_alive = true; } else{ config = new ArrayList<>(); config_file = new DictReader(config_path,info); first_start = 1; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getGUIconfigData(){\n String zlgcnfg=null;\n try {\n // get connected to Rserve\n //String RSERVE_HOST = \"vdc-build.hmdc.harvard.edu\";//\"140.247.115.232\"\n //int RSERVE_PORT = 6311;\n RConnection c = new RConnection(RSERVE_HOST, RSERVE_PORT);\n \n // login(String user, String pwd)\n //String RSERVE_USER = \"rserve\";\n //String RSERVE_PWD = \"rserve\";\n c.login(RSERVE_USER, RSERVE_PWD);\n \n // get the hostname of the caller\n String hostname = null;\n Map<String, String> env = System.getenv();\n for (String envName : env.keySet()) {\n if (envName.equals(\"HOST\")){\n hostname = env.get(envName);\n }\n }\n dbgLog.fine(\"hostname=\"+hostname);\n \n // set-up R command lines\n // temp file\n String R_TMP_DIR = \"/tmp/VDC/\";\n //String cnfgfl = R_TMP_DIR +\"configZeligGUI.\"+RandomStringUtils.randomNumeric(6)+ \".xml\"; \n String cnfgfl = R_TMP_DIR +\"configZeligGUI.xml\"; \n dbgLog.fine(\"cnfgfl=\"+cnfgfl);\n \n // remove the existing config file if exists\n String removeOLdLine = \"if (file.exists('\"+cnfgfl+\"')){file.remove('\"+cnfgfl+\"');}\";\n c.voidEval(removeOLdLine);\n // R code line part 1 \n String cmndline = \"library(VDCutil); printZeligSchemaInstance('\"+ cnfgfl + \"')\";\n // cnfgfl + \"',\" + \"'\" + RSERVE_HOST + \"')\";\n dbgLog.fine(\"comand line=\"+cmndline);\n \n // write zelig GUI-config data to the temp ifle\n c.voidEval(cmndline);\n //dbgLog.fine(\"commandline output=\"+outString);\n \n // check whether the temp file exists (Rserve is local)\n long filelength=0;\n try {\n if (RSERVE_HOST.equals(\"localhost\") || RSERVE_HOST.equals(hostname)){\n File flnm =new File(cnfgfl);\n boolean exists = flnm.exists();\n if (exists) {\n dbgLog.fine(\"configuration xml file (\"+cnfgfl+\") was found\");\n filelength = flnm.length();\n // Get the number of bytes in the file\n dbgLog.fine(\"The size of the file =\"+filelength);\n } else {\n dbgLog.fine(\"configuration xml file (\"+cnfgfl+\") was not found\");\n }\n }\n } catch (NullPointerException e) {\n e.printStackTrace();\n }\n \n //if (filelength > 0){\n // read-back the config file\n c.voidEval(\"zz<-file('\"+cnfgfl+\"', 'r')\");\n c.voidEval(\"open(zz)\");\n zlgcnfg = c.eval(\"paste(readLines(zz),collapse='')\").asString();\n dbgLog.fine(\"string length=\"+zlgcnfg.length());\n if (zlgcnfg.length()>0){\n dbgLog.fine(\"first 72 bytes=[\\n\"+zlgcnfg.substring(0, 71) +\"\\n]\\n\");\n }\n //}\n } catch (Exception ex){\n ex.printStackTrace();\n }\n return zlgcnfg;\n }", "private void cargarConfiguracionBBDD()\r\n\t{\r\n\t\tjava.io.InputStream IO = null;\r\n\r\n\t\ttry {\r\n\t\t\tIO = getClass().getClassLoader().getResourceAsStream(\"configuracion.properties\");\r\n\r\n\t\t // load a properties file\r\n\t\t prop.load(IO);\r\n\t\t \r\n\t\t \r\n\t\t host=prop.getProperty(\"host\");\r\n\t\t database=prop.getProperty(\"database\");\r\n\t\t username=prop.getProperty(\"username\");\r\n\t\t password=prop.getProperty(\"password\");\r\n\t\t \r\n\t\t System.out.println(host);\r\n\r\n\t\t \r\n\t\t \r\n\t\t} catch (IOException ex) {\r\n\t\t ex.printStackTrace();\r\n\t\t} finally {\r\n\t\t if (IO != null) {\r\n\t\t try {\r\n\t\t IO.close();\r\n\t\t } catch (IOException e) {\r\n\t\t e.printStackTrace();\r\n\t\t }\r\n\t\t }\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "private void config() {\n\t}", "private String ProperEstadoCivil()\n{\n String strRes=\"\";\n try\n {\n //Leer archivo de configuración .\n java.util.Properties proArc=new java.util.Properties();\n \n java.io.FileInputStream fis=new java.io.FileInputStream(\"config.properties.txt\");\n proArc.load(fis);\n fis.close();\n \n \n \n strRes=proArc.getProperty(\"EstadoCivil\");\n proArc=null;\n }\n catch (java.io.IOException e)\n {\n strRes=\"\";\n }\n catch (Exception e)\n {\n strRes=\"\";\n }\n return strRes;\n }", "private static void loadConfig() {\n\t\trxID = (Integer) ConfigStoreRedstoneWireless.getInstance(\n\t\t\t\t\"WirelessRedstone\").get(\"Receiver.ID\", Integer.class,\n\t\t\t\tnew Integer(rxID));\n\t\ttxID = (Integer) ConfigStoreRedstoneWireless.getInstance(\n\t\t\t\t\"WirelessRedstone\").get(\"Transmitter.ID\", Integer.class,\n\t\t\t\tnew Integer(txID));\n\t}", "private void getData() {\r\n Properties config = new Properties();\r\n\tFileInputStream input = null;\r\n\ttry {\r\n input = new FileInputStream(\"src/signupsigninserver/config/connection.properties\");\r\n config.load(input);\r\n port=Integer.parseInt(config.getProperty(\"port\"));\r\n maxThreads=Integer.parseInt(config.getProperty(\"max_threads\"));\r\n \r\n } catch (FileNotFoundException ex) {\r\n LOGGER.info(\"No encuentra archivo\");\r\n } catch (IOException ex) {\r\n Logger.getLogger(ILogicImplementation.class.getName()).log(Level.SEVERE, null, ex);\r\n } finally {\r\n if (input != null)\r\n\t\ttry {\r\n input.close();\r\n } catch (IOException ex) {\r\n Logger.getLogger(ILogicImplementation.class.getName()).log(Level.SEVERE, null, ex);\r\n } \r\n\t}\r\n }", "private void defaultConfig(){\n\t\t\n\t\t String status =\"\";\n\t\t try {\n\t\t \tstatus =\"reading control file\";\n\t\t \tString aFile = controlfileTF.getText();\n\t\t\t config.controlfile = aFile;\n\n\t\t BufferedReader input = new BufferedReader(new FileReader(aFile));\n\t\t try {\n\t\t \n\t\t config.outputdir = input.readLine();\t\t \n\t\t outputdirTF.setText(config.outputdir);\n\t\t config.reginputdir = input.readLine();\t\t \n\t\t reginputdirTF.setText(config.reginputdir);\n\t\t config.grdinputdir = input.readLine();\t\t \n\t\t grdinputdirTF.setText(config.grdinputdir);\n\t\t config.eqchtinputdir = input.readLine();\t\t \n\t\t eqchtinputdirTF.setText(config.eqchtinputdir);\n\t\t config.spchtinputdir = input.readLine();\t\t \n\t\t spchtinputdirTF.setText(config.spchtinputdir);\n\t\t config.trchtinputdir = input.readLine();\t\t \n\t\t trchtinputdirTF.setText(config.trchtinputdir);\n\t\t config.restartinputdir = input.readLine();\t\t \n\t\t restartinputdirTF.setText(config.restartinputdir);\n\t\t config.calibrationdir = input.readLine();\t\t \n\t\t calibrationdirTF.setText(config.calibrationdir);\n\t\t \n\t\t config.runstage = input.readLine();\n\t\t if (config.runstage.equalsIgnoreCase(\"eq\")) {\n\t\t \trunstageRB[0].setSelected(true);\n\t\t } else if (config.runstage.equalsIgnoreCase(\"sp\")) {\n\t\t \trunstageRB[1].setSelected(true);\t\t \t\n\t\t } else if (config.runstage.equalsIgnoreCase(\"tr\")) {\n\t\t \trunstageRB[2].setSelected(true);\t\t \t\n\t\t } else if (config.runstage.equalsIgnoreCase(\"sptr\")) {\n\t\t \trunstageRB[3].setSelected(true);\t\t \t\n\t\t }\n\t\t \n\t\t config.initmode = input.readLine();\t\t \n\t\t if (config.initmode.equalsIgnoreCase(\"lookup\")) {\n\t\t \tinitmodeRB[0].setSelected(true);\n\t\t } else if (config.initmode.equalsIgnoreCase(\"restart\")) {\n\t\t \tinitmodeRB[1].setSelected(true);\n\t\t } else if (config.initmode.equalsIgnoreCase(\"sitein\")) {\n\t\t \tinitmodeRB[2].setSelected(true);\t\t \t\n\t\t }\n\t\t \n\t\t config.climatemode = input.readLine();\t\t \n\t\t if (config.climatemode.equalsIgnoreCase(\"normal\")) {\n\t\t \tclmmodeRB[0].setSelected(true);\n\t\t } else if (config.climatemode.equalsIgnoreCase(\"dynamic\")) {\n\t\t \tclmmodeRB[1].setSelected(true);\t\t \t\n\t\t }\n\n\t\t config.co2mode = input.readLine();\t\t \n\t\t if (config.co2mode.equalsIgnoreCase(\"initial\")) {\n\t\t \tco2modeRB[0].setSelected(true);\n\t\t } else if (config.co2mode.equalsIgnoreCase(\"dynamic\")) {\n\t\t \tco2modeRB[1].setSelected(true);\n\t\t }\n\n\t\t config.casename = input.readLine();\t\t \n\t\t casenameTF.setText(config.casename);\n \n\t\t }catch (Exception e){\n\t\t \t JOptionPane.showMessageDialog(f, status+\" failed\");\n\t\t }\n\t\t finally {\n\t\t input.close();\n\t\t }\n\t\t }\n\t\t catch (IOException ex){\n\t\t ex.printStackTrace();\n\t\t }\t\t\n\t\t}", "private PropiedadesComunicacion() throws IOException {\r\n try {\r\n\r\n Properties propiedades = new Properties();\r\n InputStream stream = ClassLoader.getSystemResourceAsStream(RUTA_PROPIEDADES);\r\n propiedades.load(stream);\r\n\r\n puerto = Integer.parseInt(propiedades.getProperty(KEY_PORT));\r\n\r\n stream.close();\r\n\r\n stream.close();\r\n if (!validarPuerto(puerto)) {\r\n throw new IOException(\"Error de direccion ip del servidor\");\r\n }\r\n } catch (IOException ex) {\r\n throw ex;\r\n }\r\n }", "private void initConfig() {\n Path walletPath;\n Wallet wallet;\n\n // load a CCP\n Path networkConfigPath; \n \n try {\n \t\n \tif (!isLoadFile) {\n // Load a file system based wallet for managing identities.\n walletPath = Paths.get(\"wallet\");\n wallet = Wallet.createFileSystemWallet(walletPath);\n\n // load a CCP\n networkConfigPath = Paths.get(\"\", \"..\", \"basic-network\", configFile);\n \n builder = Gateway.createBuilder();\n \n \tbuilder.identity(wallet, userId).networkConfig(networkConfigPath).discovery(false);\n \t\n \tisLoadFile = true;\n \t}\n } catch (Exception e) {\n \te.printStackTrace();\n \tthrow new RuntimeException(e);\n }\n\t}", "void makeConfig()\n\t{\n\t\t\t\t\n\t\tbuf.append(\"\\t\\tUplink Setup Work order for \" + myDay.toString() + \" Rel 0.2\\n\");\n\t\tbuf.append(\"\\t\\t-----------------------------------------------------------------\\n\\n\");\n\t\t\n\t\tbuf.append(\"\\n1. Channel : \" + channelNumber + \" RF Source : \" + (rfSource==0?\"ASI\":(rfSource==1?\"RF\":\"MPEGoIP\")) + \"\\n\");\n\t\tbuf.append(\"\\n2. Physical Connection : \" + param.get(16) + \"\\n\");\t\n\t\t\n\t\t\n\t\tbuf.append(\"\\n3. Input Test Case : \" + Utility.getIntVal(param.get(1)) + \"\\n\\n\");\n\t\tString[] inpTCParamName = new String[] {\"TC Name\", \"Format/Modulation\", \"Rate (Msym)\", \"Bandwidth (Mbit)\"};\n\t\tprintTCParam(4, 13, Utility.getIntVal(param.get(1)), inpTCParamName);\n\t\t\n\t\tbuf.append(\"\\n4. CA Test Case : \" + Utility.getIntVal(param.get(2)) + \"\\n\\n\");\n\t\tString[] caTCParamName = new String[] {\"Scrambling Mode\", \"#Signal Source\", \"#DCD\", \"#Algorithm\", \"MSK\", \"Channel Setup\"};\n\t\tprintTCParam(5, 10, Utility.getIntVal(param.get(2)), caTCParamName);\n\n\t\tbuf.append(\"\\n5. Video Test Case : \" + Utility.getIntVal(param.get(3)) + \"\\n\\n\");\n\t\tString[] vidTCParamName = new String[] {\"Video Format\", \"Picture (resolution)\", \"Profile/Feature\", \"GOP Settings\", \"3:2 PullDown\", \n\t\t\t\t \t\t\t\t\"Video Bit Rate\", \"Video Rate\", \"#Encoder Parameters\"};\n\t\tprintTCParam(7, 8, Utility.getIntVal(param.get(3)), vidTCParamName);\n\t\n\t\tbuf.append(\"\\n6. Audio#1 Test Case : \" + Utility.getIntVal(param.get(4)) + \"\\n\\n\");\n\t\tString[] audTCParamName = new String[] {\"TC Name\", \"#Audio Type\", \"#Bit Rates\", \"#Encoder Flags #1\", \"#Encoder Flags #2\",\n \"#Encoder 1:Stereo\", \"#Encoder 2:Dual Mono\", \"#Encoder 3:Single Mono\", \n \"#Encoder 4:3/2 Surround & 5.1\", \"#PCM/Compress\", \"#DDP Mode\", \"#1:Stereo\", \n \"#2:Dual Mono\", \"#3:Single Mono\", \"#4:3/2 Surround & 5.1\"};\n\t\tprintTCParam(6, 10, Utility.getIntVal(param.get(4)), audTCParamName);\n\t\n\t\tbuf.append(\"\\n7. Audio#2 Test Case :\" + Utility.getIntVal(param.get(5)) + \"\\n\\n\");\n\t\tprintTCParam(6, 10, Utility.getIntVal(param.get(4)), audTCParamName);\n\n\t\tbuf.append(\"\\n8. Trancode#1 Test Case : \" + Utility.getIntVal(param.get(6)) + \" subject of automatic setup\\n\");\n\t\t\n\t\tbuf.append(\"\\n9. Trancode#2 Test Case : \" + Utility.getIntVal(param.get(7)) + \" subject of automatic setup\\n\");\t\n\t\t\n\t\tbuf.append(\"\\n10. Subtitle Test Case : \" + Utility.getIntVal(param.get(8)) + \"\\n\\n\");\n\t\tString[] sbtTCParamName = new String[] {\"TC Name\", \"Video Std\", \"Subtitle Std\", \"#Stream/Subtitle enc\"};\n\t\tprintTCParam(8, 10, Utility.getIntVal(param.get(8)), sbtTCParamName);\n\t\n\t\tbuf.append(\"\\n11. VBI Test Case : \" + Utility.getIntVal(param.get(9)) + \"\\n\\n\");\n\t\tString[] vbiTCParamName = new String[] {\"TC Name\", \"#Video Frame Rate\", \"#NABTS\", \"#WST\", \"#Invert WST\", \"#VITC PAL(1)\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"#AMOL-I(3)\", \"#AMOL-II(3)\", \"#VPS\", \"#WSS\", \"#VITS\", \"#GEMTAR(1x)(2)\", \n\t\t\t\t\t\t\t\t\t\t\t\t\"#GEMTAR(2x)(2)\", \"#Monochrome\", \"#VBItotal bit rate (KBits)\"};\n\t\tprintTCParam(9, 9, Utility.getIntVal(param.get(9)), vbiTCParamName);\n\t\t\n\t\tbuf.append(\"\\n12. LSD Test Case : \" + Utility.getIntVal(param.get(10)) + \"\\n\\n\");\n\t\tString[] lsdTCParamName = new String[] {\"TC Name\", \"#Data rate\"};\n\t\tprintTCParam(10, 9, Utility.getIntVal(param.get(10)), lsdTCParamName);\n\t\n\t\tbuf.append(\"\\n13. MPE Test Case : \" + Utility.getIntVal(param.get(11)) + \"\\n\\n\");\n\t\tString[] mpeTCParamName = new String[] {\"TC Name\", \"#PIDs\", \"Rate per PID (Mbits)\", \"Aggregate Rate (Mbits)\", \"Frame Size\", \"Flow Type\"};\n\t\tprintTCParam(11, 8, Utility.getIntVal(param.get(11)), mpeTCParamName);\n\t\t\n\t\tbuf.append(\"\\n14. FPT Test Case : \" + (Utility.getIntVal(param.get(12))==1?\"Yes\":\"No\") + \"\\n\");\n\t\t\n\t\tbuf.append(\"\\n15. CC Test Case : \" + (Utility.getIntVal(param.get(13))==1?\"Yes\":\"No\") + \"\\n\");\t\n\t\t\n\t\tbuf.append(\"\\n16. DPM 58/59 Test Case : \" + Utility.getIntVal(param.get(14)) + \" subject of automatic setup\\n\");\t\n\t\t\n\t\tbuf.append(\"\\n17. DPM 24/54 Test Case : \" + Utility.getIntVal(param.get(15)) + \" subject of automatic setup\\n\");\t\n\n\t\tbuf.append(\"\\n\\n*** End of Uplink Setup Work order ***\\n\");\n\t\t\n\t\tString fileName = null;\n\t\ttry {\n\t\t\t SimpleDateFormat timeStamp = new SimpleDateFormat(\"dd-MMM-yyyy_HH-mm-ss\");\n\t\t\t Calendar cal = Calendar.getInstance();\n\t\t\t \n\t\t\t cal.setTime(myDay);\n\t\t\t fileName = STS.outputDirectory + \"\\\\\" + \"Uplink_Setup_\" + timeStamp.format(cal.getTime()) + \".txt\";\n\n\t\t\tFileOutputStream out = new FileOutputStream(fileName);\n\t\t\tout.write(buf.toString().getBytes());\n\t\t\tout.close();\n\t\t\t\n\t\t} catch(Exception e) {\n\t\t\tSystem.out.println(\"Can not write into file \" + fileName);\n\t\t}\n\n\t\t\n\t}", "private void initConfiguration() {\n\n\t\t//Configuration du jeu\n\t\tconfigJeu = ask(config, \"Emplacement de départ ?\", \"Emplacement\");\n\t\tSystem.out.println(\"\"+modeJeu);\n\n\t\t//mode 2 = Machine contre Machine\n\t\t//mode 1 = Jouur contre Machine\n\n\t\t//On demande le mode de jeu\n\t\tmodeJeu = JOptionPane.showOptionDialog(this, \"Quel mode de jeu ?\", \"Mode de jeu\",\n\t\t\t\tJOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE,\n\t\t\t\ticon, modes, modes[1]); //default button title\n\n\t\tif(modeJeu == 1 || modeJeu == 2){\t//Dans le cas ou c'est joueur contre machine\n\t\t\t nivDifficulté = new String[]{\"Niveau 0 (Random)\",\n\t\t\t\t\t \"Niveau 1 (MinMax niveau 4 avec random)\",\n\t\t\t\t\t \"Niveau 2 (MinMax niveau 2)\",\n\t\t\t\t\t \"Niveau 2.5 (MinMax niveau 2 puis 4)\",\n\t\t\t\t\t \"Niveau 3 (AlphaBeta profondeur 2)\",\n\t\t\t\t\t \"Niveau 4 (NégaAlphaBeta profondeur 4)\",\n\t\t\t\t\t \"Niveau 5 (IA Tricheuse, avec NégaAlphaBeta profondeur 4)\",\n\t\t\t\t\t \"Niveau 6 (IA Tricheuse & voleuse, avec NégaAlphaBeta profondeur 4)\"};\n\n\t\t\tniveauDifficulté = ask(nivDifficulté, \"Votre niveau de difficulté?\",\"Niveau de difficulté\");\n\n\t\t\tniveauHeuristique = ask(configHeuristique, \"L'orientation des poids de l'IA ?\", \"Poids de l'IA\");\n\t\t\tif(niveauHeuristique == 0)\n\t\t\t\tpoids = poidsEquilibre;\n\t\t\telse if(niveauHeuristique == 1)\n\t\t\t\tpoids = poidsAttaque;\n\t\t\telse if (niveauHeuristique == 2)\n\t\t\t\tpoids = poidsDefense;\n\n\n\t\t}else if (modeJeu == 2){\n\t\t\tniveauDifficulté = 10;\t// Dans le cas ou c'est Humain contre humain\n\t\t}\n\t}", "public void loadConfig(){\n this.saveDefaultConfig();\n //this.saveConfig();\n\n\n }", "private void loadWiperConfig(String mSubPath,boolean bQuiet)\n {\n FileReader mWiperConfigReader;\n\n // Environment.getRootDirectory() = /system\".\n final File mFileName = new File(Environment.getRootDirectory(), mSubPath);\n try\n {\n mWiperConfigReader = new FileReader(mFileName);\n }\n catch (FileNotFoundException e)\n {\n if (!bQuiet)\n {\n Log.e(TAG, \"wiperconfig file read/open error \" + mFileName);\n }\n bWiperConfigReadError = true;\n return;\n }\n\n try\n {\n XmlPullParser mParser = Xml.newPullParser();\n mParser.setInput(mWiperConfigReader);\n\n XmlUtils.beginDocument(mParser, \"wiperconfig\");\n\n while (true)\n {\n XmlUtils.nextElement(mParser);\n\n String szName = mParser.getName();\n if (!\"configparam\".equals(szName))\n {\n break;\n }\n\n szUsername = mParser.getAttributeValue(null, \"username\");\n szRealm = mParser.getAttributeValue(null, \"realm\");\n\n String szHighFreqPeriodMs = mParser.getAttributeValue(null, \"highFreqPeriodMs\");\n lHighFreqPeriodMs = Long.parseLong(szHighFreqPeriodMs);\n\n String szLowFreqPeriodMs = mParser.getAttributeValue(null, \"lowFreqPeriodMs\");\n lLowFreqPeriodMs = Long.parseLong(szLowFreqPeriodMs);\n\n szTilingPath = mParser.getAttributeValue(null, \"tilingPath\");\n\n String szMaxDataSizePerSession = mParser.getAttributeValue(null, \"maxDataSizePerSession\");\n lMaxDataSizePerSession = Long.parseLong(szMaxDataSizePerSession);\n\n String szMaxDataSizeTotal = mParser.getAttributeValue(null, \"maxDataSizeTotal\");\n lMaxDataSizeTotal = Long.parseLong(szMaxDataSizeTotal);\n\n String szNetworkPvdEnabled = mParser.getAttributeValue(null, \"networkPvdEnabled\");\n bNetworkPvdEnabled = Boolean.parseBoolean(szNetworkPvdEnabled);\n\n }\n }\n catch (XmlPullParserException e)\n {\n Log.e(TAG, \"WiperConfig parsing exception \", e);\n bWiperConfigReadError = true;\n }\n catch (IOException e)\n {\n Log.e(TAG, \"WiperConfig parsing exception\", e);\n bWiperConfigReadError = true;\n }\n\n if(Config.LOGV)\n {\n Log.v(TAG,\"WiperConfig uname:\"+szUsername+\", realm:\"+szRealm+\",hi:\"+lHighFreqPeriodMs+\",lo:\"+lLowFreqPeriodMs+\":tPath:\"+szTilingPath);\n }\n return;\n }", "private static void loadConfig()\n\t{\n\t\ttry\n\t\t{\n\t\t\tfinal Properties props = ManagerServer.loadProperties(ManagerServer.class, \"/resources/conf.properties\");\n\t\t\tasteriskIP = props.getProperty(\"asteriskIP\");\n\t\t\tloginName = props.getProperty(\"userName\");\n\t\t\tloginPwd = props.getProperty(\"password\");\n\t\t\toutboundproxy = props.getProperty(\"outBoundProxy\");\n\t\t\tasteriskPort = Integer.parseInt(props.getProperty(\"asteriskPort\"));\n\t\t}\n\t\tcatch (IOException ex)\n\t\t{\n\t\t\tLOG.error(\"IO Exception while reading the configuration file.\", ex);\n\t\t}\n\t}", "public void createMiniKdcConf() {\n\t\tconf = MiniKdc.createConf();\n\t}", "public static void main (String []args){\n\t\tint i2=0;\n\t\tIntegraInformacionSalidaWMS integra = new IntegraInformacionSalidaWMS();\n\t\tprop = new Properties();\n\t\ttry{\n\t\t\t//System.out.println(\"Ruta Properties:\"+Constants.FILE_PROPERTIES);\n\t\t\tprop.load(new FileInputStream(\"/proceso_XML/\"+\"config.properties\"));\n\t\t\t//prop.load(new FileInputStream(\"proceso/\"+\"config.properties\"));\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tString mensaje = \"Mensaje 1 :\"+e.getMessage();\n\t\t\t//email.mail(mensaje);\n\t\t\te.printStackTrace();\n\t\t}\n\t\ttry{\n\t\t\tString ws=prop.getProperty(\"wsCaserita\");\n\t\t\tString dir1=prop.getProperty(\"dirInicial\");\n\t\t\tString dir2=prop.getProperty(\"dirFinal\");\n\t\t\twhile (i2==0){\n\t\t\t\t//String path = \"/home2/ftp/out/\";\n\t\t\t\t//String path = \"/RedPrairie/LCSWMSTST/LES/files/hostout/\";\n\t\t\t\tString path = dir1;\n\n\t\t\t\tString files;\n\n\t\t\t\tFile directorio = new File(path);\n\t\t\t\tFile [] ficheros = directorio.listFiles();\n\t\t\t\tString line;\n\t\t\t\t//log.info(ws);\n\t\t\t\tif (ficheros!=null){\n\t\t\t\t\tfor (int i = 0; i < ficheros.length; i++) {\n\t\t\t\t\t\t\n\t\t\t if (ficheros[i].isFile()) {\n\t\t\t \tfiles = ficheros[i].getName();\n\t\t\t if (files.endsWith(\".xml\") || files.endsWith(\".XML\")){\n\t\t\t \tlog.info(\"archivo:\"+path+ficheros[i].getName());\n\t\t\t \t\t\t\ttry{\n\t\t\t \t\t\t\t\t\n\t\t\t \t\t\t\t\tBufferedReader bf = new BufferedReader(new FileReader(path+ficheros[i].getName()));\n\t\t\t \t\t\t\t\tString linea=\"\";\n\t\t\t \t\t\t\t\tString xml=\"\";\n\t\t\t \t\t\t\t\tint lin=0;\n\t\t\t \t\t\t\t\tint band=1;\n\t\t\t \t\t\t\t\tString xml1=\"\";\n\t\t\t \t\t\t\t\tFecha fecha = new Fecha();\n\n\t\t\t \t\t\t\t\twhile((linea=bf.readLine())!=null){\n\t\t\t \t\t\t\t\t\txml=xml+linea;\n\t\t\t \t\t\t\t\t\tlin++;\n\t\t\t \t\t\t\t\t\tband=1;\n\t\t\t \t\t\t\t\t\tif (lin==5000){\n\n\t\t\t \t\t\t\t\t\t\txml1=xml1+xml;\n\t\t\t \t\t\t\t\t\t\txml=\"\";\n\t\t\t \t\t\t\t\t\t\tlin=0;\n\t\t\t \t\t\t\t\t\t\tband=0;\n\t\t\t \t\t\t\t\t\t}\n\t\t\t \t\t\t\t\t}\n\t\t\t \t\t\t\t\t//Concatena XML \n\t\t\t \t\t\t\t\tif (band==1){\n\t\t\t \t\t\t\t\t\txml1=xml1+xml;\n\t\t\t \t\t\t\t\t}\n\t\t\t \t\t\t\t\tFecha fecha2 = new Fecha();\n\t\t\t \t\t\t\t\t\n\t\t\t \t\t\t\t\tlog.info(xml1);\n\t\t\t \t\t\t\t\t//System.out.println(xml);\n\t\t\t \t\t\t\t\tbf.close();\n\t\t\t \t\t\t\t\tConfirmacionDTO confirmacion = new ConfirmacionDTO();\n\t\t\t \t\t\t\t\tconfirmacion.setXml(xml1);\n\t\t\t \t\t\t\t\tconfirmacion.setNameFile(ficheros[i].getName());\n\t\t\t \t\t\t\t\tGson gson = new Gson();\n\t\t\t \t\t\t\t\tString json = gson.toJson(confirmacion);\n\t\t\t \t\t\t\t\t//System.out.println(json);\n\t\t\t \t\t\t\t\ttry {\n\t\t\t \t\t\t\t\t\t \n\t\t\t \t\t\t\t\t\tURL url = new URL(ws.trim());\n\t\t\t \t\t\t\t\t\t\n\t\t\t \t\t\t\t\t\t//URL url = new URL(\"http://192.168.1.30:8080/ServiciosTransportistaWEB/servicioTransRest/wmsCaserita/post\");\n\n\t\t\t \t\t\t\t\t\t\n\t\t\t \t\t\t\t\t\tHttpURLConnection conn = (HttpURLConnection) url.openConnection();\n\t\t\t \t\t\t\t\t\tconn.setDoOutput(true);\n\t\t\t \t\t\t\t\t\tconn.setRequestMethod(\"POST\");\n\t\t\t \t\t\t\t\t\tOutputStream os = conn.getOutputStream();\n\t\t\t \t\t\t\t\t\tos.write(json.getBytes());\n\t\t\t \t\t\t\t\t\t//os.write(xml.getBytes());\n\t\t\t \t\t\t\t\t\tos.flush();\n\t\t\t \t\t\t\t\t\t\n\t\t\t \t\t\t\t \n\t\t\t \t\t\t\t\t\tif (conn.getResponseCode() != 200) {\n\t\t\t \t\t\t\t\t\t\tthrow new RuntimeException(\"Failed : HTTP error code : \"\n\t\t\t \t\t\t\t\t\t\t\t\t+ conn.getResponseCode());\n\t\t\t \t\t\t\t\t\t}\n\t\t\t \t\t\t\t \n\t\t\t \t\t\t\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(\n\t\t\t \t\t\t\t\t\t\t(conn.getInputStream())));\n\t\t\t \t\t\t\t \n\t\t\t \t\t\t\t\t\tString output;\n\t\t\t \t\t\t\t\t\tlog.info(\"Output from Server .... \\n\");\n\t\t\t \t\t\t\t\t\t/*while ((output = br.readLine()) != null) {\n\t\t\t \t\t\t\t\t\t\tSystem.out.println(output);\n\t\t\t \t\t\t\t\t\t}*/\n\t\t\t \t\t\t\t \n\t\t\t \t\t\t\t\t\tconn.disconnect();\n\t\t\t \t\t\t\t\t\txml=\"\";\n\t\t\t\t\t \t\t\t\txml1=\"\";\n\t\t\t\t\t \t\t\t\tlog.info(\"Hora Inicial:\"+fecha.getHHMMSS());\n\n\t\t\t\t \t\t\t\t\tlog.info(\"Hora Final:\"+fecha2.getHHMMSS());\n\t\t\t \t\t\t\t\t } catch (MalformedURLException e) {\n\t\t\t \t\t\t\t\t\t String mensaje = \"Mensaje 2: \"+e.getMessage();\n\t\t\t \t\t\t\t\t\t\t//email.mail(mensaje);\n\t\t\t \t\t\t\t\t\te.printStackTrace();\n\t\t\t \t\t\t\t \n\t\t\t \t\t\t\t\t } catch (IOException e) {\n\t\t\t \t\t\t\t\t\t String mensaje = \"Mensaje 3: \"+e.getMessage();\n\t\t\t \t\t\t\t\t\t\t//email.mail(mensaje);\n\t\t\t \t\t\t\t\t\te.printStackTrace();\n\t\t\t \t\t\t\t \n\t\t\t \t\t\t\t\t }\n\t\t\t \t\t\t\t\t\n\n\t\t\t \t\t\t\t}catch(Exception e){\n\t\t\t \t\t\t\t\tString mensaje = \"Mensaje 4: \"+e.getMessage();\n\t\t\t \t\t\t\t\t//email.mail(mensaje);\n\t\t\t \t\t\t\t\te.printStackTrace();\n\t\t\t \t\t\t\t}\n\t\t\t \t\t\t\tintegra.moveFile(path+ficheros[i].getName(), ficheros[i].getName(),dir2);\n\t\t\t \t\t\t\t\n\t\t\t }\n\t\t\t }\n\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t}catch(Exception e){\n\t\t\tString mensaje = \"Mensaje 5: \"+e.getMessage();\n\t\t\t//email.mail(mensaje);\t\t\t\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "String drbdResourceConfig(final Host configOnHost)\n throws Exceptions.DrbdConfigException {\n final StringBuilder config = new StringBuilder(50);\n config.append(\"resource \" + getName() + \" {\\n\");\n final String[] params = getBrowser().getDrbdXML().getSectionParams(\n \"resource\");\n for (String param : params) {\n //if (DRBD_RES_PARAM_DEV.equals(param)) {\n // continue;\n //}\n final String value = getComboBoxValue(param);\n if (value != null && value.equals(getParamDefault(param))) {\n continue;\n }\n config.append('\\t');\n config.append(param);\n config.append('\\t');\n config.append(value);\n config.append(\";\\n\");\n }\n if (params.length != 0) {\n config.append('\\n');\n }\n /* section config */\n try {\n config.append(drbdSectionsConfig(configOnHost));\n } catch (Exceptions.DrbdConfigException dce) {\n throw dce;\n }\n /*\n <host name=\"alpha\">\n <volume vnr=\"0\">\n <device minor=\"0\"></device>\n <disk>/dev/foo</disk>\n <flexible-meta-disk>/dev/bar</flexible-meta-disk>\n </volume>\n <volume vnr=\"1\">\n \n <device minor=\"1\"></device>\n <disk>/dev/foo1</disk>\n <flexible-meta-disk>/dev/bar1</flexible-meta-disk>\n </volume>\n <address family=\"ipv4\" port=\"7793\">192.168.23.21</address>\n </host>\n */\n final boolean volumesAvailable = configOnHost.hasVolumes();\n for (final Host host : getCluster().getHostsArray()) {\n final List<String> volumeConfigs = new ArrayList<String>();\n for (final DrbdVolumeInfo dvi : drbdVolumes) {\n final String volumeConfig = dvi.drbdVolumeConfig(\n host,\n volumesAvailable);\n if (!\"\".equals(volumeConfig)) {\n volumeConfigs.add(volumeConfig);\n }\n }\n if (!volumeConfigs.isEmpty()) {\n config.append(\"\\ton \");\n config.append(host.getName());\n config.append(\" {\\n\\t\\t\");\n config.append(Tools.join(\"\\n\\n\\t\\t\", volumeConfigs));\n final GuiComboBox acb = addressComboBoxHash.get(host);\n final GuiComboBox pcb = portComboBox;\n if (acb != null && pcb != null) {\n final NetInfo ni = (NetInfo) acb.getValue();\n if (ni == null) {\n throw new Exceptions.DrbdConfigException(\n \"Address not defined in \"\n + getCluster().getName()\n + \" (\" + getName() + \")\");\n }\n config.append(\"\\n\\t\\taddress\\t\\t\");\n config.append(getDrbdNetInterfaceWithPort(\n ni.getNetInterface().getIp(),\n pcb.getStringValue()));\n config.append(\";\");\n \n }\n config.append(\"\\n\\t}\\n\");\n }\n } config.append(\"}\");\n getDrbdResource().setCommited(true);\n return config.toString();\n }", "public static void main(String[] args) {\n\t\tGlobalConfiguration globalConfig = new GlobalConfiguration(\n\t\t\t\t\"C:\\\\Users\\\\<User>\\\\Desktop\\\\Universidad\\\\SSI\\\\PAI\\\\PAI2\\\\config.properties\",\n\t\t\t\t\"C:\\\\Users\\\\<User>\\\\Desktop\\\\Universidad\\\\SSI\\\\PAI\\\\PAI2\\\\Logs\\\\\");\n\t\tConfiguration config = new Configuration(globalConfig);\n\t\tExecutionUtils.setConfiguration(config);\n\t\tExecutionUtils.setOk(0);\n\t\tExecutionUtils.setErrors(0);\n\t\tExecutionUtils.runUtility();\n\n\t\tif (whiteBoxTesting) {\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"I have configured the configuration without any problems. If you want to know about the values, enable Gray Box Testing\");\n\t\t}\n\n\t\tif (grayBoxTesting) {\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"I am going to give you the value of the Configuration, it should be the value of globalConfig variable up this line, the value taken is \"\n\t\t\t\t\t\t\t+ ExecutionUtils.getConfiguration());\n\t\t}\n\n\t\tfor (int i = 0; i < 100; i++) {\n\t\t\ttry {\n\t\t\t\tSocketFactory socketFactory = (SocketFactory) SocketFactory.getDefault();\n\n\t\t\t\tSocket socket = (Socket) socketFactory.createSocket(\"localhost\", 7070);\n\t\t\t\t// crea un PrintWriter para enviar mensaje/MAC al servidor\n\t\t\t\tPrintWriter output = new PrintWriter(new OutputStreamWriter(socket.getOutputStream()));\n\t\t\t\t// TODO aqui cambie el nombre\n\t\t\t\tString cuentaOrigen = JOptionPane.showInputDialog(null, \"Introduzca cuenta origen:\");\n\t\t\t\toutput.println(cuentaOrigen);\n\n\t\t\t\tif (whiteBoxTesting) {\n\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\"I have configured the origin account without any problems. If you want to know about the values, enable Gray Box Testing\");\n\t\t\t\t}\n\n\t\t\t\tif (grayBoxTesting) {\n\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\"I am going to give you the value of the Configuration, it should be the value given in the input, the value taken is \"\n\t\t\t\t\t\t\t\t\t+ cuentaOrigen);\n\t\t\t\t}\n\n\t\t\t\t// envio del mensaje al servidor\n\t\t\t\t// habrķa que calcular el correspondiente MAC con la clave\n\t\t\t\t// compartida por servidor/cliente\n\t\t\t\tString macdelCuentaOrigen = FileUtils.getMac(cuentaOrigen, ExecutionUtils.getConfiguration());// TODO\n\t\t\t\t// String macdelMensaje=\"asd\";\n\t\t\t\toutput.println(macdelCuentaOrigen);\n\t\t\t\tif (whiteBoxTesting) {\n\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\"I have configured the mac of the origin account without any problems. If you want to know about the values, enable Gray Box Testing\");\n\t\t\t\t}\n\n\t\t\t\tif (grayBoxTesting) {\n\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\"I am going to give you the value of the mac, it should be the value given in the input, the value taken is \"\n\t\t\t\t\t\t\t\t\t+ macdelCuentaOrigen);\n\t\t\t\t}\n\t\t\t\tString cuentaDestino = JOptionPane.showInputDialog(null, \"Introduzca cuenta destino:\");\n\t\t\t\toutput.println(cuentaDestino); // envio del mensaje al servidor\n\t\t\t\t// habrķa que calcular el correspondiente MAC con la clave\n\t\t\t\t// compartida por servidor/cliente\n\t\t\t\tif (whiteBoxTesting) {\n\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\"I have configured the destination account without any problems. If you want to know about the values, enable Gray Box Testing\");\n\t\t\t\t}\n\n\t\t\t\tif (grayBoxTesting) {\n\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\"I am going to give you the value of the mac, it should be the value given in the input, the value taken is \"\n\t\t\t\t\t\t\t\t\t+ cuentaDestino);\n\t\t\t\t}\n\n\t\t\t\tString macdelCuentaDestino = FileUtils.getMac(cuentaDestino, ExecutionUtils.getConfiguration());// TODO\n\t\t\t\t// String macdelMensaje=\"asd\";\n\t\t\t\toutput.println(macdelCuentaDestino);\n\n\t\t\t\tif (whiteBoxTesting) {\n\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\"I have configured the mac of the destination account without any problems. If you want to know about the values, enable Gray Box Testing\");\n\t\t\t\t}\n\n\t\t\t\tif (grayBoxTesting) {\n\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\"I am going to give you the value of the mac, it should be the value given in the input, the value taken is \"\n\t\t\t\t\t\t\t\t\t+ macdelCuentaDestino);\n\t\t\t\t}\n\n\t\t\t\tString cantidad = JOptionPane.showInputDialog(null, \"Introduzca la cantidad a transferir:\");\n\t\t\t\toutput.println(cantidad); // envio del mensaje al servidor\n\t\t\t\t// habrķa que calcular el correspondiente MAC con la clave\n\t\t\t\t// compartida por servidor/cliente\n\t\t\t\tif (whiteBoxTesting) {\n\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\"I have configured the quantity account without any problems. If you want to know about the values, enable Gray Box Testing\");\n\t\t\t\t}\n\n\t\t\t\tif (grayBoxTesting) {\n\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\"I am going to give you the value of the quantity, it should be the value given in the input, the value taken is \"\n\t\t\t\t\t\t\t\t\t+ cantidad);\n\t\t\t\t}\n\t\t\t\tString macdelCantidad = FileUtils.getMac(cantidad, ExecutionUtils.getConfiguration());// TODO\n\t\t\t\t// String macdelMensaje=\"asd\";\n\t\t\t\toutput.println(macdelCantidad);\n\n\t\t\t\tif (whiteBoxTesting) {\n\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\"I have configured the mac of the quantity without any problems. If you want to know about the values, enable Gray Box Testing\");\n\t\t\t\t}\n\n\t\t\t\tif (grayBoxTesting) {\n\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\"I am going to give you the value of the mac, it should be the value given in the input, the value taken is \"\n\t\t\t\t\t\t\t\t\t+ macdelCantidad);\n\t\t\t\t}\n\n\t\t\t\tRandom r = new Random();\n\t\t\t\tInteger e = r.nextInt(10000);\n\t\t\t\tString macdelNons = FileUtils.getMac(\"\" + e, ExecutionUtils.getConfiguration());// TODO\n\t\t\t\toutput.println(macdelNons);\n\t\t\t\t// Suelta el buffer\n\t\t\t\toutput.flush();\n\t\t\t\t// crea un objeto BufferedReader para leer la respuesta del\n\t\t\t\t// servidor\n\t\t\t\tBufferedReader input = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n\t\t\t\tString respuesta = readLine(input); // lee la\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// respuesta del\n\t\t\t\t// servidor\n\t\t\t\tJOptionPane.showMessageDialog(null, respuesta); // muestra la\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// respuesta al\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// cliente\n\t\t\t\toutput.close();\n\t\t\t\tinput.close();\n\t\t\t\tsocket.close();\n\n\t\t\t\tif (whiteBoxTesting) {\n\t\t\t\t\tSystem.out.println(\"I have done everything.\");\n\t\t\t\t}\n\n\t\t\t} // end try\n\t\t\tcatch (IOException ioException) {\n\t\t\t\tioException.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t}", "public void saveConnectionConfiguration(){\n\t\tProperties props = new Properties();\n\t\tif (connectionconfig!=null){\n\t\t\tprops.setProperty(\"server\", connectionconfig.getServer());\n\t\t\tprops.setProperty(\"user\", connectionconfig.getUser());\n\t\t\tprops.setProperty(\"passwd\", connectionconfig.getPasswd());\n\t\t}\n\t\ttry {\n\t\t\tFileOutputStream propOutFile = new FileOutputStream(getConnConfigFile());\n\t\t\ttry {\n\t\t\t\tprops.store(propOutFile, \"Jabber connection parameters\");\n\t\t\t} catch (IOException e) {\n\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} catch (FileNotFoundException e2) {\n\n\t\t\te2.printStackTrace();\n\t\t}\n\t}", "protected void requestPro(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\n\t\tSystem.out.println(\"패스워드 찾기 리케스트 프로 호출\");\n\t}", "public static void main(String[] args) {\n\r\n String cFields = \"NIC,SIMBOLO_VARIABLE,FECHA_VENCIMIENTO,FECHA_PAGO_OPORTUNO,FECHA_EMISION,NUMERO_FACTURA,INDICATIVO_SUMINISTRO,CIIU,TIPO_COBRO,SECUENCIAL_RECIBO,NIS,TIPO_SERVICIO,ORDEN_LECTURA,MEDIDOR,LECT_ANTERIOR,LECT_ACTUAL,FECHA_LECTURA_ACTUAL,CONSUMO_FACTURADO,VALOR_FACTURA,GRUPO_FAMILIAR,PRECIO_UNITARIO_CU,IND_VISUSALIZACION_BARCODI,IMPORTE_TOTAL_DEUDA,CANTIDAD_FACTURAS_ADEUDADAS,DESC_ANOMALIA_LECTURA,IMPORTE_TOTAL_FACTURA,SUBTOTAL_FACTURA,DESCRIPCION_TARIFA,CONSUMO_PROMEDIO,DIAS_FACTURADOS,CLAVE_ORDEN_FACTURA,PROPIEDAD_EQUIPO_MEDIDA,UNICOM,RUTA,ITINERARIO\";\r\n fields = cFields.split(\",\");\r\n\r\n readConfiguracion();\r\n\r\n if (configuracion.size() != fields.length) {\r\n System.out.println(\"Longitud de campos y configuración es diferente. Fields: \" + fields.length + \" Configuracion: \" + configuracion.size());\r\n Utilidades.AgregarLog(\"Longitud de campos y configuración es diferente. Fields: \" + fields.length + \" Configuracion: \" + configuracion.size());\r\n return;\r\n }\r\n\r\n if (configuracion.size() > 0) {\r\n System.out.println(\"Campos a leer: \" + configuracion.size());\r\n Utilidades.AgregarLog(\"Campos a leer: \" + configuracion.size());\r\n String ruta = \"C:\\\\REPARTO\\\\\";\r\n File directorio = new File(ruta);\r\n Utilidades.AgregarLog(\"Descomprimiendo archivos ruta:\" + ruta);\r\n DescomprimirArchivosCarpeta(directorio);\r\n Utilidades.AgregarLog(\"Procesando archivos de reparto en ruta:\" + ruta);\r\n ProcesarDirectorio(directorio);\r\n\r\n } else {\r\n System.out.println(\"No se ha cargado la configuracion\");\r\n Utilidades.AgregarLog(\"No se ha cargado la configuracion\");\r\n }\r\n\r\n }", "public static Parametros ConfiguracionParametros(String ruta){\n try{\n Parametros theParametros = new Parametros();\n List<EventoPuertaMagnetica> eventoPM = new ArrayList<>();\n File theXmlFile = new File(ruta + \"config.xml\");\n DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();\n DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();\n Document doc = dBuilder.parse(theXmlFile);\n doc.getDocumentElement().normalize();\n\n String url_ws= doc.getDocumentElement().getElementsByTagName(\"Url_WebServices\").item(0).getTextContent();\n String id_port = doc.getDocumentElement().getElementsByTagName(\"Id_Portico\").item(0).getTextContent();\n String ip_bd = doc.getDocumentElement().getElementsByTagName(\"Base_Datos_IP\").item(0).getTextContent();\n String mani_puerta_chapa = doc.getDocumentElement().getElementsByTagName(\"Tiene_Chapa\").item(0).getTextContent();\n String dispo = doc.getDocumentElement().getElementsByTagName(\"Disposicion\").item(0).getTextContent();\n String crede_admin = doc.getDocumentElement().getElementsByTagName(\"Id_Crede_Administrador\").item(0).getTextContent();\n String loc_geo = doc.getDocumentElement().getElementsByTagName(\"Localizacion_Geografica\").item(0).getTextContent();\n\n NodeList events = doc.getDocumentElement().getElementsByTagName(\"Evento\"); //0 o mas ...\n for(int i=0; i< events.getLength(); i++){\n EventoPuertaMagnetica event = new EventoPuertaMagnetica();\n\n Node nodo = events.item(i);\n NodeList caracteristicasEvento = nodo.getChildNodes();\n\n String id_evento = caracteristicasEvento.item(0).getTextContent();\n String nombre_evento = caracteristicasEvento.item(1).getTextContent();\n\n event.set_U01B3F3(id_evento);\n event.set_DESTINO(nombre_evento);\n\n eventoPM.add(event);\n }\n theParametros.set_Url_WebServices(url_ws);\n theParametros.set_Id_Portico(id_port);\n theParametros.set_Base_Datos_IP(ip_bd);\n theParametros.set_Manipulacion_Puerta(mani_puerta_chapa);\n theParametros.set_Disposicion(dispo);\n theParametros.set_Id_CredencialAdmin(crede_admin);\n theParametros.set_Localizacion_Geografica(loc_geo);\n theParametros.set_Eventos(eventoPM);\n\n return theParametros;\n\n }catch (Exception ex){\n return null;\n }\n }", "private void procesarConfiguracion() {\n try {\n\n\n IXMLParser parser = XMLParserFactory.createDefaultXMLParser();\n IXMLReader reader = StdXMLReader.fileReader(Servidor.path_config);\n parser.setReader(reader);\n IXMLElement xml = (IXMLElement) parser.parse();\n Enumeration e = xml.enumerateChildren();\n\n Vector v, c;\n IXMLElement proc, caso;\n\n\n while (e.hasMoreElements()) {\n proc = (IXMLElement) e.nextElement();\n v = proc.getChildren();\n int n = 0;\n LinkedList<Caso> list = new LinkedList<>();\n while (n < v.size()) {\n caso = (IXMLElement) v.get(n);\n\n Caso ca = new Caso(((IXMLElement) caso.getChildrenNamed(\"solucion\").get(0)).getContent(), ((IXMLElement) caso.getChildrenNamed(\"normal\").get(0)).getContent(), ((IXMLElement) caso.getChildrenNamed(\"error\").get(0)).getContent());\n list.add(ca);\n n++;\n\n }\n config.put(proc.getName(), list);\n }\n\n\n\n\n\n } catch (XMLException | IOException | ClassNotFoundException | InstantiationException | IllegalAccessException ex) {\n Servidor.logger.severe(ex.toString());\n }\n\n\n }", "protected void printServerConfig(){\n\t\t/*String filePrefix = System.getProperty(\"user.dir\")+\"/src/server/\"+gameName;\n\t\tFile gameFolderServ = new File(filePrefix);\n\t\tString filePrefix2 = System.getProperty(\"user.dir\")+\"/src/auctions/\"+gameName;\n\t\tFile gameFolderAuct = new File(filePrefix2);\n\n\t\tFile server_config = new File(filePrefix+\"/Config_AuctionServer.txt\");\n\t\t*/\n\t\tFile server_config = new File(\"src/server/\"+\"Config_AuctionServer.txt\");\n\t\tif(!server_config.exists()){\n\n\t\t\t try{\n\n\t\t\t\t //gameFolderServ.mkdir();\n\t\t\t\t // gameFolderAuct.mkdir();\n\t\t\t\t server_config.createNewFile();\n\t\t\t\t FileWriter fstream = new FileWriter(server_config);\n\t\t\t\t BufferedWriter out = new BufferedWriter(fstream);\n\t\t\t\t if(localIP){\n\t\t\t\t\t out.write(\"Host_IP:local\\n\");\n\t\t\t\t }else{\n\t\t\t\t\t out.write(\"Host_IP:public\\n\");\n\t\t\t\t }\n\n\t\t\t\t out.write(\"Port_Number:\"+port+\"\\n\");\n\t\t\t\t //out.newLine();\n\n\t\t\t\t out.write(\"Min_Number_Clients:\"+minClients+\"\\n\");\n\t\t\t\t out.write(\"Max_Number_Clients:\"+maxClients+\"\\n\");\n\t\t\t\t out.write(\"Max_Wait_For_Clients:\"+maxWait+\"\\n\");\n\t\t\t\t out.write(\"Response_Time:\"+responseTime);\n\t\t\t\t out.newLine();\n\t\t\t\t if(respTime){\n\t\t\t\t\t out.write(\"Full_Response_Time:true\");\n\t\t\t\t }else{\n\t\t\t\t\t out.write(\"Full_Response_Time:false\");\n\t\t\t\t }\n\t\t\t\t out.newLine();\n\t\t\t\t out.write(\"Server_Log_File:Log_AuctionServer.txt\");\n\t\t\t\t out.newLine();\n\t\t\t\t out.write(\"Server_Results_File:Results_AuctionServer.txt\");\n\t\t\t\t out.newLine();\n\n\t\t\t\t if(maxSeq>1 && maxSim>1){\n\t\t\t\t\t out.write(\"Auction_Type:SequentialAuction\");\n\t\t\t\t\t out.newLine();\n\t\t\t\t\t out.write(\"Auction_Config_File:Config_Sequential_of_Simultaneous.txt\");\n\t\t\t\t\t out.newLine();\n\t\t\t\t }else if(maxSeq>1){\n\t\t\t\t\t out.write(\"Auction_Type:SequentialAuction\");\n\t\t\t\t\t out.newLine();\n\t\t\t\t\t out.write(\"Auction_Config_File:Config_SequentialAuction_0.txt\");\n\t\t\t\t\t out.newLine();\n\t\t\t\t }else if(maxSim>1){\n\t\t\t\t\t out.write(\"Auction_Type:SimultaneousAuction\");\n\t\t\t\t\t out.newLine();\n\t\t\t\t\t out.write(\"Auction_Config_File:Config_SimultaneousAuction_0.txt\");\n\t\t\t\t\t out.newLine();\n\t\t\t\t }else if(maxSeq==1 && maxSim==1){\n\t\t\t\t\t out.write(\"Auction_Type:\"+getAuctionName(auctionsSchedule[0])+\"\\n\");\n\t\t\t\t\t out.write(\"Auction_Config_File:Config_\"+getAuctionName(auctionsSchedule[0])+\"_0_0.txt\");\n\t\t\t\t\t out.newLine();\n\t\t\t\t }else{\n\t\t\t\t\t System.out.println(\"ERROR: no auctions\");\n\t\t\t\t }\n\n\t\t\t\t out.write(\"Valuation_Type:\"+valueFxn);\n\t\t\t\t out.newLine();\n\t\t\t\t out.write(\"Valuation_Config_File:Config_Valuation\"+valueFxn+\".txt\");\n\n\t\t\t\t out.close();\n\n\t\t\t }catch (IOException e){\n\t\t\t\t\tSystem.out.println(\"file error creating Server Config.\");\n\t\t\t}\n\t\t}\n\t}", "public static boolean ReescrituraConfig(String ruta, String ws, String ip_bd, String id_portico, String chapa, String dispo, String idAdmin, List<EventoPuertaMagnetica> eventos, String loc_geo){\n try{\n DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();\n DocumentBuilder docBuilder = docFactory.newDocumentBuilder();\n Document doc = docBuilder.newDocument();\n\n //creacion de elementos\n Element rootElement = doc.createElement(\"parametros\");\n Element urlWS = doc.createElement(\"Url_WebServices\");\n Element idPort = doc.createElement(\"Id_Portico\");\n Element ipBD = doc.createElement(\"Base_Datos_IP\");\n Element cha = doc.createElement(\"Tiene_Chapa\");\n Element disp = doc.createElement(\"Disposicion\");\n Element idAdm = doc.createElement(\"Id_Crede_Administrador\");\n Element lg = doc.createElement(\"Localizacion_Geografica\");\n\n doc.appendChild(rootElement); //ingreso de cabecera.\n\n //ingreso de datos a elementos\n urlWS.appendChild(doc.createTextNode(ws));\n idPort.appendChild(doc.createTextNode(id_portico));\n ipBD.appendChild(doc.createTextNode(ip_bd));\n cha.appendChild(doc.createTextNode(chapa));\n disp.appendChild(doc.createTextNode(dispo));\n idAdm.appendChild(doc.createTextNode(idAdmin));\n lg.appendChild(doc.createTextNode(loc_geo));\n\n //ingresos de elementos a cabecera\n rootElement.appendChild(urlWS);\n rootElement.appendChild(idPort);\n rootElement.appendChild(ipBD);\n rootElement.appendChild(cha);\n rootElement.appendChild(disp);\n rootElement.appendChild(idAdm);\n rootElement.appendChild(lg);\n\n if(chapa.equals(\"Z0B9C4B\")){\n for(int i=0; i<eventos.size(); i++){\n Element event = doc.createElement(\"Evento\");\n Element idEvent = doc.createElement(\"Id_Evento\");\n Element nombreEvent = doc.createElement(\"Nombre_Evento\");\n idEvent.appendChild(doc.createTextNode(eventos.get(i).get_U01B3F3()));\n nombreEvent.appendChild(doc.createTextNode(eventos.get(i).get_DESTINO()));\n event.appendChild(idEvent);\n event.appendChild(nombreEvent);\n rootElement.appendChild(event);\n }\n\n }\n\n //transformacion a archivo XML.\n\n TransformerFactory transFactory = TransformerFactory.newInstance();\n Transformer trans = transFactory.newTransformer();\n DOMSource source = new DOMSource(doc);\n File dir = new File(ruta);\n\n Log.i(TAG, \"Se verifica la existencia del archivo apra su creacion\");\n if(dir.exists()){\n //elimino el archivo xml junto con el folder.\n\n File [] archivo = dir.listFiles();//data/data/com.civi/config/config.xml\n if(archivo.length != 0){//existen archivos.\n Log.i(TAG, \"Archivo config existe, eliminando...\");\n if(archivo[0].delete()){\n Log.i(TAG, \"Archivo Config eliminado\");\n if(dir.delete()){//elimino el folder.\n Log.i(TAG, \"Folder config eliminado\");\n }else{\n Log.i(TAG, \"No fue posible la eliminacion del folder\");\n }\n }else{\n Log.i(TAG, \"NO fue posible la eliminacion del archivo\");\n }\n }else{\n Log.i(TAG, \"Archivo Config no existe. elimino solo el folder\");\n if(dir.delete()){\n Log.i(TAG, \"Folder eliminado\");\n }\n }\n\n }\n\n //Creacion de folder.\n if(dir.mkdirs()){\n StreamResult result = new StreamResult(new File(dir, \"config.xml\"));\n trans.transform(source, result);\n }\n Log.i(TAG, \"Generacion de config.xml realizada en \"+ruta);\n\n } catch(Exception ex){\n return false;\n }\n return true;\n }", "public static void main(String[] args) throws IOException {\n\n String path = System.getProperty(\"user.dir\")+\"\\\\Files\\\\Config2.properties\";\n FileInputStream fileInputStream=new FileInputStream(path);\n Properties properties=new Properties();\n properties.load(fileInputStream);\n System.out.println(properties.get(\"browser\"));\n System.out.println(properties.get(\"url\"));\n System.out.println(properties.get(\"username\"));\n System.out.println(properties.get(\"password\"));\n //fileInputStream.close();\n FileOutputStream fileOutputStream=new FileOutputStream(path);\n Properties properties1=new Properties();\n properties.store(fileOutputStream,\"Masoud\");\n\n\n\n\n }", "public void store() throws Exception\n {\n try\n {\n if (this.config == null)\n {\n Logger.info(\"creating ddv config\");\n this.config = DDVConfigFactory.create();\n }\n \n //////////////////////////////////////////////////////////////////////////\n // nicht konfigurierbare Werte\n this.config.setSoftPin(true); // Eingabe niemals ueber Kartenleser\n //\n //////////////////////////////////////////////////////////////////////////\n\n //////////////////////////////////////////////////////////////////////////\n // Sonstige Parameter\n \n // Kartenleser\n String reader = request.getParameter(\"reader\");\n if (reader == null || reader.length() == 0)\n throw new ApplicationException(i18n.tr(\"Bitte wähle ein Kartenleser-Modell aus\"));\n\n List<Reader> readers = this.getReaders();\n for (Reader r:readers)\n {\n if (r.getClass().getName().equals(reader))\n {\n this.config.setReaderPreset(r);\n this.config.setCTAPIDriver(r.getCTAPIDriver());\n break;\n }\n }\n \n if (this.config.getReaderPreset() == null)\n throw new ApplicationException(i18n.tr(\"Bitte wähle ein Kartenleser-Modell aus\"));\n if (this.config.getCTAPIDriver() == null)\n throw new ApplicationException(i18n.tr(\"Das Kartenleser-Modell wird vom Betriebssystem des Servers nicht unterstützt\"));\n \n // Bezeichnung\n this.config.setName(request.getParameter(\"name\"));\n \n // Port\n String port = request.getParameter(\"port\");\n if (port == null || port.length() == 0)\n throw new ApplicationException(i18n.tr(\"Bitte wähle einen Port aus\"));\n this.config.setPort(port);\n \n // HBCI-Version\n String hbciVersion = request.getParameter(\"hbciversion\");\n if (hbciVersion == null || port.length() == 0)\n throw new ApplicationException(i18n.tr(\"Bitte wähle eine HBCI-Version aus\"));\n this.config.setHBCIVersion(hbciVersion);\n\n // CT-Number\n try {\n this.config.setCTNumber(Integer.parseInt(request.getParameter(\"ctnumber\")));\n }\n catch (Exception e) {\n throw new ApplicationException(i18n.tr(\"Bitte wähle einen Wert für den Index des Lesers aus\"));\n }\n \n // Entry-Index\n try {\n this.config.setEntryIndex(Integer.parseInt(request.getParameter(\"entryindex\")));\n }\n catch (Exception e) {\n throw new ApplicationException(i18n.tr(\"Bitte wähle einen Wert für den Index des HBCI-Zugangs aus\"));\n }\n //\n //////////////////////////////////////////////////////////////////////////\n\n \n //////////////////////////////////////////////////////////////////////////\n // PIN-Checks\n String password = request.getParameter(\"pin\");\n String password2 = request.getParameter(\"pin2\");\n\n if (password == null || password.length() == 0)\n throw new ApplicationException(i18n.tr(\"Keine PIN angegeben\"));\n\n if (password2 == null || password2.length() == 0)\n throw new ApplicationException(i18n.tr(\"Bitte gib die PIN zur Kontrolle zweimal ein\"));\n\n if (!password.equals(password2))\n throw new ApplicationException(i18n.tr(\"PIN-Eingaben stimmen nicht überein.\"));\n\n Logger.info(\"saving pin in wallet\");\n de.willuhn.jameica.hbci.payment.Settings.setHBCIPassword(this.config.getId(),password);\n //\n //////////////////////////////////////////////////////////////////////////\n\n \n Logger.info(\"create passport handle\");\n PassportHandle handle = new PassportHandleImpl(this.config);\n \n Logger.info(\"fetch accounts\");\n Konto[] konten = readKonten(handle.open());\n if (konten != null)\n this.config.setKonten(Arrays.asList(konten)); // Konten fest verknuepfen\n DDVConfigFactory.store(this.config); // Config registrieren\n Application.getMessagingFactory().sendMessage(new StatusBarMessage(i18n.tr(\"Chipkarten-Einstellungen gespeichert und Konten angelegt.\"), StatusBarMessage.TYPE_SUCCESS));\n }\n catch (Exception e)\n {\n String msg = e.getMessage();\n if (!(e instanceof ApplicationException))\n {\n Logger.error(\"error while saving ddv config\",e);\n msg = i18n.tr(\"Fehler beim Speichern der Chipkarten-Einstellungen: {0}\",e.getMessage());\n }\n Application.getMessagingFactory().sendMessage(new StatusBarMessage(msg,StatusBarMessage.TYPE_ERROR));\n }\n\n }", "private void GetConfig()\n {\n boolean useClassPath = false;\n if(configFile_ == null)\n {\n useClassPath = true;\n configFile_ = \"data.config.lvg\";\n }\n // read in configuration file\n if(conf_ == null)\n {\n conf_ = new Configuration(configFile_, useClassPath);\n }\n }", "public static void initConfig()\r\n {\r\n try\r\n {\r\n ip = ConfigProperties.getKey(ConfigList.BASIC, \"AgentGateway_IP\");\r\n localIP = ConfigProperties.getKey(ConfigList.BASIC, \"Local_IP\");\r\n port = Integer.parseInt(ConfigProperties.getKey(ConfigList.BASIC, \"AgentGateway_PORT\"));\r\n }\r\n catch (NumberFormatException e)\r\n {\r\n log.error(\"read properties failed --\", e);\r\n }\r\n }", "private boolean readFileProperties()\n {\n boolean propertiesServidorCorrecto = false;\n boolean propertiesClienteCorrecto = true;\n try\n {\n InputStream fis = null;\n Properties properties = null;\n File archivo = null;\n // LEE PROPERTIES DEL SERVIDOR\n fis = \n this.getClass().getResourceAsStream(\"/PtoVentaServ.properties\");\n //25.01.2008 ERIOS Se lee la ruta del parametro\n if( fis == null)\n {\n log.info(\"No leyo archivo\");\n //archivo = new File(\"AdmCentralServ.properties\");\n archivo = new File(prop1);\n fis = new FileInputStream(archivo);\n log.info(\"\" + archivo);\n }\n if (fis != null)\n {\n properties = new Properties();\n properties.load(fis);\n FarmaVariables.vCodGrupoCia = \n properties.getProperty(\"CodigoGrupoCompania\");\n //log.debug(\"FarmaVariables.vCodGrupoCia=\" + FarmaVariables.vCodGrupoCia);\n FarmaVariables.vCodCia = properties.getProperty(\"CodigoCompania\");\n FarmaVariables.vCodLocal = properties.getProperty(\"CodigoLocal\");\n //log.debug(\"FarmaVariables.vCodLocal=\" + FarmaVariables.vCodLocal);\n FarmaVariables.vImprReporte = \n properties.getProperty(\"ImpresoraReporte\");\n //log.debug(\"FarmaVariables.vImprReporte=\" + FarmaVariables.vImprReporte);\n FarmaVariables.vIPBD = properties.getProperty(\"IpServidor\");\n /**\n * Se comento para cargarlos junto con la clave\n * @author dubilluz\n * @since 13.10.2007\n */\n /*\n FarmaVariables.vSID = properties.getProperty(\"SID\");\n //log.debug(\"FarmaVariables.vSID=\" + FarmaVariables.vSID);\n if(FarmaVariables.vSID == null)\n FarmaVariables.vSID = ConstantsPtoVenta.SID;\n\n //FarmaVariables.vUsuarioBD = FarmaEncripta.desencripta(properties.getProperty(\"UsuarioBD\"));\n FarmaVariables.vUsuarioBD = properties.getProperty(\"UsuarioBD\");\n //log.debug(\"FarmaVariables.vUsuarioBD=\" + FarmaVariables.vUsuarioBD);\n if(FarmaVariables.vUsuarioBD == null)\n FarmaVariables.vUsuarioBD = ConstantsPtoVenta.USUARIO_BD;\n */\n log.info(\"cargo properties servidor ptoventa\");\n\n propertiesServidorCorrecto = true;\n }\n else\n {\n FarmaUtility.showMessage(myparent, \n \"Archivo de Configuracion del Servidor no Encontrado.\\nPóngase en contacto con el área de sistemas.\", \n null);\n log.info(\"NO cargo properties servidor ptoventa\");\n propertiesServidorCorrecto = false;\n }\n if (propertiesServidorCorrecto && propertiesClienteCorrecto)\n return true;\n else\n return false;\n }\n catch (FileNotFoundException fnfException)\n {\n log.error(\"\",fnfException);\n FarmaUtility.showMessage(myparent, \n \"Archivo de Configuracion del Servidor no Encontrado.\\nPóngase en contacto con el área de sistemas.\", \n null);\n }\n catch (IOException ioException)\n {\n log.error(\"\",ioException);\n FarmaUtility.showMessage(myparent, \n \"Error al leer archivo de Configuracion.\\nPóngase en contacto con el área de sistemas.\", \n null);\n }\n myparent.dispose();\n return false;\n }", "private void readProperties() throws Exception{\n\t\t InputStream fisGlobal=null,fisModul=null; \n\t\t propiedades = new Properties();\n try {\n \t // Path directorio de configuracion\n \t String pathConf = System.getProperty(\"ad.path.properties\");\n \t \n \t // Propiedades globales\n \t fisGlobal = new FileInputStream(pathConf + \"sistra/global.properties\");\n \t propiedades.load(fisGlobal);\n \t\t \n \t // Propiedades modulo\n \t\t fisModul = new FileInputStream(pathConf + \"sistra/plugins/plugin-firma.properties\");\n \t\t propiedades.load(fisModul);\n \t \t \t\t \n } catch (Exception e) {\n \t propiedades = null;\n throw new Exception(\"Excepcion accediendo a las propiedadades del modulo\", e);\n } finally {\n try{if (fisGlobal != null){fisGlobal.close();}}catch(Exception ex){}\n try{if (fisModul != null){fisModul.close();}}catch(Exception ex){}\n }\t\t\n\t}", "public void refreshGUIConfiguration() {\n\t\tcbxFEP.setSelectedItem(Initializer.getFEPname());\n\t\ttxtPort.setText(String.valueOf(Initializer.getPortNumber()));\n\t\t\n\t\tfor(Map.Entry<String, String> value : Initializer.getConfigurationTracker().getFepPropertiesMap().entrySet()) {\n\t\t\tif(value.getKey().equals(\"valueOfBitfield76\")) {\n\t\t\t\tSystem.out.println(value.getValue());\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (Initializer.getConfigurationTracker().getFepPropertiesMap()\n\t\t\t\t.get(Initializer.getBaseConstants().sendResponseVariableName).equalsIgnoreCase(\"No\")) {\n\t\t\trdbtnDontSendResponse.setSelected(true);\n\t\t} else {\n\t\t\trdbtnSendResponse.setSelected(true);\n\t\t}\n\n\t\tif (Initializer.getConfigurationTracker().getFepPropertiesMap()\n\t\t\t\t.get(Initializer.getBaseConstants().authorizationResultVariableName)\n\t\t\t\t.equalsIgnoreCase(Initializer.getBaseConstants().approvalValue)) {\n\t\t\trdbtnAuthorizationApprove.setSelected(true);\n\t\t} else if (Initializer.getConfigurationTracker().getFepPropertiesMap()\n\t\t\t\t.get(Initializer.getBaseConstants().authorizationResultVariableName)\n\t\t\t\t.equalsIgnoreCase(Initializer.getBaseConstants().declineValue)) {\n\t\t\trdbtnAuthorizationDecline.setSelected(true);\n\t\t} else if (Initializer.getConfigurationTracker().getFepPropertiesMap()\n\t\t\t\t.get(Initializer.getBaseConstants().authorizationResultVariableName)\n\t\t\t\t.equalsIgnoreCase(Initializer.getBaseConstants().partialApprovalValue)) {\n\t\t\trdbtnAuthorizationPartiallyapprove.setSelected(true);\n\t\t}\n\n\t\tif (Initializer.getConfigurationTracker().getFepPropertiesMap()\n\t\t\t\t.get(Initializer.getBaseConstants().financialSalesResultVariableName)\n\t\t\t\t.equalsIgnoreCase(Initializer.getBaseConstants().approvalValue)) {\n\t\t\trdbtnFinancialSalesApprove.setSelected(true);\n\t\t} else if (Initializer.getConfigurationTracker().getFepPropertiesMap()\n\t\t\t\t.get(Initializer.getBaseConstants().financialSalesResultVariableName)\n\t\t\t\t.equalsIgnoreCase(Initializer.getBaseConstants().declineValue)) {\n\t\t\trdbtnFinancialSalesDecline.setSelected(true);\n\t\t} else if (Initializer.getConfigurationTracker().getFepPropertiesMap()\n\t\t\t\t.get(Initializer.getBaseConstants().financialSalesResultVariableName)\n\t\t\t\t.equalsIgnoreCase(Initializer.getBaseConstants().partialApprovalValue)) {\n\t\t\trdbtnFinancialSalesPartiallyapprove.setSelected(true);\n\t\t}\n\n\t\tif (Initializer.getConfigurationTracker().getFepPropertiesMap()\n\t\t\t\t.get(Initializer.getBaseConstants().financialForceDraftResultVariableName)\n\t\t\t\t.equalsIgnoreCase(Initializer.getBaseConstants().approvalValue)) {\n\t\t\trdbtnFinancialForceDraftApprove.setSelected(true);\n\t\t} else if (Initializer.getConfigurationTracker().getFepPropertiesMap()\n\t\t\t\t.get(Initializer.getBaseConstants().financialForceDraftResultVariableName)\n\t\t\t\t.equalsIgnoreCase(Initializer.getBaseConstants().declineValue)) {\n\t\t\trdbtnFinancialForceDraftDecline.setSelected(true);\n\t\t}\n\n\t\tif (Initializer.getConfigurationTracker().getFepPropertiesMap()\n\t\t\t\t.get(Initializer.getBaseConstants().reconciliationResultVariableName)\n\t\t\t\t.equalsIgnoreCase(Initializer.getBaseConstants().approvalValue)) {\n\t\t\trdbtnReconciliationApprove.setSelected(true);\n\t\t} else if (Initializer.getConfigurationTracker().getFepPropertiesMap()\n\t\t\t\t.get(Initializer.getBaseConstants().reconciliationResultVariableName)\n\t\t\t\t.equalsIgnoreCase(Initializer.getBaseConstants().declineValue)) {\n\t\t\trdbtnReconciliationDecline.setSelected(true);\n\t\t}\n\n\t\tif (Initializer.getConfigurationTracker().getFepPropertiesMap()\n\t\t\t\t.get(Initializer.getBaseConstants().reversalResultVariableName)\n\t\t\t\t.equalsIgnoreCase(Initializer.getBaseConstants().approvalValue)) {\n\t\t\trdbtnReversalApprove.setSelected(true);\n\t\t} else if (Initializer.getConfigurationTracker().getFepPropertiesMap()\n\t\t\t\t.get(Initializer.getBaseConstants().reversalResultVariableName)\n\t\t\t\t.equalsIgnoreCase(Initializer.getBaseConstants().declineValue)) {\n\t\t\trdbtnReversalDecline.setSelected(true);\n\t\t}\n\n\t\ttxtDeclineCode\n\t\t\t\t.setText(Initializer.getConfigurationTracker().getFepPropertiesMap().get(\"ValueOfBitfield39Decline\"));\n\t\ttxtApprovalAmount.setText(Initializer.getConfigurationTracker().getFepPropertiesMap().get(\"valueOfBitfield4\"));\n\t\tif (Initializer.getConfigurationTracker().getFepPropertiesMap().get(\"isHalfApprovalRequired\")\n\t\t\t\t.equalsIgnoreCase(\"true\")) {\n\t\t\tchckbxApproveForHalf.setSelected(true);\n\t\t\ttxtApprovalAmount.setEnabled(false);\n\t\t} else {\n\t\t\tchckbxApproveForHalf.setSelected(false);\n\t\t\ttxtApprovalAmount.setEnabled(true);\n\t\t}\n\t\t\n\t\tlogger.debug(\"GUI configuration updated based on the FEP properties configured\");\n\t}", "private void loadConfig()\n {\n File config = new File(\"config.ini\");\n\n if (config.exists())\n {\n try\n {\n BufferedReader in = new BufferedReader(new FileReader(config));\n\n configLine = Integer.parseInt(in.readLine());\n configString = in.readLine();\n socketSelect = (in.readLine()).split(\",\");\n in.close();\n }\n catch (Exception e)\n {\n System.exit(1);\n }\n }\n else\n {\n System.exit(1);\n }\n }", "public Properties loadConfig(){\n\t\tprintln(\"Begin loadConfig \");\n\t\tProperties prop = null;\n\t\t prop = new Properties();\n\t\ttry {\n\t\t\t\n\t\t\tprop.load(new FileInputStream(APIConstant.configFullPath));\n\n\t } catch (Exception ex) {\n\t ex.printStackTrace();\n\t println(\"Exception \"+ex.toString());\n\t \n\t }\n\t\tprintln(\"End loadConfig \");\n\t\treturn prop;\n\t\t\n\t}", "public interface Config {\n int MAX_IP_RECORD = 10;\n String ADB_PATH = \"adb_path\";\n String IP_HISTORY = \"ip_history\";\n String TITLE = \"Wifi Adb Ultimate\";\n String HELP = \"https://github.com/Sausure/WIFIADB/tree/master/WIFIADBIntelliJPlugin\";\n String DEFAULT_PORT = \"5555\";\n String EMPTY = \"\";\n String SPACE = \" \";\n String ANY_SPACES = \"\\\\s{1,}\";\n String ENTER = \"\\\\n\";\n String TAB = \"\\\\t\";\n String DEFAULT_PROGRESS_TIP = \"Wait a moment\";\n String DAEMON_FLAG = Utils.concat(SPACE,\"daemon\",SPACE);\n String IP_PATTERN = \"\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}:\\\\d{1,5}\";\n}", "private void saveConfiguration() {\n }", "public ReadConfig() \n\t{\n\t\tFile scr = new File(\"./Configuration/config.properties\"); //property file\n\n\t\tFileInputStream fis;\n\t\ttry {\n\t\t\tfis = new FileInputStream(scr); // READ the DATA (read mode)\n\t\t\tpro = new Properties(); // pro object\n\t\t\tpro.load(fis); // Load method -load at the \n\n\t\t} catch (final Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tSystem.out.println(\"Except is \" + e.getMessage());\n\t\t} \n\t}", "ArrayList<ArrayList<String>> get_config(){\n return config_file.r_wartosci();\n }", "public static Config createJeruslaemConfig() {\n\t\tConfig config = ConfigUtils.createConfig();\n\n\t\tconfig.network().setInputFile(INPUT_NETWORK);\n\t\tconfig.plans().setInputFile(INPUT_POPULATION);\n\t\tconfig.facilities().setInputFile(INPUT_FACILITES);\n\t\tconfig.households().setInputFile(INPUT_HOUSEHOLDS);\n\n\t\t// modify controler\n\t\tconfig.controler().setWriteEventsInterval(25);\n\t\tconfig.controler().setWritePlansInterval(25);\n\t\tconfig.controler().setEventsFileFormats(EnumSet.of(EventsFileFormat.xml));\n\t\tconfig.controler().setOutputDirectory(OUTPUT_FOLDER + RUN_ID + \"/\");\n\t\tconfig.controler().setOverwriteFileSetting(OverwriteFileSetting.overwriteExistingFiles);\n\t\tconfig.controler().setFirstIteration(0);\n\t\tconfig.controler().setLastIteration(300);\n\t\tconfig.controler().setMobsim(\"qsim\");\n\t\tconfig.controler().setRoutingAlgorithmType(RoutingAlgorithmType.FastAStarLandmarks);\n\t\tconfig.controler().setRunId(RUN_ID);\n\t\t\n\t\t// modify Qsim\n\t\tconfig.qsim().setStartTime(0.0);\n\t\tconfig.qsim().setEndTime(30 * 3600);\n\t\tconfig.qsim().setFlowCapFactor(0.3);\n\t\tconfig.qsim().setStorageCapFactor(Math.pow(0.3, 0.75));\n\t\tconfig.qsim().setNumberOfThreads(12);\n\t\tconfig.qsim().setSnapshotPeriod(1);\n\t\tconfig.qsim().setStuckTime(10);//30,60 or multiply by 60\n\t\tconfig.qsim().setRemoveStuckVehicles(false);\n\t\tconfig.qsim().setTimeStepSize(1);\n\t\tconfig.qsim().setTrafficDynamics(TrafficDynamics.kinematicWaves);// kinematic waves\n\t\tconfig.qsim().setMainModes(Arrays.asList(TransportMode.car));\n\t\tconfig.qsim().setInsertingWaitingVehiclesBeforeDrivingVehicles(true);\n\n\t\t// modify global\n\t\tconfig.global().setCoordinateSystem(\"EPSG:2039\");\n\t\tconfig.global().setNumberOfThreads(16);\n\t\t// ?? random seed?<param name=\"randomSeed\" value=\"4711\" />\n\t\t\n\t\t// Add transit\n\t\tconfig.transit().setUseTransit(true);\n\t\tconfig.transit().setTransitScheduleFile(INPUT_TRANSIT_SCHEDULE);\n\t\tconfig.transit().setVehiclesFile(INPUT_TRANSIT_VEHICLES);\n\t\t\n\n\n//\t\t// Add sub-tour mode choice\n//\t\tconfig.subtourModeChoice()\n//\t\t\t\t.setModes(new String[] { TransportMode.car, TransportMode.pt, TransportMode.walk, TransportMode.bike });\n//\t\t// TODO check that bike is biycle\n//\t\tconfig.subtourModeChoice().setChainBasedModes(new String[] { TransportMode.car });\n//\n\t\t// Add sub-tour mode choice\n\t\tconfig.timeAllocationMutator().setMutationRange(3600);\n\n\t\t// Add strategy\n\t\tconfig.strategy().setMaxAgentPlanMemorySize(5);\n\t\tconfig.strategy().setFractionOfIterationsToDisableInnovation(0.8);\n\n\t\t// Add strategy - plan selector\n\t\tStrategySettings changeExpStrategy = new StrategySettings();\n\t\tchangeExpStrategy.setDisableAfter(-1);\n\t\tchangeExpStrategy.setStrategyName(DefaultPlanStrategiesModule.DefaultSelector.ChangeExpBeta.toString());\n\t\tchangeExpStrategy.setWeight(0.8);\n\t\tconfig.strategy().addStrategySettings(changeExpStrategy);\n\n//\t\t Add strategy - time-mutation\n\t\tStrategySettings timeMutatorStrategy = new StrategySettings();\n\t\ttimeMutatorStrategy\n\t\t\t\t.setStrategyName(DefaultPlanStrategiesModule.DefaultStrategy.TimeAllocationMutator.toString());\n\t\ttimeMutatorStrategy.setWeight(0.1);\n\t\tconfig.strategy().addStrategySettings(timeMutatorStrategy);\n\n\t\t// Add strategy - re-route\n\t\tStrategySettings reRouteStrategy = new StrategySettings();\n\t\treRouteStrategy.setStrategyName(DefaultPlanStrategiesModule.DefaultStrategy.ReRoute.toString());\n\t\treRouteStrategy.setWeight(0.1);\n\t\tconfig.strategy().addStrategySettings(reRouteStrategy);\n\n//\t\t Add strategy - Sub-tour strategy\n\t\tStrategySettings subTourModeChoiceStrategy = new StrategySettings();\n\t\tsubTourModeChoiceStrategy\n\t\t\t\t.setStrategyName(DefaultPlanStrategiesModule.DefaultStrategy.SubtourModeChoice.toString());\n\t\tsubTourModeChoiceStrategy.setWeight(0.1);\n\t\tconfig.strategy().addStrategySettings(subTourModeChoiceStrategy);\n\n\t\t// add car Availability after adding attributes to popualtion\n\t\t config.subtourModeChoice().setConsiderCarAvailability(true);\n\n\t\t// add network modes which are simulated on network in future add more modes\n\t\t// config.plansCalcRoute().setNetworkModes(Arrays.asList(TransportMode.car));\n\t\t// config.plansCalcRoute().setInsertingAccessEgressWalk(true);\n\n\t\t// // just a place hodler\n\t\t// ModeRoutingParams taxiModeRoute = new ModeRoutingParams();\n\t\t// taxiModeRoute.setMode(TransportMode.taxi);\n\t\t// taxiModeRoute.setTeleportedModeSpeed(100.0);\n\t\t// config.plansCalcRoute().addModeRoutingParams(taxiModeRoute);\n\n\t\t// global scoring values taken from TLVM model = SF 14\n\t\tconfig.planCalcScore().setEarlyDeparture_utils_hr(0.0);\n\t\tconfig.planCalcScore().setLateArrival_utils_hr(0);\n\t\tconfig.planCalcScore().setMarginalUtilityOfMoney(0.062);\n\t\tconfig.planCalcScore().setPerforming_utils_hr(0.96);\n\t\tconfig.planCalcScore().setUtilityOfLineSwitch(0);\n\t\tconfig.planCalcScore().setMarginalUtlOfWaitingPt_utils_hr(-0.18);\n\n\t\t// car scoring functions from TLVM model = SF 14\n\t\tPlanCalcScoreConfigGroup.ModeParams carCalcScoreParams = new PlanCalcScoreConfigGroup.ModeParams(\n\t\t\t\tTransportMode.car);\n\t\tcarCalcScoreParams.setConstant(-0.562);\n\t\tcarCalcScoreParams.setMode(\"car\");\n\t\tcarCalcScoreParams.setMonetaryDistanceRate(-0.0004);\n\t\tconfig.planCalcScore().addModeParams(carCalcScoreParams);\n\n\t\t// PT scoring functions from TLVM model = SF 14\n\t\tPlanCalcScoreConfigGroup.ModeParams ptCalcScoreParams = new PlanCalcScoreConfigGroup.ModeParams(\n\t\t\t\tTransportMode.pt);\n\t\tptCalcScoreParams.setConstant(-0.124);\n\t\tptCalcScoreParams.setMode(\"pt\");\n\t\tptCalcScoreParams.setMarginalUtilityOfTraveling(-0.18);\n\t\tconfig.planCalcScore().addModeParams(ptCalcScoreParams);\n\n\t\t// Walk scoring functions from TLVM model = SF 14\n\t\tPlanCalcScoreConfigGroup.ModeParams walkCalcScoreParams = new PlanCalcScoreConfigGroup.ModeParams(\n\t\t\t\tTransportMode.walk);\n\t\twalkCalcScoreParams.setMode(\"walk\");\n\t\twalkCalcScoreParams.setMarginalUtilityOfTraveling(-1.14);\n\t\tconfig.planCalcScore().addModeParams(walkCalcScoreParams);\n\n\t\t// TODO get values for Taxi scoring\n\t\t// Taxi scoring functions place holder (taken from car)\n\t\t// PlanCalcScoreConfigGroup.ModeParams TaxiCalcScoreParams = new\n\t\t// PlanCalcScoreConfigGroup.ModeParams(TransportMode.taxi);\n\t\t// TaxiCalcScoreParams.setConstant(-0.562);\n\t\t// TaxiCalcScoreParams.setMode(\"taxi\");\n\t\t// TaxiCalcScoreParams.setMonetaryDistanceRate(-0.0004);\n\t\t// config.planCalcScore().addModeParams(walkCalcScoreParams);\n\n\t\t// TODO add ride as network mode remove from modechoice\n\t\t// Ride scoring functions place holder taken from Berlin MATSim model -\n\t\t// monetaryDistanceRate same as car -0.0004\n\t\tPlanCalcScoreConfigGroup.ModeParams rideCalcScoreParams = new PlanCalcScoreConfigGroup.ModeParams(\n\t\t\t\tTransportMode.ride);\n\t\trideCalcScoreParams.setMode(\"ride\");\n\t\trideCalcScoreParams.setMonetaryDistanceRate(-0.0004);\n\t\tconfig.planCalcScore().addModeParams(rideCalcScoreParams);\n\n\t\t// TODO check with JLM bike - bicyle\n\t\t// bike scoring functions place holder taken from Berlin MATSim model of bicyke\n\t\tPlanCalcScoreConfigGroup.ModeParams bikeCalcScoreParams = new PlanCalcScoreConfigGroup.ModeParams(\n\t\t\t\tTransportMode.bike);\n\t\tbikeCalcScoreParams.setConstant(-1.9);\n\t\tbikeCalcScoreParams.setMode(\"bike\");\n\t\tconfig.planCalcScore().addModeParams(bikeCalcScoreParams);\n\n\t\t// TODO get activities open hours\n\t\tActivityParams home = new ActivityParams(\"home\");\n\t\thome.setTypicalDuration(16 * 60 * 60);\n\t\tconfig.planCalcScore().addActivityParams(home);\n\n\t\tActivityParams work = new ActivityParams(\"work\");\n\t\twork.setOpeningTime(6 * 3600);\n\t\twork.setClosingTime(20 * 3600);\n\t\twork.setTypicalDuration(8 * 60 * 60);\n\t\tconfig.planCalcScore().addActivityParams(work);\n\n\t\tActivityParams school = new ActivityParams(\"school\");\n\t\tschool.setOpeningTime(8 * 3600);\n\t\tschool.setClosingTime(14 * 3600);\n\t\tschool.setTypicalDuration(8 * 60 * 60);\n\t\tconfig.planCalcScore().addActivityParams(school);\n\n\t\tActivityParams leisure = new ActivityParams(\"leisure\");\n\t\tleisure.setOpeningTime(9 * 3600);\n\t\tleisure.setClosingTime(24 * 3600);\n\t\tleisure.setTypicalDuration(8 * 60 * 60);\n\t\tconfig.planCalcScore().addActivityParams(leisure);\n\n\t\tActivityParams other = new ActivityParams(\"other\");\n\t\tother.setTypicalDuration(8 * 60 * 60);\n\t\tconfig.planCalcScore().addActivityParams(other);\n\n\t\treturn config;\n\n\t}", "public abstract String getConfig();", "private void readPreferences() {\n configAutonomousCommand();\n }", "public static void recuperarFecha() {\n\n try(ObjectInputStream ois=new ObjectInputStream(new FileInputStream(\"config.ser\"))){\n //Cuando no haya mas objetos saltara la excepcion EOFException\n while(true){\n Configuracion aux=(Configuracion)ois.readObject();\n System.out.println(\"Fecha:\" + aux.getFecha() + \" \" + \"Hora: \" + aux.getHora()+\"\\n\");\n }\n }catch(ClassNotFoundException e){\n }catch(EOFException e){\n }catch(IOException e){\n }\n }", "protected void initializeCommandLineConfiguration(RacfConfiguration config) throws IOException {\r\n config.setHostNameOrIpAddr(HOST_NAME);\r\n config.setUseSsl(USE_SSL);\r\n config.setHostTelnetPortNumber(HOST_TELNET_PORT);\r\n config.setCommandTimeout(60*1000);\r\n config.setReaperMaximumIdleTime(15*60*1000);\r\n config.setConnectScript(getLoginScript());\r\n config.setDisconnectScript(getLogoffScript());\r\n config.setUserNames(new String[] {SYSTEM_USER} );\r\n config.setPasswords(new GuardedString[] {new GuardedString(SYSTEM_PASSWORD.toCharArray())});\r\n config.setSegmentNames(new String[] { \r\n \"ACCOUNT.RACF\", \"ACCOUNT.TSO\", \"ACCOUNT.NETVIEW\",\r\n \"ACCOUNT.CICS\", \"ACCOUNT.OMVS\", \"ACCOUNT.CATALOG\", \r\n \"ACCOUNT.OMVS\", \"GROUP.RACF\" });\r\n config.setSegmentParsers(new String[] { \r\n loadParserFromFile(RACF_PARSER), loadParserFromFile(TSO_PARSER), loadParserFromFile(NETVIEW_PARSER), \r\n loadParserFromFile(CICS_PARSER), loadParserFromFile(OMVS_PARSER), loadParserFromFile(CATALOG_PARSER), \r\n loadParserFromFile(OMVS_PARSER), loadParserFromFile(GROUP_RACF_PARSER) });\r\n //config.setConnectionClassName(\"org.identityconnectors.rw3270.wrq.WrqConnection\");\r\n config.setConnectionClassName(\"org.identityconnectors.rw3270.hod.HodConnection\");\r\n //config.setConnectionClassName(\"org.identityconnectors.rw3270.freehost3270.FH3270Connection\");\r\n }", "public String getConfig();", "C getConfiguration();", "public void intiSettings()throws Exception{\r\n\r\n\t\tinputStream = new FileInputStream(System.getProperty(\"user.dir\")+\"\\\\config.properties\");\r\n\t\tconfig.load(inputStream);\r\n\t\t\r\n\t\tprop.put(\"bootstrap.servers\", config.getProperty(\"bootstrap.servers\"));\r\n\t\tprop.put(\"key.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\r\n\t\tprop.put(\"value.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\r\n\r\n\t\ttopicName = config.getProperty(\"TopicName\");\r\n\t\ttopicName = createTopic(topicName);\r\n\t\t\r\n\t\tmessageList = Arrays.asList(config.getProperty(\"messages\").split(\"\\\\|\"));\r\n\t}", "public byte[] obtenerConfigSincronizar() {\n\n if (conectado) {\n try {\n String bool = \"false\";\n byte[] myTrue = bool.getBytes(Charset.forName(\"UTF-8\"));\n\n String Query = \"SELECT * FROM `configuraciones` \";\n Logy.mi(\"Consulta de configuraciones\");\n Logy.mi(\"Query: \" + Query);\n Statement st = Conexion.createStatement();\n ResultSet resultSet;\n resultSet = st.executeQuery(Query);\n while (resultSet.next()) {\n if (resultSet.getString(\"configuracion\").equals(\"sincronizar\")) {\n return resultSet.getBytes(\"valor\");\n }\n\n }\n Logy.mi(\"al parecer no se encontro la configuracion SINCRONIZAR en la DB\");\n return null;\n\n } catch (SQLException ex) {\n Logy.me(\"No se pudo consultar las configuraciones de la DB: \" + ex.getMessage());\n return null;\n }\n } else {\n Logy.me(\"No se ha establecido previamente una conexion a la DB\");\n return null;\n }\n }", "private static void loadConfig() throws IOException { \t\t\n final InputStream input = Main.class.getResourceAsStream(\"/configuration.properties\");\n final Properties prop = new Properties();\n \n prop.load(input);\n System.out.println(\"Configuration loaded:\"); \n\n // PostgreSQL server access config\n dbmsUrl = prop.getProperty(\"dbms_url\");\n System.out.println(\"- dbms_url: \" + dbmsUrl);\n\n dbmsUser = prop.getProperty(\"dbms_user\");\n System.out.println(\"- dbms_user: \" + dbmsUser);\n\n userPw = prop.getProperty(\"user_pw\"); \n System.out.println(\"- user_pw: \" + userPw);\n\n\n // Benchmarks config\n noTransactions = Integer.parseInt(prop.getProperty(\"no_transactions\"));\n System.out.println(\"- no_transactions: \" + noTransactions);\n\n noStatementsPerTransaction = Integer.parseInt(prop.getProperty(\"no_statements_per_transaction\")); \n System.out.println(\"- no_statements_per_transaction: \" + noStatementsPerTransaction);\n\n noSelectStatements = Integer.parseInt(prop.getProperty(\"no_select_statements\")); \n System.out.println(\"- no_select_statements: \" + noSelectStatements + \"\\n\");\n\n input.close();\n }", "@Override\n\tpublic Map<String, String> getConf() {\n\t\treturn null;\n\t}", "private static String getConfigFile() {\n\n final String sPath = getUserFolder();\n\n return sPath + File.separator + \"sextante.settings\";\n\n }", "public DialogoConfiguracion(java.awt.Frame parent, boolean modal) {\n super(parent, modal); \n initComponents();\n jTextFieldServidor.setEnabled(false);\n jTextFieldBD.setEnabled(false);\n jTextFieldUsuario.setEnabled(false);\n jTextFieldPassword.setEnabled(false); \n this.setLocationRelativeTo(parent); \n try {\n FileReader fichProp = new FileReader(\"agenda.cfg\");\n propiedades.load(fichProp); \n if(propiedades.getProperty(\"protocolo\")!=null &&\n propiedades.getProperty(\"protocolo\").equals(\"jdbc:mysql://\")) {\n jRadioButtonMySQL.setSelected(true);\n \n jTextFieldServidor.setEnabled(true);\n jTextFieldBD.setEnabled(true);\n jTextFieldUsuario.setEnabled(true);\n jTextFieldPassword.setEnabled(true); \n \n jTextFieldServidor.setText(propiedades.getProperty(\"servidor\"));\n jTextFieldBD.setText(propiedades.getProperty(\"BD\"));\n jTextFieldUsuario.setText(propiedades.getProperty(\"usuario\"));\n jTextFieldPassword.setText(propiedades.getProperty(\"password\"));\n } else {\n jRadioButtonDerby.setSelected(false);\n \n jTextFieldServidor.setEnabled(false);\n jTextFieldBD.setEnabled(false);\n jTextFieldUsuario.setEnabled(false);\n jTextFieldPassword.setEnabled(false); \n \n jTextFieldServidor.setText(\"\");\n jTextFieldBD.setText(\"\");\n jTextFieldUsuario.setText(\"\");\n jTextFieldPassword.setText(\"\");\n }\n } catch(IOException e) {\n jTextFieldServidor.setText(\"\");\n jTextFieldBD.setText(\"\");\n jTextFieldUsuario.setText(\"\");\n jTextFieldPassword.setText(\"\");\n }\n }", "public static void main(String args[]) {\n //seta o look and feel para o do SO\n try {\n UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\n } catch (Exception e) {\n }\n\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n Caixa c = new Caixa();\n c.setVisible(true);\n c.executaProcedimentosConfiguracao();\n }\n });\n\n /* Exercicio: ativar o marketing\n Banner b = new Banner();\n new Thread(b).start();\n */\n /*try {\n Properties arquivoConexao = new Properties();\n arquivoConexao.load(new FileInputStream(new File(System.getProperty(\"user.dir\")\n + System.getProperty(\"file.separator\")\n + \"conexao.properties\")));\n pathCargaRemoto = arquivoConexao.getProperty(\"importa.RemoteApp\");\n } catch (Exception e) {\n }*/\n }", "private void loadFtpConfiguration(){\n\t\t//Get the active profile\n\t\tProfile activeProfile = settingsService.getActiveProfile();\n\t\tHOST = activeProfile.getIpNmt();\n\t\t\n\t\tString puerto = activeProfile.getFtpPort();\n\t\tif (null != puerto && !\"\".equals(puerto)){\n\t\t\tPORT = Integer.valueOf(puerto);\t\t\n\t\t} else {\n\t\t\tPORT = 21; //DEFAULT PORT\n\t\t}\n\t\tUSERNAME = activeProfile.getFtpUser();\n\t\tPASSWORD = activeProfile.getFtpPassword();\t\t\n\t}", "public Proyectil(){\n disparar=false;\n ubicacion= new Rectangle(0,0,ancho,alto);\n try {\n look = ImageIO.read(new File(\"src/Disparo/disparo.png\"));\n } catch (IOException ex) {\n System.out.println(\"error la imagen del proyectil no se encuentra en la ruta por defecto\");\n }\n }", "public DretvaZaObraduPoruka(WebKonfiguracija config, ServerSocket server) {\n this.server = server;\n this.config = config;\n this.setName(\"DretvaZaObraduPoruka\");\n }", "public void printConfig();", "private void valoresconfiguracion() {\n\n String file_ultimanotificacion = \"ultima_notificacion\";\n\n String file_ramdom = \"ramdom_number_file\";\n\n String file_vibrar = \"vibrar_file\";\n String file_sonido = \"sonido_file\";\n String file_notificar = \"notificar_file\";\n String file_tipo = \"tipo_file\";\n String file_ringtone = \"ring_tone_file\";\n\n\n String file_nombre_ringtone = \"nombre_ringtone__file\";\n\n\n String ultimanotificacion_val = \"notexist\";\n\n\n String vibrar_val = \"11111\";\n String sonido_val = \"A\";\n String notificacion_val = \"11111\";\n String ringtone_val = \"A\";\n\n String tiposonidoval = \"11111\";\n String nombre_ringtone_val = \"A\";\n\n\n try {\n // FileOutputStream fileOutputStream = openFileOutput(file_name, MODE_PRIVATE);\n //fileOutputStream.write(parametro1.getBytes());\n\n\n // fileOutputStream.write(parametro2.getBytes());\n // fileOutputStream.write(parametro3.getBytes());\n // fileOutputStream.write(parametro4.getBytes());\n // fileOutputStream.write(parametro5.getBytes());\n // fileOutputStream.write(parametro6.getBytes());\n\n FileOutputStream fileOutputStream_ultimanot = openFileOutput(file_ultimanotificacion, MODE_PRIVATE);\n fileOutputStream_ultimanot.write(ultimanotificacion_val.getBytes());\n\n\n\n FileOutputStream fileOutputStream_ramdom = openFileOutput(file_ramdom, MODE_PRIVATE);\n fileOutputStream_ramdom.write(vibrar_val.getBytes());\n\n FileOutputStream fileOutputStream_vibrar = openFileOutput(file_vibrar, MODE_PRIVATE);\n fileOutputStream_vibrar.write(vibrar_val.getBytes());\n\n\n FileOutputStream fileOutputStream_sonido = openFileOutput(file_sonido, MODE_PRIVATE);\n fileOutputStream_sonido.write(sonido_val.getBytes());\n\n\n FileOutputStream fileOutputStream_notificar = openFileOutput(file_notificar, MODE_PRIVATE);\n fileOutputStream_notificar.write(notificacion_val.getBytes());\n\n\n FileOutputStream fileOutputStream_sonidotipo = openFileOutput(file_tipo, MODE_PRIVATE);\n fileOutputStream_sonidotipo.write(tiposonidoval.getBytes());\n\n\n FileOutputStream fileOutputStream_ring_tone = openFileOutput(file_ringtone, MODE_PRIVATE);\n fileOutputStream_ring_tone.write(ringtone_val.getBytes());\n\n\n FileOutputStream fileOutputStream_nombre_ring_tone = openFileOutput(file_nombre_ringtone, MODE_PRIVATE);\n fileOutputStream_nombre_ring_tone.write(nombre_ringtone_val.getBytes());\n\n\n fileOutputStream_nombre_ring_tone.close();\n\n fileOutputStream_ring_tone.close();\n\n\n fileOutputStream_sonidotipo.close();\n\n fileOutputStream_notificar.close();\n\n fileOutputStream_vibrar.close();\n\n fileOutputStream_sonido.close();\n\n // fileOutputStream.close();\n // Toast.makeText(getApplicationContext(), \"Configurado\", Toast.LENGTH_LONG).show();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@PostMapping(value = \"/updateClientConf\")\n\tpublic @ResponseBody ResultVO updateClientConf(HttpServletRequest req, HttpServletResponse res, ModelMap model) {\n\n\t\tString objId = req.getParameter(\"objId\");\n\t\tString confName = req.getParameter(\"objName\");\n\t\tString confComment = req.getParameter(\"objComment\");\n\n\t\t// String pollingTime =\n\t\tString homeReset = req.getParameter(GPMSConstants.CTRL_ITEM_USEHOMERESET);\n\t\tString rootAllow = req.getParameter(GPMSConstants.CTRL_ITEM_ROOTALLOW);\n\t\tString sudoAllow = req.getParameter(GPMSConstants.CTRL_ITEM_SUDOALLOW);\n\t\tString whiteIpAll = req.getParameter(GPMSConstants.CTRL_ITEM_WHITEIPALL);\n\t\tString[] whiteIps = req.getParameterValues(GPMSConstants.CTRL_ITEM_WHITEIPS + \"[]\");\n\t\tString policykitUser = req.getParameter(\"policykit_user\");\n\n\t\tString cleanModeAllow = req.getParameter(GPMSConstants.CTRL_ITEM_CLEANMODEALLOW);\n\t\t\n\t\tString isDeleteLog = req.getParameter(\"isDeleteLog\");\n\t\tString logMaxSize = req.getParameter(\"logMaxSize\");\n\t\tString logMaxCount = req.getParameter(\"logMaxCount\");\n\t\tString logRemainDate = req.getParameter(\"logRemainDate\");\n\t\tString systemKeepFree = req.getParameter(\"systemKeepFree\");\n\n\t\tString transmit_boot = req.getParameter(\"transmit_boot\");\n\t\tString transmit_exe = req.getParameter(\"transmit_exe\");\n\t\tString transmit_os = req.getParameter(\"transmit_os\");\n\t\tString transmit_media = req.getParameter(\"transmit_media\");\n\t\tString transmit_agent = req.getParameter(\"transmit_agent\");\n\n\t\tString notify_boot = req.getParameter(\"notify_boot\");\n\t\tString notify_exe = req.getParameter(\"notify_exe\");\n\t\tString notify_os = req.getParameter(\"notify_os\");\n\t\tString notify_media = req.getParameter(\"notify_media\");\n\t\tString notify_agent = req.getParameter(\"notify_agent\");\n\n\t\tString show_boot = req.getParameter(\"show_boot\");\n\t\tString show_exe = req.getParameter(\"show_exe\");\n\t\tString show_os = req.getParameter(\"show_os\");\n\t\tString show_media = req.getParameter(\"show_media\");\n\t\tString show_agent = req.getParameter(\"show_agent\");\n\n\t\tResultVO resultVO = new ResultVO();\n\n\t\ttry {\n\t\t\tString modUserId = LoginInfoHelper.getUserId();\n\t\t\t// select current configuration\n\t\t\tResultVO currentConfObj = ctrlMstService.readCtrlItem(objId);\n\n\t\t\tCtrlItemVO itemVo = new CtrlItemVO();\n\t\t\titemVo.setObjId(objId);\n\t\t\titemVo.setObjNm(confName);\n\t\t\titemVo.setMngObjTp(GPMSConstants.CTRL_CLIENT_SETUP_CONF);\n\t\t\titemVo.setMngObjTpAbbr(GPMSConstants.CTRL_CLIENT_SETUP_CONF_ABBR);\n\t\t\titemVo.setComment(confComment);\n\t\t\titemVo.setModUserId(modUserId);\n\n\t\t\tArrayList<CtrlPropVO> propList = new ArrayList<CtrlPropVO>();\n\t\t\tint propSeq = 1;\n\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), GPMSConstants.CTRL_ITEM_USEHOMERESET, homeReset,\n\t\t\t\t\t\"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), GPMSConstants.CTRL_ITEM_ROOTALLOW, rootAllow,\n\t\t\t\t\t\"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), GPMSConstants.CTRL_ITEM_SUDOALLOW, sudoAllow,\n\t\t\t\t\t\"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), GPMSConstants.CTRL_ITEM_CLEANMODEALLOW, cleanModeAllow,\n\t\t\t\t\t\"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), GPMSConstants.CTRL_ITEM_WHITEIPALL, whiteIpAll,\n\t\t\t\t\t\"\", modUserId));\n\n\t\t\tif (whiteIps != null && whiteIps.length > 0) {\n\t\t\t\tfor (String whiteIp : whiteIps) {\n\t\t\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), GPMSConstants.CTRL_ITEM_WHITEIPS,\n\t\t\t\t\t\t\twhiteIp, \"\", modUserId));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"policykitUser\", policykitUser, \"\", modUserId));\n\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"isDeleteLog\", isDeleteLog, \"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"logMaxSize\", logMaxSize, \"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"logMaxCount\", logMaxCount, \"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"logRemainDate\", logRemainDate, \"\", modUserId));\n\t\t\tpropList.add(\n\t\t\t\t\tnew CtrlPropVO(\"\", String.valueOf(propSeq++), \"systemKeepFree\", systemKeepFree, \"\", modUserId));\n\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"transmit_boot\", transmit_boot, \"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"transmit_exe\", transmit_exe, \"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"transmit_os\", transmit_os, \"\", modUserId));\n\t\t\tpropList.add(\n\t\t\t\t\tnew CtrlPropVO(\"\", String.valueOf(propSeq++), \"transmit_media\", transmit_media, \"\", modUserId));\n\t\t\tpropList.add(\n\t\t\t\t\tnew CtrlPropVO(\"\", String.valueOf(propSeq++), \"transmit_agent\", transmit_agent, \"\", modUserId));\n\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"notify_boot\", notify_boot, \"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"notify_exe\", notify_exe, \"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"notify_os\", notify_os, \"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"notify_media\", notify_media, \"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"notify_agent\", notify_agent, \"\", modUserId));\n\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"show_boot\", show_boot, \"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"show_exe\", show_exe, \"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"show_os\", show_os, \"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"show_media\", show_media, \"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"show_agent\", show_agent, \"\", modUserId));\n\n\t\t\tCtrlPropVO[] props = new CtrlPropVO[propList.size()];\n\t\t\tprops = propList.toArray(props);\n\n\t\t\tStatusVO status = ctrlMstService.updateCtrlItem(itemVo, props);\n\t\t\tresultVO.setStatus(status);\n\n\t\t\t// [JOBCREATE]\n\t\t\tif (GPMSConstants.MSG_SUCCESS.equals(status.getResult())) {\n\n\t\t\t\t// use home reset job\n\t\t\t\tif (homeReset != null && !(homeReset.equals(getPropertyValue((CtrlItemVO) currentConfObj.getData()[0],\n\t\t\t\t\t\tGPMSConstants.CTRL_ITEM_USEHOMERESET)))) {\n\t\t\t\t\tHashMap<String, String> map = new HashMap<String, String>();\n\t\t\t\t\tif (\"true\".equalsIgnoreCase(homeReset)) {\n\t\t\t\t\t\tmap.put(\"operation\", \"enable\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmap.put(\"operation\", \"disable\");\n\t\t\t\t\t}\n\t\t\t\t\tjobMaker.createJobForClientConf(objId, GPMSConstants.TYPE_CLIENTCONF,\n\t\t\t\t\t\t\tGPMSConstants.JOB_CLIENTCONF_HOMERESET_CHANGE, map);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// root / sudo allow job\n\t\t\t\tHashMap<String, String> mapAccountAllow = new HashMap<String, String>();\n\t\t\t\tif (\"true\".equalsIgnoreCase(rootAllow)) {\n\t\t\t\t\tmapAccountAllow.put(\"root_use\", \"allow\");\n\t\t\t\t} else {\n\t\t\t\t\tmapAccountAllow.put(\"root_use\", \"disallow\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (\"true\".equalsIgnoreCase(sudoAllow)) {\n\t\t\t\t\tmapAccountAllow.put(\"sudo_use\", \"allow\");\n\t\t\t\t} else {\n\t\t\t\t\tmapAccountAllow.put(\"sudo_use\", \"disallow\");\n\t\t\t\t}\n\t\t\t\tjobMaker.createJobForClientConf(objId, GPMSConstants.TYPE_CLIENTCONF,\n\t\t\t\t\t\tGPMSConstants.JOB_ACCOUNT_RULE_CHANGE, mapAccountAllow);\n\t\t\t\t\n\t\t\t\t// policykit user job\n\t\t\t\tif (policykitUser != null && !(policykitUser.equals(getPropertyValue((CtrlItemVO) currentConfObj.getData()[0], \"policykitUser\")))) {\n\t\t\t\t\tHashMap<String, String> map = new HashMap<String, String>();\n\t\t\t\t\tmap.put(\"polkit_admin\", policykitUser);\n\t\t\t\t\tjobMaker.createJobForClientConf(objId, GPMSConstants.TYPE_CLIENTCONF,\n\t\t\t\t\t\t\tGPMSConstants.JOB_CLIENTCONF_POLICYKITUSER_CHANGE, map);\n\t\t\t\t}\n\n\t\t\t\t// clean mode allow job\n\t\t\t\tHashMap<String, String> mapCleanModeAllow = new HashMap<>();\n\t\t\t\tif(\"true\".equalsIgnoreCase(cleanModeAllow)) {\n\t\t\t\t\tmapCleanModeAllow.put(\"cleanmode_use\", \"enable\");\n\t\t\t\t} else {\n\t\t\t\t\tmapCleanModeAllow.put(\"cleanmode_use\", \"disable\");\n\t\t\t\t}\n\t\t\t\tjobMaker.createJobForClientConf(objId, GPMSConstants.TYPE_CLIENTCONF,\n\t\t\t\t\t\tGPMSConstants.JOB_CLEANMODE_RULE_CHANGE, mapCleanModeAllow);\n\n\t\t\t\t// use log config change job\n\t\t\t\tjobMaker.createJobForClientConf(objId, GPMSConstants.TYPE_CLIENTCONF,\n\t\t\t\t\t\tGPMSConstants.JOB_CLIENTCONF_LOGCONFIG_CHANGE, null);\n\n\t\t\t}\n\n\t\t} catch (Exception ex) {\n\t\t\tlogger.error(\"error in updateClientConf : {}, {}, {}\", GPMSConstants.CODE_SYSERROR,\n\t\t\t\t\tMessageSourceHelper.getMessage(GPMSConstants.MSG_SYSERROR), ex.toString());\n\t\t\tif (resultVO != null) {\n\t\t\t\tresultVO.setStatus(new StatusVO(GPMSConstants.MSG_FAIL, GPMSConstants.CODE_SYSERROR,\n\t\t\t\t\t\tMessageSourceHelper.getMessage(GPMSConstants.MSG_SYSERROR)));\n\t\t\t}\n\t\t}\n\n\t\treturn resultVO;\n\t}", "public String preuzmiPassword() {\n return konfiguracija.dajPostavku(\"OpenSkyNetwork.lozinka\");\n }", "public static void main(String[] args) throws IOException {\n\t\tProperties prop = new Properties();\r\n\t\t\t \r\n\t\tFileInputStream ip = new FileInputStream(\"C:\\\\Users\\\\PC User1\\\\git\\\\VedantAutomation\\\\\"\r\n\t\t\t\t+ \"VedantAutomation\\\\config.properties\");\r\n\t\t\r\n\t\tprop.load(ip);\r\n\t\t\r\n\t\tSystem.out.print(prop.get(\"browser\"));\r\n\t\t\r\n\r\n\t}", "public static void main(String[] args) throws NacosException, InterruptedException, IOException {\n String dataId = \"StreamingServiceOrderMainV2.yml\";\n// downLoadFromConfigCenter(dataId);\n// String group = \"DEFAULT_GROUP\";\n// String namespace = \"847b80b1-0e6f-4409-ac09-442efd3b969b\";\n// Properties properties = new Properties();\n// properties.put(PropertyKeyConst.NAMESPACE, namespace);\n// properties.put(PropertyKeyConst.SERVER_ADDR, serverAddr);\n// ConfigService configService = NacosFactory.createConfigService(properties);\n// String content = configService.getConfig(dataId, group, 5000);\n// System.out.println(content);\n// configService.addListener(dataId, group, new Listener() {\n// @Override\n// public void receiveConfigInfo(String configInfo) {\n// System.out.println(\"recieve:\" + configInfo);\n// }\n//\n// @Override\n// public Executor getExecutor() {\n// return null;\n// }\n// });\n//\n// boolean isPublishOk = configService.publishConfig(dataId, group, \"content\");\n// System.out.println(isPublishOk);\n//\n// Thread.sleep(3000);\n// content = configService.getConfig(dataId, group, 5000);\n// System.out.println(content);\n//\n// boolean isRemoveOk = configService.removeConfig(dataId, group);\n// System.out.println(isRemoveOk);\n// Thread.sleep(3000);\n//\n// content = configService.getConfig(dataId, group, 5000);\n// System.out.println(content);\n// Thread.sleep(300000);\n }", "public boolean configure(StaplerRequest req, JSONObject o) throws FormException {\n \trhapsodyClPath = o.getString(\"rhapsodyClPath\");\n \tlicenseServerPath = o.getString(\"licenseServerPath\");\n save();\n return super.configure(req, o);\n }", "public void loadConfig() {\n\t}", "@Override\r\n\tpublic void init() throws ServletException {\n\t\tBufferedReader in = new BufferedReader(\r\n new InputStreamReader(getClass().getResourceAsStream(\"/config.ini\")));\r\n String inputLine;\r\n String response = \"\";\r\n try {\r\n while((inputLine=in.readLine())!=null){\r\n response += inputLine;\r\n }\r\n } catch (IOException ex) {\r\n Logger.getLogger(ParameterServlet.class.getName()).log(Level.SEVERE, null, ex);\r\n }finally{\r\n \ttry {\r\n\t\t\t\tin.close();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n }\r\n model = new ParameterModel();\r\n model.setAddress(response.split(\" \")[0]);\r\n model.setPort( Integer.parseInt(response.split(\" \")[1]));\r\n model.setAddressIp(response.split(\" \")[2]);\r\n\t}", "public static void main(String[] args) {\n /* obtenção da localização do serviço de registo RMI */\n \n // nome do sistema onde está localizado o serviço de registos RMI\n String rmiRegHostName;\n \n // port de escuta do serviço\n int rmiRegPortNumb; \n\n RegistryConfig rc = new RegistryConfig(\"config.ini\");\n rmiRegHostName = rc.registryHost();\n rmiRegPortNumb = rc.registryPort();\n \n /* instanciação e instalação do gestor de segurança */\n if (System.getSecurityManager() == null) {\n System.setSecurityManager(new SecurityManager());\n }\n \n /* instanciação do objecto remoto que representa o referee site e geração de um stub para ele */\n RefereeSite referee_site = null;\n RefereeSiteInterface refereeSiteInterface = null;\n referee_site = new RefereeSite();\n \n try {\n refereeSiteInterface = (RefereeSiteInterface) UnicastRemoteObject.exportObject(referee_site, rc.refereeSitePort());\n } catch (RemoteException e) {\n System.out.println(\"Excepção na geração do stub para o referee site: \" + e.getMessage());\n System.exit(1);\n }\n \n System.out.println(\"O stub para o referee site foi gerado!\");\n\n /* seu registo no serviço de registo RMI */\n String nameEntryBase = RegistryConfig.registerHandler;\n String nameEntryObject = RegistryConfig.refereeSiteNameEntry;\n Registry registry = null;\n RegisterInterface reg = null;\n\n try {\n registry = LocateRegistry.getRegistry(rmiRegHostName, rmiRegPortNumb);\n } catch (RemoteException e) {\n System.out.println(\"Excepção na criação do registo RMI: \" + e.getMessage());\n System.exit(1);\n }\n \n System.out.println(\"O registo RMI foi criado!\");\n\n try {\n reg = (RegisterInterface) registry.lookup(nameEntryBase);\n } catch (RemoteException e) {\n System.out.println(\"RegisterRemoteObject lookup exception: \" + e.getMessage());\n System.exit(1);\n } catch (NotBoundException e) {\n System.out.println(\"RegisterRemoteObject not bound exception: \" + e.getMessage());\n System.exit(1);\n }\n\n try {\n reg.bind(nameEntryObject, refereeSiteInterface);\n } catch (RemoteException e) {\n System.out.println(\"Excepção no registo do referee site: \" + e.getMessage());\n System.exit(1);\n } catch (AlreadyBoundException e) {\n System.out.println(\"O referee site já está registado: \" + e.getMessage());\n System.exit(1);\n }\n \n System.out.println(\"O referee site foi registado!\");\n }", "public static void main(String[] args) throws ClassNotFoundException, IOException {\n InputStream n = Class.forName(\"com.ezzra.Main\").getClassLoader().getResourceAsStream(\"config.properties\");\n// System.out.println(path);\n InputStream rin = Main.class.getClassLoader().getResourceAsStream(\"config.properties\");\n// InputStream in = new FileInputStream(path);\n Reader reader = new InputStreamReader(n,\"GBK\");\n Properties prop = new Properties();\n prop.load(reader);\n System.out.println(prop);\n }", "public Connection getConexion() throws IOException {\n Connection cn = null;\n // Properties prop = new Properties();\n //prop.load(Propiedades.class.getResourceAsStream(\"configuracion.properties\"));\n\n String TextObt = \"\" , sUsuario = \"\" , sPass = \"\" , sStringConect = \"\" , sDB = \"\" , sServer=\"\" ; \n Properties propiedades = new Properties();\n InputStream entrada = null;\n Path currentRelativePath = Paths.get(\"\");\n String pathF = currentRelativePath.toAbsolutePath().toString();\n \n try {\n entrada = new FileInputStream(pathF+ File.separator +\"webapps\"+File.separator+\"LysWsRest\"+ File.separator+\"propiedades\"+File.separator+\"configuracion.properties\");\n propiedades.load(entrada);\n sDB= propiedades.getProperty(\"database\");\n sServer = propiedades.getProperty(\"server\");\n sUsuario = propiedades.getProperty(\"usuario\");\n sPass = propiedades.getProperty(\"password\");\n \n url =\"jdbc:sqlserver://\"+sServer+\";databaseName=\"+sDB; // cambiar\n // url=\"jdbc:sqlserver://ibserver_29;databaseName=pprodmant\";\n \n } catch (FileNotFoundException ex) {\n Logger.getLogger(SOAPLYS.class.getName()).log(Level.SEVERE, null, ex);\n TextObt = ex.getMessage();\n } catch (IOException ex) {\n Logger.getLogger(SOAPLYS.class.getName()).log(Level.SEVERE, null, ex);\n TextObt = ex.getMessage();\n }\n \n\n try {\n Class.forName(driver).newInstance();\n cn = DriverManager.getConnection(url,sUsuario,sPass); // cambiar\n //cn = DriverManager.getConnection(url,\"desarrollador2\",\"@desit39\");\n //System.out.println(\"test\");\n } catch (SQLException e) {\n System.out.println(e.toString());\n cn = null;\n } catch (Exception e) {\n System.out.println(e.toString());\n cn = null;\n }\n\n return cn;\n }", "public void loadConfiguration() {\n Properties prop = new Properties();\n String propFileName = \".env_\" + this.dbmode.name().toLowerCase();\n InputStream inputStream = getClass().getClassLoader().getResourceAsStream(propFileName);\n try {\n if (inputStream != null) {\n prop.load(inputStream);\n } else {\n System.err.println(\"property file '\" + propFileName + \"' not found in the classpath\");\n }\n this.jdbc = prop.getProperty(\"jdbc\");\n this.host = prop.getProperty(\"host\");\n this.port = prop.getProperty(\"port\");\n this.database = prop.getProperty(\"database\");\n this.user = prop.getProperty(\"user\");\n this.password = prop.getProperty(\"password\");\n // this.sslFooter = prop.getProperty(\"sslFooter\");\n } catch (Exception e) {\n System.err.println(\"can't read property file\");\n }\n try {\n inputStream.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@SuppressWarnings({ \"rawtypes\" })\r\n protected static void transferConfigurationFrom(Map conf, Properties prop) {\r\n // transfer zookeeper information so that SignalMechanism can create Zookeeper frameworks\r\n if (null != conf.get(CONFIG_KEY_STORM_ZOOKEEPER_PORT)) {\r\n prop.put(PORT_ZOOKEEPER, conf.get(CONFIG_KEY_STORM_ZOOKEEPER_PORT).toString());\r\n }\r\n if (null != conf.get(CONFIG_KEY_STORM_NIMBUS_PORT)) {\r\n prop.put(PORT_THRIFT, conf.get(CONFIG_KEY_STORM_NIMBUS_PORT).toString());\r\n }\r\n if (null != conf.get(CONFIG_KEY_STORM_NIMBUS_HOST)) {\r\n prop.put(HOST_NIMBUS, conf.get(CONFIG_KEY_STORM_NIMBUS_HOST).toString());\r\n }\r\n if (null != conf.get(CONFIG_KEY_STORM_ZOOKEEPER_SERVERS)) {\r\n Object zks = conf.get(CONFIG_KEY_STORM_ZOOKEEPER_SERVERS);\r\n String tmp = zks.toString();\r\n if (zks instanceof Collection) {\r\n tmp = \"\";\r\n for (Object o : (Collection) zks) {\r\n if (tmp.length() > 0) {\r\n tmp += \",\";\r\n }\r\n tmp += o.toString();\r\n }\r\n }\r\n prop.put(HOST_ZOOKEEPER, tmp);\r\n }\r\n if (null != conf.get(RETRY_TIMES_ZOOKEEPER)) {\r\n prop.put(RETRY_TIMES_ZOOKEEPER, conf.get(RETRY_TIMES_ZOOKEEPER).toString());\r\n }\r\n if (null != conf.get(RETRY_INTERVAL_ZOOKEEPER)) {\r\n prop.put(RETRY_INTERVAL_ZOOKEEPER, conf.get(RETRY_INTERVAL_ZOOKEEPER).toString());\r\n }\r\n\r\n // if storm has a configuration value and the actual configuration is not already\r\n // changed, than change the event bus configuration\r\n if (null != conf.get(HOST_EVENT)) {\r\n prop.put(HOST_EVENT, conf.get(HOST_EVENT));\r\n }\r\n if (null != conf.get(Configuration.PORT_EVENT)) {\r\n prop.put(PORT_EVENT, conf.get(PORT_EVENT));\r\n }\r\n if (null != conf.get(EVENT_DISABLE_LOGGING)) {\r\n prop.put(EVENT_DISABLE_LOGGING, conf.get(EVENT_DISABLE_LOGGING));\r\n }\r\n if (null != conf.get(PIPELINE_INTERCONN_PORTS)) {\r\n prop.put(PIPELINE_INTERCONN_PORTS, conf.get(PIPELINE_INTERCONN_PORTS));\r\n }\r\n // TODO use transfer above\r\n transfer(conf, prop, MONITORING_VOLUME_ENABLED, false);\r\n transfer(conf, prop, WATCHER_WAITING_TIME, false);\r\n if (prop.size() > 0) {\r\n System.out.println(\"Reconfiguring infrastructure settings: \" + prop + \" from \" + conf);\r\n configure(prop, false);\r\n }\r\n }", "@Override\n public boolean configure(StaplerRequest req, JSONObject formData) throws FormException {\n\n iniLocation = formData.getString(\"iniLocation\");\n iniContents = formData.getString(\"iniContents\");\n commandG2Z = formData.getString(\"commandG2Z\");\n commandZ2G = formData.getString(\"commandZ2G\");\n\n String iniFullPath;\n\n if (System.getProperty(\"JENKINS_HOME\") != null) {\n iniFullPath = System.getProperty(\"JENKINS_HOME\") + \"/\" + iniLocation;\n } else {\n if (System.getProperty(\"user.home\") != null) {\n iniFullPath = System.getProperty(\"user.home\") + \"/\" + iniLocation;\n } else {\n iniFullPath = \"/var/lib/jenkins\" + \"/\" + iniLocation;\n }\n }\n\n File file = new File(iniFullPath);\n\n try {\n if (!file.exists()) {\n if (!(file.getParentFile().exists())) {\n if (!(file.getParentFile().mkdirs())) {\n throw new IOException(\"Unable to create directory \" + iniFullPath );\n }\n }\n if (!(file.createNewFile())) {\n throw new IOException(\"Unable to create file \" + iniFullPath );\n }\n }\n } catch (IOException e) {\n System.out.println(\"File could not be created or opened: \" + iniFullPath);\n e.printStackTrace();\n }\n\n if (file.exists()) {\n try (Writer fstream = new OutputStreamWriter(new FileOutputStream(iniFullPath), \"UTF8\");) {\n fstream.write(iniContents);\n fstream.flush();\n fstream.close();\n System.out.println(\"File written Succesfully: \" + iniFullPath);\n } catch (IOException e) {\n System.out.println(\"File write NOT Succesfully: \" + iniFullPath);\n e.printStackTrace();\n }\n }\n save();\n return super.configure(req,formData);\n }", "public static HashMap configurerJoueur() {\r\n HashMap config = new HashMap();\r\n \r\n // Titre de la page du jeu\r\n //\r\n config.put(\"titre\", \"Joueur_IM\");\r\n \r\n // Identifiant du joueur\r\n //\r\n config.put(\"Prefixe\", \"Joueur_1\");\r\n \r\n // Donnees de connexion\r\n //\r\n config.put(\"Host\", \"localHost\");\r\n \r\n // Donnees de panneauG\r\n //\r\n config.put(\"arrierePlan\", Color.black);\r\n config.put(\"avantPlan\", Color.gray);\r\n config.put(\"police\", new Font(\"Times Roman\", Font.BOLD, 16));\r\n config.put(\"grille\", new Dimension(10, 10));\r\n \r\n return config;\r\n }", "public static void exportarConf(DadosConfiguracao dados) {\n numeroNeuroniosPrimeiraCamada = dados.getNumCamadas();\n numEpocasMaxima = dados.getNumEpocas();\n erroAceitavel = dados.getErroAceito();\n taxaAprendizado = dados.getTaxaAprendizado();\n\n System.out.println(\"Numero de Camadas: \" + numeroNeuroniosPrimeiraCamada);\n System.out.println(\"Numero de Epocas: \" + numEpocasMaxima);\n System.out.println(\"Erro Aceitavel: \" + erroAceitavel);\n System.out.println(\"Taxa Aprendizado: \" + taxaAprendizado);\n }", "public void partidaCargada(InputStream origenConfiguracion) {\r\n Partida partida = this.crearPartida(origenConfiguracion); \r\n this.setPartida(partida);\r\n }", "public void loadConfig(){\r\n File config = new File(\"config.ini\");\r\n if(config.exists()){\r\n try {\r\n Scanner confRead = new Scanner(config);\r\n \r\n while(confRead.hasNextLine()){\r\n String line = confRead.nextLine();\r\n if(line.indexOf('=')>0){\r\n String setting,value;\r\n setting = line.substring(0,line.indexOf('='));\r\n value = line.substring(line.indexOf('=')+1,line.length());\r\n \r\n //Perform the actual parameter check here\r\n if(setting.equals(\"romfile\")){\r\n boolean result;\r\n result = hc11_Helpers.loadBinary(new File(value.substring(value.indexOf(',')+1,value.length())),board,\r\n Integer.parseInt(value.substring(0,value.indexOf(',')),16));\r\n if(result)\r\n System.out.println(\"Loaded a rom file.\");\r\n else\r\n System.out.println(\"Error loading rom file.\");\r\n }\r\n }\r\n }\r\n confRead.close();\r\n } catch (FileNotFoundException ex) {\r\n ex.printStackTrace();\r\n }\r\n }\r\n }", "protected static void dumpConfig() {\n try {\n logger.info( Configuration.CN_WKBOTANICA_API_CONTEXT_PATH + getContextPath());\n logger.info( Configuration.CN_DNS + \" \" + Configuration.CN_DNS_ADD_LOCALS + shouldAddLocalDns());\n logger.info( Configuration.CN_HTTP + \" \" + Configuration.CN_HTTP_PORT + getHttpPort());\n logger.info( Configuration.CN_FLICKR_API_KEY + \" \" + getFlickrApiKey());\n logger.info( Configuration.CN_FLICKR_USER_ID + \" \" + getFlickrUserId());\n logger.info( Configuration.CN_FLICKR_PHOTOSET_ID + \" \" + getFickrPhotosetId());\n }\n catch (Exception e) {\n logger.info(\"GRAVE:\" + e.getMessage());\n }\n }", "String readConfig(String parameter, SignedObject accessToken) throws RemoteException, rmi.AuthenticationException;", "private LODEParameters(){\n prefsFile=new File(LODEConstants.PARAMS_FILE);\n }", "protected abstract String getXmppConfigResources();", "public static void main(String[] args)throws Throwable {\n FileLib flib = new FileLib();\n flib.readPropertyData(\"./data/config.properties\", \"browser\");\n // System.out.println(value); \n\t}", "@PostMapping(value = \"/createClientConf\")\n\tpublic @ResponseBody ResultVO createClientConf(HttpServletRequest req, HttpServletResponse res, ModelMap model) {\n\n\t\tString objName = req.getParameter(\"objName\");\n\t\tString objComment = req.getParameter(\"objComment\");\n\t\tString adminType = req.getParameter(\"adminType\");\n\n\t\t// String pollingTime =\n\t\t// req.getParameter(GPMSConstants.CTRL_ITEM_AGENTPOLLINGTIME);\n\t\tString homeReset = req.getParameter(GPMSConstants.CTRL_ITEM_USEHOMERESET);\n\t\tString rootAllow = req.getParameter(GPMSConstants.CTRL_ITEM_ROOTALLOW);\n\t\tString sudoAllow = req.getParameter(GPMSConstants.CTRL_ITEM_SUDOALLOW);\n\t\tString whiteIpAll = req.getParameter(GPMSConstants.CTRL_ITEM_WHITEIPALL);\n\t\tString[] whiteIps = req.getParameterValues(GPMSConstants.CTRL_ITEM_WHITEIPS + \"[]\");\n\t\tString policykitUser = req.getParameter(\"policykit_user\");\n\n\t\tString cleanModeAllow = req.getParameter(GPMSConstants.CTRL_ITEM_CLEANMODEALLOW);\n\n\t\tString isDeleteLog = req.getParameter(\"isDeleteLog\");\n\t\tString logMaxSize = req.getParameter(\"logMaxSize\");\n\t\tString logMaxCount = req.getParameter(\"logMaxCount\");\n\t\tString logRemainDate = req.getParameter(\"logRemainDate\");\n\t\tString systemKeepFree = req.getParameter(\"systemKeepFree\");\n\n\t\tString transmit_boot = req.getParameter(\"transmit_boot\");\n\t\tString transmit_exe = req.getParameter(\"transmit_exe\");\n\t\tString transmit_os = req.getParameter(\"transmit_os\");\n\t\tString transmit_media = req.getParameter(\"transmit_media\");\n\t\tString transmit_agent = req.getParameter(\"transmit_agent\");\n\n\t\tString notify_boot = req.getParameter(\"notify_boot\");\n\t\tString notify_exe = req.getParameter(\"notify_exe\");\n\t\tString notify_os = req.getParameter(\"notify_os\");\n\t\tString notify_media = req.getParameter(\"notify_media\");\n\t\tString notify_agent = req.getParameter(\"notify_agent\");\n\n\t\tString show_boot = req.getParameter(\"show_boot\");\n\t\tString show_exe = req.getParameter(\"show_exe\");\n\t\tString show_os = req.getParameter(\"show_os\");\n\t\tString show_media = req.getParameter(\"show_media\");\n\t\tString show_agent = req.getParameter(\"show_agent\");\n\n\t\tResultVO resultVO = new ResultVO();\n\n\t\ttry {\n\t\t\tString modUserId = LoginInfoHelper.getUserId();\n\n\t\t\tCtrlItemVO itemVo = new CtrlItemVO();\n\t\t\titemVo.setObjNm(objName);\n\t\t\titemVo.setComment(objComment);\n\t\t\titemVo.setModUserId(modUserId);\n\t\t\titemVo.setMngObjTp(GPMSConstants.CTRL_CLIENT_SETUP_CONF);\n\t\t\titemVo.setMngObjTpAbbr(GPMSConstants.CTRL_CLIENT_SETUP_CONF_ABBR);\n\t\t\tif (\"S\".equalsIgnoreCase(adminType)) {\n\t\t\t\titemVo.setStandardObj(true);\n\t\t\t}\n\n\t\t\tArrayList<CtrlPropVO> propList = new ArrayList<CtrlPropVO>();\n\t\t\tint propSeq = 1;\n\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), GPMSConstants.CTRL_ITEM_USEHOMERESET, homeReset,\n\t\t\t\t\t\"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), GPMSConstants.CTRL_ITEM_ROOTALLOW, rootAllow,\n\t\t\t\t\t\"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), GPMSConstants.CTRL_ITEM_SUDOALLOW, sudoAllow,\n\t\t\t\t\t\"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), GPMSConstants.CTRL_ITEM_CLEANMODEALLOW, cleanModeAllow,\n\t\t\t\t\t\"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), GPMSConstants.CTRL_ITEM_WHITEIPALL, whiteIpAll,\n\t\t\t\t\t\"\", modUserId));\n\n\t\t\tif (whiteIps != null && whiteIps.length > 0) {\n\t\t\t\tfor (String whiteIp : whiteIps) {\n\t\t\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), GPMSConstants.CTRL_ITEM_WHITEIPS,\n\t\t\t\t\t\t\twhiteIp, \"\", modUserId));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"policykitUser\", policykitUser, \"\", modUserId));\n\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"isDeleteLog\", isDeleteLog, \"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"logMaxSize\", logMaxSize, \"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"logMaxCount\", logMaxCount, \"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"logRemainDate\", logRemainDate, \"\", modUserId));\n\t\t\tpropList.add(\n\t\t\t\t\tnew CtrlPropVO(\"\", String.valueOf(propSeq++), \"systemKeepFree\", systemKeepFree, \"\", modUserId));\n\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"transmit_boot\", transmit_boot, \"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"transmit_exe\", transmit_exe, \"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"transmit_os\", transmit_os, \"\", modUserId));\n\t\t\tpropList.add(\n\t\t\t\t\tnew CtrlPropVO(\"\", String.valueOf(propSeq++), \"transmit_media\", transmit_media, \"\", modUserId));\n\t\t\tpropList.add(\n\t\t\t\t\tnew CtrlPropVO(\"\", String.valueOf(propSeq++), \"transmit_agent\", transmit_agent, \"\", modUserId));\n\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"notify_boot\", notify_boot, \"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"notify_exe\", notify_exe, \"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"notify_os\", notify_os, \"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"notify_media\", notify_media, \"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"notify_agent\", notify_agent, \"\", modUserId));\n\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"show_boot\", show_boot, \"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"show_exe\", show_exe, \"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"show_os\", show_os, \"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"show_media\", show_media, \"\", modUserId));\n\t\t\tpropList.add(new CtrlPropVO(\"\", String.valueOf(propSeq++), \"show_agent\", show_agent, \"\", modUserId));\n\n\t\t\tCtrlPropVO[] props = new CtrlPropVO[propList.size()];\n\t\t\tprops = propList.toArray(props);\n\n\t\t\tStatusVO status = ctrlMstService.createCtrlItem(itemVo, props);\n\t\t\tresultVO.setStatus(status);\n\n\t\t} catch (Exception ex) {\n\t\t\tlogger.error(\"error in createClientConf : {}, {}, {}\", GPMSConstants.CODE_SYSERROR,\n\t\t\t\t\tMessageSourceHelper.getMessage(GPMSConstants.MSG_SYSERROR), ex.toString());\n\t\t\tif (resultVO != null) {\n\t\t\t\tresultVO.setStatus(new StatusVO(GPMSConstants.MSG_FAIL, GPMSConstants.CODE_SYSERROR,\n\t\t\t\t\t\tMessageSourceHelper.getMessage(GPMSConstants.MSG_SYSERROR)));\n\t\t\t}\n\t\t}\n\n\t\treturn resultVO;\n\t}", "private static void connect(String connectFile,boolean withUpr,boolean WithSes,boolean withTsk) {\n\t\tScanner sc = null;\n\t\ttry {\n\t\t\tsc = new Scanner(new File(connectFile));\n\t\t\twhile (sc.hasNext()) {\n\t\t\t\tString line = sc.nextLine().trim();\n\t\t\t\tif (line.length() > 0)\n\t\t\t\t\tif (!line.startsWith(\"#\"))\n\t\t\t\t\t\tif (line.contains(\"=\"))\n\t\t\t\t\t\t\tconfig_params.put(line.split(\"=\")[0].trim()\n\t\t\t\t\t\t\t\t\t.toUpperCase(),\n\t\t\t\t\t\t\t\t\tline.substring(line.indexOf(\"=\") + 1)\n\t\t\t\t\t\t\t\t\t\t\t.trim());\n\t\t\t}\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tsc.close();\n\t\t}\n\n\t\tif (!config_params.containsKey(\"NODE\")\n\t\t\t\t|| !config_params.containsKey(\"PORT\")\n\t\t\t\t|| !config_params.containsKey(\"AREA\")\n\t\t\t\t|| !config_params.containsKey(\"HOST\")\n\t\t\t\t|| !config_params.containsKey(\"USER\")\n\t\t\t\t|| !config_params.containsKey(\"PASSWORD\")) {\n\t\t\tSystem.out.println(\"Error ! Missing fields in UVMS Config :\\\"\"\n\t\t\t\t\t+ connectFile + \"\\\"\");\n\t\t\tSystem.exit(-1);\n\t\t}\n\n\t\tSystem.out.println(\"Connecting to UVMS : \\\"\"+config_params.get(\"HOST\")+\"\\\"\");\n\t\t\n\t\tString nodes[] = config_params.get(\"NODE\").split(\",\");\n\n\t\tfor (int i = 0; i < nodes.length; i++) {\n\n\t\t\tDuApiConnection conn = new DuApiConnection(nodes[i],\n\t\t\t\t\tconfig_params.get(\"AREA\"), config_params.get(\"HOST\"),\n\t\t\t\t\tInteger.parseInt(config_params.get(\"PORT\")),\n\t\t\t\t\tconfig_params.get(\"USER\"), config_params.get(\"PASSWORD\"),withUpr,WithSes,withTsk);\n\t\t\tif (!DUAPIConnections.containsKey(nodes[i] + \"/\"\n\t\t\t\t\t+ config_params.get(\"AREA\"))) {\n\t\t\t\tDUAPIConnections.put(\n\t\t\t\t\t\tnodes[i] + \"/\" + config_params.get(\"AREA\"), conn);\n\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\t}", "public void loadConfigurationFromDisk() {\r\n try {\r\n FileReader fr = new FileReader(CONFIG_FILE);\r\n BufferedReader rd = new BufferedReader(fr);\r\n\r\n String line;\r\n while ((line = rd.readLine()) != null) {\r\n if (line.startsWith(\"#\")) continue;\r\n if (line.equalsIgnoreCase(\"\")) continue;\r\n\r\n StringTokenizer str = new StringTokenizer(line, \"=\");\r\n if (str.countTokens() > 1) {\r\n String aux;\r\n switch (str.nextToken().trim()) {\r\n case \"system.voidchain.protocol_version\":\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.protocolVersion = aux;\r\n continue;\r\n case \"system.voidchain.transaction.max_size\":\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.transactionMaxSize = Integer.parseInt(aux);\r\n continue;\r\n case \"system.voidchain.block.num_transaction\":\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.numTransactionsInBlock = Integer.parseInt(aux);\r\n continue;\r\n case \"system.voidchain.storage.data_file_extension\":\r\n if (firstRun) {\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.dataFileExtension = aux;\r\n }\r\n continue;\r\n case \"system.voidchain.storage.block_file_base_name\":\r\n if (firstRun) {\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.blockFileBaseName = aux;\r\n }\r\n continue;\r\n case \"system.voidchain.storage.wallet_file_base_name\":\r\n if (firstRun) {\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.walletFileBaseName = aux;\r\n }\r\n continue;\r\n case \"system.voidchain.storage.data_directory\":\r\n if (firstRun) {\r\n aux = str.nextToken().trim();\r\n if (aux != null) {\r\n aux = aux.replace('/', File.separatorChar);\r\n if (!aux.endsWith(File.separator))\r\n //aux = aux.substring(0, aux.length() - 1);\r\n aux = aux.concat(File.separator);\r\n this.dataDirectory = aux;\r\n }\r\n }\r\n continue;\r\n case \"system.voidchain.storage.block_file_directory\":\r\n if (firstRun) {\r\n aux = str.nextToken().trim();\r\n if (aux != null) {\r\n aux = aux.replace('/', File.separatorChar);\r\n if (!aux.endsWith(File.separator))\r\n //aux = aux.substring(0, aux.length() - 1);\r\n aux = aux.concat(File.separator);\r\n this.blockFileDirectory = aux;\r\n }\r\n }\r\n continue;\r\n case \"system.voidchain.storage.wallet_file_directory\":\r\n if (firstRun) {\r\n aux = str.nextToken().trim();\r\n if (aux != null) {\r\n aux = aux.replace('/', File.separatorChar);\r\n if (!aux.endsWith(File.separator))\r\n //aux = aux.substring(0, aux.length() - 1);\r\n aux = aux.concat(File.separator);\r\n this.walletFileDirectory = aux;\r\n }\r\n }\r\n continue;\r\n case \"system.voidchain.memory.block_megabytes\":\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.memoryUsedForBlocks = Integer.parseInt(aux);\r\n continue;\r\n case \"system.voidchain.sync.block_sync_port\":\r\n if (firstRun) {\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.blockSyncPort = Integer.parseInt(aux);\r\n }\r\n continue;\r\n case \"system.voidchain.crypto.ec_param\":\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.ecParam = aux;\r\n continue;\r\n case \"system.voidchain.core.block_proposal_timer\":\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.blockProposalTimer = Integer.parseInt(aux) * 1000;\r\n continue;\r\n case \"system.voidchain.blockchain.chain_valid_timer\":\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.blockchainValidTimer = Integer.parseInt(aux) * 1000;\r\n continue;\r\n }\r\n }\r\n }\r\n\r\n fr.close();\r\n rd.close();\r\n\r\n if (this.firstRun)\r\n this.firstRun = false;\r\n } catch (IOException e) {\r\n logger.error(\"Could not load configuration\", e);\r\n }\r\n }", "public void loadConfiguration(){\n\t\t\n\t\tString jarLoc = this.getJarLocation();\n\t\tTicklerVars.jarPath = jarLoc;\n\t\tTicklerVars.configPath=TicklerVars.jarPath+TicklerConst.configFileName;\n\t\t\n\t\t//Read configs from conf file\n\t\tif (new File(TicklerVars.configPath).exists()){\n\t\t\ttry {\n\t\t\t\tString line;\n\t\t\t\tBufferedReader reader = new BufferedReader(new FileReader(TicklerVars.configPath));\n\t\t\t\twhile ((line =reader.readLine())!= null) {\n\t\t\t\t\tif (line.contains(\"Tickler_local_directory\")){\n\t\t\t\t\t\tString loc = line.substring(line.indexOf(\"=\")+1, line.length());\n\t\t\t\t\t\tTicklerVars.ticklerDir = this.correctJarLoc(loc);\n\t\t\t\t\t}\n\t\t\t\t\telse if (line.contains(\"Tickler_sdcard_directory\")){\n\t\t\t\t\t\tString loc = line.substring(line.indexOf(\"=\")+1, line.length()-1);\n\t\t\t\t\t\tTicklerVars.sdCardPath = this.correctJarLoc(loc);\n\t\t\t\t\t}\n\t\t\t\t\telse if (line.contains(\"Frida_server_path\")){\n\t\t\t\t\t\tString loc = line.substring(line.indexOf(\"=\")+1, line.length());\n\t\t\t\t\t\tTicklerVars.fridaServerLoc = loc;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\treader.close();\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t//Config path does not exist\n\t\t\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"WARNING...... Configuration file does not exist!!!!\\nThe following default configurations are set:\\n\");\n\t\t\tTicklerVars.ticklerDir = TicklerVars.jarPath+TicklerConst.defaultTicklerDirName;\n\t\t\tSystem.out.println(\"Tickler Workspace directory on host: \"+TicklerVars.ticklerDir);\n\t\t\tSystem.out.println(\"Tickler temporary directory on device: \"+TicklerConst.sdCardPathDefault);\n\t\t}\n\t\t\n\t\tString x = TicklerVars.ticklerDir;\n\t\tif (TicklerVars.ticklerDir == null || TicklerVars.ticklerDir.matches(\"\\\\s*/\") ){\n\t\t\tTicklerVars.ticklerDir = TicklerVars.jarPath+TicklerConst.defaultTicklerDirName;\n//\t\t\tOutBut.printWarning(\"Configuration File \"+TicklerVars.configPath+ \" doesn't specify Tickler_local_directory. Workspace is set at \"+ TicklerVars.ticklerDir);\n\t\t\tOutBut.printStep(\"Tickler Workspace directory on host: \"+TicklerVars.ticklerDir);\n\t\t}\n\t\t\n\t\tif (TicklerVars.sdCardPath == null || TicklerVars.sdCardPath.matches(\"\\\\s*/\")) {\n\t\t\tTicklerVars.sdCardPath = TicklerConst.sdCardPathDefault;\t\n//\t\t\tOutBut.printWarning(\"Configuration File \"+TicklerVars.configPath+ \" doesn't specify Tickler's temp directory on the device. It is set to \"+ TicklerVars.sdCardPath);\n\t\t\tOutBut.printStep(\"Tickler temporary directory on device: \"+TicklerConst.sdCardPathDefault);\n\t\t}\n\t\t\t\n\t}", "private void configuracoes() {\n setLocationRelativeTo(null);\n this.setIconImage(new ImageIcon(getClass().getResource(SystemMessage.IMAGE_URL)).getImage());\n this.setTitle(SystemMessage.SYSTEM_NAME + \" -\");\n }", "void chiudiConnessione() throws RemoteException,IOException;", "public static void cargarRecursos(String carpetaArchivosConf, AdministradorRecursosNvjItf recursosProyecto) \n \t\tthrows CargadorRecursosException, MapeoException, IOException{\n System.out.println(\"Comenzando la carga de NavajaFW\");\n //Listo los archivos de configuracion\n String[] listaDeArchivos = new File(carpetaArchivosConf).list();\n \n if (listaDeArchivos == null) {\n throw new CargadorRecursosCarpetaConfVaciaException(carpetaArchivosConf);\n }\n\n //Se listan los archivos de la carpeta indicada\n ArrayList<String> archivosConf = new ArrayList<String>(Arrays.asList(listaDeArchivos));\n\n //Se los itera\n for (String archivoNombre : archivosConf){\n //Si algun archivo termina con _or.xml es un mapeo\n if (archivoNombre.endsWith(NavajaConstantes.GUION_BAJO_OR_PUNTO_XML)) {\n //Muestro que el archivo se esta leyendo\n System.out.println(\"Mapeando \" + archivoNombre + \"...\");\n //Comienzo el mapeo\n Mapeador.mapearXml(carpetaArchivosConf + archivoNombre);\n System.out.println(\"Mapeado correctamente \"); \n }\n }\n \n if (Mapeador.getRaizMapeo() == null || Mapeador.getRaizMapeo().getTablas().isEmpty()) {\n throw new CargadorRecursosNoExistenArchivosMapeoException(); \t\n }\n \n //Se setea la instancia NavajaConector de la app el mapeo recien generado\n NavajaConector.getInstance().setMapeoRaiz(Mapeador.getRaizMapeo());\n \n //Se inicializa los recursos segun lo implementado en el metodo sobrescrito\n recursosProyecto.iniciarRecursos();\n \n //Se setea la instancia NavajaConector de la app el DataSource para conectarse\n DataSource dataSource = recursosProyecto.proveerDataSource();\n \n if(dataSource == null) {\n throw new org.calevin.navaja.excepciones.core.CargadorRecursosDataSourceNuloException();\n }\n\n Connection conexion = null;\n\t\ttry {\n\t\t\tconexion = dataSource.getConnection();\n\t\t\t\n\t\t\tif (conexion == null){\n\t\t\t\tthrow new CargadorRecursosConexionFallidaException(\n\t\t\t\t\t\tNavajaStringUtil.conmutarCaseChar(NavajaConstantes.CONEXION_NULA, 0)\n\t\t\t\t\t\t+ NavajaConstantes.PUNTO);\n\t\t\t} else if (!conexion.isValid(0)) {\n\t\t\t\tthrow new CargadorRecursosConexionFallidaException(\n\t\t\t\t\t\tNavajaStringUtil.conmutarCaseChar(NavajaConstantes.CONEXION_INVALIDA, 0)\n\t\t\t\t\t\t+ NavajaConstantes.COMA_ESPACIO\n\t\t\t\t\t\t+ NavajaConstantes.CONEXION\n\t\t\t\t\t\t+ NavajaConstantes.ESPACIO_COMILLA\n\t\t\t\t\t\t+ conexion\n\t\t\t\t\t\t+ NavajaConstantes.COMILLA\n\t\t\t\t\t\t+ NavajaConstantes.PUNTO);\t\t\t\t\n\t\t\t} else {\n\t\t NavajaConector.getInstance().setDataSource(dataSource);\t\t\t\t\n\t\t\t}\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\tthrow new CargadorRecursosConexionFallidaException(e);\n\t\t} finally {\n\t\t\tif (conexion != null) {\n\t\t\t\ttry {\n\t\t\t\t\tconexion.close(); \n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tthrow new CargadorRecursosConexionFallidaException(e);\n\t\t\t\t} \n\t\t\t}\n\t\t}\n }", "public void configurarPeriodoNoturno() {\n Dig_Config dig = new Dig_Config(this, true);\n dig.setVisible(true);\n }", "private void chargeConfiguration() {\n\t\tgetConfig().options().copyDefaults(true);\n\t\tFile config = new File(getDataFolder(), \"config.yml\");\n\t\tFile lang = new File(getDataFolder(), \"lang.properties\");\n\t\ttry {\n\t\t\tif (!config.exists()) {\n\t\t\t\tsaveDefaultConfig();\n\t\t\t}\n\t\t\tif (!lang.exists()) {\n\t\t\t\tsaveResource(\"lang.properties\", false);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tthis.error(\"Can not load the configuration\", e);\n\t\t}\n\t}", "void configure();", "@Override\r\n\tpublic void iniciarSesion() {\n\t\tthis.contextoOrdenMenosUno = new Contexto();\r\n\t\t//Obtengo el orden del xml de configuración\r\n\t\tthis.orden = Constantes.ORDER_MAX_PPMC;\r\n\t\t//Creo tantos Ordenes como dice el XML\r\n\t\tthis.listaOrdenes = new ArrayList<Orden>(this.orden+1);\r\n\t\tthis.inicializarListas();\r\n\t\tthis.compresorAritmetico = new LogicaAritmetica();\r\n\t\tthis.initSession = true;\r\n\t\tthis.tiraBits = \"\";\r\n\t\tthis.bitsBuffer = new StringBuffer();\r\n\t\tthis.finalizada = false;\r\n\t\tthis.contextoPrevio = false;\r\n\t\tthis.contextoActual = new String();\r\n\t}", "private void poczatkowe_zmienne()\n {\n konfiguracja.loadProperties();\n predkosc_wroga=Integer.parseInt(konfiguracja.properties.getProperty(\"predkosc_wroga\"));\n czas_watku=Integer.parseInt(konfiguracja.properties.getProperty(\"czas_watku\"));\n punkty_poziomu=Integer.parseInt(konfiguracja.properties.getProperty(\"punkty_poziomu\"));\n zmienne_poziomu(poziom);\n }", "private void controladorAdminConfig(Controlador controlador) {\n \tthis.contAdminUsuarios = controlador.getAdminUsuarios();\n \tadminConfig.setControlAdminUsuarios(contAdminUsuarios);\n \t\n \tthis.contAdminProyectos = controlador.getAdminProyectos();\n \tadminConfig.setControlAdminProyectos(contAdminProyectos);\n \t\n \tthis.contAdminConfigVotes = controlador.getAdminConfigVotes();\n \tadminConfig.setControlAdminConfigVotes(contAdminConfigVotes);\n \t\n \tthis.contAdminConfigCaducidad = controlador.getAdminConfigCaducidad();\n adminConfig.setControlAdminConfigCaducidad(contAdminConfigCaducidad);\n }", "private final static void getProp() {\n try(InputStream fis = ConnectionBDD.class.getClassLoader().getResourceAsStream(\"conf.properties\")){\n \n props.load(fis);\n \n Class.forName(props.getProperty(\"jdbc.driver.class\"));\n \n url = props.getProperty(\"jdbc.url\");\n login = props.getProperty(\"jdbc.login\");\n password = props.getProperty(\"jdbc.password\");\n \n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n } catch (FileNotFoundException e1) {\n e1.printStackTrace();\n } catch (IOException e1) {\n e1.printStackTrace();\n }\n }", "public void readEAPConfig(BufferedWriter out) {\n\t\tcreateLogFile();\n\t\t/* Get the WifiService */\n\t\tWifiManager wifi = (WifiManager) this.context\n\t\t\t\t.getSystemService(context.WIFI_SERVICE);\n\t\t/* Get All WIfi configurations */\n\t\tList<WifiConfiguration> configList = wifi.getConfiguredNetworks();\n\t\t/*\n\t\t * Now we need to search appropriate configuration i.e. with name\n\t\t * SSID_Name\n\t\t */\n\t\tfor (int i = 0; i < configList.size(); i++) {\n\t\t\tif (configList.get(i).SSID.contentEquals(\"\\\"SSID_NAME\\\"\")) {\n\t\t\t\t/* We found the appropriate config now read all config details */\n\t\t\t\tIterator<WifiConfiguration> iter = configList.iterator();\n\t\t\t\tWifiConfiguration config = configList.get(i);\n\n\t\t\t\t/*\n\t\t\t\t * I dont think these fields have anything to do with EAP config\n\t\t\t\t * but still will print these to be on safe side\n\t\t\t\t */\n\t\t\t\ttry {\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\", \"[SSID]\"\n\t\t\t\t\t\t\t+ config.SSID);\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\" + \"[SSID]\"\n\t\t\t\t\t\t\t+ config.SSID);\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\", \"[BSSID]\"\n\t\t\t\t\t\t\t+ config.BSSID);\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t+ \"[BSSID]\" + config.BSSID);\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\",\n\t\t\t\t\t\t\t\"[HIDDEN SSID]\" + config.hiddenSSID);\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t+ \"[HIDDEN SSID]\" + config.hiddenSSID);\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\", \"[PASSWORD]\"\n\t\t\t\t\t\t\t+ config.preSharedKey);\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t+ \"[PASSWORD]\" + config.preSharedKey);\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\",\n\t\t\t\t\t\t\t\"[ALLOWED ALGORITHMS]\");\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t+ \"[ALLOWED ALGORITHMS]\");\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\",\n\t\t\t\t\t\t\t\"[LEAP]\"\n\t\t\t\t\t\t\t\t\t+ config.allowedAuthAlgorithms\n\t\t\t\t\t\t\t\t\t\t\t.get(AuthAlgorithm.LEAP));\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t+ \"[LEAP]\"\n\t\t\t\t\t\t\t+ config.allowedAuthAlgorithms\n\t\t\t\t\t\t\t\t\t.get(AuthAlgorithm.LEAP));\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\",\n\t\t\t\t\t\t\t\"[OPEN]\"\n\t\t\t\t\t\t\t\t\t+ config.allowedAuthAlgorithms\n\t\t\t\t\t\t\t\t\t\t\t.get(AuthAlgorithm.OPEN));\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t+ \"[OPEN]\"\n\t\t\t\t\t\t\t+ config.allowedAuthAlgorithms\n\t\t\t\t\t\t\t\t\t.get(AuthAlgorithm.OPEN));\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\",\n\t\t\t\t\t\t\t\"[SHARED]\"\n\t\t\t\t\t\t\t\t\t+ config.allowedAuthAlgorithms\n\t\t\t\t\t\t\t\t\t\t\t.get(AuthAlgorithm.SHARED));\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t+ \"[SHARED]\"\n\t\t\t\t\t\t\t+ config.allowedAuthAlgorithms\n\t\t\t\t\t\t\t\t\t.get(AuthAlgorithm.SHARED));\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\",\n\t\t\t\t\t\t\t\"[GROUP CIPHERS]\");\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t+ \"[GROUP CIPHERS]\");\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\", \"[CCMP]\"\n\t\t\t\t\t\t\t+ config.allowedGroupCiphers.get(GroupCipher.CCMP));\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\" + \"[CCMP]\"\n\t\t\t\t\t\t\t+ config.allowedGroupCiphers.get(GroupCipher.CCMP));\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\", \"[TKIP]\"\n\t\t\t\t\t\t\t+ config.allowedGroupCiphers.get(GroupCipher.TKIP));\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\" + \"[TKIP]\"\n\t\t\t\t\t\t\t+ config.allowedGroupCiphers.get(GroupCipher.TKIP));\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\",\n\t\t\t\t\t\t\t\"[WEP104]\"\n\t\t\t\t\t\t\t\t\t+ config.allowedGroupCiphers\n\t\t\t\t\t\t\t\t\t\t\t.get(GroupCipher.WEP104));\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t+ \"[WEP104]\"\n\t\t\t\t\t\t\t+ config.allowedGroupCiphers\n\t\t\t\t\t\t\t\t\t.get(GroupCipher.WEP104));\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\", \"[WEP40]\"\n\t\t\t\t\t\t\t+ config.allowedGroupCiphers.get(GroupCipher.WEP40));\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t+ \"[WEP40]\"\n\t\t\t\t\t\t\t+ config.allowedGroupCiphers.get(GroupCipher.WEP40));\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\", \"[KEYMGMT]\");\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t+ \"[KEYMGMT]\");\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\",\n\t\t\t\t\t\t\t\"[IEEE8021X]\"\n\t\t\t\t\t\t\t\t\t+ config.allowedKeyManagement\n\t\t\t\t\t\t\t\t\t\t\t.get(KeyMgmt.IEEE8021X));\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t+ \"[IEEE8021X]\"\n\t\t\t\t\t\t\t+ config.allowedKeyManagement\n\t\t\t\t\t\t\t\t\t.get(KeyMgmt.IEEE8021X));\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\", \"[NONE]\"\n\t\t\t\t\t\t\t+ config.allowedKeyManagement.get(KeyMgmt.NONE));\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\" + \"[NONE]\"\n\t\t\t\t\t\t\t+ config.allowedKeyManagement.get(KeyMgmt.NONE));\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\", \"[WPA_EAP]\"\n\t\t\t\t\t\t\t+ config.allowedKeyManagement.get(KeyMgmt.WPA_EAP));\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t+ \"[WPA_EAP]\"\n\t\t\t\t\t\t\t+ config.allowedKeyManagement.get(KeyMgmt.WPA_EAP));\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\", \"[WPA_PSK]\"\n\t\t\t\t\t\t\t+ config.allowedKeyManagement.get(KeyMgmt.WPA_PSK));\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t+ \"[WPA_PSK]\"\n\t\t\t\t\t\t\t+ config.allowedKeyManagement.get(KeyMgmt.WPA_PSK));\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\",\n\t\t\t\t\t\t\t\"[PairWiseCipher]\");\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t+ \"[PairWiseCipher]\");\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\",\n\t\t\t\t\t\t\t\"[CCMP]\"\n\t\t\t\t\t\t\t\t\t+ config.allowedPairwiseCiphers\n\t\t\t\t\t\t\t\t\t\t\t.get(PairwiseCipher.CCMP));\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t+ \"[CCMP]\"\n\t\t\t\t\t\t\t+ config.allowedPairwiseCiphers\n\t\t\t\t\t\t\t\t\t.get(PairwiseCipher.CCMP));\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\",\n\t\t\t\t\t\t\t\"[NONE]\"\n\t\t\t\t\t\t\t\t\t+ config.allowedPairwiseCiphers\n\t\t\t\t\t\t\t\t\t\t\t.get(PairwiseCipher.NONE));\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t+ \"[NONE]\"\n\t\t\t\t\t\t\t+ config.allowedPairwiseCiphers\n\t\t\t\t\t\t\t\t\t.get(PairwiseCipher.NONE));\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\",\n\t\t\t\t\t\t\t\"[TKIP]\"\n\t\t\t\t\t\t\t\t\t+ config.allowedPairwiseCiphers\n\t\t\t\t\t\t\t\t\t\t\t.get(PairwiseCipher.TKIP));\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t+ \"[TKIP]\"\n\t\t\t\t\t\t\t+ config.allowedPairwiseCiphers\n\t\t\t\t\t\t\t\t\t.get(PairwiseCipher.TKIP));\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\", \"[Protocols]\");\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t+ \"[Protocols]\");\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\", \"[RSN]\"\n\t\t\t\t\t\t\t+ config.allowedProtocols.get(Protocol.RSN));\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\" + \"[RSN]\"\n\t\t\t\t\t\t\t+ config.allowedProtocols.get(Protocol.RSN));\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\", \"[WPA]\"\n\t\t\t\t\t\t\t+ config.allowedProtocols.get(Protocol.WPA));\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\" + \"[WPA]\"\n\t\t\t\t\t\t\t+ config.allowedProtocols.get(Protocol.WPA));\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\",\n\t\t\t\t\t\t\t\"[PRE_SHARED_KEY]\" + config.preSharedKey);\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t+ \"[PRE_SHARED_KEY]\" + config.preSharedKey);\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\",\n\t\t\t\t\t\t\t\"[WEP Key Strings]\");\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t+ \"[WEP Key Strings]\");\n\t\t\t\t\tString[] wepKeys = config.wepKeys;\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\", \"[WEP KEY 0]\"\n\t\t\t\t\t\t\t+ wepKeys[0]);\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t+ \"[WEP KEY 0]\" + wepKeys[0]);\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\", \"[WEP KEY 1]\"\n\t\t\t\t\t\t\t+ wepKeys[1]);\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t+ \"[WEP KEY 1]\" + wepKeys[1]);\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\", \"[WEP KEY 2]\"\n\t\t\t\t\t\t\t+ wepKeys[2]);\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t+ \"[WEP KEY 2]\" + wepKeys[2]);\n\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\", \"[WEP KEY 3]\"\n\t\t\t\t\t\t\t+ wepKeys[3]);\n\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t+ \"[WEP KEY 3]\" + wepKeys[3]);\n\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tLog.e(\"WRITE ERROR : \",\n\t\t\t\t\t\t\t\"Failed to write Logs to ReadConfigLog.txt\");\n\t\t\t\t\tLog.e(\"WRITE ERROR : \", \"Please take logs using Logcat\");\n\t\t\t\t\tLog.e(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\",\n\t\t\t\t\t\t\t\"Could not write to ReadConfigLog.txt\"\n\t\t\t\t\t\t\t\t\t+ e.getMessage());\n\t\t\t\t}\n\t\t\t\t/* reflection magic */\n\t\t\t\t/* These are the fields we are really interested in */\n\t\t\t\ttry {\n\t\t\t\t\t// Let the magic start\n\t\t\t\t\tClass[] wcClasses = WifiConfiguration.class.getClasses();\n\t\t\t\t\t// null for overzealous java compiler\n\t\t\t\t\tClass wcEnterpriseField = null;\n\n\t\t\t\t\tfor (Class wcClass : wcClasses)\n\t\t\t\t\t\tif (wcClass.getName().equals(INT_ENTERPRISEFIELD_NAME)) {\n\t\t\t\t\t\t\twcEnterpriseField = wcClass;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\tboolean noEnterpriseFieldType = false;\n\t\t\t\t\tif (wcEnterpriseField == null)\n\t\t\t\t\t\tnoEnterpriseFieldType = true; // Cupcake/Donut access\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// enterprise settings\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// directly\n\n\t\t\t\t\tField wcefAnonymousId = null, wcefCaCert = null, wcefClientCert = null, wcefEap = null, wcefIdentity = null, wcefPassword = null, wcefPhase2 = null, wcefPrivateKey = null;\n\t\t\t\t\tField[] wcefFields = WifiConfiguration.class.getFields();\n\t\t\t\t\t// Dispatching Field vars\n\t\t\t\t\tfor (Field wcefField : wcefFields) {\n\t\t\t\t\t\tif (wcefField.getName().trim()\n\t\t\t\t\t\t\t\t.equals(INT_ANONYMOUS_IDENTITY))\n\t\t\t\t\t\t\twcefAnonymousId = wcefField;\n\t\t\t\t\t\telse if (wcefField.getName().trim().equals(INT_CA_CERT))\n\t\t\t\t\t\t\twcefCaCert = wcefField;\n\t\t\t\t\t\telse if (wcefField.getName().trim()\n\t\t\t\t\t\t\t\t.equals(INT_CLIENT_CERT))\n\t\t\t\t\t\t\twcefClientCert = wcefField;\n\t\t\t\t\t\telse if (wcefField.getName().trim().equals(INT_EAP))\n\t\t\t\t\t\t\twcefEap = wcefField;\n\t\t\t\t\t\telse if (wcefField.getName().trim()\n\t\t\t\t\t\t\t\t.equals(INT_IDENTITY))\n\t\t\t\t\t\t\twcefIdentity = wcefField;\n\t\t\t\t\t\telse if (wcefField.getName().trim()\n\t\t\t\t\t\t\t\t.equals(INT_PASSWORD))\n\t\t\t\t\t\t\twcefPassword = wcefField;\n\t\t\t\t\t\telse if (wcefField.getName().trim().equals(INT_PHASE2))\n\t\t\t\t\t\t\twcefPhase2 = wcefField;\n\t\t\t\t\t\telse if (wcefField.getName().trim()\n\t\t\t\t\t\t\t\t.equals(INT_PRIVATE_KEY))\n\t\t\t\t\t\t\twcefPrivateKey = wcefField;\n\t\t\t\t\t}\n\t\t\t\t\tMethod wcefValue = null;\n\t\t\t\t\tif (!noEnterpriseFieldType) {\n\t\t\t\t\t\tfor (Method m : wcEnterpriseField.getMethods())\n\t\t\t\t\t\t\t// System.out.println(m.getName());\n\t\t\t\t\t\t\tif (m.getName().trim().equals(\"value\")) {\n\t\t\t\t\t\t\t\twcefValue = m;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t/* EAP Method */\n\t\t\t\t\tString result = null;\n\t\t\t\t\tObject obj = null;\n\t\t\t\t\tif (!noEnterpriseFieldType) {\n\t\t\t\t\t\tobj = wcefValue.invoke(wcefEap.get(config), null);\n\t\t\t\t\t\tString retval = (String) obj;\n\t\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\",\n\t\t\t\t\t\t\t\t\"[EAP METHOD]\" + retval);\n\t\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t\t+ \"[EAP METHOD]\" + retval);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tobj = wcefEap.get(config);\n\t\t\t\t\t\tString retval = (String) obj;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* phase 2 */\n\t\t\t\t\tif (!noEnterpriseFieldType) {\n\t\t\t\t\t\tresult = (String) wcefValue.invoke(\n\t\t\t\t\t\t\t\twcefPhase2.get(config), null);\n\t\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\",\n\t\t\t\t\t\t\t\t\"[EAP PHASE 2 AUTHENTICATION]\" + result);\n\t\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t\t+ \"[EAP PHASE 2 AUTHENTICATION]\" + result);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult = (String) wcefPhase2.get(config);\n\t\t\t\t\t}\n\n\t\t\t\t\t/* Anonymous Identity */\n\t\t\t\t\tif (!noEnterpriseFieldType) {\n\t\t\t\t\t\tresult = (String) wcefValue.invoke(\n\t\t\t\t\t\t\t\twcefAnonymousId.get(config), null);\n\t\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\",\n\t\t\t\t\t\t\t\t\"[EAP ANONYMOUS IDENTITY]\" + result);\n\t\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t\t+ \"[EAP ANONYMOUS IDENTITY]\" + result);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult = (String) wcefAnonymousId.get(config);\n\t\t\t\t\t}\n\n\t\t\t\t\t/* CA certificate */\n\t\t\t\t\tif (!noEnterpriseFieldType) {\n\t\t\t\t\t\tresult = (String) wcefValue.invoke(\n\t\t\t\t\t\t\t\twcefCaCert.get(config), null);\n\t\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\",\n\t\t\t\t\t\t\t\t\"[EAP CA CERTIFICATE]\" + result);\n\t\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t\t+ \"[EAP CA CERTIFICATE]\" + result);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult = (String) wcefCaCert.get(config);\n\n\t\t\t\t\t}\n\n\t\t\t\t\t/* private key */\n\t\t\t\t\tif (!noEnterpriseFieldType) {\n\t\t\t\t\t\tresult = (String) wcefValue.invoke(\n\t\t\t\t\t\t\t\twcefPrivateKey.get(config), null);\n\t\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\",\n\t\t\t\t\t\t\t\t\"[EAP PRIVATE KEY]\" + result);\n\t\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t\t+ \"[EAP PRIVATE KEY]\" + result);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult = (String) wcefPrivateKey.get(config);\n\t\t\t\t\t}\n\n\t\t\t\t\t/* Identity */\n\t\t\t\t\tif (!noEnterpriseFieldType) {\n\t\t\t\t\t\tresult = (String) wcefValue.invoke(\n\t\t\t\t\t\t\t\twcefIdentity.get(config), null);\n\t\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\",\n\t\t\t\t\t\t\t\t\"[EAP IDENTITY]\" + result);\n\t\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t\t+ \"[EAP IDENTITY]\" + result);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult = (String) wcefIdentity.get(config);\n\t\t\t\t\t}\n\n\t\t\t\t\t/* Password */\n\t\t\t\t\tif (!noEnterpriseFieldType) {\n\t\t\t\t\t\tresult = (String) wcefValue.invoke(\n\t\t\t\t\t\t\t\twcefPassword.get(config), null);\n\t\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\",\n\t\t\t\t\t\t\t\t\"[EAP PASSWORD]\" + result);\n\t\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t\t+ \"[EAP PASSWORD]\" + result);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult = (String) wcefPassword.get(config);\n\t\t\t\t\t}\n\n\t\t\t\t\t/* client certificate */\n\t\t\t\t\tif (!noEnterpriseFieldType) {\n\t\t\t\t\t\tresult = (String) wcefValue.invoke(\n\t\t\t\t\t\t\t\twcefClientCert.get(config), null);\n\t\t\t\t\t\tLog.d(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\",\n\t\t\t\t\t\t\t\t\"[EAP CLIENT CERT]\" + result);\n\t\t\t\t\t\tout.write(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\"\n\t\t\t\t\t\t\t\t+ \"[EAP CLIENT CERT]\" + result);\n\t\t\t\t\t\tLog.e(\"READ EROR : \",\n\t\t\t\t\t\t\t\t\"All config data logged to ReadConfigLog.txt\");\n\t\t\t\t\t\tLog.e(\"READ EROR : \",\n\t\t\t\t\t\t\t\t\"Extract ReadConfigLog.txt from SD CARD\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult = (String) wcefClientCert.get(config);\n\t\t\t\t\t}\n\n\t\t\t\t\tout.close();\n\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tLog.e(\"LOGGING EROR : \",\n\t\t\t\t\t\t\t\"Failed to write Logs to ReadConfigLog.txt\");\n\t\t\t\t\tLog.e(\"LOGGING EROR : \", \"Please take logs using Logcat\");\n\t\t\t\t\tLog.e(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\",\n\t\t\t\t\t\t\t\"Could not write to ReadConfigLog.txt\"\n\t\t\t\t\t\t\t\t\t+ e.getMessage());\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}", "public void getConfigProperty() {\n Properties properties = new Properties();\n try(InputStream input = new FileInputStream(\"config.properties\");){\n properties.load(input);\n logger.info(\"BASE URL :\" + properties.getProperty(\"BASEURL\"));\n setBaseUrl(properties.getProperty(\"BASEURL\"));\n setLoginMode(properties.getProperty(\"LOGINMODE\"));\n setProjectId(properties.getProperty(\"PROJECTID\"));\n setReportId(properties.getProperty(\"REPORTID\"));\n if (!(properties.getProperty(\"PASSWORD\").trim().equals(\"\"))) {\n setPassword(properties.getProperty(\"PASSWORD\"));\n }\n if (!(properties.getProperty(\"USERNAME\").trim().equals(\"\"))) {\n setUserName(properties.getProperty(\"USERNAME\"));\n }\n }catch(IOException ex) {\n logger.debug(\"Failed to fetch value from configure file: \", ex);\n }\n\n }", "public void configurarTermino() {\n System.out.println(\"......................\");\n System.out.println(\"Seleccionar Termino Academico para el juego\");\n int i = 1;\n if (Termino.terminos.size() != 0) {\n for (Termino t : Termino.terminos) {\n System.out.println(i + \". \" + t);\n i++;\n }\n Entrada entrada = new Entrada();\n int opc;\n do {\n opc = entrada.Entera(\"Ingrese opcion(1-\" + (i - 1) + \"): \");\n if (!(opc >= 1 && opc <= (i - 1))) {\n System.out.println(\"opcion no valida\");\n }\n } while (!(opc >= 1 && opc <= (i - 1)));\n this.t = Termino.terminos.get(opc - 1);\n Juego juego = new Juego(t);\n PrcTermino.juego = juego;\n } else {\n System.out.println(\"No hay terminos academicos registrados\");\n }\n }", "public String dumpConfig() \n\t\t\tthrows PermissionDeniedException, FileNotFoundException;", "public static void main(String[] args) {\n\t\tString realPath = getFileRealPath(\"config/docService.properties\");\n\t\tgetPropertiesConfigByResourceRealPath(realPath);\n\t\t\n\t}", "private boolean readFilePasswordProperties()\n {\n boolean propertiesClaveCorrecto = true;\n try\n {\n InputStream fis = null;\n Properties properties = null;\n File archivo = null;\n // LEE PROPERTIES DE LA CLAVE\n //fis = new FileInputStream(FarmaConstants.RUTA_PROPERTIES_CLAVE);\n fis = \n this.getClass().getResourceAsStream(FarmaConstants.RUTA_PROPERTIES_CLAVE);\n //25.01.2008 ERIOS Se lee la ruta del parametro\n if( fis == null)\n {\n log.info(\"No leyo archivo\");\n //archivo = new File(\"ptoventaid.properties\");\n archivo = new File(prop2);\n fis = new FileInputStream(archivo);\n log.info(\"\" + archivo);\n }\n if (fis != null)\n {\n properties = new Properties();\n properties.load(fis);\n FarmaVariables.vClaveBD = FarmaEncripta.desencripta(properties.getProperty(\"ClaveBD\"));\n log.info(\"0. FarmaVariables.vClaveBD=\" + \n FarmaVariables.vClaveBD + \".\");\n\n /**\n * Se obtiene el SID y USER de BD\n * @author dubilluz\n * @since 13.10.2007\n */\n FarmaVariables.vSID = properties.getProperty(\"SID\");\n log.info(\"1. FarmaVariables.vSID=\" + \n FarmaVariables.vSID + \".\");\n if (FarmaVariables.vSID == null)\n FarmaVariables.vSID = ConstantsPtoVenta.SID;\n\n log.info(\"2. FarmaVariables.vSID=\" + \n FarmaVariables.vSID + \".\");\n\n //FarmaVariables.vUsuarioBD = FarmaEncripta.desencripta(properties.getProperty(\"UsuarioBD\")); \n FarmaVariables.vUsuarioBD = properties.getProperty(\"UsuarioBD\");\n log.debug(\"1. FarmaVariables.vUsuarioBD=\" + \n FarmaVariables.vUsuarioBD + \".\");\n if (FarmaVariables.vUsuarioBD == null)\n FarmaVariables.vUsuarioBD = ConstantsPtoVenta.USUARIO_BD;\n\n log.info(\"2. FarmaVariables.vUsuarioBD=\" + \n FarmaVariables.vUsuarioBD + \".\");\n\n log.info(\"cargo properties clave ptoventa.\");\n propertiesClaveCorrecto = true;\n }\n else\n {\n FarmaUtility.showMessage(myparent, \n \"Archivo de Configuracion de Clave no Encontrado.\\nPóngase en contacto con el área de sistemas.\", \n null);\n log.info(\"NO cargo properties clave ptoventa\");\n propertiesClaveCorrecto = false;\n }\n if (propertiesClaveCorrecto)\n return true;\n else\n return false;\n }\n catch (FileNotFoundException fnfException)\n {\n log.error(\"\",fnfException);\n FarmaUtility.showMessage(myparent, \n \"Archivo de Configuracion de Clave no Encontrado.\\nPóngase en contacto con el área de sistemas.\", \n null);\n }\n catch (IOException ioException)\n {\n log.error(\"\",ioException);\n FarmaUtility.showMessage(myparent, \n \"Error al leer archivo de Configuracion de Clave.\\nPóngase en contacto con el área de sistemas.\", \n null);\n }\n myparent.dispose();\n return false;\n }", "private void Btn_ConfiguracionActionPerformed(java.awt.event.ActionEvent evt) {\n Tabb_Principal.setSelectedIndex(2);\n Btn_Cliente.setEnabled(true);\n Btn_Configuracion.setEnabled(false);\n config = new ConfigurationVM(_radio);\n }" ]
[ "0.65560496", "0.585607", "0.57898897", "0.56741756", "0.5559647", "0.5516202", "0.55006015", "0.5496913", "0.5474694", "0.5455539", "0.5443659", "0.53857183", "0.53639984", "0.5331417", "0.53306854", "0.53225857", "0.529146", "0.5272007", "0.5270845", "0.5261678", "0.5251584", "0.5250898", "0.52476203", "0.5243472", "0.5239172", "0.5238905", "0.5229846", "0.52289855", "0.5226201", "0.5223092", "0.5215305", "0.5214726", "0.5212869", "0.5203469", "0.51968676", "0.51868963", "0.518163", "0.51631445", "0.51554847", "0.5153075", "0.5153009", "0.5139909", "0.5137308", "0.51322377", "0.51184475", "0.5114745", "0.50996226", "0.5097705", "0.5097503", "0.5094905", "0.5093895", "0.5084251", "0.50803953", "0.5074695", "0.5074122", "0.50711155", "0.50611115", "0.5025318", "0.50245017", "0.50211215", "0.50105345", "0.5003697", "0.499025", "0.4986542", "0.4985391", "0.4983011", "0.4980577", "0.49744973", "0.49730295", "0.4971339", "0.49625778", "0.49607745", "0.49537358", "0.49505538", "0.49495", "0.49472752", "0.4944346", "0.49435765", "0.4936263", "0.49294326", "0.4927021", "0.49206972", "0.4903851", "0.49037477", "0.49019554", "0.48958102", "0.4895676", "0.4887619", "0.48867336", "0.48807415", "0.48728317", "0.48696905", "0.48581362", "0.48551798", "0.4851283", "0.48482868", "0.48446333", "0.4837756", "0.4833362", "0.48327512" ]
0.5049155
57
pobieranie zawartosci pliku konfiguracyjnego
ArrayList<ArrayList<String>> get_config(){ return config_file.r_wartosci(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testSpremiKonfiguraciju() throws Exception {\n System.out.println(\"spremiKonfiguraciju\");\n KonfiguracijaTxt instance = new KonfiguracijaTxt(datKonf.getName());\n instance.spremiKonfiguraciju();\n assertTrue(datKonf.exists());\n }", "public String getDescription() {\r\n\t return \"Just accept image file\";\r\n\t }", "String getFilepath();", "public abstract String getFotoPath();", "public abstract File mo41088k();", "public abstract String getImageFormat();", "public FileDesc getFileDesc();", "public abstract String getFileLocation();", "protected abstract String getResourcePath();", "public String getKeyFilePath();", "private String descFormat() {\n File f = cfg.getReadFromFile();\n if (f != null) {\n return f.getPath();\n }\n return StringUtils.defaultString(cfg.getName(), \"(unnamed)\");\n }", "public abstract String getFileFormatName();", "String getImagePath();", "String getImagePath();", "public void crearRutaImgPublicacion(){\n \n servletContext=(ServletContext) contexto.getExternalContext().getContext();\n String ruta=\"\";\n //Ruta real hasta la carpeta uploads\n ruta=servletContext.getRealPath(\"/upload/\");\n //Obtener el codigo del usuario de la sesion actual\n //este es utilizado para ubicar la carpeta que le eprtenece\n String codUsuario=String.valueOf(new SessionLogica().obtenerUsuarioSession().getCodUsuario());\n //Concatenamiento de directorios internos\n ruta+=File.separatorChar+\"img\"+File.separatorChar+\"post\"+File.separatorChar+codUsuario+File.separatorChar+\"all\"+File.separatorChar;\n //Asignacion de la ruta creada\n this.rutaImgPublicacion=ruta;\n }", "String getFilePath();", "@Override\n public String getDescription() {\n return \"File di immagini (*.jpg, *.jpeg, *.gif, *.png, *.tif)\";\n }", "@Test\n\tpublic void test(){\n\t\tFile srcFile = new File(\"E:\\\\Workspaces\\\\MyPro\\\\ssh\\\\WebRoot\\\\products\\\\2\\\\男鞋\");\n//\t\tSystem.out.println(ss);\n\t\tthis.getAllJavaFilePaths(srcFile);\n\t}", "public interface FileConfig {\n /**\n * get the mustache file path.\n * @return file path\n */\n String getPath();\n}", "@Test\n public void testSpremiKonfiguraciju_String() throws Exception {\n System.out.println(\"spremiKonfiguraciju\");\n KonfiguracijaTxt instance = new KonfiguracijaTxt(datKonf.getName());\n instance.spremiKonfiguraciju(datKonf.getName());\n assertTrue(datKonf.exists());\n }", "public static String getPath() {\n\t\t// Lấy đường dẫn link\n\t\tAuthentication auth1 = SecurityContextHolder.getContext().getAuthentication();\n\t\tAgentconnection cus = (Agentconnection) auth1.getPrincipal();\n\t\t \n\t\t//String PATH_STRING_REAL = fileStorageProperties.getUploadDir()+cus.getMerchant()+\"/hotel/images/\" + year + \"/\" + month + \"/\" ;\n\t String PATH_STRING_REAL = \"E:/ezcloud/upload/\"+cus.getMerchant()+\"/hotel/images/\" + year + \"/\" + month + \"/\" ;\n\t return PATH_STRING_REAL;\n\t}", "public void creaRutaImgPerfil(){\n servletContext=(ServletContext) contexto.getExternalContext().getContext();\n String ruta=\"\";\n //Ruta real hasta la carpeta de uploads\n ruta=servletContext.getRealPath(\"/upload/\");\n \n //Concatenamiento de directorios internos\n ruta+=File.separatorChar+\"img\"+File.separatorChar+\"users\"+File.separatorChar;\n \n //Asignacion de la ruta creada\n this.rutaImgPerfil=ruta;\n }", "abstract String getFileRoute() throws IOException;", "java.lang.String getImagePath();", "public static void zapisPliku(String nazwaPlikuZapis) throws IOException{\n FileWriter plikZapisz = null;\n try {\n // tworzy nowy plik jeżeli nie istnieje, w przeciwnym przypadku\n // usuwa zawartość pliku i nadpisuje od początku\n plikZapisz = new FileWriter(nazwaPlikuZapis);\n //zapis łańcucha\n plikZapisz.write(tekstDoZapisu);\n //zapis po znaku\n for (char znak = 'a'; znak <='z'; znak++){\n plikZapisz.write(znak);\n plikZapisz.write('\\n');\n }\n }finally {\n if (plikZapisz != null){\n plikZapisz.close();\n }\n }\n }", "Config(InfoHandler info){\n \n this.info = info;\n \n config_list = new ArrayList<>();\n \n File test = new File(config_path);\n \n if(test.exists()){ //plik istnieje\n \n info.mode=1; //wlaczenie trybu dla obslugi pliku konfiguracyjnego\n \n \n //tutaj pobieranie informacji z pliku konfiguracyjnego\n //do ciała funkcji\n \n config_file = new DictReader(config_path,info);\n \n //tutaj dodajemy funkcjonalnosci\n \n config_list.add(config_file.szukaj(\"%imie\"));\n config_list.add(config_file.szukaj(\"%dict_path\"));\n \n config = get_config();\n \n info.mode=0;\n \n is_alive = true;\n }\n else{\n config = new ArrayList<>();\n config_file = new DictReader(config_path,info);\n first_start = 1;\n }\n }", "public abstract String getFileExtension();", "public abstract File mo41087j();", "String getFile();", "String getFile();", "String getFile();", "private void choixRepertoire(int format){\n\t\tString path = \"\"; //Chemin a parcourir\n\t\tJFileChooser chooser = null;\n\t\tif(SauvegardeRepertoire.getPaths().isEmpty()){//Si la liste des repertoires est vide\n\t\t\tchooser = new JFileChooser();\n\t\t}\n\t\telse{//si elle n'est pas vide\n\t\t\tIterator<String> it = SauvegardeRepertoire.getPaths().iterator();\n\t\t\twhile (it.hasNext() && path.equals(\"\")) {\n\t\t\t\tString str = (String) it.next();\n\t\t\t\tFile file = new File(str);\n\n\t\t\t\tif (file.exists()) //on recupere le premier repertoire possible\t\n\t\t\t\t\tpath = file.getAbsolutePath();\n\t\t\t}\n\n\t\t\tif(path.equals(\"\"))//si on a pas trouvé de chemin coherent\n\t\t\t\tchooser = new JFileChooser();\n\t\t\telse\n\t\t\t\tchooser = new JFileChooser(path);\n\t\t}\n\t\tFileNameExtensionFilter filter=null;\n\t\tswitch(format)\n\t\t{\n\t\t\tcase PDFFile:\n\t\t\t\tfilter = new FileNameExtensionFilter(\"PDF\",\"pdf\");\n\t\t\t\tbreak;\n\t\t\tcase ARFFFile:\n\t\t\t\tchooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\n\t\t\t\tchooser.setAcceptAllFileFilterUsed(false);\n\t\t\t\tbreak;\n\t\t}\n\n\t\tchooser.setFileFilter(filter);\n\t\tchooser.setMultiSelectionEnabled(false);\n\t\tint returnVal = chooser.showOpenDialog(null);\n\t\tif(returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t\tSauvegardeRepertoire.ajoutPath(chooser);//permet de sauvegarder les repertoires\n\t\t\tif(filter!=null && filter.getExtensions()[0].equals(\"pdf\")) {\n\t\t\t\tgestionFichier(chooser);\n\t\t\t\tunlockButton();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tgestionFichierDataSet(chooser);\n\t\t\t\tbDataTraining.setEnabled(true);\n\t\t\t}\n\n\t\t}\n\t}", "public abstract String getPropertyFile();", "public static void odczytZnakPoZnaku(String nazwaPlikuOdczyt) throws IOException {\n FileReader plikZPZ = null;\n try {\n plikZPZ = new FileReader(nazwaPlikuOdczyt);\n System.out.println(\"\\n\\nOdczyt pliku znak po znaku:\\n\");\n int znaki;\n //odczyt pliku znak po anaku i wyświetlenie na ekranie\n while ((znaki = plikZPZ.read()) != -1) {//jeśli znaki = -1 to znaczy koniec pliku\n System.out.println((char) znaki);\n }\n } finally {// klauzula finally służy do wykonania instrukcji\n // niezależnie od tego kiedy i w jaki sposób (normalnie lub\n // przez wyjątek) zostało zakończone wykonywanie bloku try\n if (plikZPZ != null) {\n plikZPZ.close();//zamknięcie pliku\n }\n }\n }", "protected abstract String getFileExtension();", "public File getConfigurationFile();", "private String getPhotoFilePath(boolean getThumbnail) throws IOException {\n\n String mainPath = config.getString(\"travelea.photos.main\");\n\n String returnPath = mainPath + (getThumbnail\n ? config.getString(\"travelea.photos.thumbnail\")\n : \"\");\n\n\n Path path = Paths.get(returnPath).toAbsolutePath();\n\n returnPath = path.toString();\n\n if (!path.toFile().exists() || !path.toFile().isDirectory()) {\n Files.createDirectory(path);\n }\n\n return returnPath;\n }", "@Override\r\n\tpublic String getDescription() {\r\n\t\treturn \"Image Files\";\r\n\t}", "public boolean getUseFiles();", "public interface FileFilter {\n\t\n\t/**\n\t * Metoda provjerava zadovoljava li file zadani implementirani filter, ovisno o razredu.\n\t * \n\t * @param f file nad kojim se provjerava \n\t * @return true ili false, ovisno o uspjesnosti provjere\n\t */\n\tpublic boolean accepts(File f);\n\n}", "private void configurar() {\n jButtonPrimero.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/com/robertovicentepujades/mantenimientos/archivos/resources/to-start-30.png\")));\n jButtonPrimero.setToolTipText(\"Ir al primer registro\");\n jButtonAnterior.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/com/robertovicentepujades/mantenimientos/archivos/resources/fb-30.png\")));\n jButtonAnterior.setToolTipText(\"Ir al registro anterior\");\n jButtonSiguiente.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/com/robertovicentepujades/mantenimientos/archivos/resources/ff-30.png\")));\n jButtonSiguiente.setToolTipText(\"Ir al registro siguiente\");\n jButtonUltimo.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/com/robertovicentepujades/mantenimientos/archivos/resources/to-end-30.png\")));\n jButtonUltimo.setToolTipText(\"Ir al último registro\");\n jLabelNumeroNum.setFont(new java.awt.Font(\"Tahoma\", 1, 12));\n jLabelNumero.setFont(new java.awt.Font(\"Tahoma\", 1, 12));\n\n this.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 1, true));\n \n }", "@Override\n\tpublic String getSrcFileZulForm(OperacionEnum operacionEnum) {\n\t\treturn null;\n\t}", "private ControlloFile() {\n\t}", "String getConfigFileName();", "public abstract String getDataFileUrl ();", "public void mo210a(File file) {\n }", "public String getFilename();", "private static void info ( File f ) {\n\tString nume = f . getName () ;\n\tif( f.isFile () )\n\tSystem.out.println ( \" Fisier : \" + nume ) ;\n\telse\n\tif( f.isDirectory () )\n\tSystem.out.println ( \" Director : \" + nume ) ;\n\tSystem.out.println (\n\t\" Cale absoluta : \" + f.getAbsolutePath () +\n\t\" \\n Poate citi : \" + f.canRead () +\n\t\" \\n Poate scrie : \" + f.canWrite () +\n\t\" \\n Parinte : \" + f.getParent () +\n\t\" \\n Cale : \" + f.getPath () +\n\t\" \\n Lungime : \" + f.length () +\n\t\" \\n Data ultimei modificari : \" +\n\tnew Date ( f.lastModified () ) ) ;\n\tSystem.out.println ( \" --------------\" ) ;\n\t}", "public boolean fileFormatSupported(String fmt);", "String getIconFile();", "public void sproziRisanje(String[] args) {\n try {\n int wPlatno = PRIVZETA_SIRINA_PLATNA;\n int hPlatno = PRIVZETA_VISINA_PLATNA;\n File datoteka = null;\n\n // obdelaj argumente ukazne vrstice\n for (int i = 0; i < args.length; i++) {\n if (args[i].indexOf(\".\") >= 0) {\n String[] imeKoncnica = args[i].split(\"\\\\.\");\n String koncnica = imeKoncnica[imeKoncnica.length - 1];\n if (!koncnica.equals(\"png\")) {\n throw new IllegalArgumentException(\"Datoteka mora imeti končnico .png\");\n }\n datoteka = new File(args[i]);\n\n } else if (args[i].indexOf(\"x\") >= 0) {\n String[] wh = args[i].split(\"x\");\n wPlatno = Integer.parseInt(wh[0]);\n hPlatno = Integer.parseInt(wh[1]);\n\n } else {\n throw new RuntimeException();\n }\n }\n\n // V odvisnosti od tipa platna ustvari okno in plo\"s\"co oziroma\n // pomnilni\"sko sliko. V primeru izdelave pomnilni\"ske slike\n // pokli\"ci metodo `narisi' in shrani izdelano sliko v datoteko.\n // V primeru izdelave okna pa se bo metoda `narisi' poklicala\n // preko metode paintComponent risalne plo\"s\"ce.\n\n if (datoteka == null) {\n this.ustvariOknoInPlosco(wPlatno, hPlatno);\n } else {\n this.izdelajPNG(wPlatno, hPlatno, datoteka);\n }\n\n } catch (IllegalArgumentException ex) {\n System.err.println(\"====================================\");\n System.err.println(ex.getMessage());\n System.err.println(\"====================================\");\n izpisiNavodila();\n\n } catch (RuntimeException ex) {\n // nekaj je narobe; izpi\"si navodila za uporabo\n izpisiNavodila();\n }\n }", "public abstract String getResourcePath(Method method);", "public abstract String getPath();", "public abstract String getPath();", "public abstract String getImageSuffix();", "public void salvaAula()\n { \n JFileChooser fileChooser = new JFileChooser();\n String strFilePlan = \"out/\" + this.myAula.getNome()+ \"_plan\"+ \".png\";\n System.out.println(\"scrivo su file \"+ strFilePlan);\n File fp = new File(strFilePlan);\n String strFileDati = \"out/\" + this.myAula.getNome()+ \"_dati\"+ \".png\";\n File fd = new File(strFileDati);\n fileChooser.setSelectedFile(fd);\n try\n { \n ImageIO.write(this.getPlan(), \"png\", fp);\n ImageIO.write(this.getDati(), \"png\", fd);\n }\n catch (Exception ex)\n {\n System.out.println(\"errore in Salvataggio aula su file\");\n }\n \n JOptionPane.showMessageDialog(this, \"file salvati correttamente sotto cartella /out\",\"Info\", JOptionPane.INFORMATION_MESSAGE);\n }", "java.lang.String getFilePath();", "String generalFileName(String url);", "public InputStream pobierzZPliku(String nazwaPliku) {\r\n ClassLoader zaladuj = getClass().getClassLoader();\r\n InputStream zawartosc = zaladuj.getResourceAsStream(nazwaPliku);\r\n if (zawartosc == null) {\r\n throw new IllegalArgumentException(\"Brak pliku: \" + nazwaPliku);\r\n } else {\r\n return zawartosc;\r\n }\r\n }", "File getPropertiesFile();", "Path getFilePath();", "String getFilename();", "public Path getPath(String path,String nombreArchivo);", "String getResource();", "@Test\n public void testAnalyzeFileByExtension() {\n incorrectValues(null, \"test.txt\");\n incorrectValues(\"\", \"test.txt\");\n incorrectValues(\"lof\", null);\n incorrectValues(\"file\", \"\");\n incorrectValues(\"resources\", \".png\");\n }", "File getFile();", "File getFile();", "public abstract String getFullPath();", "public String getResourcePath();", "@Override\n public String getFilenameXPathKey() {\n return ebsco_filename;\n }", "private String image_path(String path, String name, String ext) {\n return path + \"/\" + name + \".\" + ext;\n }", "@Test\n\tpublic void obtenerMimeTypeTest() {\n\t\tArchivo ar = new Imagen(\"test\", \"contenido\");\n\t\tassertEquals(\"image/png\", ar.obtenerMimeType());\n\t}", "@Override\n\tpublic void obavesti(KruznaFigura figura) {\n\t\t\n\t}", "private void generarPNG(String nombre, String entrada) {\n try {\n String ruta = this.pathGuardado + \"/\" + nombre + \".dot\";\n File file = new File(ruta);\n // Si el archivo no existe es creado\n if (!file.exists()) {\n file.createNewFile();\n }\n FileWriter fw = new FileWriter(file);\n BufferedWriter bw = new BufferedWriter(fw);\n bw.write(entrada);\n bw.close();\n// //Generar Imagen creada por .dot\n ControlTerminal controlTer = new ControlTerminal(ruta, this.pathGuardado + \"/\" + nombre + \".png\");\n controlTer.generarImagen();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void testDefaultFormat() {\n ThemeLayer tl = new ThemeLayer();\n assertTrue(tl.getFormat().equals(\"image/png\"));\n }", "private void izdelajPNG(int wSlika, int hSlika, File datoteka) {\n BufferedImage slika = new BufferedImage(wSlika, hSlika, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g = slika.createGraphics();\n g.setColor(Color.WHITE);\n g.fillRect(0, 0, wSlika, hSlika);\n this.narisi(g, wSlika, hSlika);\n g.dispose();\n\n try {\n ImageIO.write(slika, \"png\", datoteka);\n } catch (IOException ex) {\n ex.printStackTrace(System.err);\n }\n }", "@Override\n public String getDescription() {\n return \"AutoPathing\";\n }", "public String getFileName ();", "private String ProperEstadoCivil()\n{\n String strRes=\"\";\n try\n {\n //Leer archivo de configuración .\n java.util.Properties proArc=new java.util.Properties();\n \n java.io.FileInputStream fis=new java.io.FileInputStream(\"config.properties.txt\");\n proArc.load(fis);\n fis.close();\n \n \n \n strRes=proArc.getProperty(\"EstadoCivil\");\n proArc=null;\n }\n catch (java.io.IOException e)\n {\n strRes=\"\";\n }\n catch (Exception e)\n {\n strRes=\"\";\n }\n return strRes;\n }", "public String getAnoFilmagem();", "private void validateFile(final boolean isRustica) {\n\t\thayErroresFilas = false;\r\n\t\thayErroresFila = false;\r\n\r\n\t\tcampoMasaCorrectos = true;\r\n\t\tcampoHojaCorrecto = true;\r\n\t\tcampoParecelaCorrecto = true;\r\n\t\tcampoTipoCorrecto = true;\r\n\t\tcampoFechaAltaCorrecto = true;\r\n\t\tcampoFechaBajaCorrecto = true;\r\n\r\n\t\tFile currentDirectory = (File) blackboard.get(ImportarUtils_LCGIII.LAST_IMPORT_DIRECTORY);\r\n\r\n\t\tGeopistaFiltroFicheroFilter filter = new GeopistaFiltroFicheroFilter();\r\n\t\tfilter.addExtension(\"SHP\");\r\n filter.setDescription(\"Shapefiles\");\r\n\t\t\r\n final JFileChooser jfc;\r\n final JTextField jtf;\r\n if (isRustica)\r\n {\r\n \tjfc = fcRustica;\t\r\n \tjtf = this.txtFicheroRustica;\r\n }\r\n\t\telse\r\n\t\t{\r\n\t\t\tjfc = fcUrbana;\r\n\t\t\tjtf = this.txtFicheroUrbana;\r\n\t\t}\r\n\t\t\t\t\r\n\t\t// FILES(*.*)\r\n jfc.setFileFilter(filter);\r\n \tjfc.setAcceptAllFileFilterUsed(false); // QUITA LA OPCION ALL\r\n\t\tjfc.setCurrentDirectory(currentDirectory);\r\n\t\t\r\n\t\tint returnVal = jfc.showOpenDialog(this);\r\n\t\tblackboard.put(ImportarUtils_LCGIII.LAST_IMPORT_DIRECTORY, jfc.getCurrentDirectory());\r\n\r\n\t\tif (returnVal == JFileChooser.APPROVE_OPTION)\r\n\t\t{\r\n\t\t\t// Cargamos el fichero que hemos obtenido\r\n\t\t\tString fichero;\r\n\t\t\tfichero = jfc.getSelectedFile().getPath();\r\n\t\t\tjtf.setText(fichero); // meto el fichero seleccionado\r\n\t\t\t// en el campo\r\n\r\n\t\t\tcadenaTexto = \"<font face=SansSerif size=3>\"\r\n\t\t\t\t+ aplicacion.getI18nString(\"ImportacionComenzar\") + \"<b>\" + \" \"\r\n\t\t\t\t+ jfc.getSelectedFile().getName() + \"</b>\";\r\n\t\t\t\r\n\t\t\tcadenaTexto = cadenaTexto + \"<p>\" + aplicacion.getI18nString(\"OperacionMinutos\") + \" ...</p></font>\";\r\n\t\t\tcadenaTexto = cadenaTexto + aplicacion.getI18nString(\"importar.datos.parcelas\");\r\n\r\n\t\t\tediError.setText(cadenaTexto);\r\n\t\t\tcadenaTexto=\"\";\r\n\r\n\t\t\tfinal TaskMonitorDialog progressDialog = \r\n\t\t\t\tnew TaskMonitorDialog(aplicacion.getMainFrame(), geopistaEditor.getContext().getErrorHandler());\r\n\r\n\t\t\tprogressDialog.setTitle(aplicacion.getI18nString(\"ValidandoDatos\"));\r\n\t\t\tprogressDialog.report(aplicacion.getI18nString(\"ValidandoDatos\"));\r\n\t\t\tprogressDialog.addComponentListener(new ComponentAdapter()\r\n\t\t\t{\r\n\t\t\t\tpublic void componentShown(ComponentEvent e)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Wait for the dialog to appear before starting the\r\n\t\t\t\t\t// task. Otherwise\r\n\t\t\t\t\t// the task might possibly finish before the dialog\r\n\t\t\t\t\t// appeared and the\r\n\t\t\t\t\t// dialog would never close. [Jon Aquino]\r\n\t\t\t\t\tnew Thread(new Runnable()\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tpublic void run()\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\ttry\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tGeopistaLayer layerParcelas = (GeopistaLayer) blackboard.get(\"capaParcelasInfoReferencia\");\r\n\t\t\t\t\t\t\t\tif (layerParcelas != null)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tgeopistaEditor.getLayerManager().remove(layerParcelas);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tlayerParcelas = (GeopistaLayer) geopistaEditor.loadData(\r\n\t\t\t\t\t\t\t\t\t\tjfc.getSelectedFile().getAbsolutePath(),\r\n\t\t\t\t\t\t\t\t\t\taplicacion.getI18nString(\"importar.informe.parcelas\"));\r\n\t\t\t\t\t\t\t\tlayerParcelas.setActiva(false);\r\n\t\t\t\t\t\t\t\tlayerParcelas.addStyle(new BasicStyle(new Color(64, 64,64)));\r\n\t\t\t\t\t\t\t\tlayerParcelas.setVisible(false);\r\n\r\n\t\t\t\t\t\t\t\tif (isRustica)\r\n\t\t\t\t\t\t\t\t\tblackboard.put(\"capaParcelasInfoReferencia\", layerParcelas);\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\tblackboard.put(\"capaParcelasInfoReferenciaUrbana\", layerParcelas);\r\n\r\n\t\t\t\t\t\t\t\t// Obtener el esquema\r\n\t\t\t\t\t\t\t\tFeatureSchema esquema = layerParcelas.getFeatureCollectionWrapper().getFeatureSchema();\r\n\r\n\t\t\t\t\t\t\t\t// Localizar los campos\r\n\t\t\t\t\t\t\t\tcampoMasaCorrectos = encontrarCampo(\"MASA\",esquema);\r\n\t\t\t\t\t\t\t\tcampoHojaCorrecto = encontrarCampo(\"HOJA\",esquema);\r\n\t\t\t\t\t\t\t\tcampoParecelaCorrecto = encontrarCampo(\"PARCELA\",esquema);\r\n\t\t\t\t\t\t\t\tcampoTipoCorrecto = encontrarCampo(\"TIPO\",esquema);\r\n\t\t\t\t\t\t\t\tcampoFechaAltaCorrecto = encontrarCampo(\"FECHAALTA\", esquema);\r\n\t\t\t\t\t\t\t\tcampoFechaBajaCorrecto = encontrarCampo(\"FECHABAJA\", esquema);\r\n\r\n\t\t\t\t\t\t\t\tif (campoMasaCorrectos \r\n\t\t\t\t\t\t\t\t\t\t&& campoHojaCorrecto\r\n\t\t\t\t\t\t\t\t\t\t&& campoParecelaCorrecto\r\n\t\t\t\t\t\t\t\t\t\t&& campoTipoCorrecto\r\n\t\t\t\t\t\t\t\t\t\t&& campoFechaAltaCorrecto\r\n\t\t\t\t\t\t\t\t\t\t&& campoFechaBajaCorrecto)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t// A partir de aqui hay que\r\n\t\t\t\t\t\t\t\t\t// verificar que no hay nulos y es\r\n\t\t\t\t\t\t\t\t\t// del tipo correcto los valores.\r\n\t\t\t\t\t\t\t\t\tList listaLayer = layerParcelas.getFeatureCollectionWrapper().getFeatures();\r\n\t\t\t\t\t\t\t\t\tIterator itLayer = listaLayer.iterator();\r\n\r\n\t\t\t\t\t\t\t\t\twhile (itLayer.hasNext())\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tif (hayErroresFila)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t// break;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tFeature f = (Feature) itLayer.next();\r\n\t\t\t\t\t\t\t\t\t\tString masa = f.getString(\"MASA\");\r\n\t\t\t\t\t\t\t\t\t\tString hoja = f.getString(\"HOJA\");\r\n\t\t\t\t\t\t\t\t\t\tString parcela = f.getString(\"PARCELA\");\r\n\r\n\t\t\t\t\t\t\t\t\t\tString tipo = f.getString(\"TIPO\");\r\n\t\t\t\t\t\t\t\t\t\t// Comprobamos que no sea nulo y\r\n\t\t\t\t\t\t\t\t\t\t// sea una U o una R\r\n\t\t\t\t\t\t\t\t\t\tif ((!tipo.equals(\"U\"))\r\n\t\t\t\t\t\t\t\t\t\t\t\t&& (!tipo.equals(\"R\"))\r\n\t\t\t\t\t\t\t\t\t\t\t\t&& (!tipo.equals(\"D\"))\r\n\t\t\t\t\t\t\t\t\t\t\t\t&& (!tipo.equals(\"X\")))\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t// Solo puede haber una R \r\n\t\t\t\t\t\t\t\t\t\t\t// una U una D o una X.\r\n\t\t\t\t\t\t\t\t\t\t\tcadenaTexto = cadenaTexto\r\n\t\t\t\t\t\t\t\t\t\t\t+ aplicacion.getI18nString(\"importar.informe.parcelas.rustico\")\r\n\t\t\t\t\t\t\t\t\t\t\t+ masa\r\n\t\t\t\t\t\t\t\t\t\t\t+ hoja\r\n\t\t\t\t\t\t\t\t\t\t\t+ parcela\r\n\t\t\t\t\t\t\t\t\t\t\t+ aplicacion.getI18nString(\"importar.informe.parcelas.fin.rustico\");\r\n\t\t\t\t\t\t\t\t\t\t\thayErroresFila = true;\r\n\t\t\t\t\t\t\t\t\t\t\thayErroresFilas = true;\r\n\t\t\t\t\t\t\t\t\t\t\t// break;\r\n\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\telse if (!isRustica && (tipo.equals(\"R\") || tipo.equals(\"D\") || tipo.equals(\"X\")))\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tcadenaTexto = I18N.get(\"ImportadorParcelas\", \"importar.informe.parcelas.error.inicio.parcelario\")\r\n\t\t\t\t\t\t\t\t\t\t\t+ I18N.get(\"ImportadorParcelas\", \"importar.informacion.referencia.validacion.urbana\") + \r\n\t\t\t\t\t\t\t\t\t\t\tI18N.get(\"ImportadorParcelas\", \"importar.informe.parcelas.error.fin.parcelario\");\r\n\t\t\t\t\t\t\t\t\t\t\thayErroresFila = true;\r\n\t\t\t\t\t\t\t\t\t\t\thayErroresFilas = true;\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse if (isRustica && tipo.equals(\"U\"))\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tcadenaTexto = I18N.get(\"ImportadorParcelas\", \"importar.informe.parcelas.error.inicio.parcelario\")\r\n\t\t\t\t\t\t\t\t\t\t\t+ I18N.get(\"ImportadorParcelas\", \"importar.informacion.referencia.validacion.rustica\") + \r\n\t\t\t\t\t\t\t\t\t\t\tI18N.get(\"ImportadorParcelas\", \"importar.informe.parcelas.error.fin.parcelario\");\r\n\t\t\t\t\t\t\t\t\t\t\thayErroresFila = true;\r\n\t\t\t\t\t\t\t\t\t\t\thayErroresFilas = true;\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t// Comprobamos que la fecha\r\n\t\t\t\t\t\t\t\t\t\t\t// que viene sea fecha\r\n\t\t\t\t\t\t\t\t\t\t\ttry\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\tDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd\");\r\n\t\t\t\t\t\t\t\t\t\t\t\tDate date = (Date) formatter.parse(f.getString(\"FECHAALTA\"));\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Comprobamos que la\r\n\t\t\t\t\t\t\t\t\t\t\t\t// fecha de baja es nula\r\n\t\t\t\t\t\t\t\t\t\t\t\t// o valida o 9999999\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (f.getString(\"FECHABAJA\").equals(\"99999999\"))\r\n\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t// Correcto\r\n\t\t\t\t\t\t\t\t\t\t\t\t\thayErroresFila = false;\r\n\t\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ((f.getString(\"FECHABAJA\")) == null)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\thayErroresFila = false;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Comprobamos que sea una fecha correcta\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttry\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDateFormat formatter1 = new SimpleDateFormat(\"yyyyMMdd\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate date1 = (Date) formatter1.parse(f.getString(\"FECHABAJA\"));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcatch (Exception excp)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\texcp.printStackTrace();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thayErroresFila = true;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thayErroresFilas = true;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcadenaTexto = cadenaTexto\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ aplicacion.getI18nString(\"importar.informe.parcelas.fecha.baja\")\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ masa\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ hoja\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ parcela\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ aplicacion.getI18nString(\"importar.informe.parcelas.fin.rustico\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// break;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t//jtf.setBorder(BorderFactory.createLineBorder(Color.GREEN, 2));\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (isRustica)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\trusticaValida = true;\r\n\t\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t\turbanaValida = true;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\tcatch (Exception exc)\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t// En la fecha de alta\r\n\t\t\t\t\t\t\t\t\t\t\t\tcadenaTexto = cadenaTexto\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ aplicacion.getI18nString(\"importar.informe.parcelas.fecha.alta.validacion\")\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ masa\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ hoja\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ parcela\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ aplicacion.getI18nString(\"importar.informe.parcelas.fin.rustico\");\r\n\t\t\t\t\t\t\t\t\t\t\t\texc.printStackTrace();\r\n\t\t\t\t\t\t\t\t\t\t\t\thayErroresFila = true;\r\n\t\t\t\t\t\t\t\t\t\t\t\thayErroresFilas = true;\r\n\t\t\t\t\t\t\t\t\t\t\t\t// break;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t//Se comprueba si la geometría es de tipo polygon y no es empty (únicas válidas en la capa parcelas)\r\n\t\t\t\t\t\t\t\t\t\t\tif (!(f.getGeometry() instanceof Polygon)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t|| f.getGeometry().isEmpty())\r\n\t\t\t\t\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\tcadenaTexto = I18N.get(\"ImportadorParcelas\", \"importar.informe.parcelas.error.inicio.parcelario\")\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ I18N.get(\"ImportadorParcelas\", \"importar.informacion.referencia.validacion.geometria\") + \r\n\t\t\t\t\t\t\t\t\t\t\t\tI18N.get(\"ImportadorParcelas\", \"importar.informe.parcelas.error.fin.parcelario\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\thayErroresFila = true;\r\n\t\t\t\t\t\t\t\t\t\t\t\thayErroresFilas = true;\r\n\t\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t// Alguno de los campos no están\r\n\t\t\t\t\t\t\t\t\t// definidos\r\n\t\t\t\t\t\t\t\t\t// JOptionPane.showMessageDialog(this,aplicacion.getI18nString(\"importar.informe.parcelas.algun.campo\"));\r\n\t\t\t\t\t\t\t\t\tcadenaTexto += aplicacion.getI18nString(\"importar.informacion.ficheros.no.correctos\");\r\n\t\t\t\t\t\t\t\t\thayErroresFilas = true;\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif (isRustica)\r\n\t\t\t\t\t\t\t\t\t\trusticaValida = false;\r\n\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\turbanaValida = false;\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\tcatch (Exception e)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\thayErroresFilas = true;\r\n\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\tfinally\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tprogressDialog.setVisible(false);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}).start();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tGUIUtil.centreOnWindow(progressDialog);\r\n\t\t\tprogressDialog.setVisible(true);\r\n\r\n\t\t\tif (hayErroresFilas)\r\n\t\t\t{\r\n\t\t\t\tjtf.setBorder(BorderFactory.createLineBorder(Color.RED, 2));\r\n\t\t\t\tcadenaTexto = cadenaTexto + aplicacion.getI18nString(\"validacion.finalizada\");\t\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tjtf.setBorder(BorderFactory.createLineBorder(Color.GREEN, 2));\r\n\t\t\t\tcadenaTexto = cadenaTexto + aplicacion.getI18nString(\"importar.informe.parcelas.fichero.correcto\")\r\n\t\t\t\t+ aplicacion.getI18nString(\"validacion.finalizada\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tediError.setText(cadenaTexto);\r\n\t\t\twizardContext.inputChanged();\r\n\t\t}\r\n\r\n\t}", "private static void showFiles(File f) {\n\t\n}", "@Test\r\n public void testToPath() {\r\n System.out.println(\"toPath\");\r\n String id = \"c_58__47_Dojo_32_Workshop_47_test_46_txt\";\r\n String expResult = \"c:/Dojo Workshop/test.txt\";\r\n String result = FileRestHelper.toPath(id);\r\n assertEquals(expResult, result);\r\n }", "String getNoticeFileUrl();", "public abstract String direcao();", "private void toFile(OutputData data) {\n if(data == null) {\r\n JOptionPane.showMessageDialog(this, \"Dane wynikowe nie zostały jeszcze umieszczone w pamieci\");\r\n return;\r\n }\r\n\r\n // Sprawdzenie sciezki zapisu\r\n String filePath = this.outputFileSelector.getPath();\r\n if(filePath.length() <= 5) {\r\n JOptionPane.showMessageDialog(this, \"Nie można zapisać wyniku w wybranej lokacji!\");\r\n return;\r\n }\r\n\r\n // Zapisujemy plik na dysk\r\n try{\r\n PrintWriter writer = new PrintWriter(filePath, \"UTF-8\");\r\n OutputDataFormatter odf = new OutputDataFormatter(this.outputData);\r\n\r\n String userPattern = this.outputFormatPanel.getPattern();\r\n writer.write(odf.getParsedString(userPattern.length() < 2 ? defaultFormatting : userPattern));\r\n\r\n writer.close();\r\n } catch (IOException e) {\r\n JOptionPane.showMessageDialog(this, \"Wystąpił błąd IO podczas zapisu.\");\r\n }\r\n\r\n }", "public Files files();", "boolean hasImagePath();", "File getDefaultFile();", "@Override\r\n\tpublic void additionalFuntion() {\n\t\tSystem.out.println(\"에디트 플러스에는 FTP 및 빌드 기능이 있습니다.\");\r\n\t}", "@Test\n public void filePathTest() {\n // TODO: test filePath\n }", "public void subir_file()\n {\n FileChooser fc = new FileChooser();\n\n fc.getExtensionFilters().addAll(new FileChooser.ExtensionFilter(\"PDF Files\",\"*.pdf\")\n , new FileChooser.ExtensionFilter(\"Jpg Images\",\"*.jpg\",\"*.JPEG\",\"*.JPG\",\"*.jpeg\",\"*.PNG\",\"*.png\"));\n\n File fileSelected = fc.showOpenDialog(null);\n\n if (fileSelected!= null){\n txt_ruta.setText(fileSelected.getPath());\n\n if(txt_ruta.getText().contains(\".pdf\"))\n {\n System.out.println(\"si es pdf\");\n Image image = new Image(\"/sample/Clases/pdf.png\");\n image_esquema.setImage(image);\n\n }\n else\n {\n File file = new File(txt_ruta.getText());\n javafx.scene.image.Image image = new Image(file.toURI().toString());\n image_esquema.setImage(image);\n }\n\n }\n else{\n System.out.println(\"no se seleccinoó\");\n }\n }", "public static void main(String[] args) throws IOException {\n HttpPageExtractor httpPageExtractor = new HttpPageExtractor();\n Page page = httpPageExtractor.extractPage(\"http://www.obrazki.org/upload/ob_0_33793200_1306404375.JPEG\");\n // new BufferedWriter(new FileWriter(new File(\"C:\\\\Users\\\\Jaras\\\\Desktop\\\\Temporary\\\\obrazek.jpeg\")))\n //Files.write(Paths.get(\"C:\\\\Users\\\\Jaras\\\\Desktop\\\\Temporary\\\\obraze.png\"), page.getBody().getBytes());\n try (InputStream in = URI.create(\"https://demotywatory.pl/uploads/201008/1282322197_by_MACTEP_600.jpg\").toURL().openStream()) {\n Files.copy(in, Paths.get(\"C:\\\\Users\\\\Jaras\\\\Desktop\\\\Temporary\\\\obrazek1.png\"));\n }\n }", "public interface IRasterFile{\r\n\t/**\r\n\t * Obtiene el Tamaño de cada fichero de que consta el raster en bytes. \r\n\t * @return long que representa el tamaño\r\n\t */\r\n\tpublic long[] getFileSize();\r\n\t/**\r\n\t * Obtiene el nombre de de cada fichero de que consta el raster. En caso de estar en disco\r\n\t * debe ofrecerse con la ruta completa.\r\n\t * @return Cadena con el nombre del fichero.\r\n\t */\r\n\tpublic String[] getFileName();\r\n\t/**\r\n\t * Obtiene el número de ficheros de que consta el raster.\r\n\t * @return Número de ficheros.\r\n\t */\r\n\tpublic int getFileCount();\r\n\t/**\r\n\t * Formato del fichero raster. Puede devolver la extensión correspondiente al\r\n\t * fichero\r\n\t * @return String que representa el formato\r\n\t */\r\n\tpublic String getFileFormat();\r\n}", "static void testFichier(String rep){\n\t\tFile f = new File(rep);\n\t\t\n\t\t// Si le rep existe\n\t\tif(f.exists()){\n\t\t\t// on prend le contenu du rep sous forme de liste\n\t\t\tString[] contenu = f.list();\n\t\t\t// on parcours les fichiers/dossiers\n\t\t\tfor(int i=0; i<contenu.length; i++)\n\t\t\t{\n\t\t\t\tFile f2 = new File(rep,contenu[i]);\n\t\t\t\t// si c'est un sous répertoire\n\t\t\t\tif(f2.isDirectory()){\n\t\t\t\t\t// on affiche le nom du rep\n\t\t\t\t\tSystem.out.println(\"Dossier \" + contenu[i]);\n\t\t\t\t\t// Et on parcours son contenu par récursivité\n\t\t\t\t\ttestFichier(rep+\"/\"+contenu[i]);\n\t\t\t\t}\n\t\t\t\t// si c'est un fichier\n\t\t\t\telse\n\t\t\t\t\t// on affiche son nom\n\t\t\t\t\tSystem.out.println(\"\\tFichier \" + contenu[i]);\n\t\t\t}\n\t\t}\n\t}", "public String getDefaultFilePattern();", "public void instalarTipoLetra()\r\n\t{\r\n\t\ttry\r\n { \r\n FileInputStream fIn = new FileInputStream(\"./images/dandelion in the spring.ttf\");\r\n FileOutputStream fOut = new FileOutputStream(\"C:/windows/fonts/dandelion in the spring.ttf\");\r\n \r\n FileChannel fIChan = fIn.getChannel();\r\n FileChannel fOChan = fOut.getChannel();\r\n \r\n long fSize = fIChan.size();\r\n \r\n MappedByteBuffer mBuf = \r\n fIChan.map(FileChannel.MapMode.READ_ONLY, 0, fSize); \r\n fOChan.write(mBuf);//con esto copiamos el archivo\r\n \r\n //nunca olvidemos cerrar los archivos\r\n fIChan.close();\r\n fIn.close();\r\n fOChan.close();\r\n fOut.close();\r\n JOptionPane.showMessageDialog(this,\"El tipo de letra ha sido instalada en el sistema operativo.\",\"Instalar Tipo Letra\", JOptionPane.INFORMATION_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/informacion.PNG\"));\r\n JOptionPane.showMessageDialog(this,\"Cierre el Sistema Experto - SESP y vuelva a iniciar el ejecutable.\",\"Instalar Tipo Letra\", JOptionPane.INFORMATION_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/informacion.PNG\"));\r\n }\r\n catch(Exception ef)\r\n {\r\n \tJOptionPane.showMessageDialog(this,\"Error al instalar el tipo de letra dandelion in the spring en el sistema operativo\",\"Error\", JOptionPane.ERROR_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/error.PNG\"));\r\n \tJOptionPane.showMessageDialog(this,\"Intente instalar manualmente el archivo (dandelion in the spring.ttf) que esta en la carpeta images o intente\"+\"\\n\"+\" copiar manualmente el archivo (dandelion in the spring.ttf) en el directorio C:/windows/fonts\",\"Error\", JOptionPane.ERROR_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/error.PNG\"));\r\n \t}\r\n\t}", "void setConfigFileName( String s );", "Path fileToUpload();", "String getFileExtension();", "public boolean isFile() { return true; }" ]
[ "0.5513576", "0.53826153", "0.53546745", "0.53510493", "0.5345537", "0.5238124", "0.51832074", "0.5161903", "0.5158369", "0.5152805", "0.5152211", "0.5149017", "0.5118898", "0.5118898", "0.5115913", "0.5107539", "0.51043314", "0.50984496", "0.5063698", "0.50571704", "0.5054993", "0.5036007", "0.49861705", "0.49821028", "0.49758047", "0.49570987", "0.49493742", "0.49449134", "0.49383593", "0.49383593", "0.49383593", "0.49381018", "0.4937883", "0.49368784", "0.49359867", "0.4928405", "0.492007", "0.4913052", "0.49117938", "0.4904055", "0.48841834", "0.48785466", "0.4874269", "0.4864867", "0.48597327", "0.48593646", "0.48586795", "0.48422927", "0.4841862", "0.48356462", "0.48225406", "0.4821967", "0.48178294", "0.48178294", "0.48154026", "0.48146632", "0.48008266", "0.47900495", "0.4789323", "0.47882605", "0.47846228", "0.4780419", "0.4778846", "0.47734168", "0.47684264", "0.4767891", "0.4767891", "0.4757404", "0.47550327", "0.47478458", "0.4747773", "0.47466275", "0.4735894", "0.4733388", "0.47261038", "0.47249433", "0.4722262", "0.47179067", "0.4717574", "0.4715845", "0.47154796", "0.47126183", "0.4709078", "0.4708683", "0.47077423", "0.47060227", "0.47005585", "0.46978173", "0.46971834", "0.46971467", "0.46963042", "0.46938613", "0.46871248", "0.46811527", "0.4678294", "0.46733707", "0.46718493", "0.4668513", "0.46608144", "0.4656529", "0.4650054" ]
0.0
-1
/WeCodeModel weCodeModel=new WeCodeModel(); WeClass weClass=weCodeModel.createClass("com.test.jc"); WeBlock clzBlock=weClass.body(); WeVar p1=clzBlock.declare(WeMod.PUBLIC,"","",""); p1.init(null); clzBlock.declare(WeMod.PUBLIC,"","",""); WeMethod weMethod=weClass.createMethod(WeMod.PUBLIC,"methodName"); WeBlock methodBlock=weMethod.body(); methodBlock.declare("","",""); weCodeModel.build();
public void main(){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void generateCode()\n {\n \n }", "public String _class_globals() throws Exception{\n_nativeme = new anywheresoftware.b4j.object.JavaObject();\n //BA.debugLineNum = 7;BA.debugLine=\"End Sub\";\nreturn \"\";\n}", "CodeType createCodeType();", "BOpMethod createBOpMethod();", "public String _class_globals() throws Exception{\n_abm = new com.ab.abmaterial.ABMaterial();\r\n //BA.debugLineNum = 4;BA.debugLine=\"End Sub\";\r\nreturn \"\";\r\n}", "public String getCode(ClassDecl cl)\r\n\t{\r\n\t\tString testcode = \"#Region \\\"Testing code generated by KawigiEdit\\\"\\n\";\r\n\t\ttestcode += \"Module MainModule\\n\";\r\n\t\ttestcode += \"\\tSub Main()\\n\";\r\n\t\tEditorDataType returnType = cl.getMethod().getReturnType();\r\n\t\ttestcode += \"\\t\\tDim Errors As Boolean = False\\n\";\r\n\t\ttestcode += \"\\t\\tDim Answer, DesiredAnswer As \" + EditorLanguage.VB.getName(returnType) + \"\\n\";\r\n\t\ttestcode += \"\\t\\tDim Obj As \" + cl.getName() + \"\\n\";\r\n\t\ttestcode += \"\\t\\tDim Time As DateTime\\n\";\r\n\t\tif (returnType.isArrayType())\r\n\t\t{\r\n\t\t\ttestcode += \"\\t\\tDim Same As Boolean\\n\";\r\n\t\t\ttestcode += \"\\t\\tDim i As Integer\\n\";\r\n\t\t}\r\n\t\tboolean stringType = returnType.isType(EditorDataType.String);\r\n\t\tEditorDataType[] paramTypes = cl.getMethod().getParamTypes();\r\n\t\ttestcode += \"\\t\\t<%:start-tests%>\\n\";\r\n\t\tfor (int i=0; i<cl.countTests(); i++)\r\n\t\t{\r\n\t\t\ttestcode += \"\\t\\tObj = New \" + cl.getName() + \"()\\n\";\r\n\t\t\ttestcode += \"\\t\\tTime = DateTime.Now\\n\";\r\n\t\t\ttestcode += \"\\t\\tAnswer = Obj.\" + cl.getMethod().getName() + \"(\" + toTest(cl.getTest(i).getParameters(), paramTypes) + \")\\n\";\r\n\t\t\ttestcode += \"\\t\\tConsole.WriteLine(\\\"Time: \\\" & (DateTime.Now.Subtract(Time)).TotalSeconds & \\\" seconds\\\")\\n\";\r\n\t\t\ttestcode += \"\\t\\tDesiredAnswer = \" + translateObject(returnType, cl.getTest(i).getAnswer()) + \"\\n\";\r\n\t\t\ttestcode += \"\\t\\tConsole.WriteLine(\\\"Your Answer:\\\")\\n\";\r\n\t\t\tif (returnType.isArrayType())\r\n\t\t\t{\r\n\t\t\t\ttestcode += \"\\t\\tConsole.Write(\\\"{ \\\")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tIf (Answer.Length > 0) Then\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tConsole.Write(\" + (stringType ? \"\\\"\\\"\\\"\\\" & \" : \"\") + \"Answer(0)\" + (stringType ? \" & \\\"\\\"\\\"\\\"\" : \"\") + \")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tFor i = 1 To Answer.Length - 1\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\t\\tConsole.Write(\\\"\\t, \" + (stringType ? \"\\\"\\\"\" : \"\") + \"\\\" & Answer(i)\" + (stringType ? \" & \\\"\\\"\\\"\\\"\" : \"\") + \")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tNext\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tConsole.WriteLine(\\\" }\\\")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tElse\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tConsole.WriteLine(\\\"}\\\")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tEnd If\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tConsole.WriteLine(\\\"Desired Answer:\\\")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tConsole.Write(\\\"{ \\\")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tIf (DesiredAnswer.Length > 0) Then\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tConsole.Write(\" + (stringType ? \"\\\"\\\"\\\"\\\" & \" : \"\") + \"DesiredAnswer(0)\" + (stringType ? \" & \\\"\\\"\\\"\\\"\" : \"\") + \")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tFor i = 1 To DesiredAnswer.Length - 1\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\t\\tConsole.Write(\\\", \" + (stringType ? \"\\\"\\\"\" : \"\") + \"\\\" & DesiredAnswer(i)\" + (stringType ? \" & \\\"\\\"\\\"\\\"\" : \"\") + \")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tNext\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tConsole.WriteLine(\\\" }\\\")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tElse\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tConsole.WriteLine(\\\"}\\\")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tEnd If\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tSame = (Answer.Length = DesiredAnswer.Length)\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tIf (Same)\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tFor i = 0 To DesiredAnswer.Length - 1\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\t\\tIf Answer(i) <> DesiredAnswer(i) Then\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\t\\t\\tSame = False\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\t\\tEnd If\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tNext\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tEnd If\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tIf Same Then\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tConsole.WriteLine(\\\"Match :-)\\\")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tElse\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tConsole.WriteLine(\\\"DOESN'T MATCH!!!!\\\")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tErrors = True\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tEnd If\\n\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ttestcode += \"\\t\\tConsole.WriteLine(\\\"\\t\" + (stringType ? \"\\\"\\\"\" : \"\") + \"\\\" & Answer\" + (stringType ? \" & \\\"\\\"\\\"\\\"\" : \"\") + \")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tConsole.WriteLine(\\\"Desired Answer:\\\")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tConsole.WriteLine(\\\"\\t\" + (stringType ? \"\\\"\\\"\" : \"\") +\"\\\" & DesiredAnswer\" + (stringType ? \" & \\\"\\\"\\\"\\\"\" : \"\") + \")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tIf Answer = DesiredAnswer Then\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tConsole.WriteLine(\\\"Match :-)\\\")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tElse\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tConsole.WriteLine(\\\"DOESN'T MATCH!!!!\\\")\\n\";\r\n\t\t\t\ttestcode += \"\\t\\t\\tErrors = True\\n\";\r\n\t\t\t\ttestcode += \"\\t\\tEnd If\\n\";\r\n\t\t\t}\r\n\t\t\ttestcode += \"\\t\\tConsole.WriteLine()\\n\";\r\n\t\t}\r\n\t\ttestcode += \"\\t\\t<%:end-tests%>\\n\";\r\n\t\ttestcode += \"\\t\\t\\n\\t\\tIf Errors Then\\n\";\r\n\t\ttestcode += \"\\t\\t\\tConsole.WriteLine(\\\"Some of the test cases had errors :-(\\\")\\n\";\r\n\t\ttestcode += \"\\t\\tElse\\n\";\r\n\t\ttestcode += \"\\t\\t\\tConsole.WriteLine(\\\"You're a stud (at least on the test data)! :-D \\\")\\n\";\r\n\t\ttestcode += \"\\t\\tEnd If\\n\";\r\n\t\ttestcode += \"\\tEnd Sub\\n\";\r\n\t\ttestcode += \"End Module\\n\";\r\n\t\ttestcode += \"#End Region\\n\";\r\n\t\treturn testcode;\r\n\t}", "CodeBlock createCodeBlock();", "public void build() throws HelperCodeException {\n MethodNode constructorNode = null;\n if(!TypeUtil.isAccess(methodNode.access, Opcodes.ACC_STATIC) && !methodNode.name.contains(\"<init>\")) {\n //1. make instance for the instance of the class\n //ClassNode classNode = TypeTableBuilder.getMethodClassNode(methodNode);\n if(!ClassNodeUtil.isClassNodeBuilderable(classNode))\n throw new HelperCodeException(\"not able to build classNode\");\n constructorNode = ClassNodeUtil.getSimpleConstructor(classNode);\n if(constructorNode != null) {\n String classname = classNode.name.substring(classNode.name.lastIndexOf(\".\") + 1);\n classname = classname.substring(classname.lastIndexOf(\"/\") + 1);\n String stmt = makeNewVoidConstructorStmt(classname, \"c\");//fixme\n if(!TypeUtil.isAccess(constructorNode.access, Opcodes.ACC_PUBLIC))\n throw new HelperCodeException(\"classnode is non-public\");\n addImport(classNode.name);\n stmts.add(stmt);\n } else\n throw new HelperCodeException(\"unable to found a classnode constructor\");\n } else {\n //what if the method is static\n\n //what if it\n }\n\n for (Type pt : Type.getMethodType(methodNode.desc).getArgumentTypes()) {\n //fixme, only support primitive and string object now.\n int sort = pt.getSort();\n if (sort > Type.DOUBLE) {\n if (sort == Type.OBJECT) {\n //if it is in standard library\n HelperMethod item = null;\n if(TypeUtil.isStandardLibrary(pt.getClassName())) {\n item = StandardLibraryClasses.getHelper(pt);\n //fixme for instance helper\n } else {\n item = InstanceHelperClasses.getInstanceHelper(pt);\n }\n\n if (item != null) {\n Type methodType = Type.getMethodType(item.desc);\n methodArguments.add(methodType);\n methods.add(item);\n continue;\n }\n }\n //fixme\n InstanceHelperBuilder.addunsuported(pt);\n throw new HelperCodeException(\"doesn't support this type now\");\n } else\n methodArguments.add(pt);\n }\n\n int number_of_string_arg = 0;\n for(Type t: methodArguments) {\n if(t.getSort() == Type.METHOD) {\n for(Type mt: t.getArgumentTypes()) {\n if(mt.getSort() == Type.OBJECT)\n number_of_string_arg += 1;\n }\n }\n if(t.getSort() == Type.OBJECT)\n number_of_string_arg += 1;\n }\n if(number_of_string_arg > 1) {\n //is_args_valid_for_building = false;\n throw new HelperCodeException(\"fail to build argument\");\n }\n\n if(number_of_string_arg == 1) {\n this.isFileString = true;\n }\n\n System.out.println(\"The size of the stmts in build, before methodArgument: \" + stmts.size());\n makeMethodBody(methodArguments);\n }", "public void enterModelComponent(ProgramElement pe) {\n/* 35 */ ModelRepository mr = DefaultModelRepository.getModelRepository(null);\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 51 */ CodeStripe cs = mr.getCurrentStripe();\n/* 52 */ if (cs != null) {\n/* 53 */ MethodReference metr = (MethodReference)pe;\n/* 54 */ Method mmmm = ReferenceConverter.getMethod(metr);\n/* 55 */ Location loc = new Location(mr.getCurrentFile());\n/* 56 */ Call call = mr.addCall(mmmm, mmmm, cs);\n/* 57 */ loc.setStartLine(metr.getFirstElement().getStartPosition().getLine());\n/* 58 */ loc.setStartChar(metr.getFirstElement().getStartPosition().getColumn());\n/* 59 */ loc.setEndLine(metr.getLastElement().getEndPosition().getLine());\n/* 60 */ loc.setEndChar(metr.getLastElement().getEndPosition().getColumn());\n/* 61 */ call.addInstance(cs.getRelPosOf(loc));\n/* */ } \n/* */ }", "Build_Model() {\n\n }", "public void genCode(CodeFile code) {\n\t\t\n\t}", "public Code() {\n\t}", "public void mo9137b() {\n }", "private CodeRef() {\n }", "public static void main (String[] args) {import java.util.*;%>\n//&&&staticSymbol&&&<%import org.eclipse.emf.codegen.ecore.genmodel.*;%>\n//&&&staticSymbol&&&<%\n\n/**\n * Copyright (c) 2002-2010 IBM Corporation and others.\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http://www.eclipse.org/legal/epl-v10.html\n *\n * Contributors:\n * IBM - Initial API and implementation\n */\n\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\nGenPackage genPackage = (GenPackage)((Object[])argument)[0]; GenModel genModel=genPackage.getGenModel(); /* Trick to import java.util.* without warnings */Iterator.class.getName();\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\nboolean isInterface = Boolean.TRUE.equals(((Object[])argument)[1]); boolean isImplementation = Boolean.TRUE.equals(((Object[])argument)[2]);\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\nString publicStaticFinalFlag = isImplementation ? \"public static final \" : \"\";\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%include(\"../Header.javajetinc\");%>\n//&&&staticSymbol&&&<%\nif (isInterface || genModel.isSuppressInterfaces()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&package <%\n//&&&staticSymbol&&&=genPackage.getReflectionPackageName()\n//&&&staticSymbol&&&%>;\n//&&&staticSymbol&&&<%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&package <%\n//&&&staticSymbol&&&=genPackage.getClassPackageName()\n//&&&staticSymbol&&&%>;\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&<%\nif (isImplementation) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\ngenModel.addPseudoImport(\"org.eclipse.emf.ecore.impl.MinimalEObjectImpl.Container\");\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\ngenModel.addPseudoImport(\"org.eclipse.emf.ecore.impl.MinimalEObjectImpl.Container.Dynamic\");\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\ngenModel.addImport(\"org.eclipse.emf.ecore.EClass\");\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\ngenModel.addImport(\"org.eclipse.emf.ecore.EObject\");\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\nif (!genPackage.hasJavaLangConflict() && !genPackage.hasInterfaceImplConflict() && !genPackage.getClassPackageName().equals(genPackage.getInterfacePackageName())) genModel.addImport(genPackage.getInterfacePackageName() + \".*\");\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\ngenModel.markImportLocation(stringBuffer);\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&<%\nif (isInterface) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&/**\n//&&&staticSymbol&&& * <!-- begin-user-doc -->\n//&&&staticSymbol&&& * The <b>Factory</b> for the model.\n//&&&staticSymbol&&& * It provides a create method for each non-abstract class of the model.\n//&&&staticSymbol&&& * <!-- end-user-doc -->\n//&&&staticSymbol&&&<%\nif (!genModel.isSuppressEMFMetaData()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& * @see <%\n//&&&staticSymbol&&&=genPackage.getQualifiedPackageInterfaceName()\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& * @generated\n//&&&staticSymbol&&& */\n//&&&staticSymbol&&&<%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&/**\n//&&&staticSymbol&&& * <!-- begin-user-doc -->\n//&&&staticSymbol&&& * An implementation of the model <b>Factory</b>.\n//&&&staticSymbol&&& * <!-- end-user-doc -->\n//&&&staticSymbol&&& * @generated\n//&&&staticSymbol&&& */\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\nif (isImplementation) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&public class <%\n//&&&staticSymbol&&&=genPackage.getFactoryClassName()\n//&&&staticSymbol&&&%> extends <%\n//&&&staticSymbol&&&=genModel.getImportedName(\"org.eclipse.emf.ecore.impl.EFactoryImpl\")\n//&&&staticSymbol&&&%><%\nif (!genModel.isSuppressInterfaces()) {\n//&&&staticSymbol&&&%> implements <%\n//&&&staticSymbol&&&=genPackage.getImportedFactoryInterfaceName()\n//&&&staticSymbol&&&%><%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&public interface <%\n//&&&staticSymbol&&&=genPackage.getFactoryInterfaceName()\n//&&&staticSymbol&&&%><%\nif (!genModel.isSuppressEMFMetaData()) {\n//&&&staticSymbol&&&%> extends <%\n//&&&staticSymbol&&&=genModel.getImportedName(\"org.eclipse.emf.ecore.EFactory\")\n//&&&staticSymbol&&&%><%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&{\n//&&&staticSymbol&&&<%\nif (genModel.hasCopyrightField()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&&\t<%\n//&&&staticSymbol&&&=publicStaticFinalFlag\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.lang.String\")\n//&&&staticSymbol&&&%> copyright = <%\n//&&&staticSymbol&&&=genModel.getCopyrightFieldLiteral()\n//&&&staticSymbol&&&%>;<%\n//&&&staticSymbol&&&=genModel.getNonNLS()\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\nif (isImplementation && (genModel.isSuppressEMFMetaData() || genModel.isSuppressInterfaces())) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * The singleton instance of the factory.\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&&\t<%\n//&&&staticSymbol&&&=publicStaticFinalFlag\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genPackage.getFactoryClassName()\n//&&&staticSymbol&&&%> eINSTANCE = init();\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\nif (isInterface && genModel.isSuppressEMFMetaData()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * The singleton instance of the factory.\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&&\t<%\n//&&&staticSymbol&&&=publicStaticFinalFlag\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genPackage.getFactoryInterfaceName()\n//&&&staticSymbol&&&%> INSTANCE = <%\n//&&&staticSymbol&&&=genPackage.getQualifiedFactoryClassName()\n//&&&staticSymbol&&&%>.eINSTANCE;\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&<%\n} else if (isInterface && !genModel.isSuppressInterfaces()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * The singleton instance of the factory.\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&&\t<%\n//&&&staticSymbol&&&=publicStaticFinalFlag\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genPackage.getFactoryInterfaceName()\n//&&&staticSymbol&&&%> eINSTANCE = <%\n//&&&staticSymbol&&&=genPackage.getQualifiedFactoryClassName()\n//&&&staticSymbol&&&%>.init();\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\nif (isImplementation) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * Creates the default factory implementation.\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&&<%\nString factoryType = genModel.isSuppressEMFMetaData() ? genPackage.getFactoryClassName() : genPackage.getImportedFactoryInterfaceName();\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\tpublic static <%\n//&&&staticSymbol&&&=factoryType\n//&&&staticSymbol&&&%> init()\n//&&&staticSymbol&&&\t{\n//&&&staticSymbol&&&\t\ttry\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&&\t\t\t<%\n//&&&staticSymbol&&&=factoryType\n//&&&staticSymbol&&&%> the<%\n//&&&staticSymbol&&&=genPackage.getFactoryName()\n//&&&staticSymbol&&&%> = (<%\n//&&&staticSymbol&&&=factoryType\n//&&&staticSymbol&&&%>)<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"org.eclipse.emf.ecore.EPackage\")\n//&&&staticSymbol&&&%>.Registry.INSTANCE.getEFactory(<%\n//&&&staticSymbol&&&=genPackage.getPackageInterfaceName()\n//&&&staticSymbol&&&%>.eNS_URI);\n//&&&staticSymbol&&&\t\t\tif (the<%\n//&&&staticSymbol&&&=genPackage.getFactoryName()\n//&&&staticSymbol&&&%> != null)\n//&&&staticSymbol&&&\t\t\t{\n//&&&staticSymbol&&&\t\t\t\treturn the<%\n//&&&staticSymbol&&&=genPackage.getFactoryName()\n//&&&staticSymbol&&&%>;\n//&&&staticSymbol&&&\t\t\t}\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&&\t\tcatch (Exception exception)\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&&\t\t\t<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"org.eclipse.emf.ecore.plugin.EcorePlugin\")\n//&&&staticSymbol&&&%>.INSTANCE.log(exception);\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&&\t\treturn new <%\n//&&&staticSymbol&&&=genPackage.getImportedFactoryClassName()\n//&&&staticSymbol&&&%>();\n//&&&staticSymbol&&&\t}\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * Creates an instance of the factory.\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&&\tpublic <%\n//&&&staticSymbol&&&=genPackage.getFactoryClassName()\n//&&&staticSymbol&&&%>()\n//&&&staticSymbol&&&\t{\n//&&&staticSymbol&&&\t\tsuper();\n//&&&staticSymbol&&&\t}\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&& <%\nif (genModel.useClassOverrideAnnotation()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t@Override\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\tpublic EObject create(EClass eClass)\n//&&&staticSymbol&&&\t{\n//&&&staticSymbol&&&\t\tswitch (eClass.getClassifierID())\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&&<%\nfor (GenClass genClass : genPackage.getGenClasses()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\nif (!genClass.isAbstract()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tcase <%\n//&&&staticSymbol&&&=genPackage.getImportedPackageInterfaceName()\n//&&&staticSymbol&&&%>.<%\n//&&&staticSymbol&&&=genClass.getClassifierID()\n//&&&staticSymbol&&&%>: return <%\n//&&&staticSymbol&&&*%%storeSymbol%%*0\n//&&&staticSymbol&&&%>create<%\n//&&&staticSymbol&&&=genClass.getName()\n//&&&staticSymbol&&&%>();\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tdefault:\n//&&&staticSymbol&&&\t\t\t\tthrow new IllegalArgumentException(\"The class '\" + eClass.getName() + \"' is not a valid classifier\");<%\n//&&&staticSymbol&&&=genModel.getNonNLS()\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genModel.getNonNLS(2)\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&&\t}\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&<%\nif (!genPackage.getAllGenDataTypes().isEmpty()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&& <%\nif (genModel.useClassOverrideAnnotation()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t@Override\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\tpublic Object createFromString(<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"org.eclipse.emf.ecore.EDataType\")\n//&&&staticSymbol&&&%> eDataType, String initialValue)\n//&&&staticSymbol&&&\t{\n//&&&staticSymbol&&&\t\tswitch (eDataType.getClassifierID())\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&&<%\nfor (GenDataType genDataType : genPackage.getAllGenDataTypes()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genDataType.isSerializable()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tcase <%\n//&&&staticSymbol&&&=genPackage.getImportedPackageInterfaceName()\n//&&&staticSymbol&&&%>.<%\n//&&&staticSymbol&&&=genDataType.getClassifierID()\n//&&&staticSymbol&&&%>:\n//&&&staticSymbol&&&\t\t\t\treturn create<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>FromString(eDataType, initialValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tdefault:\n//&&&staticSymbol&&&\t\t\t\tthrow new IllegalArgumentException(\"The datatype '\" + eDataType.getName() + \"' is not a valid classifier\");<%\n//&&&staticSymbol&&&=genModel.getNonNLS()\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genModel.getNonNLS(2)\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&&\t}\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&& <%\nif (genModel.useClassOverrideAnnotation()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t@Override\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\tpublic String convertToString(<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"org.eclipse.emf.ecore.EDataType\")\n//&&&staticSymbol&&&%> eDataType, Object instanceValue)\n//&&&staticSymbol&&&\t{\n//&&&staticSymbol&&&\t\tswitch (eDataType.getClassifierID())\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&&<%\nfor (GenDataType genDataType : genPackage.getAllGenDataTypes()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genDataType.isSerializable()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tcase <%\n//&&&staticSymbol&&&=genPackage.getImportedPackageInterfaceName()\n//&&&staticSymbol&&&%>.<%\n//&&&staticSymbol&&&=genDataType.getClassifierID()\n//&&&staticSymbol&&&%>:\n//&&&staticSymbol&&&\t\t\t\treturn convert<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>ToString(eDataType, instanceValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tdefault:\n//&&&staticSymbol&&&\t\t\t\tthrow new IllegalArgumentException(\"The datatype '\" + eDataType.getName() + \"' is not a valid classifier\");<%\n//&&&staticSymbol&&&=genModel.getNonNLS()\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genModel.getNonNLS(2)\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&&\t}\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\nfor (GenClass genClass : genPackage.getGenClasses()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (!genClass.isAbstract()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&&\tpublic <%\n//&&&staticSymbol&&&=genClass.getTypeParameters()\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genClass.getImportedInterfaceName()\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genClass.getInterfaceTypeArguments()\n//&&&staticSymbol&&&%> create<%\n//&&&staticSymbol&&&=genClass.getName()\n//&&&staticSymbol&&&%>()\n//&&&staticSymbol&&&\t{\n//&&&staticSymbol&&& <%\nif (genClass.isDynamic()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t<%\n//&&&staticSymbol&&&=genClass.getImportedInterfaceName()\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genClass.getInterfaceTypeArguments()\n//&&&staticSymbol&&&%> <%\n//&&&staticSymbol&&&=genClass.getSafeUncapName()\n//&&&staticSymbol&&&%> = <%\n//&&&staticSymbol&&&=genClass.getCastFromEObject()\n//&&&staticSymbol&&&%>super.create(<%\n//&&&staticSymbol&&&=genClass.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t<%\n//&&&staticSymbol&&&=genClass.getImportedClassName()\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genClass.getClassTypeArguments()\n//&&&staticSymbol&&&%> <%\n//&&&staticSymbol&&&=genClass.getSafeUncapName()\n//&&&staticSymbol&&&%> = new <%\n//&&&staticSymbol&&&=genClass.getImportedClassName()\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genClass.getClassTypeArguments()\n//&&&staticSymbol&&&%>()<%\nif (genModel.isSuppressInterfaces() && !genPackage.getReflectionPackageName().equals(genPackage.getInterfacePackageName())) {\n//&&&staticSymbol&&&%>{}<%\n}\n//&&&staticSymbol&&&%>;\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn <%\n//&&&staticSymbol&&&=genClass.getSafeUncapName()\n//&&&staticSymbol&&&%>;\n//&&&staticSymbol&&&\t}\n//&&&staticSymbol&&&\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\nfor (GenDataType genDataType : genPackage.getAllGenDataTypes()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genDataType.isSerializable()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\nif (genPackage.isDataTypeConverters() || genDataType.hasCreatorBody()) { String eDataType = genDataType.getQualifiedClassifierAccessor();\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&& <%\nif (genModel.useGenerics() && genDataType.isUncheckedCast() && !genDataType.hasCreatorBody()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t@SuppressWarnings(\"unchecked\")\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\tpublic <%\n//&&&staticSymbol&&&=genDataType.getImportedParameterizedInstanceClassName()\n//&&&staticSymbol&&&%> create<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>(<%\nif (genDataType.hasCreatorBody()) {\n//&&&staticSymbol&&&%>final <%\n}\n//&&&staticSymbol&&&%>String <%\nif (genDataType.hasCreatorBody()) {\n//&&&staticSymbol&&&%>it<%\n} else {\n//&&&staticSymbol&&&%>literal<%\n}\n//&&&staticSymbol&&&%>)\n//&&&staticSymbol&&&\t{\n//&&&staticSymbol&&& <%\nif (genDataType.hasCreatorBody()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t<%\n//&&&staticSymbol&&&=genDataType.getCreatorBody(genModel.getIndentation(stringBuffer))\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else if (genDataType instanceof GenEnum) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t<%\n//&&&staticSymbol&&&=genDataType.getImportedInstanceClassName()\n//&&&staticSymbol&&&%> result = <%\n//&&&staticSymbol&&&=genDataType.getImportedInstanceClassName()\n//&&&staticSymbol&&&%>.get(literal);\n//&&&staticSymbol&&&\t\tif (result == null) throw new IllegalArgumentException(\"The value '\" + literal + \"' is not a valid enumerator of '\" + <%\n//&&&staticSymbol&&&=eDataType\n//&&&staticSymbol&&&%>.getName() + \"'\");<%\n//&&&staticSymbol&&&=genModel.getNonNLS()\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genModel.getNonNLS(2)\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genModel.getNonNLS(3)\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn result;\n//&&&staticSymbol&&& <%\n} else if (genDataType.getBaseType() != null) { GenDataType genBaseType = genDataType.getBaseType(); boolean isPrimitiveConversion = !genDataType.isPrimitiveType() && genBaseType.isPrimitiveType();\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genBaseType.getGenPackage() == genPackage) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (isPrimitiveConversion && genModel.getComplianceLevel().getValue() < GenJDKLevel.JDK50) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn new <%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>(create<%\n//&&&staticSymbol&&&=genBaseType.getName()\n//&&&staticSymbol&&&%>(literal));\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn create<%\n//&&&staticSymbol&&&=genBaseType.getName()\n//&&&staticSymbol&&&%>(literal);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else if (genBaseType.getGenPackage().isDataTypeConverters()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (isPrimitiveConversion && genModel.getComplianceLevel().getValue() < GenJDKLevel.JDK50) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn new <%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>(<%\n//&&&staticSymbol&&&=genBaseType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.create<%\n//&&&staticSymbol&&&=genBaseType.getName()\n//&&&staticSymbol&&&%>(literal));\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn <%\n//&&&staticSymbol&&&=genBaseType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.create<%\n//&&&staticSymbol&&&=genBaseType.getName()\n//&&&staticSymbol&&&%>(literal);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn <%\nif (!genDataType.isObjectType()) {\n//&&&staticSymbol&&&%>(<%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>)<%\n}\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genBaseType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.createFromString(<%\n//&&&staticSymbol&&&=genBaseType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, literal);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else if (genDataType.getItemType() != null) { GenDataType genItemType = genDataType.getItemType(); \n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tif (literal == null) return null;\n//&&&staticSymbol&&&\t\t<%\n//&&&staticSymbol&&&=genDataType.getImportedParameterizedInstanceClassName()\n//&&&staticSymbol&&&%> result = new <%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.util.ArrayList\")\n//&&&staticSymbol&&&%><%\nif (genModel.useGenerics()) {\n//&&&staticSymbol&&&%><<%=genItemType.getObjectType().getImportedParameterizedInstanceClassName()%>><%\n}\n//&&&staticSymbol&&&%>();\n//&&&staticSymbol&&& <%\nif (genModel.getRuntimeVersion().getValue() < GenRuntimeVersion.EMF26_VALUE) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tfor (<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.util.StringTokenizer\")\n//&&&staticSymbol&&&%> stringTokenizer = new <%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.util.StringTokenizer\")\n//&&&staticSymbol&&&%>(literal); stringTokenizer.hasMoreTokens(); )\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tfor (String item : split(literal))\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&& <%\nif (genModel.getRuntimeVersion().getValue() < GenRuntimeVersion.EMF26_VALUE) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tString item = stringTokenizer.nextToken();\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genItemType.getGenPackage() == genPackage) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genPackage.isDataTypeConverters()) { genItemType = genItemType.getObjectType();\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult.add(create<%\n//&&&staticSymbol&&&=genItemType.getName()\n//&&&staticSymbol&&&%>(item));\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult.add(create<%\n//&&&staticSymbol&&&=genItemType.getName()\n//&&&staticSymbol&&&%>FromString(<%\n//&&&staticSymbol&&&=genItemType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, item));\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genItemType.getGenPackage().isDataTypeConverters()) { genItemType = genItemType.getObjectType();\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult.add(<%\n//&&&staticSymbol&&&=genItemType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.create<%\n//&&&staticSymbol&&&=genItemType.getName()\n//&&&staticSymbol&&&%>(item));\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult.add(<%\n//&&&staticSymbol&&&=genItemType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.createFromString(<%\n//&&&staticSymbol&&&=genItemType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, item));\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&&\t\treturn result;\n//&&&staticSymbol&&& <%\n} else if (!genDataType.getMemberTypes().isEmpty()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tif (literal == null) return <%\n//&&&staticSymbol&&&=genDataType.getStaticValue(null)\n//&&&staticSymbol&&&%>;\n//&&&staticSymbol&&&\t\t<%\n//&&&staticSymbol&&&=genDataType.getImportedInstanceClassName()\n//&&&staticSymbol&&&%> result = <%\n//&&&staticSymbol&&&=genDataType.getStaticValue(null)\n//&&&staticSymbol&&&%>;\n//&&&staticSymbol&&&\t\tRuntimeException exception = null;\n//&&&staticSymbol&&& <%\nfor (GenDataType genMemberType : genDataType.getMemberTypes()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\ttry\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&& <%\nif (genMemberType.getGenPackage() == genPackage) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genPackage.isDataTypeConverters()) { if (!genDataType.isPrimitiveType()) genMemberType = genMemberType.getObjectType();\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult = create<%\n//&&&staticSymbol&&&=genMemberType.getName()\n//&&&staticSymbol&&&%>(literal);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult = (<%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>)create<%\n//&&&staticSymbol&&&=genMemberType.getName()\n//&&&staticSymbol&&&%>FromString(<%\n//&&&staticSymbol&&&=genMemberType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, literal);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genPackage.isDataTypeConverters()) { if (!genDataType.isPrimitiveType()) genMemberType = genMemberType.getObjectType();\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult = <%\n//&&&staticSymbol&&&=genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.create<%\n//&&&staticSymbol&&&=genMemberType.getName()\n//&&&staticSymbol&&&%>(literal);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult = (<%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>)<%\n//&&&staticSymbol&&&=genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.createFromString(<%\n//&&&staticSymbol&&&=genMemberType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, literal);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tif (<%\nif (!genDataType.isPrimitiveType()) {\n//&&&staticSymbol&&&%>result != null && <%\n}\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genModel.getImportedName(\"org.eclipse.emf.ecore.util.Diagnostician\")\n//&&&staticSymbol&&&%>.INSTANCE.validate(<%\n//&&&staticSymbol&&&=eDataType\n//&&&staticSymbol&&&%>, <%\nif (genDataType.isPrimitiveType() && genModel.getComplianceLevel().getValue() < GenJDKLevel.JDK50) {\n//&&&staticSymbol&&&%>new <%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>(result)<%\n} else {\n//&&&staticSymbol&&&%>result<%\n}\n//&&&staticSymbol&&&%>, null, null))\n//&&&staticSymbol&&&\t\t\t{\n//&&&staticSymbol&&&\t\t\t\treturn result;\n//&&&staticSymbol&&&\t\t\t}\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&&\t\tcatch (RuntimeException e)\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&&\t\t\texception = e;\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tif (<%\nif (!genDataType.isPrimitiveType()) {\n//&&&staticSymbol&&&%>result != null || <%\n}\n//&&&staticSymbol&&&%>exception == null) return result;\n//&&&staticSymbol&&& \n//&&&staticSymbol&&&\t\tthrow exception;\n//&&&staticSymbol&&& <%\n} else if (!genDataType.hasConversionDelegate() && genModel.useGenerics() && (genDataType.isArrayType() || !genDataType.getEcoreDataType().getETypeParameters().isEmpty() || genDataType.getEcoreDataType().getInstanceTypeName().contains(\"<\"))) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn (<%\n//&&&staticSymbol&&&=genDataType.getImportedParameterizedObjectInstanceClassName()\n//&&&staticSymbol&&&%>)super.createFromString(literal);\n//&&&staticSymbol&&& <%\n} else if (!genDataType.hasConversionDelegate() && genDataType.isArrayType()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t// TODO: implement this method\n//&&&staticSymbol&&&\t\t// Ensure that you remove @generated or mark it @generated NOT\n//&&&staticSymbol&&&\t\tthrow new <%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.lang.UnsupportedOperationException\")\n//&&&staticSymbol&&&%>();\n//&&&staticSymbol&&& <%\n} else if (genDataType.isPrimitiveType() && genModel.getComplianceLevel().getValue() < GenJDKLevel.JDK50) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn ((<%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>)super.createFromString(<%\n//&&&staticSymbol&&&=eDataType\n//&&&staticSymbol&&&%>, literal)).<%\n//&&&staticSymbol&&&=genDataType.getPrimitiveValueFunction()\n//&&&staticSymbol&&&%>();\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn <%\nif (!genDataType.isObjectType()) {\n//&&&staticSymbol&&&%>(<%\n//&&&staticSymbol&&&=genDataType.getImportedParameterizedObjectInstanceClassName()\n//&&&staticSymbol&&&%>)<%\n}\n//&&&staticSymbol&&&%>super.createFromString(<%\n//&&&staticSymbol&&&=eDataType\n//&&&staticSymbol&&&%>, literal);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t}\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&& <%\nif (!genPackage.isDataTypeConverters() && genModel.useGenerics() && genDataType.isUncheckedCast() && !genDataType.hasCreatorBody()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t@SuppressWarnings(\"unchecked\")\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\tpublic <%\n//&&&staticSymbol&&&=genDataType.getImportedParameterizedObjectInstanceClassName()\n//&&&staticSymbol&&&%> create<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>FromString(<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"org.eclipse.emf.ecore.EDataType\")\n//&&&staticSymbol&&&%> eDataType, String initialValue)\n//&&&staticSymbol&&&\t{\n//&&&staticSymbol&&& <%\nif (genDataType instanceof GenEnum) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genPackage.isDataTypeConverters() || genDataType.hasCreatorBody()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn create<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>(initialValue);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t<%\n//&&&staticSymbol&&&=((GenEnum)genDataType).getImportedInstanceClassName()\n//&&&staticSymbol&&&%> result = <%\n//&&&staticSymbol&&&=((GenEnum)genDataType).getImportedInstanceClassName()\n//&&&staticSymbol&&&%>.get(initialValue);\n//&&&staticSymbol&&&\t\tif (result == null) throw new IllegalArgumentException(\"The value '\" + initialValue + \"' is not a valid enumerator of '\" + eDataType.getName() + \"'\");<%\n//&&&staticSymbol&&&=genModel.getNonNLS()\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genModel.getNonNLS(2)\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genModel.getNonNLS(3)\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn result;\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else if (genDataType.getBaseType() != null) { GenDataType genBaseType = genDataType.getBaseType(); \n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genBaseType.getGenPackage() == genPackage) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn <%\nif (!genDataType.getObjectInstanceClassName().equals(genBaseType.getObjectInstanceClassName())) {\n//&&&staticSymbol&&&%>(<%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>)<%\n}\n//&&&staticSymbol&&&%>create<%\n//&&&staticSymbol&&&=genBaseType.getName()\n//&&&staticSymbol&&&%>FromString(<%\n//&&&staticSymbol&&&=genBaseType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, initialValue);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn <%\nif (!genDataType.isObjectType()) {\n//&&&staticSymbol&&&%>(<%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>)<%\n}\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genBaseType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.createFromString(<%\n//&&&staticSymbol&&&=genBaseType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, initialValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else if (genDataType.getItemType() != null) { GenDataType genItemType = genDataType.getItemType(); \n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genPackage.isDataTypeConverters()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn create<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>(initialValue);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tif (initialValue == null) return null;\n//&&&staticSymbol&&&\t\t<%\n//&&&staticSymbol&&&=genDataType.getImportedParameterizedObjectInstanceClassName()\n//&&&staticSymbol&&&%> result = new <%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.util.ArrayList\")\n//&&&staticSymbol&&&%><%\nif (genModel.useGenerics()) {\n//&&&staticSymbol&&&%><<%=genItemType.getObjectType().getImportedParameterizedInstanceClassName()%>><%\n}\n//&&&staticSymbol&&&%>();\n//&&&staticSymbol&&& <%\nif (genModel.getRuntimeVersion().getValue() < GenRuntimeVersion.EMF26_VALUE) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tfor (<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.util.StringTokenizer\")\n//&&&staticSymbol&&&%> stringTokenizer = new <%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.util.StringTokenizer\")\n//&&&staticSymbol&&&%>(initialValue); stringTokenizer.hasMoreTokens(); )\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tfor (String item : split(initialValue))\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&& <%\nif (genModel.getRuntimeVersion().getValue() < GenRuntimeVersion.EMF26_VALUE) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tString item = stringTokenizer.nextToken();\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genItemType.getGenPackage() == genPackage) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult.add(create<%\n//&&&staticSymbol&&&=genItemType.getName()\n//&&&staticSymbol&&&%>FromString(<%\n//&&&staticSymbol&&&=genItemType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, item));\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult.add(<%\nif (!genItemType.isObjectType()) {\n//&&&staticSymbol&&&%>(<%\n//&&&staticSymbol&&&=genItemType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>)<%\n}\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genItemType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.createFromString(<%\n//&&&staticSymbol&&&=genItemType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, item));\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&&\t\treturn result;\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else if (!genDataType.getMemberTypes().isEmpty()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genPackage.isDataTypeConverters()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genDataType.isPrimitiveType() && genModel.getComplianceLevel().getValue() < GenJDKLevel.JDK50) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn new <%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>(create<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>(initialValue));\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn create<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>(initialValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tif (initialValue == null) return null;\n//&&&staticSymbol&&&\t\t<%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%> result = null;\n//&&&staticSymbol&&&\t\tRuntimeException exception = null;\n//&&&staticSymbol&&& <%\nfor (GenDataType genMemberType : genDataType.getMemberTypes()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\ttry\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&& <%\nif (genMemberType.getGenPackage() == genPackage) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult = <%\nif (!genDataType.isObjectType() && !genDataType.getObjectInstanceClassName().equals(genMemberType.getObjectInstanceClassName())) {\n//&&&staticSymbol&&&%>(<%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>)<%\n}\n//&&&staticSymbol&&&%>create<%\n//&&&staticSymbol&&&=genMemberType.getName()\n//&&&staticSymbol&&&%>FromString(<%\n//&&&staticSymbol&&&=genMemberType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, initialValue);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult = <%\nif (!genDataType.isObjectType()) {\n//&&&staticSymbol&&&%>(<%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>)<%\n}\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.createFromString(<%\n//&&&staticSymbol&&&=genMemberType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, initialValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tif (result != null && <%\n//&&&staticSymbol&&&=genModel.getImportedName(\"org.eclipse.emf.ecore.util.Diagnostician\")\n//&&&staticSymbol&&&%>.INSTANCE.validate(eDataType, result, null, null))\n//&&&staticSymbol&&&\t\t\t{\n//&&&staticSymbol&&&\t\t\t\treturn result;\n//&&&staticSymbol&&&\t\t\t}\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&&\t\tcatch (RuntimeException e)\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&&\t\t\texception = e;\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tif (result != null || exception == null) return result;\n//&&&staticSymbol&&& \n//&&&staticSymbol&&&\t\tthrow exception;\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else if (genPackage.isDataTypeConverters() || genDataType.hasCreatorBody()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn create<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>(initialValue);\n//&&&staticSymbol&&& <%\n} else if (!genDataType.hasConversionDelegate() && genModel.useGenerics() && (genDataType.isArrayType() || !genDataType.getEcoreDataType().getETypeParameters().isEmpty() || genDataType.getEcoreDataType().getInstanceTypeName().contains(\"<\"))) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn <%\nif (!genDataType.isObjectType()) {\n//&&&staticSymbol&&&%>(<%\n//&&&staticSymbol&&&=genDataType.getImportedParameterizedObjectInstanceClassName()\n//&&&staticSymbol&&&%>)<%\n}\n//&&&staticSymbol&&&%>super.createFromString(initialValue);\n//&&&staticSymbol&&& <%\n} else if (!genDataType.hasConversionDelegate() && genDataType.isArrayType()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t// TODO: implement this method\n//&&&staticSymbol&&&\t\t// Ensure that you remove @generated or mark it @generated NOT\n//&&&staticSymbol&&&\t\tthrow new <%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.lang.UnsupportedOperationException\")\n//&&&staticSymbol&&&%>();\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn <%\nif (!genDataType.isObjectType()) {\n//&&&staticSymbol&&&%>(<%\n//&&&staticSymbol&&&=genDataType.getImportedParameterizedObjectInstanceClassName()\n//&&&staticSymbol&&&%>)<%\n}\n//&&&staticSymbol&&&%>super.createFromString(eDataType, initialValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t}\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&<%\nif (genPackage.isDataTypeConverters() || genDataType.hasConverterBody()) { String eDataType = genDataType.getQualifiedClassifierAccessor();\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&&\tpublic String convert<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>(<%\nif (genDataType.hasCreatorBody()) {\n//&&&staticSymbol&&&%>final <%\n}\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genDataType.getImportedBoundedWildcardInstanceClassName()\n//&&&staticSymbol&&&%> <%\nif (genDataType.hasConverterBody()) {\n//&&&staticSymbol&&&%>it<%\n} else {\n//&&&staticSymbol&&&%>instanceValue<%\n}\n//&&&staticSymbol&&&%>)\n//&&&staticSymbol&&&\t{\n//&&&staticSymbol&&& <%\nif (genDataType.hasConverterBody()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t<%\n//&&&staticSymbol&&&=genDataType.getConverterBody(genModel.getIndentation(stringBuffer))\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else if (genDataType instanceof GenEnum) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn instanceValue == null ? null : instanceValue.toString();\n//&&&staticSymbol&&& <%\n} else if (genDataType.getBaseType() != null) { GenDataType genBaseType = genDataType.getBaseType(); boolean isPrimitiveConversion = !genDataType.isPrimitiveType() && genBaseType.isPrimitiveType();\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genBaseType.getGenPackage() == genPackage) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (isPrimitiveConversion) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn instanceValue == null ? null : convert<%\n//&&&staticSymbol&&&=genBaseType.getName()\n//&&&staticSymbol&&&%>(instanceValue<%\nif (genModel.getComplianceLevel().getValue() < GenJDKLevel.JDK50) {\n//&&&staticSymbol&&&%>.<%\n//&&&staticSymbol&&&=genBaseType.getPrimitiveValueFunction()\n//&&&staticSymbol&&&%>()<%\n}\n//&&&staticSymbol&&&%>);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn convert<%\n//&&&staticSymbol&&&=genBaseType.getName()\n//&&&staticSymbol&&&%>(instanceValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else if (genBaseType.getGenPackage().isDataTypeConverters()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn <%\n//&&&staticSymbol&&&=genBaseType.getGenPackage().getQualifiedFactoryInstanceAccessor()\n//&&&staticSymbol&&&%>.convert<%\n//&&&staticSymbol&&&=genBaseType.getName()\n//&&&staticSymbol&&&%>(instanceValue);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn <%\n//&&&staticSymbol&&&=genBaseType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.convertToString(<%\n//&&&staticSymbol&&&=genBaseType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, instanceValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else if (genDataType.getItemType() != null) { GenDataType genItemType = genDataType.getItemType(); \n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tif (instanceValue == null) return null;\n//&&&staticSymbol&&&\t\tif (instanceValue.isEmpty()) return \"\";\n//&&&staticSymbol&&&\t\t<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.lang.StringBuffer\")\n//&&&staticSymbol&&&%> result = new <%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.lang.StringBuffer\")\n//&&&staticSymbol&&&%>();\n//&&&staticSymbol&&& <%\nString item; if (!genModel.useGenerics()) { item = \"i.next()\"; \n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tfor (<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.util.Iterator\")\n//&&&staticSymbol&&&%> i = instanceValue.iterator(); i.hasNext(); )\n//&&&staticSymbol&&& <%\n} else { item = \"item\";\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tfor (<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.lang.Object\")\n//&&&staticSymbol&&&%> item : instanceValue)\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&& <%\nif (genItemType.getGenPackage() == genPackage) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genPackage.isDataTypeConverters()) { genItemType = genItemType.getObjectType();\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult.append(convert<%\n//&&&staticSymbol&&&=genItemType.getName()\n//&&&staticSymbol&&&%>((<%\n//&&&staticSymbol&&&=genItemType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>)<%\n//&&&staticSymbol&&&=item\n//&&&staticSymbol&&&%>));\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult.append(convert<%\n//&&&staticSymbol&&&=genItemType.getName()\n//&&&staticSymbol&&&%>ToString(<%\n//&&&staticSymbol&&&=genItemType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, <%\n//&&&staticSymbol&&&=item\n//&&&staticSymbol&&&%>));\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genItemType.getGenPackage().isDataTypeConverters()) { genItemType = genItemType.getObjectType();\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult.append(<%\n//&&&staticSymbol&&&=genItemType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.convert<%\n//&&&staticSymbol&&&=genItemType.getName()\n//&&&staticSymbol&&&%>((<%\n//&&&staticSymbol&&&=genItemType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>)<%\n//&&&staticSymbol&&&=item\n//&&&staticSymbol&&&%>));\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult.append(<%\n//&&&staticSymbol&&&=genItemType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.convertToString(<%\n//&&&staticSymbol&&&=genItemType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, <%\n//&&&staticSymbol&&&=item\n//&&&staticSymbol&&&%>));\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult.append(' ');\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&&\t\treturn result.substring(0, result.length() - 1);\n//&&&staticSymbol&&& <%\n} else if (!genDataType.getMemberTypes().isEmpty()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (!genDataType.isPrimitiveType()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tif (instanceValue == null) return null;\n//&&&staticSymbol&&& <%\nfor (GenDataType genMemberType : genDataType.getMemberTypes()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tif (<%\n//&&&staticSymbol&&&=genMemberType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>.isInstance(instanceValue))\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&&\t\t\ttry\n//&&&staticSymbol&&&\t\t\t{\n//&&&staticSymbol&&& <%\nif (genMemberType.getGenPackage() == genPackage) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genPackage.isDataTypeConverters()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genMemberType.getQualifiedInstanceClassName().equals(genDataType.getQualifiedInstanceClassName())) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\t\tString value = convert<%\n//&&&staticSymbol&&&=genMemberType.getName()\n//&&&staticSymbol&&&%>(instanceValue);\n//&&&staticSymbol&&& <%\n} else if (genMemberType.isPrimitiveType() && genModel.getComplianceLevel().getValue() < GenJDKLevel.JDK50) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\t\tString value = convert<%\n//&&&staticSymbol&&&=genMemberType.getName()\n//&&&staticSymbol&&&%>(((<%\n//&&&staticSymbol&&&=genMemberType.getObjectType().getImportedInstanceClassName()\n//&&&staticSymbol&&&%>)instanceValue).<%\n//&&&staticSymbol&&&=genMemberType.getPrimitiveValueFunction()\n//&&&staticSymbol&&&%>());\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\t\tString value = convert<%\n//&&&staticSymbol&&&=genMemberType.getName()\n//&&&staticSymbol&&&%>((<%\n//&&&staticSymbol&&&=genMemberType.getObjectType().getImportedBoundedWildcardInstanceClassName()\n//&&&staticSymbol&&&%>)instanceValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\t\tString value = convert<%\n//&&&staticSymbol&&&=genMemberType.getName()\n//&&&staticSymbol&&&%>ToString(<%\n//&&&staticSymbol&&&=genMemberType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, instanceValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genMemberType.getGenPackage().isDataTypeConverters()) { genMemberType = genMemberType.getObjectType();\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\t\tString value = <%\n//&&&staticSymbol&&&=genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.convert<%\n//&&&staticSymbol&&&=genMemberType.getName()\n//&&&staticSymbol&&&%>((<%\n//&&&staticSymbol&&&=genMemberType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>)instanceValue);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\t\tString value = <%\n//&&&staticSymbol&&&=genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.convertToString(<%\n//&&&staticSymbol&&&=genMemberType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, instanceValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\t\tif (value != null) return value;\n//&&&staticSymbol&&&\t\t\t}\n//&&&staticSymbol&&&\t\t\tcatch (Exception e)\n//&&&staticSymbol&&&\t\t\t{\n//&&&staticSymbol&&&\t\t\t\t// Keep trying other member types until all have failed.\n//&&&staticSymbol&&&\t\t\t}\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nfor (GenDataType genMemberType : genDataType.getMemberTypes()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\ttry\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&& <%\nif (genMemberType.getGenPackage() == genPackage) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genPackage.isDataTypeConverters()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tString value = convert<%\n//&&&staticSymbol&&&=genMemberType.getName()\n//&&&staticSymbol&&&%>(instanceValue);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tString value = convert<%\n//&&&staticSymbol&&&=genMemberType.getName()\n//&&&staticSymbol&&&%>ToString(<%\n//&&&staticSymbol&&&=genMemberType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, <%\nif (genModel.getComplianceLevel().getValue() < GenJDKLevel.JDK50) {\n//&&&staticSymbol&&&%>new <%\n//&&&staticSymbol&&&=genMemberType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>(instanceValue)<%\n} else {\n//&&&staticSymbol&&&%>instanceValue<%\n}\n//&&&staticSymbol&&&%>);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genMemberType.getGenPackage().isDataTypeConverters()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tString value = <%\n//&&&staticSymbol&&&=genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.convert<%\n//&&&staticSymbol&&&=genMemberType.getName()\n//&&&staticSymbol&&&%>(instanceValue);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tString value = <%\n//&&&staticSymbol&&&=genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.convertToString(<%\n//&&&staticSymbol&&&=genMemberType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, <%\nif (genModel.getComplianceLevel().getValue() < GenJDKLevel.JDK50) {\n//&&&staticSymbol&&&%>new <%\n//&&&staticSymbol&&&=genMemberType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>(instanceValue)<%\n} else {\n//&&&staticSymbol&&&%>instanceValue<%\n}\n//&&&staticSymbol&&&%>);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tif (value != null) return value;\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&&\t\tcatch (Exception e)\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&&\t\t\t// Keep trying other member types until all have failed.\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tthrow new IllegalArgumentException(\"Invalid value: '\"+instanceValue+\"' for datatype :\"+<%\n//&&&staticSymbol&&&=eDataType\n//&&&staticSymbol&&&%>.getName());\n//&&&staticSymbol&&& <%\n} else if (!genDataType.hasConversionDelegate() && genModel.useGenerics() && (genDataType.isArrayType() || !genDataType.getEcoreDataType().getETypeParameters().isEmpty() || genDataType.getEcoreDataType().getInstanceTypeName().contains(\"<\"))) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn super.convertToString(instanceValue);\n//&&&staticSymbol&&& <%\n} else if (!genDataType.hasConversionDelegate() && genDataType.isArrayType()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t// TODO: implement this method\n//&&&staticSymbol&&&\t\t// Ensure that you remove @generated or mark it @generated NOT\n//&&&staticSymbol&&&\t\tthrow new <%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.lang.UnsupportedOperationException\")\n//&&&staticSymbol&&&%>();\n//&&&staticSymbol&&& <%\n} else if (genDataType.isPrimitiveType() && genModel.getComplianceLevel().getValue() < GenJDKLevel.JDK50) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn super.convertToString(<%\n//&&&staticSymbol&&&=eDataType\n//&&&staticSymbol&&&%>, new <%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>(instanceValue));\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn super.convertToString(<%\n//&&&staticSymbol&&&=eDataType\n//&&&staticSymbol&&&%>, instanceValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t}\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&& <%\nif (genModel.useGenerics() && (genDataType.getItemType() != null || genDataType.isUncheckedCast()) && (genPackage.isDataTypeConverters() || genDataType.hasCreatorBody())) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t@SuppressWarnings(\"unchecked\")\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\tpublic String convert<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>ToString(<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"org.eclipse.emf.ecore.EDataType\")\n//&&&staticSymbol&&&%> eDataType, Object instanceValue)\n//&&&staticSymbol&&&\t{\n//&&&staticSymbol&&& <%\nif (genDataType instanceof GenEnum) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genPackage.isDataTypeConverters() || genDataType.hasConverterBody()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn convert<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>((<%\n//&&&staticSymbol&&&=genDataType.getImportedInstanceClassName()\n//&&&staticSymbol&&&%>)instanceValue);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn instanceValue == null ? null : instanceValue.toString();\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else if (genDataType.getBaseType() != null) { GenDataType genBaseType = genDataType.getBaseType(); \n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genBaseType.getGenPackage() == genPackage) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn convert<%\n//&&&staticSymbol&&&=genBaseType.getName()\n//&&&staticSymbol&&&%>ToString(<%\n//&&&staticSymbol&&&=genBaseType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, instanceValue);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn <%\n//&&&staticSymbol&&&=genBaseType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.convertToString(<%\n//&&&staticSymbol&&&=genBaseType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, instanceValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else if (genDataType.getItemType() != null) { GenDataType genItemType = genDataType.getItemType(); \n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genPackage.isDataTypeConverters() || genDataType.hasCreatorBody()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn convert<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>((<%\n//&&&staticSymbol&&&=genDataType.getImportedBoundedWildcardInstanceClassName()\n//&&&staticSymbol&&&%>)instanceValue);\n//&&&staticSymbol&&& <%\n} else { final String singleWildcard = genModel.useGenerics() ? \"<?>\" : \"\";\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tif (instanceValue == null) return null;\n//&&&staticSymbol&&&\t\t<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.util.List\")\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=singleWildcard\n//&&&staticSymbol&&&%> list = (<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.util.List\")\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=singleWildcard\n//&&&staticSymbol&&&%>)instanceValue;\n//&&&staticSymbol&&&\t\tif (list.isEmpty()) return \"\";\n//&&&staticSymbol&&&\t\t<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.lang.StringBuffer\")\n//&&&staticSymbol&&&%> result = new <%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.lang.StringBuffer\")\n//&&&staticSymbol&&&%>();\n//&&&staticSymbol&&& <%\nString item; if (!genModel.useGenerics()) { item = \"i.next()\"; \n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tfor (<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.util.Iterator\")\n//&&&staticSymbol&&&%> i = list.iterator(); i.hasNext(); )\n//&&&staticSymbol&&& <%\n} else { item = \"item\";\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tfor (<%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.lang.Object\")\n//&&&staticSymbol&&&%> item : list)\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&& <%\nif (genItemType.getGenPackage() == genPackage) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult.append(convert<%\n//&&&staticSymbol&&&=genItemType.getName()\n//&&&staticSymbol&&&%>ToString(<%\n//&&&staticSymbol&&&=genItemType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, <%\n//&&&staticSymbol&&&=item\n//&&&staticSymbol&&&%>));\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult.append(<%\n//&&&staticSymbol&&&=genItemType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.convertToString(<%\n//&&&staticSymbol&&&=genItemType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, <%\n//&&&staticSymbol&&&=item\n//&&&staticSymbol&&&%>));\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\tresult.append(' ');\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&&\t\treturn result.substring(0, result.length() - 1);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else if (!genDataType.getMemberTypes().isEmpty()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genPackage.isDataTypeConverters() || genDataType.hasConverterBody()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genDataType.isPrimitiveType()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn instanceValue == null ? null : convert<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>(((<%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>)instanceValue)<%\nif (genModel.getComplianceLevel().getValue() < GenJDKLevel.JDK50) {\n//&&&staticSymbol&&&%>.<%\n//&&&staticSymbol&&&=genDataType.getPrimitiveValueFunction()\n//&&&staticSymbol&&&%>()<%\n}\n//&&&staticSymbol&&&%>);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn convert<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>(instanceValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tif (instanceValue == null) return null;\n//&&&staticSymbol&&& <%\nfor (GenDataType genMemberType : genDataType.getMemberTypes()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tif (<%\n//&&&staticSymbol&&&=genMemberType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>.isInstance(instanceValue))\n//&&&staticSymbol&&&\t\t{\n//&&&staticSymbol&&&\t\t\ttry\n//&&&staticSymbol&&&\t\t\t{\n//&&&staticSymbol&&& <%\nif (genMemberType.getGenPackage() == genPackage) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\t\tString value = convert<%\n//&&&staticSymbol&&&=genMemberType.getName()\n//&&&staticSymbol&&&%>ToString(<%\n//&&&staticSymbol&&&=genMemberType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, instanceValue);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\t\tString value = <%\n//&&&staticSymbol&&&=genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()\n//&&&staticSymbol&&&%>.convertToString(<%\n//&&&staticSymbol&&&=genMemberType.getQualifiedClassifierAccessor()\n//&&&staticSymbol&&&%>, instanceValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t\t\tif (value != null) return value;\n//&&&staticSymbol&&&\t\t\t}\n//&&&staticSymbol&&&\t\t\tcatch (Exception e)\n//&&&staticSymbol&&&\t\t\t{\n//&&&staticSymbol&&&\t\t\t\t// Keep trying other member types until all have failed.\n//&&&staticSymbol&&&\t\t\t}\n//&&&staticSymbol&&&\t\t}\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\tthrow new IllegalArgumentException(\"Invalid value: '\"+instanceValue+\"' for datatype :\"+eDataType.getName());\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else if (genPackage.isDataTypeConverters() || genDataType.hasConverterBody()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genDataType.isPrimitiveType()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn instanceValue == null ? null : convert<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>(<%\nif (genModel.getComplianceLevel().getValue() < GenJDKLevel.JDK50) {\n//&&&staticSymbol&&&%>(<%\n}\n//&&&staticSymbol&&&%>(<%\n//&&&staticSymbol&&&=genDataType.getObjectInstanceClassName()\n//&&&staticSymbol&&&%>)instanceValue<%\nif (genModel.getComplianceLevel().getValue() < GenJDKLevel.JDK50) {\n//&&&staticSymbol&&&%>).<%\n//&&&staticSymbol&&&=genDataType.getPrimitiveValueFunction()\n//&&&staticSymbol&&&%>()<%\n}\n//&&&staticSymbol&&&%>);\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn convert<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>((<%\n//&&&staticSymbol&&&=genDataType.getImportedBoundedWildcardInstanceClassName()\n//&&&staticSymbol&&&%>)instanceValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n} else if (!genDataType.hasConversionDelegate() && genModel.useGenerics() && (genDataType.isArrayType() || !genDataType.getEcoreDataType().getETypeParameters().isEmpty() || genDataType.getEcoreDataType().getInstanceTypeName().contains(\"<\"))) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn super.convertToString(instanceValue);\n//&&&staticSymbol&&& <%\n} else if (!genDataType.hasConversionDelegate() && genDataType.isArrayType()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\t// TODO: implement this method\n//&&&staticSymbol&&&\t\t// Ensure that you remove @generated or mark it @generated NOT\n//&&&staticSymbol&&&\t\tthrow new <%\n//&&&staticSymbol&&&=genModel.getImportedName(\"java.lang.UnsupportedOperationException\")\n//&&&staticSymbol&&&%>();\n//&&&staticSymbol&&& <%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t\treturn super.convertToString(eDataType, instanceValue);\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t}\n//&&&staticSymbol&&&\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\n} else {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nfor (GenClass genClass : genPackage.getGenClasses()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genClass.hasFactoryInterfaceCreateMethod()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * Returns a new object of class '<em><%\n//&&&staticSymbol&&&=genClass.getFormattedName()\n//&&&staticSymbol&&&%></em>'.\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @return a new object of class '<em><%\n//&&&staticSymbol&&&=genClass.getFormattedName()\n//&&&staticSymbol&&&%></em>'.\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&&\t<%\n//&&&staticSymbol&&&=genClass.getTypeParameters()\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genClass.getImportedInterfaceName()\n//&&&staticSymbol&&&%><%\n//&&&staticSymbol&&&=genClass.getInterfaceTypeArguments()\n//&&&staticSymbol&&&%> create<%\n//&&&staticSymbol&&&=genClass.getName()\n//&&&staticSymbol&&&%>();\n//&&&staticSymbol&&&\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genPackage.isDataTypeConverters()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nfor (GenDataType genDataType : genPackage.getAllGenDataTypes()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\nif (genDataType.isSerializable()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * Returns an instance of data type '<em><%\n//&&&staticSymbol&&&=genDataType.getFormattedName()\n//&&&staticSymbol&&&%></em>' corresponding the given literal.\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @param literal a literal of the data type.\n//&&&staticSymbol&&&\t * @return a new instance value of the data type.\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&&\t<%\n//&&&staticSymbol&&&=genDataType.getImportedParameterizedInstanceClassName()\n//&&&staticSymbol&&&%> create<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>(String literal);\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * Returns a literal representation of an instance of data type '<em><%\n//&&&staticSymbol&&&=genDataType.getFormattedName()\n//&&&staticSymbol&&&%></em>'.\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @param instanceValue an instance value of the data type.\n//&&&staticSymbol&&&\t * @return a literal representation of the instance value.\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&&\tString convert<%\n//&&&staticSymbol&&&=genDataType.getName()\n//&&&staticSymbol&&&%>(<%\n//&&&staticSymbol&&&=genDataType.getImportedBoundedWildcardInstanceClassName()\n//&&&staticSymbol&&&%> instanceValue);\n//&&&staticSymbol&&&\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\nif (!isImplementation && !genModel.isSuppressEMFMetaData()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * Returns the package supported by this factory.\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @return the package supported by this factory.\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&&\t<%\n//&&&staticSymbol&&&=genPackage.getPackageInterfaceName()\n//&&&staticSymbol&&&%> get<%\n//&&&staticSymbol&&&=genPackage.getBasicPackageName()\n//&&&staticSymbol&&&%>();\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&<%\n} else if (isImplementation) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&&\tpublic <%\n//&&&staticSymbol&&&=genPackage.getImportedPackageInterfaceName()\n//&&&staticSymbol&&&%> get<%\n//&&&staticSymbol&&&=genPackage.getBasicPackageName()\n//&&&staticSymbol&&&%>()\n//&&&staticSymbol&&&\t{\n//&&&staticSymbol&&&\t\treturn (<%\n//&&&staticSymbol&&&=genPackage.getImportedPackageInterfaceName()\n//&&&staticSymbol&&&%>)getEPackage();\n//&&&staticSymbol&&&\t}\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&\t/**\n//&&&staticSymbol&&&\t * <!-- begin-user-doc -->\n//&&&staticSymbol&&&\t * <!-- end-user-doc -->\n//&&&staticSymbol&&&\t * @deprecated\n//&&&staticSymbol&&&\t * @generated\n//&&&staticSymbol&&&\t */\n//&&&staticSymbol&&& <%\nif (genModel.useClassOverrideAnnotation()) {\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\t@Deprecated\n//&&&staticSymbol&&& <%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&\tpublic static <%\n//&&&staticSymbol&&&=genPackage.getImportedPackageInterfaceName()\n//&&&staticSymbol&&&%> getPackage()\n//&&&staticSymbol&&&\t{\n//&&&staticSymbol&&&\t\treturn <%\n//&&&staticSymbol&&&=genPackage.getImportedPackageInterfaceName()\n//&&&staticSymbol&&&%>.eINSTANCE;\n//&&&staticSymbol&&&\t}\n//&&&staticSymbol&&&\n//&&&staticSymbol&&&<%\n}\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&} //<%\n//&&&staticSymbol&&&*%%storeSymbol%%*1\n//&&&staticSymbol&&&%>\n//&&&staticSymbol&&&<%\ngenModel.emitSortedImports();\n//&&&staticSymbol&&&%>\n\n}", "@Test(timeout = 4000)\n public void test083() throws Throwable {\n Label label0 = new Label();\n FileSystemHandling.appendStringToFile((EvoSuiteFile) null, \"oc[MfnZM[~MHOK iO\");\n ClassWriter classWriter0 = new ClassWriter((-2450));\n classWriter0.newInteger((-2450));\n FileSystemHandling.setPermissions((EvoSuiteFile) null, false, false, false);\n classWriter0.newConst(\"Code\");\n String[] stringArray0 = new String[9];\n stringArray0[0] = \"Fj)3/|(;sZXz$\";\n stringArray0[1] = \"Code\";\n stringArray0[2] = \"oc[MfnZM[~MHOK iO\";\n stringArray0[3] = \"~)yCTRxQ#s$y[Ly%\";\n stringArray0[4] = \"Fj)3/|(;sZXz$\";\n stringArray0[5] = \"oc[MfnZM[~MHOK iO\";\n stringArray0[6] = \"Code\";\n stringArray0[7] = \"oc[MfnZM[~MHOK iO\";\n stringArray0[8] = \"Code\";\n MethodWriter methodWriter0 = new MethodWriter(classWriter0, 3, \"\\\".3t\\\"0\", \"~)yCTRxQ#s$y[Ly%\", \"\\\".3t\\\"0\", stringArray0, true, false);\n Label label1 = new Label();\n byte[] byteArray0 = new byte[0];\n label1.resolve(methodWriter0, 168, byteArray0);\n classWriter0.newNameTypeItem(\"Code\", \"Fj)3/|(;sZXz$\");\n Label label2 = new Label();\n methodWriter0.visitFieldInsn(3, \"oc[MfnZM[~MHOK iO\", \"oc[MfnZM[~MHOK iO\", \"*/TEiGBLds&\");\n methodWriter0.visitLdcInsn(\"java/lang/dyn/Dynamic\");\n }", "public interface NewLine extends ClouBausteinElement {\n\n static NewLine create(CodePosition codePosition){\n return new NewLineImpl(codePosition);\n }\n\n}", "public abstract Object mo1185b();", "public void createCode(){\n\t\tsc = animationScript.newSourceCode(new Coordinates(10, 60), \"sourceCode\",\r\n\t\t\t\t\t\t null, AnimProps.SC_PROPS);\r\n\t\t \r\n\t\t// Add the lines to the SourceCode object.\r\n\t\t// Line, name, indentation, display dealy\r\n\t\tsc.addCodeLine(\"1. Berechne für jede (aktive) Zeile und Spalte der Kostenmatrix\", null, 0, null); // 0\r\n\t\tsc.addCodeLine(\" die Differenz aus dem kleinsten (blau) und zweit-kleinsten (lila)\", null, 0, null);\r\n\t\tsc.addCodeLine(\" Element der entsprechenden Zeile/ Spalte.\", null, 0, null);\r\n\t\tsc.addCodeLine(\"2. Wähle die Zeile oder Spalte (grün) aus bei der sich die größte\", null, 0, null); \r\n\t\tsc.addCodeLine(\" Differenz (blau) ergab.\", null, 0, null);\r\n\t\tsc.addCodeLine(\"3. Das kleinste Element der entsprechenden Spalte\", null, 0, null); \r\n\t\tsc.addCodeLine(\" (bzw. Zeile) gibt nun die Stelle an, welche im\", null, 0, null);\r\n\t\tsc.addCodeLine(\" Transporttableau berechnet wird (blau).\", null, 0, null);\r\n\t\tsc.addCodeLine(\"4. Nun wird der kleinere Wert von Angebots- und\", null, 0, null); // 4\r\n\t\tsc.addCodeLine(\" Nachfragevektor im Tableau eingetragen.\", null, 0, null);\r\n\t\tsc.addCodeLine(\"5. Anschließend wird der eingetragene Wert von den Rändern\", null, 0, null); // 5\r\n\t\tsc.addCodeLine(\" abgezogen (mindestens einer muss 0 werden). \", null, 0, null);\r\n\t\tsc.addCodeLine(\"6. Ist nun der Wert im Nachfragevektor Null so markiere\", null, 0, null); // 6\r\n\t\tsc.addCodeLine(\" die entsprechende Spalte in der Kostenmatrix. Diese\", null, 0, null);\r\n\t\tsc.addCodeLine(\" wird nun nicht mehr beachtet (rot). Ist der Wert des\", null, 0, null);\r\n\t\tsc.addCodeLine(\" Angebotsvektors Null markiere die Zeile der Kostenmatrix.\", null, 0, null);\r\n\t\tsc.addCodeLine(\"7. Der Algorithmus wird beendet, falls lediglich eine Zeile oder\", null, 0, null); // 8\r\n\t\tsc.addCodeLine(\" Spalte der Kostenmatrix unmarkiert ist (eines reicht aus).\", null, 0, null);\r\n\t\tsc.addCodeLine(\"8 . Der entsprechenden Zeile bzw. Spalte im Transporttableau werden\", null, 0, null); // 9\t\t \r\n\t\tsc.addCodeLine(\" die restlichen Angebots- und Nachfragemengen zugeordnet.\", null, 0, null);\r\n\t\t\r\n\t}", "public abstract C0270jy mo5354b();", "private Solution() {\n /**.\n * { constructor }\n */\n }", "public void gen(CodeSeq code, ICodeEnv env) {\n\r\n\t}", "public static void __init() {\r\n\t\t__name__ = new str(\"code\");\r\n\r\n\t\t/**\r\n\t\t copyright Sean McCarthy, license GPL v2 or later\r\n\t\t*/\r\n\t\tdefault_0 = null;\r\n\t\tcl_Code = new class_(\"Code\");\r\n\t}", "public void mo97906c() {\n }", "public void mo5097b() {\n }", "@Override\n public void generate(ToolContext context) throws ToolException {\n //Sorry but I needed to rewrite the code, doesn't have any point to override\n boolean initialized = getFieldValue(\"initialized\");\n if (!initialized) {\n initialize(context);\n }\n\n S2JJAXBModel rawJaxbModelGenCode = getFieldValue(\"rawJaxbModelGenCode\");\n if (rawJaxbModelGenCode == null) {\n return;\n }\n\n if (context.getErrorListener().getErrorCount() > 0) {\n return;\n }\n\n try {\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n\n CustomOutputStreamCodeWriter fileCodeWriter = new CustomOutputStreamCodeWriter(stream, \"utf-8\", results);\n ClassCollector classCollector = context.get(ClassCollector.class);\n for (JClass cls : rawJaxbModelGenCode.getAllObjectFactories()) {\n classCollector.getTypesPackages().add(cls._package().name());\n }\n JCodeModel jcodeModel = rawJaxbModelGenCode.generateCode(null, null);\n\n jcodeModel.build(fileCodeWriter);\n\n context.put(JCodeModel.class, jcodeModel);\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }", "public void mo56167c() {\n }", "public void mo115190b() {\n }", "public abstract C mo29734a();", "void mo80455b();", "CD withCode();", "abc createabc();", "public abstract String mo11611b();", "public void mo21825b() {\n }", "public void mo55254a() {\n }", "public void generateByteCode(Optimizer opt) {}", "DefineBlock createDefineBlock();", "public void mo115188a() {\n }", "public void mo9233aH() {\n }", "public void mo21785J() {\n }", "void mo41086b();", "public void mo97908d() {\n }", "public static String _globals() throws Exception{\nmostCurrent._pnloverlay = new anywheresoftware.b4a.objects.PanelWrapper();\n //BA.debugLineNum = 21;BA.debugLine=\"Private txtval As EditText\";\nmostCurrent._txtval = new anywheresoftware.b4a.objects.EditTextWrapper();\n //BA.debugLineNum = 22;BA.debugLine=\"Private btnlogin As Button\";\nmostCurrent._btnlogin = new anywheresoftware.b4a.objects.ButtonWrapper();\n //BA.debugLineNum = 23;BA.debugLine=\"Private btndelete As Button\";\nmostCurrent._btndelete = new anywheresoftware.b4a.objects.ButtonWrapper();\n //BA.debugLineNum = 24;BA.debugLine=\"End Sub\";\nreturn \"\";\n}", "public void generate() {\n\t\t// Print generation stamp\n\t\tcontext.getNaming().putStamp(elementInterface, out);\n\t\t// Print the code\n\t\t// Print header\n\t\tout.println(\"package \"+modelPackage+\";\");\n\t\tout.println();\n\t\tout.println(\"public interface \"+elementInterface);\n\t\tif (context.isGenerateVisitor()) {\n\t\t\tout.println(indent+\"extends \"+context.getNaming().getVisitableInterface(modelName));\n\t\t}\n\t\tout.println(\"{\");\n\t\tif (context.isGenerateID()) {\n\t\t\tout.println(indent+\"/** Get the id */\");\n\t\t\tout.println(indent+\"public String getId();\");\n\t\t\tout.println(indent+\"/** Set the id */\");\n\t\t\tout.println(indent+\"public void setId(String id);\");\n\t\t\tout.println();\n\t\t}\n\t\tif (context.isGenerateBidirectional()) {\n\t\t\tout.println(indent+\"/** Delete */\");\n\t\t\tout.println(indent+\"public void delete();\");\n\t\t}\n\t\tout.println(indent+\"/** Override toString */\");\n\t\tout.println(indent+\"public String toString();\");\n//\t\tif (context.isGenerateInvariant()) {\n//\t\t\tout.println();\n//\t\t\tout.println(indent+\"/** Parse all invariants */\");\n//\t\t\tout.println(indent+\"public Boolean parseInvariants(ILog log);\");\n//\t\t\tout.println(indent+\"/** Evaluate all invariants */\");\n//\t\t\tout.println(indent+\"public Boolean evaluateInvariants(ILog log);\");\n//\t\t}\n\t\tout.println(\"}\");\n\t}", "public void mo21789N() {\n }", "C7904c mo24084a();", "public void mo3376r() {\n }", "public void mo21784I() {\n }", "public Body jimplify(Body b, SootMethod m) {\n\n final Jimple jimple = Jimple.v();\n final UnknownType unknownType = UnknownType.v();\n final NullConstant nullConstant = NullConstant.v();\n final Options options = Options.v();\n\n /*\n * Timer t_whole_jimplification = new Timer(); Timer t_num = new Timer(); Timer t_null = new Timer();\n *\n * t_whole_jimplification.start();\n */\n\n JBOptions jbOptions = new JBOptions(PhaseOptions.v().getPhaseOptions(\"jb\"));\n jBody = (JimpleBody) b;\n deferredInstructions = new ArrayList<DeferableInstruction>();\n instructionsToRetype = new HashSet<RetypeableInstruction>();\n\n if (jbOptions.use_original_names()) {\n PhaseOptions.v().setPhaseOptionIfUnset(\"jb.lns\", \"only-stack-locals\");\n }\n if (jbOptions.stabilize_local_names()) {\n PhaseOptions.v().setPhaseOption(\"jb.lns\", \"sort-locals:true\");\n }\n\n if (IDalvikTyper.ENABLE_DVKTYPER) {\n DalvikTyper.v().clear();\n }\n\n // process method parameters and generate Jimple locals from Dalvik\n // registers\n List<Local> paramLocals = new LinkedList<Local>();\n if (!isStatic) {\n int thisRegister = numRegisters - numParameterRegisters - 1;\n\n Local thisLocal =\n jimple.newLocal(freshLocalName(\"this\"), unknownType); // generateLocal(UnknownType.v());\n jBody.getLocals().add(thisLocal);\n\n registerLocals[thisRegister] = thisLocal;\n JIdentityStmt idStmt =\n (JIdentityStmt) jimple.newIdentityStmt(thisLocal, jimple.newThisRef(declaringClassType));\n add(idStmt);\n paramLocals.add(thisLocal);\n if (IDalvikTyper.ENABLE_DVKTYPER) {\n DalvikTyper.v()\n .setType(idStmt.leftBox, jBody.getMethod().getDeclaringClass().getType(), false);\n }\n }\n {\n int i = 0; // index of parameter type\n int argIdx = 0;\n int parameterRegister = numRegisters - numParameterRegisters; // index of parameter register\n for (Type t : parameterTypes) {\n\n String localName = null;\n Type localType = null;\n if (jbOptions.use_original_names()) {\n // Attempt to read original parameter name.\n try {\n localName = parameterNames.get(argIdx);\n localType = parameterTypes.get(argIdx);\n } catch (Exception ex) {\n logger.error(\"Exception while reading original parameter names.\", ex);\n }\n }\n if (localName == null && localDebugs.containsKey(parameterRegister)) {\n localName = localDebugs.get(parameterRegister).get(0).name;\n } else {\n localName = \"$u\" + parameterRegister;\n }\n if (localType == null) {\n // may only use UnknownType here because the local may be\n // reused with a different type later (before splitting)\n localType = unknownType;\n }\n\n Local gen = jimple.newLocal(freshLocalName(localName), localType);\n jBody.getLocals().add(gen);\n registerLocals[parameterRegister] = gen;\n\n JIdentityStmt idStmt =\n (JIdentityStmt) jimple.newIdentityStmt(gen, jimple.newParameterRef(t, i++));\n add(idStmt);\n paramLocals.add(gen);\n if (IDalvikTyper.ENABLE_DVKTYPER) {\n DalvikTyper.v().setType(idStmt.leftBox, t, false);\n }\n\n // some parameters may be encoded on two registers.\n // in Jimple only the first Dalvik register name is used\n // as the corresponding Jimple Local name. However, we also add\n // the second register to the registerLocals array since it\n // could be used later in the Dalvik bytecode\n if (t instanceof LongType || t instanceof DoubleType) {\n parameterRegister++;\n // may only use UnknownType here because the local may be reused with a different\n // type later (before splitting)\n String name;\n if (localDebugs.containsKey(parameterRegister)) {\n name = localDebugs.get(parameterRegister).get(0).name;\n } else {\n name = \"$u\" + parameterRegister;\n }\n Local g = jimple.newLocal(freshLocalName(name), unknownType);\n jBody.getLocals().add(g);\n registerLocals[parameterRegister] = g;\n }\n\n parameterRegister++;\n argIdx++;\n }\n }\n\n for (int i = 0; i < (numRegisters - numParameterRegisters - (isStatic ? 0 : 1)); i++) {\n String name;\n if (localDebugs.containsKey(i)) {\n name = localDebugs.get(i).get(0).name;\n } else {\n name = \"$u\" + i;\n }\n registerLocals[i] = jimple.newLocal(freshLocalName(name), unknownType);\n jBody.getLocals().add(registerLocals[i]);\n }\n\n // add local to store intermediate results\n storeResultLocal = jimple.newLocal(freshLocalName(\"$u-1\"), unknownType);\n jBody.getLocals().add(storeResultLocal);\n\n // process bytecode instructions\n final DexFile dexFile = dexEntry.getDexFile();\n final boolean isOdex =\n dexFile instanceof DexBackedDexFile\n ? ((DexBackedDexFile) dexFile).supportsOptimizedOpcodes()\n : false;\n\n ClassPath cp = null;\n if (isOdex) {\n String[] sootClasspath = options.soot_classpath().split(File.pathSeparator);\n List<String> classpathList = new ArrayList<String>();\n for (String str : sootClasspath) {\n classpathList.add(str);\n }\n try {\n ClassPathResolver resolver =\n new ClassPathResolver(classpathList, classpathList, classpathList, dexEntry);\n cp = new ClassPath(resolver.getResolvedClassProviders().toArray(new ClassProvider[0]));\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n\n int prevLineNumber = -1;\n for (DexlibAbstractInstruction instruction : instructions) {\n if (isOdex && instruction instanceof OdexInstruction) {\n ((OdexInstruction) instruction).deOdex(dexFile, method, cp);\n }\n if (dangling != null) {\n dangling.finalize(this, instruction);\n dangling = null;\n }\n instruction.jimplify(this);\n if (instruction.getLineNumber() > 0) {\n prevLineNumber = instruction.getLineNumber();\n } else {\n instruction.setLineNumber(prevLineNumber);\n }\n }\n if (dangling != null) {\n dangling.finalize(this, null);\n }\n for (DeferableInstruction instruction : deferredInstructions) {\n instruction.deferredJimplify(this);\n }\n\n if (tries != null) {\n addTraps();\n }\n\n if (options.keep_line_number()) {\n fixLineNumbers();\n }\n\n // At this point Jimple code is generated\n // Cleaning...\n\n instructions = null;\n // registerLocals = null;\n // storeResultLocal = null;\n instructionAtAddress.clear();\n // localGenerator = null;\n deferredInstructions = null;\n // instructionsToRetype = null;\n dangling = null;\n tries = null;\n parameterNames.clear();\n\n /*\n * We eliminate dead code. Dead code has been shown to occur under the following circumstances.\n *\n * 0006ec: 0d00 |00a2: move-exception v0 ... 0006f2: 0d00 |00a5: move-exception v0 ... 0x0041 - 0x008a\n * Ljava/lang/Throwable; -> 0x00a5 <any> -> 0x00a2\n *\n * Here there are two traps both over the same region. But the same always fires, hence rendering the code at a2\n * unreachable. Dead code yields problems during local splitting because locals within dead code will not be split. Hence\n * we remove all dead code here.\n */\n\n // Fix traps that do not catch exceptions\n DexTrapStackFixer.v().transform(jBody);\n\n // Sort out jump chains\n DexJumpChainShortener.v().transform(jBody);\n\n // Make sure that we don't have any overlapping uses due to returns\n DexReturnInliner.v().transform(jBody);\n\n // Shortcut: Reduce array initializations\n DexArrayInitReducer.v().transform(jBody);\n\n // split first to find undefined uses\n getLocalSplitter().transform(jBody);\n\n // Remove dead code and the corresponding locals before assigning types\n getUnreachableCodeEliminator().transform(jBody);\n DeadAssignmentEliminator.v().transform(jBody);\n UnusedLocalEliminator.v().transform(jBody);\n\n for (RetypeableInstruction i : instructionsToRetype) {\n i.retype(jBody);\n }\n\n // {\n // // remove instructions from instructions list\n // List<DexlibAbstractInstruction> iToRemove = new\n // ArrayList<DexlibAbstractInstruction>();\n // for (DexlibAbstractInstruction i: instructions)\n // if (!jBody.getUnits().contains(i.getUnit()))\n // iToRemove.add(i);\n // for (DexlibAbstractInstruction i: iToRemove) {\n // Debug.printDbg(\"removing dexinstruction containing unit '\",\n // i.getUnit() ,\"'\");\n // instructions.remove(i);\n // }\n // }\n\n if (IDalvikTyper.ENABLE_DVKTYPER) {\n\n DexReturnValuePropagator.v().transform(jBody);\n getCopyPopagator().transform(jBody);\n DexNullThrowTransformer.v().transform(jBody);\n DalvikTyper.v().typeUntypedConstrantInDiv(jBody);\n DeadAssignmentEliminator.v().transform(jBody);\n UnusedLocalEliminator.v().transform(jBody);\n\n DalvikTyper.v().assignType(jBody);\n // jBody.validate();\n jBody.validateUses();\n jBody.validateValueBoxes();\n // jBody.checkInit();\n // Validate.validateArrays(jBody);\n // jBody.checkTypes();\n // jBody.checkLocals();\n\n } else {\n // t_num.start();\n DexNumTransformer.v().transform(jBody);\n // t_num.end();\n\n DexReturnValuePropagator.v().transform(jBody);\n getCopyPopagator().transform(jBody);\n\n DexNullThrowTransformer.v().transform(jBody);\n\n // t_null.start();\n DexNullTransformer.v().transform(jBody);\n // t_null.end();\n\n DexIfTransformer.v().transform(jBody);\n\n DeadAssignmentEliminator.v().transform(jBody);\n UnusedLocalEliminator.v().transform(jBody);\n\n // DexRefsChecker.v().transform(jBody);\n DexNullArrayRefTransformer.v().transform(jBody);\n }\n\n if (IDalvikTyper.ENABLE_DVKTYPER) {\n for (Local l : jBody.getLocals()) {\n l.setType(unknownType);\n }\n }\n\n // Remove \"instanceof\" checks on the null constant\n DexNullInstanceofTransformer.v().transform(jBody);\n\n TypeAssigner.v().transform(jBody);\n\n final RefType objectType = RefType.v(\"java.lang.Object\");\n if (IDalvikTyper.ENABLE_DVKTYPER) {\n for (Unit u : jBody.getUnits()) {\n if (u instanceof IfStmt) {\n ConditionExpr expr = (ConditionExpr) ((IfStmt) u).getCondition();\n if (((expr instanceof EqExpr) || (expr instanceof NeExpr))) {\n Value op1 = expr.getOp1();\n Value op2 = expr.getOp2();\n if (op1 instanceof Constant && op2 instanceof Local) {\n Local l = (Local) op2;\n Type ltype = l.getType();\n if (ltype instanceof PrimType) {\n continue;\n }\n if (!(op1 instanceof IntConstant)) {\n // null is\n // IntConstant(0)\n // in Dalvik\n continue;\n }\n IntConstant icst = (IntConstant) op1;\n int val = icst.value;\n if (val != 0) {\n continue;\n }\n expr.setOp1(nullConstant);\n } else if (op1 instanceof Local && op2 instanceof Constant) {\n Local l = (Local) op1;\n Type ltype = l.getType();\n if (ltype instanceof PrimType) {\n continue;\n }\n if (!(op2 instanceof IntConstant)) {\n // null is\n // IntConstant(0)\n // in Dalvik\n continue;\n }\n IntConstant icst = (IntConstant) op2;\n int val = icst.value;\n if (val != 0) {\n continue;\n }\n expr.setOp2(nullConstant);\n } else if (op1 instanceof Local && op2 instanceof Local) {\n // nothing to do\n } else if (op1 instanceof Constant && op2 instanceof Constant) {\n\n if (op1 instanceof NullConstant && op2 instanceof NumericConstant) {\n IntConstant nc = (IntConstant) op2;\n if (nc.value != 0) {\n throw new RuntimeException(\"expected value 0 for int constant. Got \" + expr);\n }\n expr.setOp2(NullConstant.v());\n } else if (op2 instanceof NullConstant && op1 instanceof NumericConstant) {\n IntConstant nc = (IntConstant) op1;\n if (nc.value != 0) {\n throw new RuntimeException(\"expected value 0 for int constant. Got \" + expr);\n }\n expr.setOp1(nullConstant);\n }\n } else {\n throw new RuntimeException(\"error: do not handle if: \" + u);\n }\n }\n }\n }\n\n // For null_type locals: replace their use by NullConstant()\n List<ValueBox> uses = jBody.getUseBoxes();\n // List<ValueBox> defs = jBody.getDefBoxes();\n List<ValueBox> toNullConstantify = new ArrayList<ValueBox>();\n List<Local> toRemove = new ArrayList<Local>();\n for (Local l : jBody.getLocals()) {\n\n if (l.getType() instanceof NullType) {\n toRemove.add(l);\n for (ValueBox vb : uses) {\n Value v = vb.getValue();\n if (v == l) {\n toNullConstantify.add(vb);\n }\n }\n }\n }\n for (ValueBox vb : toNullConstantify) {\n System.out.println(\"replace valuebox '\" + vb + \" with null constant\");\n vb.setValue(nullConstant);\n }\n for (Local l : toRemove) {\n System.out.println(\"removing null_type local \" + l);\n l.setType(objectType);\n }\n }\n\n // We pack locals that are not used in overlapping regions. This may\n // again lead to unused locals which we have to remove.\n LocalPacker.v().transform(jBody);\n UnusedLocalEliminator.v().transform(jBody);\n PackManager.v().getTransform(\"jb.lns\").apply(jBody);\n\n // Some apps reference static fields as instance fields. We fix this\n // on the fly.\n if (Options.v().wrong_staticness() == Options.wrong_staticness_fix\n || Options.v().wrong_staticness() == Options.wrong_staticness_fixstrict) {\n FieldStaticnessCorrector.v().transform(jBody);\n MethodStaticnessCorrector.v().transform(jBody);\n }\n\n // Inline PackManager.v().getPack(\"jb\").apply(jBody);\n // Keep only transformations that have not been done\n // at this point.\n TrapTightener.v().transform(jBody);\n TrapMinimizer.v().transform(jBody);\n // LocalSplitter.v().transform(jBody);\n Aggregator.v().transform(jBody);\n // UnusedLocalEliminator.v().transform(jBody);\n // TypeAssigner.v().transform(jBody);\n // LocalPacker.v().transform(jBody);\n // LocalNameStandardizer.v().transform(jBody);\n\n // Remove if (null == null) goto x else <madness>. We can only do this\n // after we have run the constant propagation as we might not be able\n // to statically decide the conditions earlier.\n ConditionalBranchFolder.v().transform(jBody);\n\n // Remove unnecessary typecasts\n ConstantCastEliminator.v().transform(jBody);\n IdentityCastEliminator.v().transform(jBody);\n\n // Remove unnecessary logic operations\n IdentityOperationEliminator.v().transform(jBody);\n\n // We need to run this transformer since the conditional branch folder\n // might have rendered some code unreachable (well, it was unreachable\n // before as well, but we didn't know).\n UnreachableCodeEliminator.v().transform(jBody);\n\n // Not sure whether we need this even though we do it earlier on as\n // the earlier pass does not have type information\n // CopyPropagator.v().transform(jBody);\n\n // we might have gotten new dead assignments and unused locals through\n // copy propagation and unreachable code elimination, so we have to do\n // this again\n DeadAssignmentEliminator.v().transform(jBody);\n UnusedLocalEliminator.v().transform(jBody);\n NopEliminator.v().transform(jBody);\n\n // Remove unnecessary chains of return statements\n DexReturnPacker.v().transform(jBody);\n\n for (Unit u : jBody.getUnits()) {\n if (u instanceof AssignStmt) {\n AssignStmt ass = (AssignStmt) u;\n if (ass.getRightOp() instanceof CastExpr) {\n CastExpr c = (CastExpr) ass.getRightOp();\n if (c.getType() instanceof NullType) {\n ass.setRightOp(nullConstant);\n }\n }\n }\n if (u instanceof DefinitionStmt) {\n DefinitionStmt def = (DefinitionStmt) u;\n // If the body references a phantom class in a\n // CaughtExceptionRef,\n // we must manually fix the hierarchy\n if (def.getLeftOp() instanceof Local && def.getRightOp() instanceof CaughtExceptionRef) {\n Type t = def.getLeftOp().getType();\n if (t instanceof RefType) {\n RefType rt = (RefType) t;\n if (rt.getSootClass().isPhantom()\n && !rt.getSootClass().hasSuperclass()\n && !rt.getSootClass().getName().equals(\"java.lang.Throwable\")) {\n rt.getSootClass().setSuperclass(Scene.v().getSootClass(\"java.lang.Throwable\"));\n }\n }\n }\n }\n }\n\n // Replace local type null_type by java.lang.Object.\n //\n // The typing engine cannot find correct type for such code:\n //\n // null_type $n0;\n // $n0 = null;\n // $r4 = virtualinvoke $n0.<java.lang.ref.WeakReference:\n // java.lang.Object get()>();\n //\n for (Local l : jBody.getLocals()) {\n Type t = l.getType();\n if (t instanceof NullType) {\n l.setType(objectType);\n }\n }\n\n // Must be last to ensure local ordering does not change\n PackManager.v().getTransform(\"jb.lns\").apply(jBody);\n\n // t_whole_jimplification.end();\n\n return jBody;\n }", "public void mo23438b() {\n }", "C3577c mo19678C();", "public void mo21793R() {\n }", "public Zip_Code GO_Zip_Code(){\n Reusable_Library_Loggers.click(driver,\"//*[@id ='txtZipCodetxt']\",\"clicking on GO\",logger);\n return new Zip_Code(driver);\n\n }", "public /* synthetic */ String mo15496a(Void __) {\n boolean[] $jacocoInit = $jacocoInit();\n String string = getArguments().getString(\"package_name\");\n $jacocoInit[217] = true;\n return string;\n }", "C45321i mo90380a();", "public String _class_globals() throws Exception{\n_ws = new anywheresoftware.b4j.object.WebSocket();\r\n //BA.debugLineNum = 5;BA.debugLine=\"Public page As ABMPage\";\r\n_page = new com.ab.abmaterial.ABMPage();\r\n //BA.debugLineNum = 7;BA.debugLine=\"Private theme As ABMTheme\";\r\n_theme = new com.ab.abmaterial.ABMTheme();\r\n //BA.debugLineNum = 9;BA.debugLine=\"Private ABM As ABMaterial 'ignore\";\r\n_abm = new com.ab.abmaterial.ABMaterial();\r\n //BA.debugLineNum = 11;BA.debugLine=\"Public Name As String = \\\"CompComboPage\\\"\";\r\n_name = \"CompComboPage\";\r\n //BA.debugLineNum = 13;BA.debugLine=\"Private ABMPageId As String = \\\"\\\"\";\r\n_abmpageid = \"\";\r\n //BA.debugLineNum = 16;BA.debugLine=\"Dim myToastId As Int\";\r\n_mytoastid = 0;\r\n //BA.debugLineNum = 17;BA.debugLine=\"Dim combocounter As Int = 4\";\r\n_combocounter = (int) (4);\r\n //BA.debugLineNum = 18;BA.debugLine=\"End Sub\";\r\nreturn \"\";\r\n}", "CodegenFactory getCodegenFactory();", "public void mo1403c() {\n }", "C11316t5 mo29022j0();", "public void mo44053a() {\n }", "void mo67923b();", "public void mo21788M() {\n }", "abstract void mo4372a(zzwt zzwt, cu cuVar);", "public /* synthetic */ String mo15507f(Void __) {\n boolean[] $jacocoInit = $jacocoInit();\n String string = getArguments().getString(\"package_name\");\n $jacocoInit[219] = true;\n return string;\n }", "public void mo21791P() {\n }", "public void mo3287b() {\n }", "void mo80457c();", "public /* synthetic */ String mo15511g(Void __) {\n boolean[] $jacocoInit = $jacocoInit();\n String string = getArguments().getString(\"package_name\");\n $jacocoInit[218] = true;\n return string;\n }", "void mo72113b();", "C1529a mo17019b();", "public void mo21782G() {\n }", "void mo88523b();", "MethodStart createMethodStart();", "@Override\n public String codeGen() {\n\n\tString labelFun = \"labelFun\" + MiniFunLib.getLabIndex();\n\tString popParSequence = \"\";\n\tString popLocalVariable = \"\";\n\tString localVariableCodeGen = \"\";\n\n\tfor (int i = 0; i < funParams.size(); i++) {\n\t NodeType nt = this.funParams.get(i).getType().getNodeType();\n\n\t if (nt == NodeType.ARROWTYPE_NODE)\n\t\tpopParSequence += VMCommands.POP + \"\\n\" + VMCommands.POP + \"\\n\";\n\t else\n\t\tpopParSequence += VMCommands.POP + \"\\n\";\n\t}\n\n\tfor (int i = 0; i < funLocalVariables.size(); i++) {\n\t localVariableCodeGen += funLocalVariables.get(i).codeGen();\n\t popLocalVariable += VMCommands.POP + \"\\n\";\n\t}\n\n\tString code = labelFun + \" :\\n\" +\n\t// Preparo parte bassa dell'activation Record\n\n\t\t// Il registro FP punterà al nuovo Activation Record\n\t\tVMCommands.CFP + \"\\n\"\n\n\t\t// PUSH dei dati Locali\n\t\t+ localVariableCodeGen +\n\n\t\t// PUSH return address del chiamante\n\t\tVMCommands.LRA + \"\\n\"\n\n\t\t// Corpo della funzione\n\t\t+ funBody.codeGen() +\n\n\t\t// POP RV e salvo nel registro\n\t\tVMCommands.SRV + \"\\n\" +\n\n\t\t// POP RA e salvo nel registro\n\t\tVMCommands.SRA + \"\\n\" +\n\n\t\t// Rimuovo variabili locali\n\t\tpopLocalVariable +\n\t\t// Rimuovo Access Link\n\t\tVMCommands.POP + \"\\n\" +\n\t\t// Rimuovo Pametri\n\t\tpopParSequence +\n\n\t\t// Ripristino il Registro FP che punterà all'Activation Record\n\t\t// del chiamante\n\t\tVMCommands.SFP + \"\\n\" +\n\n\t\t// PUSH valore di ritorno\n\t\tVMCommands.LRV + \"\\n\" +\n\t\t// PUSH indirizzo di ritorno\n\t\tVMCommands.LRA + \"\\n\" +\n\n\t\t// Salto al Chiamante\n\t\tVMCommands.JS + \"\\n\";\n\n\tMiniFunLib.addFunctionCode(code);\n\n\treturn VMCommands.PUSH + \" \" + labelFun + \"\\n\";\n }", "void mo57277b();", "@Test(timeout = 4000)\n public void test012() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-1983180370));\n FileSystemHandling.appendStringToFile((EvoSuiteFile) null, \"\");\n String[] stringArray0 = new String[0];\n classWriter0.visit(1, 1, \"InnerClasses\", \"\", \"EQIUR?\", stringArray0);\n classWriter0.newField(\"\", \"\", \"\\\"\");\n String[] stringArray1 = new String[4];\n stringArray1[0] = \"\\\"\";\n stringArray1[1] = \"char\";\n stringArray1[2] = \"boolean\";\n stringArray1[3] = \" ,G\";\n MethodWriter methodWriter0 = new MethodWriter(classWriter0, (-1983180370), \" ,G\", \"<T'RwU+)i.UKJX>\", \"\", stringArray1, true, true);\n methodWriter0.visitCode();\n }", "public void mo5251b() {\n }", "public void mo6944a() {\n }", "void mo4833b();", "public bcm a(World paramaqu, int paramInt)\r\n/* 41: */ {\r\n/* 42:56 */ return new bdj();\r\n/* 43: */ }", "void mo57278c();", "public abstract JCodeModel owner();", "public void mo5099c() {\n }", "public Generateur() {\n }", "private NfkjBasic()\n\t\t{\n\t\t\t\n\t\t}", "public abstract String mo9239aw();", "ZenModel createZenModel();", "public void mo21780E() {\n }", "public void mo9241ay() {\n }", "public interface\nExp extends HIR\n{\n\n/** ConstNode (##3)\n * Build HIR constant node.\n * @param pConstSym constant symbol to be attached to the node.\n * @return constant leaf node having operation code opConst.\n**/\n// Constructor (##3)\n// ConstNode( Const pConstSym );\n\n/** getConstSym\n * Get constant symbol attached to this node.\n * \"this\" should be a constant node.\n * @return constant symbol attached to this node.\n**/\nConst\ngetConstSym();\n\n/** SymNode (##3)\n * Build an HIR symbol name node from a symbol name.\n * @param pVar variable name symbol to be attached to the node.\n * @param pSubp subprogram name symbol to be attached to the node.\n * @param pLabel label name symbol to be attached to the node.\n * @param pElem struct/union element name to be attached to the node.\n * @param pField class field name to be attached to the node.\n * @return symbol name node of corresponding class (##2)\n * having operation code opSym.\n**/\n// Constructor (##3)\n// VarNode( Var pVar ); (##3)\n// SubpNode( Subp pSubp ); (##3)\n// LabelNode( Label pLabel ); (##3)\n// ElemNode( Elem pElem ); (##3)\n// FieldNode( Field pField ); (##3)\n\n/** getSym\n * Get symbol from SymNode. (##2)\n * \"this\" should be a SymNode (##2)\n * (either VarNode, SubpNode, LabelNode, ElemNode, or FieldNode). (##2)\n * @return the symbol attached to the node\n * (either Var, Subp, Label, Elem, or Field). (##2)\n**/\n//## Sym\n//## getSym();\n\n/** getVar\n * Get symbol of specified class from SymNode. (##2)\n * \"this\" should be a SymNode.\n * @return the symbol of specified class attached to the node.\n * If the symbol is not attached to the node or if its class is\n * not the specified class, then return null.\n**/\nVar getVar();\n\n/** getSubp\n * Get symbol of spefified class from SymNode. (##2)\n * \"this\" should be a SymNode.\n * @return the symbol of specified class attached to the node.\n * If the symbol is not attached to the node or if its class is\n * not the specified class, then return null.\n**/\nSubp getSubp();\n\n/**\n * getLabel\n * Get symbol of spefified class from SymNode. (##2)\n * \"this\" should be a SymNode.\n * @return the symbol of specified class attached to the node.\n * If the symbol is not attached to the node or if its class is\n * not the specified class, then return null.\n**/\nLabel getLabel();\n\n/**\n * getElem\n * Get symbol of spefified class from SymNode. (##2)\n * \"this\" should be a SymNode.\n * @return the symbol of specified class attached to the node.\n * If the symbol is not attached to the node or if its class is\n * not the specified class, then return null.\n**/\nElem getElem();\n// Field getField();\n\n/** UnaryExp (##3)\n * Build an unary expression having pOperator as its operator\n * and pExp as its source operand.\n * @param pOperator unary operator.\n * @param pExp source operand expression.\n * @return unary expression using pOperator and pExp as its\n * operator and operand.\n**/\n// Constructor (##3)\n// UnaryExp( int pOperator, Exp pExp );\n\n/** BinaryExp (##3)\n * Build a binary expression having pOperator as its operator\n * and pExp1, pExp2 as its source operand 1 and 2.\n * @param pOperator binary operator.\n * @param pExp1 source operand 1 expression.\n * @param pExp2 source operand 2 expression.\n * @return binary expression using pOperator and\n * pExp1 and pExp2 as its operator and operands.\n**/\n// Constructor (##3)\n// BinaryExp( int pOperator, Exp pExp1, Exp pExp2 );\n\n/** getExp1\n * Get source operand 1 from unary or binary expression.\n * \"this\" should be either unary or binary expression.\n * @return the source operand 1 expression of this node.\n**/\nExp\ngetExp1();\n\n/** getExp2\n * Get source operand 2 from binary expression.\n * \"this\" should be a binary expression.\n * @return the source operand 2 expression of this node.\n**/\nExp\ngetExp2();\n\n/** getArrayExp (##2)\n * getSubscriptExp\n * getElemSizeExp (##2)\n * Get a component of a subscripted variable.\n * \"this\" should be a node built by buildSubscriptedVar method.\n * @return a component expression of this subscripted variable.\n**/\nExp getArrayExp(); // return array expression part (pArrayExp).\nExp getSubscriptExp(); // return subscript expression part (pSubscript).\nExp getElemSizeExp(); // return element size part (pElemSize).\n\n/** PointedVar (##3)\n * Build a pointed variable node.\n * @param pPointer pointer expression which may be a compond variable.\n(##2)\n * @param pElement struct/union element name pointed by pPointer.\n * @return pointed variable node having operation code opArrow.\n**/\n// Constructor (##3)\n// PointedVar( Exp pPointer, Elem pElement ); // (##2)\n\n/** getPointerExp\n * getPointedElem\n * Get a component of pointed variable expression.\n * \"this\" should be a node built by buildPointedVar method.\n * @return a component expression of this pointed variable.\n**/\nExp getPointerExp(); // return the pointer expression part (pPointer).\nElem getPointedElem(); // return the pointed element part (pElem).\n\n/** QualifiedVar (##3)\n * Build qualified variable node that represents an element\n * of structure or union.\n * @param pQualifier struct/union variable having elements.\n * @param pElement struct/union element name to be represented.\n * @return qualified variable node having operation code opQual.\n**/\n// Constructor (##3)\n// QualifiedVar( Exp pQualifier, Elem pElement );\n\n/** getQualifier\n * getQualifiedElem\n * Get a component of qualified variable expression.\n * \"this\" should be a node built by BuildQualifiedVar method.\n * @return a component of \"this\" QualifiedVar expression. (##2)\n**/\nExp getQualifierExp(); // return qualifier part (pQualifier).\nElem getQualifiedElem(); // return qualified element part (pelement).\n\n/** FunctionExp (##3)\n * Build a function expression node that computes function value.\n * @param pSubpExp function specification part which may be either\n * a function name, or an expression specifying a function name.\n * @param pParamList actual parameter list.\n * @return function expression node having operation code opCall.\n * @see IrList.\n**/\n// Constructor (##3)\n// FunctionExp( Subp pSubpSpec, IrList pParamList );\n\n/** getSubpSpec (##2)\n * getActualParamList\n * Get a component expression of the function expression. (##2)\n * \"this\" should be a node built by buildFunctionExp.\n * getSubpSpec return the expression specifying the subprogram\n * to be called (pSubpSpec). (##2)\n * getActualParamList return the actual parameter list (pParamList).\n * If this has no parameter, then return null.\n**/\nExp getSubpSpec();\nIrList getActualParamList();\n\n/** findSubpType\n * Find SubpType represented by this expression.\n * If this is SubpNode then return SubpType pointed by this node type,\n * else decompose this expression to find Subpnode.\n * If illegal type is encountered, return null.\n**/\npublic SubpType // (##6)\nfindSubpType();\n\n/** isEvaluable\n * See if \"this\" expression can be evaluated or not.\n * Following expressions are evaluable expression: //##14\n * constant expression,\n * expression whose operands are all evaluable expressions.\n * Expressions with OP_ADDR or OP_NULL are treated as non evaluable.\n * Variable with initial value is also treated as non evaluable\n * because its value may change. //##43\n * @return true if this expression can be evaluated as constant value\n * at the invocation of this method, false otherwise.\n**/\nboolean isEvaluable();\n\n//SF050111[\n///** evaluate\n// * Evaluate \"this\" expression.\n// * \"this\" should be an evaluable expression.\n// * If not, this method returns null.\n// * It is strongly recommended to confirm isEvaluable() returns true\n// * for this expression before calling this method.\n// * @return constant node as the result of evaluation.\n//**/\n//ConstNode evaluate();\n\n/**\n * Evaluate \"this\" expression.\n * @return constant as the result of evaluation or null(when failing in the\n * evaluation)\n**/\npublic Const evaluate();\n\n/**\n * Fold \"this\" expression.\n * evaluate() is called by recursive. If the evaluation succeeded, former node\n * is substituted for the constant node generated as evaluation result.\n * @return constant as the result of evaluation or null (when failing in the\n * evaluation)\n**/\npublic Exp fold();\n//SF050111]\n\n/** evaluateAsInt\n * Evaluate \"this\" expression as int.\n * \"this\" should be an evaluable expression.\n * If not, this method returns 0.\n * It is strongly recommended to confirm isEvaluable() returns true\n * for this expression before calling this method.\n * @return integer value as the result of evaluation.\n**/\n//SF050111 int evaluateAsInt();\npublic int evaluateAsInt(); //SF050111\n\n/**\n * Evaluate \"this\" expression as long.\n * \"this\" should be an evaluable expression. If not, this method returns 0.\n * @return long value as the result of evaluation.\n**/\npublic long evaluateAsLong(); //SF050111\n\n/** evaluateAsFloat\n * Evaluate \"this\" expression as float.\n * \"this\" should be an evaluable expression.\n * If not, this method returns 0.0.\n * It is strongly recommended to confirm isEvaluable() returns true\n * for this expression before calling this method.\n * @return float value as the result of evaluation.\n**/\n//SF050111 float evaluateAsFloat();\npublic float evaluateAsFloat(); //SF050111\n\n/** evaluateAsDouble\n * Evaluate \"this\" expression as double.\n * \"this\" should be an evaluable expression.\n * If not, this method returns 0.0.\n * It is strongly recommended to confirm isEvaluable() returns true\n * for this expression before calling this method.\n * @return float value as the result of evaluation.\n**/\n//SF050111 double evaluateAsDouble();\npublic double evaluateAsDouble(); //SF050111\n\n/** getValueString //##40\n * Evaluate this subtree and return the result as a string.\n * If the result is constant, then return the string representing\n * the constant.\n * If the result is not a constant, then return a string\n * representing the resultant expression.\n * It is strongly recommended to confirm isEvaluable() returns true\n * for this expression before calling this method.\n * @return a string representing the evaluated result.\n**/\npublic String\ngetValueString();\n\n//##84 BEGIN\n/**\n * Adjust the types of binary operands according to the\n * C language specifications\n * (See ISO/IEC 9899-1999 Programming language C section 6.3.1.8).\n * The result is an expression\n * (HIR.OP_SEQ, adjusted_operand1, adjusted_operand2).\n * The operands can be get by\n * ((HIR)lResult.getChild1()).copyWithOperands()\n * ((HIR)lResult.getChild2()).copyWithOperands()\n * @param pExp1 operand 1.\n * @param pExp2 operand 2.\n * @return (HIR.OP_SEQ, adjusted_operand1, adjusted_operand2)\n */\npublic Exp\nadjustTypesOfBinaryOperands( Exp pExp1, Exp pExp2 );\n//##84 END\n\n/** initiateArray //##15\n * Create loop statement to initiate all elements of\n * the array pArray and append it to the initiation block\n * of subprogram pSubp.\n * The initiation statement to be created for pSubp is\n * for (i = pFrom; i <= pTo; i++)\n * pArray[i] = pInitExp;\n * If pSubp is null, set-data statement is generated.\n * @param pArray array variable expression.\n * @param pInitExp initial value to be set.\n * @param pFrom array index start position\n * @param pTo array index end position\n * @param pSubp subprogram containing the initiation statement.\n * null for global variable initiation.\n * @return the loop statement to set initial value.\n**/\npublic Stmt\ninitiateArray(\n Exp pArray, Exp pInitExp,\n Exp pFrom, Exp pTo, Subp pSubp ); //##15\n\n}", "H create(Method method);", "public abstract C0631bt mo9227aB();", "Method createMethod();", "Method createMethod();", "public WorldPhoneOp01() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.<init>():void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.<init>():void\");\n }", "Editor mo117962b();", "Code getCode();", "public native void compile() /*-{\r\n\t\tvar template = [email protected]::getJsObj()();\r\n\t\ttemplate.compile();\r\n\t}-*/;", "@Test(timeout = 4000)\n public void test087() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-1983180372));\n classWriter0.addType(\"H\");\n classWriter0.visitOuterClass(\"H\", \"H\", \"9iniWt>\");\n classWriter0.newField(\"H\", \"H\", \"UNp|{*'V\");\n FileSystemHandling fileSystemHandling0 = new FileSystemHandling();\n String[] stringArray0 = new String[4];\n stringArray0[0] = \"UNp|{*'V\";\n stringArray0[1] = \"9iniWt>\";\n classWriter0.newLong(1);\n stringArray0[2] = \"H\";\n stringArray0[3] = \"UNp|{*'V\";\n boolean boolean0 = true;\n MethodWriter methodWriter0 = new MethodWriter(classWriter0, (-1983180372), \"H\", \"<T'RwU+).UKJX>\", \"H\", stringArray0, true, false);\n classWriter0.newNameTypeItem(\"9iniWt>\", \"UNp|{*'V\");\n Item item0 = new Item();\n methodWriter0.visitInsn(186);\n Label label0 = new Label();\n Attribute attribute0 = new Attribute(\"9iniWt>\");\n methodWriter0.visitIincInsn((-1), 177);\n ClassReader classReader0 = null;\n try {\n classReader0 = new ClassReader(\"HL)rLXrkh@[\");\n fail(\"Expecting exception: IOException\");\n \n } catch(Throwable e) {\n //\n // Class not found\n //\n verifyException(\"org.objectweb.asm.jip.ClassReader\", e);\n }\n }", "ModuleDefine createModuleDefine();", "public abstract String mo41086i();" ]
[ "0.66862863", "0.6232548", "0.60719204", "0.5990177", "0.595375", "0.5911663", "0.5910171", "0.5897931", "0.5883455", "0.58529204", "0.5832868", "0.582639", "0.58224857", "0.58042353", "0.5803472", "0.5798016", "0.5754048", "0.5751809", "0.572214", "0.5719824", "0.57168084", "0.5716327", "0.5715361", "0.57142913", "0.57084054", "0.57054555", "0.56741333", "0.56687516", "0.56418014", "0.56357044", "0.5628557", "0.5614194", "0.5612637", "0.5607016", "0.560602", "0.5603354", "0.55928755", "0.5586001", "0.55834", "0.55814135", "0.5566031", "0.55582255", "0.55509245", "0.55460674", "0.5540987", "0.55313176", "0.5528997", "0.55278134", "0.55219835", "0.5519771", "0.5519374", "0.5517577", "0.55125993", "0.549577", "0.5494953", "0.54949194", "0.54947263", "0.54904383", "0.54868346", "0.54848933", "0.54794973", "0.54791504", "0.54774624", "0.547684", "0.5471304", "0.5468721", "0.54674965", "0.5463207", "0.54575175", "0.5449736", "0.5449573", "0.5448588", "0.54476243", "0.54441094", "0.54435074", "0.54421926", "0.54336137", "0.54318106", "0.5423319", "0.5421373", "0.54142934", "0.5414107", "0.541319", "0.5411413", "0.54104376", "0.54099447", "0.5402482", "0.54022443", "0.53955036", "0.53953373", "0.53951865", "0.5392939", "0.5392689", "0.5392689", "0.5391004", "0.53900564", "0.53885984", "0.53871715", "0.5382582", "0.5371791", "0.53710306" ]
0.0
-1
Private constructor of this factory
IntStrategyFactory() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Factory() {\n\t\tsuper();\n\t}", "private Instantiation(){}", "private PerksFactory() {\n\n\t}", "private ObjectFactory() { }", "public CommonsFactoryImpl() {\n\t\tsuper();\n\t}", "private StickFactory() {\n\t}", "public XCanopusFactoryImpl()\r\n {\r\n super();\r\n }", "Reproducible newInstance();", "protected MoneyFactory() {\n\t}", "private ResourceFactory() {\r\n\t}", "private VegetableFactory() {\n }", "private SimpleRepository() {\n \t\t// private ct to disallow external object creation\n \t}", "private DTOFactory() {\r\n \t}", "private SerializerFactory() {\n // do nothing\n }", "private ConcreteFactory() {}", "private LocatorFactory() {\n }", "public Factory() {\n this(getInternalClient());\n }", "private FactoryCacheValet() {\n\t\tsuper();\n\t}", "public ObjectFactory() {\n\t}", "private CloneFactory() {\n }", "public MystFactoryImpl()\r\n {\r\n super();\r\n }", "public ParameterizedInstantiateFactory() {\r\n super();\r\n }", "public EsoFactoryImpl()\r\n {\r\n super();\r\n }", "protected abstract void construct();", "private StreamFactory()\n {\n /*\n * nothing to do\n */\n }", "public ObjectFactory() {\r\n\t}", "private XmlFactory() {\r\n /* no-op */\r\n }", "private XmlStreamFactory()\n {\n /*\n * nothing to do\n */\n }", "private UnitFactory() {\n\t}", "private WriterFactory() {\n }", "public Constructor(){\n\t\t\n\t}", "private HierarchyFactory ()\n {\n }", "private Builder()\n {\n }", "public PiviFactoryImpl() {\r\n\t\tsuper();\r\n\t}", "private void __sep__Constructors__() {}", "private Rekenhulp()\n\t{\n\t}", "private Builder() {\n }", "private Builder() {\n }", "private ErrorFactory() {\r\n\t}", "public BuiltinFactoryImpl() {\n\t\tsuper();\n\t}", "private ServiceFactory() {}", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }" ]
[ "0.7890318", "0.77736104", "0.7527702", "0.75129366", "0.7493356", "0.74726397", "0.74553454", "0.7430518", "0.7417765", "0.73841", "0.7365888", "0.73500407", "0.73412097", "0.7336717", "0.7332506", "0.7320623", "0.7315528", "0.7287492", "0.72833794", "0.726964", "0.72692263", "0.72642624", "0.7263979", "0.72589916", "0.7253966", "0.72523403", "0.72434527", "0.7235848", "0.72170675", "0.7199969", "0.7179275", "0.7143676", "0.71373177", "0.71336484", "0.7132689", "0.7131355", "0.71265846", "0.71265846", "0.71095365", "0.7103669", "0.7095903", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681", "0.70681" ]
0.0
-1
VARIABLE SELECTORS (nonexhaustive list) Selects the first noninstantiated variable, to branch on it.
public static VariableSelector<IntVar> lexico_var_selector() { return new InputOrder<>(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static VariableSelector<IntVar> minDomainSize_var_selector() {\n return new FirstFail();\n }", "IntVar selectVariable(IntVar[] v) {\r\n\r\n if (v.length != 0) {\r\n int index = 0;\r\n int smallestDomain = Integer.MAX_VALUE;\r\n for(int i = 0; i< v.length-1; i++){\r\n if(v[i].domain.getSize()<smallestDomain){\r\n index = i;\r\n smallestDomain = v[i].domain.getSize();\r\n }\r\n\r\n }\r\n if(v[index].min() == v[index].max()){\r\n\r\n searchVariables = new IntVar[v.length-1];\r\n for (int i = 0; i < v.length-1; i++) {\r\n if(i<index){\r\n searchVariables[i] = v[i];\r\n }\r\n else searchVariables[i] = v[i+1];\r\n\r\n }\r\n }\r\n else{\r\n searchVariables = new IntVar[v.length];\r\n for(int i = 0; i < v.length; i++){\r\n searchVariables[i] = v[i];\r\n }\r\n }\r\n return v[index];\r\n\r\n }\r\n else {\r\n System.err.println(\"Zero length list of variables for labeling\");\r\n return new IntVar(store);\r\n }\r\n }", "@Override\n public Void visitVariableConsequence(GraafvisParser.VariableConsequenceContext ctx) {\n TerminalNode variable = ctx.HID();\n if (!variables.contains(variable.getText())) {\n int line = variable.getSymbol().getLine();\n int column = variable.getSymbol().getCharPositionInLine();\n errors.add(new UndefinedVariableError(line, column, variable.getText()));\n }\n return null;\n }", "public static VariableSelector<IntVar> maxDomainSize_var_selector() {\n return new AntiFirstFail();\n }", "public static VariableSelector<IntVar> random_var_selector(long SEED) {\n return new Random<>(SEED);\n }", "protected <E> String selectUnassignedVariable(CSP<E> csp, Assignment<E> assignment) {\r\n\t\tList<String> unassigned= new ArrayList<String>(); \r\n\t\tfor(String i:csp.variables){\r\n\t\t\tif(!assignment.containsKey(i)){\r\n\t\t\t\tunassigned.add(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tRandom random = new Random();\r\n\t\tint rand=random.nextInt(unassigned.size());\r\n\t\treturn unassigned.get(rand);\r\n\t}", "public IVariable getVariable(int index) {\n return null;\n }", "final public void varcall() throws ParseException {\n jj_consume_token(VARIABLE);\n if(userVals.get(token.image)==null) {\n {if (true) throw new ParseException(\"La variable no ha sido definida.\");}\n }\n }", "public T caseVariable(Variable object) {\n\t\treturn null;\n\t}", "public T caseVariable(Variable object) {\n\t\treturn null;\n\t}", "public T caseVariable(Variable object) {\n\t\treturn null;\n\t}", "public T caseVariableCondition(VariableCondition object)\n {\n return null;\n }", "void defSelect(Variable var){\r\n \t//if (isSelectAll()){\r\n \t\taddSelect(var);\r\n \t//}\r\n }", "public boolean isVariable() {\n return false;\n }", "public IVariable getVariable(Integer id) {\n return null;\n }", "public T caseVariables(Variables object)\n {\n return null;\n }", "public Variable getVariable() {\r\n\t\tObject ob = elementAt(0);\r\n\t\tif (size() == 1 && ob instanceof Variable) {\r\n\t\t\treturn (Variable) ob;\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public T caseVariableDefinition(VariableDefinition object) {\r\n\t\treturn null;\r\n\t}", "public T caseVar(Var object) {\r\n\t\treturn null;\r\n\t}", "@Override\n public Object visitVariableList(LitmusX86Parser.VariableListContext ctx) {\n return null;\n }", "Variable getTargetVariable();", "public void typeCheck(/*@NotNull*/ ExpressionVisitor visitor) throws XPathException {\n Expression value = getSelectExpression();\n if (value != null) {\n value.checkForUpdatingSubexpressions();\n if (value.isUpdatingExpression()) {\n throw new XPathException(\n \"Initializing expression for global variable must not be an updating expression\", \"XUST0001\");\n }\n RoleDiagnostic role = new RoleDiagnostic(\n RoleDiagnostic.VARIABLE, getVariableQName().getDisplayName(), 0);\n ContextItemStaticInfo cit = new ContextItemStaticInfo(AnyItemType.getInstance(), true);\n Expression value2 = TypeChecker.strictTypeCheck(\n value.simplify().typeCheck(visitor, cit),\n getRequiredType(), role, visitor.getStaticContext());\n value2 = value2.optimize(visitor, cit);\n setSelectExpression(value2);\n // the value expression may declare local variables\n SlotManager map = getConfiguration().makeSlotManager();\n int slots = ExpressionTool.allocateSlots(value2, 0, map);\n if (slots > 0) {\n setContainsLocals(map);\n }\n\n if (getRequiredType() == SequenceType.ANY_SEQUENCE && !(this instanceof GlobalParam)) {\n // no type was declared; try to deduce a type from the value\n try {\n final ItemType itemType = value.getItemType();\n final int cardinality = value.getCardinality();\n setRequiredType(SequenceType.makeSequenceType(itemType, cardinality));\n GroundedValue constantValue = null;\n if (value2 instanceof Literal) {\n constantValue = ((Literal) value2).getValue();\n }\n for (BindingReference reference : references) {\n if (reference instanceof VariableReference) {\n ((VariableReference) reference).refineVariableType(\n itemType, cardinality, constantValue, value.getSpecialProperties());\n }\n }\n } catch (Exception err) {\n // exceptions can happen because references to variables and functions are still unbound\n }\n }\n\n\n }\n }", "private ExpSem choose(AST.Expression exp, QvarSem qvar, ExpSem none, FunExpSem some)\n {\n if (qvar instanceof QvarSem.Single &&\n (none == null || none instanceof ExpSem.Single) &&\n some instanceof FunExpSem.Single)\n {\n QvarSem.Single qvar0 = (QvarSem.Single)qvar;\n ExpSem.Single none0 = (ExpSem.Single)none;\n FunExpSem.Single some0 = (FunExpSem.Single)some;\n if (translator.nondeterministic)\n return (ExpSem.Multiple)(Context c)-> \n {\n Seq<Value[]> v = qvar0.apply(c);\n // if (v.get() == null)\n // {\n // if (none0 == null)\n // return Seq.empty();\n // else\n // return Seq.cons(none0.apply(c), Seq.empty());\n // }\n // return v.apply((Value[] v1)->some0.apply(v1).apply(c));\n if (none0 == null)\n return v.apply((Value[] v1)->some0.apply(v1).apply(c));\n else\n return Seq.append(v.apply((Value[] v1)->some0.apply(v1).apply(c)),\n Seq.supplier(()->new Seq.Next<Value>(none0.apply(c), Seq.empty())));\n };\n else\n return (ExpSem.Single)(Context c)-> \n {\n Main.performChoice();\n Seq<Value[]> v = qvar0.apply(c);\n Seq.Next<Value[]> next = v.get();\n if (next == null) \n {\n if (none0 == null)\n {\n translator.runtimeError(exp, \"no choice possible\");\n return null;\n }\n else\n return none0.apply(c);\n }\n else\n return some0.apply(next.head).apply(c);\n };\n }\n else\n {\n QvarSem.Multiple qvar0 = qvar.toMultiple();\n FunExpSem.Multiple some0 = some.toMultiple();\n ExpSem.Multiple none0 = none == null ? null : none.toMultiple();\n return (ExpSem.Multiple)(Context c)->\n {\n Seq<Seq<Value[]>> result = qvar0.apply(c);\n return result.applyJoin((Seq<Value[]> v)->\n {\n if (v.get() == null) \n {\n if (none0 == null)\n return Seq.empty();\n else\n return none0.apply(c);\n }\n return v.applyJoin((Value[] v1)->some0.apply(v1).apply(c));\n });\n };\n }\n }", "private boolean isUnunsedVariable(final String message) {\n\t\treturn message.contains(\"Unused variable\"); //$NON-NLS-1$\n\t}", "private static int isVariable(ArrayList<Variable> vars, String name) {\n\t\tfor (int i = 0; i < vars.size(); i++) {\n\t\t\tif (vars.get(i).name.equals(name)) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "public T caseVarInit(VarInit object) {\r\n\t\treturn null;\r\n\t}", "public Variable getVariable(String name);", "public int indexVar(Node node) {\n Expr ee = getFilter().getExp();\n String name = node.getLabel();\n for (int i = 0; i < 2; i++) {\n if (ee.getExp(i).type() == ExprType.VARIABLE\n && ee.getExp(i).getLabel().equals(name)) {\n return i;\n }\n }\n return -1;\n }", "public Structure select(String varName) {\n List<String> memberNames = new ArrayList<>(1);\n memberNames.add(varName);\n return select(memberNames);\n }", "public static int vars(int varCount, Node n) {\n for (int i = 0; i < n.tokens.size(); i++) {\n if (n.tokens.get(i).tokenID == Token.TokenID.IDENT_tk) {\n if (varCount > 0) {\n int k = find(n.tokens.get(i).instanc);\n if (k == -1) {\n //do nothing\n } else {\n support.error(\"This variable has already been defined: \" + n.tokens.get(i).instanc);\n }\n }\n push(n.tokens.get(i));\n varCount++;\n }\n\n }\n if (n.child1 != null) {\n varCount = +vars(varCount, n.child1);\n }\n\n return varCount;\n }", "public void testNonPermanentVariableResolvedOkNoBinding() throws Exception\n {\n resolveAndAssertSolutions(\"[[g(x), h(x), (f :- g(X), h(Y))], (?- f), [[]]]\");\n }", "public final Instruction select_op() throws RecognitionException {\r\n Instruction inst = null;\r\n\r\n\r\n Constant e1 =null;\r\n\r\n Type fc1 =null;\r\n\r\n Constant e2 =null;\r\n\r\n Type fc2 =null;\r\n\r\n Constant e3 =null;\r\n\r\n Constant variable82 =null;\r\n\r\n\r\n\r\n Constant dest;\r\n int opcode = InstType.selectInst;\r\n List<Type> types = new ArrayList<Type>();\r\n List<Constant> operands = new ArrayList<Constant>();\r\n\r\n try {\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:485:5: ( variable '=' 'select' BOOLEAN_TYPE e1= expression ',' fc1= first_class_type e2= expression ',' fc2= first_class_type e3= expression )\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:485:7: variable '=' 'select' BOOLEAN_TYPE e1= expression ',' fc1= first_class_type e2= expression ',' fc2= first_class_type e3= expression\r\n {\r\n pushFollow(FOLLOW_variable_in_select_op2652);\r\n variable82=variable();\r\n\r\n state._fsp--;\r\n\r\n\r\n match(input,47,FOLLOW_47_in_select_op2654); \r\n\r\n match(input,79,FOLLOW_79_in_select_op2656); \r\n\r\n match(input,BOOLEAN_TYPE,FOLLOW_BOOLEAN_TYPE_in_select_op2658); \r\n\r\n pushFollow(FOLLOW_expression_in_select_op2662);\r\n e1=expression();\r\n\r\n state._fsp--;\r\n\r\n\r\n match(input,44,FOLLOW_44_in_select_op2664); \r\n\r\n pushFollow(FOLLOW_first_class_type_in_select_op2668);\r\n fc1=first_class_type();\r\n\r\n state._fsp--;\r\n\r\n\r\n pushFollow(FOLLOW_expression_in_select_op2672);\r\n e2=expression();\r\n\r\n state._fsp--;\r\n\r\n\r\n match(input,44,FOLLOW_44_in_select_op2674); \r\n\r\n pushFollow(FOLLOW_first_class_type_in_select_op2678);\r\n fc2=first_class_type();\r\n\r\n state._fsp--;\r\n\r\n\r\n pushFollow(FOLLOW_expression_in_select_op2682);\r\n e3=expression();\r\n\r\n state._fsp--;\r\n\r\n\r\n dest = variable82; \r\n types.add(typeFactory.getIntNType(1));\r\n operands.add(e1);\r\n types.add(fc1); operands.add(e2);\r\n types.add(fc2); operands.add(e3);\r\n\r\n }\r\n\r\n\r\n inst = instFactory.createSimpleInst(dest, opcode, operands, types);\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n\r\n finally {\r\n \t// do for sure before leaving\r\n }\r\n return inst;\r\n }", "@Override\r\n\tpublic void visit(VariableExpression variableExpression) {\n\r\n\t}", "@Override\n\tpublic Void visit(ClauseVarType clause, Void ctx) {\n\t\treturn null;\n\t}", "public static IntStrategy random_value(IntVar[] VARS) {\n return random_value(VARS, 0);\n }", "public Closure find_var(String name){\n Closure currentClosure = this;\n while (currentClosure != null){\n if (currentClosure.contains(name)){\n return currentClosure;\n }\n currentClosure = currentClosure.getParent();\n }\n throw new UndefinedVariable();\n }", "public interface IVariable<A extends AbstractDomain<?>> extends IReferenceHolder<A>, ITerm {\n\n\t@SuppressWarnings(\"unchecked\")\n\t@Override\n\tpublic default Set<IVariable<?>> getVariables() {\n\t\tSet<IVariable<?>> values = new HashSet<>();\n\t\tvalues.add((IVariable<AbstractDomain<?>>) this);\n\t\treturn values;\n\t}\n\n\t/**\n\t * Lets the visitor visit the variable.\n\t * \n\t * @param IVariableVisitor\n\t * The visitor.\n\t */\n\tpublic void processWith(IVariableVisitor iVariableVisitor);\n\n\t/**\n\t * Returns whether it is a constant.\n\t * \n\t * @return Whether it is a constant.\n\t */\n\tpublic boolean isConstant();\n}", "public void variableInit(HashSet<MJVariable> initialized)\n\t\t\tthrows TypeCheckerException {\n\t\t\n\t\tif (!(this.init instanceof MJNoExpression)) {\n\t\t\tinitialized.add(this);\n\t\t}\n\n\t}", "boolean isDummy() {\n return var == null;\n }", "private ELOperandToken readVarToken() {\r\n \t\tfState = STATE_VAR;\r\n \t\tint endOfToken = index;\r\n \t\tint ch;\r\n \t\tint type = ELOperandToken.EL_PROPERTY_NAME_TOKEN;\r\n \t\twhile((ch = readCharBackward()) != -1) {\r\n \t\t\tif (!Character.isJavaIdentifierPart(ch)) {\r\n \t\t\t\treleaseChar();\r\n \t\t\t\treturn (endOfToken - index > 0 ? new ELOperandToken(index, endOfToken - index, getCharSequence(index, endOfToken - index), type) : ELOperandToken.EOF);\r\n \t\t\t}\r\n \t\t}\r\n \t\treleaseChar();\r\n \t\treturn (endOfToken - index > 0 ? new ELOperandToken(index, endOfToken - index, getCharSequence(index, endOfToken - index), type) : ELOperandToken.EOF);\r\n \t}", "DAGVariable() {\n this.var = null;\n }", "public static IntStrategy once(VariableSelector<IntVar> VAR_SELECTOR,\n IntValueSelector VAL_SELECTOR,\n IntVar... VARS){\n return new Once(VARS, VAR_SELECTOR, VAL_SELECTOR, assign());\n }", "Node getVariable();", "String getVariable();", "public IExpressionValue getUserDefinedVariable(String key);", "public String isVar(Exp e) {\n if (e instanceof EId) {\n return ((EId) e).id_;\n } else\n throw new TypeException(\"Expected variable but found: \" + e);\n }", "public String getVariable();", "public String visit(VarDeclaration n, String ourclass) {\n String type, name;\n type = n.f0.accept(this, null);\n name = n.f1.accept(this, null);\n if(!ourclass.contains(\" \")){ //class members variables\n vcounter ++;\n integer++;\n variable x = new variable(type, name, vcounter, integer);\n ClassMembers cm = st.cmgetST(ourclass);\n if(cm.checkSameVar(x)){\n System.out.println(\"Variable already exists\");\n return null;\n }\n cm.var.add(x);\n st.cmputST(ourclass, cm);\n }\n else{ //method's variables\n integer++;\n variable x = new variable(type, name, integer);\n String[] parts = ourclass.split(\" \");\n String classname = parts[0]; \n String methodname = parts[1];\n ClassMembers cm=st.cmgetST(classname);\n Method m=cm.meth.get(methodname);\n m.localvars.add(x);\n cm.meth.put(methodname, m);\n st.cmputST(classname, cm);\n }\n return null; \n }", "String getVarDeclare();", "public Variable getVariable(int i) {\r\n\t\treturn getVariables().get(i);\r\n\t}", "static int varno(String v) {\n int i=0;\n if (varlist==null) {System.out.println(\"Varlist null\");}\n while (i<varlist.size() && !v.equals( ((Variable)(varlist.get(i))).ident)) {i++;}\n if (i==varlist.size()) {i=-1;}\n return i;\n }", "private GradsVariable findVar(Variable v2) {\n List<GradsVariable> vars = gradsDDF.getVariables();\n String varName = v2.getFullName();\n for (GradsVariable var : vars) {\n if (var.getName().equals(varName)) {\n return var;\n }\n }\n\n return null; // can't happen?\n }", "private static Collection<CompletionProposal> getVariableCompletionProposals(final CompletionContext context, CPModel model) {\n Collection<CompletionProposal> proposals = new LinkedHashSet<>();\n for (CPElement var : model.getVariables(context.getCaretOffset())) {\n if (var.getType() != CPElementType.VARIABLE_USAGE && !var.getRange().containsInclusive(context.getCaretOffset())) {\n ElementHandle handle = new CPCslElementHandle(context.getFileObject(), var.getName());\n VariableCompletionItem item = new VariableCompletionItem(\n handle,\n var.getHandle(),\n context.getAnchorOffset(),\n null); //no origin for current file\n// var.getFile() == null ? null : var.getFile().getNameExt());\n\n proposals.add(item);\n }\n }\n try {\n //now gather global vars from all linked sheets\n FileObject file = context.getFileObject();\n if (file != null) {\n Map<FileObject, CPCssIndexModel> indexModels = CPUtils.getIndexModels(file, DependencyType.REFERRING_AND_REFERRED, true);\n for (Entry<FileObject, CPCssIndexModel> entry : indexModels.entrySet()) {\n FileObject reff = entry.getKey();\n CPCssIndexModel cpIndexModel = entry.getValue();\n Collection<org.netbeans.modules.css.prep.editor.model.CPElementHandle> variables = cpIndexModel.getVariables();\n for (org.netbeans.modules.css.prep.editor.model.CPElementHandle var : variables) {\n if (var.getType() == CPElementType.VARIABLE_GLOBAL_DECLARATION) {\n ElementHandle handle = new CPCslElementHandle(context.getFileObject(), var.getName());\n VariableCompletionItem item = new VariableCompletionItem(\n handle,\n var,\n context.getAnchorOffset(),\n reff.getNameExt());\n\n proposals.add(item);\n }\n\n }\n\n }\n }\n } catch (IOException ex) {\n Exceptions.printStackTrace(ex);\n }\n\n return proposals;\n }", "@Override\r\n public ASTNode visitVarDef(CoolParser.VarDefContext ctx) {\n if (ctx.init != null) {\r\n return new VarDef(ctx.getStart(), new Id(ctx.name), new Type(ctx.type), (Expression) visit(ctx.init));\r\n }\r\n\r\n return new VarDef(ctx.getStart(), new Id(ctx.name), new Type(ctx.type), null);\r\n }", "@Override\n public R visit(VarOrTerm n, A argu) {\n R _ret = null;\n n.nodeChoice.accept(this, argu);\n return _ret;\n }", "@Test\n\tpublic void testMakeSureVarVariablesCanShadowLetVariables()\n\t{\n\t\tString[] code = {\n\t\t\t\"let a = 1;\",\n\t\t \"let b = 2;\",\n\t\t \"var c = 3;\",\n\n\t\t \"function sup(a) {\",\n\t\t \"var b = 4;\",\n\t\t \"let c = 5;\",\n\t\t \"let d = 6;\",\n\t\t \"if (false) {\",\n\t\t \"var d = 7;\",\n\t\t \"}\",\n\t\t \"return b + c + a + d;\",\n\t\t \"}\",\n\n\t\t \"sup();\"\n\t\t};\n\t\t\n\t\tth.addError(1, 5, \"'a' is defined but never used.\");\n\t th.addError(2, 5, \"'b' is defined but never used.\");\n\t th.addError(3, 5, \"'c' is defined but never used.\");\n\t th.addError(9, 5, \"'d' has already been declared.\");\n\t\tth.test(code, new LinterOptions().set(\"esnext\", true).set(\"unused\", true).set(\"undef\", true).set(\"funcscope\", true));\n\t}", "public T caseVariableDeclarationWithoutInitCS(VariableDeclarationWithoutInitCS object) {\r\n return null;\r\n }", "private String matchVariable(String key) {\n\t\treturn variables.get(key);\n\t}", "VariableDeclarationWithInitCS getResultVariable();", "protected Set<AeScriptVarDef> findVariableReferences() {\r\n AeXPathVariableNodeVisitor visitor = new AeXPathVariableNodeVisitor();\r\n getXPathAST().visitAll(visitor);\r\n return visitor.getVariableReferences();\r\n }", "VarAssignment createVarAssignment();", "@Override\n\tpublic Expr visit(VarExpr e) {\n\t\treturn e;\n\t}", "private SWRLVariable initalizeVariable(String name, SWRLVariable var1) {\n\n if (literalVocabulary.containsKey(name)) {\n var1 = factory.getSWRLVariable(IRI.create(manager.getOntologyDocumentIRI(domainOntology) + \"#\" + literalVocabulary.get(name)));\n } else {\n char variable = this.generateVariable();\n literalVocabulary.put(name, String.valueOf(variable));\n var1 = factory.getSWRLVariable(IRI.create(manager.getOntologyDocumentIRI(domainOntology) + \"#\" + variable));\n }\n\n return var1;\n }", "Variable createVariable();", "Variable createVariable();", "public T caseIteratorExpVariableCS(IteratorExpVariableCS object) {\r\n return null;\r\n }", "public Expression differentiate(String var) {\r\n // var might be a differentiate of other variable\r\n if (!this.toString().equalsIgnoreCase(var)) {\r\n return (Expression) new Num(0);\r\n }\r\n return (Expression) new Num(1);\r\n\r\n }", "private Value findDefVariable(CallGraph cg, Value value) {\n\t\tValue defV=null;\n\t\tfor(Iterator it = cg.sourceMethods(); it.hasNext();){\n\t\t\tSootMethod method =(SootMethod)it.next();\n\t\t\tExceptionalUnitGraph ug = new ExceptionalUnitGraph(method.getActiveBody());\n\t\t\t\n\t\t\tfor(Iterator ugIt = ug.iterator(); ugIt.hasNext();){\n\n\t\t\t\tUnit u = (Unit)ugIt.next();\n\t\t\t\tList<ValueBox> defBoxes = u.getDefBoxes();\n\t\t\t\tfor(ValueBox v : defBoxes){\n\t\t\t\t\tif(!v.getValue().toString().equals(value.toString())){\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tList<ValueBox> uses = u.getUseBoxes();\n\t\t\t\t\tfor(ValueBox use: uses){\n\t\t\t\t\t\tValue newV = use.getValue();\n\t\t\t\t\t\tif(newV instanceof Local){\n\t\t\t\t\t\t\tdefV = findLocalVDef(method, newV);\n\t\t\t\t\t\t}else if(newV instanceof FieldRef){\n\t\t\t\t\t\t\tdefV = findLocalVDef(method, newV);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tdefV = newV;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\treturn defV;\n\t}", "public T caseIntegerVariable(IntegerVariable object) {\n\t\treturn null;\n\t}", "public Variable getVariableContaining(int offset);", "private VariableDeclaration getVarDeclaration(Element statement) {\n VariableDeclaration variableDeclaration = statement.nearestAncestor(VariableDeclaration.class);\n if (variableDeclaration == null) {\n return getNearestElement(statement, VariableDeclaration.class);\n } else {\n return variableDeclaration;\n }\n }", "private Variable getVariable(String varName){\r\n\t\tif(contains(varName)){\r\n\t\t\treturn scopeVariables.get(varName);\r\n\t\t}else{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "Variable(String _var) {\n this._var = _var;\n }", "public T caseVariableDeclarationWithoutInitListCS(VariableDeclarationWithoutInitListCS object) {\r\n return null;\r\n }", "@Override\n public void enterVariableAssignmentStatement(MiniJavaParser.VariableAssignmentStatementContext ctx) {\n Symbol variable = currentScope.lookup(ctx.Identifier().getText());\n if (variable.isField()) {\n mg.loadThis();\n }\n }", "@Override\n public CodeFragment visitVarDecStat(AlangParser.VarDecStatContext ctx) {\n String name = ctx.ID().getText();\n if (this.variableExists(name)) {\n this.addError(ctx, name, \"Variable already declared\");\n return new CodeFragment(\"\");\n }\n\n String alangvartype = ctx.var_type().getText();\n String llvmvartype = Types.getLLVMDefineVartype(alangvartype);\n\n String reg = this.generateNewRegister(true);\n Variable v = new Variable(reg, alangvartype, llvmvartype);\n\n int arity = ctx.index_to_global_array().size();\n v.setArity(arity);\n if (arity > 0) {\n v.setGlobalArray();\n }\n\n for (int i = 0; i < arity; i++) {\n v.addLevel(Integer.valueOf(ctx.index_to_global_array(i).INT().getText()));\n }\n\n this.globals.put(name, v);\n\n return new CodeFragment(\"\");\n }", "public void testVariableInClauseMayTakeMultipleSimultaneousBindings() throws Exception\n {\n resolveAndAssertSolutions(\"[[f(X)], (?- f(x), f(y)), [[]]]\");\n }", "public boolean hasVar1() {\n return fieldSetFlags()[2];\n }", "public static IntStrategy dichotomic(VariableSelector<IntVar> VAR_SELECTOR, boolean LOWERFIRST, IntVar... VARS){\n if(LOWERFIRST){\n return custom(VAR_SELECTOR, ISF.mid_value_selector(LOWERFIRST), DecisionOperator.int_split, VARS);\n }else{\n return custom(VAR_SELECTOR, ISF.mid_value_selector(LOWERFIRST), DecisionOperator.int_reverse_split, VARS);\n }\n }", "public VariableNotFoundException (String var) {\n\t\tthis(\"\", var);\n\t}", "public static boolean variablePattern(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"variablePattern\")) return false;\n boolean r;\n Marker m = enter_section_(b, l, _NONE_, VARIABLE_PATTERN, \"<variable pattern>\");\n r = variablePattern_0(b, l + 1);\n if (!r) r = variablePattern_1(b, l + 1);\n if (!r) r = variablePattern_2(b, l + 1);\n if (!r) r = variablePattern_3(b, l + 1);\n exit_section_(b, l, m, r, false, null);\n return r;\n }", "abstract public boolean isVariableCommand();", "public Variable(){\n name = \"\";\n initialValue = 0;\n }", "public static void main(String[] args) {\n\t\tWhichVar whichVar = new WhichVar();\n\t\tSystem.out.println(\"Which var \" +whichVar.i);\n\t}", "private Variable findVariable(String varToFind){\r\n\t\tScope curScope = this;\r\n\t\twhile (curScope!=null) {\r\n\t\t\tif(curScope.contains(varToFind)){\r\n\t\t\t\treturn curScope.getVariable(varToFind);\r\n\t\t\t}else{\r\n\t\t\t\tcurScope = curScope.parent;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "private void assignUninitialisedGlobalVar(Variable lastAppearanceOfVar,String valueName)throws\r\n\t\t\tTypeNotSupportedException{\r\n\t\t\tVariable variablesCopy = vFactory.createVariable(true, false, lastAppearanceOfVar.isArgument(),\r\n\t\t\t\t\tlastAppearanceOfVar.getType(), true);\r\n\t\t\tuninitialisedGlobalVariables.put(valueName, variablesCopy);\r\n\t}", "@Override\n\tpublic Set<Variable> getDefVariables() {\n\t\tSet<Variable> used = new HashSet<Variable>();\n\t\treturn used;\n\t}", "public static VariableSelector<IntVar> maxRegret_var_selector() {\n return new MaxRegret();\n }", "private void extractVarMethod(Scope root, List<ParseTree> children) {\n Feature feature = null;\n for (int j = 1; j < children.size(); j++) {\n if (children.get(j + 1).getText().equalsIgnoreCase(\")\")) break;\n if (children.get(j).getText().equalsIgnoreCase(\",\")\n || children.get(j).getText().equalsIgnoreCase(\"(\")) {\n if (children.get(j) instanceof CommonToken) {\n feature = new Feature(children.get(j + 1).getText(), ScopeType.VAR, \"\", ((CommonToken) children.get(j)).getLine());\n } else {\n feature = new Feature(children.get(j + 1).getText(), ScopeType.VAR, \"\", -1);// todo\n }\n if (children.get(j + 2) instanceof MoolaParser.MoolaTypeContext) {\n feature.setFieldType(((MoolaParser.MoolaTypeContext) children.get(5)).st.children.stream().map(ParseTree::getText).reduce((s, s2) -> s + s2));\n j++;\n }\n root.getInner_level().add(feature);\n j++;\n }\n }\n }", "public T caseExpresionVar(ExpresionVar object)\n {\n return null;\n }", "@Override\n public R visit(VarOrIRIref n, A argu) {\n R _ret = null;\n n.nodeChoice.accept(this, argu);\n return _ret;\n }", "@Override\n public void enterVar_assign(FSMParser.Var_assignContext ctx) {\n if (findComp(ctx.var().NAME().getText()) == null) {\n Var temp = new Var(\n ctx.var().NAME().getText(),\n Integer.parseInt(ctx.var().INT().getText()),\n false, false, false);\n this.comps.add(temp);\n\n }\n }", "Aliasing getVariable();", "public Object caseVariabilityElement(VariabilityElement object) {\n\t\treturn null;\n\t}", "Variable getSourceVariable();", "@Override\n\tprotected String getVariableClassName() {\n\t\treturn \"variable\";\n\t}", "@Override\n public String visit(VariableDeclarator n, Object arg) {\n return null;\n }", "public static IntStrategy lexico_Neq_LB(IntVar... VARS) {\n return custom(lexico_var_selector(), min_value_selector(), remove(), VARS);\n }", "private void checkValue(Variable toBeVariable) throws MethodCallWithNonexistentParameter {\n if (!toBeVariable.hasValue()) {\n throw new MethodCallWithNonexistentParameter();\n }\n }", "void collect(){\r\n\t\tif (getValues() != null){\r\n\t\t\tfor (Variable var : getValues().getVariables()){\r\n\t\t\t\tdefSelect(var);\r\n\t\t\t}\r\n\t\t}\r\n\t}" ]
[ "0.6273803", "0.6046351", "0.5988261", "0.5907913", "0.58938324", "0.58509344", "0.5668354", "0.5622567", "0.56205857", "0.56205857", "0.56205857", "0.5547056", "0.5475111", "0.5420171", "0.53305864", "0.5313075", "0.53089666", "0.52877694", "0.5276816", "0.5244032", "0.52369237", "0.5230646", "0.521166", "0.5183344", "0.51652634", "0.5149298", "0.5135473", "0.51292443", "0.5103284", "0.5068336", "0.50668406", "0.5061895", "0.5061587", "0.5045322", "0.5044591", "0.50418675", "0.5040049", "0.5031092", "0.50182295", "0.50019735", "0.49849182", "0.4959263", "0.49571827", "0.49545163", "0.49470732", "0.4943803", "0.4942615", "0.4940789", "0.49397862", "0.49379626", "0.49273124", "0.49255437", "0.4924624", "0.49173898", "0.49158096", "0.49098802", "0.4907678", "0.49053413", "0.4904127", "0.49027437", "0.49008948", "0.48977908", "0.48938724", "0.48738125", "0.48738125", "0.4872021", "0.48696628", "0.48625785", "0.4860119", "0.4859025", "0.48541033", "0.48452607", "0.48419955", "0.48400858", "0.4840051", "0.48313648", "0.48304725", "0.4827424", "0.48263913", "0.4812985", "0.48046705", "0.4804065", "0.47993568", "0.47983998", "0.47968826", "0.4789693", "0.47868642", "0.47836486", "0.47724837", "0.47669393", "0.47586587", "0.47565854", "0.4753766", "0.47528154", "0.4745193", "0.47414482", "0.47414175", "0.47413102", "0.47326446", "0.4732004" ]
0.60790676
1
Selects randomly a noninstantiated variable to branch on
public static VariableSelector<IntVar> random_var_selector(long SEED) { return new Random<>(SEED); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void getRandomNumber() {\n\t\tRandom generator = new Random();\n\t\trandomNumber = generator.nextInt(POSSIBLE_CHOICE.length);\n\t}", "private static Option pickRandom() {\n\t\treturn Option.values()[rand.nextInt(3)];\n\t}", "private void random() {\n\n\t}", "private void assuerNN_random() {\n //Check, if the variable is null..\n if (this.random == null) {\n //..and now create it.\n this.random = new Random(10);\n }\n }", "protected void randInitialize(Variable variable) {\n if (variable instanceof Combining) {\n Combining comb = (Combining) variable;\n comb.setValue(pprng.nextInt(comb.getNumberOfAlternatives()));\n } else if (variable instanceof Assigning) {\n //this covers initialization for both assigning and connecting\n Assigning assign = (Assigning) variable;\n for (int i = 0; i < assign.getNumberOfLHS(); i++) {\n for (int j = 0; j < assign.getNumberOfRHS(); j++) {\n if(pprng.nextBoolean())\n assign.connect(i,j);\n }\n }\n// assign.connect(0,0);\n// assign.connect(6,0);\n// assign.connect(7,0);\n// assign.connect(11,0);\n// assign.connect(1,1);\n// assign.connect(6,1);\n// assign.connect(10,1);\n// assign.connect(5,2);\n// assign.connect(6,2);\n// assign.connect(4,3);\n// assign.connect(5,3);\n// assign.connect(11,3);\n// assign.connect(5,4);\n// assign.connect(7,4);\n// assign.connect(8,4);\n// assign.connect(9,4);\n// assign.connect(10,4);\n \n } else {\n System.err.println(\"can not initialize unknown type\");\n }\n }", "private int choose(){\n\t\tdouble temp = 10 * Math.random();\n\t\tint i = (int)temp;\n\t\treturn i;\n\t}", "public S getRandomState();", "protected NNode getRandomNode() {\n\t\tArrayList<NNode> nodearr = new ArrayList<NNode>();\n\t\tnodearr.addAll(nodes.values());\n\t\treturn nodearr.get(Braincraft.randomInteger(nodearr.size()));\n\t}", "protected <E> String selectUnassignedVariable(CSP<E> csp, Assignment<E> assignment) {\r\n\t\tList<String> unassigned= new ArrayList<String>(); \r\n\t\tfor(String i:csp.variables){\r\n\t\t\tif(!assignment.containsKey(i)){\r\n\t\t\t\tunassigned.add(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tRandom random = new Random();\r\n\t\tint rand=random.nextInt(unassigned.size());\r\n\t\treturn unassigned.get(rand);\r\n\t}", "private static TETile randomTile() {\n int tileNum = RANDOM.nextInt(5);\n switch (tileNum) {\n case 0: return Tileset.TREE;\n case 1: return Tileset.FLOWER;\n case 2: return Tileset.GRASS;\n case 3: return Tileset.SAND;\n case 4: return Tileset.MOUNTAIN;\n default: return Tileset.NOTHING;\n }\n }", "public int getRandom() {\n ListNode pick = null;\n ListNode p = head;\n int count = 1;\n while (p != null) {\n if (rand.nextInt(count) == 0) {\n pick = p;\n }\n p = p.next;\n count++;\n }\n return pick.val;\n }", "private String getRandomName(){\n return rndString.nextString();\n }", "public Hazard selectRandom() {\r\n\t\tRandom gen = new Random();\r\n\t\treturn hazards.get(gen.nextInt(hazards.size()));\r\n\t}", "private double getRandom() {\n return 2*Math.random() - 1;\n }", "private void setRand(){\n rand = generator.nextInt(9) + 1;\n }", "Randomizer getRandomizer();", "public static void Random() {\n\t\tRandom ran =new Random();\r\n\t\trandom=ran.nextInt(6)+1;\r\n\t\t//random=1;\r\n\t\twho=A1063307_GUI.who2;\r\n\t\tif((ch[who].status)>0) {\r\n\t\t\tch[who].location=(ch[who].location)+random;\r\n\t\t\tch[who].status=(ch[who].status)-1;\r\n\t\t\t\r\n\t\t}else {\r\n\t\t\t\treturn;\r\n\t\t\t}\t\t\r\n\t}", "private static TETile getRandomTile() {\n Random r = new Random();\n int tileNum = r.nextInt(5);\n switch (tileNum) {\n case 0: return Tileset.FLOWER;\n case 1: return Tileset.MOUNTAIN;\n case 2: return Tileset.TREE;\n case 3: return Tileset.GRASS;\n case 4: return Tileset.SAND;\n default: return Tileset.SAND;\n }\n }", "private Node pickRandomNode(){\r\n\t\tNode node = null;\r\n\r\n\t\ttry (Transaction tx = graphDb.beginTx()){\r\n\t\t\t//Find a random node from the database, using the unique id attribute\r\n\t\t\tint nodeId = random.nextInt(totalGraphNodes);\r\n\t\t\t//node = graphDb.findNode(LabelEnum.Person, \"id\" , nodeId);\r\n\t\t\tnode = graphDb.getNodeById(nodeId);\r\n\t\t\ttx.success();\r\n\t\t}\r\n\t\treturn node;\r\n\t}", "public static int randomNext() { return 0; }", "protected Random get_rand_value()\n {\n return rand;\n }", "public int a(Random var1)\r\n {\r\n return 0;\r\n }", "public static IntStrategy random_value(IntVar[] VARS) {\n return random_value(VARS, 0);\n }", "private void selectRandomPlayer() {\n Random rand = new Random();\n // Restrict random number range to available indexes in the players list.\n // - 1 to offset zero-based index numbering.\n int random = rand.nextInt(players.size());\n activePlayer = players.get(random);\n }", "public static IntStrategy random_value(IntVar[] VARS, long SEED) {\n for (IntVar v : VARS) {\n if (!v.hasEnumeratedDomain()) {\n throw new UnsupportedOperationException(\"Some variables have bounded domains, \" +\n \"please use random heuristic instead\");\n }\n }\n return custom(random_var_selector(SEED), random_value_selector(SEED), VARS);\n }", "public static int randomGet() { return 0; }", "RandomizedRarestFirstSelector(Random random) {\n this.random = random;\n }", "T getRandomAllowedValue();", "public Player getRandomTarget() {\n\t\tPlayer target = null;\n\t\tint rand = Battleground.getRandomNumber(1, 5);\n\t\tswitch (rand) {\n\t\tcase 1:\n\t\t\tif (Battleground.captainAmerica.stillAlive()) {\n\t\t\t\ttarget = Battleground.captainAmerica;\n\t\t\t\tbreak;\n\t\t\t}\n\t\tcase 2:\n\t\t\tif (Battleground.hawkeye.stillAlive()) {\n\t\t\t\ttarget = Battleground.hawkeye;\n\t\t\t\tbreak;\n\t\t\t}\n\t\tcase 3:\n\t\t\tif (Battleground.blackWidow.stillAlive()) {\n\t\t\t\ttarget = Battleground.blackWidow;\n\t\t\t\tbreak;\n\t\t\t}\n\t\tcase 4:\n\t\t\tif (Battleground.hulk.stillAlive()) {\n\t\t\t\ttarget = Battleground.hulk;\n\t\t\t\tbreak;\n\t\t\t}\n\t\tcase 5:\n\t\t\tif (Battleground.thor.stillAlive()) {\n\t\t\t\ttarget = Battleground.thor;\n\t\t\t\tbreak;\n\t\t\t}\n\t\tdefault:\n\t\t\ttarget = Battleground.captainAmerica;\n\t\t\tbreak;\n\t\t}\n\t\treturn target;\n\t}", "public void SetRandom(boolean random);", "private void loadRandomState() {\n patternName = \"Random\";\n\n for (int i = 0; i < NUMCELLS; i++)\n currentState[i] = (rand.nextInt() > 0x40000000) ? (byte)1 : (byte)0;\n\n generations = 0;\n }", "private Random rand()\n\t{\n\t\treturn new Random();\n\t}", "private static int get() { \r\n Random r = new Random();\r\n return (r.nextInt(9));\r\n }", "public abstract void randomize();", "public void set_random_choice()\r\n\t{\r\n\t\tfor (int i=0 ; i<size ; i++)\r\n\t\t{\r\n\t\t\tnumbers.add(get_not_selected_random_digit());\r\n\t\t}\r\n\t}", "private double getRandomNumber(){\n double rand = Math.random();//produce a number between 0 and 1\n rand = rand - 0.5;\n return rand;\n }", "public abstract int getRandomDamage();", "public Random getRandom() {\n\t\treturn (rand);\n\t}", "Boolean getRandomize();", "public void randomize() {\n\t\tx = ThreadLocalRandom.current().nextInt(0, 499 + 1);\n\t\ty = ThreadLocalRandom.current().nextInt(0, 499 + 1);\n\t}", "public static int getRandom() \n\t{\n\t\treturn rGenerator.nextInt();\n\t}", "private static Position fetchRandomPosition(){\n return new Position(0,0).returnRandomPosition();\n }", "public void generateRandomVaraibles() {\r\n\r\n\t\tfor (DataVariable var : dataTestModel) {\r\n\t\t\tif (!var.getType().equals(\"LOCAL_DATA\") && !var.getType().equals(\"OUTPUT_DATA\")) {\r\n\t\t\t\tif (var.getType().equals(\"boolean\") || var.getType().equals(\"Boolean\")) {\r\n\t\t\t\t\tvar.setValue(String.valueOf(getRandomBoolean()));\r\n\r\n\t\t\t\t} else if (var.getType().equals(\"int\")) {\r\n\t\t\t\t\tif (var.getMinimumValue() != null && var.getMinimumValue().length() > 0\r\n\t\t\t\t\t\t\t&& var.getMaximumValue() != null && var.getMaximumValue().length() > 0) {\r\n\t\t\t\t\t\tvar.setValue(String.valueOf(randomInt(Integer.parseInt(var.getMinimumValue()),\r\n\t\t\t\t\t\t\t\tInteger.parseInt(var.getMaximumValue()))));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar.setValue(String.valueOf(randomInt(0, 100)));\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (var.getType().equals(\"double\")) {\r\n\t\t\t\t\tif (var.getMinimumValue() != null && var.getMinimumValue().length() > 0\r\n\t\t\t\t\t\t\t&& var.getMaximumValue() != null && var.getMaximumValue().length() > 0) {\r\n\t\t\t\t\t\tvar.setValue(String.valueOf(randomDouple(Double.parseDouble(var.getMinimumValue()),\r\n\t\t\t\t\t\t\t\tDouble.parseDouble(var.getMaximumValue()))));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar.setValue(String.valueOf(randomDouple(0.0, 100.0)));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static EnumCardNumber pickRandom() {\r\n\t\treturn values()[Tools.Numbers.randomInt(0, values().length - 1)];\r\n\t}", "public void removeRandom() {\n Node[] nodes = getRandomNonterminalNode(false);\n if (nodes == null)\n return;\n \n // Generate random DecisionNode to replace\n DecisionNode replacementNode = DecisionNode.getRandom();\n \n // Update prev reference\n if (nodes[PREV].left == nodes[CURR]){\n nodes[PREV].left = replacementNode;\n } else {\n nodes[PREV].right = replacementNode;\n }\n }", "public int getRandom() {\n return sub.get(rand.nextInt(sub.size()));\n }", "public City randomlyAssignCity()\n {\n int cityReferenceNumber = (int)(Math.random()*(getContainerSize() - 1)) + 1;\n City randomCity = cityContainer.get(cityReferenceNumber);\n \n return randomCity;\n }", "public void setRandom(Random r) {\n this.r = r;\n }", "Chromosome getRandom();", "public static void randomInit(int r) { }", "public static Object getRandom(Object... kv)\n {\n return getRandom(distributeChance(kv));\n }", "public T next(final Random random) {\n return elements[selection.applyAsInt(random)];\n }", "public abstract boolean isRandom();", "private void selectRandom() {\n\n\t\tRandom randomise;\n\n\t\t// Select random char from Spinner only if it is enabled\n\t\tif (solo.getCurrentSpinners().get(0).isEnabled()) {\n\t\t\trandomise = new Random();\n\t\t\trandomCharPos = randomise.nextInt(solo.getCurrentSpinners().get(1)\n\t\t\t\t\t.getCount());\n\n\t\t\tsolo.pressSpinnerItem(0, randomCharPos);\n\t\t\tsolo.goBackToActivity(\"OptionsActivity\");\n\n\t\t\trandomChar = solo.getCurrentSpinners().get(0).getSelectedItem()\n\t\t\t\t\t.toString();\n\t\t}\n\n\t\t// Select random act from Spinner\n\t\trandomise = new Random();\n\t\trandomActPos = randomise.nextInt(solo.getCurrentSpinners().get(1)\n\t\t\t\t.getCount());\n\n\t\tsolo.pressSpinnerItem(1, randomActPos);\n\t\tsolo.goBackToActivity(\"OptionsActivity\");\n\n\t\trandomAct = solo.getCurrentSpinners().get(1).getSelectedItem()\n\t\t\t\t.toString();\n\n\t\t// Select random page from Spinner\n\t\trandomise = new Random();\n\t\trandomPagePos = randomise.nextInt(solo.getCurrentSpinners().get(2)\n\t\t\t\t.getCount());\n\n\t\tsolo.pressSpinnerItem(2, randomPagePos);\n\t\tsolo.goBackToActivity(\"OptionsActivity\");\n\n\t\trandomPage = solo.getCurrentSpinners().get(2).getSelectedItem()\n\t\t\t\t.toString();\n\t}", "public static Ally getRandomRep () {\n return republican[(int) (Math.random() * republican.length)];\n }", "private void random() {\n GameState gs = cc.getGameState();\n ArrayList<int[]> moves = cc.getPlayerMoves(player);\n ArrayList<GameState> states = nextStates(moves, gs);\n for (int[] m : moves) {\n GameState next = checkMove(m, cc);\n states.add(next);\n }\n Random rand = new Random(System.nanoTime());\n int i = rand.nextInt(states.size());\n cc.setAIMove(states.get(i));\n }", "private static String getRandomType(){\r\n int index = r.nextInt(typeOfRooms.length);\r\n return typeOfRooms[index];\r\n }", "public RandomNeighborhoodOperator(int nbRelaxedVars, long seed)\n{\n\trandom = new Random(seed);\n\tthis.nbRelaxedVars = nbRelaxedVars;\n\tselected = new TIntHashSet();\n}", "static Place getRandomPlace()\r\n\t{\r\n\t\tPlace randomPlace = knownPlaces.get( new Random().nextInt ( knownPlaces.size()));\r\n\t\treturn randomPlace;\r\n\t}", "public void setRandom(boolean random){\n this.random = random;\n }", "public Position sampleRandomUniformPosition();", "@Test\n\tpublic void myRandomTest() throws IllegalArgumentException, IllegalAccessException {\n\t\t\n\t\tif (Configuration.featureamp &&\n\t\t\t\tConfiguration.playengine &&\n\t\t\t\tConfiguration.choosefile &&\n\t\t\t\tConfiguration.mp3 &&\n\t\t\t\tConfiguration.gui &&\n\t\t\t\tConfiguration.skins &&\n\t\t\t\tConfiguration.light &&\n\t\t\t\tConfiguration.filesupport &&\n\t\t\t\tConfiguration.showtime &&\n\t\t\t\tConfiguration.tracktime) {\n\t\t\n\t\tstart();\n\t\tint n = gui.myRandom(1, 1);\n\t\tassertTrue(n == 1);\n\n\t\tn = gui.myRandom(2, 2);\n\t\tassertTrue(n == 2);\n\n\t\tn = gui.myRandom(0, 0);\n\t\tassertTrue(n == 0);\n\t\t\n\t\tn = gui.myRandom(4, 4);\n\t\tassertTrue(n == 4);\n\n\t\tn = gui.myRandom(1000, 1001);\n\t\tassertTrue(n == 1000 || n == 1001);\n\t\t\n\t\t}\n\t}", "private void chooseBreedToBeIdentified() {\n Random r = new Random();\n int questionBreedIndex = r.nextInt(3);\n\n questionCarMake = displayingCarMakes.get(questionBreedIndex);\n carMakeNameTitle.setText(questionCarMake);\n }", "public void chooseWord() {\n int length = words.size();\n int index = (int) ((length - 1) * Math.random());\n word = words.get(index);\n }", "public static char casillaRandom() {\r\n char pool[] = {'b', 'p', 's', 'd'};\r\n\r\n int indiceRandom = (int) (Math.random() * 4);\r\n\r\n char selected = pool[indiceRandom];\r\n\r\n return selected;\r\n }", "public int getRandom(int bound) {\n return ThreadLocalRandom.current().nextInt(bound);\n }", "private int getRandomPiece() {\r\n return new Random().nextInt(Constants.NUM_PIECES);\r\n }", "public frameTableElement findVictimRandom(int randomNum){\n return frameTable.getElement(randomNum % totalNumPages);\n\n }", "public int getRandom() {\n return lst.get(rand.nextInt(lst.size()));\n }", "public static Position getRandomPosition() {\n\t\tRandom rand = new Random();\n\t\treturn values()[rand.nextInt(values().length)];\n\t}", "private Direction selectRandomDirection(List<Direction> possibleDirections) {\n\t\tint random = (int) (Math.random() * possibleDirections.size());\n\t\treturn possibleDirections.get(random);\n\t}", "public int getRandom() {\n Integer ans = null;\n while (ans == null) {\n int r = random.nextInt(size);\n ans = allSet[r];\n if (!realSet.contains(ans)) {\n ans = allSet[r] = null;\n }\n }\n return ans;\n }", "public void generateComputerChoice() {\n\t\tgetRandomNumber();\n\t\tsetComputerChoice();\n\t}", "private int generateRandomNumber() {\n\t\treturn new SplittableRandom().nextInt(0, 3);\n\t}", "private void chooseSprite()\r\n\t{\r\n\t\t//Ensure pedestrian sprites exist\r\n\t\tif (sprites.isEmpty()) {\r\n\t\t\tSystem.err.println(\"ERROR: No pedestrian sprites have been loaded\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//Select a random sprite\r\n\t\tint index = (int) Math.floor( Math.random()*sprites.size() );\r\n\t\tspriteName = sprites.get(index);\r\n\t\tsetSprite(\"pedestrians/\"+spriteName);\r\n\t}", "Point getRandomPoint() {\n\t\t\t\t\tdouble val = Math.random() * 3;\n\t\t\t\t\tif (val >=0.0 && val <1.0)\n\t\t\t\t\t\treturn p1;\n\t\t\t\t\telse if (val >=1.0 && val <2.0)\n\t\t\t\t\t\t\treturn p2;\n\t\t\t\t\telse\n\t\t\t\t\t\t\treturn p3;\n\t\t\t\t\t}", "public static String randomSelection() {\n int min = 1;\n int max = 3;\n String randomSelection;\n Random random = new Random(System.currentTimeMillis());\n int randomNumber = random.nextInt((max - min) +1) +min;\n if(randomNumber == 1) {\n randomSelection = \"rock\";\n } else if (randomNumber == 2) {\n randomSelection = \"paper\";\n } else {\n randomSelection = \"scissors\";\n }\n return randomSelection;\n }", "private Item chooseValidItem()\n {\n\n // Sets the intial random value.\n int numberRandom = random.nextInt(items.size());\n\n while (trackItems.contains(items.get(numberRandom).getName())){\n numberRandom = random.nextInt(items.size());\n }\n\n // Loops until a unused value is assigned to numberRandom,\n // within the array list size.\n \n trackItems.push(items.get(numberRandom).getName());\n\n return items.get(numberRandom);\n }", "public String chooseWord(){\n\t\tRandom a = new Random();\t\t\r\n\t\t\r\n\t\tint randomNumber = a.nextInt(words.length);\r\n\t\t\r\n\t\tString gameWord = words[randomNumber];\r\n\t\t\r\n\t\treturn gameWord;\r\n\t\t\t\t\r\n\t}", "private int randomValue() {\r\n\t\tRandom rand = new Random();\r\n\t\tint val = rand.nextInt(10);\r\n\t\tif(val == 9)\r\n\t\t\treturn 4;\r\n\t\telse\r\n\t\t\treturn 2;\r\n\t}", "public double getRandom(){\n\t\treturn random.nextDouble();\n\t}", "private String randomCityId(RandomNumberGenerator random) {\n long targetPop = (long) (random.rand() * totalPopulation);\n\n for (Map.Entry<String, Long> city : populationByCityId.entrySet()) {\n targetPop -= city.getValue();\n\n if (targetPop < 0) {\n return city.getKey();\n }\n }\n\n // should never happen\n throw new RuntimeException(\"Unable to select a random city id.\");\n }", "public Clue getRandomClue()\n {\n HashMap<String, Clue> usableClues = getUseableClues();\n ArrayList<Clue> list = new ArrayList<>(usableClues.values());\n int i = rand.nextInt(usableClues.size());\n return list.get(i);\n }", "String selectRandomSecretWord();", "private IUnit getRandomCacheUnit(){\n\t\tcache = new UnitCache();\n\t\treturn cache.getUnit(rnd.nextInt(cache.getSize()));\n\t}", "public DataSetMember<t> getRandomMember()\n\t{\n\t\tRandom R = new Random();\n\t\tint i = R.nextInt(_data.size());\n\t\treturn _data.get(i);\n\t}", "public void randomize() {\r\n\t\tRandom random = new Random();// random generator used to get random int\r\n\t\tint r;// will hold the random int\r\n\t\tint num;// will hold the filtered random int that determines with entity to use for a tile\r\n\t\tfor (int i = 0; i < WIDTH_TILES; i++) {// loops x-coords\r\n\t\t\tfor (int j = 0; j < HEIGHT_TILES; j++) {// loops y-coords\r\n\t\t\t\tr = random.nextInt(32);// gets random int from 0 to 32\r\n\t\t\t\tif (r < 4) num = 0; else if (r < 8) num = 1; else if (r < 31) num = 2; else num = 3;// distributes different objects\r\n\t\t\t\tif (nodes[i * WIDTH_TILES + j].isOccupied() == false) {// if tile empty or random chosen\r\n\t\t\t\t\tnodes[i * WIDTH_TILES + j] = new Node(new Point(i * BOARD_WIDTH / WIDTH_TILES, j * BOARD_WIDTH / HEIGHT_TILES), new ImageIcon(icons[num]).getImage(), true, occupants[num]);// creates random tile\r\n\t\t\t\t}// if (random)\r\n\t\t\t}// for (j)\r\n\t\t}// for (i)\r\n\t}", "public int getRandom() {\n return A.get(r.nextInt(A.size()));\n }", "private void chooseRandomTweet() {\n if (random.nextBoolean()) {\n realTweet = true;\n displayRandomTrumpTweet();\n } else {\n realTweet = false;\n displayRandomFakeTweet();\n }\n }", "public final void rand() {\n\t\tpush(randomNumberGenerator.nextDouble());\n\t}", "public int getRandom() {\n int index = rnd.nextInt(list.size());\n return list.get(index).val;\n }", "private IUnit getRandomListUnit(){\n\t\treturn unitList.get(rnd.nextInt(unitListSize()));\n\t}", "private void randomBehavior() {\n\t\trandom = rand.nextInt(50);\n\t\tif (random == 0) {\n\t\t\trandom = rand.nextInt(4);\n\t\t\tswitch (random) {\n\t\t\t\tcase 0:\n\t\t\t\t\tchangeFacing(ACTION.DOWN);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tchangeFacing(ACTION.RIGHT);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tchangeFacing(ACTION.UP);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tchangeFacing(ACTION.LEFT);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "@Test\n \tpublic void testTargetRandomSelection() {\n \tComputerPlayer player = new ComputerPlayer();\n \t// Pick a location with no rooms in target, just three targets\n \tboard.calcTargets(23, 7, 2);\n \tint loc_24_8Tot = 0;\n \tint loc_22_8Tot = 0;\n \tint loc_21_7Tot = 0;\n \t// Run the test 100 times\n \tfor (int i=0; i<100; i++) {\n \t\tBoardCell selected = player.pickLocation(board.getTargets());\n \t\tif (selected == board.getRoomCellAt(24, 8))\n \t\t\tloc_24_8Tot++;\n \t\telse if (selected == board.getRoomCellAt(22, 8))\n \t\t\tloc_22_8Tot++;\n \t\telse if (selected == board.getRoomCellAt(21, 7))\n \t\t\tloc_21_7Tot++;\n \t\telse\n \t\t\tfail(\"Invalid target selected\");\n \t}\n \t// Ensure we have 100 total selections (fail should also ensure)\n \tassertEquals(100, loc_24_8Tot + loc_22_8Tot + loc_21_7Tot);\n \t// Ensure each target was selected more than once\n \tassertTrue(loc_24_8Tot > 10);\n \tassertTrue(loc_22_8Tot > 10);\n \tassertTrue(loc_21_7Tot > 10);\t\t\t\t\t\t\t\n }", "public int monsterAttack(){\n Random ran = new Random();\n return ran.nextInt(4);\n }", "@Override\n public int attack() {\n return new Random().nextInt(5);\n }", "public static CubeState getRandom(){\n CubeState cs = new CubeState();\n Random rand = new Random();\n for (int i = 0; i < 20; i++) {\n cs = cs.times(Solver.generators.get(rand.nextInt(18)));\n }\n return cs;\n }", "public static PickupType random(){\n Array<PickupType> types = new Array<PickupType>(PickupType.values());\n types.shuffle();\n return types.random();\n }", "private void selectRandomUnexploredProfile(GameObserver gameObs) {\n if (eGame.getTotalNumSamples() >= eGame.getNumProfiles() ||\n gameObs.numObsLeft() <= 0) return;\n\n eGame.getRandomProfile(currentOutcome);\n while (eGame.getNumSamples(currentOutcome) > 0) {\n eGame.getRandomProfile(currentOutcome);\n }\n\n sampleAndUpdate(currentOutcome, gameObs);\n }", "private int RandomResourceValue(int playerNumber) {\n\t\tArrayList<Integer> excludedNumbers = new ArrayList<>();\n\t\tfor (int i = 0; i < CurrentPlayer.resources.length; i++) {\n\t\t\tif (robberPlayers.get(playerNumber).resources[i] == 0)\n\t\t\t\texcludedNumbers.add(i);\n\t\t}\n\t\tRandom r = new Random();\n\t\tint randomVariable = 0;\n\t\trandomVariable = r.nextInt(5 - 0) + 0;\n\n\t\tif (excludedNumbers.size() < 5) {\n\t\t\twhile (excludedNumbers.contains(randomVariable)) {\n\t\t\t\trandomVariable = r.nextInt(5 - 0) + 0;\n\t\t\t}\n\t\t}\n\t\treturn randomVariable;\n\t}" ]
[ "0.66364324", "0.6471506", "0.63834554", "0.63469917", "0.6326578", "0.62978286", "0.62180054", "0.61365366", "0.61124545", "0.61078393", "0.6062286", "0.60357714", "0.6029924", "0.60248274", "0.6024618", "0.60108507", "0.6000782", "0.5995677", "0.5986535", "0.5985708", "0.5984206", "0.59791744", "0.5964815", "0.5964261", "0.59550387", "0.593847", "0.59352434", "0.5929884", "0.5910781", "0.58994037", "0.5896321", "0.5876997", "0.5875984", "0.5875847", "0.5857202", "0.58446234", "0.58209616", "0.5786796", "0.5778302", "0.57723826", "0.5771507", "0.57615936", "0.5759748", "0.5758213", "0.57580227", "0.5751469", "0.57430416", "0.5741382", "0.57409275", "0.5737569", "0.57181615", "0.57180405", "0.57162076", "0.5704604", "0.5698062", "0.56950206", "0.56903607", "0.56775874", "0.5676533", "0.5675903", "0.5670489", "0.5667618", "0.5665725", "0.5659791", "0.564638", "0.5632143", "0.5630248", "0.56282073", "0.5622393", "0.56216115", "0.5620516", "0.56172407", "0.56167716", "0.56084734", "0.56055975", "0.5592037", "0.5591016", "0.558395", "0.5583818", "0.55837274", "0.55760324", "0.5575009", "0.5572748", "0.55712533", "0.55651337", "0.5561309", "0.55483365", "0.5547131", "0.55444366", "0.554443", "0.55437565", "0.55278623", "0.5527531", "0.550894", "0.5507641", "0.55070275", "0.5506866", "0.55052686", "0.5503492", "0.5501667" ]
0.6860366
0
Selects the noninstantiated variable of smallest domain, to branch on it. This heuristic is sometimes called FirstFail.
public static VariableSelector<IntVar> minDomainSize_var_selector() { return new FirstFail(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static VariableSelector<IntVar> maxDomainSize_var_selector() {\n return new AntiFirstFail();\n }", "IntVar selectVariable(IntVar[] v) {\r\n\r\n if (v.length != 0) {\r\n int index = 0;\r\n int smallestDomain = Integer.MAX_VALUE;\r\n for(int i = 0; i< v.length-1; i++){\r\n if(v[i].domain.getSize()<smallestDomain){\r\n index = i;\r\n smallestDomain = v[i].domain.getSize();\r\n }\r\n\r\n }\r\n if(v[index].min() == v[index].max()){\r\n\r\n searchVariables = new IntVar[v.length-1];\r\n for (int i = 0; i < v.length-1; i++) {\r\n if(i<index){\r\n searchVariables[i] = v[i];\r\n }\r\n else searchVariables[i] = v[i+1];\r\n\r\n }\r\n }\r\n else{\r\n searchVariables = new IntVar[v.length];\r\n for(int i = 0; i < v.length; i++){\r\n searchVariables[i] = v[i];\r\n }\r\n }\r\n return v[index];\r\n\r\n }\r\n else {\r\n System.err.println(\"Zero length list of variables for labeling\");\r\n return new IntVar(store);\r\n }\r\n }", "public int chooseVTD(){\n int min=0;\n //this loop is used to avoid a bug\n for(int i=0;i<heuristicArrayTD.length;i++){\n if(heuristicArrayTD[i]< heuristicArrayTD[min]){\n min=i;\n }\n }\n int max=min;\n //returns highest scoring and unused var\n for(int i=0;i<heuristicArrayTD.length;i++){\n if(heuristicArrayTD[i]>= heuristicArrayTD[max] && usageArray[i%variableLength]==0){\n max=i;\n }\n }\n return max%variableLength;\n }", "public Solution solve(ISearchable domain) {\n if (domain == null)\n return null;\n ArrayList<AState> neighbors;\n Solution solution;\n domain.ResetVisit();\n pathSteps.add(domain.getStartState());\n domain.changeVisitTrue(domain.getStartState());\n numberOfNodes++;\n while (pathSteps.size() > 0) {\n AState temp = pathSteps.poll();\n if (domain.getGoalState().equals(temp)) {\n domain.setGoalState(temp);\n solution = finalSolution(temp);\n return solution;\n }\n neighbors = domain.getAllPossibleStates(temp);\n for (int i=0;i<neighbors.size();i++) {\n if (domain.isVisited(neighbors.get(i))==false) {\n numberOfNodes++;\n domain.changeVisitTrue(neighbors.get(i));\n neighbors.get(i).predecessor = temp;\n pathSteps.add(neighbors.get(i));\n }\n if (neighbors.get(i).equals(domain.getGoalState())) {\n neighbors.get(i).predecessor = temp;\n solution = finalSolution(neighbors.get(i));\n return solution;\n }\n }\n }\n return null;\n }", "private ProblemModel findCheapestNode(){\n\t\tProblemModel ret = unvisitedPM.peek();\n\t\t\n\t\tfor(ProblemModel p : unvisitedPM){ \n\t\t\t//f(s) = depth + cost to make this move\n\t\t\tif(p.getCost() + p.getDepth() <= ret.getCost() + ret.getDepth()) ret = p;\n\t\t}\n\t\tunvisitedPM.remove(ret);\n\t\treturn ret;\n\t}", "@Override\npublic boolean restrictNeighborhood(Solution solution)\n{\n\n\tSolver solver = solution.getSolver();\n\tint nbTotalVars = solver.getNbIntVars() - 1;\n\n\tint n = nbTotalVars - nbRelaxedVars;\n\tboolean b = false;\n\tIntVar var;\n\tselected.clear();\n\twhile (n > 0) {\n\t\tint index = random.nextInt(nbTotalVars);\n\t\tvar = solver.getIntVarQuick(index);\n\t\tif (var != solver.getObjective() && !selected.contains(index)) {\n\t\t\tif (solution.getIntValue(index) != Solution.NULL) {\n\t\t\t\tsolver.LOGGER.info(\"fix \" + var);\n\t\t\t\tsolver.post(solver.eq(var, solution.getIntValue(index)));\n\t\t\t\tb = true;\n\t\t\t}\n\t\t\tselected.add(index);\n\t\t\tn--;\n\t\t}\n\t}\n\treturn b;\n}", "public VariableCoefficientTuple suggestBranchingVariable (TwoIntegerTuple childRectCounts ) {\r\n \r\n VariableCoefficientTuple result= new VariableCoefficientTuple(null, ZERO) ;\r\n \r\n //first get the best lp rects\r\n List<Rectangle> rectanglesToConsiderForBranchingVarCalculation = this.getRectanglesToConsiderForBranchingVarCalculation( );\r\n \r\n //collect 0 direction refcounts into this map\r\n Map<String, Integer> zeroVar_RefCountMap = new HashMap<String, Integer> () ;\r\n //and one diirection refconts into this map\r\n Map<String, Integer> oneVar_RefCountMap = new HashMap<String, Integer> () ;\r\n \r\n List<VariableCoefficientTuple> variablesUsedForBranchingInThisRectangle =null;\r\n for (Rectangle rect: rectanglesToConsiderForBranchingVarCalculation){\r\n variablesUsedForBranchingInThisRectangle = getVariablesUsedForBranchingInThisRectangle (rect);\r\n if (variablesUsedForBranchingInThisRectangle.size()>ZERO) {\r\n this.updateVariableRefCounts(zeroVar_RefCountMap, oneVar_RefCountMap, variablesUsedForBranchingInThisRectangle) ;\r\n }else {\r\n System.err.print(\"trying to branch a node which should have been marked infeasible\" );\r\n exit(ONE);\r\n }\r\n }\r\n \r\n \r\n //now find the highest refcount var, no matter its direction\r\n int highZeroFreq = zeroVar_RefCountMap.isEmpty()?ZERO:Collections.max( zeroVar_RefCountMap.values());\r\n int highOneFreq = oneVar_RefCountMap.isEmpty()? ZERO: Collections.max(oneVar_RefCountMap.values()) ;\r\n \r\n //we need to find the selected var's refcount on the other side\r\n int selectedVarRefCountOnOtherSide = ZERO;\r\n \r\n int totalRects = getNumberOfRects(this.myInfeasibleRectanglesList) ;\r\n \r\n if (highZeroFreq>highOneFreq) {\r\n result.varName=getHighestFreqVar (zeroVar_RefCountMap,highZeroFreq ) ;\r\n result.coeff=highZeroFreq;\r\n selectedVarRefCountOnOtherSide= oneVar_RefCountMap.get( result.varName)==null? ZERO : oneVar_RefCountMap.get( result.varName);\r\n //this is how many rects will survive on either side\r\n childRectCounts.zeroSideCount = totalRects - selectedVarRefCountOnOtherSide;\r\n childRectCounts.oneSideCount=totalRects -highZeroFreq ;\r\n \r\n } else {\r\n result.varName=getHighestFreqVar (oneVar_RefCountMap,highOneFreq ) ;\r\n result.coeff=highOneFreq;\r\n selectedVarRefCountOnOtherSide= zeroVar_RefCountMap.get( result.varName)==null? ZERO : zeroVar_RefCountMap.get( result.varName);\r\n \r\n childRectCounts.zeroSideCount = totalRects - highOneFreq;\r\n childRectCounts.oneSideCount=totalRects - selectedVarRefCountOnOtherSide;\r\n }\r\n \r\n return result;\r\n }", "protected IPlanningGoal selectGoal(){ \n List<IPlanningGoal> relevantGoals = representation.getRelevantGoals(body);\n \n //If we have failed to find plans for high priority goals and environment has not changed, lets try some \n //lower priority ones\n if(numFailuresSinceLastImportantEnvChange < relevantGoals.size()){\n return relevantGoals.get(numFailuresSinceLastImportantEnvChange);\n } else {\n //tried all relevant goals but all failed, lets try it once more\n representation.setMarker(body);\n numFailuresSinceLastImportantEnvChange = 0;\n return relevantGoals.get(0);\n }\n }", "public void SelectDNF(TableVar Variables) {\r\n float perf;\r\n int i, j, k, m, best, posicion[];\r\n\r\n posicion = new int[long_poblacion];\r\n for (i=0;i<long_poblacion;i++) {\r\n posicion[i] = 0;\r\n }\r\n\r\n // Compute the ranking of each individual of the population: element 0 is the better\r\n for (i=0;i<long_poblacion;i++) {\r\n // Find better individual of the rest\r\n best=-1;\r\n perf=0;\r\n for (j=0;j<long_poblacion;j++) {\r\n if (posicion[j]==0 && (best==-1 || Utils.BETTER(poblac.getIndivFitness(j), perf))) {\r\n // If the individual is better\r\n perf = poblac.getIndivFitness(j);\r\n best = j;\r\n }\r\n }\r\n // Mark the individual with the ranking\r\n posicion[best] = i;\r\n }\r\n\r\n // The intermediary population is the ordered copy\r\n for (i=0;i<long_poblacion;i++) {\r\n k = posicion[i];\r\n for (j=0;j<Variables.getNVars();j++)\r\n for (m=0; m<=Variables.getNLabelVar(j); m++)\r\n Inter.setCromElemGene(k,j, m, poblac.getCromElemGene(i,j,m));\r\n Inter.setIndivFitness(k, poblac.getIndivFitness(i));\r\n Inter.setIndivEvaluated(k,true);\r\n }\r\n\r\n }", "public Space nextUnsolved(){\n for (int i = 0; i < dimensions[0];i++){\n for (int j = 0; j<dimensions[1];j++){\n if (grids[i][j].labeled==false) return grids[i][j];\n }\n }\n return null;\n }", "private static void defineInitialAttackTarget() {\n\t\tUnit buildingToAttack = MapExploration.getNearestEnemyBuilding();\n\n\t\t// We know some building of CPU that we can attack.\n\t\tif (buildingToAttack != null) {\n\t\t\tchangeNextTargetTo(buildingToAttack);\n\t\t}\n\n\t\t// No building to attack found, safely decide not to attack.\n\t\telse {\n\t\t\tchangeStateTo(STATE_PEACE);\n\t\t}\n\t}", "private void findSmallestCost() {\n int best = 0;\n fx = funFitness[0];\n for (int i = 1; i < population; i++) {\n if (funFitness[i] < fx) {\n fx = funFitness[i];\n best = i;\n }\n }\n //System.arraycopy(currentPopulation[best], 0, bestSolution, 0, dimension);\n copy(bestSolution, currentPopulation[best]);\n }", "private void findBestPath(){\n\t\t// The method will try to find the best path for every starting point and will use the minimum\n\t\tfor(int start = 0; start < this.getDimension(); start++){\n\t\t\tfindBestPath(start);\t\n\t\t}\t\n\t}", "@Override\n public Solution solve(ISearchable domain) {\n if(domain==null)\n return null;\n Solution s2=domain.checkIfIsSmall();\n if(s2!=null){\n domain.isClear();\n return s2;\n }\n Solution sol = new Solution();\n temp.add(domain.getStartState());\n numOfNude++;\n domain.isVisit(domain.getStartState());\n ArrayList<AState> neighbors=new ArrayList<AState>();\n while(!temp.isEmpty()){\n AState curr=temp.poll();\n if(domain.isEqual(domain.getGoalState(),curr)){\n numOfNude++;\n sol =solutionPath(curr,sol);\n\n break;\n }\n neighbors=domain.getAllPossibleState(curr);\n for(int i=0;i<neighbors.size();i++){\n if(domain.isEqual(domain.getGoalState(),neighbors.get(i))){\n neighbors.get(i).pervState=curr;\n neighbors.get(i).setPrice(neighbors.get(i).getPrice()+curr.getPrice());\n numOfNude++;\n sol =solutionPath(neighbors.get(i),sol);\n break;\n }\n neighbors.get(i).pervState=curr;\n neighbors.get(i).setPrice(neighbors.get(i).getPrice()+curr.getPrice());\n temp.add(neighbors.get(i));\n numOfNude++;\n }\n }\n\n domain.isClear();\n return sol;\n }", "public void testVariableBindingFromFirstPathPropagatesAccrossConjunctionAndFailsOnNonUnification() throws Exception\n {\n resolveAndAssertFailure(new String[] { \"g(x)\", \"h(y)\", \"f(X) :- g(X), h(X)\" }, \"?- f(Y)\");\n }", "@Override\n public Variable useHeuristic(Deque<Variable> deque) {\n Variable highDomain = deque.getFirst();\n for (Variable var : deque){\n if (var.getDomain().size() > highDomain.getDomain().size()){\n highDomain = var;\n }\n }\n return highDomain;\n }", "public boolean label(IntVar[] vars) {\r\n\r\n\r\n //System.out.println(\"ct \" + vars.length);\r\n count++;\r\n if (trace) {\r\n for (int i = 0; i < vars.length; i++)\r\n System.out.print (vars[i] + \" \");\r\n System.out.println ();\r\n }\r\n\r\n ChoicePoint choice = null;\r\n boolean consistent;\r\n\r\n // Instead of imposing constraint just restrict bounds\r\n // -1 since costValue is the cost of last solution\r\n if (costVariable != null) {\r\n try {\r\n if (costVariable.min() <= costValue - 1)\r\n costVariable.domain.in(store.level, costVariable, costVariable.min(), costValue - 1);\r\n else\r\n return false;\r\n } catch (FailException f) {\r\n return false;\r\n }\r\n }\r\n\r\n consistent = store.consistency();\r\n\r\n if (!consistent) {\r\n // Failed leaf of the search tree\r\n return false;\r\n } else { // consistent\r\n\r\n if (vars.length == 0) {\r\n // solution found; no more variables to label\r\n\r\n // update cost if minimization\r\n if (costVariable != null)\r\n costValue = costVariable.min();\r\n\r\n reportSolution();\r\n\r\n return costVariable == null; // true is satisfiability search and false if minimization\r\n }\r\n\r\n choice = new ChoicePoint(vars);\r\n\r\n levelUp();\r\n\r\n store.impose(choice.getConstraint());\r\n\r\n // choice point imposed.\r\n\r\n consistent = label(choice.getSearchVariables());\r\n\r\n if (consistent) {\r\n levelDown();\r\n return true;\r\n } else {\r\n\r\n restoreLevel();\r\n store.impose(new Not(choice.getConstraint()));\r\n\r\n\r\n\r\n // negated choice point imposed.\r\n\r\n consistent = label(vars);\r\n\r\n levelDown();\r\n\r\n if (consistent) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n }\r\n }", "public TreeStar nextVar(int[] variables,int lfri, int bestVar, int profondeur){\n if(profondeur<=variableLength){\n int[] temporary=variables.clone();\n\n temporary[bestVar]=lfri;//change the best available var from -1 to 0 or 1\n TreeStar treeStar= new TreeStar(temporary,profondeur);\n treeStar.setScore(testAstar(temporary));\n return treeStar;\n }\n return null;\n\n }", "@Test\n public void testSingleRunWithUnsatisfiableConstraint() {\n System.out.println(\" - test single run with unsatisfiable constraint\");\n // add constraint\n problem.addMandatoryConstraint(new NeverSatisfiedConstraintStub());\n // single run\n System.out.format(\" - low temperature (T = %.7f)\\n\", LOW_TEMP);\n singleRunWithMaxRuntime(searchLowTemp, SINGLE_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT);\n System.out.format(\" - medium temperature (T = %.7f)\\n\", MED_TEMP);\n singleRunWithMaxRuntime(searchMedTemp, SINGLE_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT);\n System.out.format(\" - high temperature (T = %.7f)\\n\", HIGH_TEMP);\n singleRunWithMaxRuntime(searchHighTemp, SINGLE_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT);\n // verify\n assertNull(searchLowTemp.getBestSolution());\n assertNull(searchMedTemp.getBestSolution());\n assertNull(searchHighTemp.getBestSolution());\n }", "private static int getLowestCostUnprocessedNode(int[] costs, boolean[] doneWithNode) {\n int result = UNKNOWN;\n int lowestCost = 0;\n\n for (int i=0; i<doneWithNode.length; i++) {\n // We can't pick the node if we've already done it or\n // we don't know how much it costs to get to the node.\n if (doneWithNode[i] || costs[i] == UNKNOWN)\n continue;\n\n if (result == UNKNOWN || costs[i] < lowestCost) {\n lowestCost = costs[i];\n result = i;\n }\n }\n\n return result;\n }", "private static int min_value_with_pruning(State curr_state, int alpha, int beta) {\n\t\tcounterPruning++;\r\n\r\n\t\t//If s is a terminal state, return its game value\r\n\t\tif(curr_state.isTerminal()){\r\n\t\t\treturn curr_state.getScore();\r\n\t\t}\r\n\r\n\t\tState[] successors = curr_state.getSuccessors('2');\r\n\r\n\t\tif(successors.length == 0 && curr_state.isTerminal() == false){\r\n\t\t\tbeta = Math.min(beta, max_value_with_pruning(curr_state, alpha, beta));\r\n\t\t}\r\n\r\n\t\tfor(State state : successors){\r\n\t\t\tbeta = Math.min(beta, max_value_with_pruning(state, alpha, beta));\r\n\t\t\tif(alpha >= beta)\r\n\t\t\t\treturn alpha;\r\n\t\t}\r\n\r\n\t\treturn beta;\r\n\t}", "@Override\n\tpublic Solution<TTPVariable> run(SingleObjectiveThiefProblem thief, IEvaluator evaluator, MyRandom rand) {\n\t\tTTPVariable var = TTPVariable.create(new TourOptimalFactory(thief).next(rand), Pack.empty());\n\t\tSolution<TTPVariable> currentBest = thief.evaluate(var);\n\t\t\n\n\t\twhile (evaluator.hasNext()) {\n\n\t\t\t// now take the tour and optimize packing plan\n\t\t\tSolution<Pack> nextPack = optPack(thief, evaluator, rand, currentBest.getVariable().getTour(), currentBest.getVariable().getPack());\n\t\t\t\n\t\t\tSolution<Tour> nextTour = optTour(thief, evaluator, rand, currentBest.getVariable().getTour(), nextPack.getVariable());\n\t\t\t\n\t\t\tTTPVariable next = TTPVariable.create(nextTour.getVariable(), nextPack.getVariable());\n\t\t\tSolution<TTPVariable> s = thief.evaluate(next);\n\t\t\t\n\t\t\t//System.out.println(nextPack);\n\t\t\t//System.out.println(currentBest);\n\t\t\t//System.out.println(\"----------------\");\n\t\t\t\n\t\t\t// update the best found solution\n\t\t\tif (SolutionDominator.isDominating(s, currentBest)) {\n\t\t\t\tcurrentBest = s;\n\t\t\t\t//System.out.println(\"YES\");\n\t\t\t}\n\t\t\tevaluator.notify(currentBest);\n\n\t\t}\n\n\t\treturn currentBest;\n\t}", "public double getDomainMin1() throws IllegalStateException {\n\treturn -Double.MAX_VALUE;\n }", "private int minValue(Node state, int alpha, int beta) {\n\t\t\n\t\tthis.nodesExplored++;\n\t\tthis.nodesExploredThisTurn++;\n\t\t\n\t\tif (this.cutoffTest(state)) {\n\t\t\treturn state.eval(this.player);\n\t\t}\n\t\t\n\t\t\n\t\tArrayList<Move> legalMoves = state.getGame().getLegalMoves();\n\t\t\n\t\tif (this.moveOrdering) {\n\t\t\tthis.quickSort(state, legalMoves, 0, legalMoves.size() - 1, true);\n\t\t}\n\t\t\n\t\tint v = Integer.MAX_VALUE;\n\t\tMove bestMove = null;\n\t\tfor (Move move : legalMoves) {\n\n\t\t\tif (System.currentTimeMillis() - startMili > this.maxTime * 1000)\n\t\t\t\treturn 0;\n\t\t\t\n\t\t\tint value = this.maxValue(state.result(move), alpha, beta);\n\t\t\tif (v > value) { //\n\t\t\t\tv = value;\n\t\t\t\tbestMove = move;\n\t\t\t}\n\n\t\t\tif (v <= alpha) {\n\t\t\t\tstate.setBestMove(bestMove);\n\t\t\t\treturn v;\n\t\t\t}\n\t\t\tbeta = Math.min(v, beta);\n\t\t}\n\t\tstate.setBestMove(bestMove);\n\t\treturn v;\n\t}", "public final int indexOfInferred(final IRNode var) {\n return lattice2.indexOf(var);\n }", "public Solver(Board initial) {\r\n if (initial == null) throw new IllegalArgumentException();\r\n\r\n\r\n SearchNode initialAdjacent = new SearchNode(initial.twin(), null, 0);\r\n MinPQ<SearchNode> adjacentPriorityQueue = new MinPQ<>(1);\r\n adjacentPriorityQueue.insert(initialAdjacent);\r\n\r\n\r\n SearchNode initialNode = new SearchNode(initial, null, 0);\r\n MinPQ<SearchNode> priorityQueue = new MinPQ<>(1);\r\n priorityQueue.insert(initialNode);\r\n\r\n if (initial.isGoal()) {\r\n goal = initialNode;\r\n isSolvable = true;\r\n return;\r\n } else if (initialAdjacent.board.isGoal()) {\r\n isSolvable = false;\r\n }\r\n\r\n\r\n SearchNode currentAdjacent = initialAdjacent;\r\n SearchNode currentBoard = initialNode;\r\n\r\n while (!currentAdjacent.board.isGoal() && !currentBoard.board.isGoal()) {\r\n\r\n currentAdjacent = adjacentPriorityQueue.delMin();\r\n currentBoard = priorityQueue.delMin();\r\n\r\n for (Board adjacentNeighbor : currentAdjacent.board.neighbors()) {\r\n SearchNode toBeInserted = new SearchNode(adjacentNeighbor, currentAdjacent, currentAdjacent.previousMoves + 1);\r\n if (currentAdjacent.previousSearchNode == null || !toBeInserted.board.equals(currentAdjacent.previousSearchNode.board)) {\r\n adjacentPriorityQueue.insert(toBeInserted);\r\n }\r\n }\r\n\r\n\r\n for (Board neighbor : currentBoard.board.neighbors()) {\r\n SearchNode toBeInserted = new SearchNode(neighbor, currentBoard, currentBoard.previousMoves + 1);\r\n if (currentBoard.previousSearchNode == null || !toBeInserted.board.equals(currentBoard.previousSearchNode.board)) {\r\n\r\n priorityQueue.insert(toBeInserted);\r\n }\r\n }\r\n }\r\n if (currentAdjacent.board.isGoal()) {\r\n isSolvable = false;\r\n goal = initialNode;\r\n } else {\r\n goal = currentBoard;\r\n isSolvable = true;\r\n }\r\n\r\n }", "private int findProperLeavingBasicVariable(int newBasicColumn) {\n int rowLeavingBasicVariable = -1;\n for (int i = 0; i < numberOfVariables; i++) {\n if (tableaux[i][newBasicColumn] <= 0)\n continue;\n else if (rowLeavingBasicVariable == -1)\n rowLeavingBasicVariable = i;\n else if ((tableaux[i][numberOfConstraints\n + numberOfVariables] / tableaux[i][newBasicColumn]) < (tableaux[rowLeavingBasicVariable][numberOfConstraints\n + numberOfVariables] / tableaux[rowLeavingBasicVariable][newBasicColumn]))\n rowLeavingBasicVariable = i;\n }\n if (rowLeavingBasicVariable == -1) throw new ArithmeticException(\"PROGRAM NIEOGRANICZONY\");\n return rowLeavingBasicVariable;\n }", "protected <E> String MinRemainingValue(CSP<E> csp, Assignment<E> assignment) {\r\n\t\tString var=\"\";\r\n\t\tint minVar=100;\r\n\t\tfor(String i:csp.variables){\r\n\t\t\tif(!assignment.containsKey(i)){\r\n\t\t\t\tint min = csp.domains.get(i).size();\r\n\t\t\t\tif(min<=minVar) {\r\n\t\t\t\t\tif(min==minVar) {\r\n\t\t\t\t\t\tString varLess=OneDegreeHeuristics(csp,i,var);\r\n\t\t\t\t\t\tminVar=csp.domains.get(varLess).size();;\r\n\t\t\t\t\t\tvar=varLess;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tminVar=min;\r\n\t\t\t\t\t\tvar=i;\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn var;\t\r\n\t}", "public void testNonPermanentVariableResolvedOkNoBinding() throws Exception\n {\n resolveAndAssertSolutions(\"[[g(x), h(x), (f :- g(X), h(Y))], (?- f), [[]]]\");\n }", "private void findBest()\r\n\t{\r\n\t\tint i;\r\n\t\tint size_mature_pool;\r\n\t\tint idx_current;//index of a currently checked genotype\r\n\t\tint num_errors;//number of errors of the current chromosome\r\n\t\tdouble min_error;//smallest error among the oldest genotypes\r\n\t\tVector<Integer> idx_oldest;\r\n\t\t\r\n\t\tsize_mature_pool = _pool_of_bests.size();\r\n\t\t\r\n\t\tidx_oldest = new Vector<Integer>(0, 1);\r\n\t\t\r\n\t\t//find all oldest genotypes\r\n\t\tfor(i=0; i<size_mature_pool; i++)\r\n\t\t{\r\n\t\t\tnum_errors = _pool_of_bests.get(i)._error.all_single_squares.size();\r\n\t\t\tif(num_errors>=_min_life_span)\r\n\t\t\t{\r\n\t\t\t\tidx_oldest.add(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//find the best oldest gentypes with a span above a threshold\r\n\t\t_best_idx = -1;\r\n\t\tif(idx_oldest.size() > 0)\r\n\t\t{\r\n\t\t\t_best_idx = idx_oldest.get(0);\r\n\t\t\tmin_error = _pool_of_bests.get(_best_idx)._error.getAverageError();\r\n\t\t\tfor(i=1; i<idx_oldest.size(); i++)\r\n\t\t\t{\r\n\t\t\t\tidx_current = idx_oldest.get(i);\r\n\t\t\t\tif(min_error > _pool_of_bests.get(idx_current)._error.getAverageError())\r\n\t\t\t\t{\r\n\t\t\t\t\t_best_idx = idx_current;\r\n\t\t\t\t\tmin_error = _pool_of_bests.get(_best_idx)._error.getAverageError();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected void doDeduction() {\n\n boolean narrowed= false;\n\n unit=false;\n isInconclusive=false;\n\n int newXL;\n int newYU;\n\n Variable x = null;\n Variable y = null;\n\n for(Variable var : csp.getVars()){\n if(var.getPosition() == unitSB.getX().getPosition()){\n x = var;\n } else if(var.getPosition() == unitSB.getY().getPosition()){\n y = var;\n }\n }\n\n int xU = x.getUpperDomainBound();\n int yL = y.getLowerDomainBound();\n\n newXL = yL + unitSB.getCright();\n newYU = xU - unitSB.getCright();\n\n if(newXL>x.getLowerDomainBound()){\n Variable newX = new Variable(newXL, xU);\n newX.setPosition(x.getPosition());\n changeVariable(newX);\n narrowed= true;\n }\n if (newYU< y.getUpperDomainBound()){\n Variable newY = new Variable(yL, newYU);\n newY.setPosition(y.getPosition());\n changeVariable(newY);\n narrowed =true;\n }\n\n if(narrowed){\n doAlgorithmA1();\n }else {\n doAlgorithmA3();\n }\n\n }", "protected <E> String selectUnassignedVariable(CSP<E> csp, Assignment<E> assignment) {\r\n\t\tList<String> unassigned= new ArrayList<String>(); \r\n\t\tfor(String i:csp.variables){\r\n\t\t\tif(!assignment.containsKey(i)){\r\n\t\t\t\tunassigned.add(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tRandom random = new Random();\r\n\t\tint rand=random.nextInt(unassigned.size());\r\n\t\treturn unassigned.get(rand);\r\n\t}", "protected IDecisionVariable dereferenceIfNeeded(IDecisionVariable variable, Value value) {\n IDecisionVariable v = variable;\n if (TypeQueries.isReference(variable.getDeclaration().getType()) \n && !TypeQueries.isReference(value.getType())) {\n v = Configuration.dereference(v);\n if (null == v) { // just a fallback, shall not happen\n v = variable;\n }\n }\n return v;\n }", "private int restrictProblem(Message msg, String parameter) {\n int[] problems = setProblemRestriction(msg, parameter);\n\n if (problems[0] == ERROR_CODE[0]) {\n return -1;\n }\n\n problemRestriction = true;\n lowerProblem = problems[0];\n upperProblem = problems[1];\n return 0;\n }", "public MoveAddress nextVariationFirstState() {\n MoveAddress other = nextVariation(1);\n return other.firstChild(1, 0);\n }", "public static ProbNet instantiate(ProbNet originalDAN, Variable variable, State state) {\n\t\tProbNet instantiatedNet = originalDAN.copy();\n\n\t\tNode originalNode = null;\n\t\ttry {\n\t\t\toriginalNode = originalDAN.getNode(variable.getName());\n\t\t} catch (NodeNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t// If we are instantiating a decision variable we must project potentials for the selected state of the decision\n\t\tif (originalNode != null /*&& originalNode.getNodeType().equals(NodeType.DECISION)*/) {\n\t\t\ttry {\n\t\t\t\tprojectPotentials(instantiatedNet, variable, state);\n\t\t\t} catch (InvalidStateException | IncompatibleEvidenceException | NonProjectablePotentialException | WrongCriterionException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\t// Get the links of the node in the original network\n\t\tfor (Link<Node> link : originalDAN.getLinks(originalNode)) {\n\t\t\tif (link.getNode1().equals(originalNode)) // Our originalNode is the source originalNode (act as parent)\n\t\t\t{\n\t\t\t\tNode destinationNode = instantiatedNet.getNode(link.getNode2().getVariable());\n\t\t\t\t// Remove link between restricting originalNode and restricted originalNode\n\t\t\t\tinstantiatedNet.removeLink(link.getNode1().getVariable(), link.getNode2().getVariable(), true);\n\n\t\t\t\tif (destinationNode.getNodeType() == NodeType.CHANCE) {\n\t\t\t\t\tif (link.hasRevealingConditions()) {\n\t\t\t\t\t\tif (link.getRevealingStates().contains(state)) {\n\t\t\t\t\t\t\tList<Node> predecessorDecisions = ProbNetOperations\n\t\t\t\t\t\t\t\t\t.getPredecessorDecisions(destinationNode, instantiatedNet);\n\t\t\t\t\t\t\t// If it has predecessor decisions, do not reveal it yet, but add revealing links\n\t\t\t\t\t\t\t// from every predecessor decision to the originalNode\n\t\t\t\t\t\t\tif (predecessorDecisions.isEmpty()) {\n\t\t\t\t\t\t\t\tdestinationNode.setAlwaysObserved(true);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tfor (Node predecessorDecision : predecessorDecisions) {\n\t\t\t\t\t\t\t\t\tLink<Node> revealingArc = instantiatedNet\n\t\t\t\t\t\t\t\t\t\t\t.addLink(predecessorDecision, destinationNode, true);\n\t\t\t\t\t\t\t\t\tState[] predecessorDecisionStates = predecessorDecision.getVariable().getStates();\n\t\t\t\t\t\t\t\t\tfor (State predecessorDecisionState : predecessorDecisionStates)\n\t\t\t\t\t\t\t\t\t\trevealingArc.addRevealingState(predecessorDecisionState);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (link.hasRestrictions()) {\n\t\t\t\t\tVariable destinationVariable = destinationNode.getVariable();\n\t\t\t\t\tState[] restrictedVariableStates = destinationVariable.getStates();\n\t\t\t\t\tList<State> nonRestrictedStates = ProbNetOperations\n\t\t\t\t\t\t\t.getUnrestrictedStates(link, restrictedVariableStates, state);\n\n\t\t\t\t\tif (nonRestrictedStates.isEmpty()) {\n\t\t\t\t\t\t// Remove destination originalNode and its descendants!\n\t\t\t\t\t\tStack<Node> disposableNodes = new Stack<>();\n\t\t\t\t\t\tdisposableNodes.push(destinationNode);\n\t\t\t\t\t\twhile (!disposableNodes.isEmpty()) {\n\t\t\t\t\t\t\tNode disposableNode = disposableNodes.pop();\n\t\t\t\t\t\t\t// If it's a decision originalNode, check if there is another\n\t\t\t\t\t\t\t// path to it from another decision\n\t\t\t\t\t\t\tif (disposableNode.getNodeType() != NodeType.DECISION || !ProbNetOperations\n\t\t\t\t\t\t\t\t\t.hasPredecessorDecision(disposableNode, instantiatedNet)) {\n\t\t\t\t\t\t\t\tfor (Node descendant : instantiatedNet.getChildren(disposableNode)) {\n\t\t\t\t\t\t\t\t\tdisposableNodes.push(descendant);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Guarantee that the DAN has at least a utility node\n\t\t\t\t\t\t\t\tif (disposableNode.getNodeType() != NodeType.UTILITY\n\t\t\t\t\t\t\t\t\t\t|| instantiatedNet.getNodes(NodeType.UTILITY).size() > 1) {\n\t\t\t\t\t\t\t\t\tinstantiatedNet.removeNode(disposableNode);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {//If the node of utility should be removed, then we leave it in the network with a zero value\n\t\t\t\t\t\t\t\t\treplaceUtilityPotentialWithZero(instantiatedNet, disposableNode);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// }else if(nonRestrictedStates.size () == 1) // Remove variables with a single variable\n\t\t\t\t\t\t// {\n\t\t\t\t\t\t// ProbNet probNetWithoutSingleStateVariable = probNetCopy.copy ();\n\t\t\t\t\t\t// probNetWithoutSingleStateVariable.removeNode (probNetWithoutSingleStateVariable.getNode (destinationNode.getVariable ()));\n\t\t\t\t\t\t// probNetCopy = applyRestrictionsAndReveal(probNetWithoutSingleStateVariable, destinationNode, nonRestrictedStates.get (0), originalProbNet);\n\t\t\t\t\t} else if (nonRestrictedStates.size() < restrictedVariableStates.length) {\n\t\t\t\t\t\t// At least one of the states of the destination originalNode is restricted.\n\t\t\t\t\t\t// Make a copy of the variable and remove the restricted states\n\t\t\t\t\t\t//if (destinationNode.getNodeType()!=NodeType.CHANCE){\n\t\t\t\t\t\tState[] unrestrictedStates = nonRestrictedStates.toArray(new State[0]);\n\t\t\t\t\t\tVariable restrictedVariable = new Variable(destinationVariable.getName(), unrestrictedStates);\n\t\t\t\t\t\trestrictedVariable.setVariableType(destinationVariable.getVariableType());\n\t\t\t\t\t\tupdatePotentialsWithNewVariable(instantiatedNet, destinationVariable, restrictedVariable);\n\t\t\t\t\t\tdestinationNode.setVariable(restrictedVariable);\n\t\t\t\t\t\t//}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (originalNode.getNodeType() == NodeType.DECISION) {\n\t\t\tinstantiatedNet.removeNode(instantiatedNet.getNode(originalNode.getVariable()));\n\t\t}\n\t\treturn instantiatedNet;\n\t}", "public void SelectCAN(TableVar Variables) {\r\n float perf;\r\n int i, j, k, best, posicion[];\r\n\r\n posicion = new int[long_poblacion];\r\n for (i=0;i<long_poblacion;i++) {\r\n posicion[i] = 0;\r\n }\r\n \r\n // Compute the ranking of each individual of the population: element 0 is the better\r\n for (i=0;i<long_poblacion;i++) {\r\n // Find better individual of the rest\r\n best=-1; \r\n perf=0;\r\n for (j=0;j<long_poblacion;j++) {\r\n if (posicion[j]==0 && (best==-1 || Utils.BETTER(poblac.getIndivFitness(j), perf))) {\r\n // If the individual is better\r\n perf = poblac.getIndivFitness(j);\r\n best = j;\r\n }\r\n }\r\n // Mark the individual with the ranking\r\n posicion[best] = i; \r\n }\r\n \r\n // The intermediary population is the ordered copy\r\n for (i=0;i<long_poblacion;i++) {\r\n k = posicion[i];\r\n for (j=0;j<Variables.getNVars();j++)\r\n Inter.setCromElem(k,j, poblac.getCromElem(i,j));\r\n Inter.setIndivFitness(k, poblac.getIndivFitness(i));\r\n Inter.setIndivEvaluated(k,true);\r\n }\r\n \r\n }", "public void testVariableBindingFromFirstPathPropagatesAccrossConjunction() throws Exception\n {\n resolveAndAssertSolutions(\"[[g(x), h(x), (f(X) :- g(X), h(X))], (?- f(Y)), [[Y <-- x]]]\");\n }", "private static <V extends Variable<A>, A extends Value> boolean BACKTRACK(SharedDomainVariableSet<V, A> variableSet) {\n\t\tif (variableSet.isComplete()) {return true;}\n\t\t\n\t\t// get variable to assign\n\t\tV var = variableSet.getUnassignedVariable();\n\t\tSystem.out.println(x + \" --> \" + variableSet.getCountSet() + \": \" + var.getIndex());\n\t\tx += 1;\n\t\t//System.out.println(var);\n\t\t\n\t\t// for each possible value\n\t\tfor (A val : variableSet.getDomain(var)) {\n\n\t\t\t// add the assignment\n\t\t\tvar.assign(val);\n\t\t\t\n\t\t\t// test acceptability and infer the feasibility of the assignment && INFER(variableSet, var)\n\t\t\tif (INFER(variableSet, var)) {\n\t\t\t//if (true) {\t\n\t\t\t\ttry {\n\t\t\t\t\t\n\t\t\t\t\t// domain reduction, throws exception if invalid\n\t\t\t\t\tMap<V, DomainReduction<A>> domainReduction2 = FORWARD_CHECK2(variableSet, var);\n\t\t\t\t\t\n\t\t\t\t\t//Map<V, DomainReduction<A>> domainReduction = FORWARD_CHECK(variableSet, var);\n\t\t\t\t\t\n\t\t\t\t\t// add domain reduction to set\n\t\t\t\t\t//variableSet.addDomainReduction(domainReduction);\n\t\t\t\t\t\n\t\t\t\t\t// backtrack\n\t\t\t\t\t//boolean result = BACKTRACK(variableSet);\n\t\t\t\t\t\n\t\t\t\t\t// stop if solution found\n\t\t\t\t\tif (INFER(variableSet, var) && BACKTRACK(variableSet)) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// clear domain reduction\n\t\t\t\t\t//variableSet.clearDomainReduction(domainReduction);\n\t\t\t\t\tvariableSet.clearDomainReduction(domainReduction2);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t\t// clean assignment\n\t\t\tvar.unassign();\n\t\t\t\n\t\t}\n\t\t\n\t\t// no assignment found\n\t\treturn false;\n\t\t\n\t}", "protected int chooseAppropriateDomainIndex(String originalDomain) {\n int domainIndex = 0;\n do {\n domainIndex = rnd.nextInt(replacements.size());\n } while (originalDomain.equals(replacements.get(domainIndex)));\n return domainIndex;\n }", "@Override\n public Void visitVariableConsequence(GraafvisParser.VariableConsequenceContext ctx) {\n TerminalNode variable = ctx.HID();\n if (!variables.contains(variable.getText())) {\n int line = variable.getSymbol().getLine();\n int column = variable.getSymbol().getCharPositionInLine();\n errors.add(new UndefinedVariableError(line, column, variable.getText()));\n }\n return null;\n }", "private T getMinUnvisited(){\n if (unvisited.isEmpty()) return null;\n T min = unvisited.get(0);\n for (int i = 1; i < unvisited.size(); i++){\n T temp = unvisited.get(i);\n if (distances[vertexIndex(temp)] < distances[vertexIndex(min)]){\n min = temp;\n }\n }\n return min;\n }", "public SolutionType getBestSolution();", "public Move chooseMove(TablutBoardState boardState) {\n \n \tList<TablutMove> options = boardState.getAllLegalMoves();\n\n \n bestMove = options.get(((int) MyTools.getSomething())% (options.size()));\n\n int depth = DEPTH;\n int opponent = boardState.getOpponent();\n boolean isMax;\n if(opponent==1){\n \tisMax = true;\n \t//System.out.println(\"I'm max\");\n }\n else{\n \tisMax = false;\n \t//System.out.println(\"I'm min\");\n }\n //bestMove = \n \n int bestvalue = minimax(boardState,isMax, depth,-10000,10000);\n \n \n //int minNumberOfOpponentPieces = boardState.getNumberPlayerPieces(opponent);\n //boolean moveCaptures = false;\n //System.out.println(\"minimax return value: \"+bestvalue);\n \n \n \n \n return bestMove;\n }", "@Override\n public VariableNonRequirement computeVariableNonRequirement(IQTree child) {\n return VariableNonRequirement.of(substitution.getDomain());\n }", "private void checkValue(Variable toBeVariable) throws MethodCallWithNonexistentParameter {\n if (!toBeVariable.hasValue()) {\n throw new MethodCallWithNonexistentParameter();\n }\n }", "@Test\n public void testChooseLocalNodeWithLocalNodeLoaded() {\n DatanodeDescriptor localNode = dataNodes[1];\n int numLocalChosen = 0;\n for (int i = 0; i < CHOOSE_TIMES; i++) {\n DatanodeStorageInfo[] targets =\n namenode.getNamesystem().getBlockManager().getBlockPlacementPolicy()\n .chooseTarget(FILE, 1, localNode,\n new ArrayList<DatanodeStorageInfo>(), false, null, BLOCK_SIZE,\n TestBlockStoragePolicy.DEFAULT_STORAGE_POLICY, null);\n\n Assert.assertEquals(1, targets.length);\n if (localNode == targets[0].getDatanodeDescriptor()) {\n numLocalChosen++;\n }\n }\n Assert.assertTrue(numLocalChosen < (CHOOSE_TIMES - numLocalChosen));\n }", "private void generateInitialSolution(Instance instance) {\n currentSol = new Solution(instance);\n switch (INITIAL) {\n case 0: mostValuePerWeightFirst(instance);\n case 1: leastWeightFirst(instance);\n default: randomConfiguration(instance);\n }\n // Set current best solution to initial solution\n bestSol = new Solution(currentSol);\n }", "public Comparable<?> a(DiscreteDomain<Comparable<?>> discreteDomain) {\n return discreteDomain.minValue();\n }", "@Override\n protected Collection<BDDState> preCheck(BDDState pState, VariableTrackingPrecision pPrecision) {\n if (pPrecision.isEmpty()) {\n return Collections.singleton(pState);\n }\n // the path is not fulfilled\n if (pState.getRegion().isFalse()) {\n return ImmutableList.of();\n }\n return null;\n }", "public abstract OptimisationSolution getBestSolution();", "private Coordinate firstMoveHeuristics(TicTacToeModel model, PossibleBoard possibleBoard) {\n BoardSpace[][] board = possibleBoard.board;\n\n if (possibleBoard.freeSpace == TicTacToeModel.BOARD_DIMENSION*TicTacToeModel.BOARD_DIMENSION) {\n if (board[0][0].getIcon() == Icon.EMPTY) {\n return new Coordinate(0,0);\n } else {\n return new Coordinate(0, TicTacToeModel.BOARD_DIMENSION - 1);\n }\n } else if (possibleBoard.freeSpace == TicTacToeModel.BOARD_DIMENSION*TicTacToeModel.BOARD_DIMENSION - 1) {\n if (model.cornerTaken()) {\n return new Coordinate(TicTacToeModel.BOARD_DIMENSION/2, TicTacToeModel.BOARD_DIMENSION/2);\n } else if (board[TicTacToeModel.BOARD_DIMENSION/2][TicTacToeModel.BOARD_DIMENSION/2].getIcon() != Icon.EMPTY) {\n return new Coordinate(0,0);\n } else {\n return model.getCornerNextToEdge();\n }\n }\n\n return null;\n }", "private int first_leaf() { return n/2; }", "@Override\n public final void solve() {\n this.flag1 = this.neo.getPosition().equals(this.goal);\n \n }", "public Solver(Board initial) {\n\t\tgoal = null;\n\t\tminpq = new MinPQ<Solver.SearchNode>();\n\t\tminpqTwin = new MinPQ<SearchNode>();\n\t\tcheck = new HashMap<String, Integer>();\n\t\tcheckTwin = new HashMap<String, Integer>();\n\t\t\n\t\tminpq.insert(new SearchNode(initial, null));\n\t\tminpqTwin.insert(new SearchNode(initial.twin(), null));\n\t\t\n\t\tcheck.put(initial.toString(), 1);\n\t\tcheckTwin.put(initial.twin().toString(), 1);\n\t\t\n\t\t//StdOut.println(\"Hamming =\" + initial.hamming());\n\t\t//StdOut.println(\"Manhattan =\" + initial.manhattan());\n\t\t//StdOut.println(\"Original:\\n\" + initial.toString());\n\t\t//StdOut.println(\"Twin:\\n\" + initial.twin().toString());\n\t\t\n\t\tSearchNode minNode = minpq.delMin();\n\t\tSearchNode minNodeTwin = minpqTwin.delMin();\n\t\t\n\t\twhile (true) {\n\t\t\t\n\t\t\tif (minNode.getBoard().isGoal()) {\n\t\t\t\tgoal = minNode;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (minNodeTwin.getBoard().isGoal()) {\n\t\t\t\tgoal = null;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tpushNodes(minNode, minpq, check);\n\t\t\tpushNodes(minNodeTwin, minpqTwin, checkTwin);\n\t\t\t\n\t\t\tminNode = minpq.delMin();\n\t\t\tminNodeTwin = minpqTwin.delMin();\n\t\t}\n\t}", "private static int max_value_with_pruning(State curr_state, int alpha, int beta) {\n\t\tcounterPruning++;\r\n\r\n\t\t//If s is a terminal state, return its game value\r\n\t\tif(curr_state.isTerminal()){\r\n\t\t\treturn curr_state.getScore();\r\n\t\t}\r\n\r\n\t\tState[] successors = curr_state.getSuccessors('1');\r\n\r\n\t\t//If there is no valid move available but it is not a terminal node\r\n\t\tif(successors.length == 0 && curr_state.isTerminal() == false){\r\n\t\t\talpha = Math.max(alpha, min_value_with_pruning(curr_state, alpha, beta));\r\n\t\t}\r\n\r\n\t\tfor(State state : successors){\r\n\t\t\talpha = Math.max(alpha, min_value_with_pruning(state, alpha, beta));\r\n\t\t\tif(alpha >= beta)\r\n\t\t\t\treturn beta;\r\n\t\t}\r\n\r\n\t\treturn alpha;\r\n\t}", "private static State tryStart(String line) {\n if (line.contains(\"START_LEVEL=\")) {\n Matcher matcher = START_LEVEL.matcher(line);\n if(matcher.matches()) {\n String level = matcher.group(1); // 0.00032\n s_level = Double.parseDouble(level);\n System.out.println(\"Got START_LEVEL=\" + s_level);\n return START;\n }\n }\n return tryIteration(line);\n }", "public boolean runSolver()\n {\n Variable current = getUnassignedVar();\n\n if (current == null)\n {\n return true;\n }\n\n for (int i = 0; i < current.getDomain().size(); i++)\n {\n List<Integer> oldDomain = current.getDomain();\n int newval = oldDomain.get(i);\n current.setValue(newval);\n current.setDomain(i);\n\n if (constraintsSatisfied(constraintsWithAnyVals()))\n {\n if (runSolver())\n {\n return true;\n }\n }\n\n current.setDomain(oldDomain);\n current.setValue(current.getPrevious()); \n }\n return false;\n }", "public Solver(Board initial) {\n \tsolutionNode = null;\n \tpq = new MinPQ<>();\n \tpq.insert(new SearchNode(initial, null, 0));\n\n \twhile (true) {\n \t\tSearchNode currNode = pq.delMin();\n\t \tBoard currBoard = currNode.getBoard();\n\n\t \tif (currBoard.isGoal()) {\n\t \t\tisSolvable = true;\n\t \t\tsolutionNode = currNode;\n\t \t\tbreak;\n\t \t}\n\n\t \tif (currBoard.hamming() == 2 && currBoard.twin().isGoal()) {\n\t \t\tisSolvable = false;\n\t \t\tbreak;\n\t \t}\n\n\t \tint moves = currNode.getMoves();\n\t \tBoard prevBoard = moves > 0 ? currNode.prev().getBoard() : null;\n\t \tfor (Board nextBoard : currBoard.neighbors()) {\n\t \t\tif (nextBoard != null && nextBoard.equals(prevBoard)) {\n\t \t\t\tcontinue;\n\t \t\t}\n\t \t\tpq.insert(new SearchNode(nextBoard, currNode, moves + 1));\n\t \t}\n \t}\n \t\n }", "private int recursivelyFixVars(IntArrayList varNodes)\n throws AlgorithmException\n {\n int x;\n \n // Even though we are not iterating through varNods,\n // this loop is more efficient than using allFixed(varNodes)\n // and it guarantees that we won't get stuck in an infinte\n // loop.\n int N = varNodes.size();\n for(x=0; x < N; x++)\n {\n // Get the node that is connected to the most number\n // of undetermined variables.\n int var = _fg.chooseMaxConnode(varNodes);\n \n if(var < 0)\n {\n _fg.fixVar(var);\n \n _runMaxProduct();\n\n // find all active paths (ie. sigma vars with max state == 1)\n //int[] activePaths = getActivePaths();\n \n Submodel model = fixUniqueVars(var);\n \n //model.setActivePaths(activePaths);\n \n _submodels.add(model);\n logger.info(\"added submodel \" + model.getId()\n + \" with \" + model.size() + \" vars. \"\n + countDegenerate(varNodes) + \" vars still not fixed\");\n }\n else\n {\n // var == 0 means that all of the nodes are fixed.\n break;\n }\n }\n \n return x;\n }", "@Test\n public void testSubsequentRunsWithUnsatisfiableConstraint() {\n System.out.println(\" - test subsequent runs with unsatisfiable constraint\");\n // set constraint\n problem.addMandatoryConstraint(new NeverSatisfiedConstraintStub());\n // create and add listeners\n AcceptedMovesListener l1 = new AcceptedMovesListener();\n AcceptedMovesListener l2 = new AcceptedMovesListener();\n AcceptedMovesListener l3 = new AcceptedMovesListener();\n searchLowTemp.addSearchListener(l1);\n searchMedTemp.addSearchListener(l2);\n searchHighTemp.addSearchListener(l3);\n // perform multiple runs (maximizing objective)\n System.out.format(\" - low temperature (T = %.7f)\\n\", LOW_TEMP);\n multiRunWithMaximumRuntime(searchLowTemp, MULTI_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT, NUM_RUNS, true, true);\n System.out.format(\" >>> accepted/rejected moves: %d/%d\\n\", l1.getTotalAcceptedMoves(), l1.getTotalRejectedMoves());\n System.out.format(\" - medium temperature (T = %.7f)\\n\", MED_TEMP);\n multiRunWithMaximumRuntime(searchMedTemp, MULTI_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT, NUM_RUNS, true, true);\n System.out.format(\" >>> accepted/rejected moves: %d/%d\\n\", l2.getTotalAcceptedMoves(), l2.getTotalRejectedMoves());\n System.out.format(\" - high temperature (T = %.7f)\\n\", HIGH_TEMP);\n multiRunWithMaximumRuntime(searchHighTemp, MULTI_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT, NUM_RUNS, true, true);\n System.out.format(\" >>> accepted/rejected moves: %d/%d\\n\", l3.getTotalAcceptedMoves(), l3.getTotalRejectedMoves());\n // verify\n assertNull(searchLowTemp.getBestSolution());\n assertNull(searchMedTemp.getBestSolution());\n assertNull(searchHighTemp.getBestSolution());\n }", "public void setComparedHeuristics (VariableSelector variableSelector, IntValueSelector valueOrder){\n\t\tIntValueSelector valueSelector = valueOrder;\n\t\t\n\t \n\t\tkb.getModelKB().getSolver().setSearch(Search.intVarSearch(\n \n\t\t\t\tvariableSelector,\n // selects the smallest domain value (lower bound)\n\t\t\t\t \n\t\t\t\tvalueSelector,\n \n // variables to branch on\n\t\t\t\tkb.getVars()\n\t\t));\n\t\t\n\t}", "public String newRuleFirstCondition(Situation threeSituationsAgo)\n {\n String firstPredicate;\n //---------------\n firstPredicate = \"ninguno\";\n\n if(\n (threeSituationsAgo.puzzle[0][0] == 1) &&\n (threeSituationsAgo.puzzle[0][1] == 2) &&\n (threeSituationsAgo.puzzle[0][2] == 3) &&\n (threeSituationsAgo.puzzle[0][3] == 4) &&\n (threeSituationsAgo.puzzle[1][0] == 5) &&\n (threeSituationsAgo.puzzle[1][1] == 6) &&\n (threeSituationsAgo.puzzle[1][2] == 7) &&\n (threeSituationsAgo.puzzle[1][3] == 8) &&\n (threeSituationsAgo.puzzle[2][0] == 9) &&\n (threeSituationsAgo.puzzle[3][0] == 13)\n )\n {\n firstPredicate = \"dosLineasYColumna\";\n }//end if\n else\n {\n if(\n (threeSituationsAgo.puzzle[0][0] == 1) &&\n (threeSituationsAgo.puzzle[0][1] == 2) &&\n (threeSituationsAgo.puzzle[0][2] == 3) &&\n (threeSituationsAgo.puzzle[0][3] == 4) &&\n (threeSituationsAgo.puzzle[1][0] == 5) &&\n (threeSituationsAgo.puzzle[1][1] == 6) &&\n (threeSituationsAgo.puzzle[1][2] == 7) &&\n (threeSituationsAgo.puzzle[1][3] == 8)\n )\n {\n firstPredicate = \"dosLineasListas\";\n }//end if\n else\n {\n if(\n (threeSituationsAgo.puzzle[0][0] == 1) &&\n (threeSituationsAgo.puzzle[0][1] == 2) &&\n (threeSituationsAgo.puzzle[0][2] == 3) &&\n (threeSituationsAgo.puzzle[0][3] == 4)\n )\n {\n firstPredicate = \"primeraLineaLista\";\n }//end if\n }//end else\n }//end else\n\n return firstPredicate;\n }", "private int getLowerBound(Object problem, int upperbound)\n {\n Graph tsp = (Graph)problem;\n if (weight == null)\n weight = new double[tsp.size()];\n hki = new HeldKarpIterative( tsp, included, includedT, excluded, excludedT, iterations, weight, upperbound);\n hki.compute();\n tour = hki.isTour();\n bound = hki.getBound();\n hasRun = true;\n// System.out.println(hki.debugDump());\n return bound;\n }", "public void SteadyStepReproductionDNF (TableVar Variables) {\r\n\r\n int i, j, k, pos;\r\n int[] indices = new int[long_poblacion];\r\n float[] fit = new float[long_poblacion];\r\n\r\n for (i=0; i<long_poblacion; i++) {\r\n fit[i]= poblac.getIndivFitness(i);\r\n indices[i] = i;\r\n }\r\n\r\n // Sort the fitness array of actual population and store the values at \"indices\"\r\n Utils.OrDecIndex (fit,0,long_poblacion-1,indices); // To maximise\r\n\r\n for (i=0; i<descendientes; i++) {\t// For each descendant\r\n pos = indices[long_poblacion-1-i];\r\n for (j=0; j<Variables.getNVars(); j++) {\r\n for (k=0; k<=Variables.getNLabelVar(j); k++)\r\n poblac.setCromElemGene(pos, j, k, Des.getCromElemGene(i,j,k));\r\n }\r\n poblac.setIndivEvaluated(pos,false);\r\n }\r\n\r\n }", "@Test\n\tpublic void checkAlreadyMinimal() {\n\n\t\tSet<FunctionalDependency> input = set(\n\t\t\t\tnew FunctionalDependency(set(\"A\"), set(\"B\")),\n\t\t\t\tnew FunctionalDependency(set(\"B\"), set(\"C\")),\n\t\t\t\tnew FunctionalDependency(set(\"B\"), set(\"D\")));\n\n\t\tSet<FunctionalDependency> output = minimalBasisSolver.findMinimal(input);\n\n\t\tassertEquals(input, output);\n\t}", "public boolean bestFirstSearch() {\n\t\twhile(!soloution){\n\t\t\tif(open.isEmpty()){\n\t\t\t\tSystem.out.println(\"No more choices to explore\");\n\t\t\t\tSystem.out.println(\"SolutionId: \" + solutionId);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t//chooses the most optimal X\n\t\t\tNode x = popNode();\n\t\t\tclosed.add(x);\n\t\t\tSystem.out.println(\"X:\\t\\t\" + x.state + \" \" + x.h + \" + \" + x.g + \" = \" + x.f);\n\t\t\t//checks if it is a soulution\n\t\t\tif(solution(x)){\n\t\t\t\tSystem.out.println(\"SOLUTION:\\t\" + x.state);\n\t\t\t\tSystem.out.println(\"nodes created: \" + open.size() + closed.size());\n\t\t\t\tprintSolution(x);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t//handles the possible moves from the state x\n\t\t\tsucc = generateAllSuccesors(x);\n\t\t\tfor (Node s : succ) {\n\t\t\t\t//if this state already exist, we will use the node keeping it instead\n\t\t\t\tNode old = findOld(s);\n\t\t\t\tif(old != null)\n\t\t\t\t\ts = old;\n\t\t\t\t//makes the new node a child of x\n\t\t\t\tx.kids.add(s);\n\t\t\t\t//if its a new state it will be inserted to open after evaluation\n\t\t\t\tif(!open.contains(s) && !closed.contains(s)){\n\t\t\t\t\tattachAndEval(s,x);\n\t\t\t\t\tinsert(s);\n\t\t\t\t}\n\t\t\t\t//if its an old node and x is a better parent it will be evalueted again.\n\t\t\t\telse if(x.g + arcCost(x, s) < s.g){\n\t\t\t\t\tattachAndEval(s, x);\n\t\t\t\t\tif(closed.contains(s)){\n\t\t\t\t\t\t//if its closed all children will be evaluated with the new score of \"s\"\n\t\t\t\t\t\tpropagatePathImprovements(s);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public abstract IDecisionVariable getVariable();", "protected IExpressionValue possibleVal()throws TableFunctionMalformedException,\r\n\t\t\t\t\t\t\t\t\t\t\t\t SomeStateUndeclaredException {\r\n\r\n\t\tthis.getName();\r\n\t\t\r\n\t\t// Use a list to store already known states or identifiers to evaluate already known values... \r\n//\t\tIExpressionValue ret = new SimpleProbabilityValue(Float.NaN);\r\n\t\tif (this.currentHeader != null) {\r\n\t\t\t// check if this is not a user-defined variable first;\r\n\t\t\tIExpressionValue userDefinedVariableValue = this.currentHeader.getUserDefinedVariable(noCaseChangeValue);\r\n\t\t\tif (userDefinedVariableValue != null) {\r\n\t\t\t\treturn userDefinedVariableValue;\r\n\t\t\t}\r\n\t\t\t// check if this is not another state of current node\r\n\t\t\tfor (TempTableProbabilityCell cell : this.currentHeader.getCellList()) {\r\n\t\t\t\t if (cell.getPossibleValue().getName().equalsIgnoreCase(value) ) {\r\n\t\t\t\t\t // Debug.println(\"\\n => Variable value found: \" + cell.getPossibleValue().getName());\r\n\t\t\t\t\t return cell.getProbability();\r\n\t\t\t\t\t \r\n\t\t\t\t }\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// if null, it means it was called before an assignment\r\n\t\t\tthrow new SomeStateUndeclaredException(getNode().toString());\r\n\t\t}\r\n\t\t\r\n\r\n\r\n\t\t// Debug.println(\"An undeclared possible value or a \\\"varsetname\\\" was used : \" + value);\r\n//\t\treturn ret;\r\n\t\treturn null;\r\n\t}", "static TDN revealFirst ( TDN chosen, TDN current, int guess ) {\n\t// return ... ;\n\t// return ... chosen.first ... chosen.second ... chosen.third ... current.first ... current.second ... current.third .. guess ;\n\t/*\n\treturn new TDN ( ... chosen.first ... chosen.second ... chosen.third ... current.first ... current.second ... current.third .. guess,\n\t\t\t ... chosen.first ... chosen.second ... chosen.third ... current.first ... current.second ... current.third .. guess,\n\t\t\t ... chosen.first ... chosen.second ... chosen.third ... current.first ... current.second ... current.third .. guess ) ;\n\t*/\n\tif ( chosen.first == guess ) {\n\t return new TDN ( chosen.first,\n\t\t\t current.second,\n\t\t\t current.third) ;\n\t} else {\n\t return current;\n\t /*\n\t return new TDN ( current.first,\n\t current.second,\n\t\t\t current.third) ;\n\t */\n\t}\n }", "public Website treeMinimum(Website site) {\r\n\t\tWebsite localSite = site; // Local pointer to given Site\r\n\t\twhile (localSite.getLeft() != null&&localSite.getLeft().getPageRank()!=0) { // Traversing Loop, stops at null node\r\n\t\t\tlocalSite = localSite.getLeft(); // incrementation Condition\r\n\t\t}\r\n\t\treturn localSite; // Returns minimum\r\n\t}", "private static int min_value(State curr_state) {\n\t\tcounterMinimax++;\r\n\r\n\t\t//Check if the current state is a terminal state, if it is, return\r\n\t\t//its terminal value\r\n\t\tif(curr_state.isTerminal()){\r\n\t\t\treturn curr_state.getScore();\r\n\t\t}\r\n\r\n\t\tint min_value = Integer.MAX_VALUE;\r\n\t\t//Get the successors of the current state, as light always runs second\r\n\t\t//it will call minValue;\r\n\t\tState[] successors = curr_state.getSuccessors('2');\r\n\r\n\t\tif(successors.length == 0 && curr_state.isTerminal() == false){\r\n\t\t\tmin_value = Math.min(min_value, max_value(curr_state));\r\n\t\t}\r\n\r\n\r\n\t\t//Select the successor that returns the smallest(optimal) value\r\n\t\tfor(State state : successors){\r\n\t\t\tmin_value = Math.min(min_value, max_value(state));\r\n\t\t}\r\n\r\n\r\n\t\treturn min_value;\r\n\t}", "public RTWLocation firstN(int n);", "ProbeLevel minimumLevel();", "private Board DLS(Board start, Board goal, int depth) {\n Board found = null;\n // Paso base: Si start es la solucion y esta en el ultimo nivel, regresa\n if((depth == 0) && start.equals(goal)) {\n return start;\n }\n // Si el nivel aun no es el ultimo, se obtienen los nodos hijos\n // y se vuelve a llamar la funcion en ellos\n else if(depth > 0) {\n // Obtiene los nodos hijos\n // Todas las posibles configuraciones del tablero que se pueden\n // hacer a partir de la actual\n ArrayList<Board> children = start.expand();\n\n expandedNodes++;\n\n // Para cada hijo vuelve a hacer lo mismo\n for(Board child : children) {\n found = DLS(child, goal, depth - 1);\n if(found != null)\n return found;\n }\n }\n return null;\n }", "@Test\n public void testSingleRunWithUnsatisfiablePenalizingConstraint() {\n System.out.println(\" - test single run with unsatisfiable penalizing constraint\");\n // set constraint\n final double penalty = 7.8;\n problem.addPenalizingConstraint(new NeverSatisfiedPenalizingConstraintStub(penalty));\n // single run\n System.out.format(\" - low temperature (T = %.7f)\\n\", LOW_TEMP);\n singleRunWithMaxRuntime(searchLowTemp, SINGLE_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT);\n System.out.format(\" - medium temperature (T = %.7f)\\n\", MED_TEMP);\n singleRunWithMaxRuntime(searchMedTemp, SINGLE_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT);\n System.out.format(\" - high temperature (T = %.7f)\\n\", HIGH_TEMP);\n singleRunWithMaxRuntime(searchHighTemp, SINGLE_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT);\n // verify\n PenalizedEvaluation penEval;\n penEval = (PenalizedEvaluation) searchLowTemp.getBestSolutionEvaluation();\n assertEquals(penalty, penEval.getEvaluation().getValue() - penEval.getValue(), TestConstants.DOUBLE_COMPARISON_PRECISION);\n penEval = (PenalizedEvaluation) searchMedTemp.getBestSolutionEvaluation();\n assertEquals(penalty, penEval.getEvaluation().getValue() - penEval.getValue(), TestConstants.DOUBLE_COMPARISON_PRECISION);\n penEval = (PenalizedEvaluation) searchHighTemp.getBestSolutionEvaluation();\n assertEquals(penalty, penEval.getEvaluation().getValue() - penEval.getValue(), TestConstants.DOUBLE_COMPARISON_PRECISION);\n }", "private int HeuristicValue(PuzzleState aState, PuzzleState goalState)\n\t{\n\t\tint heuristic = 0;\n\t\tfor(int i = 0; i < aState.Puzzle.length; i++)\n\t\t{\n\t\t\tfor(int j = 0; j < aState.Puzzle[i].length; j++)\n\t\t\t{\n\t\t\t\tif(aState.Puzzle[i][j] != goalState.Puzzle[i][j])\n\t\t\t\t\theuristic++;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn heuristic;\n\t}", "private static double minMaxPruning(GameState state, int depth, double alpha, double beta){\n\n double v = 0;\n\n // A vector containing all possible children states if this current state\n Vector<GameState> nextStates = new Vector<GameState>();\n state.findPossibleMoves(nextStates);\n\n /**\n // Try testing win/loss before going into depth search\n Move m = state.getMove();\n\n if(m.isXWin()){\n return 1000+depth;\n }\n\n else if(m.isOWin()){\n return -1;\n }\n */\n if (depth==0 || nextStates.size()==0){\n v = evalState(state);\n }\n\n // 2 is 'O' so if nextPlayer is 2 it means that the current player is 'X'\n else if (state.getNextPlayer() == 1){\n v=Double.NEGATIVE_INFINITY;\n\n for(GameState s: nextStates){\n v = Math.max(v, minMaxPruning(s,depth-1, alpha, beta));\n alpha = Math.max(alpha, v);\n if(beta <= alpha) {\n return v;\n }\n }\n }\n // 1 is 'X' so if nextplayer is 1 it means that the current player is 'O'\n else if (state.getNextPlayer() == 2){\n v=Double.POSITIVE_INFINITY;\n\n for(GameState s: nextStates){\n v= Math.min(v,minMaxPruning(s,depth-1, alpha, beta));\n beta = Math.min(beta, v);\n if( beta <= alpha ) {\n return v;\n }\n }\n }\n return v;\n }", "private Integer getRandomUnvisitedNeighbourIndex(int currentIndex) {\n\t\t\n\t\tArrayList<Integer> neighbors = setUnvisitedNeighbors(currentIndex);\n\t\t\n\t\tRandom random = new Random();\n\t\t\t\t\n\t\treturn neighbors.size() == 0 ? NOT_EXIST : neighbors.get(random.nextInt(neighbors.size())); \n\t}", "private Point findStartPoint(){\n Point min = points.get(0);\n for (int i = 1; i < points.size(); i++) {\n min = getMinValue(min, points.get(i));\n }\n return min;\n }", "public MoveEvaluation alreadyDetermined(IGameState state) {\n\t\tNode<Pair> node = list.head();\n\t\t\n\t\twhile (node != null) {\n\t\t\tPair p = node.value();\n\t\t\tif (state.equivalent(p.state)) {\n\t\t\t\treturn p.move;\n\t\t\t}\n\t\t\t\n\t\t\tnode = node.next();\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "@Override\n\tpublic Agent selectNextAgent(int ts){\n\n\t\tLinkedList<Agent> list;\n\t\tLinkedList<Agent> yours = null;\n\t\tLinkedList<Agent> others = null;\n\t\tlist=this.carlos.network.availableAgentsInTS;\n\n\t\tif(this.targetValue == 1){\n\t\t\tyours = this.carlos.network.availablePosAgentsInTS;\n\t\t\tothers = this.carlos.network.availableNegAgentsInTS; \n\t\t}\n\t\telse if(this.targetValue == -1){\n\t\t\tothers = this.carlos.network.availablePosAgentsInTS;\n\t\t\tyours = this.carlos.network.availableNegAgentsInTS; \n\t\t}\n\t\t\n\t\t//safe yours\n\t\tfor(Agent agent : yours){\n\t\t\tdouble tauPos = carlos.network.getTauPos(agent, ts-1);\n\t\t\tif(targetValue == 1 && (1-tauPos) < carlos.tau){\n\t\t\t\tcontinue; //safe\n\t\t\t}\n\t\t\t\n\t\t\tif(targetValue == -1 && (tauPos) < carlos.tau){\n\t\t\t\tcontinue; //safe\n\t\t\t}\n\t\t\t\n\t\t\t//System.out.println(\"TakeSing: found one\");\n\t\t\treturn agent;\n\t\t}\n\t\t\n\t\t//Steel others which you can get\n\t\tfor(Agent agent: others){\n\t\t\tdouble tauPos = carlos.network.getTauPos(agent, ts-1);\n\t\t\tif(targetValue == 1 && (tauPos) < carlos.tau){\n\t\t\t\tcontinue; //lost anyway\n\t\t\t}\n\t\t\t\n\t\t\tif(targetValue == -1 && (1-tauPos) < carlos.tau){\n\t\t\t\tcontinue; //lost anyway\n\t\t\t}\n\t\t\t//System.out.println(\"TakeSing: found one\");\n\t\t\treturn agent;\n\t\t}\n\t\t\n\t\treturn this.carlos.network.availableAgentsInTS.getFirst();\n\t}", "default int minimumHit(Player player) {\n\t\treturn -1;\n\t}", "public PuzzleState getStateWithShortestPath();", "Object getWorst();", "public static IntStrategy minDom_LB(IntVar... VARS) {\n return custom(minDomainSize_var_selector(), min_value_selector(), VARS);\n }", "Object getBest();", "public void testLPState()\n \t{\n \t\tsolver.buildLPState();\n \t\tassertTrue(solver.hasLPState());\n \t\t\n \t\tfinal int nLPVars = solver.getNumberOfLPVariables();\n \t\tassertTrue(nLPVars >= 0);\n \t\t\n \t\tfinal double[] objective = solver.getObjectiveFunction();\n \t\tassertEquals(nLPVars, objective.length);\n \t\t\n \t\tint nVarsUsed = 0;\n \t\t\n \t\tfor (VariableBase var : model.getVariables())\n \t\t{\n \t\t\tSVariable svar = solver.getSolverVariable(var);\n \t\t\tassertSame(svar, solver.createVariable(var));\n \t\t\t\n \t\t\tDiscrete mvar = svar.getModelObject();\n \t\t\tassertSame(var, mvar);\n \t\t\tassertSame(solver, svar.getParentGraph());\n \t\t\t\n \t\t\t// Test do-nothing methods\n \t\t\tsvar.resetEdgeMessages(0);\n \t\t\tsvar.updateEdge(0);\n \t\t\tsvar.moveMessages(null, 0, 1);\n \t\t\tassertNull(svar.getInputMsg(0));\n \t\t\tassertNull(svar.getOutputMsg(0));\n \t\t\tassertNull(svar.createMessages(null));\n \t\t\tassertNull(svar.resetInputMessage(null));\n \t\t\t\n \t\t\tint lpVar = svar.getLPVarIndex();\n \t\t\tint nValidAssignments = svar.getNumberOfValidAssignments();\n \t\t\t\n \t\t\tif (var.hasFixedValue())\n \t\t\t{\n \t\t\t\t// Currently the converse is not true because model variables\n \t\t\t\t// do not currently check to see if there is only one non-zero input weight.\n \t\t\t\tassertTrue(svar.hasFixedValue());\n \t\t\t}\n \t\t\tif (svar.hasFixedValue())\n \t\t\t{\n \t\t\t\tassertFalse(svar.hasLPVariable());\n \t\t\t}\n \t\t\tif (svar.hasLPVariable())\n \t\t\t{\n \t\t\t\tassertTrue(lpVar >= 0);\n \t\t\t\tassertTrue(nValidAssignments > 1);\n \t\t\t\t++nVarsUsed;\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\tassertEquals(-1, lpVar);\n \t\t\t\tassertTrue(nValidAssignments <= 1);\n \t\t\t}\n \t\t\t\n \t\t\tdouble[] weights = mvar.getInput();\n \t\t\tdouble totalWeight = 0.0;\n \t\t\tfor (double w : weights)\n \t\t\t{\n \t\t\t\ttotalWeight += w;\n \t\t\t}\n \t\t\t\n \t\t\tfor (int i = 0, end = svar.getModelObject().getDomain().size(); i < end; ++i)\n \t\t\t{\n \t\t\t\tdouble w = mvar.getInput()[i];\n \t\t\t\tint lpVarForValue = svar.domainIndexToLPVar(i);\n \t\t\t\tint i2 = svar.lpVarToDomainIndex(lpVarForValue);\n \t\t\t\tif (lpVarForValue >= 0)\n \t\t\t\t{\n \t\t\t\t\tassertEquals(i, i2);\n\t\t\t\t\tassertEquals(Math.log(w), objective[lpVarForValue], 1e-6);\n \t\t\t\t}\n \t\t\t\tif (!svar.hasLPVariable() || mvar.getInput()[i] == 0.0)\n \t\t\t\t{\n \t\t\t\t\tassertEquals(-1, lpVarForValue);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \t\tfor (Factor factor : model.getFactors())\n \t\t{\n \t\t\tSTableFactor sfactor = solver.getSolverFactor(factor);\n \t\t\tassertSame(sfactor, solver.createFactor(factor));\n \t\t\tassertSame(factor, sfactor.getModelObject());\n \t\t\tassertSame(solver, sfactor.getParentGraph());\n \t\t\t\n \t\t\t// Test do nothing methods\n \t\t\tsfactor.createMessages();\n \t\t\tsfactor.updateEdge(0);\n \t\t\tsfactor.resetEdgeMessages(0);\n \t\t\tsfactor.moveMessages(null, 0 , 1);\n \t\t\tassertNull(sfactor.getInputMsg(0));\n \t\t\tassertNull(sfactor.getOutputMsg(0));\n \t\t}\n \t\t\n \t\tfinal List<IntegerEquation> constraints = solver.getConstraints();\n \t\tassertNotNull(constraints);\n \n \t\tint nConstraints = solver.getNumberOfConstraints();\n \t\tint nVarConstraints = solver.getNumberOfVariableConstraints();\n \t\tint nMarginalConstraints = solver.getNumberOfMarginalConstraints();\n \t\tassertEquals(nConstraints, constraints.size());\n \t\tassertEquals(nConstraints, nVarConstraints + nMarginalConstraints);\n \t\tassertEquals(nVarsUsed, nVarConstraints);\n \t\t\n \t\t{\n \t\t\tMatlabConstraintTermIterator termIter = solver.getMatlabSparseConstraints();\n \t\t\tList<Integer> constraintTerms = new ArrayList<Integer>(termIter.size() * 3);\n \t\t\t\n \t\t\tIterator<IntegerEquation> constraintIter = constraints.iterator();\n \t\t\tfor (int row = 1; constraintIter.hasNext(); ++ row)\n \t\t\t{\n \t\t\t\tIntegerEquation constraint = constraintIter.next();\n \t\t\t\t\n \t\t\t\tint nExpectedTerms = -1;\n \t\t\t\tint lpVar = -1;\n \t\t\t\t\n \t\t\t\tif (row <= nVarConstraints)\n \t\t\t\t{\n \t\t\t\t\tLPVariableConstraint varConstraint = constraint.asVariableConstraint();\n \t\t\t\t\tassertNotNull(varConstraint);\n \t\t\t\t\tassertNull(constraint.asFactorConstraint());\n \t\t\t\t\t\n \t\t\t\t\tSVariable svar = varConstraint.getSolverVariable();\n \t\t\t\t\tassertTrue(svar.hasLPVariable());\n \t\t\t\t\t\n \t\t\t\t\tassertEquals(1, varConstraint.getRHS());\n \t\t\t\t\tnExpectedTerms = svar.getNumberOfValidAssignments();\n \t\t\t\t\t\n \t\t\t\t\tlpVar = svar.getLPVarIndex();\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tLPFactorMarginalConstraint factorConstraint = constraint.asFactorConstraint();\n \t\t\t\t\tassertNotNull(factorConstraint);\n \t\t\t\t\tassertNull(constraint.asVariableConstraint());\n \t\t\t\t\t\n \t\t\t\t\tSTableFactor sfactor = factorConstraint.getSolverFactor();\n \t\t\t\t\tlpVar = sfactor.getLPVarIndex();\n \t\t\t\t\t\n \t\t\t\t\tassertEquals(0, factorConstraint.getRHS());\n \t\t\t\t\tnExpectedTerms = sfactor.getNumberOfValidAssignments();\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tint[] lpvars = constraint.getVariables();\n \t\t\t\tassertEquals(constraint.size(), lpvars.length);\n \t\t\t\tassertEquals(0, constraint.getCoefficient(-1));\n \t\t\t\tassertEquals(0, constraint.getCoefficient(lpVar + nExpectedTerms));\n \t\t\t\tassertFalse(constraint.hasCoefficient(-1));\n \t\t\t\t\n \t\t\t\tassertTrue(lpVar >= 0);\n \n \t\t\t\tIntegerEquation.TermIterator constraintTermIter = constraint.getTerms();\n \t\t\t\tfor (int i = 0; constraintTermIter.advance(); ++i)\n \t\t\t\t{\n \t\t\t\t\tassertEquals(lpvars[i], constraintTermIter.getVariable());\n \t\t\t\t\tassertEquals(constraintTermIter.getCoefficient(), constraint.getCoefficient(lpvars[i]));\n \t\t\t\t\tassertTrue(constraint.hasCoefficient(lpvars[i]));\n \t\t\t\t\tconstraintTerms.add(row);\n \t\t\t\t\tconstraintTerms.add(constraintTermIter.getVariable());\n \t\t\t\t\tconstraintTerms.add(constraintTermIter.getCoefficient());\n \t\t\t\t}\n \t\t\t\tassertFalse(constraintTermIter.advance());\n \t\t\t}\n \t\t\t\n \t\t\tfor (int i = 0; termIter.advance(); i += 3)\n \t\t\t{\n \t\t\t\tassertEquals((int)constraintTerms.get(i), termIter.getRow());\n \t\t\t\tassertEquals(constraintTerms.get(i+1) + 1, termIter.getVariable());\n \t\t\t\tassertEquals((int)constraintTerms.get(i+2), termIter.getCoefficient());\n \t\t\t}\n \t\t\tassertFalse(termIter.advance());\n \t\t}\n \t\t\n \t\t\n \t\tif (expectedConstraints != null)\n \t\t{\n \t\t\tIterator<IntegerEquation> constraintIter = constraints.iterator();\n \t\t\tassertEquals(expectedConstraints.length, solver.getNumberOfConstraints());\n \t\t\tfor (int i = 0, end = expectedConstraints.length; i < end; ++i)\n \t\t\t{\n \t\t\t\tByteArrayOutputStream out = new ByteArrayOutputStream();\n \t\t\t\tIntegerEquation constraint = constraintIter.next();\n \t\t\t\tconstraint.print(new PrintStream(out));\n \t\t\t\tString actual = out.toString().trim();\n \n \t\t\t\tString expected = expectedConstraints[i].trim();\n \n \t\t\t\tif (!expected.equals(actual))\n \t\t\t\t{\n \t\t\t\t\tSystem.out.format(\"Constraint %d mismatch:\\n\", i);\n \t\t\t\t\tSystem.out.format(\"Expected: %s\\n\", expected);\n \t\t\t\t\tSystem.out.format(\" Actual: %s\\n\", actual);\n \t\t\t\t}\n \t\t\t\tassertEquals(expected, actual);\n \t\t\t}\n \t\t}\n \t\t\n \t\t// Test setting solution. A real solution will only use ones and zeros,\n \t\t// but we will use random values to make sure they are assigned correctly.\n \t\tdouble[] solution = new double[nLPVars];\n \t\tRandom rand = new Random();\n \t\tfor (int i = solution.length; --i>=0;)\n \t\t{\n \t\t\tsolution[i] = rand.nextDouble();\n \t\t}\n \t\tsolver.setSolution(solution);\n \t\tfor (VariableBase var : model.getVariables())\n \t\t{\n \t\t\tSVariable svar = solver.getSolverVariable(var);\n \t\t\tdouble[] belief = svar.getBelief();\n \t\t\tif (svar.hasFixedValue())\n \t\t\t{\n \t\t\t\tint vali = svar.getValueIndex();\n \t\t\t\tfor (int i = belief.length; --i>=0;)\n \t\t\t\t{\n \t\t\t\t\tif (i == vali)\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(1.0, belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t\telse\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(0.0, belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\tfor (int i = svar.getModelObject().getDomain().size(); --i>=0;)\n \t\t\t\t{\n \t\t\t\t\tint lpVar = svar.domainIndexToLPVar(i);\n \t\t\t\t\tif (lpVar < 0)\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(0, belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t\telse\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(solution[lpVar], belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \t\tsolver.clearLPState();\n \t\tassertInitialState();\n \t}", "public AnyType findMin() {\r\n\t\tif (isEmpty())\r\n\t\t\tthrow new UnderflowException();\r\n\t\treturn findMin(root).element;\r\n\t}", "@Override\r\n\tpublic double min_value(GameState s, int depthLimit)\r\n\t{\r\n\t\tdouble stateEvaluationValue = stateEvaluator(s);\r\n\t\r\n\t\tif (depthLimit == 0)\r\n\t\t{\r\n\t\t\treturn -(stateEvaluationValue);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tdouble currMin = Double.POSITIVE_INFINITY;\r\n\t\t\tint bestMove = 0;\r\n\t\t\tArrayList <Integer> succList = generateSuccessors(s.lastMove, s.takenList);\r\n\t\t\tif (succList.isEmpty())\r\n\t\t\t{\r\n\t\t\t\ts.leaf = true;\r\n\t\t\t\treturn 1;\r\n\t\t\t}\r\n\t\t\tIterator <Integer> myItr = succList.iterator();\r\n\t\t\t\r\n\t\t\twhile (myItr.hasNext())\r\n\t\t\t{\r\n\t\t\t\tint currNumber = myItr.next();\r\n\t\t\t\t\r\n\t\t\t\tdouble tempMin = currMin;\r\n\t\t\t\tint [] newList = s.takenList;\r\n\t\t\t\tnewList [currNumber] = 2;\r\n\t\t\t\tGameState newGameState = new GameState(newList, currNumber);\r\n\t\t\t\tcurrMin = Math.min(currMin, max_value(newGameState, depthLimit - 1));\r\n\r\n\t\t\t\tif (currMin < tempMin)\r\n\t\t\t\t{\r\n\t\t\t\t\tbestMove = currNumber;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ts.bestMove = bestMove;\r\n\t\t\treturn currMin;\r\n\r\n\t\t}\r\n\t}", "public BSTMapNode findMin() \n\t{\n\t\t\n\t\t\n\t\treturn null;\n\t}", "private int deadZone(int value, int minValue)\n\t{\n\t\tif (Math.abs(value) < minValue) value = 0;\n\t\t\n\t\treturn value;\n\t}", "public boolean getMiss(int a)\r\n\t{\r\n\t\tif(Math.random()>(((double)a/(vlr+a))))\r\n\t\t\treturn false;\r\n\t\telse\r\n\t\t\treturn true;\r\n\t}", "public Move chooseMove(PentagoBoardState boardState) {\r\n try {\r\n if (heuristicOnly) {\r\n System.out.println(\"chose from heuristic\");\r\n return Heuristics.choseMove(new LowMemoryBoardState(boardState));\r\n }\r\n if (mcts == null) {\r\n mcts = new MonteCarloUCT();\r\n }\r\n return mcts.nextMove(new LowMemoryBoardState(boardState));\r\n } catch (OutOfMemoryError e) {\r\n /*\r\n if the memory limit is exceeded, we *attempt* to free memory\r\n by nullifying our mcts and asking the JVM to garbage collect.\r\n Since this is a serious error, we switch the instance to use\r\n a heuristic exclusively, to prevent going over the memory limit\r\n again.\r\n */\r\n mcts = null;\r\n System.gc();\r\n this.heuristicOnly = true;\r\n return Heuristics.choseMove(new LowMemoryBoardState(boardState));\r\n }\r\n }", "private void findBestPath(int start){\n\t\tint n = this.getDimension(); // for readability\n\t\tint lastCity, minDist = 0, moment = 0;\n\t\t\n\t\tthis.path = new int[this.getDimension() + 1];\n\t\tthis.visited = 0; \n\t\t\n\t\tsetAllUnvisited();\n\t\t\n\t\tvisitCity(moment, start); // visits the first city in time 0\n\t\tlastCity = start;\n//\t\tSystem.out.println(Arrays.toString(this.path) + \" > \" + this.visited);\n\t\t// Repeats until all cities were visited\n\t\twhile(visited < n){\n//\t\t\tSystem.out.println(\"LC:\" + lastCity + \" MD:\" + minDist + \" M:\" + moment);\n\t\t\tmoment++;\n\t\t\t\n\t\t\t// Finds the closest city\n\t\t\tint closest = -1, closestDist = -1;\n\t\t\tfor(int i = 0; i < n; i++){\n\t\t\t\tif(!wasVisited(i)){\n\t\t\t\t\tif(dist(lastCity, i) < closestDist || closestDist == -1){ // If it's the first iteration or found a closer city\n\t\t\t\t\t\tclosest = i;\n\t\t\t\t\t\tclosestDist = dist(lastCity, closest);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Updates distance\n\t\t\tminDist += dist(lastCity, closest);\n\t\t\t\n\t\t\t// Visits the closest city\n\t\t\tvisitCity(moment, closest);\n\t\t\tlastCity = closest;\n//\t\t\tSystem.out.println(Arrays.toString(this.path) + \" > \" + minDist);\n\t\t\t\n\t\t}\n\t\t\n\t\t// Returns to the first city\n\t\tvisitCity(moment + 1, start);\n\t\tminDist += dist(lastCity, start);\n\t\t\n\t\tif(minDist < this.totalDistance || this.totalDistance == -1){\n\t\t\tthis.totalDistance = minDist;\n\t\t\tthis.bestPath = this.path.clone();\n\t\t}\n//\t\tSystem.out.println(Arrays.toString(this.path) + \" -----> \" + minDist);\n\t}", "private SearchNode findFirstNode(HashSet<SearchNode> set){\n\t\t\tSearchNode min = null;\n\t\t\tfor (SearchNode cur : set){\n\t\t\t\tif (min == null || cur.fScore < min.fScore)\n\t\t\t\t\tmin = cur;\n\t\t\t}\n\t\t\treturn min;\n\t\t}", "private static <V extends Variable<A>, A extends Value> boolean INFER(SharedDomainVariableSet<V, A> variableSet, V variable) {\n\t\tList<Constraint<V>> constraints = variableSet.getConstraintsByVariable(variable);\n\t\t\n\t\tfor (Constraint<V> constraint : constraints) {\n\t\t\t// get all the variables that need to be set for this constraint\n\t\t\tQueue<V> variablesToSet = new LinkedList<>();\n\t\t\tfor (V v : constraint.getVariables()) {\n\t\t\t\tif (!v.isSet()) {\n\t\t\t\t\tvariablesToSet.add(v);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// try and find some combination of the unset variables to make the constraint valid\n\t\t\tif (!FIND_COMBINATION(variableSet, variablesToSet, constraint)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "private int selectNextCity(Ant ant) {\n int t = random.nextInt(numberOfCities - currentIndex);\n if (random.nextDouble() < randomFactor) {\n OptionalInt cityIndex = IntStream.range(0, numberOfCities)\n .filter(i -> i == t && !ant.visited(i))\n .findFirst();\n if (cityIndex.isPresent()) {\n return cityIndex.getAsInt();\n }\n }\n calculateProbabilities(ant);\n double r = random.nextDouble();\n double total = 0;\n for (int i = 0; i < numberOfCities; i++) {\n total += probabilities[i];\n if (total >= r) {\n return i;\n }\n }\n\n throw new RuntimeException(\"There are no other cities\");\n }", "private Set<Variable> extractBlockedDomainVars(Variable rangeVariable, ImmutableSet<Variable> domainVariables,\n ImmutableSet<Variable> aggregationVariables) {\n if (aggregationVariables.contains(rangeVariable))\n return domainVariables;\n\n Sets.SetView<Variable> aggregationDomainVariables = Sets.intersection(domainVariables, aggregationVariables);\n\n // Equalities from an aggregation variable to a grouping variable are blocked\n if (groupingVariables.contains(rangeVariable))\n return aggregationDomainVariables;\n\n // Fresh variables: need at least one variable to become projected\n // the latter may be an aggregation variable if there is no grouping variable\n Variable dominantVariable = aggregationDomainVariables.stream()\n .findAny()\n .orElseGet(() -> domainVariables.iterator().next());\n\n return Sets.difference(aggregationDomainVariables, ImmutableSet.of(dominantVariable));\n }", "@Override\n\tpublic BoardLocation findBestLocWhenStuck() {\n\t\treturn null;\n\t}" ]
[ "0.57804465", "0.54749465", "0.5394625", "0.52655816", "0.5200865", "0.51678723", "0.5130778", "0.5125643", "0.51256037", "0.5125349", "0.5101134", "0.5080856", "0.5071061", "0.50672233", "0.5052197", "0.50130326", "0.49961555", "0.4957893", "0.49476606", "0.49395028", "0.49248558", "0.48474553", "0.484721", "0.48471934", "0.48316455", "0.48139986", "0.48117274", "0.47726038", "0.47619638", "0.47594792", "0.47532785", "0.47388163", "0.47384778", "0.47198454", "0.4714771", "0.47002277", "0.46980992", "0.46906033", "0.46841824", "0.467835", "0.46782395", "0.4674273", "0.46594638", "0.46578398", "0.46574742", "0.46452773", "0.46324357", "0.46307755", "0.4629398", "0.4613484", "0.45967823", "0.45949015", "0.45861933", "0.45795155", "0.45780963", "0.4570104", "0.45660296", "0.45596692", "0.45595506", "0.45572254", "0.45562306", "0.45501554", "0.45496628", "0.45485058", "0.45483816", "0.45474413", "0.45436704", "0.45427597", "0.45339218", "0.45258564", "0.45187604", "0.4517488", "0.45099434", "0.4508183", "0.4505716", "0.4501654", "0.44986805", "0.44871646", "0.44838226", "0.4478898", "0.44778228", "0.44766903", "0.44764525", "0.4476419", "0.4474246", "0.44672358", "0.44671774", "0.44655737", "0.4460851", "0.44586128", "0.4452492", "0.4450666", "0.44485384", "0.4447409", "0.44467467", "0.4440121", "0.44375634", "0.44348672", "0.4434578", "0.44304088" ]
0.6604398
0
Selects the noninstantiated variable of largest domain, to branch on it. This heuristic is sometimes called AntiFirstFail.
public static VariableSelector<IntVar> maxDomainSize_var_selector() { return new AntiFirstFail(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static VariableSelector<IntVar> minDomainSize_var_selector() {\n return new FirstFail();\n }", "public int chooseVTD(){\n int min=0;\n //this loop is used to avoid a bug\n for(int i=0;i<heuristicArrayTD.length;i++){\n if(heuristicArrayTD[i]< heuristicArrayTD[min]){\n min=i;\n }\n }\n int max=min;\n //returns highest scoring and unused var\n for(int i=0;i<heuristicArrayTD.length;i++){\n if(heuristicArrayTD[i]>= heuristicArrayTD[max] && usageArray[i%variableLength]==0){\n max=i;\n }\n }\n return max%variableLength;\n }", "@Override\n public Variable useHeuristic(Deque<Variable> deque) {\n Variable highDomain = deque.getFirst();\n for (Variable var : deque){\n if (var.getDomain().size() > highDomain.getDomain().size()){\n highDomain = var;\n }\n }\n return highDomain;\n }", "public VariableCoefficientTuple suggestBranchingVariable (TwoIntegerTuple childRectCounts ) {\r\n \r\n VariableCoefficientTuple result= new VariableCoefficientTuple(null, ZERO) ;\r\n \r\n //first get the best lp rects\r\n List<Rectangle> rectanglesToConsiderForBranchingVarCalculation = this.getRectanglesToConsiderForBranchingVarCalculation( );\r\n \r\n //collect 0 direction refcounts into this map\r\n Map<String, Integer> zeroVar_RefCountMap = new HashMap<String, Integer> () ;\r\n //and one diirection refconts into this map\r\n Map<String, Integer> oneVar_RefCountMap = new HashMap<String, Integer> () ;\r\n \r\n List<VariableCoefficientTuple> variablesUsedForBranchingInThisRectangle =null;\r\n for (Rectangle rect: rectanglesToConsiderForBranchingVarCalculation){\r\n variablesUsedForBranchingInThisRectangle = getVariablesUsedForBranchingInThisRectangle (rect);\r\n if (variablesUsedForBranchingInThisRectangle.size()>ZERO) {\r\n this.updateVariableRefCounts(zeroVar_RefCountMap, oneVar_RefCountMap, variablesUsedForBranchingInThisRectangle) ;\r\n }else {\r\n System.err.print(\"trying to branch a node which should have been marked infeasible\" );\r\n exit(ONE);\r\n }\r\n }\r\n \r\n \r\n //now find the highest refcount var, no matter its direction\r\n int highZeroFreq = zeroVar_RefCountMap.isEmpty()?ZERO:Collections.max( zeroVar_RefCountMap.values());\r\n int highOneFreq = oneVar_RefCountMap.isEmpty()? ZERO: Collections.max(oneVar_RefCountMap.values()) ;\r\n \r\n //we need to find the selected var's refcount on the other side\r\n int selectedVarRefCountOnOtherSide = ZERO;\r\n \r\n int totalRects = getNumberOfRects(this.myInfeasibleRectanglesList) ;\r\n \r\n if (highZeroFreq>highOneFreq) {\r\n result.varName=getHighestFreqVar (zeroVar_RefCountMap,highZeroFreq ) ;\r\n result.coeff=highZeroFreq;\r\n selectedVarRefCountOnOtherSide= oneVar_RefCountMap.get( result.varName)==null? ZERO : oneVar_RefCountMap.get( result.varName);\r\n //this is how many rects will survive on either side\r\n childRectCounts.zeroSideCount = totalRects - selectedVarRefCountOnOtherSide;\r\n childRectCounts.oneSideCount=totalRects -highZeroFreq ;\r\n \r\n } else {\r\n result.varName=getHighestFreqVar (oneVar_RefCountMap,highOneFreq ) ;\r\n result.coeff=highOneFreq;\r\n selectedVarRefCountOnOtherSide= zeroVar_RefCountMap.get( result.varName)==null? ZERO : zeroVar_RefCountMap.get( result.varName);\r\n \r\n childRectCounts.zeroSideCount = totalRects - highOneFreq;\r\n childRectCounts.oneSideCount=totalRects - selectedVarRefCountOnOtherSide;\r\n }\r\n \r\n return result;\r\n }", "public int getHighestVariable() {\n\t\treturn HighestVariable;\n\t}", "IntVar selectVariable(IntVar[] v) {\r\n\r\n if (v.length != 0) {\r\n int index = 0;\r\n int smallestDomain = Integer.MAX_VALUE;\r\n for(int i = 0; i< v.length-1; i++){\r\n if(v[i].domain.getSize()<smallestDomain){\r\n index = i;\r\n smallestDomain = v[i].domain.getSize();\r\n }\r\n\r\n }\r\n if(v[index].min() == v[index].max()){\r\n\r\n searchVariables = new IntVar[v.length-1];\r\n for (int i = 0; i < v.length-1; i++) {\r\n if(i<index){\r\n searchVariables[i] = v[i];\r\n }\r\n else searchVariables[i] = v[i+1];\r\n\r\n }\r\n }\r\n else{\r\n searchVariables = new IntVar[v.length];\r\n for(int i = 0; i < v.length; i++){\r\n searchVariables[i] = v[i];\r\n }\r\n }\r\n return v[index];\r\n\r\n }\r\n else {\r\n System.err.println(\"Zero length list of variables for labeling\");\r\n return new IntVar(store);\r\n }\r\n }", "public VariantType getLargestVariantType(VariantType notThis) {\n VariantType[] values = { VariantType.SNP_A, VariantType.SNP_C, VariantType.SNP_G, VariantType.SNP_T, VariantType.DELETION, VariantType.INSERTION, VariantType.OTHER };\n\n VariantType snpNuc = null;\n\n for (VariantType n : values) {\n if (n != notThis) {\n if (getCoverage(n, null) > 0 && (snpNuc == null || getCoverage(n, null) > getCoverage(snpNuc, null))){\n snpNuc = n;\n }\n }\n }\n\n return snpNuc;\n }", "Object getWorst();", "@Override\npublic boolean restrictNeighborhood(Solution solution)\n{\n\n\tSolver solver = solution.getSolver();\n\tint nbTotalVars = solver.getNbIntVars() - 1;\n\n\tint n = nbTotalVars - nbRelaxedVars;\n\tboolean b = false;\n\tIntVar var;\n\tselected.clear();\n\twhile (n > 0) {\n\t\tint index = random.nextInt(nbTotalVars);\n\t\tvar = solver.getIntVarQuick(index);\n\t\tif (var != solver.getObjective() && !selected.contains(index)) {\n\t\t\tif (solution.getIntValue(index) != Solution.NULL) {\n\t\t\t\tsolver.LOGGER.info(\"fix \" + var);\n\t\t\t\tsolver.post(solver.eq(var, solution.getIntValue(index)));\n\t\t\t\tb = true;\n\t\t\t}\n\t\t\tselected.add(index);\n\t\t\tn--;\n\t\t}\n\t}\n\treturn b;\n}", "private void findBest()\r\n\t{\r\n\t\tint i;\r\n\t\tint size_mature_pool;\r\n\t\tint idx_current;//index of a currently checked genotype\r\n\t\tint num_errors;//number of errors of the current chromosome\r\n\t\tdouble min_error;//smallest error among the oldest genotypes\r\n\t\tVector<Integer> idx_oldest;\r\n\t\t\r\n\t\tsize_mature_pool = _pool_of_bests.size();\r\n\t\t\r\n\t\tidx_oldest = new Vector<Integer>(0, 1);\r\n\t\t\r\n\t\t//find all oldest genotypes\r\n\t\tfor(i=0; i<size_mature_pool; i++)\r\n\t\t{\r\n\t\t\tnum_errors = _pool_of_bests.get(i)._error.all_single_squares.size();\r\n\t\t\tif(num_errors>=_min_life_span)\r\n\t\t\t{\r\n\t\t\t\tidx_oldest.add(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//find the best oldest gentypes with a span above a threshold\r\n\t\t_best_idx = -1;\r\n\t\tif(idx_oldest.size() > 0)\r\n\t\t{\r\n\t\t\t_best_idx = idx_oldest.get(0);\r\n\t\t\tmin_error = _pool_of_bests.get(_best_idx)._error.getAverageError();\r\n\t\t\tfor(i=1; i<idx_oldest.size(); i++)\r\n\t\t\t{\r\n\t\t\t\tidx_current = idx_oldest.get(i);\r\n\t\t\t\tif(min_error > _pool_of_bests.get(idx_current)._error.getAverageError())\r\n\t\t\t\t{\r\n\t\t\t\t\t_best_idx = idx_current;\r\n\t\t\t\t\tmin_error = _pool_of_bests.get(_best_idx)._error.getAverageError();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected IPlanningGoal selectGoal(){ \n List<IPlanningGoal> relevantGoals = representation.getRelevantGoals(body);\n \n //If we have failed to find plans for high priority goals and environment has not changed, lets try some \n //lower priority ones\n if(numFailuresSinceLastImportantEnvChange < relevantGoals.size()){\n return relevantGoals.get(numFailuresSinceLastImportantEnvChange);\n } else {\n //tried all relevant goals but all failed, lets try it once more\n representation.setMarker(body);\n numFailuresSinceLastImportantEnvChange = 0;\n return relevantGoals.get(0);\n }\n }", "private static void solve() {\n\t\tList<Integer> rgtMax= new ArrayList<>();\n\t\tList<Integer> lftMax= new ArrayList<>();\n\t\t\n\t\tpopulateRgtMax(rgtMax);\n\t\tpopulateLftMax(lftMax);\n\t\t\t\t\n\t\tint area=findMaxArea(lftMax,rgtMax);\n\t\tSystem.out.println(area);\n\t\t\n\t}", "public Location findLargest() {\n int max = -1;\n\n final LinkedList<Location> loc = new LinkedList<>();\n\n for (int r = 0; r < board.length; r++)\n for (int c = 0; c < board[0].length; c++)\n if (board[r][c] > max) {\n loc.clear();\n max = board[r][c];\n loc.add(new Location(r, c));\n } else if (board[r][c] == max)\n loc.add(new Location(r, c));\n\n Collections.shuffle(loc);\n\n return loc.pop();\n }", "public double getDomainMax1() throws IllegalStateException {\n\treturn Double.MAX_VALUE;\n }", "private static int max_value_with_pruning(State curr_state, int alpha, int beta) {\n\t\tcounterPruning++;\r\n\r\n\t\t//If s is a terminal state, return its game value\r\n\t\tif(curr_state.isTerminal()){\r\n\t\t\treturn curr_state.getScore();\r\n\t\t}\r\n\r\n\t\tState[] successors = curr_state.getSuccessors('1');\r\n\r\n\t\t//If there is no valid move available but it is not a terminal node\r\n\t\tif(successors.length == 0 && curr_state.isTerminal() == false){\r\n\t\t\talpha = Math.max(alpha, min_value_with_pruning(curr_state, alpha, beta));\r\n\t\t}\r\n\r\n\t\tfor(State state : successors){\r\n\t\t\talpha = Math.max(alpha, min_value_with_pruning(state, alpha, beta));\r\n\t\t\tif(alpha >= beta)\r\n\t\t\t\treturn beta;\r\n\t\t}\r\n\r\n\t\treturn alpha;\r\n\t}", "public SolutionType getBestSolution();", "public void SelectDNF(TableVar Variables) {\r\n float perf;\r\n int i, j, k, m, best, posicion[];\r\n\r\n posicion = new int[long_poblacion];\r\n for (i=0;i<long_poblacion;i++) {\r\n posicion[i] = 0;\r\n }\r\n\r\n // Compute the ranking of each individual of the population: element 0 is the better\r\n for (i=0;i<long_poblacion;i++) {\r\n // Find better individual of the rest\r\n best=-1;\r\n perf=0;\r\n for (j=0;j<long_poblacion;j++) {\r\n if (posicion[j]==0 && (best==-1 || Utils.BETTER(poblac.getIndivFitness(j), perf))) {\r\n // If the individual is better\r\n perf = poblac.getIndivFitness(j);\r\n best = j;\r\n }\r\n }\r\n // Mark the individual with the ranking\r\n posicion[best] = i;\r\n }\r\n\r\n // The intermediary population is the ordered copy\r\n for (i=0;i<long_poblacion;i++) {\r\n k = posicion[i];\r\n for (j=0;j<Variables.getNVars();j++)\r\n for (m=0; m<=Variables.getNLabelVar(j); m++)\r\n Inter.setCromElemGene(k,j, m, poblac.getCromElemGene(i,j,m));\r\n Inter.setIndivFitness(k, poblac.getIndivFitness(i));\r\n Inter.setIndivEvaluated(k,true);\r\n }\r\n\r\n }", "public AnyType findMax() {\r\n\t\tif (isEmpty())\r\n\t\t\tthrow new UnderflowException();\r\n\t\treturn findMax(root).element;\r\n\t}", "private int recursivelyFixVars(IntArrayList varNodes)\n throws AlgorithmException\n {\n int x;\n \n // Even though we are not iterating through varNods,\n // this loop is more efficient than using allFixed(varNodes)\n // and it guarantees that we won't get stuck in an infinte\n // loop.\n int N = varNodes.size();\n for(x=0; x < N; x++)\n {\n // Get the node that is connected to the most number\n // of undetermined variables.\n int var = _fg.chooseMaxConnode(varNodes);\n \n if(var < 0)\n {\n _fg.fixVar(var);\n \n _runMaxProduct();\n\n // find all active paths (ie. sigma vars with max state == 1)\n //int[] activePaths = getActivePaths();\n \n Submodel model = fixUniqueVars(var);\n \n //model.setActivePaths(activePaths);\n \n _submodels.add(model);\n logger.info(\"added submodel \" + model.getId()\n + \" with \" + model.size() + \" vars. \"\n + countDegenerate(varNodes) + \" vars still not fixed\");\n }\n else\n {\n // var == 0 means that all of the nodes are fixed.\n break;\n }\n }\n \n return x;\n }", "public void findHighestPowerUnitAnySize() {\r\n\t\ttimer.startAlgorithm(\"ChronalCharger.findHighestPowerUnitAnySize()\");\r\n\t\tfor (int i=1; i<=300; i++) {\r\n//\t\t\tcurrentGrid = new ShrinkingPowerGrid(i, 300);\r\n\t\t\tfindHighestPowerUnit(i);\r\n//\t\t\tpreviousGrids.add(currentGrid);\r\n\t\t}\r\n\t\ttimer.stopAlgorithm();\r\n\t}", "abstract int getMaxLevel();", "public Space nextUnsolved(){\n for (int i = 0; i < dimensions[0];i++){\n for (int j = 0; j<dimensions[1];j++){\n if (grids[i][j].labeled==false) return grids[i][j];\n }\n }\n return null;\n }", "public Comparable<?> b(DiscreteDomain<Comparable<?>> discreteDomain) {\n return discreteDomain.maxValue();\n }", "public int nEigenOneOrGreater(){\n if(!this.pcaDone)this.pca();\n return this.greaterThanOneLimit;\n }", "private int getPRFurthestUse() {\n int max = -1;\n int maxPR = -1;\n for (int i = 0; i < numPhysRegs - 1; i++) {\n if (PRNU[i] > max) {\n max = PRNU[i];\n maxPR = i;\n }\n }\n return maxPR; // no free physical register\n }", "public int maxLocals();", "public boolean label(IntVar[] vars) {\r\n\r\n\r\n //System.out.println(\"ct \" + vars.length);\r\n count++;\r\n if (trace) {\r\n for (int i = 0; i < vars.length; i++)\r\n System.out.print (vars[i] + \" \");\r\n System.out.println ();\r\n }\r\n\r\n ChoicePoint choice = null;\r\n boolean consistent;\r\n\r\n // Instead of imposing constraint just restrict bounds\r\n // -1 since costValue is the cost of last solution\r\n if (costVariable != null) {\r\n try {\r\n if (costVariable.min() <= costValue - 1)\r\n costVariable.domain.in(store.level, costVariable, costVariable.min(), costValue - 1);\r\n else\r\n return false;\r\n } catch (FailException f) {\r\n return false;\r\n }\r\n }\r\n\r\n consistent = store.consistency();\r\n\r\n if (!consistent) {\r\n // Failed leaf of the search tree\r\n return false;\r\n } else { // consistent\r\n\r\n if (vars.length == 0) {\r\n // solution found; no more variables to label\r\n\r\n // update cost if minimization\r\n if (costVariable != null)\r\n costValue = costVariable.min();\r\n\r\n reportSolution();\r\n\r\n return costVariable == null; // true is satisfiability search and false if minimization\r\n }\r\n\r\n choice = new ChoicePoint(vars);\r\n\r\n levelUp();\r\n\r\n store.impose(choice.getConstraint());\r\n\r\n // choice point imposed.\r\n\r\n consistent = label(choice.getSearchVariables());\r\n\r\n if (consistent) {\r\n levelDown();\r\n return true;\r\n } else {\r\n\r\n restoreLevel();\r\n store.impose(new Not(choice.getConstraint()));\r\n\r\n\r\n\r\n // negated choice point imposed.\r\n\r\n consistent = label(vars);\r\n\r\n levelDown();\r\n\r\n if (consistent) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n }\r\n }", "private int maxValue(Node state, int alpha, int beta) {\n\t\t\n\t\t\n\t\tthis.nodesExplored++;\n\t\tthis.nodesExploredThisTurn++;\n\t\t\n\t\tif (this.cutoffTest(state)) {\n\t\t\treturn state.eval(this.player);\n\t\t}\n\t\t\n\t\tArrayList<Move> legalMoves = state.getGame().getLegalMoves();\n\t\n\t\tif (this.moveOrdering) {\n\t\t\tthis.quickSort(state, legalMoves, 0, legalMoves.size() - 1, false);\n\t\t}\n\t\t\n\t\tint v = Integer.MIN_VALUE;\n\t\tMove bestMove = null;\n\t\tfor (Move move : legalMoves) {\n\t\t\t\n\t\t\tif (System.currentTimeMillis() - startMili > this.maxTime * 1000) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t\n\t\t\tint value = this.minValue(state.result(move), alpha, beta);\n\t\t\tif (v < value) { //\n\t\t\t\tv = value;\n\t\t\t\tbestMove = move;\n\t\t\t}\n\t\t\t\n\t\t\tif (v >= beta) {\n\t\t\t\tstate.setBestMove(bestMove);\n\t\t\t\t\n\t\t\t\treturn v;\n\t\t\t}\n\t\t\talpha = Math.max(v, alpha);\n\t\t}\n\t\tstate.setBestMove(bestMove);\n\t\treturn v;\n\t}", "public abstract OptimisationSolution getBestSolution();", "protected int chooseAppropriateDomainIndex(String originalDomain) {\n int domainIndex = 0;\n do {\n domainIndex = rnd.nextInt(replacements.size());\n } while (originalDomain.equals(replacements.get(domainIndex)));\n return domainIndex;\n }", "private int findProperLeavingBasicVariable(int newBasicColumn) {\n int rowLeavingBasicVariable = -1;\n for (int i = 0; i < numberOfVariables; i++) {\n if (tableaux[i][newBasicColumn] <= 0)\n continue;\n else if (rowLeavingBasicVariable == -1)\n rowLeavingBasicVariable = i;\n else if ((tableaux[i][numberOfConstraints\n + numberOfVariables] / tableaux[i][newBasicColumn]) < (tableaux[rowLeavingBasicVariable][numberOfConstraints\n + numberOfVariables] / tableaux[rowLeavingBasicVariable][newBasicColumn]))\n rowLeavingBasicVariable = i;\n }\n if (rowLeavingBasicVariable == -1) throw new ArithmeticException(\"PROGRAM NIEOGRANICZONY\");\n return rowLeavingBasicVariable;\n }", "public static VariableSelector<IntVar> maxRegret_var_selector() {\n return new MaxRegret();\n }", "private ProblemModel findCheapestNode(){\n\t\tProblemModel ret = unvisitedPM.peek();\n\t\t\n\t\tfor(ProblemModel p : unvisitedPM){ \n\t\t\t//f(s) = depth + cost to make this move\n\t\t\tif(p.getCost() + p.getDepth() <= ret.getCost() + ret.getDepth()) ret = p;\n\t\t}\n\t\tunvisitedPM.remove(ret);\n\t\treturn ret;\n\t}", "public void testFindMax() {\r\n assertNull(tree.findMax());\r\n tree.insert(\"apple\");\r\n tree.insert(\"bagel\");\r\n assertEquals(\"bagel\", tree.findMax());\r\n tree.remove(\"bagel\");\r\n assertEquals(\"apple\", tree.findMax());\r\n }", "@Test\n\tpublic void testNeighborhoodNoMax() {\n\t\tresetTestVars();\n\t\tsetUpNeighborhoodVars();\t//makes a few links between the users\n\t\t\n\t\ttry {\n\t\t\tsn.neighborhood(null, null, null);\n\t\t} catch (NullPointerException np) {\n\t\t\tSystem.out.println(\"EXPECTED (5/): Null arguments passed\");\n\t\t}\n\t\t\n\t\tList<Friend> friends = usersToFriendArray();\n\t\tFriend friend4 = new Friend();\n\t\tfriend4.set(user4, 1);\n\t\tfriends.add(friend4);\n\t\t\n\t\tSet<Friend> nbh = sn.neighborhood(\"1\", mid, SocialNetworkStatus.DEFAULT);\n\t\t\n\t\tassertTrue(\"All users reached through direct/indirect links\", nbh.contains(friends.get(0)));\n\t\tassertTrue(\"All users reached through direct/indirect links\", nbh.contains(friends.get(1)));\n\t\tassertTrue(\"All users reached through direct/indirect links\", nbh.contains(friends.get(2)));\n\t\t\n\t\ttry {\n\t\t\tsn.tearDownLink(\"2\", \"4\", late, SocialNetworkStatus.DEFAULT);\n\t\t\tsn.tearDownLink(\"4\", \"3\", late, SocialNetworkStatus.DEFAULT);\n\t\t\tsn.tearDownLink(\"2\", \"3\", late, SocialNetworkStatus.DEFAULT);\n\t\t} catch (UninitializedObjectException uo) {\n\t\t\tSystem.out.println(\"UNEXPECTED: users should be valid\");\n\t\t}\n\t\t\n\t\tnbh = sn.neighborhood(\"1\", late, SocialNetworkStatus.DEFAULT);\n\t\tassertTrue(\"Less friends when other links are torn down\", nbh.contains(friends.get(0)));\n\t\tassertFalse(\"Less friends when other links are torn down\", nbh.contains(friends.get(1)));\n\t\tassertFalse(\"Less friends when other links are torn down\", nbh.contains(friends.get(2)));\n\t}", "@Override\n public Solution solve(ISearchable domain) {\n if(domain==null)\n return null;\n Solution s2=domain.checkIfIsSmall();\n if(s2!=null){\n domain.isClear();\n return s2;\n }\n Solution sol = new Solution();\n temp.add(domain.getStartState());\n numOfNude++;\n domain.isVisit(domain.getStartState());\n ArrayList<AState> neighbors=new ArrayList<AState>();\n while(!temp.isEmpty()){\n AState curr=temp.poll();\n if(domain.isEqual(domain.getGoalState(),curr)){\n numOfNude++;\n sol =solutionPath(curr,sol);\n\n break;\n }\n neighbors=domain.getAllPossibleState(curr);\n for(int i=0;i<neighbors.size();i++){\n if(domain.isEqual(domain.getGoalState(),neighbors.get(i))){\n neighbors.get(i).pervState=curr;\n neighbors.get(i).setPrice(neighbors.get(i).getPrice()+curr.getPrice());\n numOfNude++;\n sol =solutionPath(neighbors.get(i),sol);\n break;\n }\n neighbors.get(i).pervState=curr;\n neighbors.get(i).setPrice(neighbors.get(i).getPrice()+curr.getPrice());\n temp.add(neighbors.get(i));\n numOfNude++;\n }\n }\n\n domain.isClear();\n return sol;\n }", "static double findMaxGlobal(int numberOfSteps){\n\n //calculating step length, defining initial maximum global error, and initial y-value of approximation at previous step\n double stepLength = (X - x0) / numberOfSteps;\n double maxGlobalError = 0.0;\n double y = y0, x = x0;\n\n //jumping through number of steps and calculate error by the formula\n while(x + stepLength <= X){\n y += stepLength * derivativeAtPoint(x, y);\n x += stepLength;\n maxGlobalError = Math.max(Math.abs(exactSolution.calculate(x) - y), maxGlobalError);\n }\n //returning result\n return maxGlobalError;\n }", "public AnyType findMax( ) throws Exception\r\n\t{\r\n\t\tif( isEmpty( ) )\r\n\t\t\tthrow new Exception( );\r\n\t\treturn findMax( root ).element;\r\n\t}", "public Building mostFitInPopulation(){\n\t\tCollections.sort(population);\n\t\treturn population.get(population.size() - 1);\n\t}", "@Override\n\tpublic Solution<TTPVariable> run(SingleObjectiveThiefProblem thief, IEvaluator evaluator, MyRandom rand) {\n\t\tTTPVariable var = TTPVariable.create(new TourOptimalFactory(thief).next(rand), Pack.empty());\n\t\tSolution<TTPVariable> currentBest = thief.evaluate(var);\n\t\t\n\n\t\twhile (evaluator.hasNext()) {\n\n\t\t\t// now take the tour and optimize packing plan\n\t\t\tSolution<Pack> nextPack = optPack(thief, evaluator, rand, currentBest.getVariable().getTour(), currentBest.getVariable().getPack());\n\t\t\t\n\t\t\tSolution<Tour> nextTour = optTour(thief, evaluator, rand, currentBest.getVariable().getTour(), nextPack.getVariable());\n\t\t\t\n\t\t\tTTPVariable next = TTPVariable.create(nextTour.getVariable(), nextPack.getVariable());\n\t\t\tSolution<TTPVariable> s = thief.evaluate(next);\n\t\t\t\n\t\t\t//System.out.println(nextPack);\n\t\t\t//System.out.println(currentBest);\n\t\t\t//System.out.println(\"----------------\");\n\t\t\t\n\t\t\t// update the best found solution\n\t\t\tif (SolutionDominator.isDominating(s, currentBest)) {\n\t\t\t\tcurrentBest = s;\n\t\t\t\t//System.out.println(\"YES\");\n\t\t\t}\n\t\t\tevaluator.notify(currentBest);\n\n\t\t}\n\n\t\treturn currentBest;\n\t}", "@Override\n public VariableNonRequirement computeVariableNonRequirement(IQTree child) {\n return VariableNonRequirement.of(substitution.getDomain());\n }", "private boolean isLatest()\n {\n return varIndexes.get(curDisplay.get()) >= children.stream().mapToInt(c -> c.varIndexes.isEmpty() ? -1 : c.varIndexes.get(c.varIndexes.size() - 1)).max().orElse(-1);\n }", "private RolapCalculation getAbsoluteMaxSolveOrder() {\n // Find member with the highest solve order.\n RolapCalculation maxSolveMember = calculations[0];\n for (int i = 1; i < calculationCount; i++) {\n RolapCalculation member = calculations[i];\n if (expandsBefore(member, maxSolveMember)) {\n maxSolveMember = member;\n }\n }\n return maxSolveMember;\n }", "public static PentagoMove excecuteMiniMax(PentagoBoardState bs, int depth) {\n\t\tlong timerStart = System.currentTimeMillis();\n\t\tPentagoMove bestMove = null;\n\t\tint highestVal = Integer.MIN_VALUE;\n\t\tint lowestVal = Integer.MAX_VALUE;\n\t\tint currentVal = 0;\n\t\tint possibleMoves = bs.getAllLegalMoves().size();\n\t\tfor (PentagoMove move : bs.getAllLegalMoves()) {\n\t\t\tPentagoBoardState stateClone = (PentagoBoardState) bs.clone();\n\t\t\tstateClone.processMove(move);\n\t\t\tif(bs.getTurnPlayer() == 0) {\n\t\t\t\tMax(stateClone, depth-1);\n\t\t\t}\n\t\t\telse if(bs.getTurnPlayer() == 1) {\n\t\t\t\tMin(stateClone, depth-1);\n\t\t\t}\n\t\t\tif (bs.getTurnPlayer() == 0 && currentVal >= highestVal) {\n\t\t\t\thighestVal = currentVal;\n\t\t\t\tbestMove = move;\n\t\t\t}\n\t\t\telse if (bs.getTurnPlayer() == 1 && currentVal <= lowestVal) {\n\t\t\t\tlowestVal = currentVal;\n\t\t\t\tbestMove = move;\n\t\t\t}\n\t\t\tif (System.currentTimeMillis() - timerStart >= 1900) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tlong totalTime = System.currentTimeMillis() - timerStart;\n\t\tSystem.out.println(totalTime);\n\t\treturn bestMove;\n\t}", "public abstract int getMaximumValue();", "public int findMaxValue() {\n\t\treturn findMaxValue( this );\n\t}", "private static <V extends Variable<A>, A extends Value> boolean BACKTRACK(SharedDomainVariableSet<V, A> variableSet) {\n\t\tif (variableSet.isComplete()) {return true;}\n\t\t\n\t\t// get variable to assign\n\t\tV var = variableSet.getUnassignedVariable();\n\t\tSystem.out.println(x + \" --> \" + variableSet.getCountSet() + \": \" + var.getIndex());\n\t\tx += 1;\n\t\t//System.out.println(var);\n\t\t\n\t\t// for each possible value\n\t\tfor (A val : variableSet.getDomain(var)) {\n\n\t\t\t// add the assignment\n\t\t\tvar.assign(val);\n\t\t\t\n\t\t\t// test acceptability and infer the feasibility of the assignment && INFER(variableSet, var)\n\t\t\tif (INFER(variableSet, var)) {\n\t\t\t//if (true) {\t\n\t\t\t\ttry {\n\t\t\t\t\t\n\t\t\t\t\t// domain reduction, throws exception if invalid\n\t\t\t\t\tMap<V, DomainReduction<A>> domainReduction2 = FORWARD_CHECK2(variableSet, var);\n\t\t\t\t\t\n\t\t\t\t\t//Map<V, DomainReduction<A>> domainReduction = FORWARD_CHECK(variableSet, var);\n\t\t\t\t\t\n\t\t\t\t\t// add domain reduction to set\n\t\t\t\t\t//variableSet.addDomainReduction(domainReduction);\n\t\t\t\t\t\n\t\t\t\t\t// backtrack\n\t\t\t\t\t//boolean result = BACKTRACK(variableSet);\n\t\t\t\t\t\n\t\t\t\t\t// stop if solution found\n\t\t\t\t\tif (INFER(variableSet, var) && BACKTRACK(variableSet)) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// clear domain reduction\n\t\t\t\t\t//variableSet.clearDomainReduction(domainReduction);\n\t\t\t\t\tvariableSet.clearDomainReduction(domainReduction2);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t\t// clean assignment\n\t\t\tvar.unassign();\n\t\t\t\n\t\t}\n\t\t\n\t\t// no assignment found\n\t\treturn false;\n\t\t\n\t}", "public void setVarimaxMaximumIterations(int max){\n this.nVarimaxMax = max;\n }", "public double getDomainMax2() throws IllegalStateException {\n\treturn Double.MAX_VALUE;\n }", "@Test\n public void whenFirstIsMax() {\n Max max = new Max();\n int rsl = max.max(3, 2, 1);\n assertThat(rsl, is(3));\n }", "public void setHighestVariable(int v) {\n\t\tHighestVariable = (HighestVariable + v);\n\t}", "public Solution solve(ISearchable domain) {\n if (domain == null)\n return null;\n ArrayList<AState> neighbors;\n Solution solution;\n domain.ResetVisit();\n pathSteps.add(domain.getStartState());\n domain.changeVisitTrue(domain.getStartState());\n numberOfNodes++;\n while (pathSteps.size() > 0) {\n AState temp = pathSteps.poll();\n if (domain.getGoalState().equals(temp)) {\n domain.setGoalState(temp);\n solution = finalSolution(temp);\n return solution;\n }\n neighbors = domain.getAllPossibleStates(temp);\n for (int i=0;i<neighbors.size();i++) {\n if (domain.isVisited(neighbors.get(i))==false) {\n numberOfNodes++;\n domain.changeVisitTrue(neighbors.get(i));\n neighbors.get(i).predecessor = temp;\n pathSteps.add(neighbors.get(i));\n }\n if (neighbors.get(i).equals(domain.getGoalState())) {\n neighbors.get(i).predecessor = temp;\n solution = finalSolution(neighbors.get(i));\n return solution;\n }\n }\n }\n return null;\n }", "private int HeuristicValue(PuzzleState aState, PuzzleState goalState)\n\t{\n\t\tint heuristic = 0;\n\t\tfor(int i = 0; i < aState.Puzzle.length; i++)\n\t\t{\n\t\t\tfor(int j = 0; j < aState.Puzzle[i].length; j++)\n\t\t\t{\n\t\t\t\tif(aState.Puzzle[i][j] != goalState.Puzzle[i][j])\n\t\t\t\t\theuristic++;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn heuristic;\n\t}", "private static int max_value(State curr_state) {\n\t\tcounterMinimax++; \r\n\r\n\r\n\t\t//Check if the current state is a terminal state, if it is, return\r\n\t\t//its terminal value\r\n\t\tif(curr_state.isTerminal()){\r\n\t\t\treturn curr_state.getScore();\r\n\t\t}\r\n\r\n\t\tint max_value = Integer.MIN_VALUE;\r\n\t\tState[] successors = curr_state.getSuccessors('1');\r\n\r\n\t\tif(successors.length == 0 && curr_state.isTerminal() == false){\r\n\t\t\tmax_value = Math.max(max_value, min_value(curr_state));\r\n\t\t}\r\n\t\t//\t\telse if(successors.length != 0 && curr_state.isTerminal() == false){\r\n\r\n\t\t//Get the successors of the current state, as dark always runs first\r\n\t\t//it will call maxValue;\r\n\r\n\r\n\t\t//Select the successor that returns the biggest value\r\n\t\tfor(State state : successors){\r\n\t\t\tmax_value = Math.max(max_value, min_value(state));\r\n\t\t}\t\r\n\t\t//\t\t}\r\n\t\treturn max_value;\r\n\t}", "private RolapCalculation getScopedMaxSolveOrder() {\n // Finite state machine that determines the member with the highest\n // solve order.\n RolapCalculation maxSolveMember = null;\n ScopedMaxSolveOrderFinderState state =\n ScopedMaxSolveOrderFinderState.START;\n for (int i = 0; i < calculationCount; i++) {\n RolapCalculation calculation = calculations[i];\n switch (state) {\n case START:\n maxSolveMember = calculation;\n if (maxSolveMember.containsAggregateFunction()) {\n state = ScopedMaxSolveOrderFinderState.AGG_SCOPE;\n } else if (maxSolveMember.isCalculatedInQuery()) {\n state = ScopedMaxSolveOrderFinderState.QUERY_SCOPE;\n } else {\n state = ScopedMaxSolveOrderFinderState.CUBE_SCOPE;\n }\n break;\n\n case AGG_SCOPE:\n if (calculation.containsAggregateFunction()) {\n if (expandsBefore(calculation, maxSolveMember)) {\n maxSolveMember = calculation;\n }\n } else if (calculation.isCalculatedInQuery()) {\n maxSolveMember = calculation;\n state = ScopedMaxSolveOrderFinderState.QUERY_SCOPE;\n } else {\n maxSolveMember = calculation;\n state = ScopedMaxSolveOrderFinderState.CUBE_SCOPE;\n }\n break;\n\n case CUBE_SCOPE:\n if (calculation.containsAggregateFunction()) {\n continue;\n }\n\n if (calculation.isCalculatedInQuery()) {\n maxSolveMember = calculation;\n state = ScopedMaxSolveOrderFinderState.QUERY_SCOPE;\n } else if (expandsBefore(calculation, maxSolveMember)) {\n maxSolveMember = calculation;\n }\n break;\n\n case QUERY_SCOPE:\n if (calculation.containsAggregateFunction()) {\n continue;\n }\n\n if (calculation.isCalculatedInQuery()) {\n if (expandsBefore(calculation, maxSolveMember)) {\n maxSolveMember = calculation;\n }\n }\n break;\n }\n }\n\n return maxSolveMember;\n }", "public static Location locateLargest(double[][] a){\n Location answer = new Location(a);\n return answer;\n }", "public boolean restoreBestIndividual()\r\n\t{\r\n\t\tint i;\r\n\t\tint num_sub;\r\n\t\tboolean is_assigned;//output variable\r\n\t\t\r\n\t\t//search for the best genotype\r\n\t\tfindBest();\r\n\t\t\r\n\t\tif(_best_idx!=-1)\r\n\t\t{\r\n\t\t\t_time_best = _pool_of_bests.get(_best_idx)._time_step;\r\n\t\t\tnum_sub = _pool_of_bests.get(_best_idx)._individual.length;\r\n\t\t\tfor(i=0; i<num_sub; i++)\r\n\t\t\t{\r\n\t\t\t\t_esn.configDiffEvolutionDecodeIndividual(i, _pool_of_bests.get(_best_idx)._individual[i]);\r\n\t\t\t\t_esn.setModuleNodes(i, layer_type_E.LT_OUTPUT, _pool_of_bests.get(_best_idx)._sub_output[i]);\r\n\t\t\t}\r\n\t\t\t_esn.calculateEsnOutput();\r\n\t\t\tis_assigned = true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tis_assigned = false;\r\n\t\t}\r\n\t\treturn is_assigned;\r\n\t}", "private static Node mrvFindNode() {\n\t\tif (constrainedNodes.size() == 0) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\t// Was able to use this by 'implementing Comparable'\r\n\t\t// in the Node class\r\n\t\t// return max value node of constrained nodes\r\n\t\treturn Collections.max(constrainedNodes);\r\n\r\n\t}", "private static int maxXIndex(int y, int lo, int hi, int[][] nums) {\n int maxIndex = -1;\n for (int x = lo; x < hi; x++) {\n if (maxIndex == -1 || nums[y][x] > nums[y][maxIndex])\n maxIndex = x;\n }\n return maxIndex;\n }", "public int findMaxValueWithoutRecursion() {\n\t\tQueue<XTreeNode<Integer>> collectedNodes = new LinkedList<>();\n\t\tcollectedNodes.add( (XTreeNode<Integer>) this );\n\n\t\tint maxValue = Integer.MIN_VALUE;\n\t\twhile( !collectedNodes.isEmpty() ) {\n\t\t\tXTreeNode<Integer> node = collectedNodes.poll();\n\t\t\tmaxValue = node.getData() > maxValue ? node.getData() : maxValue;\n\n\t\t\tif( node.getLeftChild() != null ) {\n\t\t\t\tcollectedNodes.add( node.getLeftChild() );\n\t\t\t}\n\t\t\tif( node.getRightChild() != null ) {\n\t\t\t\tcollectedNodes.add( node.getRightChild() );\n\t\t\t}\n\t\t}\n\t\treturn maxValue;\n\t}", "public AnyType findMax() {\n\t\treturn elementAt(findMax(root));\n\t}", "@Override\n\tpublic State maxStateAbsMapping(State state, MaxNode maxNode) {\n\t\treturn null;\n\t}", "private int postprocess() {\n // Index with highest probability\n int maxIndex = -1;\n float maxProb = 0.0f;\n for (int i = 0; i < outputArray[0].length; i++) {\n if (outputArray[0][i] > maxProb) {\n maxProb = outputArray[0][i];\n maxIndex = i;\n }\n }\n return maxIndex;\n }", "public static IntStrategy maxDom_Split(IntVar... VARS) {\n return dichotomic(maxDomainSize_var_selector(), true, VARS);\n }", "double largestNumber(double[] a) {\n\t\tdouble max = a[0];\n\t\tdouble no = 0;\n\t\tfor (int index = 1; index < a.length; index++) {\n\t\t\tif (max > a[index] && max > a[index + 1]) {\n\t\t\t\tno = max;\n\t\t\t\tbreak;\n\t\t\t} else if (a[index] > max && a[index] > a[index + 1]) {\n\t\t\t\tno = a[index];\n\t\t\t\tbreak;\n\t\t\t} else if (a[index + 1] > max && a[index + 1] > a[index]) {\n\t\t\t\tno = a[index + 1];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn no;\n\t}", "private boolean tryOverpopulation(int x, int y, Assignment assignment){\n\n\t\tif(getNeighborCount(x, y, assignment) >= 4)\n\t\t\treturn true;\n\n\t\treturn false;\n\t}", "Object getBest();", "private void findBestPath(){\n\t\t// The method will try to find the best path for every starting point and will use the minimum\n\t\tfor(int start = 0; start < this.getDimension(); start++){\n\t\t\tfindBestPath(start);\t\n\t\t}\t\n\t}", "public Coords getJumpPathHighestPoint() {\n Coords highestCoords = null;\n int highestElevation = 0;\n for (MoveStep step : steps) {\n if (getGame().getBoard().getHex(step.getPosition()).getLevel() > highestElevation) {\n highestElevation = step.getElevation();\n highestCoords = step.getPosition();\n }\n }\n return highestCoords;\n }", "public Individual getWorst() {\n\t\treturn individuals[individuals.length-1];\n\t}", "public Decision planWorst(Context context, Decision defaultDecision);", "private void notEligibleForRealMax() {\n eligibleForRealMax = false;\n }", "public String findMax(String[] vals)\r\n\t{\r\n\t\treturn \"nothing yet\";\r\n\t}", "public void SelectCAN(TableVar Variables) {\r\n float perf;\r\n int i, j, k, best, posicion[];\r\n\r\n posicion = new int[long_poblacion];\r\n for (i=0;i<long_poblacion;i++) {\r\n posicion[i] = 0;\r\n }\r\n \r\n // Compute the ranking of each individual of the population: element 0 is the better\r\n for (i=0;i<long_poblacion;i++) {\r\n // Find better individual of the rest\r\n best=-1; \r\n perf=0;\r\n for (j=0;j<long_poblacion;j++) {\r\n if (posicion[j]==0 && (best==-1 || Utils.BETTER(poblac.getIndivFitness(j), perf))) {\r\n // If the individual is better\r\n perf = poblac.getIndivFitness(j);\r\n best = j;\r\n }\r\n }\r\n // Mark the individual with the ranking\r\n posicion[best] = i; \r\n }\r\n \r\n // The intermediary population is the ordered copy\r\n for (i=0;i<long_poblacion;i++) {\r\n k = posicion[i];\r\n for (j=0;j<Variables.getNVars();j++)\r\n Inter.setCromElem(k,j, poblac.getCromElem(i,j));\r\n Inter.setIndivFitness(k, poblac.getIndivFitness(i));\r\n Inter.setIndivEvaluated(k,true);\r\n }\r\n \r\n }", "int getMax_depth();", "@Test\n public void testSingleRunWithUnsatisfiableConstraint() {\n System.out.println(\" - test single run with unsatisfiable constraint\");\n // add constraint\n problem.addMandatoryConstraint(new NeverSatisfiedConstraintStub());\n // single run\n System.out.format(\" - low temperature (T = %.7f)\\n\", LOW_TEMP);\n singleRunWithMaxRuntime(searchLowTemp, SINGLE_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT);\n System.out.format(\" - medium temperature (T = %.7f)\\n\", MED_TEMP);\n singleRunWithMaxRuntime(searchMedTemp, SINGLE_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT);\n System.out.format(\" - high temperature (T = %.7f)\\n\", HIGH_TEMP);\n singleRunWithMaxRuntime(searchHighTemp, SINGLE_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT);\n // verify\n assertNull(searchLowTemp.getBestSolution());\n assertNull(searchMedTemp.getBestSolution());\n assertNull(searchHighTemp.getBestSolution());\n }", "E maxVal();", "private static double minMaxPruning(GameState state, int depth, double alpha, double beta){\n\n double v = 0;\n\n // A vector containing all possible children states if this current state\n Vector<GameState> nextStates = new Vector<GameState>();\n state.findPossibleMoves(nextStates);\n\n /**\n // Try testing win/loss before going into depth search\n Move m = state.getMove();\n\n if(m.isXWin()){\n return 1000+depth;\n }\n\n else if(m.isOWin()){\n return -1;\n }\n */\n if (depth==0 || nextStates.size()==0){\n v = evalState(state);\n }\n\n // 2 is 'O' so if nextPlayer is 2 it means that the current player is 'X'\n else if (state.getNextPlayer() == 1){\n v=Double.NEGATIVE_INFINITY;\n\n for(GameState s: nextStates){\n v = Math.max(v, minMaxPruning(s,depth-1, alpha, beta));\n alpha = Math.max(alpha, v);\n if(beta <= alpha) {\n return v;\n }\n }\n }\n // 1 is 'X' so if nextplayer is 1 it means that the current player is 'O'\n else if (state.getNextPlayer() == 2){\n v=Double.POSITIVE_INFINITY;\n\n for(GameState s: nextStates){\n v= Math.min(v,minMaxPruning(s,depth-1, alpha, beta));\n beta = Math.min(beta, v);\n if( beta <= alpha ) {\n return v;\n }\n }\n }\n return v;\n }", "protected void doDeduction() {\n\n boolean narrowed= false;\n\n unit=false;\n isInconclusive=false;\n\n int newXL;\n int newYU;\n\n Variable x = null;\n Variable y = null;\n\n for(Variable var : csp.getVars()){\n if(var.getPosition() == unitSB.getX().getPosition()){\n x = var;\n } else if(var.getPosition() == unitSB.getY().getPosition()){\n y = var;\n }\n }\n\n int xU = x.getUpperDomainBound();\n int yL = y.getLowerDomainBound();\n\n newXL = yL + unitSB.getCright();\n newYU = xU - unitSB.getCright();\n\n if(newXL>x.getLowerDomainBound()){\n Variable newX = new Variable(newXL, xU);\n newX.setPosition(x.getPosition());\n changeVariable(newX);\n narrowed= true;\n }\n if (newYU< y.getUpperDomainBound()){\n Variable newY = new Variable(yL, newYU);\n newY.setPosition(y.getPosition());\n changeVariable(newY);\n narrowed =true;\n }\n\n if(narrowed){\n doAlgorithmA1();\n }else {\n doAlgorithmA3();\n }\n\n }", "private int getBestGuess(double values[]){\n int maxIndex=0;\n double max=0;\n for(int i=0;i<4;i++){\n if(values[i]>max) {\n max = values[i];\n maxIndex=i;\n }\n }\n return maxIndex+1;\n }", "public void SteadyStepReproductionDNF (TableVar Variables) {\r\n\r\n int i, j, k, pos;\r\n int[] indices = new int[long_poblacion];\r\n float[] fit = new float[long_poblacion];\r\n\r\n for (i=0; i<long_poblacion; i++) {\r\n fit[i]= poblac.getIndivFitness(i);\r\n indices[i] = i;\r\n }\r\n\r\n // Sort the fitness array of actual population and store the values at \"indices\"\r\n Utils.OrDecIndex (fit,0,long_poblacion-1,indices); // To maximise\r\n\r\n for (i=0; i<descendientes; i++) {\t// For each descendant\r\n pos = indices[long_poblacion-1-i];\r\n for (j=0; j<Variables.getNVars(); j++) {\r\n for (k=0; k<=Variables.getNLabelVar(j); k++)\r\n poblac.setCromElemGene(pos, j, k, Des.getCromElemGene(i,j,k));\r\n }\r\n poblac.setIndivEvaluated(pos,false);\r\n }\r\n\r\n }", "private int restrictProblem(Message msg, String parameter) {\n int[] problems = setProblemRestriction(msg, parameter);\n\n if (problems[0] == ERROR_CODE[0]) {\n return -1;\n }\n\n problemRestriction = true;\n lowerProblem = problems[0];\n upperProblem = problems[1];\n return 0;\n }", "private Integer getRandomUnvisitedNeighbourIndex(int currentIndex) {\n\t\t\n\t\tArrayList<Integer> neighbors = setUnvisitedNeighbors(currentIndex);\n\t\t\n\t\tRandom random = new Random();\n\t\t\t\t\n\t\treturn neighbors.size() == 0 ? NOT_EXIST : neighbors.get(random.nextInt(neighbors.size())); \n\t}", "@Override\r\n\tpublic double max_value(GameState s, int depthLimit) \r\n\t{\r\n\t\tdouble stateEvaluationValue = stateEvaluator(s);\r\n\r\n\t\tif (depthLimit == 0)\r\n\t\t{\r\n\t\t\treturn stateEvaluationValue;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tdouble currMax = Double.NEGATIVE_INFINITY;\r\n\t\t\tint bestMove = 0;\r\n\t\t\tArrayList <Integer> succList = generateSuccessors(s.lastMove, s.takenList);\r\n\t\t\tif (succList.isEmpty())\r\n\t\t\t{\r\n\t\t\t\ts.bestMove = -1;\r\n\t\t\t\ts.leaf = true;\r\n\t\t\t\treturn -1;\r\n\t\t\t}\r\n\t\t\tIterator <Integer> myItr = succList.iterator();\r\n\t\t\twhile (myItr.hasNext())\r\n\t\t\t{\r\n\t\t\t\tdouble tempMax = currMax;\r\n\t\t\t\tint currNumber = myItr.next();\r\n\t\t\t\tint [] newList = s.takenList;\r\n\t\t\t\tnewList [currNumber] = 1; //assign it to player 1\r\n\t\t\t\tGameState newGameState = new GameState(newList, currNumber);\r\n\t\t\t\tcurrMax = Math.max(currMax, min_value(newGameState, depthLimit - 1));\r\n\r\n\t\t\t\tif (tempMax < currMax)\r\n\t\t\t\t{\r\n\t\t\t\t\tbestMove = currNumber;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ts.bestMove = bestMove;\t\t\t\r\n\t\t\treturn currMax;\r\n\t\t}\r\n\r\n\r\n\t}", "public String getSubgoal()\n\t{\n\t if ( this.isNary() )\n\t {\n \t\tcheckPrecondition(this.paramState != null, \"n-ary goal has no parameter state\");\n \t\treturn this.paramState;\n\t }\n\t else\n\t {\n\t checkPrecondition(finiteCostMatch != null, \"pattern has no subgoal\");\n\t return this.finiteCostMatch;\n\t }\n\t}", "@Test\n\tpublic void testNeighborhoodWithMax() {\n\t\tresetTestVars();\n\t\tsetUpNeighborhoodVars();\t//makes a few links between the users\n\t\t\n\t\ttry {\n\t\t\tsn.neighborhood(null, null, null);\n\t\t} catch (NullPointerException np) {\n\t\t\tSystem.out.println(\"EXPECTED (5/): Null arguments passed\");\n\t\t}\n\t\t\n\t\tList<Friend> friends = usersToFriendArray();\n\t\tUser user5 = new User();\n\t\tuser5.setID(\"5\");\n\t\tsn.addUser(user5);\n\t\t\n\t\ttry {\n\t\t\tsn.establishLink(\"5\", \"4\", mid, status);\n\t\t}\n\t\tcatch (UninitializedObjectException uo) {\n\t\t\tSystem.out.println(\"Shouldn't happen\");\n\t\t}\n\t\t\n\t\tFriend friend5 = new Friend();\n\t\tfriend5.set(user5, 2);\n\t\t\n\t\tSet<Friend> nbh = sn.neighborhood(\"1\", late, 1, SocialNetworkStatus.DEFAULT);\n\t\tassertTrue(\"All users reached through direct/indirect links\", nbh.contains(friends.get(0)));\n\t\tassertTrue(\"All users reached through direct/indirect links\", nbh.contains(friends.get(1)));\n\t\tassertTrue(\"All users reached through direct/indirect links\", nbh.contains(friends.get(2)));\n\t\tassertFalse(\"User was beyond max distance\", nbh.contains(friend5));\n\t\t\t\t\t\t\t//max distance is 1, user5 was at a distance of 2 (3 links)\n\t\ttry {\n\t\t\tsn.tearDownLink(\"2\", \"4\", late, SocialNetworkStatus.DEFAULT);\n\t\t\tsn.tearDownLink(\"4\", \"3\", late, SocialNetworkStatus.DEFAULT);\n\t\t\tsn.tearDownLink(\"2\", \"3\", late, SocialNetworkStatus.DEFAULT);\n\t\t} catch (UninitializedObjectException uo) {\n\t\t\tSystem.out.println(\"UNEXPECTED: users should be valid\");\n\t\t}\n\t\t\n\t\tnbh = sn.neighborhood(\"1\", late, 1, SocialNetworkStatus.DEFAULT);\n\t\tassertTrue(\"Less friends when other links are torn down\", nbh.contains(friends.get(0)));\n\t\tassertFalse(\"Less friends when other links are torn down\", nbh.contains(friends.get(1)));\n\t\tassertFalse(\"Less friends when other links are torn down\", nbh.contains(friends.get(2)));\n\t\tassertFalse(\"User is beyond max distance\", nbh.contains(friend5));\n\t}", "public int findMax(){\n return nilaiMaks(this.root);\n }", "private void checkValue(Variable toBeVariable) throws MethodCallWithNonexistentParameter {\n if (!toBeVariable.hasValue()) {\n throw new MethodCallWithNonexistentParameter();\n }\n }", "private static int maximum() {\n\t\tint popSize = 0;\n\t\tChromosome thisChromo = null;\n\t\tChromosome thatChromo = null;\n\t\tint winner = 0;\n\t\tboolean foundNewWinner = false;\n\t\tboolean done = false;\n\n\t\twhile (!done) {\n\t\t\tfoundNewWinner = false;\n\t\t\tpopSize = population.size();\n\t\t\tfor (int i = 0; i < popSize; i++) {\n\t\t\t\tif (i != winner) { // Avoid self-comparison.\n\t\t\t\t\tthisChromo = population.get(i);\n\t\t\t\t\tthatChromo = population.get(winner);\n\t\t\t\t\tif (thisChromo.conflicts() > thatChromo.conflicts()) {\n\t\t\t\t\t\twinner = i;\n\t\t\t\t\t\tfoundNewWinner = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (foundNewWinner == false) {\n\t\t\t\tdone = true;\n\t\t\t}\n\t\t}\n\t\treturn winner;\n\t}", "public void testNonPermanentVariableResolvedOkNoBinding() throws Exception\n {\n resolveAndAssertSolutions(\"[[g(x), h(x), (f :- g(X), h(Y))], (?- f), [[]]]\");\n }", "public Chromosome worstChromosome()\r\n {\r\n\treturn worstChromo.clone();\r\n }", "private int selectNextCity(Ant ant) {\n int t = random.nextInt(numberOfCities - currentIndex);\n if (random.nextDouble() < randomFactor) {\n OptionalInt cityIndex = IntStream.range(0, numberOfCities)\n .filter(i -> i == t && !ant.visited(i))\n .findFirst();\n if (cityIndex.isPresent()) {\n return cityIndex.getAsInt();\n }\n }\n calculateProbabilities(ant);\n double r = random.nextDouble();\n double total = 0;\n for (int i = 0; i < numberOfCities; i++) {\n total += probabilities[i];\n if (total >= r) {\n return i;\n }\n }\n\n throw new RuntimeException(\"There are no other cities\");\n }", "public Decision worstFor(Context context);", "protected <E> String selectUnassignedVariable(CSP<E> csp, Assignment<E> assignment) {\r\n\t\tList<String> unassigned= new ArrayList<String>(); \r\n\t\tfor(String i:csp.variables){\r\n\t\t\tif(!assignment.containsKey(i)){\r\n\t\t\t\tunassigned.add(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tRandom random = new Random();\r\n\t\tint rand=random.nextInt(unassigned.size());\r\n\t\treturn unassigned.get(rand);\r\n\t}", "private static int min_value_with_pruning(State curr_state, int alpha, int beta) {\n\t\tcounterPruning++;\r\n\r\n\t\t//If s is a terminal state, return its game value\r\n\t\tif(curr_state.isTerminal()){\r\n\t\t\treturn curr_state.getScore();\r\n\t\t}\r\n\r\n\t\tState[] successors = curr_state.getSuccessors('2');\r\n\r\n\t\tif(successors.length == 0 && curr_state.isTerminal() == false){\r\n\t\t\tbeta = Math.min(beta, max_value_with_pruning(curr_state, alpha, beta));\r\n\t\t}\r\n\r\n\t\tfor(State state : successors){\r\n\t\t\tbeta = Math.min(beta, max_value_with_pruning(state, alpha, beta));\r\n\t\t\tif(alpha >= beta)\r\n\t\t\t\treturn alpha;\r\n\t\t}\r\n\r\n\t\treturn beta;\r\n\t}", "private void checkDomainSizes()\n\t{\n\t\tfor (int var = 0; var < domainSizes.size(); var++)\n\t\t{\n\t\t\tif (domainSizes.get(var) < 1)\n\t\t\t{\n\t\t\t\tSystem.err.println(\"Variable \" + var + \" has a domain size of \"\n\t\t\t\t\t\t+ domainSizes.get(var) + \".\");\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t}\n\t}", "@Test\n public void testSubsequentRunsWithUnsatisfiableConstraint() {\n System.out.println(\" - test subsequent runs with unsatisfiable constraint\");\n // set constraint\n problem.addMandatoryConstraint(new NeverSatisfiedConstraintStub());\n // create and add listeners\n AcceptedMovesListener l1 = new AcceptedMovesListener();\n AcceptedMovesListener l2 = new AcceptedMovesListener();\n AcceptedMovesListener l3 = new AcceptedMovesListener();\n searchLowTemp.addSearchListener(l1);\n searchMedTemp.addSearchListener(l2);\n searchHighTemp.addSearchListener(l3);\n // perform multiple runs (maximizing objective)\n System.out.format(\" - low temperature (T = %.7f)\\n\", LOW_TEMP);\n multiRunWithMaximumRuntime(searchLowTemp, MULTI_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT, NUM_RUNS, true, true);\n System.out.format(\" >>> accepted/rejected moves: %d/%d\\n\", l1.getTotalAcceptedMoves(), l1.getTotalRejectedMoves());\n System.out.format(\" - medium temperature (T = %.7f)\\n\", MED_TEMP);\n multiRunWithMaximumRuntime(searchMedTemp, MULTI_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT, NUM_RUNS, true, true);\n System.out.format(\" >>> accepted/rejected moves: %d/%d\\n\", l2.getTotalAcceptedMoves(), l2.getTotalRejectedMoves());\n System.out.format(\" - high temperature (T = %.7f)\\n\", HIGH_TEMP);\n multiRunWithMaximumRuntime(searchHighTemp, MULTI_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT, NUM_RUNS, true, true);\n System.out.format(\" >>> accepted/rejected moves: %d/%d\\n\", l3.getTotalAcceptedMoves(), l3.getTotalRejectedMoves());\n // verify\n assertNull(searchLowTemp.getBestSolution());\n assertNull(searchMedTemp.getBestSolution());\n assertNull(searchHighTemp.getBestSolution());\n }", "public Cell highestCell() {\n for (Cell c : this.board) {\n if (c.height == ForbiddenIslandWorld.ISLAND_SIZE / 2 && !c.isCoastCell()) {\n return c;\n }\n }\n return highestCell();\n }", "public Move chooseMove(TablutBoardState boardState) {\n \n \tList<TablutMove> options = boardState.getAllLegalMoves();\n\n \n bestMove = options.get(((int) MyTools.getSomething())% (options.size()));\n\n int depth = DEPTH;\n int opponent = boardState.getOpponent();\n boolean isMax;\n if(opponent==1){\n \tisMax = true;\n \t//System.out.println(\"I'm max\");\n }\n else{\n \tisMax = false;\n \t//System.out.println(\"I'm min\");\n }\n //bestMove = \n \n int bestvalue = minimax(boardState,isMax, depth,-10000,10000);\n \n \n //int minNumberOfOpponentPieces = boardState.getNumberPlayerPieces(opponent);\n //boolean moveCaptures = false;\n //System.out.println(\"minimax return value: \"+bestvalue);\n \n \n \n \n return bestMove;\n }", "private int getHighestLevelFromProperties(){\n GameModel gameModel = GameModel.getInstance();\n int highestReachedLevel;\n int level = gameModel.getCurrentLevelIndex();\n String highest = properties.getProperty(\"highestReachedLevel\");\n if (highest!=null){ //if property not saved\n highestReachedLevel = Integer.parseInt(highest);\n } else {\n highestReachedLevel = level;\n }\n return highestReachedLevel;\n }" ]
[ "0.62522143", "0.56476456", "0.5603983", "0.5517984", "0.53899246", "0.5273627", "0.52450544", "0.5169853", "0.51596713", "0.5128026", "0.5124575", "0.50679564", "0.50634456", "0.5050384", "0.50209534", "0.4999194", "0.49909446", "0.4963009", "0.49442112", "0.49412882", "0.49412817", "0.49407867", "0.49343896", "0.49299768", "0.49079928", "0.49061614", "0.48932207", "0.487283", "0.48487464", "0.48402986", "0.48327714", "0.4829489", "0.48215398", "0.4813016", "0.4801469", "0.4800452", "0.4799088", "0.47954527", "0.4782091", "0.47811744", "0.47776192", "0.47731495", "0.47729254", "0.47630283", "0.47620288", "0.47551125", "0.47509232", "0.47478464", "0.47403908", "0.47319368", "0.47295126", "0.4728203", "0.4723707", "0.47211954", "0.47109443", "0.47019157", "0.46990407", "0.46980512", "0.46960467", "0.46921036", "0.46894774", "0.4687218", "0.46840617", "0.4682599", "0.46824902", "0.46790454", "0.4669002", "0.46688607", "0.46657225", "0.4662723", "0.46519503", "0.464433", "0.46410328", "0.4638058", "0.46351767", "0.46292794", "0.46184328", "0.46129686", "0.46122542", "0.46078175", "0.4604426", "0.46012548", "0.45956203", "0.45848823", "0.4576405", "0.45709875", "0.45685238", "0.4564816", "0.45593163", "0.45560095", "0.4554607", "0.45501283", "0.45481795", "0.4547822", "0.4542858", "0.45381135", "0.45374262", "0.45349872", "0.4526372", "0.45253494" ]
0.677643
0
Selects the noninstantiated variable with the largest difference between the two smallest values in its domain, to branch on it.
public static VariableSelector<IntVar> maxRegret_var_selector() { return new MaxRegret(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static double getMax(double a, double b) {\n\t\treturn (a > b) ? a : b;\n\t}", "static int findGreatestValue(int x, int y) {\r\n\t\t\r\n\t\tif(x>y)\r\n\t\t\treturn x;\r\n\t\telse\r\n\t\t return y;\r\n\t}", "E maxVal();", "public int chooseVTD(){\n int min=0;\n //this loop is used to avoid a bug\n for(int i=0;i<heuristicArrayTD.length;i++){\n if(heuristicArrayTD[i]< heuristicArrayTD[min]){\n min=i;\n }\n }\n int max=min;\n //returns highest scoring and unused var\n for(int i=0;i<heuristicArrayTD.length;i++){\n if(heuristicArrayTD[i]>= heuristicArrayTD[max] && usageArray[i%variableLength]==0){\n max=i;\n }\n }\n return max%variableLength;\n }", "double getMax();", "double getMax();", "@Test\n\tpublic void testMaxSmallerBigger(){\n\t int min=3, mid=5, max=10, bigger=Integer.MAX_VALUE, smaller=Integer.MIN_VALUE;\n\t assertEquals( bigger, MaxDiTre.max(max, smaller, bigger) );\n\t}", "@Override\n\tpublic AbstractValue greatestLowerBound(AbstractValue d) {\n\t\tif ( !(d instanceof Interval) )\n\t\t\tthrow new IllegalArgumentException(\"v should be of type Interval\");\n\t\tInterval i = (Interval) d;\n\n\t\tif (i.isBottom())\n\t\t\treturn i;\n\t\telse if (i.equals(top))\n\t\t\treturn this;\n\n\t\tString newLow = \"-Inf\", newHigh = \"+Inf\";\n\n\t\t//Calcolare limite inferiore\n\n\t\tif ( this.getLow().equals(\"-Inf\")){\n\t\t\tif( !i.getLow().equals(\"-Inf\"))\n\t\t\t\tif(Integer.parseInt(this.getHigh()) > Integer.parseInt(i.getLow()))\n\t\t\t\t\tnewLow = String.valueOf(Integer.max(Integer.parseInt(this.getLow()), Integer.parseInt(i.getLow())));\n\t\t\t\telse\n\t\t\t\t\treturn BottomAV.getInstance();\n\t\t}else if ( i.getLow().equals(\"-Inf\")){\n\t\t\tif( !this.getLow().equals(\"-Inf\"))\n\t\t\t\tif(Integer.parseInt(i.getHigh()) > Integer.parseInt(this.getLow()))\n\t\t\t\t\tnewLow = String.valueOf(Integer.max(Integer.parseInt(i.getLow()), Integer.parseInt(this.getLow())));\n\t\t\t\telse\n\t\t\t\t\treturn BottomAV.getInstance();\n\t\t}else if(!this.getLow().equals(\"-Inf\") && !i.getLow().equals(\"-Inf\")){\n\t\t\tnewLow = String.valueOf(Integer.max(Integer.parseInt(this.getLow()), Integer.parseInt(i.getLow())));\n\t\t}\n\n\t\t// Calcolare limite superiore\n\n\t\tif ( this.getHigh().equals(\"+Inf\")) {\n\t\t\tif (!i.getHigh().equals(\"+Inf\"))\n\t\t\t\tnewHigh = i.getHigh();\n\t\t}else if ( i.getHigh().equals(\"+Inf\")) {\n\t\t\tif (!this.getHigh().equals(\"+Inf\"))\n\t\t\t\tnewHigh = this.getHigh();\n\t\t}else if(!this.getHigh().equals(\"+Inf\") && !i.getHigh().equals(\"+Inf\")){\n\t\t\tnewHigh = String.valueOf(Integer.min(Integer.parseInt(this.getHigh()), Integer.parseInt(i.getHigh())));\n\t\t}\n\n\t\tInterval res = new Interval(newLow, newHigh);\n\n\t\t// Checks whether low > high\n\t\tif ((!newLow.equals(\"-Inf\") && (!newHigh.equals(\"+Inf\")) && Integer.parseInt(newLow) > Integer.parseInt(newHigh)))\n\t\t\treturn BottomAV.getInstance();\n\n\t\treturn amItop() ? top : res;\n\t}", "@Test\n\tpublic void testBiggerMaxSmaller(){\n\t int min=3, mid=5, max=10, bigger=Integer.MAX_VALUE, smaller=Integer.MIN_VALUE;\n\t assertEquals( bigger, MaxDiTre.max(bigger, max, smaller) );\n\t}", "@Test\n\tpublic void testSmallerBiggerMax(){\n\t int min=3, mid=5, max=10, bigger=Integer.MAX_VALUE, smaller=Integer.MIN_VALUE;\n\t assertEquals( bigger, MaxDiTre.max(smaller, bigger, max) );\n\t}", "@Test\n\tpublic void testNegMaxNegMaxNegMin(){\n\t int min=3, mid=5, max=10;\n\t assertEquals( -min, MaxDiTre.max(-max, -max, -min) );\n\t}", "Double getMaximumValue();", "private static void findLocalMaxOrMin() {\n // Find the integer with no duplicates\n // Priority Queues / Double ended priority queues are efficient O(1) with remove the min / max\n\n Integer[] a = new Integer[]{0,1,2,3,4,5,6,7,8,7,6};\n// int[] a2 = new int[]{5,4,3,2,1,2,3,4};\n\n MinPQ<Integer> minPQ = new MinPQ<Integer>(a);\n\n System.out.print(minPQ.min());\n }", "E minVal();", "public static double max(double a, double b) {\t\n\t\treturn ((a>b)?a:b);\n\t}", "@Test\n\tpublic void testNegMaxNegMinNegMax(){\n\t int min=3, mid=5, max=10;\n\t assertEquals( -min, MaxDiTre.max(-max, -min, -max) );\n\t}", "private double min(double a, double b) {\n if (a > b) {\n return b;\n }\n return a;\n }", "int getMax();", "@Test\n\tpublic void testNegMinNegMaxNegMax(){\n\t int min=3, mid=5, max=10;\n\t assertEquals( -min, MaxDiTre.max(-min, -max, -min) );\n\t}", "public int GetMaxVal();", "int getMaximum();", "public abstract int getMaximumValue();", "public double getMaximum()\n {\n return Math.max(first, second);\n }", "protected int getMaxValue(int a1, int b1)\n\t{\n\t\tint c1=Math.max(a1, b1);\n\t\t\n\t\t//int c1=getMaxValue(a1, b1);\t\n\t\treturn c1;\n\t}", "int max(int a, int b);", "public static State max(State a, State b){\n return a.score >= b.score ? a : b;\n }", "@Test\n public void whenSecondIsMax() {\n Max max = new Max();\n int rsl = max.max(0, 3, -1);\n assertThat(rsl, is(3));\n }", "public static void minMaxDifference() {\n //int arr[] = {4,3,5,6,7,1,2};\n int arr[] = {6, 1, 7, -1, 3, 5, 9};\n int min_number = Integer.MAX_VALUE;\n int max_diff = Integer.MIN_VALUE;\n int current_difference;\n for (int i = 0; i < arr.length; i++) {\n if (arr[i] < min_number)\n min_number = arr[i];\n current_difference = arr[i] - min_number;\n if (current_difference > max_diff)\n max_diff = current_difference;\n }\n System.out.println(\"Max diff : \" + max_diff);\n }", "private RolapCalculation getAbsoluteMaxSolveOrder() {\n // Find member with the highest solve order.\n RolapCalculation maxSolveMember = calculations[0];\n for (int i = 1; i < calculationCount; i++) {\n RolapCalculation member = calculations[i];\n if (expandsBefore(member, maxSolveMember)) {\n maxSolveMember = member;\n }\n }\n return maxSolveMember;\n }", "public int GetMinVal();", "private Double getMax(Double[] values) {\n Double ret = null;\n for (Double d: values) {\n if (d != null) ret = (ret == null) ? d : Math.max(d, ret);\n }\n return ret;\n }", "Double maxOfDisplacements(ArrayList<Double> dispA){\r\n\t\tObject minvalobj = Collections.min(dispA);\r\n\t\tObject maxvalobj = Collections.max(dispA);\r\n\t\tIJ.log(\"Max displacement\" + maxvalobj);\r\n\t\tIJ.log(\"Min displacement\" + minvalobj);\r\n\t\tdouble minval = (Double) minvalobj;\r\n\t\tdouble maxval = (Double) maxvalobj;\t\t\r\n\t\tdouble maxdisp = maxval;\r\n\t\tif (Math.abs(maxval) < Math.abs(minval)) \r\n\t\t\tmaxdisp = minval;\r\n\t\telse\r\n\t\t\tmaxdisp = maxval;\t\t\r\n\t\treturn maxdisp;\r\n\t}", "Double getMinimumValue();", "@Test\n public void whenFirstGreaterThanSecond() {\n Max maximum = new Max();\n int result = maximum.max(2, 1);\n assertThat(result, is(2));\n }", "public abstract int getMinimumValue();", "@Test\n\tpublic void testMaxMaxMax(){\n\t int min=3, mid=5, max=10;\n\t assertEquals( max, MaxDiTre.max(max, max, max) );\n\t}", "public int getMinimumValue() {\n/* 276 */ return -this.s.getMaximumValue();\n/* */ }", "static int minVal(int a, int b, int c, int d){ //minVal function evaluates the lowest value takes 4 ints and returns an int\n \n //logic: (logic table)\n //\n int[] val = new int[]{a, b, c, d}; //loads it into a array to make it easier to cycle through\n if(a == minVal(val[0], val[1])){//if a is smaller than b\n if (a == minVal(val[0], val[2])){// if a is smaller than c\n if(a == minVal(val[0], val[3])) //if a is smaller than d, return a\n return a;\n return val[3]; // if d is not smaller than a but a is smaller than the rest return d\n }//end if\n else if(c == minVal(val[2], val[3])) //if a is smaller than b but not smaller than c, check if c is smaller than d\n return val[2];//return c\n return val[3];// if a is smaller than b but not smaller than c, and c is not smaller than d, return d \n }//end if \n else{ //if(b == minVal(val[0], val[1])){ //if b is smaller than a\n if (b == minVal(val[1], val[2])){ //if b is smaller than c\n if(b == minVal(val[1], val[3])) //if b is smaller than d, return b\n return b;\n return val[3];// if d is not smaller than a but a is smaller than the rest return d\n }//end if\n else if(c == minVal(val[2], val[3]))//if a is smaller than b but not smaller than c, check if c is smaller than d\n return val[2];//return c\n return val[3];// if a is smaller than b but not smaller than c, and c is not smaller than d, return d \n }//end else\n \n }", "public double getMaxValue(double defaultMax, Date start, Date end)\n\t{\n\t\tdouble max = Double.NEGATIVE_INFINITY;\n\t\tfor(TimedVariable tv : vars)\n\t\t{\n\t\t\tDate t = tv.getTime();\n\t\t\tif (start != null && start.compareTo(t) > 0)\n\t\t\t\tcontinue;\n\t\t\tif (end != null && end.compareTo(t) < 0)\n\t\t\t\tcontinue;\n\t\t\tint fl = tv.getFlags();\n\t\t\tif ((fl & IFlags.IS_MISSING) == 0)\n\t\t\t{\n\t\t\t\ttry \n\t\t\t\t{\n\t\t\t\t\tdouble d = tv.getDoubleValue();\n\t\t\t\t\tif (d > max)\n\t\t\t\t\t\tmax = d;\n\t\t\t\t}\n\t\t\t\tcatch(NoConversionException ex) {}\n\t\t\t}\n\t\t}\n\t\treturn max == Double.NEGATIVE_INFINITY ? defaultMax : max;\n\t}", "static int max(int x, int y){\n\t\treturn (x > y)? x : y;\n\t}", "ComparableExpression<T> max();", "public int determineHighestVal() {\n if (playerCards[0].value > playerCards[1].value) {\n return playerCards[0].value;\n }\n return playerCards[1].value;\n\n }", "public Point getMax () {\r\n\r\n\treturn getB();\r\n }", "int max(int a, int b) \n { \n return (a > b) ? a : b; \n }", "public double maxDifference()\n {\n double maxD = 0.0;\n double testD = 0.0;\n \n for (int i=0; i < data.length -1; i++) // stopping 1 early because reading ahead\n {\n testD = Math.abs(data[i]-data[i+1]);\n if (testD > maxD)\n {\n maxD = testD;\n }\n }\n \n return maxD;\n }", "private double lInfinityDistance(Instance one, Instance two) {\n\n double attributeDistance;\n double maxDistance = 0;\n\n for (int i = 0; i < one.numAttributes() - 1; i++) {\n\n attributeDistance = Math.abs(one.value(i) - two.value(i));\n\n if (attributeDistance > maxDistance) {\n maxDistance = attributeDistance;\n }\n }\n\n return maxDistance;\n\n }", "public T findHighest(){\n T highest = array[0];\n for (int i=0;i<array.length; i++)\n {\n if (array[i].doubleValue()>highest.doubleValue())\n {\n highest = array[i];\n } \n }\n return highest;\n }", "private int max(int a, int b) {\n\t\treturn a>b?a:b;\n\t}", "public double getDomainMin2() throws IllegalStateException {\n\treturn -Double.MAX_VALUE;\n }", "@Test\n public void whenFirstEqualsSecond() {\n Max maximum = new Max();\n int result = maximum.max(2, 2);\n assertThat(result, is(2));\n }", "private int maxValue(Node state, int alpha, int beta) {\n\t\t\n\t\t\n\t\tthis.nodesExplored++;\n\t\tthis.nodesExploredThisTurn++;\n\t\t\n\t\tif (this.cutoffTest(state)) {\n\t\t\treturn state.eval(this.player);\n\t\t}\n\t\t\n\t\tArrayList<Move> legalMoves = state.getGame().getLegalMoves();\n\t\n\t\tif (this.moveOrdering) {\n\t\t\tthis.quickSort(state, legalMoves, 0, legalMoves.size() - 1, false);\n\t\t}\n\t\t\n\t\tint v = Integer.MIN_VALUE;\n\t\tMove bestMove = null;\n\t\tfor (Move move : legalMoves) {\n\t\t\t\n\t\t\tif (System.currentTimeMillis() - startMili > this.maxTime * 1000) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t\n\t\t\tint value = this.minValue(state.result(move), alpha, beta);\n\t\t\tif (v < value) { //\n\t\t\t\tv = value;\n\t\t\t\tbestMove = move;\n\t\t\t}\n\t\t\t\n\t\t\tif (v >= beta) {\n\t\t\t\tstate.setBestMove(bestMove);\n\t\t\t\t\n\t\t\t\treturn v;\n\t\t\t}\n\t\t\talpha = Math.max(v, alpha);\n\t\t}\n\t\tstate.setBestMove(bestMove);\n\t\treturn v;\n\t}", "java.math.BigDecimal getMaximum();", "@Test\n\tpublic void testMinMinMin(){\n\t int min=3, mid=5, max=10;\n\t assertEquals( min, MaxDiTre.max(min, min, min) );\n\t}", "public static int MAX_VALUE(State state){\n if(TERMINAL_TEST(state)){\n //System.out.println(\"Found a terminal state on min\\n:\"+state);\n return UTILITY(state);\n }\n if(SUCCESSOR(state).size()==0){\n return UTILITY(state);\n }\n int v = negativeInf;\n for(State s:SUCCESSOR(state)){\n v = Math.max(v, MIN_VALUE(s));\n }\n return v;\n }", "public static<T extends Comparable<T>> T max(T first, T second){\n return (first.compareTo(second) < 0) ? second : first;\n }", "private static int max(int lhs, int rhs) {\r\n return lhs > rhs ? lhs : rhs;\r\n }", "private Integer maximum(Integer dataA, Integer dataB) {\n return dataA > dataB ? dataA : dataB;\n }", "public static void main(String[] args) {\n\n int a = 34;\n int b = 45;\n int c = 78;\n\n if (a >= b && a >= c)\n System.out.println(a + \" is a largest number\");\n else if (b >= a && b >= c)\n System.out.println(b + \" is a largest number\");\n else\n System.out.println(c + \" is a largest number\");\n}", "@Test\n\tpublic void testMaxMinMax(){\n\t int min=3, mid=5, max=10;\n\t assertEquals( max, MaxDiTre.max(max, min, max) );\n\t}", "private int max(int a, int b) {\n return (a > b) ? a : b;\n }", "static int max(int a, int b) {\n\t\treturn a > b ? a : b;\n\t}", "private int max(int lhs, int rhs){\n if(lhs > rhs){\n return lhs;\n } else {\n return rhs;\n }\n }", "@Test\n public void whenFirstLessThanSecond() {\n Max maximum = new Max();\n int result = maximum.max(1, 2);\n assertThat(result, is(2));\n }", "@Test\n\tpublic void testMidMaxMin(){\n\t int min=3, mid=5, max=10;\n\t assertEquals( max, MaxDiTre.max(mid, max, min) );\n\t}", "public Comparable<?> b(DiscreteDomain<Comparable<?>> discreteDomain) {\n return discreteDomain.maxValue();\n }", "public void initMaxMin(){\n\t\tmax = dja.max();\n\t\tmin = dja.min();\n\t}", "Expression getMax();", "double getLeft(double min);", "@Test\n public void whenFirstIsMax() {\n Max max = new Max();\n int rsl = max.max(3, 2, 1);\n assertThat(rsl, is(3));\n }", "public int solution(int[] a) {\n int max = 0;\n int min = Integer.MIN_VALUE;\n for (int i=0;i<a.length;i++) {\n if (i == 0) {\n min = a[i];\n } else if (a[i] > min) {\n max = Math.max(a[i] - min, max);\n } else if (a[i] < min) {\n min = a[i];\n }\n }\n return max;\n }", "@Test\n\tpublic void testMinMaxMax(){\n\t int min=3, mid=5, max=10;\n\t assertEquals( max, MaxDiTre.max(min, max, max) );\n\t}", "double largestNumber(double[] a) {\n\t\tdouble max = a[0];\n\t\tdouble no = 0;\n\t\tfor (int index = 1; index < a.length; index++) {\n\t\t\tif (max > a[index] && max > a[index + 1]) {\n\t\t\t\tno = max;\n\t\t\t\tbreak;\n\t\t\t} else if (a[index] > max && a[index] > a[index + 1]) {\n\t\t\t\tno = a[index];\n\t\t\t\tbreak;\n\t\t\t} else if (a[index + 1] > max && a[index + 1] > a[index]) {\n\t\t\t\tno = a[index + 1];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn no;\n\t}", "int max(int x, int y) {\n return x > y ? x : y;\n }", "int getMin( int min );", "@Test\n public void whenFirstLessSecond() {\n Max maximum = new Max();\n int result = maximum.max(1, 2);\n assertThat(result, is(2));\n }", "public DataValue getGreatestDataByDeviceIdAndSensorType(SensorValue sensorVal) throws Exception;", "int getMax( int max );", "static int min(int a, int b) { return a < b ? a : b; }", "public static int pointFree(double[] numbers){\n String completeString = \"\";\n String redactedString = \"\";\n int newArray[] = new int[numbers.length];\n int greatestValue=0;\n \n \n \n for (double x : numbers) {\n int currentValue;\n \n completeString = String.valueOf(x);\n redactedString = completeString.replaceAll(\"\\\\.\",\"\");\n currentValue = Integer.parseInt(redactedString);\n for (int i = 0; i < newArray.length; i++) {\n \n newArray[i]=currentValue;\n \n \n }\n greatestValue=newArray[0];\n for (int i = 0; i < newArray.length; i++) {\n if(newArray[i]>greatestValue){\n greatestValue=newArray[i];\n \n }\n \n }\n \n \n }\n return greatestValue;\n \n }", "int max(int a, int b)\n\t{\n\t\treturn(a>b)?a:b;\n\t}", "public double getDomainMin1() throws IllegalStateException {\n\treturn -Double.MAX_VALUE;\n }", "public static VariableSelector<IntVar> minDomainSize_var_selector() {\n return new FirstFail();\n }", "private int minValue(Node state, int alpha, int beta) {\n\t\t\n\t\tthis.nodesExplored++;\n\t\tthis.nodesExploredThisTurn++;\n\t\t\n\t\tif (this.cutoffTest(state)) {\n\t\t\treturn state.eval(this.player);\n\t\t}\n\t\t\n\t\t\n\t\tArrayList<Move> legalMoves = state.getGame().getLegalMoves();\n\t\t\n\t\tif (this.moveOrdering) {\n\t\t\tthis.quickSort(state, legalMoves, 0, legalMoves.size() - 1, true);\n\t\t}\n\t\t\n\t\tint v = Integer.MAX_VALUE;\n\t\tMove bestMove = null;\n\t\tfor (Move move : legalMoves) {\n\n\t\t\tif (System.currentTimeMillis() - startMili > this.maxTime * 1000)\n\t\t\t\treturn 0;\n\t\t\t\n\t\t\tint value = this.maxValue(state.result(move), alpha, beta);\n\t\t\tif (v > value) { //\n\t\t\t\tv = value;\n\t\t\t\tbestMove = move;\n\t\t\t}\n\n\t\t\tif (v <= alpha) {\n\t\t\t\tstate.setBestMove(bestMove);\n\t\t\t\treturn v;\n\t\t\t}\n\t\t\tbeta = Math.min(v, beta);\n\t\t}\n\t\tstate.setBestMove(bestMove);\n\t\treturn v;\n\t}", "@Test\n\tpublic void testMinMinMax(){\n\t int min=3, mid=5, max=10;\n\t assertEquals( max, MaxDiTre.max(min, min, max) );\n\t}", "protected final void setMax() {\n\n\tint prevmax = this.max;\n\n\tint i1 = this.high;\n\tint i2 = left.max;\n\tint i3 = right.max;\n\n\tif ((i1 >= i2) && (i1 >= i3)) {\n\t this.max = i1;\n\t} else if ((i2 >= i1) && (i2 >= i3)) {\n\t this.max = i2;\n\t} else {\n\t this.max = i3;\n\t}\n\t\n\tif ((p != IntervalNode.nullIntervalNode) &&\n\t (prevmax != this.max)) {\n \t p.setMax();\n\t}\n }", "int max(int a, int b) {\n return (a > b) ? a : b;\n }", "double getMin();", "double getMin();", "private static int min(int d1,int d2){\n\t\treturn d1<d2?d1:d2;\n\t}", "private static int maxDifference(int[] arr) {\n\t\tint maxDiff = arr[1] - arr[0];\n\t\tint minElement = arr[0];\n\t\t\n\t\tfor(int i = 1 ; i < arr.length; i++)\n\t\t{\n\t\t\tif(arr[i] - minElement > maxDiff)\n\t\t\t{\n\t\t\t\tmaxDiff = arr[i] - minElement;\n\t\t\t}\n\t\t\tif(arr[i] < minElement)\n\t\t\t{\n\t\t\t\tminElement = arr[i];\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn maxDiff;\n\t}", "public int getLowerBound ();", "public double getMaxDoubleValue();", "public boolean larger(CRational1 r) {\n\t\tint cn = (this.n * r.d) - (this.d * r.n);\r\n\t\tif (cn < 0)\r\n\t\t\treturn false;\r\n\t\telse\r\n\t\t\treturn true;\r\n\t}", "static int max(int a, int b) {\n return (a > b) ? a : b;\n }", "Object getMaximumValue(Object elementID) throws Exception;", "int max(int a,int b)\n {\n \t\n \tif(a>b)\n \t\treturn a;\n \telse\n \t\treturn b;\n \t\n }", "int max();", "Object getWorst();", "public static int secondaryArgmax(double[] a) {\n\t\tint mi = argmax(a);\n\t\t// scan left until increasing\n\t\tint i;\n\t\tfor (i=mi-1; i>=0 && a[i]<=a[i+1]; i--);\n\t\tint l = argmax(a,0,i+1);\n\t\tfor (i=mi+1; i<a.length && a[i]<=a[i-1]; i++);\n\t\tint r = argmax(a,i,a.length);\n\t\tif (l==-1) return r;\n\t\tif (r==-1) return l;\n\t\treturn a[l]>=a[r]?l:r;\n\t}", "public static double findMax(double[] da) {\n\n\t\tdouble max = da[0];\n\n\t\tfor (double d : da) {\n\t\t\tif (d > max) {\n\t\t\t\tmax = d;\n\t\t\t}\n\t\t}\n\n\t\treturn max;\n\t}", "private static int max_value(State curr_state) {\n\t\tcounterMinimax++; \r\n\r\n\r\n\t\t//Check if the current state is a terminal state, if it is, return\r\n\t\t//its terminal value\r\n\t\tif(curr_state.isTerminal()){\r\n\t\t\treturn curr_state.getScore();\r\n\t\t}\r\n\r\n\t\tint max_value = Integer.MIN_VALUE;\r\n\t\tState[] successors = curr_state.getSuccessors('1');\r\n\r\n\t\tif(successors.length == 0 && curr_state.isTerminal() == false){\r\n\t\t\tmax_value = Math.max(max_value, min_value(curr_state));\r\n\t\t}\r\n\t\t//\t\telse if(successors.length != 0 && curr_state.isTerminal() == false){\r\n\r\n\t\t//Get the successors of the current state, as dark always runs first\r\n\t\t//it will call maxValue;\r\n\r\n\r\n\t\t//Select the successor that returns the biggest value\r\n\t\tfor(State state : successors){\r\n\t\t\tmax_value = Math.max(max_value, min_value(state));\r\n\t\t}\t\r\n\t\t//\t\t}\r\n\t\treturn max_value;\r\n\t}" ]
[ "0.6123842", "0.58621913", "0.5848", "0.5831816", "0.5791033", "0.5791033", "0.5736742", "0.5730677", "0.565944", "0.56228095", "0.55951464", "0.5590598", "0.5583589", "0.55713695", "0.5537532", "0.5535816", "0.5516024", "0.5514065", "0.54829735", "0.5482869", "0.5475708", "0.54638076", "0.5457609", "0.5440046", "0.541681", "0.54132944", "0.54012966", "0.53949875", "0.53922343", "0.538207", "0.53785074", "0.53780293", "0.53540957", "0.5348308", "0.5347722", "0.5338053", "0.5336398", "0.53286606", "0.53230226", "0.5319213", "0.53116137", "0.53065157", "0.53059447", "0.5290465", "0.529046", "0.5285218", "0.5284639", "0.5276543", "0.52698547", "0.5260656", "0.5256728", "0.52546287", "0.52526116", "0.52458054", "0.5244891", "0.5233613", "0.5232413", "0.5228762", "0.5211868", "0.5209239", "0.5208933", "0.5204975", "0.5202028", "0.519984", "0.5195246", "0.51948655", "0.5192946", "0.51864177", "0.5179962", "0.5178267", "0.5172466", "0.51666933", "0.5165806", "0.51641893", "0.5161894", "0.51586825", "0.5157667", "0.5145265", "0.5142562", "0.5132406", "0.5130978", "0.51291436", "0.51277506", "0.5125397", "0.5117606", "0.5115623", "0.51147765", "0.51147765", "0.5110296", "0.5107067", "0.5102787", "0.51013833", "0.510047", "0.5100189", "0.5099827", "0.5098441", "0.5098434", "0.5093044", "0.5091057", "0.5079221", "0.5074664" ]
0.0
-1
VALUE SELECTORS Selects the variable lower bound
public static IntValueSelector min_value_selector() { return new IntDomainMin(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int selectValue(IntVar v) {\r\n int c = (v.max() + v.min())/2;\r\n return c;\r\n }", "public void setParamValueRange(String label, Object minValue, Object maxValue);", "public void setParamValueRange(String label, double minValue, double maxValue);", "Range controlLimits();", "public V getLowerBound();", "public IntegerValue[] getIntegerBoundsForVariable() {\n return select.getIntegerBounds();\n }", "IntVar selectVariable(IntVar[] v) {\r\n\r\n if (v.length != 0) {\r\n int index = 0;\r\n int smallestDomain = Integer.MAX_VALUE;\r\n for(int i = 0; i< v.length-1; i++){\r\n if(v[i].domain.getSize()<smallestDomain){\r\n index = i;\r\n smallestDomain = v[i].domain.getSize();\r\n }\r\n\r\n }\r\n if(v[index].min() == v[index].max()){\r\n\r\n searchVariables = new IntVar[v.length-1];\r\n for (int i = 0; i < v.length-1; i++) {\r\n if(i<index){\r\n searchVariables[i] = v[i];\r\n }\r\n else searchVariables[i] = v[i+1];\r\n\r\n }\r\n }\r\n else{\r\n searchVariables = new IntVar[v.length];\r\n for(int i = 0; i < v.length; i++){\r\n searchVariables[i] = v[i];\r\n }\r\n }\r\n return v[index];\r\n\r\n }\r\n else {\r\n System.err.println(\"Zero length list of variables for labeling\");\r\n return new IntVar(store);\r\n }\r\n }", "@Override\n\t\t\t\tprotected void operationSelectRange(PlaneXY planeXY) {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n\tprotected void setLowerBound() {\n\t\t\n\t}", "public void setLowerBound (int lowerBound) throws ModelException;", "public abstract double[] getLowerBound();", "private double computeRangeSelectivity(TableMetadata tableMetadata, RexNode orPred, List<SchemaPath> fieldNames) {\n SchemaPath col = getColumn(orPred, fieldNames);\n if (col != null) {\n ColumnStatistics<?> columnStatistics = tableMetadata != null ? tableMetadata.getColumnStatistics(col) : null;\n Histogram histogram = columnStatistics != null ? ColumnStatisticsKind.HISTOGRAM.getFrom(columnStatistics) : null;\n if (histogram != null) {\n Double totalCount = ColumnStatisticsKind.ROWCOUNT.getFrom(columnStatistics);\n Double ndv = ColumnStatisticsKind.NDV.getFrom(columnStatistics);\n Double sel = histogram.estimatedSelectivity(orPred, totalCount.longValue(), ndv.longValue());\n if (sel != null) {\n return sel;\n }\n }\n }\n return guessSelectivity(orPred);\n }", "public int getLowerBound ();", "public void setLow(double value){low = value;}", "E minVal();", "public void setComparedHeuristics (VariableSelector variableSelector, IntValueSelector valueOrder){\n\t\tIntValueSelector valueSelector = valueOrder;\n\t\t\n\t \n\t\tkb.getModelKB().getSolver().setSearch(Search.intVarSearch(\n \n\t\t\t\tvariableSelector,\n // selects the smallest domain value (lower bound)\n\t\t\t\t \n\t\t\t\tvalueSelector,\n \n // variables to branch on\n\t\t\t\tkb.getVars()\n\t\t));\n\t\t\n\t}", "ValueRangeConstraint createValueRangeConstraint();", "public void SetMinVal(int min_val);", "public abstract void selectIndexRange(int min, int max);", "List<Exp> varBind() {\n List<Exp> lBind = new ArrayList<Exp>();\n for (int i = 0; i < size(); i++) {\n Exp f = get(i);\n if ((f.type == VALUES) || (f.isFilter() && f.size() > 0)) {\n Exp bind = f.first();\n if (bind.type() == OPT_BIND) {\n if (bind.isBindCst()) {\n // ?x = cst\n lBind.add(bind);\n } else {\n // filter has BIND\n // TODO: when there is a UNION, variables of BIND may not be all bound \n // so we cannot bind here\n //add(i, bind);\n //i++;\n }\n }\n }\n }\n return lBind;\n }", "Condition between(QueryParameter parameter, Object x, Object y);", "public static IntStrategy lexico_LB(IntVar... VARS) {\n return custom(lexico_var_selector(), min_value_selector(), VARS);\n }", "public static IntStrategy minDom_LB(IntVar... VARS) {\n return custom(minDomainSize_var_selector(), min_value_selector(), VARS);\n }", "protected void mapValueToWithinBounds() {\n if (getAllele() != null) {\n \tFloat d_value = ( (Float) getAllele());\n if (d_value.isInfinite()) {\n // Here we have to break to avoid a stack overflow.\n // ------------------------------------------------\n return;\n }\n // If the value exceeds either the upper or lower bounds, then\n // map the value to within the legal range. To do this, we basically\n // calculate the distance between the value and the float min,\n // then multiply it with a random number and then care that the lower\n // boundary is added.\n // ------------------------------------------------------------------\n if (d_value.floatValue() > m_upperBound ||\n d_value.floatValue() < m_lowerBound) {\n RandomGenerator rn;\n if (getConfiguration() != null) {\n rn = getConfiguration().getRandomGenerator();\n }\n else {\n rn = new StockRandomGenerator();\n }\n setAllele(new Float((rn.nextFloat()\n * ((m_upperBound - m_lowerBound))) + m_lowerBound));\n }\n }\n }", "public static IntStrategy maxReg_LB(IntVar... VARS) {\n return custom(maxRegret_var_selector(), min_value_selector(), VARS);\n }", "public int getLowerBound() {\r\n return lowerBound;\r\n }", "public int GetMinVal();", "void defSelect(Variable var){\r\n \t//if (isSelectAll()){\r\n \t\taddSelect(var);\r\n \t//}\r\n }", "private List<ComparisonExpression> comparisons(HashMap<TimeSelector, Long> lowerBounds,\n HashMap<TimeSelector, Long> upperBounds) {\n List<ComparisonExpression> newComparisons = new ArrayList<>();\n // for all selectors, as lowerBounds has the same keys as upperBounds\n for (Map.Entry<TimeSelector, Long> entry : lowerBounds.entrySet()) {\n TimeSelector selector = entry.getKey();\n Long lower = entry.getValue();\n Long upper = upperBounds.get(selector);\n if (lower.equals(upper)) {\n newComparisons.add(new ComparisonExpression(\n new Comparison(selector, EQ, new TimeLiteral(lower)),\n new ComparableTPGMFactory()));\n } else {\n if (lower > TemporalElement.DEFAULT_TIME_FROM) {\n // check if informative: lower bound of from is trivial lower bound of to\n if (selector.getTimeProp().equals(TX_TO)) {\n TimeSelector txFromSel = new TimeSelector(selector.getVariable(), TX_FROM);\n if (lowerBounds.getOrDefault(txFromSel, TemporalElement.DEFAULT_TIME_FROM).equals(lower)) {\n continue;\n }\n } else if (selector.getTimeProp().equals(VAL_TO)) {\n TimeSelector valFromSel = new TimeSelector(selector.getVariable(), VAL_FROM);\n if (lowerBounds.getOrDefault(valFromSel, TemporalElement.DEFAULT_TIME_FROM).equals(lower)) {\n continue;\n }\n }\n // informative => build comparison\n newComparisons.add(new ComparisonExpression(\n new Comparison(new TimeLiteral(lower), LTE, selector),\n new ComparableTPGMFactory()));\n }\n if (upper < TemporalElement.DEFAULT_TIME_TO) {\n // analagously as for lower bounds\n // upper bound of to is trivial upper of from\n if (selector.getTimeProp().equals(TimeSelector.TimeField.TX_FROM)) {\n TimeSelector txToSel = new TimeSelector(selector.getVariable(), TX_TO);\n if (upperBounds.getOrDefault(txToSel, TemporalElement.DEFAULT_TIME_TO).equals(upper)) {\n continue;\n }\n } else if (selector.getTimeProp().equals(TimeSelector.TimeField.VAL_FROM)) {\n TimeSelector valToSel = new TimeSelector(selector.getVariable(), VAL_TO);\n if (upperBounds.getOrDefault(valToSel, TemporalElement.DEFAULT_TIME_TO).equals(upper)) {\n continue;\n }\n }\n // informative => build comparison\n newComparisons.add(new ComparisonExpression(\n new Comparison(selector, LTE, new TimeLiteral(upper)),\n new ComparableTPGMFactory()));\n }\n }\n }\n return newComparisons;\n }", "Lista<V> valuesInRange(K init, K end);", "private void updateControlValues(RangeSlider rs, String parameter)\n\t{\n\t\tMap<String, Double> parameterValues_low\t\t= new HashMap<String, Double>();\n\t\tMap<String, Double> parameterValues_high\t= new HashMap<String, Double>();\n\t\t\n\t\tfor (String param : rangeSliders.keySet()) {\n\t\t\tparameterValues_low.put(param, rs.getLowValue() >= rangeSliders.get(param).getMin() ? rs.getLowValue() : rangeSliders.get(param).getMin());\n\t\t\tparameterValues_high.put(param, rs.getHighValue() <= rangeSliders.get(param).getMax() ? rs.getHighValue() : rangeSliders.get(param).getMax());\n\t\t}\n\t\t\t\n \tswitch (parameter) \n \t{\n \t\tcase \"alpha\":\n \t\t\talpha_min_textfield.setText(String.valueOf(parameterValues_low.get(\"alpha\")));\n \talpha_max_textfield.setText(String.valueOf(parameterValues_high.get(\"alpha\")));\n \t\tbreak;\n \t\t\n \t\tcase \"eta\":\n \t \teta_min_textfield.setText(String.valueOf(parameterValues_low.get(\"eta\")));\n \teta_max_textfield.setText(String.valueOf(parameterValues_high.get(\"eta\")));\n \tbreak;\n \t\t\n \t\tcase \"kappa\":\n \t\t\tkappa_min_textfield.setText(String.valueOf(parameterValues_low.get(\"kappa\")));\n \tkappa_max_textfield.setText(String.valueOf(parameterValues_high.get(\"kappa\")));\n \tbreak;\t\n \t}\n\t}", "private void initValueModels()\n {\n myCriterionValue.setName(\"Value\");\n myCriterionMaxValue.setNameAndDescription(\"Maximum value\", \"The maximum value\");\n\n addModel(myCriterionValue);\n addModel(myCriterionMaxValue);\n\n Conditional cond = myOperator.get();\n myCriterionValue.setVisible(cond != Conditional.EMPTY && cond != Conditional.NOT_EMPTY);\n myCriterionMaxValue.setVisible(cond == Conditional.BETWEEN);\n }", "private Query getIntRange(final String fieldName, String[] range) {\n int lower = Integer.parseInt(range[0]);\n int upper = Integer.parseInt(range[1]);\n return IntPoint.newRangeQuery(fieldName, lower, upper);\n }", "public Range getRangeX(double lowerPercent, double upperPercent, \n PlotRenderingInfo info, Point2D source) {\n \t\t\n \t double start = super.getDomainAxis().getRange().getLowerBound();\n double length = super.getDomainAxis().getRange().getLength();\n Range adjusted = null;\n if (super.getDomainAxis().isInverted()) {\n adjusted = new Range(start + (length * (1 - upperPercent)), \n start + (length * (1 - lowerPercent))); \n }\n else {\n adjusted = new Range(start + length * lowerPercent, \n start + length * upperPercent);\n }\n return adjusted;\n }", "public void setLowerBound(String lower) {\n lowerBound = lower;\n }", "public void getGUIVALS() {\n MinX = (double) MinXSpin.getValue();\n MaxX = (double) MaxXSpin.getValue();\n MinY = (double) MinYSpin.getValue();\n MaxY = (double) MaxYSpin.getValue();\n Step = (double) StepSpin.getValue();\n ForceRange = ForceRangeBox.isSelected();\n LineColor = LineCC.getColor();\n BackColor = BackGCC.getColor();\n Increments = (int) IncSpin.getValue();\n DrawArea = DrawAreaBox.isSelected();\n DrawScale = DrawScaleBox.isSelected();\n CurveThickness = (float) (double) CurveThicknessSpin.getValue();\n }", "List<VarRatio> selectAll();", "int getRange();", "public SelectorForNumber[] divide(double divider) {\n SelectorForNumber[] result = new SelectorForNumber[2];\n switch(type) {\n case ALL_VALUES: {\n result[0] = getSelLE(attributeId, divider - delta);\n result[1] = getSelGT(attributeId, divider);\n break;\n }\n case BELONGS_RIGHT_INCLUDING: {\n if (divider == lowerLimit) {\n result[0] = null;\n result[1] = this;\n }\n else {\n if (divider > lowerLimit) {\n if (divider == upperLimit) {\n result[0] = getSelBelongs(attributeId, lowerLimit, divider - delta);\n result[1] = null;\n }\n else if (divider > upperLimit) {\n result[0] = this;\n result[1] = null;\n }\n else {\n // lowerLimit < divider < upperLimit\n result[0] = getSelBelongs(attributeId, lowerLimit, divider - delta);\n result[1] = getSelBelongs(attributeId, divider, upperLimit);\n }\n }\n else {\n // divider < lowerLimit\n result[0] = null;\n result[1] = this;\n }\n }\n break;\n }\n case EQUAL: {\n if (divider == lowerLimit)\n result[0] = this;\n break;\n }\n case GREATER_THAN: {\n if (divider == lowerLimit) {\n result[0] = null;\n result[1] = this;\n }\n else if (divider > lowerLimit) {\n result[0] = getSelBelongs(attributeId, lowerLimit, divider - delta);\n result[1] = getSelGT(attributeId, divider);\n }\n // else -> divider < lowerLimit, so there's no selector to return;\n break;\n }\n case LOWER_OR_EQUAL: {\n if (divider == upperLimit) {\n result[0] = getSelLE(attributeId, divider - delta);\n result[1] = null;\n }\n else if (divider < upperLimit) {\n result[0] = getSelLE(attributeId, divider - delta);\n result[1] = getSelBelongs(attributeId, divider, upperLimit);\n } \n // else -> divider > lowerLimit, so there's no selector to return;\n break;\n }\n case NONE_VALUE: { // Nothing to return.\n break;\n }\n }\n return result;\n }", "private int findValue(String v, String[] names, int[] values, int dflt) {\n if (v == null) {\n return dflt;\n }\n v = v.toLowerCase();\n for (int fidx = 0; fidx < names.length; fidx++) {\n if (v.equals(names[fidx])) {\n return values[fidx];\n }\n }\n\n return dflt;\n\n }", "default DiscreteSet2D superLevelSet(double value) {\r\n\t\treturn pointsSatisfying(d -> d >= value);\r\n\t}", "private void findMinandMaxValues(SparklineValues values) {\n minY = values.getValues().stream().filter(value -> value.getValue() != null).mapToDouble(SparklineValues.SparklineValue::getValue).min().orElse(0.0);\n maxY = values.getValues().stream().filter(value -> value.getValue() != null).mapToDouble(SparklineValues.SparklineValue::getValue).max().orElse(0.0);\n\n if (Math.abs(minY) > 1E30 || Math.abs(maxY) > 1E30) {\n // something is probably wrong\n System.out.println(\"Unexpectedly small/large min or max: \");\n values.getValues().forEach(value -> {\n System.out.print(value.getValue() + \" \");\n });\n System.out.println();\n minY = -1.0;\n maxY = 1.0;\n }\n\n if (minY.equals(maxY)) {\n if (minY.equals(0.0)) {\n minY = -1.0;\n maxY = 1.0;\n } else {\n minY = minY - 0.1 * Math.abs(minY);\n maxY = maxY + 0.1 * Math.abs(maxY);\n }\n }\n }", "private List<HashMap<TimeSelector, Long>> updateLt(\n HashMap<ComparableExpression, HashSet<ComparableExpression>> rLt,\n HashMap<TimeSelector, Long> lowerBounds, HashMap<TimeSelector, Long> upperBounds)\n throws QueryContradictoryException {\n\n ArrayList<ArrayList<ComparableExpression>> lt = relationToTuples(rLt);\n for (ArrayList<ComparableExpression> tuple : lt) {\n TimeSelector selector = null;\n Long literalValue = null;\n // only comparisons between a selector and a literal are interesting here\n // selector < literal => upper(selector) = min(upper(selector), literal-1)\n if (tuple.get(0) instanceof TimeSelector && tuple.get(1) instanceof TimeLiteral) {\n selector = (TimeSelector) tuple.get(0);\n literalValue = ((TimeLiteral) tuple.get(1)).getMilliseconds() - 1;\n upperBounds.put(selector, Math.min(upperBounds.get(selector), literalValue));\n } else if (tuple.get(1) instanceof TimeSelector &&\n tuple.get(0) instanceof TimeLiteral) {\n // selector > literal => lower(selector) = max(lower(selector), literal+1)\n selector = (TimeSelector) tuple.get(1);\n literalValue = ((TimeLiteral) tuple.get(0)).getMilliseconds() + 1;\n lowerBounds.put(selector, Math.max(lowerBounds.get(selector), literalValue));\n } else {\n continue;\n }\n\n if (lowerBounds.get(selector) > upperBounds.get(selector)) {\n throw new QueryContradictoryException();\n }\n }\n\n return Arrays.asList(lowerBounds, upperBounds);\n }", "public void setLowerBound(final int lowerBound) {\r\n this.lowerBound = lowerBound;\r\n }", "public interface ValueSelector<T> {\n\n\t/**\n\t * Get the currently selected values. May be empty if no selection is made.\n\t *\n\t * @return the currently selected values\n\t */\n\tT[] getValues();\n\n\t/**\n\t * Get the primary selected value. The return value will be among those returned by {@link #getValues()}.\n\t *\n\t * @return the primary selected value\n\t */\n\tT getValue();\n}", "public static void bi_vl() {\n\t}", "void printExtremeParamValuesWhereAndWhen(String paramName, Station minStation, Sensor minSensor, MeasurementValue minValue, Station maxStation, Sensor maxSensor, MeasurementValue maxValue);", "@JSProperty(\"minRange\")\n void setMinRange(double value);", "public abstract void setRange(double value, int start, int count);", "public void setLower(int value) {\n this.lower = value;\n }", "public static VariableSelector<IntVar> minDomainSize_var_selector() {\n return new FirstFail();\n }", "public double[] getRange();", "public void setSelection( final int value ) {\n checkWidget();\n if( value < minimum ) {\n selection = minimum;\n } else if ( value > maximum - thumb ) {\n selection = maximum - thumb;\n } else {\n selection = value;\n }\n }", "protected abstract D getLower(R range);", "public abstract int getMinimumValue();", "public void testFindRangeBounds() {\n XYBlockRenderer renderer = new XYBlockRenderer();\n XYSeriesCollection dataset = new XYSeriesCollection();\n XYSeries series = new XYSeries(\"S1\");\n series.add(1.0, null);\n dataset.addSeries(series);\n Range r = renderer.findRangeBounds(dataset);\n }", "@Override\n\tprotected double getLowerBound() {\n\t\treturn 0;\n\t}", "NumericRangeFilter(double p_min, double p_max) {\n maximum = p_max;\n minimum = p_min;\n }", "public BetweenCriteria(String attributeName, Object lowerBound, Object upperBound) {\n super(attributeName, lowerBound);\n this.upperBound = upperBound;\n }", "@Override\n\tpublic int getValueSelected()\n\t{\n\t\treturn 0;\n\t}", "private Filter betweenFilter(String start, Object minValue, Object maxValue) {\n return FF.between(FF.property(start), FF.literal(minValue), FF.literal(maxValue));\n }", "private List<HashMap<TimeSelector, Long>> updateLeq(\n HashMap<ComparableExpression, HashSet<ComparableExpression>> rLeq,\n HashMap<TimeSelector, Long> lowerBounds, HashMap<TimeSelector, Long> upperBounds)\n throws QueryContradictoryException {\n\n ArrayList<ArrayList<ComparableExpression>> leq = relationToTuples(rLeq);\n for (ArrayList<ComparableExpression> tuple : leq) {\n TimeSelector selector = null;\n Long literalValue = null;\n // only comparisons between a selector and a literal are interesting here\n // selector <= literal => upper(selector) = min(upper(selector), literal)\n if (tuple.get(0) instanceof TimeSelector && tuple.get(1) instanceof TimeLiteral) {\n selector = (TimeSelector) tuple.get(0);\n literalValue = ((TimeLiteral) tuple.get(1)).getMilliseconds();\n upperBounds.put(selector, Math.min(upperBounds.get(selector), literalValue));\n } else if (tuple.get(1) instanceof TimeSelector &&\n tuple.get(0) instanceof TimeLiteral) {\n // selector >= literal => lower(selector) = max(lower(selector), literal)\n selector = (TimeSelector) tuple.get(1);\n literalValue = ((TimeLiteral) tuple.get(0)).getMilliseconds();\n lowerBounds.put(selector, Math.max(lowerBounds.get(selector), literalValue));\n } else {\n continue;\n }\n\n if (lowerBounds.get(selector) > upperBounds.get(selector)) {\n throw new QueryContradictoryException();\n }\n }\n\n return Arrays.asList(lowerBounds, upperBounds);\n }", "public double[] getRange(){\n\treturn RANGE;\n }", "int range(){\n return fuelcap*mpg;\n }", "public void setMinimum( final int value ) {\n checkWidget();\n if( 0 <= value && value < maximum ) {\n minimum = value;\n if( selection < minimum ) {\n selection = minimum;\n }\n }\n if( thumb >= maximum - minimum ) {\n thumb = maximum - minimum;\n selection = minimum;\n }\n }", "Limits limits();", "protected String getJPARangeClause(long lowerBound, long upperBound, Map<String, Object> params) {\n params.put(\"lowerBound\", lowerBound);\n params.put(\"upperBound\", upperBound);\n return \"log.id > :lowerBound and log.id <= :upperBound\";\n }", "void assignRange() {\n rangeIndex = (int) Math.floor(value / step);\n }", "default DiscreteSet2D subLevelSet(double value) {\r\n\t\treturn pointsSatisfying(d -> d <= value);\r\n\t}", "public void changeConstraintsToLessThan() throws IloException {\n /*\n IloRange notes:\n for expr == rhs, set lb = ub = rhs\n for expr <= rhs, set lb = -infinity and ub = rhs\n for expr >= rhs, set lb = rhs and ub = infinity\n */\n for (int i = 0; i < matrix.getNrows(); i++) {\n IloRange rangedExpression = matrix.getRange(i);\n if (rangedExpression.getUB() >= Double.POSITIVE_INFINITY) {\n rangedExpression.setBounds(Double.NEGATIVE_INFINITY, -rangedExpression.getUB());\n for (int j = 0; j < matrix.getNrows(); j++) {\n matrix.setNZ(i, j, -matrix.getNZ(i, j));\n }\n }\n }\n }", "public static void main(String[] args) {\n\t\t\n\t\tint k = 3;\n\t\t\n\t\tint max = Integer.MIN_VALUE, min = Integer.MAX_VALUE;\n\t\t\n\t\tint arr[] = new int[k];\n\t\t\n\t\tfor(int i = 0; i < k; i++) {\n\t\t\tif(max < arr[i])\n\t\t\t\tmax = arr[i];\n\t\t\tif(min > arr[i])\n\t\t\t\tmin = arr[i];\n\t\t}\n\t\t\n\t\t\n\t\tint [][] arr1 = {{3,8},{10,11},{1,3},{2,4}};\n\t\t\n\t\tSystem.out.println(selection(arr1));\n\t}", "private void setMinThreshold() {\n minThreshold = value + value * postBoundChange / 100;\n }", "public void setLow(double value) {\n this.low = value;\n }", "R visitBoundVariable(Formula f, int deBruijnIdx);", "void collect(){\r\n\t\tif (getValues() != null){\r\n\t\t\tfor (Variable var : getValues().getVariables()){\r\n\t\t\t\tdefSelect(var);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public abstract DoublePredicate lowerPredicate(double lowerBound);", "@JSProperty(\"minRange\")\n double getMinRange();", "private int getValue(int lowerBound, int upperBound) {\n int problemRange = upperBound - lowerBound + 1;\n\n return lowerBound + rng.nextInt(problemRange);\n }", "private Query getDoubleRange(final String fieldName, String[] range) {\n double lower = Double.parseDouble(range[0]);\n double upper = Double.parseDouble(range[1]);\n return DoublePoint.newRangeQuery(fieldName, lower, upper);\n }", "void setSelection(int from, int to);", "public List<Integer> selectRangeWherePar(byte[][] selectCols, byte[] whereCol, long value1, long value2, ResultSet result){\n List<Integer> oidList = new ArrayList<Integer>();\n \n //assuming the where col is in type LONG\n boolean[] access = new boolean[keyForLong.length];\n int whereIndex = -1;\n \n for(int i = 0; i < keyForLong.length; i++){\n if(keyForLong[i].equals( new String(whereCol) + separator + \"LONG\" )) whereIndex = i;\n \n access[i] = false;\n for(int j = 0; j < selectCols.length; j++){\n if(keyForLong[i].equals( new String(selectCols[j]) + separator + \"LONG\" )){\n access[i] = true;\n break;\n }\n }\n }\n \n int numOfFields = keyForLong.length;\n for(int i = 0; i < numObject; i++){\n //first check if this object meet the where condition\n long value = longValues[i*numOfFields + whereIndex];\n if( (value >= value1) && (value <= value2)){\n //this object meets condition\n int oid=objectIds[i];\n oidList.add(oid);\n \n //select fields in the select clause\n for(int j = 0; j < access.length; j++){\n if(access[j]){\n String key = keyForLong[j];\n if(j == whereIndex){\n result.addLong(key, oid, value);\n continue;\n }\n long longnum = longValues[i*numOfFields + j];\n if(longnum != UNDEFINED)\n result.addLong(key, oid, longnum);\n }\n }\n }\n }\n \n if(oidList.size() > 0){\n //if this partition also has other data types, also select those based on oidList\n if(keyForString.length != 0)\n selectConditionString(oidList, selectCols, result);\n if(keyForDouble.length != 0)\n selectConditionDouble(oidList, selectCols, result);\n if(keyForBool.length != 0)\n selectConditionBool(oidList, selectCols, result);\n }\n return oidList;\n }", "int getRequestedValues(int index);", "private List<HashMap<TimeSelector, Long>> updateEq(\n HashMap<ComparableExpression, HashSet<ComparableExpression>> rEq,\n HashMap<TimeSelector, Long> lowerBounds, HashMap<TimeSelector, Long> upperBounds)\n throws QueryContradictoryException {\n\n ArrayList<ArrayList<ComparableExpression>> eq = relationToTuples(rEq);\n for (ArrayList<ComparableExpression> tuple : eq) {\n TimeSelector selector = null;\n TimeLiteral literal = null;\n // only comparisons between a selector and a literal are interesting here\n if (tuple.get(0) instanceof TimeSelector && tuple.get(1) instanceof TimeLiteral) {\n selector = (TimeSelector) tuple.get(0);\n literal = (TimeLiteral) tuple.get(1);\n } else if (tuple.get(1) instanceof TimeSelector && tuple.get(0) instanceof TimeLiteral) {\n selector = (TimeSelector) tuple.get(1);\n literal = (TimeLiteral) tuple.get(0);\n } else {\n continue;\n }\n // for selector=literal, lowerBound(selector) = literal and upperBound(selector) = literal\n Long literalValue = literal.getMilliseconds();\n if (lowerBounds.get(selector) > literalValue || upperBounds.get(selector) < literalValue) {\n throw new QueryContradictoryException();\n } else {\n lowerBounds.put(selector, literalValue);\n upperBounds.put(selector, literalValue);\n }\n }\n return Arrays.asList(lowerBounds, upperBounds);\n }", "public int getMinimumValue() {\n/* 276 */ return -this.s.getMaximumValue();\n/* */ }", "private static final EvaluationAccessor min(EvaluationAccessor operand, EvaluationAccessor[] arguments) {\r\n EvaluationAccessor result = null;\r\n Value oVal = operand.getValue();\r\n if (oVal instanceof ContainerValue) {\r\n ContainerValue cont = (ContainerValue) oVal;\r\n IDatatype contType = ((Container) cont.getType()).getContainedType();\r\n int contSize = cont.getElementSize();\r\n \r\n if (contSize > 0) {\r\n Value rValue = null;\r\n \r\n // Determine min for number containers \r\n if (contType.isAssignableFrom(RealType.TYPE)) {\r\n // Handle min for Reals\r\n double min = (Double) cont.getElement(0).getValue();\r\n for (int i = 1; i < contSize; i++) {\r\n double tmp = (Double) cont.getElement(i).getValue();\r\n if (tmp < min) {\r\n min = tmp;\r\n }\r\n }\r\n \r\n try {\r\n rValue = ValueFactory.createValue(contType, min);\r\n } catch (ValueDoesNotMatchTypeException e) {\r\n EASyLoggerFactory.INSTANCE.getLogger(GenericNumberOperations.class, Bundle.ID)\r\n .debug(e.getMessage());\r\n }\r\n } else if (contType.isAssignableFrom(IntegerType.TYPE)) {\r\n // Handle min for Reals\r\n int min = (Integer) cont.getElement(0).getValue();\r\n for (int i = 1; i < contSize; i++) {\r\n int tmp = (Integer) cont.getElement(i).getValue();\r\n if (tmp < min) {\r\n min = tmp;\r\n }\r\n }\r\n \r\n // Create min value\r\n try {\r\n rValue = ValueFactory.createValue(contType, min);\r\n } catch (ValueDoesNotMatchTypeException e) {\r\n EASyLoggerFactory.INSTANCE.getLogger(GenericNumberOperations.class, Bundle.ID)\r\n .debug(e.getMessage());\r\n }\r\n }\r\n \r\n if (null != rValue) {\r\n result = ConstantAccessor.POOL.getInstance().bind(rValue, operand.getContext());\r\n }\r\n }\r\n }\r\n return result;\r\n }", "public double getXRangeMin() {\n return xRangeMin;\n }", "@Test\n public void learnToQueryWithDomainSpecificRangeParam() throws Exception {\n SqlSession session = null;\n\n List<Country> lc = session.selectList(\"getCountryRange3\", new Range(22, 33));\n\n assertEquals(12, lc.size());\n Country finland = lc.get(11);\n assertEquals(\"Finland\", finland.getCountry());\n\n }", "public void setBounds(int var1, int var2, int var3, int var4) {\n if(var1 < 0) {\n var1 = 0;\n }\n\n if(var2 < 0) {\n var2 = 0;\n }\n\n if(var3 > this.field_723) {\n var3 = this.field_723;\n }\n\n if(var4 > this.field_724) {\n var4 = this.field_724;\n }\n\n this.field_745 = var1;\n this.field_743 = var2;\n this.field_746 = var3;\n this.field_744 = var4;\n }", "private void setDefaultValidRange ()\r\n\t{\r\n\t\tm_lowerBounds = Integer.MIN_VALUE;\r\n\t\tm_upperBounds = Integer.MAX_VALUE;\r\n\t}", "public static void c1_vl() {\n\t}", "int[] getSelection();", "public double getRange(){\n\t\treturn range;\n\t}", "NumberVariable getSource();", "public void setXDataRange(float min, float max);", "RangeValue createRangeValue();", "@Override\n public void onValueSelected(int lineIndex, int pointIndex, PointValue value) {\n }", "double getBasedOnValue();", "public final EObject ruleRange() throws RecognitionException {\n EObject current = null;\n\n Token otherlv_1=null;\n AntlrDatatypeRuleToken lv_LOWER_BOUND_0_0 = null;\n\n AntlrDatatypeRuleToken lv_HIGHER_BOUND_2_0 = null;\n\n\n\n \tenterRule();\n\n try {\n // InternalMyDsl.g:3362:2: ( ( ( (lv_LOWER_BOUND_0_0= ruleNUMBER ) ) otherlv_1= ':' ( (lv_HIGHER_BOUND_2_0= ruleNUMBER ) ) ) )\n // InternalMyDsl.g:3363:2: ( ( (lv_LOWER_BOUND_0_0= ruleNUMBER ) ) otherlv_1= ':' ( (lv_HIGHER_BOUND_2_0= ruleNUMBER ) ) )\n {\n // InternalMyDsl.g:3363:2: ( ( (lv_LOWER_BOUND_0_0= ruleNUMBER ) ) otherlv_1= ':' ( (lv_HIGHER_BOUND_2_0= ruleNUMBER ) ) )\n // InternalMyDsl.g:3364:3: ( (lv_LOWER_BOUND_0_0= ruleNUMBER ) ) otherlv_1= ':' ( (lv_HIGHER_BOUND_2_0= ruleNUMBER ) )\n {\n // InternalMyDsl.g:3364:3: ( (lv_LOWER_BOUND_0_0= ruleNUMBER ) )\n // InternalMyDsl.g:3365:4: (lv_LOWER_BOUND_0_0= ruleNUMBER )\n {\n // InternalMyDsl.g:3365:4: (lv_LOWER_BOUND_0_0= ruleNUMBER )\n // InternalMyDsl.g:3366:5: lv_LOWER_BOUND_0_0= ruleNUMBER\n {\n if ( state.backtracking==0 ) {\n\n \t\t\t\t\tnewCompositeNode(grammarAccess.getRangeAccess().getLOWER_BOUNDNUMBERParserRuleCall_0_0());\n \t\t\t\t\n }\n pushFollow(FOLLOW_28);\n lv_LOWER_BOUND_0_0=ruleNUMBER();\n\n state._fsp--;\n if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n \t\t\t\t\tif (current==null) {\n \t\t\t\t\t\tcurrent = createModelElementForParent(grammarAccess.getRangeRule());\n \t\t\t\t\t}\n \t\t\t\t\tset(\n \t\t\t\t\t\tcurrent,\n \t\t\t\t\t\t\"LOWER_BOUND\",\n \t\t\t\t\t\tlv_LOWER_BOUND_0_0,\n \t\t\t\t\t\t\"org.xtext.example.mydsl.MyDsl.NUMBER\");\n \t\t\t\t\tafterParserOrEnumRuleCall();\n \t\t\t\t\n }\n\n }\n\n\n }\n\n otherlv_1=(Token)match(input,42,FOLLOW_25); if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n \t\t\tnewLeafNode(otherlv_1, grammarAccess.getRangeAccess().getColonKeyword_1());\n \t\t\n }\n // InternalMyDsl.g:3387:3: ( (lv_HIGHER_BOUND_2_0= ruleNUMBER ) )\n // InternalMyDsl.g:3388:4: (lv_HIGHER_BOUND_2_0= ruleNUMBER )\n {\n // InternalMyDsl.g:3388:4: (lv_HIGHER_BOUND_2_0= ruleNUMBER )\n // InternalMyDsl.g:3389:5: lv_HIGHER_BOUND_2_0= ruleNUMBER\n {\n if ( state.backtracking==0 ) {\n\n \t\t\t\t\tnewCompositeNode(grammarAccess.getRangeAccess().getHIGHER_BOUNDNUMBERParserRuleCall_2_0());\n \t\t\t\t\n }\n pushFollow(FOLLOW_2);\n lv_HIGHER_BOUND_2_0=ruleNUMBER();\n\n state._fsp--;\n if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n \t\t\t\t\tif (current==null) {\n \t\t\t\t\t\tcurrent = createModelElementForParent(grammarAccess.getRangeRule());\n \t\t\t\t\t}\n \t\t\t\t\tset(\n \t\t\t\t\t\tcurrent,\n \t\t\t\t\t\t\"HIGHER_BOUND\",\n \t\t\t\t\t\tlv_HIGHER_BOUND_2_0,\n \t\t\t\t\t\t\"org.xtext.example.mydsl.MyDsl.NUMBER\");\n \t\t\t\t\tafterParserOrEnumRuleCall();\n \t\t\t\t\n }\n\n }\n\n\n }\n\n\n }\n\n\n }\n\n if ( state.backtracking==0 ) {\n\n \tleaveRule();\n\n }\n }\n\n catch (RecognitionException re) {\n recover(input,re);\n appendSkippedTokens();\n }\n finally {\n }\n return current;\n }", "private void initX_ValuesControl(){\n if(xValuesPanel == null)\n xValuesPanel = new X_ValuesInCurveControlPanel(this,this);\n if(!useCustomX_Values)\n xValuesPanel.useDefaultX_Values();\n else\n xValuesPanel.setX_Values(function);\n xValuesPanel.pack();\n xValuesPanel.setVisible(true);\n }", "@JSProperty(\"range\")\n void setRange(double value);" ]
[ "0.59119636", "0.5879761", "0.5868148", "0.57209325", "0.56939006", "0.5650895", "0.56147593", "0.56061965", "0.5547528", "0.55462146", "0.55350655", "0.55113053", "0.5358328", "0.53522074", "0.53303295", "0.5320855", "0.5306986", "0.52927244", "0.5276541", "0.52742636", "0.5251186", "0.51688504", "0.5159531", "0.51364064", "0.513479", "0.51317626", "0.51123637", "0.51031893", "0.50965923", "0.5086239", "0.50855637", "0.50755346", "0.50527763", "0.50185364", "0.500657", "0.49972156", "0.4986892", "0.49692646", "0.4961404", "0.49585167", "0.49544764", "0.4954179", "0.49520966", "0.4951517", "0.49410203", "0.49375972", "0.49256098", "0.49059403", "0.48867896", "0.48838848", "0.48780426", "0.48762333", "0.48696828", "0.48661894", "0.48660815", "0.4849907", "0.48334736", "0.48305258", "0.4830176", "0.48257393", "0.48218063", "0.48169756", "0.4816379", "0.48082718", "0.4801969", "0.48002172", "0.47942746", "0.4790401", "0.4783199", "0.47709873", "0.47707728", "0.47650537", "0.47496662", "0.47426966", "0.47328055", "0.47327495", "0.4723965", "0.4704142", "0.4702197", "0.4700525", "0.46990174", "0.46982697", "0.46982104", "0.4690774", "0.4690249", "0.4690086", "0.46855462", "0.4683092", "0.46814173", "0.46787402", "0.46751884", "0.46734616", "0.46717095", "0.46683374", "0.46648237", "0.4662037", "0.46558186", "0.46545437", "0.46520776", "0.46510017" ]
0.54368955
12
Selects a value at the middle between the variable lower and upper bounds BEWARE: this should not be used within assignments and/or value removals if variables have a bounded domain.
public static IntValueSelector mid_value_selector(boolean floor) { return new IntDomainMiddle(floor); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private double getRangeCenter(int lowerBound, int upperBound) {\n return (lowerBound + upperBound) / 2.0;\n }", "public static double inInterval(double lowerBound, double value, double upperBound) {\n/* 67 */ if (value < lowerBound)\n/* 68 */ return lowerBound; \n/* 69 */ if (upperBound < value)\n/* 70 */ return upperBound; \n/* 71 */ return value;\n/* */ }", "protected void mapValueToWithinBounds() {\n if (getAllele() != null) {\n \tFloat d_value = ( (Float) getAllele());\n if (d_value.isInfinite()) {\n // Here we have to break to avoid a stack overflow.\n // ------------------------------------------------\n return;\n }\n // If the value exceeds either the upper or lower bounds, then\n // map the value to within the legal range. To do this, we basically\n // calculate the distance between the value and the float min,\n // then multiply it with a random number and then care that the lower\n // boundary is added.\n // ------------------------------------------------------------------\n if (d_value.floatValue() > m_upperBound ||\n d_value.floatValue() < m_lowerBound) {\n RandomGenerator rn;\n if (getConfiguration() != null) {\n rn = getConfiguration().getRandomGenerator();\n }\n else {\n rn = new StockRandomGenerator();\n }\n setAllele(new Float((rn.nextFloat()\n * ((m_upperBound - m_lowerBound))) + m_lowerBound));\n }\n }\n }", "public int getLowerBound ();", "public V getLowerBound();", "public void setLowerBound (int lowerBound) throws ModelException;", "private int getValue(int lowerBound, int upperBound) {\n int problemRange = upperBound - lowerBound + 1;\n\n return lowerBound + rng.nextInt(problemRange);\n }", "private double getMarginFromBounds(int lowerBound, int upperBound) {\n return (upperBound - lowerBound) / 2.0;\n }", "public int getBound();", "public E set(D lower, D upper, V value) {\n\t\t\t// Go one out to find abutting ranges, too.\n\t\t\tD prev = getPreviousOrSame(lower);\n\t\t\tD next = getNextOrSame(upper);\n\t\t\tMap<R, V> toPut = new HashMap<>();\n\t\t\tfor (E entry : getIntersecting(prev, next)) {\n\t\t\t\tR r = getRange(entry);\n\t\t\t\tboolean precedesMin = getLower(r).compareTo(lower) < 0;\n\t\t\t\tboolean succeedsMax = getUpper(r).compareTo(upper) > 0;\n\t\t\t\tboolean sameVal = Objects.equals(getValue(entry), value);\n\t\t\t\tif (precedesMin && succeedsMax && sameVal) {\n\t\t\t\t\treturn entry; // The value in this range is already set as specified\n\t\t\t\t}\n\t\t\t\tremove(entry);\n\t\t\t\tif (precedesMin) {\n\t\t\t\t\tif (sameVal) {\n\t\t\t\t\t\tlower = getLower(r);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\ttoPut.put(toRange(getLower(r), prev), getValue(entry));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (succeedsMax) {\n\t\t\t\t\tif (sameVal) {\n\t\t\t\t\t\tupper = getUpper(r);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\ttoPut.put(toRange(next, getUpper(r)), getValue(entry));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tE result = put(toRange(lower, upper), value);\n\t\t\tassert toPut.size() <= 2;\n\t\t\tfor (Entry<R, V> ent : toPut.entrySet()) {\n\t\t\t\tput(ent.getKey(), ent.getValue());\n\t\t\t}\n\t\t\treturn result;\n\t\t}", "public int getLowerBound() {\r\n return lowerBound;\r\n }", "int selectValue(IntVar v) {\r\n int c = (v.max() + v.min())/2;\r\n return c;\r\n }", "public abstract void selectIndexRange(int min, int max);", "public void setLowerBound(String lower) {\n lowerBound = lower;\n }", "private double checkBounds(double param, int i) {\n if (param < low[i]) {\n return low[i];\n } else if (param > high[i]) {\n return high[i];\n } else {\n return param;\n }\n }", "protected abstract D getUpper(R range);", "protected abstract D getLower(R range);", "public double withIn(double input, double upperBound, double lowerBound) {\n\t\tif (input > 0) {\n\t\t\treturn java.lang.Math.min(upperBound, input);\n\t\t} else if (input < 0) {\n\t\t\treturn java.lang.Math.max(lowerBound, input);\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "public void setUpperBound(String upper) {\n upperBound = upper;\n }", "public void setLowerBound(final int lowerBound) {\r\n this.lowerBound = lowerBound;\r\n }", "Condition between(QueryParameter parameter, Object x, Object y);", "public Range getRangeX(double lowerPercent, double upperPercent, \n PlotRenderingInfo info, Point2D source) {\n \t\t\n \t double start = super.getDomainAxis().getRange().getLowerBound();\n double length = super.getDomainAxis().getRange().getLength();\n Range adjusted = null;\n if (super.getDomainAxis().isInverted()) {\n adjusted = new Range(start + (length * (1 - upperPercent)), \n start + (length * (1 - lowerPercent))); \n }\n else {\n adjusted = new Range(start + length * lowerPercent, \n start + length * upperPercent);\n }\n return adjusted;\n }", "public static BsonDocument createPartitionBounds(final BsonValue lower, final BsonValue upper) {\n BsonDocument partitionBoundary = new BsonDocument();\n if (lower.getBsonType() != BsonType.MIN_KEY) {\n partitionBoundary.append(\"$gte\", lower);\n }\n if (upper.getBsonType() != BsonType.MAX_KEY) {\n partitionBoundary.append(\"$lt\", upper);\n }\n return partitionBoundary;\n }", "Range controlLimits();", "public static int getMid(int low, int high) \r\n\t{\r\n\t\treturn ((low + high + 1) / 2);\r\n\t}", "public BetweenCriteria(String attributeName, Object lowerBound, Object upperBound) {\n super(attributeName, lowerBound);\n this.upperBound = upperBound;\n }", "int getBoundsX();", "private void checkBound(int lowerBound, int upperBound) {\n\t\tSet setKeys = Utility.vocabHM.keySet();\n\t\tIterator i = setKeys.iterator();\n\n\t\twhile (i.hasNext()) {\n\t\t\tString s = (String) i.next();\n\t\t\tInteger df = (Integer) Utility.vocabHM.get(s);\n\n\t\t\tif ((df.intValue() <= lowerBound) || (df.intValue() >= upperBound))\n\t\t\t\ti.remove();\n\t\t}\n\t}", "protected int getBoundedValue(int aNumber) {\r\n if (aNumber < getMin()) {\r\n aNumber = getMin();\r\n } else if (aNumber > getMax()) {\r\n aNumber = getMax();\r\n }\r\n return aNumber;\r\n }", "public static double constrain(double value, double min, double max) {\n if(value > max) value = max;\n else if(value < min) value = min;\n return value;\n }", "@Override\n\tprotected void setLowerBound() {\n\t\t\n\t}", "private double clamp(double v, double min, double max) { return (v < min ? min : (v > max ? max : v)); }", "void assignRange() {\n rangeIndex = (int) Math.floor(value / step);\n }", "public void setValidRange (int lowerBounds, int upperBounds)\r\n\t{\r\n\t\tm_lowerBounds = lowerBounds;\r\n\t\tm_upperBounds = upperBounds;\r\n\t}", "protected abstract R toRange(D lower, D upper);", "@Override\n\tpublic AbstractValue greatestLowerBound(AbstractValue d) {\n\t\tif ( !(d instanceof Interval) )\n\t\t\tthrow new IllegalArgumentException(\"v should be of type Interval\");\n\t\tInterval i = (Interval) d;\n\n\t\tif (i.isBottom())\n\t\t\treturn i;\n\t\telse if (i.equals(top))\n\t\t\treturn this;\n\n\t\tString newLow = \"-Inf\", newHigh = \"+Inf\";\n\n\t\t//Calcolare limite inferiore\n\n\t\tif ( this.getLow().equals(\"-Inf\")){\n\t\t\tif( !i.getLow().equals(\"-Inf\"))\n\t\t\t\tif(Integer.parseInt(this.getHigh()) > Integer.parseInt(i.getLow()))\n\t\t\t\t\tnewLow = String.valueOf(Integer.max(Integer.parseInt(this.getLow()), Integer.parseInt(i.getLow())));\n\t\t\t\telse\n\t\t\t\t\treturn BottomAV.getInstance();\n\t\t}else if ( i.getLow().equals(\"-Inf\")){\n\t\t\tif( !this.getLow().equals(\"-Inf\"))\n\t\t\t\tif(Integer.parseInt(i.getHigh()) > Integer.parseInt(this.getLow()))\n\t\t\t\t\tnewLow = String.valueOf(Integer.max(Integer.parseInt(i.getLow()), Integer.parseInt(this.getLow())));\n\t\t\t\telse\n\t\t\t\t\treturn BottomAV.getInstance();\n\t\t}else if(!this.getLow().equals(\"-Inf\") && !i.getLow().equals(\"-Inf\")){\n\t\t\tnewLow = String.valueOf(Integer.max(Integer.parseInt(this.getLow()), Integer.parseInt(i.getLow())));\n\t\t}\n\n\t\t// Calcolare limite superiore\n\n\t\tif ( this.getHigh().equals(\"+Inf\")) {\n\t\t\tif (!i.getHigh().equals(\"+Inf\"))\n\t\t\t\tnewHigh = i.getHigh();\n\t\t}else if ( i.getHigh().equals(\"+Inf\")) {\n\t\t\tif (!this.getHigh().equals(\"+Inf\"))\n\t\t\t\tnewHigh = this.getHigh();\n\t\t}else if(!this.getHigh().equals(\"+Inf\") && !i.getHigh().equals(\"+Inf\")){\n\t\t\tnewHigh = String.valueOf(Integer.min(Integer.parseInt(this.getHigh()), Integer.parseInt(i.getHigh())));\n\t\t}\n\n\t\tInterval res = new Interval(newLow, newHigh);\n\n\t\t// Checks whether low > high\n\t\tif ((!newLow.equals(\"-Inf\") && (!newHigh.equals(\"+Inf\")) && Integer.parseInt(newLow) > Integer.parseInt(newHigh)))\n\t\t\treturn BottomAV.getInstance();\n\n\t\treturn amItop() ? top : res;\n\t}", "boolean selectTo(double x, double y);", "public static int clamp(int var, int min, int max){\n\n if(var >= max){return var = max;}\n else if(var <= min){return var = min;}\n else return var;\n\n }", "public void setUpperPoint(Point upper) {\n this.upper = upper;\n }", "ValueRangeConstraint createValueRangeConstraint();", "private static void checkFromToBounds(int paramInt1, int paramInt2, int paramInt3) {\n/* 386 */ if (paramInt2 > paramInt3) {\n/* 387 */ throw new ArrayIndexOutOfBoundsException(\"origin(\" + paramInt2 + \") > fence(\" + paramInt3 + \")\");\n/* */ }\n/* */ \n/* 390 */ if (paramInt2 < 0) {\n/* 391 */ throw new ArrayIndexOutOfBoundsException(paramInt2);\n/* */ }\n/* 393 */ if (paramInt3 > paramInt1) {\n/* 394 */ throw new ArrayIndexOutOfBoundsException(paramInt3);\n/* */ }\n/* */ }", "int getRange();", "private static int upperBound(int[] A, int target) {\n int max = A.length;\n int min = -1;\n while (max - min > 1) {\n int mid = ( max + min ) / 2;\n if(A[mid] <= target) {\n min = mid;\n } else {\n max = mid;\n }\n }\n\n return max;\n\n }", "public abstract double[] getLowerBound();", "public static double mapValueFromRangeToRange(\n double value,\n double fromLow,\n double fromHigh,\n double toLow,\n double toHigh) {\n double fromRangeSize = fromHigh - fromLow;\n double toRangeSize = toHigh - toLow;\n double valueScale = (value - fromLow) / fromRangeSize;\n return toLow + (valueScale * toRangeSize);\n }", "TrackingToken upperBound();", "public void setRange(double lower, double upper) {\n/* 625 */ if (lower >= upper) {\n/* 626 */ throw new IllegalArgumentException(\"Requires 'lower' < 'upper'.\");\n/* */ }\n/* 628 */ setRange(new DateRange(lower, upper));\n/* */ }", "public void testFindRangeBounds() {\n XYBlockRenderer renderer = new XYBlockRenderer();\n XYSeriesCollection dataset = new XYSeriesCollection();\n XYSeries series = new XYSeries(\"S1\");\n series.add(1.0, null);\n dataset.addSeries(series);\n Range r = renderer.findRangeBounds(dataset);\n }", "private int findCoordElementRegular(double coordValue, boolean bounded) {\n int n = orgGridAxis.getNcoords();\n if (n == 1 && bounded)\n return 0;\n\n double distance = coordValue - orgGridAxis.getCoordEdge1(0);\n double exactNumSteps = distance / orgGridAxis.getResolution();\n // int index = (int) Math.round(exactNumSteps); // ties round to +Inf\n int index = (int) exactNumSteps; // truncate down\n\n if (bounded && index < 0)\n return 0;\n if (bounded && index >= n)\n return n - 1;\n\n // check that found point is within interval\n if (index >= 0 && index < n) {\n double lower = orgGridAxis.getCoordEdge1(index);\n double upper = orgGridAxis.getCoordEdge2(index);\n if (orgGridAxis.isAscending()) {\n assert lower <= coordValue : lower + \" should be le \" + coordValue;\n assert upper >= coordValue : upper + \" should be ge \" + coordValue;\n } else {\n assert lower >= coordValue : lower + \" should be ge \" + coordValue;\n assert upper <= coordValue : upper + \" should be le \" + coordValue;\n }\n }\n\n return index;\n }", "double getLeft(double min);", "public static void setMinimumRange(int first, int last) {\r\n \tif (first > last) throw new IllegalArgumentException();\r\n \tIndex.valueOf(first);\r\n \tIndex.valueOf(last);\r\n }", "private int deadZone(int value, int minValue)\n\t{\n\t\tif (Math.abs(value) < minValue) value = 0;\n\t\t\n\t\treturn value;\n\t}", "boolean selectAt(double x, double y);", "@Override\n\tpublic AbstractValue leastUpperBound(AbstractValue v) {\n\t\tif ( !(v instanceof Interval) )\n\t\t\tthrow new IllegalArgumentException(\"v should be of type Interval\");\n\t\tInterval i = (Interval) v;\n\n\t\tif (i.equals(top))\n\t\t\treturn i;\n\t\telse if (i.isBottom())\n\t\t\treturn this;\n\n\t\tString newLow, newHigh;\n\n\t\tif (this.getLow().equals(\"-Inf\") || i.getLow().equals(\"-Inf\"))\n\t\t\tnewLow = \"-Inf\";\n\t\telse\n\t\t\tnewLow = String.valueOf(Long.min(Long.parseLong(this.getLow()), Long.parseLong(i.getLow())));\n\n\t\tif (this.getHigh().equals(\"+Inf\") || i.getHigh().equals(\"+Inf\"))\n\t\t\tnewHigh = \"+Inf\";\n\t\telse\n\t\t\tnewHigh = String.valueOf(Long.max(Long.parseLong(this.getHigh()), Long.parseLong(i.getHigh())));\n\n\t\tInterval res = new Interval(newLow, newHigh);\n\t\treturn amItop() ? top : res ;\n\t}", "private boolean isBetweenBounds(int x, int y, int[] bounds) {\n return x >= bounds[0] && x <= bounds[2] && y >= bounds[1] && y <= bounds[3];\n }", "private int findCoordElementContiguous(double target, boolean bounded) {\n int n = orgGridAxis.getNcoords();\n\n // Check that the point is within range\n MinMax minmax = orgGridAxis.getCoordEdgeMinMax();\n if (target < minmax.min()) {\n return bounded ? 0 : -1;\n } else if (target > minmax.max()) {\n return bounded ? n - 1 : n;\n }\n\n int low = 0;\n int high = n - 1;\n if (orgGridAxis.isAscending()) {\n // do a binary search to find the nearest index\n int mid;\n while (high > low + 1) {\n mid = (low + high) / 2; // binary search\n if (intervalContains(target, mid, true, false))\n return mid;\n else if (orgGridAxis.getCoordEdge2(mid) < target)\n low = mid;\n else\n high = mid;\n }\n return intervalContains(target, low, true, false) ? low : high;\n\n } else { // descending\n // do a binary search to find the nearest index\n int mid;\n while (high > low + 1) {\n mid = (low + high) / 2; // binary search\n if (intervalContains(target, mid, false, false))\n return mid;\n else if (orgGridAxis.getCoordEdge2(mid) < target)\n high = mid;\n else\n low = mid;\n }\n return intervalContains(target, low, false, false) ? low : high;\n }\n }", "public void setParamValueRange(String label, double minValue, double maxValue);", "private int getLowerBound(Object problem, int upperbound)\n {\n Graph tsp = (Graph)problem;\n if (weight == null)\n weight = new double[tsp.size()];\n hki = new HeldKarpIterative( tsp, included, includedT, excluded, excludedT, iterations, weight, upperbound);\n hki.compute();\n tour = hki.isTour();\n bound = hki.getBound();\n hasRun = true;\n// System.out.println(hki.debugDump());\n return bound;\n }", "public void setParamValueRange(String label, Object minValue, Object maxValue);", "public Range findRangeBounds(CategoryDataset dataset) { return findRangeBounds(dataset, true); }", "public Variable getVariableContaining(int offset);", "public InfinitNumber getBound() {\n\t\treturn mBound;\n\t}", "public void setBounds(int var1, int var2, int var3, int var4) {\n if(var1 < 0) {\n var1 = 0;\n }\n\n if(var2 < 0) {\n var2 = 0;\n }\n\n if(var3 > this.field_723) {\n var3 = this.field_723;\n }\n\n if(var4 > this.field_724) {\n var4 = this.field_724;\n }\n\n this.field_745 = var1;\n this.field_743 = var2;\n this.field_746 = var3;\n this.field_744 = var4;\n }", "TrackingToken lowerBound();", "private double correctToRange(double value, double min, double max) {\r\n\t\t// If the value is below the range, set it equal to the minimum.\r\n\t\tif (value < min) {\r\n\t\t\treturn min;\r\n\t\t\t// If it is above the range, set it equal to the maximum.\r\n\t\t} else if (value > max) {\r\n\t\t\treturn max;\r\n\t\t}\r\n\t\t// Otherwise, it is in-range and no adjustments are needed.\r\n\t\treturn value;\r\n\t}", "public void setUpperBound(final int upperBound) {\r\n this.upperBound = upperBound;\r\n }", "public final EObject ruleMultiplicityBoundsCS() throws RecognitionException {\n EObject current = null;\n\n Token otherlv_1=null;\n AntlrDatatypeRuleToken lv_lowerBound_0_0 = null;\n\n AntlrDatatypeRuleToken lv_upperBound_2_0 = null;\n\n\n\n \tenterRule();\n\n try {\n // InternalMyDsl.g:9315:2: ( ( ( (lv_lowerBound_0_0= ruleLOWER ) ) (otherlv_1= '..' ( (lv_upperBound_2_0= ruleUPPER ) ) )? ) )\n // InternalMyDsl.g:9316:2: ( ( (lv_lowerBound_0_0= ruleLOWER ) ) (otherlv_1= '..' ( (lv_upperBound_2_0= ruleUPPER ) ) )? )\n {\n // InternalMyDsl.g:9316:2: ( ( (lv_lowerBound_0_0= ruleLOWER ) ) (otherlv_1= '..' ( (lv_upperBound_2_0= ruleUPPER ) ) )? )\n // InternalMyDsl.g:9317:3: ( (lv_lowerBound_0_0= ruleLOWER ) ) (otherlv_1= '..' ( (lv_upperBound_2_0= ruleUPPER ) ) )?\n {\n // InternalMyDsl.g:9317:3: ( (lv_lowerBound_0_0= ruleLOWER ) )\n // InternalMyDsl.g:9318:4: (lv_lowerBound_0_0= ruleLOWER )\n {\n // InternalMyDsl.g:9318:4: (lv_lowerBound_0_0= ruleLOWER )\n // InternalMyDsl.g:9319:5: lv_lowerBound_0_0= ruleLOWER\n {\n if ( state.backtracking==0 ) {\n\n \t\t\t\t\tnewCompositeNode(grammarAccess.getMultiplicityBoundsCSAccess().getLowerBoundLOWERParserRuleCall_0_0());\n \t\t\t\t\n }\n pushFollow(FOLLOW_68);\n lv_lowerBound_0_0=ruleLOWER();\n\n state._fsp--;\n if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n \t\t\t\t\tif (current==null) {\n \t\t\t\t\t\tcurrent = createModelElementForParent(grammarAccess.getMultiplicityBoundsCSRule());\n \t\t\t\t\t}\n \t\t\t\t\tset(\n \t\t\t\t\t\tcurrent,\n \t\t\t\t\t\t\"lowerBound\",\n \t\t\t\t\t\tlv_lowerBound_0_0,\n \t\t\t\t\t\t\"org.eclipse.ocl.xtext.base.Base.LOWER\");\n \t\t\t\t\tafterParserOrEnumRuleCall();\n \t\t\t\t\n }\n\n }\n\n\n }\n\n // InternalMyDsl.g:9336:3: (otherlv_1= '..' ( (lv_upperBound_2_0= ruleUPPER ) ) )?\n int alt136=2;\n int LA136_0 = input.LA(1);\n\n if ( (LA136_0==101) ) {\n alt136=1;\n }\n switch (alt136) {\n case 1 :\n // InternalMyDsl.g:9337:4: otherlv_1= '..' ( (lv_upperBound_2_0= ruleUPPER ) )\n {\n otherlv_1=(Token)match(input,101,FOLLOW_97); if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n \t\t\t\tnewLeafNode(otherlv_1, grammarAccess.getMultiplicityBoundsCSAccess().getFullStopFullStopKeyword_1_0());\n \t\t\t\n }\n // InternalMyDsl.g:9341:4: ( (lv_upperBound_2_0= ruleUPPER ) )\n // InternalMyDsl.g:9342:5: (lv_upperBound_2_0= ruleUPPER )\n {\n // InternalMyDsl.g:9342:5: (lv_upperBound_2_0= ruleUPPER )\n // InternalMyDsl.g:9343:6: lv_upperBound_2_0= ruleUPPER\n {\n if ( state.backtracking==0 ) {\n\n \t\t\t\t\t\tnewCompositeNode(grammarAccess.getMultiplicityBoundsCSAccess().getUpperBoundUPPERParserRuleCall_1_1_0());\n \t\t\t\t\t\n }\n pushFollow(FOLLOW_2);\n lv_upperBound_2_0=ruleUPPER();\n\n state._fsp--;\n if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n \t\t\t\t\t\tif (current==null) {\n \t\t\t\t\t\t\tcurrent = createModelElementForParent(grammarAccess.getMultiplicityBoundsCSRule());\n \t\t\t\t\t\t}\n \t\t\t\t\t\tset(\n \t\t\t\t\t\t\tcurrent,\n \t\t\t\t\t\t\t\"upperBound\",\n \t\t\t\t\t\t\tlv_upperBound_2_0,\n \t\t\t\t\t\t\t\"org.eclipse.ocl.xtext.base.Base.UPPER\");\n \t\t\t\t\t\tafterParserOrEnumRuleCall();\n \t\t\t\t\t\n }\n\n }\n\n\n }\n\n\n }\n break;\n\n }\n\n\n }\n\n\n }\n\n if ( state.backtracking==0 ) {\n\n \tleaveRule();\n\n }\n }\n\n catch (RecognitionException re) {\n recover(input,re);\n appendSkippedTokens();\n }\n finally {\n }\n return current;\n }", "public static IntStrategy minDom_MidValue(boolean floor, IntVar... VARS) {\n return custom(minDomainSize_var_selector(), mid_value_selector(floor), VARS);\n }", "public int findCoordElement(CoordInterval target, boolean bounded) {\n switch (orgGridAxis.getSpacing()) {\n case regularInterval:\n // can use midpoint\n return findCoordElementRegular(target.midpoint(), bounded);\n case contiguousInterval:\n // can use midpoint\n return findCoordElementContiguous(target.midpoint(), bounded);\n case discontiguousInterval:\n // cant use midpoint\n return findCoordElementDiscontiguousInterval(target, bounded);\n }\n throw new IllegalStateException(\"unknown spacing\" + orgGridAxis.getSpacing());\n }", "public static int clamp(int var, int min, int max) {\n\n // Clamping means literally in this instance.\n //// it's used to restrict a value to a given range\n if (var >= max) {\n return var = max;\n } else if (var <= min) {\n return var = min;\n } else {\n return var;\n }\n }", "public abstract void setRange(double value, int start, int count);", "public Bounds getBounds () { return (bounds); }", "public void printRange(AnyType lower, AnyType upper) {\r\n\t\tif (lower.compareTo(upper) > 0) {\r\n\t\t\tAnyType temp = lower;\r\n\t\t\tlower = upper;\r\n\t\t\tupper = temp;\r\n\t\t} // if (switches values to check and use them)\r\n\t\tif (root == null) {\r\n\t\t\treturn;\r\n\t\t} else {\r\n\t\t\tprintRange(root, lower, upper);\r\n\t\t} // else\r\n\t}", "private boolean isInRange(int a, int b, int c) {\n return c >= a ;\n }", "int prevInt(int origin, int bound);", "Lista<V> valuesInRange(K init, K end);", "public abstract DoublePredicate upperPredicate(double upperBound);", "public void setUpperLeft(Point p) {\n this.upperLeft = p;\n }", "public int lowerBound(final List<Integer> a, int target){\n int l = 0, h = a.size()-1;\n while(h - l > 3){\n int mid = (l+h)/2;\n if(a.get(mid) == target)\n h = mid;\n else if(a.get(mid) < target){\n l = mid + 1;\n }\n else if(a.get(mid) > target){\n h = mid - 1;\n }\n }\n for(int i=l; i<=h; ++i){\n if(a.get(i) == target)\n return i;\n }\n return -1;\n }", "Rectangle getBounds();", "IntVar selectVariable(IntVar[] v) {\r\n\r\n if (v.length != 0) {\r\n int index = 0;\r\n int smallestDomain = Integer.MAX_VALUE;\r\n for(int i = 0; i< v.length-1; i++){\r\n if(v[i].domain.getSize()<smallestDomain){\r\n index = i;\r\n smallestDomain = v[i].domain.getSize();\r\n }\r\n\r\n }\r\n if(v[index].min() == v[index].max()){\r\n\r\n searchVariables = new IntVar[v.length-1];\r\n for (int i = 0; i < v.length-1; i++) {\r\n if(i<index){\r\n searchVariables[i] = v[i];\r\n }\r\n else searchVariables[i] = v[i+1];\r\n\r\n }\r\n }\r\n else{\r\n searchVariables = new IntVar[v.length];\r\n for(int i = 0; i < v.length; i++){\r\n searchVariables[i] = v[i];\r\n }\r\n }\r\n return v[index];\r\n\r\n }\r\n else {\r\n System.err.println(\"Zero length list of variables for labeling\");\r\n return new IntVar(store);\r\n }\r\n }", "public static double mid(double a, double b, double c) {\n if (a >= b) {\n if (b >= c) {\n return b; // a >= b >= c\n } else if (a >= c) {\n return c; // a >= c > b\n } else {\n return a; // c > a >= b\n }\n } else if (a >= c) {\n return a; // b > a >= c\n } else if (b >= c) {\n return c; // b >= c > a\n } else {\n return b; // c > b > a\n }\n }", "public V getUpperBound();", "private boolean isInBound(int current, int bound){\n return (current >= 0 && current < bound);\n }", "private int valueToPos( final double value )\n\t{\n\t\tfinal double dmin = range.getMinBound();\n\t\tfinal double dmax = range.getMaxBound();\n\t\treturn ( int ) Math.round( ( value - dmin ) * SLIDER_LENGTH / ( dmax - dmin ) );\n\t}", "void setSelection(int from, int to);", "private static void fillWithFlagAboveSubLitPart(\n GRect cbbox,\n MyFlagManager flagManager,\n int[] xMinArr,\n int[] xMaxArr,\n int j,\n int segmentXMin,\n int segmentXMax,\n byte segmentFlag) {\n \n final int subJ = j + 1;\n final int subXMinLit = xMinArr[subJ];\n final int subXMaxLit = xMaxArr[subJ];\n if (DEBUG) {\n Dbg.log(\"subXMinLit = \" + subXMinLit);\n Dbg.log(\"subXMaxLit = \" + subXMaxLit);\n }\n if (subXMinLit <= subXMaxLit) {\n final int cmnXMin = Math.max(segmentXMin, subXMinLit + 1);\n final int cmnXMax = Math.min(segmentXMax, subXMaxLit - 1);\n if (DEBUG) {\n Dbg.log(\"cmnXMin = \" + cmnXMin);\n Dbg.log(\"cmnXMax = \" + cmnXMax);\n }\n if (cmnXMin <= cmnXMax) {\n final int tmpI = cmnXMin - cbbox.x();\n final int indexFrom = tmpI + j * cbbox.xSpan();\n final int indexTo = indexFrom + (cmnXMax - cmnXMin);\n if (DEBUG) {\n Dbg.log(\"indexFrom = \" + indexFrom);\n Dbg.log(\"indexTo = \" + indexTo);\n }\n fillWithFlag(\n flagManager,\n indexFrom,\n indexTo,\n segmentFlag);\n }\n }\n }", "public interface IntervalRange<V extends Comparable<V>> extends Range<V> {\n\n\t/**\n\t * This method returns the lower bound of the interval.\n\t * \n\t * @return the lower bound. <code>null</code> means there is no lower bound,\n\t * i.e., this is an open interval.\n\t */\n\tpublic V getLowerBound();\n\n\t/**\n\t * This method returns the upper bound of the interval.\n\t * \n\t * @return the upper bound. <code>null</code> means there is no upper bound,\n\t * i.e., this is an open interval.\n\t */\n\tpublic V getUpperBound();\n\n}", "IntervalTupleList evaluate(double low, double high);", "protected static double clamp(double pos, double min, double max) {\n\t\tif(pos < min) {\n\t\t\treturn min;\n\t\t} else if (pos\t> max) {\n\t\t\treturn max;\n\t\t} else {\n\t\t\treturn pos;\n\t\t}\n\t}", "private int clamp(int val, int min, int max){\n\t\tif(val > max){\n\t\t\tval = max;\n\t\t}\n\t\telse if(val < min){\n\t\t\tval = min;\n\t\t}\n\t\treturn val;\n\t}", "public void boundsCheck(BigDecimal d) throws InvalidDatatypeValueException {\n boolean minOk = false;\n boolean maxOk = false;\n String upperBound = (fMaxExclusive != null )? ( fMaxExclusive.toString() ):\n ( ( fMaxInclusive != null )?fMaxInclusive.toString():\"\");\n \n String lowerBound = (fMinExclusive != null )? ( fMinExclusive.toString() ):\n (( fMinInclusive != null )?fMinInclusive.toString():\"\"); \n String lowerBoundIndicator = \"\";\n String upperBoundIndicator = \"\";\n \n \n if ( isMaxInclusiveDefined){\n maxOk = (d.compareTo(fMaxInclusive) <= 0);\n upperBound = fMaxInclusive.toString();\n if ( upperBound != null ){\n upperBoundIndicator = \"<=\"; \n } else {\n upperBound=\"\";\n }\n } else if ( isMaxExclusiveDefined){\n maxOk = (d.compareTo(fMaxExclusive) < 0);\n upperBound = fMaxExclusive.toString();\n if ( upperBound != null ){\n upperBoundIndicator = \"<\";\n } else {\n upperBound = \"\";\n }\n } else{\n maxOk = (!isMaxInclusiveDefined && ! isMaxExclusiveDefined);\n }\n \n \n if ( isMinInclusiveDefined){\n minOk = (d.compareTo(fMinInclusive) >= 0);\n lowerBound = fMinInclusive.toString();\n if( lowerBound != null ){\n lowerBoundIndicator = \"<=\";\n }else {\n lowerBound = \"\";\n }\n } else if ( isMinExclusiveDefined){\n minOk = (d.compareTo(fMinExclusive) > 0);\n lowerBound = fMinExclusive.toString();\n if( lowerBound != null ){\n lowerBoundIndicator = \"<\";\n } else {\n lowerBound = \"\";\n }\n } else{\n minOk = (!isMinInclusiveDefined && !isMinExclusiveDefined);\n }\n \n if (!(minOk && maxOk))\n throw new InvalidDatatypeValueException (\n getErrorString(DatatypeMessageProvider.OutOfBounds,\n DatatypeMessageProvider.MSG_NONE,\n new Object [] { d.toString() , lowerBound ,\n upperBound, lowerBoundIndicator, upperBoundIndicator}));\n \n }", "private double applyLimitBounds(double value) {\n if(value > 1.0) {\n value = 1.0;\n }\n if(value < -1.0) {\n value = -1.0;\n }\n\n // Absolute limits:\n if(lifter.getBottomLimit() && lifter.getUpperLimit()) {\n if(value < 0) {\n value = 0; // Can't go down from the bottom;\n }\n }\n\n if((lifter.getUpperLimit() && lifter.getUpperWarning()) && lifter.getUpperSmallPieceDetector()) {\n if(value > 0) {\n value = 0; // Can't go up from the top\n }\n }\n\n // Slow speed zones\n if(lifter.getBottomWarning()) {\n if(value < -0.3) {\n value = -0.3;\n }\n }\n\n if(lifter.getUpperWarning()) {\n if(value > 0.7) {\n value = 0.7;\n }\n }\n\n printLimits();\n\n return value;\n }", "public PickBounds(Bounds boundsObject) {\n\tbounds = boundsObject;\n }", "@Override\n\tprotected double getLowerBound() {\n\t\treturn 0;\n\t}", "public interface GeneralRange<T extends Comparable<T>> {\n\t/**\n\t * Return whether a given comparable element is in a bound according to some field in that object.\n\t * @param a The value to be compared to the range.\n\t * @return Integer < 0 if it is less than the range, = 0 if it is in the range and > 0 if it is bigger than the range.\n\t */\n\tpublic int isInBounds(T a);\n}", "Range selectAssignment(IntervalSet availableRanges, IntervalSet neededRanges, long blockSize);", "public String getUpper() {\n return upperBound;\n }", "public String getLower() {\n return lowerBound;\n }", "public Range getRangeY(double lowerPercent, double upperPercent, \n PlotRenderingInfo info, Point2D source) {\n \tdouble start = super.getRangeAxis().getRange().getLowerBound();\n double length = super.getRangeAxis().getRange().getLength();\n Range adjusted = null;\n if (super.getRangeAxis().isInverted()) {\n adjusted = new Range(start + (length * (1 - upperPercent)), \n start + (length * (1 - lowerPercent))); \n }\n else {\n adjusted = new Range(start + length * lowerPercent, \n start + length * upperPercent);\n }\n return adjusted;\n }" ]
[ "0.63003737", "0.61946565", "0.6170874", "0.6164327", "0.59495455", "0.5918012", "0.58724725", "0.58511114", "0.5753205", "0.5714184", "0.56825817", "0.559125", "0.55894375", "0.5516301", "0.5506817", "0.5487519", "0.5472665", "0.5395303", "0.53667486", "0.53566957", "0.535343", "0.53192675", "0.531861", "0.5284754", "0.52790684", "0.5271402", "0.526747", "0.5263325", "0.5263236", "0.52585286", "0.5256986", "0.5253547", "0.5244858", "0.5241485", "0.5221874", "0.521891", "0.52164483", "0.52057856", "0.5173925", "0.5167624", "0.5166017", "0.51637757", "0.51636654", "0.51451856", "0.5144125", "0.51351815", "0.51208735", "0.5101574", "0.50990736", "0.5091631", "0.50893223", "0.50874966", "0.50850356", "0.50823784", "0.5059341", "0.5042549", "0.50259656", "0.5021985", "0.501052", "0.5006904", "0.50027233", "0.49867046", "0.4986011", "0.49797955", "0.49782455", "0.49770766", "0.49731487", "0.4971937", "0.49543977", "0.49439648", "0.4937344", "0.49313068", "0.49122566", "0.4911846", "0.4910106", "0.49057472", "0.49052674", "0.4902918", "0.49012923", "0.48986068", "0.48975495", "0.48937207", "0.48904502", "0.4886716", "0.488573", "0.48853895", "0.48768607", "0.4875154", "0.4871633", "0.48690987", "0.48689732", "0.48644218", "0.48641083", "0.48601967", "0.4850591", "0.48414046", "0.48399264", "0.4838585", "0.48332", "0.48254976" ]
0.52222985
34
Selects the variable upper bound
public static IntValueSelector max_value_selector() { return new IntDomainMax(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setUpperBound(String upper) {\n upperBound = upper;\n }", "public int getUpperBound() {\r\n return upperBound;\r\n }", "public void setUpperBound(final int upperBound) {\r\n this.upperBound = upperBound;\r\n }", "public int getUpperBound() {\n\t\treturn upperBound;\n\t}", "public int getBound();", "TrackingToken upperBound();", "public V getUpperBound();", "public int getUpperBound() {\n\t\treturn this.upperBound;\n\t}", "public String getUpper() {\n return upperBound;\n }", "public int upperBound() {\n\t\tif(step > 0)\n\t\t\treturn last;\n\t\telse\n\t\t\treturn first;\n\t}", "@Override\n\tprotected void setUpperBound() {\n\t\t\n\t}", "double getUpperThreshold();", "public long getUpperTbound() {\n\t\treturn this.upperTBound;\n\t}", "public int getUpperThreshold() {\r\n\t\tint upperThreshold;\r\n\t\tupperThreshold=this.upperThreshold;\r\n\t\treturn upperThreshold;\r\n\t}", "@Basic\n\t@Raw\n\t@Immutable\n\tpublic static double getVelocityUpperBound() {\n\t\treturn VELOCITYUPPERBOUND;\n\t}", "@Override\n\tprotected double getUpperBound() {\n\t\treturn 0;\n\t}", "public int getLowerBound ();", "protected abstract D getUpper(R range);", "public int upperBoundary(){\r\n\t\treturn yStart - Constants.FLOOR_HEIGHT;\r\n\t}", "public float getUpperBound()\n {\n return fUpperBound;\n }", "boolean impliedByUpperBound(InfinitNumber ubound) {\n\t\treturn ubound.lesseq(mBound);\n\t}", "private static int upperBound(int[] A, int target) {\n int max = A.length;\n int min = -1;\n while (max - min > 1) {\n int mid = ( max + min ) / 2;\n if(A[mid] <= target) {\n min = mid;\n } else {\n max = mid;\n }\n }\n\n return max;\n\n }", "public CategoryBuilder setUpperBound(float upperBound)\n {\n fUpperBound = upperBound;\n return this;\n }", "public abstract double[] getUpperBound();", "public void setUpperPoint(Point upper) {\n this.upper = upper;\n }", "private static int getUpperBound(String expression) {\r\n\t\t\r\n\t\texpression = expression.substring(7, expression.length());\r\n\t\t\r\n\t\treturn new Integer(expression);\r\n\t\t\r\n\t}", "private int getValue(int lowerBound, int upperBound) {\n int problemRange = upperBound - lowerBound + 1;\n\n return lowerBound + rng.nextInt(problemRange);\n }", "public int getLowerBound() {\r\n return lowerBound;\r\n }", "public synchronized int getUpperSizeLimit() {\n \t\treturn upper;\n \t}", "public void addUpperConstraint(String type) {\n\t\tfinal JvmUpperBound constraint = this.jvmTypesFactory.createJvmUpperBound();\n\t\tconstraint.setTypeReference(newTypeRef(this.context, type));\n\t\tgetJvmTypeParameter().getConstraints().add(constraint);\n\t}", "R visitBoundVariable(Formula f, int deBruijnIdx);", "Range controlLimits();", "public void setUpperThreshold(int setUpperThreshold) {\r\n\t\tthis.upperThreshold = setUpperThreshold;\t\t\r\n\t}", "public String getUpperLimit() {\n return upperLimit;\n }", "public int getUpperValue() {\n return getValue() + getExtent();\n }", "public double upper()\n\t{\n\t\treturn _dblUpper;\n\t}", "public InfinitNumber getBound() {\n\t\treturn mBound;\n\t}", "public Point getUpperPoint() {\n return upper;\n }", "public final void mT__191() throws RecognitionException {\n try {\n int _type = T__191;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // ../org.xtext.example.json.ui/src-gen/org/xtext/example/mydsl/ui/contentassist/antlr/internal/InternalMyjson.g:191:8: ( 'upperBound' )\n // ../org.xtext.example.json.ui/src-gen/org/xtext/example/mydsl/ui/contentassist/antlr/internal/InternalMyjson.g:191:10: 'upperBound'\n {\n match(\"upperBound\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public float getLimit_ang_y_upper() throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\treturn __io__block.readFloat(__io__address + 68);\n\t\t} else {\n\t\t\treturn __io__block.readFloat(__io__address + 60);\n\t\t}\n\t}", "public float getLimit_ang_x_upper() throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\treturn __io__block.readFloat(__io__address + 60);\n\t\t} else {\n\t\t\treturn __io__block.readFloat(__io__address + 52);\n\t\t}\n\t}", "public float getLimit_lin_x_upper() throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\treturn __io__block.readFloat(__io__address + 36);\n\t\t} else {\n\t\t\treturn __io__block.readFloat(__io__address + 28);\n\t\t}\n\t}", "public void setHighestVariable(int v) {\n\t\tHighestVariable = (HighestVariable + v);\n\t}", "public void setLowerBound (int lowerBound) throws ModelException;", "public void setUpper(int value) {\n this.upper = value;\n }", "public Delta addStateUpperBoundConstraint(Scope<?> scope, StateModelDefId stateModelDefId,\n State state, int upperBound) {\n return addStateUpperBoundConstraint(scope, stateModelDefId, state,\n Integer.toString(upperBound));\n }", "private int getLowerBound(Object problem, int upperbound)\n {\n Graph tsp = (Graph)problem;\n if (weight == null)\n weight = new double[tsp.size()];\n hki = new HeldKarpIterative( tsp, included, includedT, excluded, excludedT, iterations, weight, upperbound);\n hki.compute();\n tour = hki.isTour();\n bound = hki.getBound();\n hasRun = true;\n// System.out.println(hki.debugDump());\n return bound;\n }", "boolean isBoundVariable(Formula f);", "public abstract DoublePredicate upperPredicate(double upperBound);", "public void setUpperValue(int value) {\n // Compute new extent.\n int lowerValue = getValue();\n int newExtent = Math.min(Math.max(0, value - lowerValue), getMaximum() - lowerValue);\n \n // Set extent to set upper value.\n setExtent(newExtent);\n }", "int selectValue(IntVar v) {\r\n int c = (v.max() + v.min())/2;\r\n return c;\r\n }", "@Test\n public void testIsInLimitUpper() {\n Assertions.assertFalse(saab.isInLimit(.5, 1.5, 2.0));\n }", "public abstract int getMaximumValue();", "private void setMaxThreshold() {\n maxThreshold = value - value * postBoundChange / 100;\n }", "public static VariableSelector<IntVar> maxDomainSize_var_selector() {\n return new AntiFirstFail();\n }", "public float getLimit_lin_y_upper() throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\treturn __io__block.readFloat(__io__address + 44);\n\t\t} else {\n\t\t\treturn __io__block.readFloat(__io__address + 36);\n\t\t}\n\t}", "public void setLimit_ang_y_upper(float limit_ang_y_upper) throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeFloat(__io__address + 68, limit_ang_y_upper);\n\t\t} else {\n\t\t\t__io__block.writeFloat(__io__address + 60, limit_ang_y_upper);\n\t\t}\n\t}", "public Builder addStateUpperBoundConstraint(Scope<?> scope, StateModelDefId stateModelDefId,\n State state, int upperBound) {\n return addStateUpperBoundConstraint(scope, stateModelDefId, state,\n Integer.toString(upperBound));\n }", "public default Type upperBound() throws LookupException {\n return this;\n }", "public V getLowerBound();", "public void setLimit_lin_x_upper(float limit_lin_x_upper) throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeFloat(__io__address + 36, limit_lin_x_upper);\n\t\t} else {\n\t\t\t__io__block.writeFloat(__io__address + 28, limit_lin_x_upper);\n\t\t}\n\t}", "public int getUpper() {\n return upper;\n }", "public void setLimit_ang_x_upper(float limit_ang_x_upper) throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeFloat(__io__address + 60, limit_ang_x_upper);\n\t\t} else {\n\t\t\t__io__block.writeFloat(__io__address + 52, limit_ang_x_upper);\n\t\t}\n\t}", "int getRange();", "public static int getRndInt(int upperBound){\n\t\tRandom randomNumber; \n\t\trandomNumber = new Random(); \n\t\tint z = randomNumber.nextInt(upperBound);\n\t\treturn z;\n\t}", "E maxVal();", "int range(){\n return fuelcap*mpg;\n }", "private double getMarginFromBounds(int lowerBound, int upperBound) {\n return (upperBound - lowerBound) / 2.0;\n }", "public float getLimit_ang_z_upper() throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\treturn __io__block.readFloat(__io__address + 76);\n\t\t} else {\n\t\t\treturn __io__block.readFloat(__io__address + 68);\n\t\t}\n\t}", "public static IntStrategy maxReg_LB(IntVar... VARS) {\n return custom(maxRegret_var_selector(), min_value_selector(), VARS);\n }", "abstract public RandomRange getPlunderRange(Unit attacker);", "public void checkBounds(Scope scope) {\n}", "public GuessingGame(int upperBound) {\n\t\tthis.upperBound = upperBound;\n\t\tthis.secret = getRandomNumber(upperBound);\n\t\tthis.hint = \"I'm thinking of a number between 1 and \" + upperBound;\n\t}", "@Override\n\tprotected void setLowerBound() {\n\t\t\n\t}", "public int getHighestVariable() {\n\t\treturn HighestVariable;\n\t}", "private void validateParameter(){\n\t\tif(hrNum > upperBound){\n\t\t\thrNum = upperBound;\n\t\t}\n\t\telse if(hrNum < lowerBound){\n\t\t\thrNum = lowerBound;\n\t\t}\n\t}", "int range() {\n\t\treturn mpg * fuelcap;\n\t}", "public static IntStrategy lexico_UB(IntVar... VARS) {\n return custom(lexico_var_selector(), max_value_selector(), VARS);\n }", "int getMaximum();", "int getUpper();", "TrackingToken lowerBound();", "public void setLimit_ang_z_upper(float limit_ang_z_upper) throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeFloat(__io__address + 76, limit_ang_z_upper);\n\t\t} else {\n\t\t\t__io__block.writeFloat(__io__address + 68, limit_ang_z_upper);\n\t\t}\n\t}", "public XtypeGrammarAccess.JvmUpperBoundAndedElements getJvmUpperBoundAndedAccess() {\r\n\t\treturn gaXtype.getJvmUpperBoundAndedAccess();\r\n\t}", "public void setUpperLimit(String upperLimit) {\n this.upperLimit = upperLimit == null ? null : upperLimit.trim();\n }", "private void checkBound(int lowerBound, int upperBound) {\n\t\tSet setKeys = Utility.vocabHM.keySet();\n\t\tIterator i = setKeys.iterator();\n\n\t\twhile (i.hasNext()) {\n\t\t\tString s = (String) i.next();\n\t\t\tInteger df = (Integer) Utility.vocabHM.get(s);\n\n\t\t\tif ((df.intValue() <= lowerBound) || (df.intValue() >= upperBound))\n\t\t\t\ti.remove();\n\t\t}\n\t}", "public static VariableSelector<IntVar> minDomainSize_var_selector() {\n return new FirstFail();\n }", "public int GetMaxVal();", "@Override\n public void setSoftUpperLimit(double position)\n {\n final String funcName = \"setSoftUpperLimit\";\n\n if (debugEnabled)\n {\n dbgTrace.traceEnter(funcName, TrcDbgTrace.TraceLevel.API, \"position=%f\", position);\n dbgTrace.traceExit(funcName, TrcDbgTrace.TraceLevel.API);\n }\n\n softUpperLimit = position;\n }", "public IntegerValue[] getIntegerBoundsForVariable() {\n return select.getIntegerBounds();\n }", "IntVar selectVariable(IntVar[] v) {\r\n\r\n if (v.length != 0) {\r\n int index = 0;\r\n int smallestDomain = Integer.MAX_VALUE;\r\n for(int i = 0; i< v.length-1; i++){\r\n if(v[i].domain.getSize()<smallestDomain){\r\n index = i;\r\n smallestDomain = v[i].domain.getSize();\r\n }\r\n\r\n }\r\n if(v[index].min() == v[index].max()){\r\n\r\n searchVariables = new IntVar[v.length-1];\r\n for (int i = 0; i < v.length-1; i++) {\r\n if(i<index){\r\n searchVariables[i] = v[i];\r\n }\r\n else searchVariables[i] = v[i+1];\r\n\r\n }\r\n }\r\n else{\r\n searchVariables = new IntVar[v.length];\r\n for(int i = 0; i < v.length; i++){\r\n searchVariables[i] = v[i];\r\n }\r\n }\r\n return v[index];\r\n\r\n }\r\n else {\r\n System.err.println(\"Zero length list of variables for labeling\");\r\n return new IntVar(store);\r\n }\r\n }", "public boolean isUpperLimit() {\n if (m_upperLimit != null) {\n return m_upperLimit.get();\n } else {\n return false;\n }\n }", "public XtypeGrammarAccess.JvmUpperBoundAndedElements getJvmUpperBoundAndedAccess() {\n\t\treturn gaXtype.getJvmUpperBoundAndedAccess();\n\t}", "public XtypeGrammarAccess.JvmUpperBoundAndedElements getJvmUpperBoundAndedAccess() {\n\t\treturn gaXtype.getJvmUpperBoundAndedAccess();\n\t}", "public UpperBoundTypeElements getUpperBoundTypeAccess() {\n\t\treturn pUpperBoundType;\n\t}", "int getBoundsY();", "private int randomGen(int upperBound) {\n\t\tRandom r = new Random();\n\t\treturn r.nextInt(upperBound);\n\t}", "public void setLimit_lin_y_upper(float limit_lin_y_upper) throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeFloat(__io__address + 44, limit_lin_y_upper);\n\t\t} else {\n\t\t\t__io__block.writeFloat(__io__address + 36, limit_lin_y_upper);\n\t\t}\n\t}", "private double applyLimitBounds(double value) {\n if(value > 1.0) {\n value = 1.0;\n }\n if(value < -1.0) {\n value = -1.0;\n }\n\n // Absolute limits:\n if(lifter.getBottomLimit() && lifter.getUpperLimit()) {\n if(value < 0) {\n value = 0; // Can't go down from the bottom;\n }\n }\n\n if((lifter.getUpperLimit() && lifter.getUpperWarning()) && lifter.getUpperSmallPieceDetector()) {\n if(value > 0) {\n value = 0; // Can't go up from the top\n }\n }\n\n // Slow speed zones\n if(lifter.getBottomWarning()) {\n if(value < -0.3) {\n value = -0.3;\n }\n }\n\n if(lifter.getUpperWarning()) {\n if(value > 0.7) {\n value = 0.7;\n }\n }\n\n printLimits();\n\n return value;\n }", "public int getMaxRangeEnd() {\n return maximumViewableRange.getTo();\n }", "protected final void setMax() {\n\n\tint prevmax = this.max;\n\n\tint i1 = this.high;\n\tint i2 = left.max;\n\tint i3 = right.max;\n\n\tif ((i1 >= i2) && (i1 >= i3)) {\n\t this.max = i1;\n\t} else if ((i2 >= i1) && (i2 >= i3)) {\n\t this.max = i2;\n\t} else {\n\t this.max = i3;\n\t}\n\t\n\tif ((p != IntervalNode.nullIntervalNode) &&\n\t (prevmax != this.max)) {\n \t p.setMax();\n\t}\n }", "public KunyarukGame(int upperbound) {\n\t\tthis.upperBound = upperbound;\n\t\tlong seed = System.nanoTime();\n\t\tRandom ran = new Random(seed);\n\t\tthis.secret = ran.nextInt(this.upperBound) + 1;\n\t\tsuper.setMessage(\"Can you guess a number between 1 and \"+this.upperBound+\" that I'm thinking of?\");\n\t}" ]
[ "0.70329005", "0.68754476", "0.68164694", "0.6741833", "0.6658067", "0.6605872", "0.65912724", "0.65516484", "0.65268", "0.6462147", "0.64512956", "0.64073503", "0.6257749", "0.6238858", "0.62370235", "0.61465704", "0.6087217", "0.60842407", "0.60773474", "0.6055799", "0.60488033", "0.60268056", "0.59803504", "0.5974773", "0.5950668", "0.59456706", "0.592749", "0.5920696", "0.58759946", "0.5873295", "0.5866629", "0.5859502", "0.5853878", "0.58152324", "0.5792166", "0.5762858", "0.5759858", "0.5746697", "0.5739382", "0.5738887", "0.57161003", "0.57102937", "0.57063097", "0.569403", "0.5681706", "0.5680899", "0.5653574", "0.5650831", "0.56495196", "0.56479967", "0.56368536", "0.5628178", "0.5608709", "0.5599526", "0.55934733", "0.5590367", "0.556707", "0.5566169", "0.5563455", "0.5555242", "0.5548146", "0.5533581", "0.55223364", "0.55090785", "0.5506852", "0.54948175", "0.5491613", "0.54868674", "0.5463456", "0.54324937", "0.54235506", "0.5422275", "0.54171085", "0.5410728", "0.54019463", "0.540132", "0.54008865", "0.53886753", "0.5388118", "0.53871864", "0.5372762", "0.53725654", "0.5365948", "0.53515315", "0.53442955", "0.5339036", "0.53363633", "0.53301966", "0.5329864", "0.53286093", "0.5319868", "0.5312343", "0.5312343", "0.53120345", "0.5306726", "0.52891886", "0.5283383", "0.52616125", "0.5261462", "0.52516556", "0.52421415" ]
0.0
-1
Selects randomly a value in the variable domain. Takes an arbitrary value in [LB,UB] BEWARE: this should not be used within assignments and/or value removals if variables have a bounded domain.
public static IntValueSelector random_value_selector(long SEED) { return new IntDomainRandom(SEED); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static IntStrategy random_value(IntVar[] VARS, long SEED) {\n for (IntVar v : VARS) {\n if (!v.hasEnumeratedDomain()) {\n throw new UnsupportedOperationException(\"Some variables have bounded domains, \" +\n \"please use random heuristic instead\");\n }\n }\n return custom(random_var_selector(SEED), random_value_selector(SEED), VARS);\n }", "public static VariableSelector<IntVar> random_var_selector(long SEED) {\n return new Random<>(SEED);\n }", "T getRandomAllowedValue();", "private static Option pickRandom() {\n\t\treturn Option.values()[rand.nextInt(3)];\n\t}", "public int getRandom(int bound) {\n return ThreadLocalRandom.current().nextInt(bound);\n }", "public static IntStrategy random_value(IntVar[] VARS) {\n return random_value(VARS, 0);\n }", "public void setToRandomValue(RandomGenerator a_numberGenerator) {\n // maps the randomly determined value to the current bounds.\n // ---------------------------------------------------------\n setAllele(new Float( (m_upperBound - m_lowerBound) *\n a_numberGenerator.nextFloat() + m_lowerBound));\n }", "private void getRandomNumber() {\n\t\tRandom generator = new Random();\n\t\trandomNumber = generator.nextInt(POSSIBLE_CHOICE.length);\n\t}", "protected Random get_rand_value()\n {\n return rand;\n }", "private int randomValue() {\r\n\t\tRandom rand = new Random();\r\n\t\tint val = rand.nextInt(10);\r\n\t\tif(val == 9)\r\n\t\t\treturn 4;\r\n\t\telse\r\n\t\t\treturn 2;\r\n\t}", "@Override\r\n public Double getValue() {\r\n return Math.random()*Integer.MAX_VALUE;\r\n \r\n }", "public static Object getRandom(Object... kv)\n {\n return getRandom(distributeChance(kv));\n }", "public static Position getRandomPosition() {\n\t\tRandom rand = new Random();\n\t\treturn values()[rand.nextInt(values().length)];\n\t}", "static public Long randomval() {\n Random rand = new Random();\n Long val = rand.nextLong() % p;\n return val;\n }", "public void set_random_choice()\r\n\t{\r\n\t\tfor (int i=0 ; i<size ; i++)\r\n\t\t{\r\n\t\t\tnumbers.add(get_not_selected_random_digit());\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic void setComputerValue() {\n\t\trps.setCom((int) (Math.random() * 3 + 1));\r\n\t}", "public RandomVaries(String name, int probability, float minUnits, float maxUnits){\n super(name);\n this.probability=probability;\n if(minUnits<0)generator=true;\n this.minUnits=Math.abs(minUnits);\n this.maxUnits=Math.abs(maxUnits);\n }", "private double getRandomNumber(){\n double rand = Math.random();//produce a number between 0 and 1\n rand = rand - 0.5;\n return rand;\n }", "public int getRandom() {\n // get a random integer from [0, n) where n is the size of the value list\n return values.get(random.nextInt(values.size()));\n }", "public int getRandom() {\n int index = rnd.nextInt(list.size());\n return list.get(index).val;\n }", "protected String random(String value) {\n \t\treturn value + new Random().nextInt(100);\n \t}", "private int randomGen(int upperBound) {\n\t\tRandom r = new Random();\n\t\treturn r.nextInt(upperBound);\n\t}", "public int getRandom() {\n return sub.get(rand.nextInt(sub.size()));\n }", "public static EnumCardNumber pickRandom() {\r\n\t\treturn values()[Tools.Numbers.randomInt(0, values().length - 1)];\r\n\t}", "@Test\n public void testVar() {\n System.out.println(\"var\");\n NegativeBinomialDistribution instance = new NegativeBinomialDistribution(3, 0.3);\n instance.rand();\n assertEquals(7/0.3, instance.var(), 1E-7);\n }", "private void setRand(){\n rand = generator.nextInt(9) + 1;\n }", "Chromosome getRandom();", "public int getRandom() {\n return lst.get(rand.nextInt(lst.size()));\n }", "public Position sampleRandomUniformPosition();", "private int choose(){\n\t\tdouble temp = 10 * Math.random();\n\t\tint i = (int)temp;\n\t\treturn i;\n\t}", "private double getRandom() {\n return 2*Math.random() - 1;\n }", "public int getRandom() {\n int randomIdx = random.nextInt(valueList.size());\n return valueList.get(randomIdx);\n }", "public static double rangedRandom(double a){\n\t\treturn -a + Calc.random(a * 2);\n\t}", "public static Lieferart getRandomLieferart() {\n\t\treturn VALUES[RANDOM.nextInt(SIZE)];\n\t}", "Point getRandomPoint() {\n\t\t\t\t\tdouble val = Math.random() * 3;\n\t\t\t\t\tif (val >=0.0 && val <1.0)\n\t\t\t\t\t\treturn p1;\n\t\t\t\t\telse if (val >=1.0 && val <2.0)\n\t\t\t\t\t\t\treturn p2;\n\t\t\t\t\telse\n\t\t\t\t\t\t\treturn p3;\n\t\t\t\t\t}", "public double getRandom(){\n\t\treturn random.nextDouble();\n\t}", "public int getRandom() {\n Random rand = new Random();\n int idx = rand.nextInt(validLength);\n return set.get(idx);\n }", "private static <T> T randomValue(T[] values) {\n return (values != null && values.length > 0) ?\n values[RandomUtils.nextInt(0, values.length)] :\n null;\n }", "public int getRandom382() {\n int count = 0, chosenValue = 0;\n ListNode curr = this.head;\n while (curr != null) {\n count += 1;\n // decide whether to include the element in reservoir\n if (rand.nextInt(count) == 0) chosenValue = curr.val;\n // move on to the next node\n curr = curr.next;\n }\n return chosenValue;\n }", "public void setRandomValues(float avg, float distr) {\n\t\tfor(int i = 0; i < size; i++)\n\t\t\tvector[i] = avg+MathUtils.randomTriangular()*distr;\n\t}", "public Element setToRandom() {\n this.value = Math.abs(ThreadSecureRandom.get().nextLong()) % field.order;\n\n return mod();\n }", "public static Double[] mutate(Double[] genotype) {\n\t\tRandom random = new Random();\n\t\tint position = random.nextInt(variableNum);\n\t\tgenotype[position]+=((Math.random()-0.5)*mutateVal);\n\t\tif(genotype[position] > maxValue) genotype[position] = maxValue;\n\t\tif(genotype[position] < minValue) genotype[position] = minValue;\n\t\treturn genotype;\n\t}", "public void setRandom(Random r) {\n this.r = r;\n }", "public void generateRandomVaraibles() {\r\n\r\n\t\tfor (DataVariable var : dataTestModel) {\r\n\t\t\tif (!var.getType().equals(\"LOCAL_DATA\") && !var.getType().equals(\"OUTPUT_DATA\")) {\r\n\t\t\t\tif (var.getType().equals(\"boolean\") || var.getType().equals(\"Boolean\")) {\r\n\t\t\t\t\tvar.setValue(String.valueOf(getRandomBoolean()));\r\n\r\n\t\t\t\t} else if (var.getType().equals(\"int\")) {\r\n\t\t\t\t\tif (var.getMinimumValue() != null && var.getMinimumValue().length() > 0\r\n\t\t\t\t\t\t\t&& var.getMaximumValue() != null && var.getMaximumValue().length() > 0) {\r\n\t\t\t\t\t\tvar.setValue(String.valueOf(randomInt(Integer.parseInt(var.getMinimumValue()),\r\n\t\t\t\t\t\t\t\tInteger.parseInt(var.getMaximumValue()))));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar.setValue(String.valueOf(randomInt(0, 100)));\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (var.getType().equals(\"double\")) {\r\n\t\t\t\t\tif (var.getMinimumValue() != null && var.getMinimumValue().length() > 0\r\n\t\t\t\t\t\t\t&& var.getMaximumValue() != null && var.getMaximumValue().length() > 0) {\r\n\t\t\t\t\t\tvar.setValue(String.valueOf(randomDouple(Double.parseDouble(var.getMinimumValue()),\r\n\t\t\t\t\t\t\t\tDouble.parseDouble(var.getMaximumValue()))));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar.setValue(String.valueOf(randomDouple(0.0, 100.0)));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}", "default void setRandomModifier(double value, int duration){\n Random random = new Random();\n Modifier.ModifierType[] modifierTypes = Modifier.ModifierType.values();\n Modifier.ModifierType randomType = modifierTypes[random.nextInt(modifierTypes.length)];\n Modifier randomModifier = new Modifier(randomType, value, duration);\n this.setModifier(randomModifier);\n }", "public int a(Random var1)\r\n {\r\n return 0;\r\n }", "public float randomQual() {\n\t\treturn((float) getRandomInteger(30,250));\n\t}", "public static VariableSelector<IntVar> minDomainSize_var_selector() {\n return new FirstFail();\n }", "public static VariableSelector<IntVar> maxDomainSize_var_selector() {\n return new AntiFirstFail();\n }", "public int getRandom() {\r\n var list = new ArrayList<>(set);\r\n return list.get(new Random().nextInt(set.size()));\r\n }", "public int getRandom() {\n int x=rand.nextInt(li.size());\n return li.get(x);\n }", "@Override\n\tpublic void setToRandomValue(RandomGenerator a_numberGenerator) {\n\n\t}", "protected NNode getRandomNode() {\n\t\tArrayList<NNode> nodearr = new ArrayList<NNode>();\n\t\tnodearr.addAll(nodes.values());\n\t\treturn nodearr.get(Braincraft.randomInteger(nodearr.size()));\n\t}", "public void randomize() {\r\n\t\tif(randomizzatoreVariazione > 0.5)\r\n\t\t\tandamentoCurva.setVariazione(\r\n\t\t\t\t\tandamentoCurva.getVariazione() * randomizzatoreVariazione\r\n\t\t\t\t\t+ andamentoCurva.getMIN_VARIAZIONE()\r\n\t\t\t\t\t+ Math.random() * (andamentoCurva.getMAX_VARIAZIONE() - andamentoCurva.getMIN_VARIAZIONE())\r\n\t\t\t);\r\n\t\telse if(randomizzatoreVariazione < 0.5)\r\n\t\t\tandamentoCurva.setVariazione(\r\n\t\t\t\t\tandamentoCurva.getVariazione()\r\n\t\t\t\t\t- andamentoCurva.getMIN_VARIAZIONE()\r\n\t\t\t\t\t+ Math.random() * (andamentoCurva.getMAX_VARIAZIONE() - andamentoCurva.getMIN_VARIAZIONE() * randomizzatoreVariazione)\r\n\t\t\t);\r\n\t}", "public static RuntimeValue sample(RuntimeValue value) throws RuntimeException {\n if (isDistribution(value)) {\n Distribution distribution = value.getDistribution();\n\n if (distribution instanceof BernoulliDistribution) {\n return new RuntimeValue(\n RuntimeValue.Type.DISCRETE_INT_SAMPLE,\n distribution.sample()\n );\n }\n\n if (distribution instanceof FlipDistribution) {\n return new RuntimeValue(\n RuntimeValue.Type.DISCRETE_BOOL_SAMPLE,\n distribution.sample()\n );\n }\n\n if (distribution instanceof ContinuousDistribution) {\n return new RuntimeValue(\n RuntimeValue.Type.CONTINUOUS_SAMPLE,\n distribution.sample()\n );\n }\n }\n\n throw new RuntimeException(\"Unable to sample value\");\n }", "public static void selectionShuffle(int[] values) {\r\n\t\tfor(int i = (values.length - 1); i >= 0; i--) //array is traversed dtarting from last position\r\n\t\t{\r\n\t\t\tint rand = (int)(Math.random() * (values.length -1)); //random var in array\r\n\t\t\tint shuff = values[i]; //stores last element in a placeholder\r\n\t\t\tvalues[i] = values[rand]; //replaces the element with a random location\r\n\t\t\tvalues[rand] = shuff; //replaces the random location with the last element stored in shuff\r\n\t\t}\r\n\t}", "public int getRandom() {\n ListNode pick = null;\n ListNode p = head;\n int count = 1;\n while (p != null) {\n if (rand.nextInt(count) == 0) {\n pick = p;\n }\n p = p.next;\n count++;\n }\n return pick.val;\n }", "protected void randInitialize(Variable variable) {\n if (variable instanceof Combining) {\n Combining comb = (Combining) variable;\n comb.setValue(pprng.nextInt(comb.getNumberOfAlternatives()));\n } else if (variable instanceof Assigning) {\n //this covers initialization for both assigning and connecting\n Assigning assign = (Assigning) variable;\n for (int i = 0; i < assign.getNumberOfLHS(); i++) {\n for (int j = 0; j < assign.getNumberOfRHS(); j++) {\n if(pprng.nextBoolean())\n assign.connect(i,j);\n }\n }\n// assign.connect(0,0);\n// assign.connect(6,0);\n// assign.connect(7,0);\n// assign.connect(11,0);\n// assign.connect(1,1);\n// assign.connect(6,1);\n// assign.connect(10,1);\n// assign.connect(5,2);\n// assign.connect(6,2);\n// assign.connect(4,3);\n// assign.connect(5,3);\n// assign.connect(11,3);\n// assign.connect(5,4);\n// assign.connect(7,4);\n// assign.connect(8,4);\n// assign.connect(9,4);\n// assign.connect(10,4);\n \n } else {\n System.err.println(\"can not initialize unknown type\");\n }\n }", "private IUnit getRandomListUnit(){\n\t\treturn unitList.get(rnd.nextInt(unitListSize()));\n\t}", "public static int getRandom() \n\t{\n\t\treturn rGenerator.nextInt();\n\t}", "public void chooseWord() {\n int length = words.size();\n int index = (int) ((length - 1) * Math.random());\n word = words.get(index);\n }", "public String chooseWord(){\n\t\tRandom a = new Random();\t\t\r\n\t\t\r\n\t\tint randomNumber = a.nextInt(words.length);\r\n\t\t\r\n\t\tString gameWord = words[randomNumber];\r\n\t\t\r\n\t\treturn gameWord;\r\n\t\t\t\t\r\n\t}", "public static int getRndInt(int upperBound){\n\t\tRandom randomNumber; \n\t\trandomNumber = new Random(); \n\t\tint z = randomNumber.nextInt(upperBound);\n\t\treturn z;\n\t}", "public static double random() {\r\n return uniform();\r\n }", "public void generateComputerChoice() {\n\t\tgetRandomNumber();\n\t\tsetComputerChoice();\n\t}", "private void initializeStateWithRandomValues(Assignment x, List<RandomVariable> Z){\n for (RandomVariable Zi: Z){\n Object randomValue = Zi.getDomain().get(new Random().nextInt(Zi.getDomain().size()));\n x.set(Zi, randomValue);\n\n }\n }", "public void randomize() {\n\t\tx = ThreadLocalRandom.current().nextInt(0, 499 + 1);\n\t\ty = ThreadLocalRandom.current().nextInt(0, 499 + 1);\n\t}", "protected <E> String selectUnassignedVariable(CSP<E> csp, Assignment<E> assignment) {\r\n\t\tList<String> unassigned= new ArrayList<String>(); \r\n\t\tfor(String i:csp.variables){\r\n\t\t\tif(!assignment.containsKey(i)){\r\n\t\t\t\tunassigned.add(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tRandom random = new Random();\r\n\t\tint rand=random.nextInt(unassigned.size());\r\n\t\treturn unassigned.get(rand);\r\n\t}", "public static char casillaRandom() {\r\n char pool[] = {'b', 'p', 's', 'd'};\r\n\r\n int indiceRandom = (int) (Math.random() * 4);\r\n\r\n char selected = pool[indiceRandom];\r\n\r\n return selected;\r\n }", "private int RandomResourceValue(int playerNumber) {\n\t\tArrayList<Integer> excludedNumbers = new ArrayList<>();\n\t\tfor (int i = 0; i < CurrentPlayer.resources.length; i++) {\n\t\t\tif (robberPlayers.get(playerNumber).resources[i] == 0)\n\t\t\t\texcludedNumbers.add(i);\n\t\t}\n\t\tRandom r = new Random();\n\t\tint randomVariable = 0;\n\t\trandomVariable = r.nextInt(5 - 0) + 0;\n\n\t\tif (excludedNumbers.size() < 5) {\n\t\t\twhile (excludedNumbers.contains(randomVariable)) {\n\t\t\t\trandomVariable = r.nextInt(5 - 0) + 0;\n\t\t\t}\n\t\t}\n\t\treturn randomVariable;\n\t}", "public int getRandom() {\n return _list.get( rand.nextInt(_list.size()) );\n }", "private int randomValue(int value, int distance)\n {\n int pos = rand.nextInt(2) > 0 ? 1 : -1;\n int newValue = value + pos * rand.nextInt(distance);\n\n if(newValue > 255 || newValue < 0)\n {\n return randomValue(value, distance);\n }\n\n return newValue;\n }", "public void setRandomX(int x) {\r\n\t\tthis.x1 = (int) (Math.random()*1000);\r\n\t}", "public void setRnd (java.lang.String rnd) {\r\n\t\tthis.rnd = rnd;\r\n\t}", "RandomizedRarestFirstSelector(Random random) {\n this.random = random;\n }", "public static int computerChoice(Random generator){\n int randNumber;\n \n randNumber = generator.nextInt(5);\n return randNumber;\n }", "private static int get() { \r\n Random r = new Random();\r\n return (r.nextInt(9));\r\n }", "IntVar selectVariable(IntVar[] v) {\r\n\r\n if (v.length != 0) {\r\n int index = 0;\r\n int smallestDomain = Integer.MAX_VALUE;\r\n for(int i = 0; i< v.length-1; i++){\r\n if(v[i].domain.getSize()<smallestDomain){\r\n index = i;\r\n smallestDomain = v[i].domain.getSize();\r\n }\r\n\r\n }\r\n if(v[index].min() == v[index].max()){\r\n\r\n searchVariables = new IntVar[v.length-1];\r\n for (int i = 0; i < v.length-1; i++) {\r\n if(i<index){\r\n searchVariables[i] = v[i];\r\n }\r\n else searchVariables[i] = v[i+1];\r\n\r\n }\r\n }\r\n else{\r\n searchVariables = new IntVar[v.length];\r\n for(int i = 0; i < v.length; i++){\r\n searchVariables[i] = v[i];\r\n }\r\n }\r\n return v[index];\r\n\r\n }\r\n else {\r\n System.err.println(\"Zero length list of variables for labeling\");\r\n return new IntVar(store);\r\n }\r\n }", "public static String randomSelection() {\n int min = 1;\n int max = 3;\n String randomSelection;\n Random random = new Random(System.currentTimeMillis());\n int randomNumber = random.nextInt((max - min) +1) +min;\n if(randomNumber == 1) {\n randomSelection = \"rock\";\n } else if (randomNumber == 2) {\n randomSelection = \"paper\";\n } else {\n randomSelection = \"scissors\";\n }\n return randomSelection;\n }", "public int getRandomInt(int upper) {\n int retVal = myRandom.nextInt() % upper;\n if (retVal < 0) {\n retVal += upper;\n }\n return (retVal);\n }", "public int getRandom() {\n Integer ans = null;\n while (ans == null) {\n int r = random.nextInt(size);\n ans = allSet[r];\n if (!realSet.contains(ans)) {\n ans = allSet[r] = null;\n }\n }\n return ans;\n }", "public int getRandom() {\n return A.get(r.nextInt(A.size()));\n }", "public int getRandom() {\n int idx;\n Random rand;\n \n rand = new Random();\n idx = rand.nextInt(set.size());\n return set.get(idx);\n }", "int getRandom(int limit){\n Random rand = new Random();\n int upperBound = limit;\n return rand.nextInt(upperBound) + 1;\n }", "public void SetRandom(boolean random);", "private void selectRandomPlayer() {\n Random rand = new Random();\n // Restrict random number range to available indexes in the players list.\n // - 1 to offset zero-based index numbering.\n int random = rand.nextInt(players.size());\n activePlayer = players.get(random);\n }", "public static Ally getRandomRep () {\n return republican[(int) (Math.random() * republican.length)];\n }", "public String getRandom() {\n\t return word.get(new Random().nextInt(word.size()));}", "int getRandom(int max);", "public abstract void randomize();", "public final void rand() {\n\t\tpush(randomNumberGenerator.nextDouble());\n\t}", "public int getRandom() {\n return nums.get(rand.nextInt(nums.size()));\n }", "public void b(World var1, int var2, int var3, int var4, Random var5)\n {\n if (var5.nextInt(10) == 0)\n {\n var1.setRawTypeId(var2, var3, var4, this.this$0.gildedlilyId);\n }\n }", "public static int getRandomAmount(){\n return rand.nextInt(1000);\n }", "public int getRandom() {\n return nums.get(random.nextInt(nums.size()));\n }", "static int getRandomDelta() {\n int d = rand.nextInt(100);\n if (d < 50) {\n return -1;\n } else {\n return 1;\n }\n }", "private static String getRandomType(){\r\n int index = r.nextInt(typeOfRooms.length);\r\n return typeOfRooms[index];\r\n }", "public Random getRandom() {\n\t\treturn (rand);\n\t}", "@Override\r\n\tpublic Item sample() {\r\n\t\tint index = StdRandom.uniform(count);\r\n\t\tItem item = arr[index];\r\n\t\treturn item;\r\n\t}", "public int getRandom() {\n return nums.get(random.nextInt(nums.size()));\n }" ]
[ "0.6533772", "0.6392203", "0.6176287", "0.59378076", "0.5850717", "0.57747996", "0.57593465", "0.5666234", "0.5662626", "0.5608057", "0.5546634", "0.54710555", "0.54633904", "0.54434216", "0.54359055", "0.5430481", "0.5413953", "0.5384175", "0.5382783", "0.53729206", "0.5369889", "0.53676224", "0.53434885", "0.53361356", "0.5321127", "0.5319343", "0.5316753", "0.53087956", "0.5303438", "0.52918214", "0.5270881", "0.526472", "0.5254117", "0.52377874", "0.5222705", "0.52188617", "0.5213891", "0.5205589", "0.5188228", "0.51787966", "0.5177796", "0.51775074", "0.51543057", "0.51508015", "0.51353854", "0.5132533", "0.51238364", "0.51198465", "0.51100326", "0.5109616", "0.51075166", "0.51042545", "0.51040214", "0.5097175", "0.50964946", "0.50943613", "0.5088394", "0.50814605", "0.5063373", "0.5063094", "0.50530344", "0.50521195", "0.5051705", "0.5049552", "0.504861", "0.50474006", "0.5046827", "0.504453", "0.5037355", "0.50271606", "0.5025632", "0.50236917", "0.5013292", "0.5010012", "0.5005933", "0.5004049", "0.49949333", "0.49935058", "0.49878794", "0.4987769", "0.49834073", "0.497715", "0.49747962", "0.49742442", "0.49742365", "0.49727368", "0.49685356", "0.49673146", "0.49672937", "0.49633458", "0.4959062", "0.49555367", "0.49524838", "0.49378955", "0.49330017", "0.492716", "0.492305", "0.49209228", "0.49191985", "0.49160597" ]
0.59742326
3
OPERATORS Assign the selected variable to the selected value e.g. X = 42 If this decision fails, it is automatically negated (i.e. X != 42)
public static DecisionOperator<IntVar> assign() { return DecisionOperator.int_eq; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract boolean setValue(Value value, boolean asAssignment);", "private Term parseAssign(final boolean required) throws ParseException {\n Term t1 = parseConditional(required);\n while (t1 != null) {\n int tt = _tokenizer.next();\n if (tt == '=') {\n Term t2 = parseAssign(true);\n if (t1 instanceof Term.Ref && ((Term.Ref) t1).getVariable() != null) {\n t1 = new Term.Assign(t1, t2);\n } else {\n reportError(\"Variable expected on the left side of assignment '='.\");\n }\n } else {\n _tokenizer.pushBack();\n break;\n }\n }\n return t1;\n }", "@Override\n public Integer visitAssign(CalculatorParser.AssignContext ctx) {\n String id = ctx.ID().getText(); // id is left-hand side of '='\n int value = visit(ctx.expr()); // compute value of expression on right\n memory.put(id, value); // store it in memory\n return value;\n }", "@Override\n public Operator visitAssign(Assign operator)\n {\n throw new AssertionError();\n }", "public Expression assign(String var, Expression expression) {\r\n // if this variable is val no meter if is capital or small letter.\r\n if (this.variable.equalsIgnoreCase(var)) {\r\n return expression;\r\n }\r\n return this;\r\n }", "@Override\n public Expression assign(String var, Expression expression) {\n return new Minus(getExpression1().assign(var, expression), getExpression2().assign(var, expression));\n }", "void setActiveOperand(double activeOperand);", "assign_op getAssign_op();", "public void setOperandA(int val);", "VarAssignment createVarAssignment();", "public boolean assignVariable(Scanner scan){\n\t\tif (scan.hasNext(\"\\\\=\")){\n\t\t\tif (!Parser.gobble(\"\\\\=\", scan)){ Parser.fail(\"Should have = for variables.\", scan); }\n\t\t\texpr = new Expression();\n\t\t\texpr.parse(scan);\t\t\t\t\t\t//Assignment\n\t\t\tif (!Parser.gobble(\"\\\\;\", scan)){ Parser.fail(\"Should have ; for variables.\", scan); }\n\t\t\t//Add to map\n\t\t\tParser.variables.put(name, this);\n\t\t\treturn true;\n\t\t} else if (scan.hasNext(\"\\\\;\")){\t//DECLARED NOT ASSIGNMENT\n\t\t\tif (!Parser.gobble(\"\\\\;\", scan)){ Parser.fail(\"Should have ; for variables.\", scan); }\n\t\t\t/*\t\t\tNum number = new Num();\n\t\t\tnumber.numberNodeZero();\n\t\t\texpr = number;\t\t\t\t\t//sets expr to 0. \n\t\t\t */\t\t\treturn true; \t\t\t\t\t//Shouldnt set it to 0 if there is already variable in map\n\t\t}\n\t\treturn false;\n\t}", "@Override\r\n\tpublic Object visit(YoyooAssignmentOperator node, Object data) {\r\n\t\tassignOptMark = new OperatorMark(node.first_token.image);\r\n\t\treturn null;\r\n\t}", "@Override\n public CodeFragment visitAssignmentStat(AlangParser.AssignmentStatContext ctx) {\n String name = ctx.ID().getText();\n if (!variableExists(name)) {\n this.addError(ctx, name, \"Assignment to undeclared variable\");\n return new CodeFragment(\"\");\n }\n\n Variable v = this.globals.get(name);\n v.setValue(ctx.global_expression().getText());\n v.setHasValue();\n\n return new CodeFragment(\"\");\n }", "public void assignValue (String variable, String x) {\n Map.Entry<String, Value> var = findVariable(variable);\n if (var != null) {\n if (var.getValue().getType() == Value.Type.STRING)\n var.getValue().setValue(x);\n else if (var.getValue().getType() == Value.Type.REAL && x.contains(\".\"))\n try {\n var.getValue().setValue(Double.parseDouble(x));\n } catch (Exception e) {\n throw new RuntimeException(\"Error Type mismatch\");\n }\n else if (var.getValue().getType() == Value.Type.INT)\n try {\n var.getValue().setValue(Integer.parseInt(x));\n } catch (Exception e) {\n throw new RuntimeException(\"Error Type mismatch\");\n }\n else if (var.getValue().getType() == Value.Type.BOOL) {\n try {\n var.getValue().setValue(Boolean.parseBoolean(x));\n } catch (Exception e) {\n throw new RuntimeException(\"Error Type mismatch\");\n }\n } else\n throw new RuntimeException(\"Error: Type mismatch\");\n } else {\n throw new RuntimeException(\"Error: Variable was not declared\");\n }\n }", "@Override\n public void visit(VariableAssignNode variableAssignNode) {\n }", "@Override\n public Void visit(AssignmentExpression nd, SuccessorInfo i) {\n if (\"&&=\".equals(nd.getOperator()) || \"||=\".equals(nd.getOperator()) || \"??=\".equals(nd.getOperator())) {\n if (\"&&=\".equals(nd.getOperator())) {\n // from lhs to rhs on truthy. from lhs to false-branch on falsy.\n visitWithSuccessors(nd.getLeft(), First.of(nd.getRight()), i.getSuccessors(false));\n } else if (\"||=\".equals(nd.getOperator())) {\n // from lhs to true-branch on truthy. from lhs to rhs on falsy.\n visitWithSuccessors(nd.getLeft(), i.getSuccessors(true), First.of(nd.getRight()));\n } else { // \"??=\"\n // the union of the above - truthyness is unknown.\n visitWithSuccessors(nd.getLeft(), union(First.of(nd.getRight()), i.getAllSuccessors()));\n }\n \n visitWithSuccessors(nd.getRight(), nd); // from right to assignment.\n\n writeSuccessors(nd, i.getGuardedSuccessors(nd));\n } else {\n visitAssign(nd, nd.getLeft(), nd.getRight());\n writeSuccessors(nd, i.getGuardedSuccessors(nd));\n }\n return null;\n }", "@Test\n\tpublic void testAssignment(){\n\t\tVariable x = new Variable(\"x\");\n\t\tOperator plus = new Operator(\"+\");\n\t\tExpression one = f.createNumNode(1);\n\t\tExpression two = f.createNumNode(2);\n\t\tExpression exp = f.createInfixNode(plus, one, two);\n\t\tStatement assign = f.createAssignNode(x,exp);\n\t\tassertEquals(assign.textRepresentation(), \"x = 1 + 2;\");\n\t\n\t\tASTNodeCountVisitor v = new ASTNodeCountVisitor();\n\t\tassign.accept(v);\n\t\tassertEquals(\"assignment test1 fail\", v.numCount, 2);\n\t\tassertEquals(\"assignment test2 fail\", v.infixCount, 1);\n\t\tassertEquals(\"assignment test3 fail\", v.assignCount, 1);\n\t}", "private void assignment() {\n\n\t\t\t}", "protected Assign assign(Position pos, Expr e, Assign.Operator asgn, Expr val) throws SemanticException {\n Assign a = (Assign) xnf.Assign(pos, e, asgn, val).type(e.type());\n if (a instanceof FieldAssign) {\n assert (e instanceof Field);\n assert ((Field) e).fieldInstance() != null;\n a = ((FieldAssign) a).fieldInstance(((Field)e).fieldInstance());\n } else if (a instanceof SettableAssign) {\n assert (e instanceof X10Call);\n X10Call call = (X10Call) e;\n List<Expr> args = CollectionUtil.append(Collections.singletonList(val), call.arguments());\n X10Call n = xnf.X10Call(pos, call.target(), nf.Id(pos, SettableAssign.SET), call.typeArguments(), args);\n n = (X10Call) n.del().disambiguate(this).typeCheck(this).checkConstants(this);\n X10MethodInstance smi = n.methodInstance();\n X10MethodInstance ami = call.methodInstance();\n // List<Type> aTypes = new ArrayList<Type>(ami.formalTypes());\n // aTypes.add(0, ami.returnType()); // rhs goes before index\n // MethodInstance smi = xts.findMethod(ami.container(),\n // xts.MethodMatcher(ami.container(), SET, aTypes, context));\n a = ((SettableAssign) a).methodInstance(smi);\n a = ((SettableAssign) a).applyMethodInstance(ami);\n }\n return a;\n }", "public static BinaryExpression addAssignChecked(Expression expression0, Expression expression1) { throw Extensions.todo(); }", "public void equal() {\n if (operatorAssigned != Operator.NON || operatorType != Operator.NON) {\n double subResult;\n if (numberStored[1] != 0) {\n subResult = basicCalculation(numberStored[1], Double.parseDouble(mainLabel.getText()), operatorType);\n numberStored[0] = basicCalculation(numberStored[0], subResult, operatorAssigned);\n numberStored[1] = 0;\n mainLabel.setText(Double.toString(numberStored[0]));\n } else {\n numberStored[0] = basicCalculation(numberStored[0], Double.parseDouble(mainLabel.getText()), operatorType);\n mainLabel.setText(Double.toString(numberStored[0]));\n }\n }\n operatorAssigned = Operator.NON;\n operatorType = Operator.NON;\n }", "public boolean setOperand(int operandNumber, String operandValue);", "public void setElseValue(Object pValue);", "void doSet() throws NotConnectedException\n\t{\n\t\ttry\n\t\t{\n\t\t\tValueExp exp = null;\n\n\t\t\tif (!hasMoreTokens())\n\t\t\t\terr(getLocalizationManager().getLocalizedTextString(\"setCommand\")); //$NON-NLS-1$\n\t\t\telse\n\t\t\t{\n\t\t\t\t// pull the expression\n\t\t\t\tString s = restOfLine();\n\n\t\t\t\t// parse and eval which causes the assignment to occur...\n\t\t\t\tif ( (exp = parseExpression(s)) == null )\n\t\t\t\t\t; // failed parse\n\n\t\t\t\t// make sure contains assignment\n\n\t\t\t\telse if ( !exp.containsAssignment() )\n\t\t\t\t\tthrow new IllegalAccessException(\"=\"); //$NON-NLS-1$\n\n\t\t\t\telse\n\t\t\t\t\tevalExpression(exp);\n\t\t\t}\n\t\t}\n\t\tcatch(IllegalAccessException iae)\n\t\t{\n\t\t\tMap<String, Object> args = new HashMap<String, Object>();\n\t\t\targs.put(\"operator\", iae.getMessage()); //$NON-NLS-1$\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"missingOperator\", args)); //$NON-NLS-1$\n\t\t}\n\t\tcatch(NullPointerException npe)\n\t\t{\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"couldNotEvaluate\")); //$NON-NLS-1$\n\t\t}\n\t}", "@Test\r\n public void deriveFromOrAssignmentExpressionWithSIUnits() throws IOException {\n check(\"varI_M|=9\", \"(int,m)\");\r\n //example with long m &= int\r\n check(\"varL_KMe2perH|=9\", \"(long,km^2/h)\");\r\n }", "protected IExpressionValue assignment(List<Entity> declaredStates, List<Entity> possibleStates) \r\n\t\t\t\t\tthrows InvalidProbabilityRangeException, \r\n\t\t\t\t\t\t TableFunctionMalformedException,\r\n\t\t\t\t\t\t SomeStateUndeclaredException{\r\n\t\t\r\n\t\t// prepare a representation of a cell inside the temporary table\r\n\t\tTempTableProbabilityCell currentCell = new TempTableProbabilityCell(null, null);\r\n\t\t\r\n\t\t// SCAN FOR IDENTIFIER\r\n\t\tscan();\r\n\t\tString userDefinedVariableName = null;\t// this will become non-null if there is an unknown state declared (unknown states will become user-defined variables)\r\n\t\tif (token == 'x') {\r\n\t\t\tif (this.node != null) {\r\n\t\t\t\t// Consistency check C09\r\n\t\t\t\t// Remember declared states, so we can check later if all states was declared\r\n\t\t\t\tEntity possibleValue = null;\r\n\t\t\t\tint index = this.node.getPossibleValueIndex(this.noCaseChangeValue);\r\n\t\t\t\tif (index < 0) {\r\n\t\t\t\t\t// unknown states will be considered as a new variable that user has declared\r\n\t\t\t\t\tuserDefinedVariableName = this.noCaseChangeValue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tpossibleValue = possibleStates.get(index);\r\n\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t//throw new TableFunctionMalformedException(e.getMessage());\r\n\t\t\t\t\t\tthrow new TableFunctionMalformedException(this.node.toString(), e);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (possibleValue == null) {\r\n\t\t\t\t\t\tthrow new TableFunctionMalformedException(getNode().toString());\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdeclaredStates.add(possibleValue);\r\n\t\t\t\t\tcurrentCell.setPossibleValue(possibleValue);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\texpected(\"Identifier\");\r\n\t\t}\r\n\r\n\t\t// LOOK FOR = OPERATOR\r\n\t\tmatch('=');\r\n\r\n\t\t// consistency check C09\r\n\t\t// ret verifies the sum of all declared states' probability (must be 1)\r\n\t\t// boolean hasUnknownValue shows if some ret was negative or NaN.\r\n\t\tIExpressionValue ret = expression();\t\r\n\t\tif (ret == null) {\r\n\t\t\tthrow new TableFunctionMalformedException(getResource().getString(\"NonDeclaredVarStateAssignment\"));\r\n\t\t}\r\n\t\tfloat retValue = 0;\t// initialize with a value which will not impact consistency check (the one that checks if sum is 1)\r\n\t\tif (userDefinedVariableName == null) {\r\n\t\t\t// this is a state of current node, so store the probability in order to calculate consistency later\r\n\t\t\tif (!ret.isNumeric()) {\r\n\t\t\t\t// state of nodes must be probabilities (numbers)\r\n\t\t\t\tthrow new TableFunctionMalformedException(getResource().getString(\"NonNumericProbAssignment\"));\r\n\t\t\t}\r\n\t\t\ttry {\r\n\t\t\t\tretValue = Float.parseFloat(ret.getValue());\r\n\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\tretValue = Float.NaN;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// this is a user-defined value\r\n\t\t\t// store it in the scope of current if-clause\r\n\t\t\tthis.currentHeader.addUserDefinedVariable(userDefinedVariableName, ret);\r\n\t\t}\r\n\t\tboolean hasUnknownValue = Float.isNaN(retValue);\r\n\t\t\r\n\t\t// add cell to header\r\n\t\tcurrentCell.setProbability(ret);\r\n\t\tif (currentCell.getPossibleValue() != null && currentCell.getPossibleValue() != null) {\r\n\t\t\tthis.currentHeader.addCell(currentCell);\r\n\t\t}\r\n\t\t// Debug.println(\"Adding cell: \" + currentCell.getPossibleValue().getName() + \" = \" + ret.toString());\r\n\r\n\t\t// consistency check C09\r\n\t\t// a single state shall never have negative prob \r\n\t\tif ( isToNormalize()\r\n\t\t\t\t&& ((retValue < 0.0) \r\n//\t\t\t\t\t\t|| (1.0 < retValue)\r\n\t\t\t\t\t\t)) {\r\n\t\t\tthrow new InvalidProbabilityRangeException(getNode().toString());\r\n\t\t}\r\n\t\t\r\n\t\t// LOOK FOR , (OPTIONAL)\r\n\t\tif (look == ',') {\r\n\t\t\tmatch(',');\r\n\t\t\tif (look != this.kwcode[this.lookup(\"IF\")]) {\r\n\t\t\t\tIExpressionValue temp = assignment(declaredStates, possibleStates);\r\n\t\t\t\tfloat tempValue = Float.NaN;\r\n\t\t\t\ttry {\r\n\t\t\t\t\ttempValue = Float.parseFloat(temp.getValue());\r\n\t\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\t\ttempValue = Float.NaN;\r\n\t\t\t\t}\r\n\t\t\t\thasUnknownValue = hasUnknownValue || (Float.isNaN(tempValue));\r\n\t\t\t\tif (hasUnknownValue) {\r\n\t\t\t\t\tretValue = Float.NaN;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tretValue += tempValue;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t// this is an if-clause after assignment.\r\n\t\t\t\t// we should finish assignment (assignments in same block of if-clauses must be always before the if clause)\r\n\t\t\t\t// if assignment and if-clause happens in same block, assingments must be only for user-defined variables\r\n\t\t\t\tif (!currentHeader.getCellList().isEmpty()) {\r\n\t\t\t\t\t// user-defined variables are not added to cellList. Assignments to states of variables are added to cell list.\r\n\t\t\t\t\t// if this is not empty, then there were assignments to states of variables, so this is invalid.\r\n\t\t\t\t\tthrow new SomeStateUndeclaredException(getResource().getString(\"NonUserDefinedVariablesFoundBeforeIfClause\"));\r\n\t\t\t\t}\r\n\t\t\t\t// let the upper clause actually handle the if=clause\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Debug.println(\"Returned expression value = \" + retValue);\r\n\t\tif (isToNormalize() && (retValue < 0)) {\r\n\t\t\tthrow new InvalidProbabilityRangeException(getNode().toString());\r\n\t\t}\r\n\t\treturn new SimpleProbabilityValue(retValue);\r\n\t}", "public abstract void assign(Object value) throws IllegalStateException, InterruptedException;", "public void assignValueToVariable(HashMap<String, String> assignment) throws\r\n\t\t\tIllegalOperationException,TypeNotSupportedException, IncompatibleTypeException{\r\n\t\tMap.Entry<String, String> data = assignment.entrySet().iterator().next();\r\n\t\tString variableName = data.getKey();\r\n\t\tString valueName = data.getValue();\r\n\t\tVariable lastAppearanceOfVar = findVariable(variableName);//we'll search a variable named variableName\r\n\t\tif(lastAppearanceOfVar==null||lastAppearanceOfVar.isFinal()){//did'nt find variableName\\ found final\r\n\t\t\tthrow new IllegalOperationException();\r\n\t\t}else {\r\n\t\t\t//if we did find a declared variable named variableName:\r\n\t\t\tif (lastAppearanceOfVar.compatibleWith(valueName)) {//if value's type's illegal -> exception\r\n\t\t\t\t//if we're trying, in a scope other than globalScope, to declare a variable by assigning it\r\n\t\t\t\t// with an uninitialised global variable:\r\n\t\t\t\tif((lastAppearanceOfVar.isGlobal()&&!lastAppearanceOfVar.isInitialized())&&!scopeType\r\n\t\t\t\t\t\t.equals(\"global\")){\r\n\t\t\t\t\t//we'll check if lastAppearanceOfVar was initialised in this scope (else it's illegal):\r\n\t\t\t\t\tassignUninitialisedGlobalVar(lastAppearanceOfVar, valueName);\r\n\t\t\t\t}else{ //else, the assignment's legal and we'll mark lastAppearanceOfVar as initialised:\r\n\t\t\t\t\tlastAppearanceOfVar.initialize();\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tassignWithReference(valueName, lastAppearanceOfVar);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public AssignExpr assign_expr() {\n if (lexer.token != Symbol.IDENT) {\n error.signal(\"Expecting identifier at assign expression\");\n }\n \n String type = symbolTable.getVariable(lexer.getStringValue());\n if(type == null){\n error.show(\"Tried to assign a value to a variable (\"+lexer.getStringValue()+\") that hasn't been declared.\");\n } else {\n if(type.equals(\"STRING\")){\n error.show(\"Tried to assign a value to a declared string variable (\"+lexer.getStringValue()+\")\");\n }\n }\n \n Ident id = new Ident(lexer.getStringValue());\n \n lexer.nextToken();\n if (lexer.token != Symbol.ASSIGN) {\n error.signal(\"Expecting assign symbol at assign expression\");\n }\n lexer.nextToken();\n Expr e = expr();\n\n if(type != null && type.toLowerCase().equals(\"int\") && e.getType(symbolTable) != null && e.getType(symbolTable).toLowerCase().equals(\"float\"))\n error.show(\"Trying to assign a \"+e.getType(symbolTable)+\" to a \"+type);\n else if (type != null && e.getType(symbolTable) != null && !type.equals(e.getType(symbolTable)))\n error.warning(\"Trying to assign a \"+e.getType(symbolTable)+\" to a \"+type);\n \n return new AssignExpr(id, e);\n }", "public Stmt createAssignment(Assign expr) {\n return createEval(expr);\n }", "public static BinaryExpression assign(Expression left, Expression right) { throw Extensions.todo(); }", "public static BinaryExpression addAssign(Expression expression0, Expression expression1) { throw Extensions.todo(); }", "private Expr visitLocalAssign(LocalAssign n) throws SemanticException { \n Position pos = n.position();\n if (n.operator() == Assign.ASSIGN) return n;\n X10Binary_c.Operator op = n.operator().binaryOperator();\n Local left = (Local) n.left();\n Expr right = n.right();\n Type R = left.type();\n Expr val = visitBinary((X10Binary_c) xnf.Binary(pos, left, op, right).type(R));\n return assign(pos, left, Assign.ASSIGN, val);\n }", "Syntax.Node ParseAssignment(Token t, Syntax.NodeVar left) throws Exception{\n while (true){\n if(t.type==TokenType.ASSIGNMENT_OPERATOR){\n var right = ParseExpression();\n return new Syntax.AssignmentNode(\":=\", left, right);\n }\n else {\n lexer.putBack(t);\n break;\n //throw new Exception(\"Error in ParseAssignment!!! can't assign it \");\n }\n }\n throw new Exception(\"Error in ParseAssignment!!! \");\n\n }", "@Override\n public ExprType analyzeAssign(AnalyzeInfo info, ExprGenerator value)\n {\n ExprGenerator objGen = ((ExprPro) _objExpr).getGenerator();\n objGen.analyze(info);\n\n value.analyze(info);\n\n // php/3a6e, php/39o3\n // objGen.analyzeSetReference(info);\n objGen.analyzeSetModified(info);\n\n return ExprType.VALUE;\n }", "@Override\n public Expression assign(String var, Expression expression) {\n Expression left = super.getLeft();\n Expression right = super.getRight();\n return new Mult(left.assign(var, expression), right.assign(var, expression));\n }", "public void load(String operand, Integer value) throws Exception{\n if (operand.equals(\"=\")){\n dataMemory.setData(0, value);\n }else if (operand.equals(\" \")){\n Integer newValue = dataMemory.getData(value);\n dataMemory.setData(0, newValue);\n }else if (operand.equals(\"*\")){\n Integer newDirection = dataMemory.getData(value);\n Integer newValue = dataMemory.getData(newDirection);\n dataMemory.setData(0, newValue);\n }else{\n throw new IllegalArgumentException(\"No valid operand\");\n }\n }", "public JCExpressionStatement makeAssignment(Tag tag, String varname, JCExpression exp1, JCExpression exp2) {\n return treeMaker.Exec(treeMaker.Assign(treeMaker.Ident(getNameFromString(varname)), treeMaker.Binary(tag, exp1, exp2)));\n }", "public Expression differentiate(String var) {\r\n // var might be a differentiate of other variable\r\n if (!this.toString().equalsIgnoreCase(var)) {\r\n return (Expression) new Num(0);\r\n }\r\n return (Expression) new Num(1);\r\n\r\n }", "@Override\n\tpublic void visit(AssignNode node) {\n\t\tEvaluator.evaluate(node.getChild(0));\n\t\tEvaluator.evaluate(node.getChild(1));\n\n\t\t/**\n\t\t * Verificam fiii si construim perechea Variabila, Valoare pentru a fi\n\t\t * inserata in HahMap-ul din Evaluator\n\t\t */\n\t\tVariable x = null;\n\t\tValue i = null;\n\t\tif (node.getChild(1) instanceof Variable) {\n\t\t\tx = new Variable(node.getChild(1).getName());\n\t\t} else {\n\t\t\ti = new Value(node.getChild(1).getName());\n\t\t}\n\n\t\tif (node.getChild(0) instanceof Variable) {\n\t\t\tx = new Variable(node.getChild(0).getName());\n\t\t} else {\n\t\t\ti = new Value(node.getChild(0).getName());\n\t\t}\n\t\tEvaluator.variables.put(x.getName(), i.getName());\n\t\tnode.setName(i.getName());\n\t}", "protected Element evalAssurance(Assurance ass){\n\t\tRecord r1 = ass.getLeftRecord();\n\t\tRecord r2 = ass.getRightRecord();\n\t\tOperator op = ass.getOperator();\n\t\tElement an = el(\"bpws:assign\");\n\t\tif (r1.getType() == RecordType.FORMULAR)\n\t\t\tan.appendChild(setExpr(r1.getFormular(), \"nswomoxsd:leftValue\"));\n\t\tif (r2.getType() == RecordType.FORMULAR)\n\t\t\tan.appendChild(setExpr(r2.getFormular(), \"nswomoxsd:rightValue\"));\n\t\tan.appendChild(\n\t\t\tsetExpr(\n\t\t\t\tgetMyVarPath(\"/nswomoxsd:leftValue\") + \n\t\t\t\top.value() +\n\t\t\t\tgetMyVarPath(\"nswomoxsd:rightValue\"),\n\t\t\t\t\"nswomoxsd:value\"\n\t\t\t)\n\t\t);\n\t\treturn an;\n\t}", "public MathEval setVariable(String nam, Double val) {\r\n if(!Character.isLetter(nam.charAt(0))) { throw new IllegalArgumentException(\"Variable must start with a letter\" ); }\r\n if(nam.indexOf('(')!=-1 ) { throw new IllegalArgumentException(\"Variable names may not contain a parenthesis\"); }\r\n if(nam.indexOf(')')!=-1 ) { throw new IllegalArgumentException(\"Variable names may not contain a parenthesis\"); }\r\n if(val==null) { variables.remove(nam); }\r\n else { variables.put(nam,val); }\r\n return this;\r\n }", "@Override\n public Expression visit(LogicalOpNode node) {\n\n Label trueLabel = new Label ();\n Label falseLabel = new Label ();\n Label endLabel = new Label ();\n\n process(node, trueLabel, falseLabel);\n\n cat.footoredo.mx.entity.Variable variable = tmpVariable(node.getType());\n\n label (trueLabel);\n assign (node.getLocation(), ref(variable), new Integer(Type.INT8, 1));\n jump (endLabel);\n\n label (falseLabel);\n assign (node.getLocation(), ref(variable), new Integer(Type.INT8, 0));\n jump (endLabel);\n\n label (endLabel);\n\n return isStatement() ? null : ref (variable);\n }", "private static AssignExpr retrieveAssignExpression(Expression expression) {\n return expression.asAssignExpr();\n }", "private ConvertViewReuseWithTernary(CtVariableReference reassignedVariable,\n CtVariableRead checkedVariable,\n CtVariableRead assignedVariable,\n DetectionPhaseContext context) {\n super(context);\n this.reassignedVariable = reassignedVariable;\n this.checkedVariable = checkedVariable;\n this.assignedVariable = assignedVariable;\n }", "public void assign (String name, int value){\n Closure exist = find_var(name);\n exist.getValues().put(name, new IntegerValue(value));\n }", "private static Expression retrieveAssignExpressionValue(Expression expression) {\n return retrieveAssignExpression(expression).getValue();\n }", "public Integer visitAssign(ExprParser.AssignContext ctx) {\n String id = ctx.ID().getText();\n int value = visit(ctx.expr());\n memory.put(id, value);\n return value;\n }", "@Override\n public Boolean visitVariableAttribution(FormScriptGrammarParser.VariableAttributionContext ctx) {\n if (!declaredVariables.containsKey(ctx.VARIABLE().getText())) {\n // this is validated in UI/controlled by flow in the UI so should never happen, but it remains here just in case\n throw new IllegalArgumentException(\"Semantic error at line: \" + ctx.getStart().getLine() + \": variable \" + ctx.VARIABLE().getText() + \" wasn't declared!\");\n// return false; //if we wanted to return the NOTOK/false result recursively, this would be here instead of the throw\n }\n DataType dataType = declaredVariables.get(ctx.VARIABLE().getText());\n boolean correctType = dataType.lexerValue().equals(ctx.value().start.getType());\n /*will verify if the attribution is actually semantically valid, e.g if\n the variable was defined as an INTEGER, it can't be assigned a DATE*/\n if (!correctType) {\n throw new IllegalArgumentException(\"Semantic error at line: \" + ctx.getStart().getLine() + \":\" + ctx.getStart().getCharPositionInLine()\n + \": Invalid attribution type!\" + \" variable \" + ctx.VARIABLE().getText() + \" can't be assigned the value \" + ctx.value().getText());\n// return false; //if we wanted to return the NOTOK/false result recursively, this would be here instead of the throw\n }\n //verify if operators are valid in the context of the datatype\n String operator = ctx.COMPARISON_OPERATORS().getText();\n if (operator.equals(\"<\") || operator.equals(\">\")) {\n if (dataType.equals(DataType.BOOLEAN) || dataType.equals(DataType.DATE) || dataType.equals(DataType.FILE)) {\n throw new IllegalArgumentException(\"Semantic error at line: \" + ctx.getStart().getLine() + \":\" + ctx.getStart().getCharPositionInLine()\n + \": Invalid comparison type!\" + \" variable \" + ctx.VARIABLE().getText() + \" can't be compared with operator '\" + operator + \"'\");\n }\n }\n return true;\n }", "@Override\n\tpublic void setValueExpression(String name, ValueExpression binding) {\n\t\tif (PropertyKeys.var.toString().equals(name)) {\n\t\t\tthrow new IllegalArgumentException(ERROR_EXPRESSION_DISALLOWED);\n\t\t}\n\n\t\tsuper.setValueExpression(name, binding);\n\t}", "public void unAssign(){\n\t\tthis.value = 0;\n\t}", "public VariType visit(AssignmentStatement n, Table argu) {\n\t VariType _ret=null;\n\t n.f0.accept(this, argu);\n\t MethodTable methodtable = (MethodTable)argu;\n\t Vari vari = methodtable.getvari(n.f0.f0.tokenImage);\n\t if(vari == null) {\n\t \t ClassTable classtable = methodtable.classtable;\n\t \t vari = classtable.getvari(n.f0.f0.tokenImage);\n\t \t if(vari == null) {\n\t \t\t PrintError.errorexist = true;\n\t\t \t String emsg = \"undefined variable \\\"\"+n.f0.f0.tokenImage+\"\\\"\";\n\t \t\t PrintError.print(emsg, n.f0.f0.beginLine, n.f0.f0.beginColumn, 1);\n\t \t\t return _ret;\n\t \t }\n\t }\n\t n.f1.accept(this, argu);\n\t VariType t2 = n.f2.accept(this, argu);\n\t if(VariType.isTheSameType(methodtable.toptable, vari.vari_type, t2) == false) {\n\t \t PrintError.errorexist = true;\n\t \t String emsg = \"assignstatement does not have matched types, one has type \"+vari.vari_type.type+\" , the other one has type \"+t2.type;\n\t \t PrintError.print(emsg, n.f1.beginLine, n.f1.beginColumn, 1);\n\t \t return _ret;\n\t }\n\t if(t2.type == \"Array\"){\n\t \t vari.init = true;\n\t \t if(t2.ifintegerliteral == true) {\n\t \t\t vari.alen = t2.integerliteral;\n\t \t }\n\t }\n\t n.f3.accept(this, argu);\n\t return _ret;\n\t }", "public T caseAssignNewValue(AssignNewValue object) {\r\n\t\treturn null;\r\n\t}", "private BDDState handleAssignment(CAssignment assignment, CFANode successor, CFAEdge edge)\n throws UnsupportedCodeException {\n CExpression lhs = assignment.getLeftHandSide();\n\n final String varName;\n if (lhs instanceof CIdExpression) {\n varName = ((CIdExpression) lhs).getDeclaration().getQualifiedName();\n } else {\n varName = functionName + \"::\" + lhs;\n }\n\n final CType targetType = lhs.getExpressionType();\n\n // next line is a shortcut, not necessary\n if (!precision.isTracking(MemoryLocation.fromQualifiedName(varName), targetType, successor)) {\n return state;\n }\n\n BDDState newState = state;\n CRightHandSide rhs = assignment.getRightHandSide();\n if (rhs instanceof CExpression exp) {\n final Partition partition = varClass.getPartitionForEdge(edge);\n\n if (isUsedInExpression(varName, exp)) {\n // make tmp for assignment,\n // this is done to handle assignments like \"a = !a;\" as \"tmp = !a; a = tmp;\"\n String tmpVarName = predmgr.getTmpVariableForPartition(partition);\n final Region[] tmp =\n predmgr.createPredicateWithoutPrecisionCheck(\n tmpVarName, bvComputer.getBitsize(partition, targetType));\n final CFANode location = successor;\n\n // make region for RIGHT SIDE and build equality of var and region\n final Region[] regRHS =\n bvComputer.evaluateVectorExpression(partition, exp, targetType, location, precision);\n newState = newState.addAssignment(tmp, regRHS);\n\n // delete var, make tmp equal to (new) var, then delete tmp\n final Region[] var =\n predmgr.createPredicate(\n scopeVar(lhs),\n targetType,\n successor,\n bvComputer.getBitsize(partition, targetType),\n precision);\n newState = newState.forget(var);\n newState = newState.addAssignment(var, tmp);\n newState = newState.forget(tmp);\n\n } else {\n final Region[] var =\n predmgr.createPredicate(\n scopeVar(lhs),\n targetType,\n successor,\n bvComputer.getBitsize(partition, targetType),\n precision);\n newState = newState.forget(var);\n final CFANode location = successor;\n\n // make region for RIGHT SIDE and build equality of var and region\n final Region[] regRHS =\n bvComputer.evaluateVectorExpression(\n partition, (CExpression) rhs, targetType, location, precision);\n newState = newState.addAssignment(var, regRHS);\n }\n return newState;\n\n } else if (rhs instanceof CFunctionCallExpression) {\n // handle params of functionCall, maybe there is a sideeffect\n newState =\n handleExternalFunctionCall(\n newState, successor, ((CFunctionCallExpression) rhs).getParameterExpressions());\n\n // call of external function: we know nothing, so we delete the value of the var\n // TODO can we assume, that malloc returns something !=0?\n // are there some \"save functions\"?\n\n final Region[] var =\n predmgr.createPredicate(\n scopeVar(lhs),\n targetType,\n successor,\n bitsize,\n precision); // is default bitsize enough?\n newState = newState.forget(var);\n\n return newState;\n\n } else {\n throw new AssertionError(\"unhandled assignment: \" + edge.getRawStatement());\n }\n }", "public void setOperandB(int val);", "public static BinaryExpression exclusiveOrAssign(Expression expression0, Expression expression1) { throw Extensions.todo(); }", "@Test\r\n public void deriveFromAndAssignmentExpressionWithSIUnits() throws IOException {\n check(\"varI_M&=9\", \"(int,m)\");\r\n //example with long m &= int\r\n check(\"varL_KMe2perH&=9\", \"(long,km^2/h)\");\r\n }", "@Override\n\tpublic Object visitStatement_Assign(Statement_Assign statement_Assign, Object arg) throws Exception {\n\t\tif(statement_Assign.lhs.getTypeName().isType(Type.INTEGER) ||statement_Assign.lhs.getTypeName().isType(Type.BOOLEAN) ){\n\t\t\tstatement_Assign.e.visit(this, arg);\t\t\n\t\t\tstatement_Assign.lhs.visit(this, arg);\n\t\t}\n\t\telse if(statement_Assign.lhs.getTypeName().isType(Type.IMAGE)){\n\t\t\t//if(statement_Assign.lhs.isCartesian){\n\t\t\t\tmv.visitFieldInsn(GETSTATIC, className, statement_Assign.lhs.name, ImageSupport.ImageDesc);\n\t\t\t\tmv.visitInsn(DUP);\n\t\t\t\tmv.visitMethodInsn(INVOKESTATIC, ImageSupport.className, \"getX\", ImageSupport.getXSig, false);\n\t\t\t\tmv.visitIntInsn(ISTORE, 3);\n\t\t\t\tmv.visitMethodInsn(INVOKESTATIC, ImageSupport.className, \"getY\", ImageSupport.getYSig, false);\n\t\t\t\tmv.visitIntInsn(ISTORE, 4);\t\t\t\t\n\t\t\t//}\n\t\t\t\n\t\t\tmv.visitInsn(ICONST_0);\n\t\t\tmv.visitVarInsn(ISTORE, 1);\n\t\t\tLabel l1 = new Label();\n\t\t\tmv.visitLabel(l1);\n\t\t\tLabel l2 = new Label();\n\t\t\tmv.visitJumpInsn(GOTO, l2);\n\t\t\tLabel l3 = new Label();\n\t\t\tmv.visitLabel(l3);\n\t\t\tmv.visitLineNumber(11, l3);\n\t\t\tmv.visitFrame(Opcodes.F_APPEND,1, new Object[] {Opcodes.INTEGER}, 0, null);\n\t\t\tmv.visitInsn(ICONST_0);\n\t\t\tmv.visitVarInsn(ISTORE, 2);\n\t\t\tLabel l4 = new Label();\n\t\t\tmv.visitLabel(l4);\n\t\t\tLabel l5 = new Label();\n\t\t\tmv.visitJumpInsn(GOTO, l5);\n\t\t\tLabel l6 = new Label();\n\t\t\tmv.visitLabel(l6);\n\t\t\tmv.visitFrame(Opcodes.F_APPEND,1, new Object[] {Opcodes.INTEGER}, 0, null);\n\t\t\t\n\t\t\tstatement_Assign.e.visit(this, arg);\n\t\t\tstatement_Assign.lhs.visit(this, arg);\n\t\t\t\n\t\t\tmv.visitIincInsn(2, 1);\n\t\t\tmv.visitLabel(l5);\n\t\t\tmv.visitFrame(Opcodes.F_SAME, 0, null, 0, null);\n\t\t\tmv.visitVarInsn(ILOAD, 2);\n\t\t\tmv.visitIntInsn(ILOAD, 4); // Y MAX VALUE\n\t\t\tmv.visitJumpInsn(IF_ICMPLT, l6);\n\t\t\tLabel l7 = new Label();\n\t\t\tmv.visitLabel(l7);\n\t\t\tmv.visitIincInsn(1, 1);\n\t\t\tmv.visitLabel(l2);\n\t\t\tmv.visitFrame(Opcodes.F_CHOP,1, null, 0, null);\n\t\t\tmv.visitVarInsn(ILOAD, 1);\n\t\t\tmv.visitIntInsn(ILOAD, 3); // X MAX VALUE\n\t\t\tmv.visitJumpInsn(IF_ICMPLT, l3);\n\t\t}\n\t\treturn null;\n\t}", "public void setComparedHeuristics (VariableSelector variableSelector, IntValueSelector valueOrder){\n\t\tIntValueSelector valueSelector = valueOrder;\n\t\t\n\t \n\t\tkb.getModelKB().getSolver().setSearch(Search.intVarSearch(\n \n\t\t\t\tvariableSelector,\n // selects the smallest domain value (lower bound)\n\t\t\t\t \n\t\t\t\tvalueSelector,\n \n // variables to branch on\n\t\t\t\tkb.getVars()\n\t\t));\n\t\t\n\t}", "@Override\n\t\t\tpublic Ast unaryOp(UnaryOp ast, Void dummy) {\n\t\t\t\tsuper.unaryOp(ast, dummy);\n\t\t\t\ttry {\n\t\t\t\t\tInteger intValue = null;\n\t\t\t\t\tBoolean boolValue = null;\n\n\t\t\t\t\tswitch (ast.operator) {\n\t\t\t\t\tcase U_BOOL_NOT:\n\t\t\t\t\t\tboolValue = !asBool(ast.arg());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase U_MINUS:\n\t\t\t\t\t\tintValue = -asInt(ast.arg());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase U_PLUS:\n\t\t\t\t\t\tintValue = asInt(ast.arg());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn replace(ast, intValue, boolValue);\n\t\t\t\t} catch (NotConstantException e) {\n\t\t\t\t\t// non-constant argument, no effect\n\t\t\t\t\treturn ast;\n\t\t\t\t}\n\t\t\t}", "public void visit(AssignmentOperator n) {\n n.f0.accept(this);\n }", "@Override\n public void acceptReject(boolean accept)\n {\n if (!accept)\n variable.setValue(savedValue);\n \n }", "@Override\r\n\tpublic Instruction lexParse(String[] words, LexicalParser lexParser) {\r\n\t\tif (words.length!=3) return null;\r\n\t\t\r\n\t\tif (!words[1].equals(\"=\")) return null;\r\n\t\t\r\n\t\trhs=TermParser.parse(words[2]);\r\n\t\tif (rhs==null) return null;\r\n\t\t\r\n\t\tTerm var=TermParser.parse(words[0]);\r\n\t\tif (var==null) return null;\r\n\t\t\r\n\t\treturn new SimpleAssignment(words[0], rhs);\r\n\t}", "public JCExpressionStatement makeAssignment(JCExpression lhs, JCExpression rhs) {\n return treeMaker.Exec(treeMaker.Assign(lhs, rhs));\n }", "private void assignWithReference(String valueName, Variable lastAppearanceOfVar) throws\r\n\t\t\tIllegalOperationException,IncompatibleTypeException,TypeNotSupportedException {\r\n\t\t//we'll check if the assignment is made with a reference to another variable:\r\n\t\tVariable reference = findVariable(valueName);\r\n\t\tif(reference==null){//if not, valueName variable was ever declared and it's type isn't legal.\r\n\t\t\tthrow new IllegalOperationException();\r\n\t\t}else if(reference.isGlobal()&&!reference.isInitialized()){//reference's an uninitialised global var\r\n\t\t\treference = uninitialisedGlobalVariables.get(valueName);//see if it was assigned in this scope\r\n\t\t\tif(reference==null){//if not:\r\n\t\t\t\tthrow new IllegalOperationException();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (!reference.isInitialized()) {//if the referenced variable was never initialised:\r\n\t\t\tthrow new IllegalOperationException();\r\n\t\t}\r\n\t\tlastAppearanceOfVar.compatibleWith(reference);//val's type's illegal-> exception\r\n\t\tif(lastAppearanceOfVar.isGlobal()&&!lastAppearanceOfVar.isInitialized()&&!scopeType.equals//\r\n\t\t\t\t(\"global\")){//we're trying, in a scope other than globalScope, to assign a value to an\r\n\t\t\t // uninitialised global variable\r\n\t\t\tassignUninitialisedGlobalVar(lastAppearanceOfVar,valueName);//see methods's documentation.\r\n\t\t}else{\r\n\t\t\tlastAppearanceOfVar.initialize();\r\n\t\t}\r\n\t}", "@FunctionalInterface\n\tpublic interface Assignment<V> {\n\t\tV set(Program p,V v);\n\t}", "public abstract void assign(ParameterVector pv) throws SolverException;", "default void assignFrom(Any other) {}", "abstract void assignOne();", "@Override\n public String visit(AssignExpr n, Object arg) {\n return null;\n }", "abstract void assign(int i);", "public void assign (String name, Value value){\n Closure exist = find_var(name);\n exist.getValues().put(name, value);\n }", "public static BinaryExpression addAssignChecked(Expression expression0, Expression expression1, Method method) { throw Extensions.todo(); }", "@Override\n public void visit(VariableEvalNode variableEvalNode) {\n }", "protected Expr visitSettableAssign(SettableAssign n) throws SemanticException {\n Position pos = n.position();\n MethodInstance mi = n.methodInstance();\n List<Expr> args = new ArrayList<Expr>(n.index());\n if (n.operator() == Assign.ASSIGN) {\n // FIXME: this changes the order of evaluation, (a,i,v) -> (a,v,i)!\n args.add(0, n.right());\n return xnf.Call(pos, n.array(), xnf.Id(pos, mi.name()),\n args).methodInstance(mi).type(mi.returnType());\n }\n X10Binary_c.Operator op = n.operator().binaryOperator();\n X10Call left = (X10Call) n.left();\n MethodInstance ami = left.methodInstance();\n List<Formal> parms = new ArrayList<Formal>();\n Name xn = Name.make(\"x\");\n LocalDef xDef = xts.localDef(pos, xts.Final(), Types.ref(mi.container()), xn);\n Formal x = xnf.Formal(pos, xnf.FlagsNode(pos, xts.Final()),\n xnf.CanonicalTypeNode(pos, mi.container()), xnf.Id(pos, xn)).localDef(xDef);\n parms.add(x);\n List<Expr> idx1 = new ArrayList<Expr>();\n int i = 0;\n for (Type t : ami.formalTypes()) {\n Name yn = Name.make(\"y\"+i);\n LocalDef yDef = xts.localDef(pos, xts.Final(), Types.ref(t), yn);\n Formal y = xnf.Formal(pos, xnf.FlagsNode(pos, xts.Final()),\n xnf.CanonicalTypeNode(pos, t), xnf.Id(pos, yn)).localDef(yDef);\n parms.add(y);\n idx1.add(xnf.Local(pos, xnf.Id(pos, yn)).localInstance(yDef.asInstance()).type(t));\n i++;\n }\n Name zn = Name.make(\"z\");\n Type T = mi.formalTypes().get(0);\n assert (xts.isSubtype(ami.returnType(), T, context()));\n LocalDef zDef = xts.localDef(pos, xts.Final(), Types.ref(T), zn);\n Formal z = xnf.Formal(pos, xnf.FlagsNode(pos, xts.Final()),\n xnf.CanonicalTypeNode(pos, T), xnf.Id(pos, zn)).localDef(zDef);\n parms.add(z);\n Expr val = visitBinary((X10Binary_c) xnf.Binary(pos,\n xnf.Call(pos,\n xnf.Local(pos, xnf.Id(pos, xn)).localInstance(xDef.asInstance()).type(mi.container()),\n xnf.Id(pos, ami.name()), idx1).methodInstance(ami).type(T),\n op, xnf.Local(pos, xnf.Id(pos, zn)).localInstance(zDef.asInstance()).type(T)).type(T));\n List<Expr> args1 = new ArrayList<Expr>(idx1);\n args1.add(0, val);\n Type ret = mi.returnType();\n Expr res = xnf.Call(pos,\n xnf.Local(pos, xnf.Id(pos, xn)).localInstance(xDef.asInstance()).type(mi.container()),\n xnf.Id(pos, mi.name()), args1).methodInstance(mi).type(ret);\n // Have to create the appropriate node in case someone defines a set():void\n Block block = ret.isVoid() ?\n xnf.Block(pos, xnf.Eval(pos, res), xnf.Return(pos, xnf.Call(pos,\n xnf.Local(pos, xnf.Id(pos, xn)).localInstance(xDef.asInstance()).type(mi.container()),\n xnf.Id(pos, ami.name()), idx1).methodInstance(ami).type(T))) :\n xnf.Block(pos, xnf.Return(pos, res));\n Closure c = synth.makeClosure(pos, T, parms, block, context());\n X10MethodInstance ci = c.closureDef().asType().applyMethod();\n args.add(0, n.array());\n args.add(n.right());\n return xnf.ClosureCall(pos, c, args).closureInstance(ci).type(ret);\n }", "@Override\n\tpublic Object evaluate(Interpreter interpreter)\n\t{\n\t\t((VarToken) A).assign(interpreter, (String) B.evaluate(interpreter));\n\t\treturn null;\n\t}", "public final void ruleOpSingleAssign() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalDroneScript.g:517:2: ( ( '=' ) )\r\n // InternalDroneScript.g:518:2: ( '=' )\r\n {\r\n // InternalDroneScript.g:518:2: ( '=' )\r\n // InternalDroneScript.g:519:3: '='\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getOpSingleAssignAccess().getEqualsSignKeyword()); \r\n }\r\n match(input,13,FOLLOW_2); if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getOpSingleAssignAccess().getEqualsSignKeyword()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "public interface AssignmentNode extends StackOperationNode {\n\n TemporaryVariableName getValueName();\n\n}", "@Test\n public void testValueOf() {\n System.out.println(\"valueOf\");\n String name = \"PENDING\";\n ReviewState expResult = ReviewState.PENDING;\n ReviewState result = ReviewState.valueOf(name);\n assertEquals(expResult, result);\n name = \"FINISHED\";\n expResult = ReviewState.FINISHED;\n result = ReviewState.valueOf(name);\n assertEquals(expResult, result);\n }", "public MathEval setVariable(String nam, double val) {\r\n return setVariable(nam,Double.valueOf(val));\r\n }", "public void setOp ( boolean value ) {\n\t\texecute ( handle -> handle.setOp ( value ) );\n\t}", "public LlvmValue visit(Assign n){\n\t\t\n\t\tSystem.out.format(\"assign********\\n\");\n\t\t\n\t\tLlvmValue rhs = n.exp.accept(this);\n\t\tLlvmRegister returns;\n\t\t//Nesta parte, para retornarmos o tipo certo, tivemos que converter todos os parametros do tipo\n\t\t//[ A x iB] para ponteiros. o Assembly reclamava quando tinha algum store ou algo do genero com tipos\n\t\t// diferentes\n\t\tif(rhs.type.toString().contains(\"x i\")){\n\t\t\t//System.out.format(\"expressao de rhs envolve arrays. fazendo casting...\\n\");\n\t\t\t\n\t\t\t//Fazer bitcast\n\t\t\tif(rhs.type.toString().contains(\" x i32\")){\n\t\t\t\treturns = new LlvmRegister(LlvmPrimitiveType.I32PTR);\n\t\t\t}else if(rhs.type.toString().contains(\" x i8\")){\n\t\t\t\treturns = new LlvmRegister(new LlvmPointer(LlvmPrimitiveType.I8));\n\t\t\t//Esse else eh meio inutil, mas pelo fato de eu querer usar elseif, deixei ele aqui mesmo.\n\t\t\t}else{\n\t\t\t\treturns = new LlvmRegister(rhs.type);\n\t\t\t}\n\t\t\t\n\t\t\tassembler.add(new LlvmBitcast(returns, rhs, returns.type));\n\t\t\tassembler.add(new LlvmStore(returns, n.var.accept(this)));\n\t\t}else{\n\t\t\t//Caso o tipo ja esteja ok, soh damos store com o rhs mesmo.\n\t\t\tassembler.add(new LlvmStore(rhs, n.var.accept(this)));\n\t\t}\n\t\treturn null;\n\t}", "static InfixExpression.Operator assignmentToInfix(final Assignment.Operator o) {\n return o == PLUS_ASSIGN ? InfixExpression.Operator.PLUS\n : o == MINUS_ASSIGN ? MINUS\n : o == TIMES_ASSIGN ? TIMES\n : o == DIVIDE_ASSIGN ? DIVIDE\n : o == BIT_AND_ASSIGN ? AND\n : o == BIT_OR_ASSIGN ? OR\n : o == BIT_XOR_ASSIGN ? XOR\n : o == REMAINDER_ASSIGN ? REMAINDER\n : o == LEFT_SHIFT_ASSIGN ? LEFT_SHIFT\n : o == RIGHT_SHIFT_SIGNED_ASSIGN ? RIGHT_SHIFT_SIGNED\n : o == RIGHT_SHIFT_UNSIGNED_ASSIGN ? RIGHT_SHIFT_UNSIGNED : null;\n }", "public void setOperator(String value) {\r\n\t\tif (!\"\".equals(firstNumber.toString())\r\n\t\t\t\t&& \"\".equals(secondNumber.toString())) {\r\n\t\t\toperator = value;\r\n\t\t}\r\n\t}", "public MathEval setVariableRequired(boolean val) {\r\n relaxed=(!val);\r\n return this;\r\n }", "public void control()\n {\n if(this.listOperator.contains(this.operator))\n {\n\n if(this.operator.equals(\"=\")) // If the operator is \"=\"\n {\n // We ask to the model to display the result\n this.calc.getResult();\n }\n else // Else, we give the operator to the model\n {\n this.calc.setOperator(this.operator);\n }\n }\n \n // If the number is ok\n if(this.number.matches(\"^[0-9.]+$\"))\n {\n this.calc.setNumber(this.number);\n }\n\n this.operator = \"\";\n this.number = \"\";\n }", "@Test\r\n public void deriveFromDoubleLeftAssignmentExpressionWithSIUnits() throws IOException {\n check(\"varI_M<<=9\", \"(int,m)\");\r\n //example with int m - char\r\n check(\"varI_M<<=\\'c\\'\", \"(int,m)\");\r\n }", "private Boolean evaluateBooleanExpression(Expression expr, InMemoryExpressionEvaluator eval)\n {\n try\n {\n Object result = expr.evaluate(eval);\n return (result instanceof InMemoryFailure) ? Boolean.FALSE : (Boolean)result;\n }\n catch (VariableNotSetException vnse)\n {\n if (NucleusLogger.QUERY.isDebugEnabled())\n {\n NucleusLogger.QUERY.debug(Localiser.msg(\"021024\", vnse.getVariableExpression().getId(), StringUtils.objectArrayToString(vnse.getValues())));\n }\n\n // TODO The iteration through possible variable values needs improving. We currently just drop out\n // to here with the possible values of a variable when first encountered (and not yet set), which\n // then starts the iteration process. This likely would fail if 2 or more variables (unchecked)\n if (vnse.getValues() == null || vnse.getValues().length == 0)\n {\n // No values available for this variable, so just put null and see the result\n eval.setVariableValue(vnse.getVariableExpression().getId(), null);\n if (NucleusLogger.QUERY.isDebugEnabled())\n {\n NucleusLogger.QUERY.debug(Localiser.msg(\"021025\", vnse.getVariableExpression().getId(), \"(null)\"));\n }\n if (Boolean.TRUE.equals(evaluateBooleanExpression(expr, eval)))\n {\n return Boolean.TRUE;\n }\n }\n else\n {\n // Set this variable and start iteration over the possible variable values\n for (int i=0;i<vnse.getValues().length;i++)\n {\n eval.setVariableValue(vnse.getVariableExpression().getId(), vnse.getValues()[i]);\n if (NucleusLogger.QUERY.isDebugEnabled())\n {\n NucleusLogger.QUERY.debug(Localiser.msg(\"021025\", vnse.getVariableExpression().getId(), vnse.getValues()[i]));\n }\n if (Boolean.TRUE.equals(evaluateBooleanExpression(expr, eval)))\n {\n return Boolean.TRUE;\n }\n }\n }\n\n // No variable value was successful so return FALSE\n if (NucleusLogger.QUERY.isDebugEnabled())\n {\n NucleusLogger.QUERY.debug(Localiser.msg(\"021026\", vnse.getVariableExpression().getId()));\n }\n eval.removeVariableValue(vnse.getVariableExpression().getId());\n return Boolean.FALSE;\n }\n }", "public static String assignValueIfInvalid(String checkValue,String assignValue) {\r\n\t\tif(isValid(checkValue))\r\n\t\t\treturn assignValue;\r\n\t\telse\r\n\t\t\treturn checkValue;\r\n\t}", "public final void ruleOpSingleAssign() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:299:2: ( ( '=' ) )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:300:1: ( '=' )\n {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:300:1: ( '=' )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:301:1: '='\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getOpSingleAssignAccess().getEqualsSignKeyword()); \n }\n match(input,11,FOLLOW_11_in_ruleOpSingleAssign580); if (state.failed) return ;\n if ( state.backtracking==0 ) {\n after(grammarAccess.getOpSingleAssignAccess().getEqualsSignKeyword()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "@Override\n public void visitAssignment(AssignmentExpression assignmentExpression) {\n assignmentExpression.interpret(context);\n }", "public void select(boolean a)\n {\n selected = a;\n }", "@Test\r\n public void deriveFromBinaryXorAssignmentExpressionWithSIUnits() throws IOException {\n check(\"varI_M^=9\", \"(int,m)\");\r\n //example with long m &= int\r\n check(\"varL_KMe2perH^=9\", \"(long,km^2/h)\");\r\n }", "@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\tboolean value = this.getValue();\n\t\t\n\t\tint bValue = Constants.isTrue;\n\t\tif(value) {\n\t\t\tbValue = Constants.isTrue;\n\t\t} else {\n\t\t\tbValue = Constants.isFalse;\n\t\t}\n\t\t//System.out.println(\"Huhu\");\n\t\tStaticHolder.area.setVariable(this.varNumber, bValue);\n\t\tStaticHolder.area.repaint();\n\t\tif(StaticHolder.area.isTrue()) {\n\t\t\tJOptionPane.showMessageDialog(StaticHolder.mainWindow, \"Herzlichen Glückwunsch! Sie haben gewonnen.\");\n\t\t}\n\t\t\n\t}", "public void sub(String operand, Integer value) throws Exception{\n if (operand.equals(\"=\")){\n Integer accVal = dataMemory.getData(0);\n dataMemory.setData(0, accVal - value);\n }else if (operand.equals(\" \")){\n Integer regVal = dataMemory.getData(value);\n Integer accVal = dataMemory.getData(0);\n dataMemory.setData(0, accVal - regVal);\n }else if (operand.equals(\"*\")){\n Integer newDirection = dataMemory.getData(value);\n Integer regVal = dataMemory.getData(newDirection);\n Integer accVal = dataMemory.getData(0);\n dataMemory.setData(0, accVal - regVal);\n }else{\n throw new IllegalArgumentException(\"No valid operand\");\n }\n }", "public final void mMULTIPLY_ASSIGN() throws RecognitionException {\n try {\n int _type = MULTIPLY_ASSIGN;\n // /Users/benjamincoe/HackWars/C.g:232:2: ( '*=' )\n // /Users/benjamincoe/HackWars/C.g:232:4: '*='\n {\n match(\"*=\"); \n\n\n }\n\n this.type = _type;\n }\n finally {\n }\n }", "@Override\n\tpublic String visitAssignst(AssignstContext ctx) {\n\t\tParseTree cur = ctx.getChild(0);\n\t\tString left = null;\n\t\tString right = null;\n\t\tif(cur == ctx.ID()){\n\t\t\tString key=visitTerminal((TerminalNode)cur);\n\t\t\tRecord id= table.lookup(key);\n\t\t\tif (id==null) throw new RuntimeException(\"Identifier \"+key+\" is not declared\");\t\t\t\t\t\n\t\t\tleft = id.getReturnType();\n\t\t}\n\t\telse {left = visit(cur);}\n\t\tright = visit(ctx.getChild(2));\n\t\tif(right.equals(left)){\t\t\t\n\t\t\treturn right;\t\t\t\n\t\t}\n\t\telse throw new RuntimeException(\"Not the same type in left and right of Assign\");\n\t}", "public void setOp(boolean value) {}", "public T caseAssignStatement(AssignStatement object) {\n\t\treturn null;\n\t}", "private AssignNode parseStatementIdentifier(Token identifier) {\n\t\tswitch (tokenReader.getCurrent().getType()) {\n\t\tcase ASSIGN:\n\t\t\ttokenReader.moveNext();\n\t\t\treturn new AssignNode(identifier, parserExpression.parse());\n\t\tcase ASSIGN_MINUS: case ASSIGN_PLUS:\n\t\t\treturn new AssignNode(identifier, new BinaryOperationNode(tokenReader.getCurrentAndMoveNext(), new VarNode(identifier), parserExpression.parse()));\n\t\tcase INCR: case DECR:\n\t\t\tToken oneToken = new Token(TokenType.NUMBER, \"1\", tokenReader.getCurrent().getIndex(), tokenReader.getCurrent().getRow(), tokenReader.getCurrent().getColumn());\n\t\t\tConstantNode one = new ConstantNode(oneToken);\n\t\t\treturn new AssignNode(identifier, new BinaryOperationNode(tokenReader.getCurrentAndMoveNext(), new VarNode(identifier), one));\n\t\tdefault:\n\t\t\tthrow new FunwapException(\"Invalid statement.\", tokenReader.getCurrent());\n\t\t}\n\t}" ]
[ "0.625886", "0.61275274", "0.6055575", "0.6035663", "0.59372294", "0.5850144", "0.58119243", "0.57949996", "0.5786715", "0.5784666", "0.5780048", "0.57748014", "0.57537925", "0.57079256", "0.5700202", "0.56849134", "0.5681147", "0.5651876", "0.56489456", "0.5633338", "0.5628787", "0.56026137", "0.5580747", "0.55632216", "0.55528253", "0.5548543", "0.5537453", "0.5502605", "0.5495076", "0.5471923", "0.5443823", "0.54374766", "0.5422289", "0.54221964", "0.541276", "0.53524286", "0.5347409", "0.53324765", "0.53316396", "0.5330079", "0.53203624", "0.53172565", "0.53159386", "0.5308018", "0.5304853", "0.5298311", "0.5295345", "0.5294182", "0.5280975", "0.5259847", "0.5234024", "0.52288294", "0.5227424", "0.52269167", "0.5191724", "0.5188376", "0.51866144", "0.51861936", "0.5183605", "0.51835704", "0.5181113", "0.51797426", "0.51727116", "0.516618", "0.51480496", "0.5141916", "0.5133271", "0.5130104", "0.51288974", "0.5124559", "0.51236254", "0.5119054", "0.51157856", "0.51155406", "0.51093316", "0.5095539", "0.5089507", "0.5057112", "0.50549495", "0.5049104", "0.50465894", "0.5036737", "0.5026492", "0.5024107", "0.501316", "0.50120646", "0.49992114", "0.4993815", "0.49919075", "0.49895594", "0.49809083", "0.4980582", "0.49800614", "0.49787465", "0.49730673", "0.49626723", "0.49600962", "0.49571413", "0.49535748", "0.49379975" ]
0.67291635
0
Remove the selected value from the selected variable domain e.g. X != 42 If this decision fails, it is automatically negated (i.e. X = 42)
public static DecisionOperator<IntVar> remove() { return DecisionOperator.int_neq; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void unsetValue();", "void unsetValue();", "@Override\r\n\tpublic void unsetGiveValue() {\n\t\t\r\n\t}", "public void unsetValue()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_attribute(VALUE$12);\n }\n }", "void unsetValueQuantity();", "public void unAssign(){\n\t\tthis.value = 0;\n\t}", "void unsetValueCodeableConcept();", "void unsetValuePeriod();", "void unsetValueRatio();", "@Override\n protected void variableRemovedDuringReplication(Aggregatable variable) {\n }", "void unsetValueString();", "public Value restrictToNotAbsent() {\n checkNotUnknown();\n if (isNotAbsent())\n return this;\n Value r = new Value(this);\n r.flags &= ~ABSENT;\n if (r.var != null && (r.flags & (PRESENT_DATA | PRESENT_ACCESSOR)) == 0)\n r.var = null;\n return canonicalize(r);\n }", "public boolean setNoDialog(boolean negated) {\n if (negated)\n value = variable.F;\n else\n value = variable.T;\n //store the name of the variable in the selectedVars list (used in model checker)\n selectedVars.add(name);\n // for each clause in clist that contains not this-term\n\n Iterator i = cnfClause.clist.iterator();\n while ( i.hasNext() ) {\n cnfClause c = ( cnfClause ) i.next();\n if ( c.hasNegTerm( !negated, ( variable )this ) ) {\n if ( c.isUnitOpen() != null )\n cnfClause.stack.push( c );\n else\n if ( c.isViolated() ) {\n cnfClause.ctStr += ((node)c.formula).toString().replace(\"_\",\"\") + \"\\n\";\n return false;\n /*grammar.dumpUserSelections();\n JOptionPane.showMessageDialog( null,\n \"model inconsistency detected -- see stderr for more information\",\n \"Error!\", JOptionPane.ERROR_MESSAGE );\n System.exit(1);*/\n }\n\n }\n }\n return true;\n }", "@Override\r\n\tpublic void unsetGetValue() {\n\t\t\r\n\t}", "public void deselect();", "@Override\n\tpublic void removeValue(String arg0) {\n\t}", "@Override\n public void acceptReject(boolean accept)\n {\n if (!accept)\n variable.setValue(savedValue);\n \n }", "@Override\n public boolean revise(int position) throws ContradictionException {\n boolean revised = false;\n final DisposableIntIterator itr = scope[position].getSVariable()\n .getDomain().getIterator();\n try {\n while (itr.hasNext()) {\n final int a = itr.next();\n if (revise(position, a, Integer.MAX_VALUE)) {\n scope[position].removeVal(a);\n revised = true;\n }\n }\n } finally {\n itr.dispose();\n }\n return revised;\n }", "void unsetRequired();", "Property removeValue(PropertyValue<?, ?> value);", "void unset() {\n size = min = pref = max = UNSET;\n }", "public void removeValue(Object value)\n\t{\n\t\tif (values.contains(value))\n\t\t{\n\t\t\tvalues.remove(value + \"\");\n\t\t}\n\t}", "@Override\n public void onValueDeselected() {\n }", "protected void removeSelection() {\n\t\tBEAN oldBean = getInternalValue();\n\t\tsetInternalValue(null);\n\t\ttextField.setValue(null);\n\t\tif (searchListener != null) {\n\t\t\tsearchListener.remove(oldBean);\n\t\t}\n\t}", "public boolean removeVariable(String varName) {\n\tif (values == null) return false;\n Iterator iter = values.iterator();\n Binding binding;\n int i=0;\n int found = -1;\n while( iter.hasNext() ) {\n binding = (Binding)iter.next();\n\t if (binding.getName().equals(varName)) {\n\t\tfound = i;\n\t\tbreak;\n\t }\n\t i++;\n\t}\n if (found != -1) {\n values.remove(found);\n return true;\n } else {\n return false;\n }\n }", "public void removeTransNotInTree(){\n // Get the list of transparents which take part into the tree\n Vector transparents=values.getListTransparents();\n Vector<FiniteStates> varsToRemove = new Vector<FiniteStates>();\n\n // Now remove the transparent in the PotentialTree if they do not\n // appear in the tree\n // Go on the set of variables, one by one\n for(int i=0; i < variables.size(); i++){\n FiniteStates var=(FiniteStates)variables.elementAt(i);\n\n // If transparent, consider if it must be removed\n if (var.getTransparency() == FiniteStates.TRANSPARENT){\n // Check if it is present in transparents\n for(int j=0; j < transparents.size(); j++){\n if (transparents.contains(var) == false)\n varsToRemove.addElement(var);\n \n }\n }\n }\n for(int i=0;i<varsToRemove.size();i++){\n variables.remove(varsToRemove.elementAt(i)); \n }\n }", "@Override\n public void onValueDeselected() {\n\n }", "@Override\n public void onValueDeselected() {\n\n }", "@Override\n public void onValueDeselected() {\n\n }", "@Override\n public void onValueDeselected() {\n\n }", "public void disableChoice(int x, int y, int value)\n {\n _cells[x][y].disableValue(value);\n }", "boolean removeVariableDiscount(int id,int acc_no);", "@Override\n public VariableNonRequirement computeVariableNonRequirement(IQTree child) {\n return VariableNonRequirement.of(substitution.getDomain());\n }", "void clearActiveOperand();", "public void removeStateValueBinding(final String variableName) {\n //Preconditions\n assert variableName != null : \"variableName must not be null\";\n assert !variableName.isEmpty() : \"variableName must not be empty\";\n\n synchronized (stateVariableDictionary) {\n if (stateVariableDictionary.isEmpty() && !stateValueBindings.isEmpty()) {\n // lazy population of the state value dictionary from the persistent state value bindings\n stateValueBindings.stream().forEach((stateValueBinding) -> {\n stateVariableDictionary.put(stateValueBinding.getVariableName(), stateValueBinding);\n });\n }\n final StateValueBinding stateValueBinding = stateVariableDictionary.remove(variableName);\n if (stateValueBinding != null) {\n final boolean isRemoved = stateValueBindings.remove(stateValueBinding);\n assert isRemoved;\n }\n }\n }", "private void removeSpeciesUnmatching(int optionselected) {\n for (String s : speciesLeft) {\n if (!(criteriaList.get(currentCriteria).getOptionList().get(optionselected).getEntities().contains(s)))\n speciesLeft.remove(s);\n }\n }", "public void discard(int idGioc, String value){\n\t\t partita.discard( idGioc, value);\n\t}", "public void supprimerEpsilonProd(){\n grammaireCleaner.supprimer_epsilon_prod();\n setChanged();\n notifyObservers(\"4\");\n }", "public abstract ArithValue negate();", "@Override\n\tpublic boolean removeChoice(String choice){\n\t\treturn false;\n\t}", "public void clearVariable(int offset);", "public Value restrictToNotModified() {\n if (!isMaybeModified())\n return this;\n Value r = new Value(this);\n r.flags &= ~MODIFIED;\n return canonicalize(r);\n }", "@Override\n public Literal not() {\n if (negation == null) {\n negation = new NotBoolVar(this);\n }\n return negation;\n }", "public boolean offForEvaluation();", "void unsetAmount();", "public Builder clearDecision() {\n bitField0_ = (bitField0_ & ~0x00000001);\n decision_ = 1;\n onChanged();\n return this;\n }", "public Builder clearDecision() {\n bitField0_ = (bitField0_ & ~0x00000001);\n decision_ = 1;\n onChanged();\n return this;\n }", "private void m12453b(C2505j jVar) {\n this.f9524O.remove(jVar);\n }", "public void setNoRelation( Value inValue )\n throws Exception\n {\n if (getVariable() == inValue.getVariable())\n return;\n\n try {\n RelationMatrix mat = _var.getMatrixForVariable( inValue._var );\n mat.setNoRelation( this, inValue );\n }\n catch (Exception ex) {\n throw ex;\n }\n }", "@Override\n\tpublic void unselect() {\n\t}", "public void unsetWasNotGiven()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(WASNOTGIVEN$4, 0);\n }\n }", "void unsetValueSampledData();", "public boolean removeSelectedValue( final T selectedValue ) {\r\n List< T > selectedValues = getSelectedValuesChoicesObject();\r\n return selectedValues.remove( selectedValue );\r\n }", "public static void setGsSearchLosDiscard(double val) {\n gsSearchLosDiscard = val;\n }", "public void removeMoney(int x)\n\t{\n\t\tsomethingChanged = true;\n\t\tmoney -= x;\n\t}", "@Override\r\n public void removeFilterValue(String value) {\n }", "public Value setDontDelete() {\n checkNotUnknown();\n if (isDontDelete())\n return this;\n Value r = new Value(this);\n r.flags &= ~ATTR_DONTDELETE_ANY;\n r.flags |= ATTR_DONTDELETE;\n return canonicalize(r);\n }", "@Override\n public void deselectGolem() {\n }", "public void unsetRecordsDroppedValue() throws JNCException {\n delete(\"records-dropped\");\n }", "public void removeVariables(int[] selectedRows) {\r\n \t for(int i = 0; i < selectedRows.length; i++) {\r\n \t\t this.variableData.remove(selectedRows[i] - i);\r\n \t }\r\n \t this.fireTableDataChanged();\r\n }", "public Builder clearVarValue() {\n bitField0_ = (bitField0_ & ~0x00020000);\n varValue_ = getDefaultInstance().getVarValue();\n onChanged();\n return this;\n }", "void unsetQuick();", "public void visitDNEG(DNEG o){\n\t\tif (stack().peek() != Type.DOUBLE){\n\t\t\tconstraintViolated(o, \"The value at the stack top is not of type 'double', but of type '\"+stack().peek()+\"'.\");\n\t\t}\n\t}", "public void unsetDualVectorTypeValue() throws JNCException {\n delete(\"dual-vector-type\");\n }", "public Value setNotDontDelete() {\n checkNotUnknown();\n if (isNotDontDelete())\n return this;\n Value r = new Value(this);\n r.flags &= ~ATTR_DONTDELETE_ANY;\n r.flags |= ATTR_NOTDONTDELETE;\n return canonicalize(r);\n }", "private static void removeValue(ISet set, Scanner in)\n {\n if (set.getSize() == 0)\n System.out.println(\"Can't remove from an empty set!\");\n else {\n int pos;\n boolean valid;\n do {\n System.out.println(\"What position should be removed from the set?\");\n pos = Integer.parseInt(in.nextLine());\n valid = (pos >= 0 && pos < set.getSize());\n if (!valid)\n System.out.println(\"That's not a valid position\");\n } while (!valid);\n set.removePos(pos);\n }\n }", "void unsetValueAttachment();", "public void assertNotSelectedValue(final String selectLocator, final String valuePattern);", "public T remove(T value){\n\t return value;\n\t}", "public void removeInterpretedBy( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.remove(this.model, this.getResource(), INTERPRETEDBY, value);\r\n\t}", "void unsetComplianceCheckResult();", "private boolean isRemovableDecInValueNode(Node decision, Node valueNode) {\n NodeList functionalPredOfSV = null;\n NodeList diff;\n NodeList predOfDec;\n\n\n //Informational predecessors of the decision\n predOfDec = decision.getParentNodes();\n predOfDec.insertNode(decision);\n\n //Conditional predecessors of the value node must be informational\n //predecessors of the decision\n functionalPredOfSV = ((IDWithSVNodes) diag).getChanceAndDecisionPredecessors(valueNode);\n diff = functionalPredOfSV.difference(decision.getParentNodes());\n diff.removeNode(decision);\n return (diff.size() == 0);\n\n }", "public void unsetGUVectorLimitValue() throws JNCException {\n delete(\"g-u-vector-limit\");\n }", "public void excludedValues(BooleanExpression excluded) {\n\t\tthis.setOperator(new DBPermittedValuesOperator(excluded));\n\t\tnegateOperator();\n\t}", "public void setRemove(Boolean newValue);", "@Override\r\n\tpublic vec3 minus(ShaderVar var) {\n\t\treturn null;\r\n\t}", "private void negate()\n\t{\n\t\tif(Fun == null)\n\t\t{\n\t\t\tsetLeftValue();\n\t\t\tresult = calc.negate();\n\t\t\tupdateText();\n\t\t\tsetLeftValue();\n\t\t}\n\t}", "public void supprimerImproductifs(){\n grammaireCleaner.nettoyNonProdGramm();\n setChanged();\n notifyObservers(\"2\");\n }", "public void removeVars(){\n this.values = new HashMap<>();\n }", "public MathEval setVariableRequired(boolean val) {\r\n relaxed=(!val);\r\n return this;\r\n }", "protected <E> String selectUnassignedVariable(CSP<E> csp, Assignment<E> assignment) {\r\n\t\tList<String> unassigned= new ArrayList<String>(); \r\n\t\tfor(String i:csp.variables){\r\n\t\t\tif(!assignment.containsKey(i)){\r\n\t\t\t\tunassigned.add(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tRandom random = new Random();\r\n\t\tint rand=random.nextInt(unassigned.size());\r\n\t\treturn unassigned.get(rand);\r\n\t}", "boolean removeTypedParameter(Parameter typedParameter);", "private DeleteByValue() {}", "private DeleteByValue() {}", "void unsetMaximum();", "public void deleteExpression(){\n\n if(currentExp.equals(\"\")){\n calculationResult.onExpressionChange(\"Invalid Input\",false);\n }\n currentExp = \"\";\n calculationResult.onExpressionChange(currentExp,true);\n calculationResult.onExpressionChangeResult(\"\",true);\n\n }", "public void retract(){\n\t\tsolenoid1.set(false);\n\t\tsolenoid2.set(false);\n\t}", "@Override\n\tpublic void\n\tscalarSub( double value )\n\t{\n\t\tdata[0] -= value;\n\t\tdata[1] -= value;\n\t\tdata[2] -= value;\n\t}", "public final void setUnbounded() {_occ.setUnbounded();}", "public MathEval clear(String pfx) {\r\n variables.subMap((pfx+\".\"),(pfx+\".\"+Character.MAX_VALUE)).clear();\r\n return this;\r\n }", "private static void leaveVarChar(DetectionContext detectionContext, String cellValue) {\n enterVarChar(detectionContext, cellValue);\n }", "void removeCalcValueListener(CalcValueListener l);", "public void removeLocalVariable(LocalVariableGen lvg) {\n/* 183 */ this._slotAllocator.releaseSlot(lvg);\n/* 184 */ super.removeLocalVariable(lvg);\n/* */ }", "public void test_removeTypedValue_accuracy() {\n instance.addTypedValue(typedValue);\n assertTrue(\"The TypedValue is not added properly.\", instance.containsTypedValue(typedValue));\n\n instance.removeTypedValue(typedValue);\n assertFalse(\"The element is not removed properly.\", instance.containsTypedValue(typedValue));\n }", "static public void deselect(DrawingPad drawingPad, SelectPanel selectPanel, Rectangle2D.Float fBounds) {\n // Current layer.\n boolean bCurrentLayer = selectPanel.isCurrentLayer();\n \n // Get the selected design.\n if (selectPanel.isSelectAllItems())\n drawingPad.getDesign().setLinesAndVerticesSelected(false);\n else if (selectPanel.isSelectGraph())\n drawingPad.getDesign().deselectGraphs(fBounds, bCurrentLayer);\n else if (selectPanel.isSelectLine())\n drawingPad.getDesign().deselectLines(fBounds, bCurrentLayer);\n else if (selectPanel.isSelectPoint())\n drawingPad.getDesign().deselectVertices(fBounds, bCurrentLayer);\n else\n throw new IllegalArgumentException(\"ToolSimpleMover::deselect() Unknown select type.\");\n }", "public Value restrictToFalsy() {\n checkNotPolymorphicOrUnknown();\n Value r = new Value(this);\n if (isMaybeStr(\"\"))\n r.str = \"\";\n else\n r.str = null;\n r.flags &= ~STR;\n if (r.num != null && Math.abs(r.num) != 0.0)\n r.num = null;\n r.object_labels = r.getters = r.setters = null;\n r.flags &= ~(BOOL_TRUE | STR_PREFIX | (NUM & ~(NUM_ZERO | NUM_NAN)));\n r.excluded_strings = r.included_strings = null;\n return canonicalize(r);\n }", "void removeIsVertexOf(Subdomain_group oldIsVertexOf);", "public void takenOrDead(Caldean du)\n{\n if(du.isFemale())\n eligibleDuas.remove(du);\n\n else\n eligibleDuises.remove(du);\n\n}", "public void removeSelection() {\n this.selection = null;\n }", "public void removePartOfSet( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.remove(this.model, this.getResource(), PARTOFSET, value);\r\n\t}" ]
[ "0.6752722", "0.6752722", "0.603682", "0.60153204", "0.59725773", "0.57589924", "0.57453215", "0.5644882", "0.5617004", "0.5603162", "0.55952615", "0.5586926", "0.5551954", "0.5529937", "0.55114746", "0.54830694", "0.5467119", "0.5464284", "0.5448762", "0.5443723", "0.542264", "0.5412262", "0.537994", "0.53741026", "0.53683335", "0.5363735", "0.5349125", "0.5349125", "0.5349125", "0.5349125", "0.5340511", "0.5311564", "0.5290983", "0.52888614", "0.5286082", "0.52310604", "0.52158237", "0.5197967", "0.519406", "0.5193865", "0.5189341", "0.5181969", "0.51794714", "0.5178122", "0.5177584", "0.51658535", "0.51658535", "0.51630235", "0.5154997", "0.51498675", "0.5141382", "0.5138101", "0.5128237", "0.51280504", "0.51240575", "0.5123101", "0.5111354", "0.5105618", "0.51054186", "0.5104288", "0.50927424", "0.50831544", "0.5083014", "0.5078218", "0.5074685", "0.5073143", "0.50605077", "0.5058544", "0.50450516", "0.503848", "0.5036157", "0.50351393", "0.5034367", "0.502837", "0.50233966", "0.50233823", "0.50075537", "0.50018036", "0.5000684", "0.4999998", "0.49904132", "0.49881423", "0.49879953", "0.49879953", "0.49816725", "0.4973589", "0.49714866", "0.49664462", "0.49658936", "0.49397215", "0.49370828", "0.4936016", "0.49306574", "0.49287713", "0.49198982", "0.49139792", "0.49132088", "0.48917907", "0.4888291", "0.4886758" ]
0.6147173
2
Split the domain of the selected variable at the selected value, by updating the upper bound. e.g. X 42)
public static DecisionOperator<IntVar> split() { return DecisionOperator.int_split; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void update_domain(int value, int lowerBound, int upperBound) {\n domain_history.push(domain.copy());\n domain.getDomain().remove((Integer) value);\n domain.getDomain().removeIf(d -> d > upperBound || d < lowerBound);\n }", "R visitBoundVariable(Formula f, int deBruijnIdx);", "public void changeRangeX(double limiteInitial, double limiteFinal, double space){\n //rango eje x\n xAxis = (NumberAxis) plot.getDomainAxis();\n xAxis.setRange(limiteInitial, limiteFinal);//agrego el rango en el eje de las x\n xAxis.setTickUnit(new NumberTickUnit(space));//agrego el espacio entre cada rango\n }", "public abstract void setRange(double value, int start, int count);", "void assignRange() {\n rangeIndex = (int) Math.floor(value / step);\n }", "public void setInput(double x)\n {\n if(domain.contains(x))\n this.x = x;\n else\n throw new BadParameterException(\"The input value \"+x+\" was rejected \"\n + \"as it is outside of the domain for this input: \"\n + \"[\"+domain.getLeft()+\", \"+domain.getRight()+\"].\");\n }", "public void divideDomain(){\n \tfor (int i = 0 ; i < getBoardSize() ; i++)\n \t\tfor (int j = 0 ; j < getBoardSize() ; j++){\n\t\t\tgetPoint(i, j).setHolder(GoPlayer.UNKNOWN);\n\t\t}\n\n \t\tfor (int i = 0 ; i < getBoardSize() ; i++)\n \t\tfor (int j = 0 ; j < getBoardSize() ; j++){\n if (getPoint(i, j).getHolder() == GoPlayer.UNKNOWN){\n \tif (getPoint(i, j).getState() == GoPoint.BLACK){\n getPoint(i, j).setHolder(GoPlayer.BLACK);\n \t}\n \telse if (getPoint(i, j).getState() == GoPoint.WHITE){\n getPoint(i, j).setHolder(GoPlayer.WHITE);\n \t}\n \telse {\n \t\tVector v = getBody(i,j);\n \t\tfindSpaceHolder(v);\n \t}\n }\n\t\t}\n }", "public void setLowerBound (int lowerBound) throws ModelException;", "protected final void setP(IntervalNode x) {\n\tthis.p = x;\n\n\t// recalc max and min\n\tsetMax();\n\tsetMin();\n }", "public void testFindDomainBounds() {\n XYBlockRenderer renderer = new XYBlockRenderer();\n XYSeriesCollection dataset = new XYSeriesCollection();\n XYSeries series = new XYSeries(\"S1\");\n series.add(1.0, null);\n dataset.addSeries(series);\n Range r = renderer.findDomainBounds(dataset);\n dataset.removeAllSeries();\n r = renderer.findDomainBounds(dataset);\n }", "Range controlLimits();", "protected void mapValueToWithinBounds() {\n if (getAllele() != null) {\n \tFloat d_value = ( (Float) getAllele());\n if (d_value.isInfinite()) {\n // Here we have to break to avoid a stack overflow.\n // ------------------------------------------------\n return;\n }\n // If the value exceeds either the upper or lower bounds, then\n // map the value to within the legal range. To do this, we basically\n // calculate the distance between the value and the float min,\n // then multiply it with a random number and then care that the lower\n // boundary is added.\n // ------------------------------------------------------------------\n if (d_value.floatValue() > m_upperBound ||\n d_value.floatValue() < m_lowerBound) {\n RandomGenerator rn;\n if (getConfiguration() != null) {\n rn = getConfiguration().getRandomGenerator();\n }\n else {\n rn = new StockRandomGenerator();\n }\n setAllele(new Float((rn.nextFloat()\n * ((m_upperBound - m_lowerBound))) + m_lowerBound));\n }\n }\n }", "public abstract Cut<C> a(BoundType boundType, DiscreteDomain<C> discreteDomain);", "public abstract Cut<C> b(BoundType boundType, DiscreteDomain<C> discreteDomain);", "IntVar selectVariable(IntVar[] v) {\r\n\r\n if (v.length != 0) {\r\n int index = 0;\r\n int smallestDomain = Integer.MAX_VALUE;\r\n for(int i = 0; i< v.length-1; i++){\r\n if(v[i].domain.getSize()<smallestDomain){\r\n index = i;\r\n smallestDomain = v[i].domain.getSize();\r\n }\r\n\r\n }\r\n if(v[index].min() == v[index].max()){\r\n\r\n searchVariables = new IntVar[v.length-1];\r\n for (int i = 0; i < v.length-1; i++) {\r\n if(i<index){\r\n searchVariables[i] = v[i];\r\n }\r\n else searchVariables[i] = v[i+1];\r\n\r\n }\r\n }\r\n else{\r\n searchVariables = new IntVar[v.length];\r\n for(int i = 0; i < v.length; i++){\r\n searchVariables[i] = v[i];\r\n }\r\n }\r\n return v[index];\r\n\r\n }\r\n else {\r\n System.err.println(\"Zero length list of variables for labeling\");\r\n return new IntVar(store);\r\n }\r\n }", "public Range getRangeX(double lowerPercent, double upperPercent, \n PlotRenderingInfo info, Point2D source) {\n \t\t\n \t double start = super.getDomainAxis().getRange().getLowerBound();\n double length = super.getDomainAxis().getRange().getLength();\n Range adjusted = null;\n if (super.getDomainAxis().isInverted()) {\n adjusted = new Range(start + (length * (1 - upperPercent)), \n start + (length * (1 - lowerPercent))); \n }\n else {\n adjusted = new Range(start + length * lowerPercent, \n start + length * upperPercent);\n }\n return adjusted;\n }", "public void setX(Double x);", "default DiscreteSet2D subLevelSet(double value) {\r\n\t\treturn pointsSatisfying(d -> d <= value);\r\n\t}", "public Cut<Comparable<?>> b(BoundType boundType, DiscreteDomain<Comparable<?>> discreteDomain) {\n throw new AssertionError(\"this statement should be unreachable\");\n }", "@Override\r\n\tpublic double derivativeOf(double x) {\r\n\t\treturn ( 1 / (x - this.getLower_bound()) ) + ( 1 / (this.getUpper_bound() - x) ); \r\n\t}", "public int getBound();", "boolean isBoundVariable(Formula f);", "public Cut<Comparable<?>> b(BoundType boundType, DiscreteDomain<Comparable<?>> discreteDomain) {\n throw new IllegalStateException();\n }", "public void setEndX(double x)\n {\n endxcoord=x; \n }", "public void setEndX(double val) {\r\n endx = val;\r\n }", "public void changeRangeY(double limiteInitial, double limiteFinal, double space){\n //rango eje y\n //plot.getRangeAxis().setRange(limiteInitial, limiteFinal);\n yaxis = (NumberAxis) plot.getRangeAxis();\n yaxis.setRange(limiteInitial, limiteFinal);//agrego el rango en el eje de las y\n yaxis.setTickUnit(new NumberTickUnit(space));//agrego el espacio entre cada rango\n }", "public abstract double[] getUpperBound();", "public static IntStrategy maxDom_Split(IntVar... VARS) {\n return dichotomic(maxDomainSize_var_selector(), true, VARS);\n }", "public Cut<Comparable<?>> a(BoundType boundType, DiscreteDomain<Comparable<?>> discreteDomain) {\n throw new AssertionError(\"this statement should be unreachable\");\n }", "public Cut<Comparable<?>> a(BoundType boundType, DiscreteDomain<Comparable<?>> discreteDomain) {\n throw new IllegalStateException();\n }", "public void boundsLex(int [] a , IntDomainVar [] x , int [] b,int j) throws ContradictionException{\n\n int i =0;\n\n\n while( i< n && a[i]==b[i]){\n\n\n if((x[i].getInf()==a[i] || x[i].updateInf(a[i], this, false)) &&\n (x[i].getSup()==b[i] || x[i].updateSup(b[i], this, false))){\n i++;\n }else{\n this.fail();\n }\n\n }\n\n\n if(i<n )\n if ((x[i].getInf()==a[i] || x[i].updateInf(a[i], this, false)) &&\n (x[i].getSup()==b[i] || x[i].updateSup(b[i], this, false))){\n }else{\n this.fail();\n }\n\n\n if(i==n || x[i].getNextDomainValue(a[i])<b[i]){\n return ;\n }\n\n i+=1;\n\n while(i<n && (b[i]+1 <= a[i]-1) && x[i].getInf()==b[i] && x[i].getSup()==a[i]){\n if(x[i].removeInterval(b[i]+1,a[i]-1, this, false)){\n i++;\n }else{\n this.fail();\n\n }\n }\n\n if(i<n) {\n if (b[i] + 1 <= a[i] - 1 && x[i].getInf() <= b[i] &&\n b[i] <= x[i].getSup() && x[i].getSup() >= a[i] && a[i] >= x[i].getInf()) {\n if (!x[i].removeInterval(b[i] + 1, a[i] - 1, this, false)) {\n this.fail();\n }\n }\n }\n\n }", "protected String maskTopLevelDomainByX(String address, int splitAddress, int splitDomain) {\n StringBuilder sb = new StringBuilder(address);\n\n ArrayList<Integer> indexes = getPointPostions(address, splitAddress);\n\n for (Integer index : indexes) {\n for (int i = splitAddress + 1; i < index; i++)\n sb.setCharAt(i, 'X');\n splitAddress = index;\n }\n return sb.toString();\n }", "private void intervalsToPTreeCredalSet(PotentialInterval intervalSet,ProbabilityTree probTree,\n Configuration conf,int nvar){\n Vector vars=intervalSet.getVariables();\n \n if(nvar<vars.size()){ // make the top part of the tree with variables in X_I\n FiniteStates currentVar=(FiniteStates)vars.elementAt(nvar);\n int ncases=currentVar.getNumStates();\n probTree.assignVar(currentVar);\n conf.insert(currentVar, 0);\n for(int i=0;i<ncases;i++){\n conf.putValue(currentVar,i);\n intervalsToPTreeCredalSet(intervalSet,probTree.getChild(i),conf,nvar+1);\n }\n } // end if\n else{\n FiniteStates conditionalVar=(FiniteStates)(intervalSet.getVariables().elementAt(0));\n PotentialInterval intervalSetRestricted = (PotentialInterval)intervalSet.restrictVariable(conf);\n Vector extremePoints=intervalSetRestricted.getListExtrems();\n int nExtrems=extremePoints.size();\n FiniteStates transp=appendTransparentVariable(nExtrems);\n int ncases=conditionalVar.getNumStates();\n \n probTree.assignVar(transp);\n for(int i=0;i<nExtrems;i++){\n double array[]=(double [])(extremePoints.elementAt(i));\n probTree.getChild(i).assignVar(conditionalVar);\n for(int j=0;j<ncases;j++){\n probTree.getChild(i).getChild(j).assignProb(array[j]);\n }\n }\n } // end else\n }", "public abstract double[] getLowerBound();", "public abstract void setValue(R1Interval interval, double value);", "default DiscreteSet2D superLevelSet(double value) {\r\n\t\treturn pointsSatisfying(d -> d >= value);\r\n\t}", "public void setDomain(Concept _domain) { domain = _domain; }", "public abstract void setUncertaintyInterval(double dx);", "IntervalTupleList evaluate(double low, double high);", "public void setBoundary(int value) {\n this.boundary = value;\n }", "public static BsonDocument createPartitionBounds(final BsonValue lower, final BsonValue upper) {\n BsonDocument partitionBoundary = new BsonDocument();\n if (lower.getBsonType() != BsonType.MIN_KEY) {\n partitionBoundary.append(\"$gte\", lower);\n }\n if (upper.getBsonType() != BsonType.MAX_KEY) {\n partitionBoundary.append(\"$lt\", upper);\n }\n return partitionBoundary;\n }", "private double transform(Point_dt range, double x, Point_dt new_range) {\n\t\tdouble dx1 = range.y() - range.x();\n\t\tdouble dx2 = new_range.y() - new_range.x();\n\n\t\tdouble scale = (x - range.x()) / dx1;\n\t\tdouble ans = new_range.x() + dx2 * scale;\n\t\treturn ans;\n\t}", "public Cut<C> b(BoundType boundType, DiscreteDomain<C> discreteDomain) {\n switch (boundType) {\n case CLOSED:\n Comparable previous = discreteDomain.previous(this.a);\n return previous == null ? Cut.e() : new AboveValue<>(previous);\n case OPEN:\n return this;\n default:\n throw new AssertionError();\n }\n }", "public Bounds[] subdivide() {\n return new Bounds[] {\n getSubdivision(0, 0, 0), getSubdivision(1, 0, 0), getSubdivision(0, 0, 1), getSubdivision(1, 0, 1),\n getSubdivision(0, 1, 0), getSubdivision(1, 1, 0), getSubdivision(0, 1, 1), getSubdivision(1, 1, 1)\n };\n }", "public void changeConstraintsToMoreThan() throws IloException {\n /*\n IloRange notes:\n for expr == rhs, set lb = ub = rhs\n for expr <= rhs, set lb = -infinity and ub = rhs\n for expr >= rhs, set lb = rhs and ub = infinity\n */\n for (int i = 0; i < matrix.getNrows(); i++) {\n IloRange rangedExpression = matrix.getRange(i);\n if (rangedExpression.getLB() <= Double.NEGATIVE_INFINITY) {\n rangedExpression.setBounds(-rangedExpression.getLB(), Double.POSITIVE_INFINITY);\n for (int j = 0; j < matrix.getNrows(); j++) {\n matrix.setNZ(i, j, -matrix.getNZ(i, j));\n }\n }\n }\n }", "@Override\n\tpublic void\n\tscalarSub( double value )\n\t{\n\t\tdata[0] -= value;\n\t\tdata[1] -= value;\n\t\tdata[2] -= value;\n\t}", "ValueRangeConstraint createValueRangeConstraint();", "public void setLimit_lin_x_upper(float limit_lin_x_upper) throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeFloat(__io__address + 36, limit_lin_x_upper);\n\t\t} else {\n\t\t\t__io__block.writeFloat(__io__address + 28, limit_lin_x_upper);\n\t\t}\n\t}", "public void includeDomainInRangeCalculator(IntegerRangeCalculator i)\r\n\t{\r\n\t\ti.include(start);\r\n\t\tif(data.length>0) i.include(start+data.length-1);\r\n\t}", "public abstract void insertRange(int start, double value, int count,\r\n int validSize);", "private Bounds getSubdivision(int x, int y, int z) {\n final int xStep = (maxX - minX + 1) / 2;\n final int yStep = (maxY - minY + 1) / 2;\n final int zStep = (maxZ - minZ + 1) / 2;\n final int newMinX = minX + xStep * x;\n final int newMinY = minY + yStep * y;\n final int newMinZ = minZ + zStep * z;\n return new Bounds(newMinX, newMinY, newMinZ, newMinX + xStep, newMinY + yStep, newMinZ + zStep);\n }", "static void set_bnd ( int N, int b, double[] x )\r\n{\nint i;\r\nfor ( i=1 ; i<=N ; i++ ) {\r\nx[getIndex(0 ,i)] = b==1 ? -x[getIndex(1,i)] : x[getIndex(1,i)];\r\nx[getIndex(N+1,i)] = b==1 ? -x[getIndex(N,i)] : x[getIndex(N,i)];\r\nx[getIndex(i,0 )] = b==2 ? -x[getIndex(i,1)] : x[getIndex(i,1)];\r\nx[getIndex(i,N+1)] = b==2 ? -x[getIndex(i,N)] : x[getIndex(i,N)];\r\n}\r\nx[getIndex(0 ,0 )] = 0.5f*(x[getIndex(1,0 )]+x[getIndex(0 ,1)]);\r\nx[getIndex(0 ,N+1)] = 0.5f*(x[getIndex(1,N+1)]+x[getIndex(0 ,N )]);\r\nx[getIndex(N+1,0 )] = 0.5f*(x[getIndex(N,0 )]+x[getIndex(N+1,1)]);\r\nx[getIndex(N+1,N+1)] = 0.5f*(x[getIndex(N,N+1)]+x[getIndex(N+1,N )]);\r\n\r\n//System.out.println(\"dopo\");\r\n//draw_dens ( N, x );\r\n}", "IntervalTupleList evaluate(Interval x);", "@Override\n protected void doAlgorithmA1() {\n int xP = 0;\n int yP = 0;\n\n\n //Taking the variable out of the list that are in the bounds\n //Testing that the bound has variables\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n xP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX().getPosition();\n }\n int xU = 0;\n int xL = 0;\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n yP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY().getPosition();\n }\n int yU = 0;\n int yL = 0;\n int cright = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCright();\n int cleft = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCleft();\n\n\n\n for (Variable variable : csp.getVars()) {\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n if (variable.getPosition() == xP) {\n xU = variable.getUpperDomainBound();\n xL = variable.getLowerDomainBound();\n }\n }\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n if (variable.getPosition() == yP) {\n yU = variable.getUpperDomainBound();\n yL = variable.getLowerDomainBound();\n }\n }\n }\n\n boolean first = false;\n boolean second = false;\n\n //Testing if the bound is true, false or inconclusive\n\n if (xL + cleft >= yU + cright) {\n first = true;\n }\n if (xU + cleft < yL + cright) {\n second = true;\n }\n\n //are first and second not equal is the bound not inconclusive\n if (first != second) {\n if (first) { //a true Simple Bound was found\n //checks if it was the last constraint in a csp\n //If so the csp is true\n //else check the next constraint and do this method again\n if (csp.getSimpleConstraints().size() - 1 == cIndex) {\n System.out.println(\"P is satisfiable\");\n System.out.println(System.nanoTime()-startTime);\n return;\n } else {\n bIndex = 0;\n cIndex++;\n unit=false;\n doAlgorithmA1();\n }\n } else if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) { //a false Simple Bound was found\n //\n bIndex = 0;\n cIndex = 0;\n if (isInconclusive) {\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n doAlgorithmA2();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n } else {//an inconclusive Simple Bound was found\n //checks if the bound wasn't already inconclusive\n if(!isInconclusive){\n unit=true;\n unitSB = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex);\n }else {\n unit=false;\n }\n isInconclusive = true;\n\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) {\n cIndex = 0;\n bIndex = 0;\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n }\n }", "private ArrayList<Integer> fillDomain() {\n ArrayList<Integer> elements = new ArrayList<>();\n\n for (int i = 1; i <= 10; i++) {\n elements.add(i);\n }\n\n return elements;\n }", "public void setMaxValue(double x) {\r\n\t\tmaxValue = x;\r\n\t}", "public void setParamValueRange(String label, double minValue, double maxValue);", "public void clamp() //TODO: implement\n {\n System.out.println(\"clamp was called!\"); //DEBUGG: check if called, delete if i know when\n /*\n IntegerVectorSpecies _species = (IntegerVectorSpecies)species;\n for (int i = 0; i < genomeLength(); i++)\n {\n int minGene = (int)_species.minGene(i);\n if (genome[i].getValue() < minGene)\n genome[i].setValue(minGene); //what do do for the TraceID?\n else\n {\n int maxGene = (int)_species.maxGene(i);\n if (genome[i].getValue() > maxGene)\n genome[i] = maxGene;\n }\n }\n\n */\n }", "default DiscreteDoubleMap2D dividedBy(double value) {\r\n\t\treturn pushForward(d -> d / value);\r\n\t}", "public static Pair<BoundUpdate, BoundUpdate> rearrange(WInequality ieq,\n\t\t\tWRational term, WExpr v) {\n\t\tPair<WExpr,WExpr> r = rearrangeFor(v,ieq);\t\t\t\t\n\t\tWExpr factor = r.second();\t\t\n\t\tWExpr remainder = r.first();\n\t\t\t\t\n\t\tif(term != null) {\n\t\t\tPair<WPolynomial,WPolynomial> p = term.rearrangeFor(v);\t\t\n\t\t\tWExpr divisor = WNumerics.normalise(term.denominator());\n\t\t\tfactor = WNumerics.divide(factor,new WRational(p.second()).negate());\t\t\t\t\t\n\t\t\tremainder = WNumerics.subtract(remainder,new WRational(p.first()));\t\t\t\n\t\t\tremainder = WNumerics.divide(remainder,divisor);\n\t\t}\t\t\n\t\t\n\t\tif (factor instanceof WNumber) {\n\t\t\tBoundUpdate lower = null;\n\t\t\tBoundUpdate upper = null;\n\n\t\t\tWNumber constant = (WNumber) factor;\n\t\t\t// look at the sign of the coefficient to\n\t\t\t// determine whether or not we have an upper or lower bound.\t\t\t\n\t\t\tif (constant.compareTo(WNumber.ZERO) < 0) {\n\t\t\t\tif (ieq.sign()) {\t\t\t\t\t\n\t\t\t\t\tlower = new BoundUpdate(v, negate(remainder), (WNumber) negate(constant), false);\n\t\t\t\t} else {\t\t\t\t\t\n\t\t\t\t\tupper = new BoundUpdate(v, negate(remainder), (WNumber) negate(constant), true);\n\t\t\t\t}\n\t\t\t} else if (constant.compareTo(WNumber.ZERO) > 0) {\n\t\t\t\tif (ieq.sign()) {\t\t\t\t\t\n\t\t\t\t\tupper = new BoundUpdate(v, remainder, constant, false);\n\t\t\t\t} else {\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tlower = new BoundUpdate(v, remainder, constant, true);\n\t\t\t\t}\n\t\t\t}\n\t\t\t/*\n\t\t\tif(lower != null) {\n\t\t\t\tif(lower.sign) {\n\t\t\t\t\tSystem.out.println(lower.factor + \"*\" + v + \" > \" + lower.poly);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(lower.factor + \"*\" + v + \" >= \" + lower.poly);\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t\tif(upper != null) {\n\t\t\t\tif(upper.sign) {\n\t\t\t\t\tSystem.out.println(upper.factor + \"*\" + v + \" < \" + upper.poly);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(upper.factor + \"*\" + v + \" <= \" + upper.poly);\n\t\t\t\t}\t\t\t\n\t\t\t}\t\t\t\n\t\t\t*/\n\t\t\treturn new Pair<BoundUpdate, BoundUpdate>(lower, upper);\n\t\t} else {\n\t\t\t// In this case, the factor is not a constant which indicates a\n\t\t\t// non-linear constraint. At the moment, there's nothing we can\n\t\t\t// do about this so we silently drop it ... making the system\n\t\t\t// unsound.\n\t\t\treturn new Pair(null, null);\n\t\t}\t\t\t\t\n\t}", "float getXStepMax();", "public void setX(double value) {\n this.x = value;\n }", "public static double limitRange( double val )\n {\n if( val > 1.0 )//If number is greater than 1.0, it becomes 1.0.\n {\n val = 1.0; \n }\n else if( val < -1.0 )//Else if number is less than -1.0, it becomes -1.0.\n {\n val = -1.0;\n }\n \n //Returns the limited number\n return val;\n }", "public interface AxisSplitter<P> {\n\t/**\n\t * Given the a set of points, select the axis to split the data along and select a point to divide the data.\n\t * Points whput items below the threshold\n\t * into left and above into right. Data is optional and should be ignored if null. The selected\n\t *\n\t * @param points Input: Set of points.\n\t * @param indexes Input: (Optional) Option index asssociated with points. Can be null.\n\t * @param left Output: Storage for points less than the split point.\n\t * @param leftIndexes Output: (Optional) Storage for indexes associated with left. Can be null.\n\t * @param right Output: Storage for points more than the split point.\n\t * @param righrIndexes Output: (Optional) Storage for indexes associated with right. Can be null.\n\t */\n\tvoid splitData( List<P> points , @Nullable GrowQueue_I32 indexes ,\n\t\t\t\t\tList<P> left , @Nullable GrowQueue_I32 leftIndexes ,\n\t\t\t\t\tList<P> right , @Nullable GrowQueue_I32 righrIndexes );\n\n\t/**\n\t * Returns the point used to split the data\n\t */\n\tP getSplitPoint();\n\n\t/**\n\t * Index associated with the split point\n\t */\n\tint getSplitIndex();\n\n\t/**\n\t * The axis/dimension that the input list was split on\n\t */\n\tint getSplitAxis();\n\n\t/**\n\t * Number of elements in a point\n\t */\n\tint getPointLength();\n}", "@Override\n public Variable useHeuristic(Deque<Variable> deque) {\n Variable highDomain = deque.getFirst();\n for (Variable var : deque){\n if (var.getDomain().size() > highDomain.getDomain().size()){\n highDomain = var;\n }\n }\n return highDomain;\n }", "public void setX(double x)\n\t\t{\n\t\t this.x[0] = x;\n\t\t}", "public static IntStrategy minDom_MidValue(boolean floor, IntVar... VARS) {\n return custom(minDomainSize_var_selector(), mid_value_selector(floor), VARS);\n }", "@Model\n\tprotected void advanceX(double dt) throws IllegalArgumentException {\n\t\tif (!isValidDt(dt)) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\t\n\t\tdouble max_s = maxAdvanceX(dt);\n\t\t// This second formula can be changed, the first one is static.\n\t\tdouble actual_s = maxAdvanceX(dt);\n\t\tdouble newx = getX() + Math.min(max_s, actual_s);\n\t\t\n\t\tsetXWithinBounds(newx);\n\t}", "protected abstract R toRange(D lower, D upper);", "public void setBounds(int var1, int var2, int var3, int var4) {\n if(var1 < 0) {\n var1 = 0;\n }\n\n if(var2 < 0) {\n var2 = 0;\n }\n\n if(var3 > this.field_723) {\n var3 = this.field_723;\n }\n\n if(var4 > this.field_724) {\n var4 = this.field_724;\n }\n\n this.field_745 = var1;\n this.field_743 = var2;\n this.field_746 = var3;\n this.field_744 = var4;\n }", "@Override\n public void setValue(int value) {\n int oldValue = getValue();\n if (oldValue == value) {\n return;\n }\n\n // Compute new value and extent to maintain upper value.\n int oldExtent = getExtent();\n int newValue = Math.min(Math.max(getMinimum(), value), oldValue + oldExtent);\n int newExtent = oldExtent + oldValue - newValue;\n\n // Set new value and extent, and fire a single change event.\n getModel().setRangeProperties(newValue, newExtent, getMinimum(), \n getMaximum(), getValueIsAdjusting());\n }", "public void setX(double newX) {\r\n x = newX;\r\n }", "public void setX(double x){\n this.x = x;\n }", "public void setX(double x){\n this.x = x;\n }", "@Override\n\tprotected void setUpperBound() {\n\t\t\n\t}", "protected void setXWithinBounds(double x) {\n\t\tif (getWorld() != null && (x < 0 || x >= getWorld().getWorldWidth()))\n\t\t\t\tterminate();\n\t\tsetX(Math.max(x, 0));\n\t}", "public void setX(double X)\r\n {\r\n curX = X;\r\n }", "public void setRange(double lower, double upper) {\n/* 625 */ if (lower >= upper) {\n/* 626 */ throw new IllegalArgumentException(\"Requires 'lower' < 'upper'.\");\n/* */ }\n/* 628 */ setRange(new DateRange(lower, upper));\n/* */ }", "public void setValue(int n) {\r\n Throwable t = new Throwable();\r\n t.printStackTrace();\r\n int newValue = Math.max(n, min);\r\n if (newValue + getExtent() > max) {\r\n newValue = max - getExtent();\r\n }\r\n\r\n setRangeProperties(newValue, getExtent(), min, max, isAdjusting);\r\n }", "public LinearXOverPerDimension( Environment _environment, Selection _selection ){\n super( _environment, _selection );\n }", "public void setX(double x) {\n this.x = x;\r\n }", "public Cut<C> a(BoundType boundType, DiscreteDomain<C> discreteDomain) {\n switch (boundType) {\n case CLOSED:\n return this;\n case OPEN:\n Comparable previous = discreteDomain.previous(this.a);\n return previous == null ? Cut.d() : new AboveValue<>(previous);\n default:\n throw new AssertionError();\n }\n }", "@JSProperty(\"range\")\n void setRange(double value);", "private double getRangeCenter(int lowerBound, int upperBound) {\n return (lowerBound + upperBound) / 2.0;\n }", "public Cut<Comparable<?>> c(DiscreteDomain<Comparable<?>> discreteDomain) {\n try {\n return Cut.b(discreteDomain.minValue());\n } catch (NoSuchElementException unused) {\n return this;\n }\n }", "public void narrowRange(int min, int max, Boolean axis) {\n\t\tint counter=0; // how much points we erasing total ?\n\t\tboolean erasingAll=false; // if we eventually erasing all the database\n\t\t// by axis X-----------------------------------------//\n\t\tif (axis){ \n\t\t\tthis.current = this.minx;\n\t\t\twhile (!erasingAll && this.current.getData().getX()<min){\n\t\t\t\tnarrowOppPoint(this.current,axis); // deleting this point in y axis\n\t\t\t\tthis.current = this.current.getNextX(); \n\t\t\t\tcounter++;\n\t\t\t\tif (this.current==null) //if we get to the edge of the DS\n\t\t\t\t\terasingAll=true;\n\t\t\t}\n\t\t\tif (!erasingAll)\n\t\t\t\tthis.current.setPrevX(null);\n\t\t\tthis.minx = this.current; // the actual erasing\n\t\t\t//---//\n\t\t\tthis.current = this.maxx;\n\t\t\twhile (!erasingAll && this.current.getData().getX() > max){\n\t\t\t\tnarrowOppPoint(this.current,axis);\n\t\t\t\tthis.current = this.current.getPrevX(); \n\t\t\t\tcounter++;\n\t\t\t\tif (this.current==null) //if we get to the edge of the DS\n\t\t\t\t\terasingAll=true;\n\t\t\t}\n\t\t\tif (!erasingAll)\n\t\t\t\tthis.current.setNextX(null);\n\t\t\tthis.maxx = this.current; //the actual erasing\n\t\t}\n\t\t// by axis Y -----------------------------------------------------------//\n\t\telse{ \n\t\t\tthis.current = this.miny;\n\t\t\twhile (!erasingAll && this.current.getData().getY()<min){\n\t\t\t\tnarrowOppPoint(this.current,axis);\n\t\t\t\tthis.current = this.current.getNextY(); \n\t\t\t\tcounter++;\n\t\t\t\tif (this.current==null) //if we get to the edge of the DS\n\t\t\t\t\terasingAll=true;\n\t\t\t}\n\t\t\tif (!erasingAll)\n\t\t\t\tthis.current.setPrevY(null);\n\t\t\tthis.miny = this.current; //the actual erasing\n\t\t\t//--//\n\t\t\tthis.current = this.maxy;\n\t\t\twhile (!erasingAll && this.current.getData().getY() > max){\n\t\t\t\tnarrowOppPoint(this.current,axis);\n\t\t\t\tthis.current = this.current.getPrevY(); \n\t\t\t\tcounter++;\n\t\t\t\tif (this.current==null) //if we get to the edge of the DS\n\t\t\t\t\terasingAll=true;\n\t\t\t}\n\t\t\tif (!erasingAll)\n\t\t\t\tthis.current.setNextY(null);\n\t\t\tthis.maxy = this.current; //the actual erasing\n\t\t}\n\t\tthis.size = this.size - counter; // Update the size of the DS\n\t}", "public void setX(double x)\n {\n this.x = x;\n }", "private void normalize() {\r\n // GET MAX PRICE \r\n for (Alternative alt : alternatives) {\r\n if (alt.getPrice() > 0 && alt.getPrice() < minPrice) {\r\n minPrice = alt.getPrice();\r\n }\r\n }\r\n\r\n for (Alternative alt : alternatives) {\r\n // NORMALIZE PRICE - NON BENIFICIAL using max - min \r\n double price = alt.getPrice();\r\n double value = minPrice / price;\r\n alt.setPrice(value);\r\n // BENITIFICIAL v[i,j] = x[i,j] / x[max,j]\r\n double wood = alt.getWood();\r\n value = wood / maxWood;\r\n alt.setWood(value);\r\n\r\n double brand = alt.getBrand();\r\n value = wood / maxBrand;\r\n alt.setBrand(value);\r\n\r\n double origin = alt.getOrigin();\r\n value = origin / maxOrigin;\r\n alt.setOrigin(value);\r\n\r\n }\r\n }", "void setX(double x){\r\n\t\tthis.x=x;\r\n\t}", "static public double lim(double x,double min,double max) {\r\n\t\t if(x<min) return min;\r\n\t\t if(x>max) return max;\r\n\t\t return x;\r\n\t}", "public SelectorForNumber[] divide(double divider) {\n SelectorForNumber[] result = new SelectorForNumber[2];\n switch(type) {\n case ALL_VALUES: {\n result[0] = getSelLE(attributeId, divider - delta);\n result[1] = getSelGT(attributeId, divider);\n break;\n }\n case BELONGS_RIGHT_INCLUDING: {\n if (divider == lowerLimit) {\n result[0] = null;\n result[1] = this;\n }\n else {\n if (divider > lowerLimit) {\n if (divider == upperLimit) {\n result[0] = getSelBelongs(attributeId, lowerLimit, divider - delta);\n result[1] = null;\n }\n else if (divider > upperLimit) {\n result[0] = this;\n result[1] = null;\n }\n else {\n // lowerLimit < divider < upperLimit\n result[0] = getSelBelongs(attributeId, lowerLimit, divider - delta);\n result[1] = getSelBelongs(attributeId, divider, upperLimit);\n }\n }\n else {\n // divider < lowerLimit\n result[0] = null;\n result[1] = this;\n }\n }\n break;\n }\n case EQUAL: {\n if (divider == lowerLimit)\n result[0] = this;\n break;\n }\n case GREATER_THAN: {\n if (divider == lowerLimit) {\n result[0] = null;\n result[1] = this;\n }\n else if (divider > lowerLimit) {\n result[0] = getSelBelongs(attributeId, lowerLimit, divider - delta);\n result[1] = getSelGT(attributeId, divider);\n }\n // else -> divider < lowerLimit, so there's no selector to return;\n break;\n }\n case LOWER_OR_EQUAL: {\n if (divider == upperLimit) {\n result[0] = getSelLE(attributeId, divider - delta);\n result[1] = null;\n }\n else if (divider < upperLimit) {\n result[0] = getSelLE(attributeId, divider - delta);\n result[1] = getSelBelongs(attributeId, divider, upperLimit);\n } \n // else -> divider > lowerLimit, so there's no selector to return;\n break;\n }\n case NONE_VALUE: { // Nothing to return.\n break;\n }\n }\n return result;\n }", "public void setXDataRange(float min, float max);", "private Set<Variable> extractBlockedDomainVars(Variable rangeVariable, ImmutableSet<Variable> domainVariables,\n ImmutableSet<Variable> aggregationVariables) {\n if (aggregationVariables.contains(rangeVariable))\n return domainVariables;\n\n Sets.SetView<Variable> aggregationDomainVariables = Sets.intersection(domainVariables, aggregationVariables);\n\n // Equalities from an aggregation variable to a grouping variable are blocked\n if (groupingVariables.contains(rangeVariable))\n return aggregationDomainVariables;\n\n // Fresh variables: need at least one variable to become projected\n // the latter may be an aggregation variable if there is no grouping variable\n Variable dominantVariable = aggregationDomainVariables.stream()\n .findAny()\n .orElseGet(() -> domainVariables.iterator().next());\n\n return Sets.difference(aggregationDomainVariables, ImmutableSet.of(dominantVariable));\n }", "public double[] getRange();", "int getBoundsX();", "public void setXCoordinates(double newX) { this.xCoordinates = newX; }", "private void updateSplitValue() {\n\t\tsplitValue = peopleSeekBar.getProgress();\t\n\t\tif ( splitValue < 1 ) {\n\t\t\tsplitValue = 1;\n\t\t}\n\t}", "IMotion splice(int splitTickStart, int splitTickEnd);", "public void NewX(double x){\n\t\tthis.x = x;\n\t}", "Limits limits();", "public void setUpperValue(int value) {\n // Compute new extent.\n int lowerValue = getValue();\n int newExtent = Math.min(Math.max(0, value - lowerValue), getMaximum() - lowerValue);\n \n // Set extent to set upper value.\n setExtent(newExtent);\n }" ]
[ "0.59866685", "0.57537043", "0.57494843", "0.56120414", "0.55461705", "0.5348587", "0.5314673", "0.52857125", "0.52325666", "0.52240455", "0.521972", "0.51883084", "0.51837367", "0.5181925", "0.5112545", "0.5107502", "0.50887024", "0.5081893", "0.50739723", "0.5061396", "0.5044892", "0.50233436", "0.5015838", "0.5008757", "0.500738", "0.50059026", "0.49950176", "0.49461257", "0.49320498", "0.4915503", "0.48930758", "0.48861343", "0.4871983", "0.48579842", "0.48431936", "0.48421934", "0.4826546", "0.4824467", "0.4817373", "0.4806239", "0.48001897", "0.479816", "0.47915086", "0.47838715", "0.47795126", "0.47608846", "0.4754673", "0.47489157", "0.47419378", "0.4739481", "0.4733782", "0.47214878", "0.4711081", "0.47028595", "0.47010458", "0.47001848", "0.46983594", "0.46954745", "0.4683651", "0.46819934", "0.46772462", "0.46756175", "0.4672766", "0.46675846", "0.46618783", "0.46603596", "0.46534714", "0.46507418", "0.46469882", "0.4639379", "0.4636683", "0.463541", "0.46199572", "0.46199572", "0.46185315", "0.46130186", "0.46111768", "0.46101573", "0.46042725", "0.46031162", "0.4600789", "0.4599209", "0.4595567", "0.45933852", "0.4591052", "0.45906115", "0.45865127", "0.45763993", "0.45748788", "0.45709208", "0.4570552", "0.45676753", "0.4565592", "0.45634848", "0.4563074", "0.45598248", "0.45531288", "0.45507717", "0.4546301", "0.45462355", "0.45440492" ]
0.0
-1
Split the domain of the selected variable at the selected value, by updating the lower bound. e.g. X >= 42 If this decision fails, it is automatically negated (i.e. X < 42)
public static DecisionOperator<IntVar> reverse_split() { return DecisionOperator.int_reverse_split; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setLowerBound (int lowerBound) throws ModelException;", "public void update_domain(int value, int lowerBound, int upperBound) {\n domain_history.push(domain.copy());\n domain.getDomain().remove((Integer) value);\n domain.getDomain().removeIf(d -> d > upperBound || d < lowerBound);\n }", "protected void mapValueToWithinBounds() {\n if (getAllele() != null) {\n \tFloat d_value = ( (Float) getAllele());\n if (d_value.isInfinite()) {\n // Here we have to break to avoid a stack overflow.\n // ------------------------------------------------\n return;\n }\n // If the value exceeds either the upper or lower bounds, then\n // map the value to within the legal range. To do this, we basically\n // calculate the distance between the value and the float min,\n // then multiply it with a random number and then care that the lower\n // boundary is added.\n // ------------------------------------------------------------------\n if (d_value.floatValue() > m_upperBound ||\n d_value.floatValue() < m_lowerBound) {\n RandomGenerator rn;\n if (getConfiguration() != null) {\n rn = getConfiguration().getRandomGenerator();\n }\n else {\n rn = new StockRandomGenerator();\n }\n setAllele(new Float((rn.nextFloat()\n * ((m_upperBound - m_lowerBound))) + m_lowerBound));\n }\n }\n }", "@Override\n\tprotected void setLowerBound() {\n\t\t\n\t}", "public void changeRangeX(double limiteInitial, double limiteFinal, double space){\n //rango eje x\n xAxis = (NumberAxis) plot.getDomainAxis();\n xAxis.setRange(limiteInitial, limiteFinal);//agrego el rango en el eje de las x\n xAxis.setTickUnit(new NumberTickUnit(space));//agrego el espacio entre cada rango\n }", "public void setLowerBound(String lower) {\n lowerBound = lower;\n }", "public abstract DoublePredicate lowerPredicate(double lowerBound);", "public void changeConstraintsToLessThan() throws IloException {\n /*\n IloRange notes:\n for expr == rhs, set lb = ub = rhs\n for expr <= rhs, set lb = -infinity and ub = rhs\n for expr >= rhs, set lb = rhs and ub = infinity\n */\n for (int i = 0; i < matrix.getNrows(); i++) {\n IloRange rangedExpression = matrix.getRange(i);\n if (rangedExpression.getUB() >= Double.POSITIVE_INFINITY) {\n rangedExpression.setBounds(Double.NEGATIVE_INFINITY, -rangedExpression.getUB());\n for (int j = 0; j < matrix.getNrows(); j++) {\n matrix.setNZ(i, j, -matrix.getNZ(i, j));\n }\n }\n }\n }", "public void boundsLex(int [] a , IntDomainVar [] x , int [] b,int j) throws ContradictionException{\n\n int i =0;\n\n\n while( i< n && a[i]==b[i]){\n\n\n if((x[i].getInf()==a[i] || x[i].updateInf(a[i], this, false)) &&\n (x[i].getSup()==b[i] || x[i].updateSup(b[i], this, false))){\n i++;\n }else{\n this.fail();\n }\n\n }\n\n\n if(i<n )\n if ((x[i].getInf()==a[i] || x[i].updateInf(a[i], this, false)) &&\n (x[i].getSup()==b[i] || x[i].updateSup(b[i], this, false))){\n }else{\n this.fail();\n }\n\n\n if(i==n || x[i].getNextDomainValue(a[i])<b[i]){\n return ;\n }\n\n i+=1;\n\n while(i<n && (b[i]+1 <= a[i]-1) && x[i].getInf()==b[i] && x[i].getSup()==a[i]){\n if(x[i].removeInterval(b[i]+1,a[i]-1, this, false)){\n i++;\n }else{\n this.fail();\n\n }\n }\n\n if(i<n) {\n if (b[i] + 1 <= a[i] - 1 && x[i].getInf() <= b[i] &&\n b[i] <= x[i].getSup() && x[i].getSup() >= a[i] && a[i] >= x[i].getInf()) {\n if (!x[i].removeInterval(b[i] + 1, a[i] - 1, this, false)) {\n this.fail();\n }\n }\n }\n\n }", "public void changeConstraintsToMoreThan() throws IloException {\n /*\n IloRange notes:\n for expr == rhs, set lb = ub = rhs\n for expr <= rhs, set lb = -infinity and ub = rhs\n for expr >= rhs, set lb = rhs and ub = infinity\n */\n for (int i = 0; i < matrix.getNrows(); i++) {\n IloRange rangedExpression = matrix.getRange(i);\n if (rangedExpression.getLB() <= Double.NEGATIVE_INFINITY) {\n rangedExpression.setBounds(-rangedExpression.getLB(), Double.POSITIVE_INFINITY);\n for (int j = 0; j < matrix.getNrows(); j++) {\n matrix.setNZ(i, j, -matrix.getNZ(i, j));\n }\n }\n }\n }", "public abstract double[] getLowerBound();", "public void setLowerBound(final int lowerBound) {\r\n this.lowerBound = lowerBound;\r\n }", "R visitBoundVariable(Formula f, int deBruijnIdx);", "void assignRange() {\n rangeIndex = (int) Math.floor(value / step);\n }", "Range controlLimits();", "private double clamp(double v, double min, double max) { return (v < min ? min : (v > max ? max : v)); }", "public void setLowerBound (int lowerBound) throws ModelException\n\t{\n\t\tif ((lowerBound > getUpperBound()) || (lowerBound < 0))\n\t\t{\n\t\t\tthrow new ModelException(I18NHelper.getMessage(getMessages(),\n\t\t\t\t\"jdo.relationship.lower_cardinality_invalid\"));\t\t// NOI18N\n\t\t}\n\n\t\tgetRelationshipImpl().setLowerBound(lowerBound);\n\t}", "public V getLowerBound();", "public void setInput(double x)\n {\n if(domain.contains(x))\n this.x = x;\n else\n throw new BadParameterException(\"The input value \"+x+\" was rejected \"\n + \"as it is outside of the domain for this input: \"\n + \"[\"+domain.getLeft()+\", \"+domain.getRight()+\"].\");\n }", "protected abstract D getLower(R range);", "boolean isBoundVariable(Formula f);", "public Range getRangeX(double lowerPercent, double upperPercent, \n PlotRenderingInfo info, Point2D source) {\n \t\t\n \t double start = super.getDomainAxis().getRange().getLowerBound();\n double length = super.getDomainAxis().getRange().getLength();\n Range adjusted = null;\n if (super.getDomainAxis().isInverted()) {\n adjusted = new Range(start + (length * (1 - upperPercent)), \n start + (length * (1 - lowerPercent))); \n }\n else {\n adjusted = new Range(start + length * lowerPercent, \n start + length * upperPercent);\n }\n return adjusted;\n }", "public int getLowerBound ();", "public static double limitRange( double val )\n {\n if( val > 1.0 )//If number is greater than 1.0, it becomes 1.0.\n {\n val = 1.0; \n }\n else if( val < -1.0 )//Else if number is less than -1.0, it becomes -1.0.\n {\n val = -1.0;\n }\n \n //Returns the limited number\n return val;\n }", "public Cut<Comparable<?>> b(BoundType boundType, DiscreteDomain<Comparable<?>> discreteDomain) {\n throw new AssertionError(\"this statement should be unreachable\");\n }", "public abstract void setRange(double value, int start, int count);", "public void includeDomainInRangeCalculator(IntegerRangeCalculator i)\r\n\t{\r\n\t\ti.include(start);\r\n\t\tif(data.length>0) i.include(start+data.length-1);\r\n\t}", "public static double inInterval(double lowerBound, double value, double upperBound) {\n/* 67 */ if (value < lowerBound)\n/* 68 */ return lowerBound; \n/* 69 */ if (upperBound < value)\n/* 70 */ return upperBound; \n/* 71 */ return value;\n/* */ }", "public void clamp() //TODO: implement\n {\n System.out.println(\"clamp was called!\"); //DEBUGG: check if called, delete if i know when\n /*\n IntegerVectorSpecies _species = (IntegerVectorSpecies)species;\n for (int i = 0; i < genomeLength(); i++)\n {\n int minGene = (int)_species.minGene(i);\n if (genome[i].getValue() < minGene)\n genome[i].setValue(minGene); //what do do for the TraceID?\n else\n {\n int maxGene = (int)_species.maxGene(i);\n if (genome[i].getValue() > maxGene)\n genome[i] = maxGene;\n }\n }\n\n */\n }", "default DiscreteSet2D superLevelSet(double value) {\r\n\t\treturn pointsSatisfying(d -> d >= value);\r\n\t}", "public Cut<Comparable<?>> b(BoundType boundType, DiscreteDomain<Comparable<?>> discreteDomain) {\n throw new IllegalStateException();\n }", "private void validateParameter(){\n\t\tif(hrNum > upperBound){\n\t\t\thrNum = upperBound;\n\t\t}\n\t\telse if(hrNum < lowerBound){\n\t\t\thrNum = lowerBound;\n\t\t}\n\t}", "@Test\n public void test_lowerBound() {\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(0.0d, new double[] {1, 2, 3})).isEqualTo(0);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(0.5d, new double[] {1, 2, 3})).isEqualTo(0);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(0.9999d, new double[] {1, 2, 3})).isEqualTo(0);\n // good input\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(1.0d, new double[] {1, 2, 3})).isEqualTo(0);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(1.0001d, new double[] {1, 2, 3})).isEqualTo(0);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(1.9999d, new double[] {1, 2, 3})).isEqualTo(0);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(2.0d, new double[] {1, 2, 3})).isEqualTo(1);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(2.0001d, new double[] {1, 2, 3})).isEqualTo(1);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(2.9999d, new double[] {1, 2, 3})).isEqualTo(1);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(3.0d, new double[] {1, 2, 3})).isEqualTo(2);\n // bad input, but still produces good output\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(3.0001d, new double[] {1, 2, 3})).isEqualTo(2);\n // check zero\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(-1.0d, new double[] {-1, 0, 1})).isEqualTo(0);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(-0.9999d, new double[] {-1, 0, 1})).isEqualTo(0);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(-0.0001d, new double[] {-1, 0, 1})).isEqualTo(0);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(-0.0d, new double[] {-1, 0, 1})).isEqualTo(1);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(0.0d, new double[] {-1, 0, 1})).isEqualTo(1);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(1.0d, new double[] {-1, 0, 1})).isEqualTo(2);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(1.5d, new double[] {-1, 0, 1})).isEqualTo(2);\n }", "private Set<Variable> extractBlockedDomainVars(Variable rangeVariable, ImmutableSet<Variable> domainVariables,\n ImmutableSet<Variable> aggregationVariables) {\n if (aggregationVariables.contains(rangeVariable))\n return domainVariables;\n\n Sets.SetView<Variable> aggregationDomainVariables = Sets.intersection(domainVariables, aggregationVariables);\n\n // Equalities from an aggregation variable to a grouping variable are blocked\n if (groupingVariables.contains(rangeVariable))\n return aggregationDomainVariables;\n\n // Fresh variables: need at least one variable to become projected\n // the latter may be an aggregation variable if there is no grouping variable\n Variable dominantVariable = aggregationDomainVariables.stream()\n .findAny()\n .orElseGet(() -> domainVariables.iterator().next());\n\n return Sets.difference(aggregationDomainVariables, ImmutableSet.of(dominantVariable));\n }", "public void setMinValue(double x) {\r\n\t\tminValue = x;\r\n\t}", "IntervalTupleList evaluate(double low, double high);", "@Override\n protected void doAlgorithmA1() {\n int xP = 0;\n int yP = 0;\n\n\n //Taking the variable out of the list that are in the bounds\n //Testing that the bound has variables\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n xP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX().getPosition();\n }\n int xU = 0;\n int xL = 0;\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n yP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY().getPosition();\n }\n int yU = 0;\n int yL = 0;\n int cright = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCright();\n int cleft = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCleft();\n\n\n\n for (Variable variable : csp.getVars()) {\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n if (variable.getPosition() == xP) {\n xU = variable.getUpperDomainBound();\n xL = variable.getLowerDomainBound();\n }\n }\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n if (variable.getPosition() == yP) {\n yU = variable.getUpperDomainBound();\n yL = variable.getLowerDomainBound();\n }\n }\n }\n\n boolean first = false;\n boolean second = false;\n\n //Testing if the bound is true, false or inconclusive\n\n if (xL + cleft >= yU + cright) {\n first = true;\n }\n if (xU + cleft < yL + cright) {\n second = true;\n }\n\n //are first and second not equal is the bound not inconclusive\n if (first != second) {\n if (first) { //a true Simple Bound was found\n //checks if it was the last constraint in a csp\n //If so the csp is true\n //else check the next constraint and do this method again\n if (csp.getSimpleConstraints().size() - 1 == cIndex) {\n System.out.println(\"P is satisfiable\");\n System.out.println(System.nanoTime()-startTime);\n return;\n } else {\n bIndex = 0;\n cIndex++;\n unit=false;\n doAlgorithmA1();\n }\n } else if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) { //a false Simple Bound was found\n //\n bIndex = 0;\n cIndex = 0;\n if (isInconclusive) {\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n doAlgorithmA2();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n } else {//an inconclusive Simple Bound was found\n //checks if the bound wasn't already inconclusive\n if(!isInconclusive){\n unit=true;\n unitSB = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex);\n }else {\n unit=false;\n }\n isInconclusive = true;\n\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) {\n cIndex = 0;\n bIndex = 0;\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n }\n }", "public Cut<C> b(BoundType boundType, DiscreteDomain<C> discreteDomain) {\n switch (boundType) {\n case CLOSED:\n Comparable previous = discreteDomain.previous(this.a);\n return previous == null ? Cut.e() : new AboveValue<>(previous);\n case OPEN:\n return this;\n default:\n throw new AssertionError();\n }\n }", "public int getLowerBound() {\r\n return lowerBound;\r\n }", "public static BsonDocument createPartitionBounds(final BsonValue lower, final BsonValue upper) {\n BsonDocument partitionBoundary = new BsonDocument();\n if (lower.getBsonType() != BsonType.MIN_KEY) {\n partitionBoundary.append(\"$gte\", lower);\n }\n if (upper.getBsonType() != BsonType.MAX_KEY) {\n partitionBoundary.append(\"$lt\", upper);\n }\n return partitionBoundary;\n }", "@Override\n\tpublic AbstractValue greatestLowerBound(AbstractValue d) {\n\t\tif ( !(d instanceof Interval) )\n\t\t\tthrow new IllegalArgumentException(\"v should be of type Interval\");\n\t\tInterval i = (Interval) d;\n\n\t\tif (i.isBottom())\n\t\t\treturn i;\n\t\telse if (i.equals(top))\n\t\t\treturn this;\n\n\t\tString newLow = \"-Inf\", newHigh = \"+Inf\";\n\n\t\t//Calcolare limite inferiore\n\n\t\tif ( this.getLow().equals(\"-Inf\")){\n\t\t\tif( !i.getLow().equals(\"-Inf\"))\n\t\t\t\tif(Integer.parseInt(this.getHigh()) > Integer.parseInt(i.getLow()))\n\t\t\t\t\tnewLow = String.valueOf(Integer.max(Integer.parseInt(this.getLow()), Integer.parseInt(i.getLow())));\n\t\t\t\telse\n\t\t\t\t\treturn BottomAV.getInstance();\n\t\t}else if ( i.getLow().equals(\"-Inf\")){\n\t\t\tif( !this.getLow().equals(\"-Inf\"))\n\t\t\t\tif(Integer.parseInt(i.getHigh()) > Integer.parseInt(this.getLow()))\n\t\t\t\t\tnewLow = String.valueOf(Integer.max(Integer.parseInt(i.getLow()), Integer.parseInt(this.getLow())));\n\t\t\t\telse\n\t\t\t\t\treturn BottomAV.getInstance();\n\t\t}else if(!this.getLow().equals(\"-Inf\") && !i.getLow().equals(\"-Inf\")){\n\t\t\tnewLow = String.valueOf(Integer.max(Integer.parseInt(this.getLow()), Integer.parseInt(i.getLow())));\n\t\t}\n\n\t\t// Calcolare limite superiore\n\n\t\tif ( this.getHigh().equals(\"+Inf\")) {\n\t\t\tif (!i.getHigh().equals(\"+Inf\"))\n\t\t\t\tnewHigh = i.getHigh();\n\t\t}else if ( i.getHigh().equals(\"+Inf\")) {\n\t\t\tif (!this.getHigh().equals(\"+Inf\"))\n\t\t\t\tnewHigh = this.getHigh();\n\t\t}else if(!this.getHigh().equals(\"+Inf\") && !i.getHigh().equals(\"+Inf\")){\n\t\t\tnewHigh = String.valueOf(Integer.min(Integer.parseInt(this.getHigh()), Integer.parseInt(i.getHigh())));\n\t\t}\n\n\t\tInterval res = new Interval(newLow, newHigh);\n\n\t\t// Checks whether low > high\n\t\tif ((!newLow.equals(\"-Inf\") && (!newHigh.equals(\"+Inf\")) && Integer.parseInt(newLow) > Integer.parseInt(newHigh)))\n\t\t\treturn BottomAV.getInstance();\n\n\t\treturn amItop() ? top : res;\n\t}", "public abstract Cut<C> b(BoundType boundType, DiscreteDomain<C> discreteDomain);", "IntVar selectVariable(IntVar[] v) {\r\n\r\n if (v.length != 0) {\r\n int index = 0;\r\n int smallestDomain = Integer.MAX_VALUE;\r\n for(int i = 0; i< v.length-1; i++){\r\n if(v[i].domain.getSize()<smallestDomain){\r\n index = i;\r\n smallestDomain = v[i].domain.getSize();\r\n }\r\n\r\n }\r\n if(v[index].min() == v[index].max()){\r\n\r\n searchVariables = new IntVar[v.length-1];\r\n for (int i = 0; i < v.length-1; i++) {\r\n if(i<index){\r\n searchVariables[i] = v[i];\r\n }\r\n else searchVariables[i] = v[i+1];\r\n\r\n }\r\n }\r\n else{\r\n searchVariables = new IntVar[v.length];\r\n for(int i = 0; i < v.length; i++){\r\n searchVariables[i] = v[i];\r\n }\r\n }\r\n return v[index];\r\n\r\n }\r\n else {\r\n System.err.println(\"Zero length list of variables for labeling\");\r\n return new IntVar(store);\r\n }\r\n }", "private void setMinThreshold() {\n minThreshold = value + value * postBoundChange / 100;\n }", "public void testFindDomainBounds() {\n XYBlockRenderer renderer = new XYBlockRenderer();\n XYSeriesCollection dataset = new XYSeriesCollection();\n XYSeries series = new XYSeries(\"S1\");\n series.add(1.0, null);\n dataset.addSeries(series);\n Range r = renderer.findDomainBounds(dataset);\n dataset.removeAllSeries();\n r = renderer.findDomainBounds(dataset);\n }", "@Override\n\tpublic boolean checkBoundary(float x) {\n\t\tif (!(x >= MINRANGE && x <= MAXRANGE)) {\n\t\t\treturn false;\n\t\t}\n\t\t// if in the range [-512.03, 511.97]\n\t\treturn true;\n\t}", "public void setValidRange (int lowerBounds, int upperBounds)\r\n\t{\r\n\t\tm_lowerBounds = lowerBounds;\r\n\t\tm_upperBounds = upperBounds;\r\n\t}", "public void boundsCheck(BigDecimal d) throws InvalidDatatypeValueException {\n boolean minOk = false;\n boolean maxOk = false;\n String upperBound = (fMaxExclusive != null )? ( fMaxExclusive.toString() ):\n ( ( fMaxInclusive != null )?fMaxInclusive.toString():\"\");\n \n String lowerBound = (fMinExclusive != null )? ( fMinExclusive.toString() ):\n (( fMinInclusive != null )?fMinInclusive.toString():\"\"); \n String lowerBoundIndicator = \"\";\n String upperBoundIndicator = \"\";\n \n \n if ( isMaxInclusiveDefined){\n maxOk = (d.compareTo(fMaxInclusive) <= 0);\n upperBound = fMaxInclusive.toString();\n if ( upperBound != null ){\n upperBoundIndicator = \"<=\"; \n } else {\n upperBound=\"\";\n }\n } else if ( isMaxExclusiveDefined){\n maxOk = (d.compareTo(fMaxExclusive) < 0);\n upperBound = fMaxExclusive.toString();\n if ( upperBound != null ){\n upperBoundIndicator = \"<\";\n } else {\n upperBound = \"\";\n }\n } else{\n maxOk = (!isMaxInclusiveDefined && ! isMaxExclusiveDefined);\n }\n \n \n if ( isMinInclusiveDefined){\n minOk = (d.compareTo(fMinInclusive) >= 0);\n lowerBound = fMinInclusive.toString();\n if( lowerBound != null ){\n lowerBoundIndicator = \"<=\";\n }else {\n lowerBound = \"\";\n }\n } else if ( isMinExclusiveDefined){\n minOk = (d.compareTo(fMinExclusive) > 0);\n lowerBound = fMinExclusive.toString();\n if( lowerBound != null ){\n lowerBoundIndicator = \"<\";\n } else {\n lowerBound = \"\";\n }\n } else{\n minOk = (!isMinInclusiveDefined && !isMinExclusiveDefined);\n }\n \n if (!(minOk && maxOk))\n throw new InvalidDatatypeValueException (\n getErrorString(DatatypeMessageProvider.OutOfBounds,\n DatatypeMessageProvider.MSG_NONE,\n new Object [] { d.toString() , lowerBound ,\n upperBound, lowerBoundIndicator, upperBoundIndicator}));\n \n }", "public Cut<Comparable<?>> a(BoundType boundType, DiscreteDomain<Comparable<?>> discreteDomain) {\n throw new AssertionError(\"this statement should be unreachable\");\n }", "public abstract Cut<C> a(BoundType boundType, DiscreteDomain<C> discreteDomain);", "static boolean updateEndpoint(R1Interval bound, boolean slopeNegative, double value) {\n if (!slopeNegative) {\n if (bound.hi() < value) {\n return false;\n }\n if (bound.lo() < value) {\n bound.setLo(value);\n }\n } else {\n if (bound.lo() > value) {\n return false;\n }\n if (bound.hi() > value) {\n bound.setHi(value);\n }\n }\n return true;\n }", "private double applyLimitBounds(double value) {\n if(value > 1.0) {\n value = 1.0;\n }\n if(value < -1.0) {\n value = -1.0;\n }\n\n // Absolute limits:\n if(lifter.getBottomLimit() && lifter.getUpperLimit()) {\n if(value < 0) {\n value = 0; // Can't go down from the bottom;\n }\n }\n\n if((lifter.getUpperLimit() && lifter.getUpperWarning()) && lifter.getUpperSmallPieceDetector()) {\n if(value > 0) {\n value = 0; // Can't go up from the top\n }\n }\n\n // Slow speed zones\n if(lifter.getBottomWarning()) {\n if(value < -0.3) {\n value = -0.3;\n }\n }\n\n if(lifter.getUpperWarning()) {\n if(value > 0.7) {\n value = 0.7;\n }\n }\n\n printLimits();\n\n return value;\n }", "private List<HashMap<TimeSelector, Long>> updateLt(\n HashMap<ComparableExpression, HashSet<ComparableExpression>> rLt,\n HashMap<TimeSelector, Long> lowerBounds, HashMap<TimeSelector, Long> upperBounds)\n throws QueryContradictoryException {\n\n ArrayList<ArrayList<ComparableExpression>> lt = relationToTuples(rLt);\n for (ArrayList<ComparableExpression> tuple : lt) {\n TimeSelector selector = null;\n Long literalValue = null;\n // only comparisons between a selector and a literal are interesting here\n // selector < literal => upper(selector) = min(upper(selector), literal-1)\n if (tuple.get(0) instanceof TimeSelector && tuple.get(1) instanceof TimeLiteral) {\n selector = (TimeSelector) tuple.get(0);\n literalValue = ((TimeLiteral) tuple.get(1)).getMilliseconds() - 1;\n upperBounds.put(selector, Math.min(upperBounds.get(selector), literalValue));\n } else if (tuple.get(1) instanceof TimeSelector &&\n tuple.get(0) instanceof TimeLiteral) {\n // selector > literal => lower(selector) = max(lower(selector), literal+1)\n selector = (TimeSelector) tuple.get(1);\n literalValue = ((TimeLiteral) tuple.get(0)).getMilliseconds() + 1;\n lowerBounds.put(selector, Math.max(lowerBounds.get(selector), literalValue));\n } else {\n continue;\n }\n\n if (lowerBounds.get(selector) > upperBounds.get(selector)) {\n throw new QueryContradictoryException();\n }\n }\n\n return Arrays.asList(lowerBounds, upperBounds);\n }", "default DiscreteSet2D subLevelSet(double value) {\r\n\t\treturn pointsSatisfying(d -> d <= value);\r\n\t}", "public static Pair<BoundUpdate, BoundUpdate> rearrange(WInequality ieq,\n\t\t\tWRational term, WExpr v) {\n\t\tPair<WExpr,WExpr> r = rearrangeFor(v,ieq);\t\t\t\t\n\t\tWExpr factor = r.second();\t\t\n\t\tWExpr remainder = r.first();\n\t\t\t\t\n\t\tif(term != null) {\n\t\t\tPair<WPolynomial,WPolynomial> p = term.rearrangeFor(v);\t\t\n\t\t\tWExpr divisor = WNumerics.normalise(term.denominator());\n\t\t\tfactor = WNumerics.divide(factor,new WRational(p.second()).negate());\t\t\t\t\t\n\t\t\tremainder = WNumerics.subtract(remainder,new WRational(p.first()));\t\t\t\n\t\t\tremainder = WNumerics.divide(remainder,divisor);\n\t\t}\t\t\n\t\t\n\t\tif (factor instanceof WNumber) {\n\t\t\tBoundUpdate lower = null;\n\t\t\tBoundUpdate upper = null;\n\n\t\t\tWNumber constant = (WNumber) factor;\n\t\t\t// look at the sign of the coefficient to\n\t\t\t// determine whether or not we have an upper or lower bound.\t\t\t\n\t\t\tif (constant.compareTo(WNumber.ZERO) < 0) {\n\t\t\t\tif (ieq.sign()) {\t\t\t\t\t\n\t\t\t\t\tlower = new BoundUpdate(v, negate(remainder), (WNumber) negate(constant), false);\n\t\t\t\t} else {\t\t\t\t\t\n\t\t\t\t\tupper = new BoundUpdate(v, negate(remainder), (WNumber) negate(constant), true);\n\t\t\t\t}\n\t\t\t} else if (constant.compareTo(WNumber.ZERO) > 0) {\n\t\t\t\tif (ieq.sign()) {\t\t\t\t\t\n\t\t\t\t\tupper = new BoundUpdate(v, remainder, constant, false);\n\t\t\t\t} else {\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tlower = new BoundUpdate(v, remainder, constant, true);\n\t\t\t\t}\n\t\t\t}\n\t\t\t/*\n\t\t\tif(lower != null) {\n\t\t\t\tif(lower.sign) {\n\t\t\t\t\tSystem.out.println(lower.factor + \"*\" + v + \" > \" + lower.poly);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(lower.factor + \"*\" + v + \" >= \" + lower.poly);\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t\tif(upper != null) {\n\t\t\t\tif(upper.sign) {\n\t\t\t\t\tSystem.out.println(upper.factor + \"*\" + v + \" < \" + upper.poly);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(upper.factor + \"*\" + v + \" <= \" + upper.poly);\n\t\t\t\t}\t\t\t\n\t\t\t}\t\t\t\n\t\t\t*/\n\t\t\treturn new Pair<BoundUpdate, BoundUpdate>(lower, upper);\n\t\t} else {\n\t\t\t// In this case, the factor is not a constant which indicates a\n\t\t\t// non-linear constraint. At the moment, there's nothing we can\n\t\t\t// do about this so we silently drop it ... making the system\n\t\t\t// unsound.\n\t\t\treturn new Pair(null, null);\n\t\t}\t\t\t\t\n\t}", "ValueRangeConstraint createValueRangeConstraint();", "protected double[] clampV(double nextVabs, double nextVarg)\r\n\t\t{\r\n//\t\t\tif(nextVabs < v_min)\r\n//\t\t\t\tnextVabs = v_min;\r\n//\t\t\telse if(nextVabs > v_max)\r\n//\t\t\t\tnextVabs = v_max;\r\n\t\t\t\r\n\t\t\treturn new double[]{nextVabs, nextVarg};\r\n\t\t}", "public void setRange(double lower, double upper) {\n/* 625 */ if (lower >= upper) {\n/* 626 */ throw new IllegalArgumentException(\"Requires 'lower' < 'upper'.\");\n/* */ }\n/* 628 */ setRange(new DateRange(lower, upper));\n/* */ }", "public void divideDomain(){\n \tfor (int i = 0 ; i < getBoardSize() ; i++)\n \t\tfor (int j = 0 ; j < getBoardSize() ; j++){\n\t\t\tgetPoint(i, j).setHolder(GoPlayer.UNKNOWN);\n\t\t}\n\n \t\tfor (int i = 0 ; i < getBoardSize() ; i++)\n \t\tfor (int j = 0 ; j < getBoardSize() ; j++){\n if (getPoint(i, j).getHolder() == GoPlayer.UNKNOWN){\n \tif (getPoint(i, j).getState() == GoPoint.BLACK){\n getPoint(i, j).setHolder(GoPlayer.BLACK);\n \t}\n \telse if (getPoint(i, j).getState() == GoPoint.WHITE){\n getPoint(i, j).setHolder(GoPlayer.WHITE);\n \t}\n \telse {\n \t\tVector v = getBody(i,j);\n \t\tfindSpaceHolder(v);\n \t}\n }\n\t\t}\n }", "boolean impliedByLowerBound(InfinitNumber lbound) {\n\t\treturn getInverseBound().lesseq(lbound);\n\t}", "public Cut<Comparable<?>> a(BoundType boundType, DiscreteDomain<Comparable<?>> discreteDomain) {\n throw new IllegalStateException();\n }", "static public double lim(double x,double min,double max) {\r\n\t\t if(x<min) return min;\r\n\t\t if(x>max) return max;\r\n\t\t return x;\r\n\t}", "public void setLowerPoint(Point lower) {\n this.lower = lower;\n }", "private List<HashMap<TimeSelector, Long>> updateLeq(\n HashMap<ComparableExpression, HashSet<ComparableExpression>> rLeq,\n HashMap<TimeSelector, Long> lowerBounds, HashMap<TimeSelector, Long> upperBounds)\n throws QueryContradictoryException {\n\n ArrayList<ArrayList<ComparableExpression>> leq = relationToTuples(rLeq);\n for (ArrayList<ComparableExpression> tuple : leq) {\n TimeSelector selector = null;\n Long literalValue = null;\n // only comparisons between a selector and a literal are interesting here\n // selector <= literal => upper(selector) = min(upper(selector), literal)\n if (tuple.get(0) instanceof TimeSelector && tuple.get(1) instanceof TimeLiteral) {\n selector = (TimeSelector) tuple.get(0);\n literalValue = ((TimeLiteral) tuple.get(1)).getMilliseconds();\n upperBounds.put(selector, Math.min(upperBounds.get(selector), literalValue));\n } else if (tuple.get(1) instanceof TimeSelector &&\n tuple.get(0) instanceof TimeLiteral) {\n // selector >= literal => lower(selector) = max(lower(selector), literal)\n selector = (TimeSelector) tuple.get(1);\n literalValue = ((TimeLiteral) tuple.get(0)).getMilliseconds();\n lowerBounds.put(selector, Math.max(lowerBounds.get(selector), literalValue));\n } else {\n continue;\n }\n\n if (lowerBounds.get(selector) > upperBounds.get(selector)) {\n throw new QueryContradictoryException();\n }\n }\n\n return Arrays.asList(lowerBounds, upperBounds);\n }", "public void validateMinimum() {\n/* */ double newMin;\n/* */ try {\n/* 373 */ newMin = Double.parseDouble(this.minimumRangeValue.getText());\n/* 374 */ if (newMin >= this.maximumValue) {\n/* 375 */ newMin = this.minimumValue;\n/* */ }\n/* */ }\n/* 378 */ catch (NumberFormatException e) {\n/* 379 */ newMin = this.minimumValue;\n/* */ } \n/* */ \n/* 382 */ this.minimumValue = newMin;\n/* 383 */ this.minimumRangeValue.setText(Double.toString(this.minimumValue));\n/* */ }", "Condition between(QueryParameter parameter, Object x, Object y);", "public void setLower(int value) {\n this.lower = value;\n }", "public void setParamValueRange(String label, double minValue, double maxValue);", "private double correctToRange(double value, double min, double max) {\r\n\t\t// If the value is below the range, set it equal to the minimum.\r\n\t\tif (value < min) {\r\n\t\t\treturn min;\r\n\t\t\t// If it is above the range, set it equal to the maximum.\r\n\t\t} else if (value > max) {\r\n\t\t\treturn max;\r\n\t\t}\r\n\t\t// Otherwise, it is in-range and no adjustments are needed.\r\n\t\treturn value;\r\n\t}", "@Override\r\n\tpublic double derivativeOf(double x) {\r\n\t\treturn ( 1 / (x - this.getLower_bound()) ) + ( 1 / (this.getUpper_bound() - x) ); \r\n\t}", "public double getDomainMin1() throws IllegalStateException {\n\treturn -Double.MAX_VALUE;\n }", "private void checkBound(int lowerBound, int upperBound) {\n\t\tSet setKeys = Utility.vocabHM.keySet();\n\t\tIterator i = setKeys.iterator();\n\n\t\twhile (i.hasNext()) {\n\t\t\tString s = (String) i.next();\n\t\t\tInteger df = (Integer) Utility.vocabHM.get(s);\n\n\t\t\tif ((df.intValue() <= lowerBound) || (df.intValue() >= upperBound))\n\t\t\t\ti.remove();\n\t\t}\n\t}", "private double checkBounds(double param, int i) {\n if (param < low[i]) {\n return low[i];\n } else if (param > high[i]) {\n return high[i];\n } else {\n return param;\n }\n }", "public void setBounds(int var1, int var2, int var3, int var4) {\n if(var1 < 0) {\n var1 = 0;\n }\n\n if(var2 < 0) {\n var2 = 0;\n }\n\n if(var3 > this.field_723) {\n var3 = this.field_723;\n }\n\n if(var4 > this.field_724) {\n var4 = this.field_724;\n }\n\n this.field_745 = var1;\n this.field_743 = var2;\n this.field_746 = var3;\n this.field_744 = var4;\n }", "protected abstract R toRange(D lower, D upper);", "public Cut<C> a(BoundType boundType, DiscreteDomain<C> discreteDomain) {\n switch (boundType) {\n case CLOSED:\n return this;\n case OPEN:\n Comparable previous = discreteDomain.previous(this.a);\n return previous == null ? Cut.d() : new AboveValue<>(previous);\n default:\n throw new AssertionError();\n }\n }", "@Override\n\t\t\tpublic IFuzzySet cut(double minValue) {\n\t\t\t\treturn null;\n\t\t\t}", "@Override\n\t\t\tpublic IFuzzySet cut(double minValue) {\n\t\t\t\treturn null;\n\t\t\t}", "protected final void setP(IntervalNode x) {\n\tthis.p = x;\n\n\t// recalc max and min\n\tsetMax();\n\tsetMin();\n }", "public static IntStrategy minDom_LB(IntVar... VARS) {\n return custom(minDomainSize_var_selector(), min_value_selector(), VARS);\n }", "private List<Rectangle> getRectanglesToConsiderForBranchingVarCalculation () {\r\n \r\n List<Rectangle> rectanglesToConsider = new ArrayList<Rectangle> ();\r\n \r\n //for every constraint, see if it has rects at the best lp\r\n \r\n for (Map <Double, List<Rectangle>> rectMap: myInfeasibleRectanglesList) {\r\n for (List<Rectangle> rectList : rectMap.values()) { \r\n \r\n rectanglesToConsider.addAll(rectList );\r\n \r\n } \r\n }\r\n \r\n return rectanglesToConsider;\r\n }", "public Cut<Comparable<?>> c(DiscreteDomain<Comparable<?>> discreteDomain) {\n try {\n return Cut.b(discreteDomain.minValue());\n } catch (NoSuchElementException unused) {\n return this;\n }\n }", "public void setLimit_lin_x_lower(float limit_lin_x_lower) throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeFloat(__io__address + 32, limit_lin_x_lower);\n\t\t} else {\n\t\t\t__io__block.writeFloat(__io__address + 24, limit_lin_x_lower);\n\t\t}\n\t}", "public void setLow(double value){low = value;}", "public void narrowRange(int min, int max, Boolean axis) {\n\t\tint counter=0; // how much points we erasing total ?\n\t\tboolean erasingAll=false; // if we eventually erasing all the database\n\t\t// by axis X-----------------------------------------//\n\t\tif (axis){ \n\t\t\tthis.current = this.minx;\n\t\t\twhile (!erasingAll && this.current.getData().getX()<min){\n\t\t\t\tnarrowOppPoint(this.current,axis); // deleting this point in y axis\n\t\t\t\tthis.current = this.current.getNextX(); \n\t\t\t\tcounter++;\n\t\t\t\tif (this.current==null) //if we get to the edge of the DS\n\t\t\t\t\terasingAll=true;\n\t\t\t}\n\t\t\tif (!erasingAll)\n\t\t\t\tthis.current.setPrevX(null);\n\t\t\tthis.minx = this.current; // the actual erasing\n\t\t\t//---//\n\t\t\tthis.current = this.maxx;\n\t\t\twhile (!erasingAll && this.current.getData().getX() > max){\n\t\t\t\tnarrowOppPoint(this.current,axis);\n\t\t\t\tthis.current = this.current.getPrevX(); \n\t\t\t\tcounter++;\n\t\t\t\tif (this.current==null) //if we get to the edge of the DS\n\t\t\t\t\terasingAll=true;\n\t\t\t}\n\t\t\tif (!erasingAll)\n\t\t\t\tthis.current.setNextX(null);\n\t\t\tthis.maxx = this.current; //the actual erasing\n\t\t}\n\t\t// by axis Y -----------------------------------------------------------//\n\t\telse{ \n\t\t\tthis.current = this.miny;\n\t\t\twhile (!erasingAll && this.current.getData().getY()<min){\n\t\t\t\tnarrowOppPoint(this.current,axis);\n\t\t\t\tthis.current = this.current.getNextY(); \n\t\t\t\tcounter++;\n\t\t\t\tif (this.current==null) //if we get to the edge of the DS\n\t\t\t\t\terasingAll=true;\n\t\t\t}\n\t\t\tif (!erasingAll)\n\t\t\t\tthis.current.setPrevY(null);\n\t\t\tthis.miny = this.current; //the actual erasing\n\t\t\t//--//\n\t\t\tthis.current = this.maxy;\n\t\t\twhile (!erasingAll && this.current.getData().getY() > max){\n\t\t\t\tnarrowOppPoint(this.current,axis);\n\t\t\t\tthis.current = this.current.getPrevY(); \n\t\t\t\tcounter++;\n\t\t\t\tif (this.current==null) //if we get to the edge of the DS\n\t\t\t\t\terasingAll=true;\n\t\t\t}\n\t\t\tif (!erasingAll)\n\t\t\t\tthis.current.setNextY(null);\n\t\t\tthis.maxy = this.current; //the actual erasing\n\t\t}\n\t\tthis.size = this.size - counter; // Update the size of the DS\n\t}", "public static double constrain(double value, double min, double max) {\n if(value > max) value = max;\n else if(value < min) value = min;\n return value;\n }", "public Comparable<?> a(DiscreteDomain<Comparable<?>> discreteDomain) {\n return discreteDomain.minValue();\n }", "public double boundValueToAttributeLimits(double value, Attribute a) {\r\n\r\n\t\tif (value < a.getMinAttribute())\r\n\t\t\tvalue = a.getMinAttribute();\r\n\t\telse if (value > a.getMaxAttribute())\r\n\t\t\tvalue = a.getMaxAttribute();\r\n\r\n\t\treturn value;\r\n\t}", "private double lbranch(double x) {\n\t\r\n\t\tdouble w = approx(x, g, a);\r\n\t\tint i=0;\r\n\t\tdouble err=w+2;\r\n\t\tdouble arg=0,da=0,df=0;\r\n\t\twhile (i<niter && abs(err-w)>tol ) {\r\n\t\t\terr=w;\r\n\r\n\t\t\targ=(w-a)/g-log(g);\r\n\t\t\tda=-lw_minus.eval(arg);\t\r\n\t\t\tdf=iq_minus.eval(w);\r\n\t\t\t//System.out.println(w+\" \"+arg+\" \"+da+\" \"+df);\r\n\t\t\tif (Double.isNaN(df) || Double.isNaN(da)) {\r\n\t\t\t\t//System.out.println(\"df \"+df+ \" da \"+da+\" w \"+w);\r\n\t\t\t\treturn Double.NaN;\r\n\t\t\t}\r\n\t\t\tw+=w*(da+1.0)*(df-g*x);\r\n\t\t\tif (w<=0) return err;\r\n\t\t\ti++;\r\n\t\t} \r\n\t\taiter=i-1;\r\n\t//\tSystem.out.println(\" niter \" +aiter +\" err \"+abs(err));\r\n\r\n\t\treturn w;\r\n\t}", "public static IntStrategy minDom_MidValue(boolean floor, IntVar... VARS) {\n return custom(minDomainSize_var_selector(), mid_value_selector(floor), VARS);\n }", "public double withIn(double input, double upperBound, double lowerBound) {\n\t\tif (input > 0) {\n\t\t\treturn java.lang.Math.min(upperBound, input);\n\t\t} else if (input < 0) {\n\t\t\treturn java.lang.Math.max(lowerBound, input);\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "@Override\n\tprotected double getLowerBound() {\n\t\treturn 0;\n\t}", "public double getDomainMin2() throws IllegalStateException {\n\treturn -Double.MAX_VALUE;\n }", "static int clamp(int x, int a, int b) {\n if (x < a) {\n return a;\n }\n if (x > b) {\n return b;\n }\n return x;\n }", "public void setParamValueRange(String label, Object minValue, Object maxValue);", "public int getBound();", "TrackingToken lowerBound();", "public void setMinValue(int x) {\r\n\t\tminValue = x;\r\n\t}", "protected int getBoundedValue(int aNumber) {\r\n if (aNumber < getMin()) {\r\n aNumber = getMin();\r\n } else if (aNumber > getMax()) {\r\n aNumber = getMax();\r\n }\r\n return aNumber;\r\n }", "protected final void setMin() {\n\tint prevmin = this.min;\n\n\tint i1 = this.low;\n\tint i2 = left.min;\n\tint i3 = right.min;\n\n\tif (i2 == -1) \n\t i2 = i1;\n\tif (i3 == -1) \n\t i3 = i1;\n\n\tif ((i1 <= i2) && (i1 <= i3)) {\n\t this.min = i1;\n\t} else if ((i2 <= i1) && (i2 <= i3)) {\n\t this.min = i2;\n\t} else {\n\t this.min = i3;\n\t}\n\n\tif ((p != IntervalNode.nullIntervalNode) &&\n\t (prevmin != this.min)) {\n \t p.setMin();\n\t}\n }", "public SelectorForNumber[] divide(double divider) {\n SelectorForNumber[] result = new SelectorForNumber[2];\n switch(type) {\n case ALL_VALUES: {\n result[0] = getSelLE(attributeId, divider - delta);\n result[1] = getSelGT(attributeId, divider);\n break;\n }\n case BELONGS_RIGHT_INCLUDING: {\n if (divider == lowerLimit) {\n result[0] = null;\n result[1] = this;\n }\n else {\n if (divider > lowerLimit) {\n if (divider == upperLimit) {\n result[0] = getSelBelongs(attributeId, lowerLimit, divider - delta);\n result[1] = null;\n }\n else if (divider > upperLimit) {\n result[0] = this;\n result[1] = null;\n }\n else {\n // lowerLimit < divider < upperLimit\n result[0] = getSelBelongs(attributeId, lowerLimit, divider - delta);\n result[1] = getSelBelongs(attributeId, divider, upperLimit);\n }\n }\n else {\n // divider < lowerLimit\n result[0] = null;\n result[1] = this;\n }\n }\n break;\n }\n case EQUAL: {\n if (divider == lowerLimit)\n result[0] = this;\n break;\n }\n case GREATER_THAN: {\n if (divider == lowerLimit) {\n result[0] = null;\n result[1] = this;\n }\n else if (divider > lowerLimit) {\n result[0] = getSelBelongs(attributeId, lowerLimit, divider - delta);\n result[1] = getSelGT(attributeId, divider);\n }\n // else -> divider < lowerLimit, so there's no selector to return;\n break;\n }\n case LOWER_OR_EQUAL: {\n if (divider == upperLimit) {\n result[0] = getSelLE(attributeId, divider - delta);\n result[1] = null;\n }\n else if (divider < upperLimit) {\n result[0] = getSelLE(attributeId, divider - delta);\n result[1] = getSelBelongs(attributeId, divider, upperLimit);\n } \n // else -> divider > lowerLimit, so there's no selector to return;\n break;\n }\n case NONE_VALUE: { // Nothing to return.\n break;\n }\n }\n return result;\n }" ]
[ "0.6363244", "0.5898049", "0.5883437", "0.567404", "0.55894274", "0.55749536", "0.5555223", "0.5552252", "0.54938185", "0.54913557", "0.5488306", "0.5477715", "0.54672337", "0.5425025", "0.54107875", "0.538686", "0.5354183", "0.5337943", "0.52592", "0.5236651", "0.5229846", "0.52114546", "0.5204717", "0.5195016", "0.5191032", "0.5174906", "0.5144754", "0.5140147", "0.5124376", "0.5111219", "0.50882304", "0.50824815", "0.5069659", "0.5059531", "0.5056841", "0.50476897", "0.5047548", "0.5047164", "0.5045931", "0.5045135", "0.50436854", "0.5042179", "0.50370944", "0.5034746", "0.50341356", "0.5032264", "0.5007801", "0.5004656", "0.49971187", "0.4988997", "0.4986245", "0.4986185", "0.49853227", "0.4982475", "0.4980635", "0.4977244", "0.49769187", "0.4969402", "0.4957283", "0.4930705", "0.49275255", "0.49215865", "0.49197978", "0.49145707", "0.49138558", "0.49040252", "0.48921296", "0.48895", "0.48753768", "0.48687154", "0.48563322", "0.48522523", "0.48498625", "0.48498088", "0.48349413", "0.48290274", "0.48230162", "0.48230162", "0.48189157", "0.48099712", "0.48077926", "0.48056743", "0.4802379", "0.47944063", "0.47905377", "0.47851408", "0.4777618", "0.47727096", "0.47718844", "0.4768103", "0.4764491", "0.475888", "0.47572583", "0.47493178", "0.47386748", "0.47370434", "0.47237048", "0.4696166", "0.46934393", "0.46901107", "0.46857747" ]
0.0
-1
CUSTOM STRATEGIES Builds your own search strategy based on binary decisions.
public static IntStrategy custom(VariableSelector<IntVar> VAR_SELECTOR, IntValueSelector VAL_SELECTOR, DecisionOperator<IntVar> DEC_OPERATOR, IntVar... VARS) { return new IntStrategy(VARS, VAR_SELECTOR, VAL_SELECTOR, DEC_OPERATOR); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract Solution<T> search(Searchable<T> s);", "public interface SearchQuerySet extends QuerySet\n{\n\n // for AbstractSearch\n public static final int STAT_MODELS = 1;\n public static final int STAT_CLUSTERS = 2;\n public static final int STAT_GENOMES = 4;\n public static final int STAT_MODEL_CLUSTERS = 8;\n\n public String getStatsById(Collection data);\n public String getStatsByQuery(String query);\n public String getStatsById(Collection data,int stats);\n public String getStatsByQuery(String query,int stats);\n \n // for BlastSearch\n public String getBlastSearchQuery(Collection dbNames, Collection keys, KeyTypeUser.KeyType keyType);\n \n //for ClusterIDSearch\n public String getClusterIDSearchQuery(Collection input, int limit, int[] DBs, KeyTypeUser.KeyType keyType);\n \n // for ClusterNameSearch\n public String getClusterNameSearchQuery(Collection input, int limit, int[] DBs, KeyTypeUser.KeyType keyType);\n \n // for DescriptionSearch\n public String getDescriptionSearchQuery(Collection input, int limit, int[] DBs, KeyTypeUser.KeyType keyType);\n \n // for GoSearch \n public String getGoSearchQuery(Collection input, int limit, KeyTypeUser.KeyType keyType);\n \n // for GoTextSearch\n public String getGoTextSearchQuery(Collection input, int limit, KeyTypeUser.KeyType keyType);\n \n // for IdSearch\n public String getIdSearchQuery(Collection input, int limit, int[] DBs, KeyTypeUser.KeyType keyType);\n \n // for QueryCompSearch\n public String getQueryCompSearchQuery(String comp_id, String status, KeyTypeUser.KeyType keyType);\n \n // for QuerySearch\n public String getQuerySearchQuery(String queries_id, KeyTypeUser.KeyType keyType); \n \n // for SeqModelSearch\n public String getSeqModelSearchQuery(Collection model_ids, KeyTypeUser.KeyType keyType);\n \n // for UnknowclusterIdSearch\n public String getUnknownClusterIdSearchQuery(int cluster_id, KeyTypeUser.KeyType keyType);\n \n // for ProbeSetSearch\n public String getProbeSetSearchQuery(Collection input, int limit, KeyTypeUser.KeyType keyType);\n \n // for ProbeSetKeySearch\n public String getProbeSetKeySearchQuery(Collection input, int limit, KeyTypeUser.KeyType keyType);\n \n // for QueryTestSearch\n public String getQueryTestSearchQuery(String query_id, String version, String genome_id);\n \n // for QueryStatsSearch\n public String getQueryStatsSearchQuery(List query_ids,List DBs);\n \n // for PskClusterSearch\n public String getPskClusterSearchQuery(int cluster_id,KeyTypeUser.KeyType keyType);\n \n // for ClusterCorrSearch\n public String getClusterCorrSearchQuery(int cluster_id, int psk_id, KeyTypeUser.KeyType keyType);\n \n // for UnknownGenesSearch\n public String getUnknownGenesSearchQuery(Collection sources, KeyTypeUser.KeyType keyType);\n \n}", "abstract public void search();", "public interface SearchStrategy<T> {\n\t\n\t/**\n\t * Sucht den gewünschten Knoten.\n\t * @return gesuchten Knoten - wenn nicht gefunden, dann null.\n\t */\n\tpublic Node<T> search(T value, Node<T> root);\n\t\n\t/**\n\t * Gibt den Pfad der zuletzt ausgeführten Suche zurück.\n\t * \n\t * @return Liste der Knoten, die durchsucht wurden.\n\t */\n\tpublic ArrayList<Node<T>> getPath();\n}", "public MagicSearch createMagicSearch();", "Boolean getSearchObjective();", "abstract public boolean performSearch();", "interface BuildingRepositoryCustom {\n\n /**\n * The constant ALL_RESULTS.\n */\n int ALL_RESULTS = 0;\n\n /**\n * Find by filter text list.\n *\n * @param words the words\n * @param justIds the just ids\n * @return the list\n */\n List findByFilterText(Set<String> words, boolean justIds);\n\n /**\n * Find building coordinates by type list.\n *\n * @param type the type\n * @return the list\n */\n List<Building> findBuildingCoordinatesByType(String type);\n\n /**\n * Find by distance list.\n *\n * @param latitude the latitude\n * @param longitude the longitude\n * @param maxDistance the max distance\n * @param maxResults the max results\n * @return the list\n */\n List findByDistance(Double latitude, Double longitude, int maxDistance, int maxResults);\n}", "public abstract S getSearch();", "public Optimizer getOptimizedCriteria() {\r\n\r\n\t\tLog.d(\"Criteria\", \"Inside getOC:\" + isIntelligenceOverridden);\r\n\r\n\t\tif (!isIntelligenceOverridden) {\r\n\r\n\t\t\t/* BATTERY LEVEL - \"HIGH\" */\r\n\t\t\tif (batteryLevel > Constants.BATTERY_LEVEL.HIGH) {\r\n\t\t\t\tLog.d(\"Test\", \"Entered High\");\r\n\t\t\t\toptimizer.setFrequency(Constants.FREQUENCY_LEVEL.HIGH);\r\n\t\t\t\toptimizer.setPriority(Constants.PRIORITY_LEVEL.HIGH);\r\n\t\t\t}\r\n\r\n\t\t\t/* BATTERY LEVEL - \"MEDIUM\" */\r\n\t\t\telse if (batteryLevel > Constants.BATTERY_LEVEL.MEDIUM\r\n\t\t\t\t\t&& batteryLevel <= Constants.BATTERY_LEVEL.HIGH) {\r\n\t\t\t\tLog.d(\"Criteria\", \"Entered Medium\");\r\n\t\t\t\toptimizer.setFrequency(Constants.FREQUENCY_LEVEL.MEDIUM);\r\n\t\t\t\toptimizer.setPriority(Constants.PRIORITY_LEVEL.MEDIUM);\r\n\t\t\t}\r\n\r\n\t\t\t/* BATTERY LEVEL - \"LOW\" */\r\n\t\t\telse if (batteryLevel <= Constants.BATTERY_LEVEL.MEDIUM) {\r\n\t\t\t\tLog.d(\"Criteria\", \"Checking Moderate Mode\");\r\n\t\t\t\tmModerateMode();\r\n\t\t\t}\r\n\t\t\tLog.d(\"Criteria\", \"Returning Op obj\");\r\n\t\t\treturn optimizer;\r\n\t\t}\r\n\r\n\t\tLog.d(\"Criteria\", \"Then continuing\");\r\n\t\tswitch (userScheme) {\r\n\t\tcase \"moderate\":\r\n\t\t\tLog.d(\"Test\", \"Entered Moderate\");\r\n\t\t\tmModerateMode();\r\n\t\t\tbreak;\r\n\t\tcase \"lazy\":\r\n\t\t\tLog.d(\"Test\", \"Lazy\");\r\n\t\t\tmLazyMode();\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tmModerateMode();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn optimizer;\r\n\t}", "public Decision bestFor(Context context);", "List<Hybridization> searchByCriteria(PageSortParams<Hybridization> params, HybridizationSearchCriteria criteria);", "public interface SearchAlgorithm {\n\t/**\n\t * Searches the state space for a solution.\n\t * @param root\n\t * The root state to begin search from.\n\t * @param expanded_list\n\t * The expanded list in order of expansion. Filled by function.\n\t * @param goal\n\t * The goal state representation used to test if we reached the goal state.\n\t * @return\n\t * The search results containing all needed information about the search and the results.\n\t */\n\tSearchResult search(State root, List<State> expanded_list, State goal);\n}", "public interface SearchInterface {\n int ACTION_TYPE_AMBIGUOUS = 1;\n int ACTION_TYPE_SWITCH_CHANNEL = 2;\n int ACTION_TYPE_SWITCH_INPUT = 3;\n\n /**\n * Search channels, inputs, or programs.\n * This assumes that parental control settings will not be change while searching.\n *\n * @param action One of {@link #ACTION_TYPE_SWITCH_CHANNEL}, {@link #ACTION_TYPE_SWITCH_INPUT},\n * or {@link #ACTION_TYPE_AMBIGUOUS},\n */\n List<SearchResult> search(String query, int limit, int action);\n}", "public interface ISearchEngine {\n\n enum SearchParam {\n CORE,\n EXPERIMENT,\n HOST,\n PORT\n }\n\n /**\n * Query engine for searching relevant documents\n * @return\n */\n SearchResponse query(SearchRequest request, Map<SearchParam, String> params);\n\n /**\n * Query search engine for spell correction\n * @param request: spell check request\n * @return\n */\n SpellResponse spellQuery(SearchRequest request, Map<SearchParam, String> params);\n}", "public RankedSearch(CourseDataCache cache) {\n this.cache = cache;\n this.corpus = cache.getCorpus();\n\n\n setUpMappingsAndShortenings();\n this.whitespaceSuggestions = new HashMap<>();\n this.descriptionSearch = new DescriptionSearch(cache);\n this.courseCodeSearch = new CourseCodeSearch(cache);\n this.titleSearch = new TitleSearch(cache);\n this.smallWords = new HashSet<>();\n setUpSmallWords();\n }", "public List<Recipe> search(String queryText, Category category, CookingMethod cookingMethod);", "@Override\r\n\tpublic void search() {\n\r\n\t}", "protected abstract boolean makeDecision (Map<Key, Object> context);", "public abstract Rank<String,String> query(String input) throws ClassificationException;", "public abstract boolean getSensitiveSearch();", "public abstract AutoCompleteDictionary getDictionary(SearchCategory categoryToSearch);", "public interface RuleConstruction extends SelectRule, DeleteRule, UpdateRule {\n\n /**\n * Check whether word is key-word\n *\n * @param word - word\n * @return false - word is not key-word\n * true - word is key-word\n */\n boolean isNotKeyWord(String word);\n\n /**\n * Check whether word is By-word\n *\n * @param currentIndex - word index\n * @param words - list of words\n * @return true - word is correct\n * false - word is not correct\n */\n boolean isByCorrect(int currentIndex, List<String> words);\n\n /**\n * Check whether word is And-word or Or-word\n *\n * @param currentIndex - word index\n * @param words - list of words\n * @return true - word is correct\n * false - word is not correct\n */\n boolean isAndOrCorrect(int currentIndex, List<String> words);\n\n /**\n * Check whether word is Between-word\n *\n * @param currentIndex - word index\n * @param words - list of words\n * @return true - word is correct\n * false - word is not correct\n */\n boolean isBetweenCorrect(int currentIndex, List<String> words);\n}", "private void searchFunction() {\n\t\t\r\n\t}", "@Override\n\tprotected void executeSearch(String term) {\n\t\t\n\t}", "private Search() {}", "public abstract Search defaultSearch(StringBuilder sb);", "public SearchConditionSB() {\r\n }", "public interface Strategy {\n\n StrategySolution solve(List<Item> items, int weight);\n}", "@Override\n\tpublic void search() {\n\t}", "public void search(Indexer indexer, CityIndexer cityIndexer, Ranker ranker, String query, boolean withSemantic, ArrayList<String> chosenCities, ObservableList<String> citiesByTag, boolean withStemming, String saveInPath, String queryId, String queryDescription) {\n String[] originalQueryTerms = query.split(\" \");\n String originQuery = query;\n docsResults = new HashMap<>();\n parser = new Parse(withStemming, saveInPath, saveInPath);\n HashSet<String> docsOfChosenCities = new HashSet<>();\n query = \"\" + query + queryDescription;\n HashMap<String, Integer> queryTerms = parser.parseQuery(query);\n HashMap<String, ArrayList<Integer>> dictionary = indexer.getDictionary();\n if (!withStemming){\n setDocsInfo(saveInPath + \"\\\\docsInformation.txt\");\n }\n else{\n setDocsInfo(saveInPath + \"\\\\docsInformation_stemming.txt\");\n }\n\n\n //add semantic words of each term in query to 'queryTerms'\n if(withSemantic) {\n HashMap<String,ArrayList<String>> semanticWords = ws.connectToApi(originQuery);\n }\n\n //give an ID to query if it's a regular query (not queries file)\n if(queryId.equals(\"\")){\n queryId = \"\" + Searcher.queryID;\n Searcher.queryID++;\n }\n\n String postingDir;\n if (!withStemming) {\n postingDir = \"\\\\indexResults\\\\postingFiles\";\n } else {\n postingDir = \"\\\\indexResults\\\\postingFiles_Stemming\";\n }\n int pointer = 0;\n\n //find docs that contain the terms in the query in their text\n HashMap<String, Integer> queryTermsIgnoreCase = new HashMap<>();\n for (String term : queryTerms.keySet()) {\n String originTerm = term;\n if (!dictionary.containsKey(term.toUpperCase()) && !dictionary.containsKey(term.toLowerCase())) {\n continue;\n }\n if(dictionary.containsKey(term.toLowerCase())){\n term = term.toLowerCase();\n }\n else {\n term = term.toUpperCase();\n }\n queryTermsIgnoreCase.put(term,queryTerms.get(originTerm));\n pointer = dictionary.get(term).get(2);\n String chunk = (\"\" + term.charAt(0)).toUpperCase();\n\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + postingDir + \"\\\\posting_\" + chunk + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsResults'\n if(line != null) {\n findDocsFromLine(line, term);\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n //find docs that contain the chosen cities in their text\n for (String cityTerm : chosenCities) {\n if (!dictionary.containsKey(cityTerm) && !dictionary.containsKey(cityTerm.toLowerCase())) {\n continue;\n }\n if(dictionary.containsKey(cityTerm.toLowerCase())){\n cityTerm = cityTerm.toLowerCase();\n }\n pointer = dictionary.get(cityTerm).get(2);\n // char chunk = indexer.classifyToPosting(term).charAt(0);\n String chunk = (\"\" + cityTerm.charAt(0)).toUpperCase();\n\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + postingDir + \"\\\\posting_\" + chunk + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsOfChosenCities'\n String docs = line.substring(0, line.indexOf(\"[\") - 1); //get 'docsListStr'\n String[] docsArr = docs.split(\";\");\n for (String docInfo : docsArr) {\n String doc = docInfo.substring(0, docInfo.indexOf(\": \"));\n while(doc.charAt(0) == ' '){\n doc = doc.substring(1);\n }\n docsOfChosenCities.add(doc);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n //find docs that contain the chosen cities in their city tag\n if(!chosenCities.isEmpty()){\n for (String cityDicRec: chosenCities) {\n //get pointer to posting from cityDictionary\n try {\n pointer = cityIndexer.getCitiesDictionary().get(cityDicRec);\n } catch (NumberFormatException e) {\n e.printStackTrace();\n }\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + \"\\\\cityIndexResults\" + \"\\\\posting_city\" + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsOfChosenCities'\n String docs = line.substring(line.indexOf(\"[\") + 1, line.indexOf(\"]\")); //get 'docsListStr'\n String[] docsArr = docs.split(\"; \");\n for (String doc : docsArr) {\n docsOfChosenCities.add(doc);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n\n\n ranker.rank(docsResults, docsOfChosenCities, queryTermsIgnoreCase, dictionary, docsInfo,entities, queryId);\n }", "public interface Searcher<T> {\r\n\t\r\n\t//the search method\r\n\tpublic Solution<T> search(Searchable<T> s);\r\n\t\r\n\t//get how many nodes were evaluated by the algorithm\r\n\tpublic int getNumberOfNodesEvaluated();\r\n}", "public interface ISearchable {\n\n\n AState getStartState () throws NullError;\n\n AState getGoalState () throws NullError;\n\n ArrayList<AState> getAllSuccessors (AState state) throws LowBoundInput, OutOfBoundMatrixInput, NullError;\n\n}", "public abstract Search create(String search, SearchBuilder builder);", "public static void main(String... args)\n {\n String path = Configuration.instance.dataDirectory + Configuration.instance.fileSeparator;\n String suffix = \"_default.xml\";\n String algorithm = \"\";\n boolean paramSeach = false;\n int maxGens = 10000;\n\n readItems();\n\n // Parsing CLI\n for (int i = 0; i < args.length; i++)\n {\n if (args[i].equals(\"-algorithm\"))\n {\n i++;\n algorithm = args[i];\n }\n\n if (args[i].equals(\"-configuration\"))\n {\n i++;\n if (args[i].equals(\"best\"))\n suffix = \"_best.xml\";\n }\n\n if (args[i].equals(\"-search_best_configuration\"))\n paramSeach = true;\n }\n\n if (paramSeach) suffix = \"_best.xml\";\n double[] hyperparameters = loadConfig(path + algorithm + suffix);\n System.out.println(\"Chosen algorithm: \" + algorithm);\n\n double time = System.currentTimeMillis();\n // Running correct algorithm according to CLI\n switch (algorithm)\n {\n case \"ga\":\n if (paramSeach)\n new GARecommender().recommend();\n else\n new Population(maxGens, hyperparameters).run();\n break;\n case \"sa\":\n case \"best-algorithm\":\n if (paramSeach)\n new SARecommender().recommend();\n else\n new Annealing(hyperparameters).run();\n break;\n case \"aco\":\n if (paramSeach)\n new ACORecommender().recommend();\n else\n new AntColony(maxGens, hyperparameters).run();\n break;\n case \"pso\":\n if (paramSeach)\n new PSORecommender().recommend();\n else\n new Swarm(maxGens * 10, hyperparameters).run(); // 10x max gens because PSO is does less per gen and is much faster\n break;\n default:\n System.out.println(\"Could not find algorithm with name \" + algorithm + \". Options are: ga, sa, aco, pso\");\n break;\n }\n System.out.println(\"Finished in: \" + ((System.currentTimeMillis() - time) / 1000) + \"s\");\n }", "@Override\n\tpublic boolean startSearch() {\n\t\tString str = \"\";\n\t\t\n\t\tDimension d = view.getInit();\n\t\tif (d == null) {\n\t\t\tstr = str + \"Falta la posicion de inicio.\\n\";\n\t\t} else {\n\t\t\ty0 = (int) d.getHeight();\n\t\t\tx0 = (int) d.getWidth();\n\t\t}\n\t\t\n\t\td = view.getGoal();\n\t\tif (d == null) {\n\t\t\tstr = str + \"Falta la posicion de meta.\\n\";\n\t\t} else {\n\t\t\tyf = (int) d.getHeight();\n\t\t\txf = (int) d.getWidth();\n\t\t}\n\t\t\n\t\tif (view.isBreadth()) {\n\t\t\tstrategy = new Breadth();\n\t\t} else if (view.isDepth()) {\n\t\t\tstrategy = new Depth();\n\t\t} else if (view.isAStar()) {\n\t\t\tstrategy = new AStar();\n\t\t\tif (view.isH0()) {\n\t\t\t\theuristic = Horse.H0;\n\t\t\t} else if (view.isH1()) {\n\t\t\t\theuristic = Horse.H1;\n\t\t\t} else if (view.isH2()) {\n\t\t\t\theuristic = Horse.H2;\n\t\t\t} else\n\t\t\t\tstr = str + \"Falta por escoger el tipo de heur’stica.\\n\";\n\t\t} else\n\t\t\tstr = str + \"Falta la estrategia de bœsqueda.\\n\";\n\t\t\n\t\tboard = view.getBoard();\n\t\t\n\t\tif (str.equals(\"\")) {\n\t\t\trootNode = new Node(new Horse(x0,y0,xf,yf, board, heuristic));\n\t\t}\n\t\t\n\t\tif (view.isTree()) {\n\t\t\tif (str.equals(\"\"))\n\t\t\t\tsearch = new Tree(rootNode, strategy);\n\t\t} else if (view.isGraph()) {\n\t\t\tif (str.equals(\"\"))\n\t\t\t\tsearch = new Graph(rootNode, strategy);\n\t\t} else \n\t\t\tstr = str + \"Falta el algoritmo de bœsqueda.\\n\";\n\t\t\n\t\tif (!str.equals(\"\")) {\n\t\t\tview.showError(str);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tgoSearch();\n\t\treturn true;\n\t}", "public interface SearchService {\n\n /**\n * Parameter that is appended to the generated links that contains the positive search terms and phrases of the\n * search expression. For several terms it occurs several times.\n */\n String PARAMETER_SEARCHTERM = \"search.term\";\n\n /**\n * Represents a result of the search consisting of a target page and one or more matching subresources. For use by\n * the search result renderer.\n */\n interface Result {\n\n /** The page which contains matches. */\n @NotNull\n Resource getTarget();\n\n /** The content child of the page which contains matches. */\n @NotNull\n Resource getTargetContent();\n\n /** A link that shows the target, including search terms with {@link #PARAMETER_SEARCHTERM} */\n @NotNull\n String getTargetUrl();\n\n /** The title of the search result. */\n @NotNull\n String getTitle();\n\n /** The score of the search result. */\n Float getScore();\n\n /**\n * One or more descendants of {@link #getTarget()} that potentially match the search expression. Mostly useful\n * for generating excerpts; can contain false positives in some search algorithms.\n */\n @NotNull\n List<Resource> getMatches();\n\n /** The fulltext search expression for which this result was found. */\n @NotNull\n String getSearchExpression();\n\n /**\n * A basic excerpt from the matches that demonstrates the occurrences of the terms from {@link\n * #getSearchExpression()} in this result. Might be empty if not applicable (e.g. if the search terms were found\n * in meta information). If there are several matches, we just give one excerpt. You might want to provide your\n * own implementation for that to accommodate for specific requirements.\n *\n * @return a text with the occurrences of the words marked with HTML tag em .\n */\n @NotNull\n String getExcerpt() throws SearchTermParseException;\n }\n\n /**\n * Fulltext search for resources. The resources are grouped if they are subresources of one target page, as\n * determined by the parameter targetResourceFilter.\n * <p>\n * Limitations: if the searchExpression consists of several search terms (implicitly combined with AND) this finds\n * only resources where a single property matches the whole search condition, i.e., all those terms. If several\n * resources of a page contain different subsets of those terms, the page is not found.\n *\n * @param context The context we use for the search.\n * @param selectors a selector string to determine the right search strategy, e.g. 'page'\n * @param root Optional parameter for the node below which we search.\n * @param searchExpression Mandatory parameter for the fulltext search expression to search for. For the syntax\n * see\n * {@link QueryConditionDsl.QueryConditionBuilder#contains(String)}\n * . It is advisable to avoid using AND and OR.\n * @param searchFilter an optional filter to drop resources to ignore.\n * @return possibly empty list of results\n * @see com.composum.sling.core.mapping.jcr.ResourceFilterMapping\n */\n @NotNull\n List<Result> search(@NotNull BeanContext context, @NotNull String selectors,\n @NotNull String root, @NotNull String searchExpression, @Nullable ResourceFilter searchFilter,\n int offset, @Nullable Integer limit)\n throws RepositoryException, SearchTermParseException;\n\n\n interface LimitedQuery {\n\n /**\n * Executes the query with the given limit; returns a pair of a boolean that is true when we are sure that all\n * results have been found in spite of the limit, and the results themselves.\n */\n Pair<Boolean, List<Result>> execQuery(int matchLimit);\n }\n\n /**\n * Execute the query with raising limit until the required number of results is met. We don't know in advance how\n * large we have to set the limit in the query to get all neccesary results, since each page can have an a priori\n * unknown number of matches. Thus, the query is executed with an estimated limit, and is reexecuted with tripled\n * limit if the number of results is not sufficient and there are more limits.\n *\n * @return up to limit elements of the result list with the offset first elements skipped.\n */\n @NotNull\n List<Result> executeQueryWithRaisingLimits(LimitedQuery limitedQuery, int offset, Integer limit);\n}", "public void testSearchRules() throws Exception {\n Project project = new Project();\r\n \r\n DateFormatSymbols symbols = new DateFormatSymbols(Locale.US);\r\n \r\n for (int i = 0; i < 12; i++) {\r\n \r\n String month = symbols.getMonths()[i];\r\n String shortMonth = symbols.getShortMonths()[i];\r\n \r\n // Basic project info\r\n project.setId(i);\r\n project.setCategoryId(1);\r\n project.setAllowGuests(true);\r\n project.setMembershipRequired(false);\r\n project.setApproved(true);\r\n project.setClosed(false);\r\n project.setPortal(false);\r\n \r\n // Unique Title\r\n project.setTitle(month + \" test project\");\r\n project.setShortDescription(month + \" description word\");\r\n project.setKeywords(shortMonth);\r\n \r\n // Unique Location\r\n project.setCity(\"Virginia Beach\");\r\n project.setState(\"VA\");\r\n project.setPostalCode(\"234\" + String.valueOf(50 + i));\r\n \r\n // Random Rating for now\r\n project.setRatingCount(i + 1);\r\n project.setRatingValue(project.getRatingCount() * StringUtils.rand(1, 5));\r\n project.setRatingAverage(project.getRatingValue() / project.getRatingCount());\r\n \r\n // Index it\r\n ProjectIndexer indexer = new ProjectIndexer();\r\n indexer.add(snowballWriter, project, true);\r\n }\r\n \r\n QueryParser parser = new QueryParser(\"contents\", snowballAnalyzer);\r\n \r\n {\r\n // Make sure a single matching term yields a single hit\r\n SearchBean search = new SearchBean();\r\n search.setQuery(symbols.getMonths()[0]);\r\n search.setLocation(\"Virginia Beach\");\r\n assertNotNull(search.getQuery());\r\n assertNotNull(search.getLocation());\r\n search.parseQuery();\r\n assertTrue(search.isValid());\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n assertNotNull(queryString);\r\n \r\n // (approved:1)\r\n // AND (guests:1)\r\n // AND (closed:0)\r\n // AND (website:0)\r\n // AND (\"january\"^20 OR january^15 OR january*^4) AND (location:(\"virginia beach\"^30))\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == 1);\r\n }\r\n \r\n {\r\n // Make sure a single matching term stem yields a single hit\r\n SearchBean search = new SearchBean();\r\n search.setQuery(symbols.getMonths()[0] + \"'s\");\r\n search.setLocation(\"Virginia Beach\");\r\n assertNotNull(search.getQuery());\r\n assertNotNull(search.getLocation());\r\n search.parseQuery();\r\n assertTrue(search.isValid());\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n assertNotNull(queryString);\r\n \r\n // (approved:1)\r\n // AND (guests:1)\r\n // AND (closed:0)\r\n // AND (website:0)\r\n // AND (\"january's\"^20 OR january's^15 OR january's*^4) AND (location:(\"virginia beach\"^30))\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == 1);\r\n }\r\n \r\n {\r\n // Make sure multiple matching words yield two hits\r\n SearchBean search = new SearchBean();\r\n search.setQuery(symbols.getMonths()[0] + \" \" + symbols.getMonths()[1]);\r\n search.setLocation(\"Virginia Beach\");\r\n search.parseQuery();\r\n assertTrue(search.isValid());\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n assertNotNull(queryString);\r\n \r\n // (approved:1)\r\n // AND (guests:1)\r\n // AND (closed:0)\r\n // AND (website:0)\r\n // AND (\"january february\"^20 OR january^15 OR february^14 OR january*^4 OR february*^3) AND (location:(\"virginia beach\"^30))\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == 2);\r\n }\r\n \r\n {\r\n // Make sure wilcards yield multiple hits\r\n SearchBean search = new SearchBean();\r\n search.setQuery(\"j\");\r\n search.setLocation(\"Virginia Beach\");\r\n search.parseQuery();\r\n assertTrue(search.isValid());\r\n \r\n // Look for data with a \"j\" for comparison\r\n int jCount = 0;\r\n for (int i = 0; i < symbols.getMonths().length; i++) {\r\n if (symbols.getMonths()[i].toLowerCase().indexOf(\"j\") > -1 ||\r\n symbols.getShortMonths()[i].toLowerCase().indexOf(\"j\") > -1) {\r\n ++jCount;\r\n }\r\n }\r\n assertTrue(jCount > 0);\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n assertNotNull(queryString);\r\n \r\n // (approved:1)\r\n // AND (guests:1)\r\n // AND (closed:0)\r\n // AND (website:0)\r\n // AND (\"j\"^20 OR j^15 OR j*^4) AND (location:(\"virginia beach\"^30))\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == jCount);\r\n }\r\n \r\n {\r\n // Make sure alternate locations do not yield any hits\r\n SearchBean search = new SearchBean();\r\n search.setQuery(symbols.getMonths()[0]);\r\n search.setLocation(\"Norfolk\");\r\n search.parseQuery();\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == 0);\r\n }\r\n \r\n {\r\n // Make sure locations as query terms do not yield any hits\r\n SearchBean search = new SearchBean();\r\n search.setQuery(\"Virginia Beach\");\r\n search.setLocation(\"Virginia Beach\");\r\n search.parseQuery();\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == 0);\r\n }\r\n }", "public void execFuzzySearchCustomWordFunc(){\n Map map = new HashMap();\n\n if(this.searchParam != null && this.searchParam.length()> 0 ){\n map.put(\"searchParam\",this.searchParam);\n }\n\n int idenfilter = 0 ;\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"all\") == false){\n idenfilter = 1;\n map.put(\"species\",this.searchSpecies.trim());\n }\n\n\n if(this.searchTrait != null && this.searchTrait.equals(\"null\")==false && this.searchTrait.length()>0){\n idenfilter =1;\n List traitlist = new ArrayList();\n if(this.searchTrait.indexOf(\",\")>-1){\n String [] traits = this.searchTrait.split(\",\");\n if(traits != null && traits.length>0){\n for(String tr:traits){\n traitlist.add(tr);\n }\n }\n }else{\n traitlist.add(this.searchTrait);\n }\n map.put(\"traitlist\", traitlist) ;\n }\n\n if(this.pvalue != null && this.pvalue.equals(\"null\")==false && this.pvalue.length()>0 ){\n idenfilter =1;\n map.put(\"psitu\", this.psitu);\n map.put(\"pval\", this.pvalue) ;\n }\n\n //this is search customword\n List<SearchItemBean> searchlist = (List<SearchItemBean>) baseService.findResultList(\"cn.big.gvk.dm.Search.selectCustomWordBySearch\",map);\n if( searchlist != null ){\n gwasAssociationList = new ArrayList<GwasAssociationBean>() ;\n mapGeneBeanList = new ArrayList<MapGeneBean>();\n for(SearchItemBean tmpbean : searchlist){\n if(tmpbean != null ){\n if(tmpbean.getItemType() == 1){\n //selecTraitByFuzzySearch\n Map cmp = new HashMap();\n cmp.put(\"traitId\", tmpbean.getItemId());\n GwasAssociationBean tmpgwas = (GwasAssociationBean) baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selecTraitByFuzzySearch\",cmp);\n if(tmpgwas != null ){\n //trait count\n Map cmap = new HashMap();\n cmap.put(\"traitId\",tmpgwas.getTraitId()) ;\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"all\") == false){\n cmap.put(\"species\",this.searchSpecies);\n\n }\n GwasAssociationBean tg_bean = (GwasAssociationBean)baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectAssociationCountByTraitId\",cmap);\n if(tg_bean != null ){\n tmpgwas.setTraitCount(tg_bean.getGwasCount());\n }\n\n List<TermInformationBean> tilist = (List<TermInformationBean>)baseService.findResultList(\"cn.big.gvk.dm.Term.selectTermDefinition\",tmpgwas.getTraitId());\n String s=\"\";\n if(tilist != null && tilist.size()>0 ){\n for(TermInformationBean tb:tilist ){\n if(tb!= null && tb.getTermDefinition() != null ){\n s+= tb.getTermDefinition() +\";\";\n }\n\n }\n }\n if(s.length()>0){\n s= s.substring(0, s.length()-1) ;\n }\n tmpgwas.setTermDefinition(s);\n\n //study count\n GwasAssociationBean tg_bean1 = (GwasAssociationBean)baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectStudyCountByTraitid\",cmap);\n if(tg_bean1 != null ){\n tmpgwas.setGwasCount(tg_bean1.getGwasCount());\n }\n gwasAssociationList.add(tmpgwas) ;\n }\n }else if(tmpbean.getItemType() == 2){\n Map cmp = new HashMap();\n cmp.put(\"gid\",tmpbean.getItemId()) ;\n MapGeneBean mgb = (MapGeneBean) baseService.findObjectByObject(\"cn.big.gvk.dm.MapGene.selectMapGeneCount\",cmp);\n if(mgb != null ){\n Map t = new HashMap();\n t.put(\"gId\",mgb.getGid()) ;\n t.put(\"count\",\"count\");\n\n //trait count\n GwasAssociationView gwas = (GwasAssociationView) baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectGwasViewByGeneInfo\",t);\n if(gwas != null){\n mgb.setTraitCount(gwas.getTraitCount());\n }\n\n //study count\n StudyBean study = (StudyBean) baseService.findObjectByObject(\"cn.big.gvk.dm.study.selectStudyByMapGeneId\",t);\n if(study != null ){\n mgb.setStudyCount(study.getStudyCount());\n }\n\n //publication count\n PublicationBean publication = (PublicationBean)baseService.findObjectByObject(\"cn.big.gvk.dm.publication.selectPubByGeneId\",t);\n if (publication != null ){\n mgb.setPublicationCount(publication.getPublicationCount());\n }\n mapGeneBeanList.add(mgb) ;\n\n }\n\n }\n }\n }\n }\n\n StringBuffer sb = new StringBuffer();\n //generate hidden html table and then use tableExport.js export\n if(gwasAssociationList != null && gwasAssociationList.size()>0){\n for(GwasAssociationBean gwas : gwasAssociationList){\n sb.append(gwas.getTraitName()).append(\"\\t\").append(gwas.getTermDefinition()).append(\"\\t\").append(gwas.getTraitCount()).append(\"\\t\").append(gwas.getGwasCount()).append(\"\\n\");\n }\n }\n\n if(mapGeneBeanList != null && mapGeneBeanList.size()>0){\n for(MapGeneBean mapgene: mapGeneBeanList){\n sb.append(mapgene.getMapGeneId()).append(\"\\t\").append(mapgene.getMapGeneChrom()).append(\":\")\n .append(mapgene.getMapGeneStart()).append(\"-\").append(mapgene.getMapGeneEnd()).append(\"\\t\").append(mapgene.getTraitCount()).append(\"\\t\")\n .append(mapgene.getStudyCount()).append(\"\\n\");\n }\n }\n\n if(format == 1 ){ //export txt\n this.response.reset();\n this.response.setHeader(\"Content-Disposition\",\n \"attachment;filename=export.txt\");\n this.response.setContentType(\"application/ms-txt\");\n try {\n PrintWriter pr = this.response.getWriter();\n pr.print(sb.toString());\n pr.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n\n\n }", "public String searchCategoriesByCriteria()\n {\n logger.info(\"**** In searchCategoriesByCriteria in Controller ****\");\n if (category != null && (StringUtils.isNotEmpty(category.getCategoryName()) || StringUtils.isNotEmpty(category.getCategoryDescription())))\n {\n categoryList = categoryService.searchCategoriesByCriteria(category);\n }\n else\n {\n FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_INFO, Constants.NO_SEARCH_CRITERIA, Constants.NO_SEARCH_CRITERIA);\n FacesContext.getCurrentInstance().getExternalContext().getFlash().setKeepMessages(true);\n FacesContext.getCurrentInstance().addMessage(null, facesMsg);\n }\n return Constants.SEARCH_CATEGORY_VIEW;\n }", "public SearchCondition[] getConditions();", "public List<Course> rankedKeywordSearch(String entireSearch) {\n entireSearch = entireSearch.toLowerCase().trim();\n\n List<Course> finalCourseList = new ArrayList<>();\n\n if (entireSearch.toLowerCase().trim().isEmpty()) {\n return finalCourseList;\n }\n\n\n if (StringUtils.isNumeric(entireSearch)) {\n List<Course> numericSearchRes = courseCodeSearch\n .suggestNumeric(entireSearch);\n for (Course c : numericSearchRes) {\n if (!finalCourseList.contains(c)) {\n finalCourseList.add(c);\n }\n }\n\n List<Course> titleSuggestionsFull = titleSearch.suggest(entireSearch);\n for (Course c : titleSuggestionsFull) {\n if (!finalCourseList.contains(c)) {\n finalCourseList.add(c);\n }\n }\n\n List<Course> descriptionSuggestionsFull = descriptionSearch\n .suggest(entireSearch);\n for (Course c : descriptionSuggestionsFull) {\n if (!finalCourseList.contains(c)) {\n finalCourseList.add(c);\n }\n }\n } else {\n finalCourseList = courseCodeSearch.suggest(entireSearch);\n\n List<Course> numericSearchRes = courseCodeSearch\n .suggestNumeric(entireSearch);\n for (Course c : numericSearchRes) {\n if (!finalCourseList.contains(c)) {\n finalCourseList.add(c);\n }\n }\n\n String sugg = searchNumberSuggestion(entireSearch);\n if (sugg != null) {\n List<Course> courseCodeResultsOuter = courseCodeSearch.suggest(sugg);\n for (Course c : courseCodeResultsOuter) {\n if (!finalCourseList.contains(c)) {\n finalCourseList.add(c);\n }\n }\n }\n\n if (finalCourseList.size() == 0) {\n List<Course> titleSuggestionsFull = titleSearch.suggest(entireSearch);\n for (Course c : titleSuggestionsFull) {\n if (!finalCourseList.contains(c)) {\n finalCourseList.add(c);\n }\n }\n\n List<Course> descriptionSuggestionsFull = descriptionSearch\n .suggest(entireSearch);\n for (Course c : descriptionSuggestionsFull) {\n if (!finalCourseList.contains(c)) {\n finalCourseList.add(c);\n }\n }\n }\n\n String[] searchWordsSplit = entireSearch.trim().split(\" \");\n if (searchWordsSplit.length == 2) {\n String putTogether = searchWordsSplit[0] + searchWordsSplit[1];\n List<Course> courseCodeResults = courseCodeSearch.suggest(putTogether);\n for (Course c : courseCodeResults) {\n if (!finalCourseList.contains(c)) {\n finalCourseList.add(c);\n }\n }\n\n String suggN = searchNumberSuggestion(putTogether);\n if (suggN != null) {\n List<Course> courseCodeResults2 = courseCodeSearch.suggest(suggN);\n for (Course c : courseCodeResults2) {\n if (!finalCourseList.contains(c)) {\n finalCourseList.add(c);\n }\n }\n }\n }\n\n\n\n if (finalCourseList.size() == 0) {\n List<String> wordsToSearch = new ArrayList<>();\n if (searchWordsSplit.length <= 5) {\n // search on each word\n for (int i = 0; i < searchWordsSplit.length; i++) {\n if (cache.getDeptForCode(searchWordsSplit[i].toUpperCase()) == null\n && !StringUtils.isNumeric(searchWordsSplit[i])\n && !smallWords.contains(searchWordsSplit[i])) {\n wordsToSearch.add(searchWordsSplit[i]);\n }\n\n }\n searchIndividualWords(finalCourseList, wordsToSearch);\n\n } else {\n // search on only the last 5 words\n for (int i = searchWordsSplit.length - 1; i > searchWordsSplit.length - 5; i--) {\n if (cache.getDeptForCode(searchWordsSplit[i].toUpperCase()) == null\n && !StringUtils.isNumeric(searchWordsSplit[i])\n && !smallWords.contains(searchWordsSplit[i])) {\n wordsToSearch.add(searchWordsSplit[i]);\n }\n }\n searchIndividualWords(finalCourseList, wordsToSearch);\n }\n }\n }\n\n return finalCourseList;\n }", "public void search() {\n String q = this.query.getText();\n String cat = this.category.getValue();\n if(cat.equals(\"Book\")) {\n searchBook(q);\n } else {\n searchCharacter(q);\n }\n }", "void compareSearch();", "private Category classify() {\n Category category = null;\n if (name != null) {\n if (name.contains(\"potato\") || name.contains(\"apple\")) {\n category = Category.FOOD;\n } else if (name.contains(\"cloths\") || name.contains(\"pants\") || name.contains(\"shirt\")) {\n category = Category.CLOTHING;\n }\n }\n return category;\n }", "public interface SearchCategory {\n /**\n * @return Internal name of the category as a search field.\n */\n public String getFieldName();\n\n /**\n * @return Human readable name for the category.\n */\n public String getCategoryLabel();\n}", "public void sortKnowledgeBase()\n {\n int i;\n Random random;\n String aPredicate;\n StringTokenizer tokenizer;\n //------------\n random = new Random();\n i = 0;\n while (i < knowledgeBase.size())\n {\n aPredicate = knowledgeBase.get(i).commitments.get(0).predicate;\n tokenizer = new StringTokenizer(aPredicate,\"(), \");\n if(tokenizer.nextToken().equals(\"secuencia\"))\n knowledgeBase.get(i).priority = random.nextInt(100);\n //end if\n else\n knowledgeBase.get(i).priority = random.nextInt(10000);\n //end else\n i = i + 1;\n }//end while\n Collections.sort(knowledgeBase);\n }", "TSearchResults searchWithQuery(TSearchQuery searchQuery, SearchParametersAPI overrideParameters, TRepo repo, AreaFactory<TContent, TArea> areaFactory, ContentFactory<TContent> contentFactory);", "SearchResultsType createSearchResultsType();", "Generalization createGeneralization();", "public AbstractSearchEngine() {}", "public Decision planBest(Context context, Decision defaultDecision);", "public Search applyFilters() {\n if (building.getValue() == null) {\n CustomAlert.warningAlert(\"Please select a building.\");\n return null;\n }\n if (capacity.getCharacters() == null) {\n CustomAlert.warningAlert(\"Please select a capacity.\");\n return null;\n }\n if (nuOfPlugs.getCharacters() == null) {\n CustomAlert.warningAlert(\"Please select the amount of plugs.\");\n return null;\n }\n boolean isScreen = false;\n boolean isBeamer = false;\n if (screen.isSelected()) {\n isScreen = true;\n }\n if (beamer.isSelected()) {\n isBeamer = true;\n }\n int intCapacity;\n String stringCapacity = (String) capacity.getCharacters();\n intCapacity = Integer.parseInt(stringCapacity);\n int intPlugs;\n String stringPlugs = (String) nuOfPlugs.getCharacters();\n intPlugs = Integer.parseInt(stringPlugs);\n return new Search(isScreen, isBeamer, intCapacity, building.getValue(), intPlugs);\n }", "private void generalizeCSACriteria(){\n\t\tArrayList<ServiceTemplate> comps = new ArrayList<ServiceTemplate>() ;\n\t\tArrayList<Criterion> crit = new ArrayList<Criterion>() ;\n\t\t\n\t\tcomps = this.data.getServiceTemplates();\n\t\tcrit = this.data.getCriteria();\n\t\t\n\t\tfor(ServiceTemplate c : comps){\n\t\t\tfor(Criterion cr : crit){\n\t\t\t\ttry {\n\t\t\t\t\tCriterion temp = (Criterion) BeanUtils.cloneBean(cr);\n\t\t\t\t\tc.addCrit(temp);\n\t\t\t\t} catch (IllegalAccessException | InstantiationException | InvocationTargetException | NoSuchMethodException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "List<TAlgmntBussRule> findTAlgmntBussRules(SearchFilter<TAlgmntBussRule> searchFilter);", "public InterfaceLogic createLogic(int category, int item) {\n if (Constant.LOG_TAG) {\n Log.d(TAG, \"category = \" + category + \";item=\" + item);\n }\n InterfaceLogic logic = null;\n switch (category) {\n case 0:\n // PictureSet\n switch (item) {\n case 0:\n // PictureMode\n logic = new PictureModeLogic(mContext);\n break;\n case 1:\n \t//Constast\n \tlogic = new ConstastModeLogic(mContext);\n \tbreak;\n case 2:\n \t//Brightness\n \tlogic = new BrightnessModeLogic(mContext);\n \tbreak;\n case 3:\n \t//Saturation\n \tlogic = new SaturationModeLogic(mContext);\n \tbreak;\n case 4:\n \t//Sharpness\n \tlogic = new SharpnessModeLogic(mContext);\n \tbreak;\n case 5:\n \t//Hue\n \tlogic = new HueModeLogic(mContext);\n \tbreak;\n case 6:\n \t//ColorTemp\n \tlogic = new ColorTempLogic(mContext);\n \tbreak;\n case 7:\n \t//Backlight\n \tlogic = new BacklightLogic(mContext);\n \tbreak;\n case 8:\n \t// Aspect\n \tlogic = new AspectLogic(mContext);\n \tbreak;\n case 9:\n \t//logic = new VGALogic(mContext);\n \tbreak;\n// case 1:\n// // ColorTemp\n// logic = new ColorTempLogic(mContext);\n// break;\n// case 2:\n// // Memclevel\n// logic = new MEMCLogic(mContext);\n// break;\n// case 3:\n// // PictureNR\n// logic = new PictureNRLogic(mContext);\n//\n// break;\n// case 4:\n// // DCI\n// logic = new DCILogic(mContext);\n// break;\n///* case 5:\n// // FleshTone\n// logic = new FleshToneLogic(mContext);\n// break;\n// case 6:\n// // BlueExtend\n// logic = new BlueExtendLogic(mContext);\n// break;*/\n// case 5:\n// // Aspect or VGA\n// if(SourceManagerInterface.getSelectSourceId() == EnumSourceIndex.SOURCE_VGA) {\n// logic = new VGALogic(mContext);\n// }else{\n// logic = new AspectLogic(mContext);\n// }\n// break;\n// case 6:\n// // Aspect\n// logic = new AspectLogic(mContext);\n// break;\n default:\n break;\n }\n break;\n case 1:\n // Sound set\n switch (item) {\n case 0:\n // SoundMode\n logic = new SoundModeLogic(mContext);\n break;\n/* case 1:\n // Treble\n logic = new TrebleLogic(mContext);\n break;\n case 2:\n // Bass\n logic = new BassLogic(mContext);\n break;*/\n case 4:\n // EQ\n logic = new EQLogic(mContext);\n break;\n case 1:\n // Balance\n logic = new BalanceLogic(mContext);\n break;\n/* case 3:\n // SRS\n logic = new SRSLogic(mContext);\n break;*/\n case 2:\n // AVC\n logic = new AVCLogic(mContext);\n break;\n case 3:\n // SPDIF output\n logic = new SPDIFLogic(mContext);\n break;\n/* case 8:\n // SpdifDelay\n logic = new SPDIFDelayLogic(mContext);\n break;\n case 9:\n // SubWoofer\n logic = new SubWooferLogic(mContext);\n break;\n case 10:\n // SubWooferVol\n logic = new SubWooferVolLogic(mContext);\n break;*/\n/* case 6:\n // SPDIF output\n logic = new SPDIFLogic(mContext);\n break;*/\n/* case 7:\n // SoundHangMode\n logic = new SoundHangModeLogic(mContext);\n break;*/\n/* case 4:\n // SoundHangMode\n logic = new SoundSpeakerLogic(mContext);\n break;*/\n default:\n break;\n }\n break;\n/*\n case 2:\n // set 3D\n switch (item) {\n case 0:\n // 3D Mode\n logic = new MenuOf3DModeLogic(mContext);\n break;\n case 1:\n // 3D LR Switch\n logic = new MenuOf3DLRSwitchLogic(mContext);\n break;\n case 2:\n // 3D TO 2D\n logic = new MenuOf3DTo2DLogic(mContext);\n break;\n case 3:\n // 3D depth\n logic = new MenuOf3DDepthLogic(mContext);\n break;\n case 4:\n // 3D View\n logic = new MenuOf3DViewLogic(mContext);\n break;\n default:\n break;\n\n }\n break;*/\n// case 2:\n// // set channel\n// switch (item) {\n// case 0:\n// // ChannelSkip\n// logic = new ChannelSkipLogic(mContext);\n// break;\n// case 1:\n// // ColorSystem\n// logic = new ColorSystemLogic(mContext);\n// break;\n// case 2:\n// // SoundSystem\n// logic = new AudioSystemLogic(mContext);\n// break;\n// case 3:\n// // FineTune\n// logic = new FineTuneLogic(mContext);\n// break;\n// case 4:\n// // ManualScan\n// logic = new ManualScanLogic(mContext);\n// break;\n// case 5:\n// // AutoScan\n// logic = new AutoScanLogic(mContext);\n// break;\n// case 6:\n// // channel edit\n// logic = new ChannelEditLogic(mContext);\n// break;\n// case 7:\n// // ChangeMode\n// logic = new ChangeModeLogic(mContext);\n// break;\n// default:\n// break;\n// }\n// break;\n\n case 2:\n // Advanced settings\n switch (item) {\n case 0:\n // DynamicBLight\n logic = new DynamicBLightLogic(mContext);\n break;\n case 1:\n // Backlight\n logic = new BacklightLogic(mContext);\n break;\n case 2:\n // SignalListener\n logic = new SingleListenerLogic(mContext);\n break;\n default:\n break;\n }\n break;\n case 3:\n // The demo mode\n switch (item) {\n case 0:\n // MEMC\n logic = new MEMCDemoLogic(mContext);\n break;\n/* case 2:\n // NR\n logic = new NRDemoLogic(mContext);\n break;\n case 3:\n // Sharpness\n logic = new SharpnessDemoLogic(mContext);\n break;*/\n case 1:\n // DCI\n logic = new DCIDemoLogic(mContext);\n break;\n case 2:\n // SR\n logic = new SRDemoLogic(mContext);\n break;\n/* case 6:\n // DBRC\n logic = new DBDRDemoLogic(mContext);\n break;*/\n default:\n break;\n }\n break;\n\n default:\n break;\n }\n return logic;\n }", "public void search() {\r\n \t\r\n }", "public interface Searchable {\n\n}", "public void runOptimizations() {\n\t\tOptInfo info = new OptInfo();\n\t\tfor (int i = 0; i < mainOpts.size(); i++) {\n\t\t\t//Extract the operator in the vector and convert it into a\n\t\t\t//SearchStrategy type. The object that is loaded into the\n\t\t\t//SearchStrategy type is not SearchStrategy as it is an\n\t\t\t//abstract class but a class that inherits off of\n\t\t\t//SearchStrategy such as FirstBestIntraOpt, FirstBestInterOpt\n\t\t\t//and so on. the opt.run method runs the run method\n\t\t\t//from the inheriting class such as FirstBestIntraOpt.\n\t\t\tSearchStrategy opt = (SearchStrategy) mainOpts.elementAt(i);\n\t\t\tSettings.printDebug(Settings.COMMENT, \"Running \" + opt);\n\n\t\t\t//The opt.run method called is dependent on the object that\n\t\t\t//was created in the mainOpts. If the object was BestBestIntraSearch\n\t\t\t//then the run method in BestBestIntraSearch is called.\n\t\t\toptInformation.add(opt.toString() + \" \" + opt.run(mainDepots));\n\t\t\tSettings.printDebug(Settings.COMMENT,\n\t\t\t\t\topt.toString() + \" Stats: \" +\n\t\t\t\t\t\t\tmainDepots.getSolutionString());\n\t\t}\n\t}", "abstract List<Divider<T> >getSearchResults(Divider<T> d);", "public interface SolutionSearchService {\n\n\t/**\n\t * Searches for instances matching all or one of the query parameters, depending\n\t * on the isOr parameter.\n\t * \n\t * @param queryParameters\n\t * field-name, field-value pairs. Value may be scalar or array.\n\t * @param isOr\n\t * If true, the query is a disjunction (\"or\"); otherwise the query is\n\t * a conjunction (\"and\").\n\t * @param pageable\n\t * Page and sort criteria\n\t * @return Page of instances, which may be empty.\n\t */\n\tPage<MLPSolution> findSolutions(Map<String, ? extends Object> queryParameters, boolean isOr, Pageable pageable);\n\n\t/**\n\t * Gets a page of instances matching all query parameters.\n\t * \n\t * @param nameKeywords\n\t * Searches the name field for the keywords using case-insensitive\n\t * LIKE after surrounding with wildcard '%' characters; ignored if\n\t * null or empty\n\t * @param descriptionKeywords\n\t * Searches the description field for the keywords using\n\t * case-insensitive LIKE after surrounding with wildcard '%'\n\t * characters; ignored if null or empty\n\t * @param active\n\t * Active status: true or false; required.\n\t * @param ownerIds\n\t * Limits match to solutions with one of the specified values;\n\t * ignored if null or empty\n\t * @param modelTypeCodes\n\t * Limits match to solutions with one of the specified values\n\t * including null (not the 4-character sequence \"null\"); ignored if\n\t * null or empty\n\t * @param accessTypeCodes\n\t * Limits match to solutions containing revisions with one of the\n\t * specified values including null (not the 4-character sequence\n\t * \"null\"); ignored if null or empty\n\t * @param validationStatusCodes\n\t * Limits match to solutions containing revisions with one of the\n\t * specified values including null (not the 4-character sequence\n\t * \"null\"); ignored if null or empty\n\t * @param tags\n\t * Limits match to solutions with one of the specified tags; ignored\n\t * if null or empty\n\t * @param pageable\n\t * Page and sort info\n\t * @return Page of matches\n\t */\n\tPage<MLPSolution> findPortalSolutions(String[] nameKeywords, String[] descriptionKeywords, boolean active,\n\t\t\tString[] ownerIds, String[] modelTypeCodes, String[] accessTypeCodes, String[] validationStatusCodes,\n\t\t\tString[] tags, Pageable pageable);\n\n\t/**\n\t * Gets a page of solutions with a change after the specified date. A match is\n\t * found if the solution's modified field, an associated revision's modified\n\t * field, or an associated artifact's modified field has a value larger than the\n\t * specified date. Only finds solutions that have 1+ revision(s) and in turn 1+\n\t * artifact(s). A freshly created solution with no revisions will not be found.\n\t * \n\t * @param active\n\t * Active status: true or false; required\n\t * @param accessTypeCodes\n\t * Limits match to solutions with one of the specified values\n\t * including null (not the 4-character sequence \"null\"); ignored if\n\t * null or empty\n\t * @param validationStatusCodes\n\t * Limits match to solutions with one of the specified values\n\t * including null (not the 4-character sequence \"null\"); ignored if\n\t * null or empty\n\t * @param modifiedDate\n\t * Last-modified date\n\t * @param pageable\n\t * Page and sort info\n\t * @return Page of matches\n\t */\n\tPage<MLPSolution> findSolutionsByModifiedDate(boolean active, String[] accessTypeCodes,\n\t\t\tString[] validationStatusCodes, Date modifiedDate, Pageable pageable);\n\n}", "public static void setPreferredSortingCriterion(Context context, String newCriterion){\n\n SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);\n SharedPreferences.Editor editor = sp.edit();\n\n String keyForSortingCriterion = context.getString(R.string.pref_sort_criterion_key);\n\n editor.putString(keyForSortingCriterion,newCriterion);\n editor.apply();\n }", "@Override\n\tpublic void before(Method method, Object[] args, Object obj) throws Throwable {\n\t\tMap<String, Object> conditionMap = new HashMap<String, Object>();\n\t\t\n\t\tList<Condition> conditionList = new ArrayList<Condition>();\n\t\tfor (int i = 0; i < args.length; i++) {\n\t\t\tif (args[i] instanceof Search) {\n\t\t\t\tSet<String> nameSet = new HashSet<String>();\n\t\t\t\tCondition c = null;\n\t\t\t\tServletRequest request = RequestContext.getCurrentContext().getRequest();\n\t\t\t\t@SuppressWarnings(\"rawtypes\")\n\t\t\t\tEnumeration enu = request.getParameterNames();\n\t\t\t\twhile (enu.hasMoreElements()) {\n\t\t\t\t\tString name = (String)enu.nextElement();\n\t\t\t\t\tString value = request.getParameter(name);\n\t\t\t\t\tList<String> params = Arrays.asList(\"routerName\", \"methods\", \"confirmMethods\", \"gridId\");\n\t\t\t\t\tif (params.contains(name)) {\n\t\t\t\t\t\tc = new Condition();\n\t\t\t\t\t\tc.setName(name);\n\t\t\t\t\t\tc.setValue(value);\n\t\t\t\t\t\tconditionMap.put(name, value);\n\t\t\t\t\t\tnameSet.add(c.getName());\n\t\t\t\t\t\tconditionList.add(c);\n\t\t\t\t\t} else if (name.toLowerCase().startsWith(SEARCH_PREFIX) \n\t\t\t\t\t\t\t&& (value != null && (!value.equals(\"\")))) {\n//\t\t\t\t\t\tboolean has = nameSet.contains(name.split(\"_\")[1]);\n//\t\t\t\t\t\tif (name.toLowerCase().endsWith(SEARCH_SUFFIX_START)) {\n//\t\t\t\t\t\t\tif (has) {\n//\t\t\t\t\t\t\t\tfor (Condition o : conditionList) {\n//\t\t\t\t\t\t\t\t\tif (o.getName().equals(name.split(\"_\")[1])) {\n//\t\t\t\t\t\t\t\t\t\tc = o;\n//\t\t\t\t\t\t\t\t\t\tconditionList.remove(o);\n//\t\t\t\t\t\t\t\t\t\tbreak;\n//\t\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t} else {\n//\t\t\t\t\t\t\t\tc = new MultiCondition();\n//\t\t\t\t\t\t\t\t((MultiCondition)c).setName(name.split(\"_\")[1]);\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\tif (((MultiCondition) c).getOperateType() == 0) {\n//\t\t\t\t\t\t\t\t((MultiCondition) c).setOperateType(ConditionOperator.GTE);\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t((MultiCondition)c).setValue(value);\n//\t\t\t\t\t\t} else if (name.toLowerCase().endsWith(SEARCH_SUFFIX_END)) {\n//\t\t\t\t\t\t\tif (has) {\n//\t\t\t\t\t\t\t\tfor (Condition o : conditionList) {\n//\t\t\t\t\t\t\t\t\tif (o.getName().equals(name.split(\"_\")[1])) {\n//\t\t\t\t\t\t\t\t\t\tc = o;\n//\t\t\t\t\t\t\t\t\t\tconditionList.remove(o);\n//\t\t\t\t\t\t\t\t\t\tbreak;\n//\t\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t} else {\n//\t\t\t\t\t\t\t\tc = new MultiCondition();\n//\t\t\t\t\t\t\t\t((MultiCondition)c).setName(name.split(\"_\")[1]);\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\tif (((MultiCondition) c).getOperateType2() == 0) {\n//\t\t\t\t\t\t\t\t((MultiCondition)c).setOperateType2(ConditionOperator.LTE);\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t((MultiCondition)c).setValue2(value);\n//\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tc = new Condition();\n\t\t\t\t\t\t\tc.setName(name.split(\"_\")[1]);\n//\t\t\t\t\t\t\tif (c.getOperateType() == 0) {\n//\t\t\t\t\t\t\t\tc.setOperateType(ConditionOperator.EQ);\n//\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (value.indexOf(\":\") > 0 && value.length() == 19) {\n\t\t\t\t\t\t\t\tc.setValue(DateUtil.formatTimestampToDate(value));\n\t\t\t\t\t\t\t} else if (\"on\".equals(value)) {\n\t\t\t\t\t\t\t\tvalue = \"1\";\n\t\t\t\t\t\t\t\tc.setValue(value);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tc.setValue(value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tconditionMap.put(name, value);\n//\t\t\t\t\t\t}\n\t\t\t\t\t\tnameSet.add(c.getName());\n\t\t\t\t\t\tconditionList.add(c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (conditionList.size() > 0) {\n\t\t\t\t\t((Search)args[i]).setConditionList(conditionList);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSearchConditionFilter s = method.getAnnotation(SearchConditionFilter.class);\n\t\tif (s != null && s.limits() != null && s.limits().length != 0) {\n\t\t\t//TODO 处理limits,只按照limits限制的条件查询,若不限制则默认全部(即不处理)\n\t\t\tList<Condition> removes = new ArrayList<Condition>();\n\t\t\tList<String> limitList = Arrays.asList(s.limits());\n\t\t\tfor (Condition cond : conditionList) {\n\t\t\t\tif (!limitList.contains(cond.getName())) {\n\t\t\t\t\tremoves.add(cond);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconditionList.removeAll(removes);\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < args.length; i++) {\n\t\t\tif (args[i] instanceof Model && conditionList.size() > 0) {\n\t\t\t\t((Model)args[i]).addAttribute(\"conditions\", conditionMap);\n\t\t\t\tfor (Iterator<Condition> ite = conditionList.iterator(); ite.hasNext();) {\n\t\t\t\t\tCondition cond = ite.next();\n\t\t\t\t\t((Model)args[i]).addAttribute(SEARCH_PREFIX + cond.getName(), conditionMap.get(SEARCH_PREFIX + cond.getName()));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n//\t\tfor (int i = 0; i < args.length; i++) {\n//\t\t\tif (args[i] instanceof Model && conditionList.size() > 0) {\n//\t\t\t\tfor (Iterator<Condition> ite = conditionList.iterator(); ite.hasNext();) {\n//\t\t\t\t\tCondition cond = ite.next();\n//\t\t\t\t\tif (cond instanceof MultiCondition) {\n//\t\t\t\t\t\t((Model)args[i]).addAttribute(SEARCH_PREFIX + cond.getName() + SEARCH_SUFFIX_START, cond.getValue());\n//\t\t\t\t\t\t((Model)args[i]).addAttribute(SEARCH_PREFIX + cond.getName() + SEARCH_SUFFIX_END, ((MultiCondition)cond).getValue2());\n//\t\t\t\t\t\tconditionMap.put(SEARCH_PREFIX + cond.getName() + SEARCH_SUFFIX_START, cond.getValue());\n//\t\t\t\t\t\tconditionMap.put(SEARCH_PREFIX + cond.getName() + SEARCH_SUFFIX_END, ((MultiCondition)cond).getValue2());\n//\t\t\t\t\t} else {\n//\t\t\t\t\t\t((Model)args[i]).addAttribute(SEARCH_PREFIX + cond.getName(), cond.getValue());\n//\t\t\t\t\t\tconditionMap.put(SEARCH_PREFIX + cond.getName(), cond.getValue());\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t\t((Model)args[i]).addAttribute(\"conditions\", conditionMap);\n//\t\t\t}\n//\t\t}\n\t\t\n\t\t\n\t\t//BusinessCallController、listcontent.ftl、BackendHelper、admin.common.js、index.ftl(resume)、\n\t\t//BasicBusinessService、ResumeBusinessService、、、UserBusinessService\n//\t\tString simpleClassName = obj.getClass().getSimpleName();\n//\t\tString beanId = StringUtil.convertFirstChar2LowerCase(simpleClassName.replace(\"Controller\", \"Helper\"));\n//\t\tBaseHelper helper = SpringApplicationContext.getBean(beanId);\n//\t\t\n//\t\tif (null != helper) {//设置Condition中value的类型\n//\t\t\thelper.getConditionValue(propertyName, value);\n//\t\t}\n\t}", "public CategoricalResults(){\n\n }", "private static Searcher createSearcher(String[] args) {\n if (args.length > 1 && \"duden\".equals(args[1])) {//Use DWDS by default, Duden only on explicit request\n return SearcherFactory.newDuden();\n } else {\n return SearcherFactory.newDwds();\n }\n }", "void searchProbed (Search search);", "public interface SearchSolver {\n\n /**\n * initializes the algorithm. This method has to be called before calling any other method\n * @param graph the graph of the map where the search takes place\n * @param targetStart the start position for the target (in our case the thief)\n * @param searchStart the start position for the searcher (in our case the police)\n * @param counter the counter object that counts the expanded nodes\n */\n void initialize(Graph graph, Node targetStart, Node searchStart, ExpandCounter counter);\n\n /**\n * gets the shortest path from search start to target\n * @return list of edges that describe the path\n * @throws NoPathFoundException if there is no path to the target\n */\n List<Edge> getPath() throws NoPathFoundException;\n}", "@Test\n\tpublic void testSearchBasedOnRequest2() {\n\t\tsearchBasedOnRequestSetup();\n\t\t\n\t\tPreference prefs = prefManager.getUserPreference();\n\t\tprefs.setThreshold(10000);\n\t\t\n\t\tList<Suggestion> sugg = dm.searchBasedOnRequest(\"lokeyanhao\", prefs, true);\n\t\tassertTrue(sugg.size() > 0);\n\t\tassertTrue(sugg.get(0).getType() == Suggestion.ENTITY);\n\t}", "SearchResult search(State root, List<State> expanded_list, State goal);", "public String categoryScan(String sIn)\r\n\t{\r\n\t\tString goBack = \"unassigned\";\r\n\t\t\r\n\t\tif(sIn.contains(\"PROFESSIONAL CATEGORY\") || sIn.contains(\"PROFESSIONAL/MANAGEMENT CATEGORY\"))\r\n\t\t{\r\n\t\t\tgoBack = \"PROFESSIONAL\";\r\n\t\t} else if(sIn.contains(\"HEALTHCARE CATEGORY\") || sIn.contains(\"HEALTH CARE/NURSING CATEGORY\"))\r\n\t\t{\r\n\t\t\tgoBack = \"HEALTHCARE\";\r\n\t\t} else if(sIn.contains(\"SALES / MARKETING CATEGORY\") || sIn.contains(\"SALES/MARKETING CATEGORY\"))\r\n\t\t{\r\n\t\t\tgoBack = \"SALES\";\r\n\t\t}else if(sIn.contains(\"SKILLS/TRADES CATEGORY\") || sIn.contains(\"SKILLED TRADES CATEGORY\"))\r\n\t\t{\r\n\t\t\tgoBack = \"SKILLS TRADES\";\r\n\t\t}else if(sIn.contains(\"GENERAL CATEGORY\"))\r\n\t\t{\r\n\t\t\tgoBack = \"GENERAL\";\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn goBack;\r\n\t}", "public void performSearch() {\n final String url = String.format(BING_SEARCH_URL, Words.getRandomWord(), Words.getRandomWord());\n\n //open page with custom data\n openWebPage(url, \"Search url: \" + url);\n }", "CampusSearchQuery generateQuery();", "public Decision planWorst(Context context, Decision defaultDecision);", "@Override\n\tpublic void onClick(View v) {\n\t\tif (searchText.equals(\"Restaurants\")){\n\t\t\tsearchType=\"restaurant\";\t\n\t\t}\n\t\telse if (searchText.equals(\"Shopping Mall\")){\n\t\t\tsearchType=\"shopping_mall\";\n\t\t}\n\t\telse if (searchText.equals(\"ATM\")){\n\t\t\tsearchType=\"atm\";\n\t\t}\n\t\telse if (searchText.equals(\"Bank\")){\n\t\t\tsearchType=\"bank\";\n\t\t}\n\t\telse if (searchText.equals(\"Hospital\")){\n\t\t\tsearchType=\"hospital\";\n\t\t}\n\t\tloadPage();\n\t\t\n\t}", "public void execFuzzySearchTraitFunc(){\n\n Map map = new HashMap();\n\n if(this.searchParam != null && this.searchParam.length()> 0 ){\n System.out.println(\"=============search param\"+this.searchParam );\n map.put(\"searchParam\",this.searchParam);\n }\n\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"all\") == false){\n map.put(\"species\",this.searchSpecies);\n System.out.println(\"species=\"+this.searchSpecies);\n }\n\n if(this.searchTrait != null&& this.searchTrait.equals(\"null\")==false && this.searchTrait.length()>0){\n\n\n map.put(\"searchTrait\", this.searchTrait) ;\n }\n\n if(this.pvalue != null && this.pvalue.equals(\"null\")==false&& this.pvalue.length()>0){\n\n\n map.put(\"psitu\", this.psitu);\n map.put(\"pval\", this.pvalue) ;\n }\n\n\n\n gwasAssociationList =(List<GwasAssociationBean>) baseService.findResultList(\"cn.big.gvk.dm.GwasAssociation.selecTraitByFuzzySearch\",map);\n\n if(gwasAssociationList != null && gwasAssociationList.size()>0){\n\n for(GwasAssociationBean gwas: gwasAssociationList){\n\n //trait count\n Map cmap = new HashMap();\n cmap.put(\"traitId\",gwas.getTraitId()) ;\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"all\") == false){\n cmap.put(\"species\",this.searchSpecies);\n\n }\n GwasAssociationBean tg_bean = (GwasAssociationBean)baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectAssociationCountByTraitId\",cmap);\n if(tg_bean != null ){\n gwas.setTraitCount(tg_bean.getGwasCount());\n }\n\n List<TermInformationBean> tilist = (List<TermInformationBean>)baseService.findResultList(\"cn.big.gvk.dm.Term.selectTermDefinition\",gwas.getTraitId());\n String s=\"\";\n if(tilist != null && tilist.size()>0 ){\n for(TermInformationBean tb:tilist ){\n if(tb!= null && tb.getTermDefinition() != null ){\n s+= tb.getTermDefinition() +\";\";\n }\n\n }\n }\n if(s.length()>0){\n s= s.substring(0, s.length()-1) ;\n }\n gwas.setTermDefinition(s);\n\n //study count\n GwasAssociationBean tg_bean1 = (GwasAssociationBean)baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectStudyCountByTraitid\",cmap);\n if(tg_bean1 != null ){\n gwas.setGwasCount(tg_bean1.getGwasCount());\n }\n\n }\n\n\n }\n\n StringBuffer sb = new StringBuffer();\n if(this.gwasAssociationList != null && this.gwasAssociationList.size()>0){\n for(GwasAssociationBean gwas: gwasAssociationList){\n sb.append(gwas.getTraitName()).append(\"\\t\").append(gwas.getTermDefinition()).append(\"\\t\")\n .append(gwas.getTraitCount()).append(\"\\t\").append(gwas.getGwasCount()).append(\"\\n\");\n }\n }\n\n if(format == 1 ){ //export txt\n this.response.reset();\n this.response.setHeader(\"Content-Disposition\",\n \"attachment;filename=export.txt\");\n this.response.setContentType(\"application/ms-txt\");\n try {\n PrintWriter pr = this.response.getWriter();\n pr.print(sb.toString());\n pr.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n\n }", "public abstract HashMap search(String keyword);", "public interface SearchCallback<T, O> extends IClusterable {\r\n public SearchCallbackResult<T> search(String searchString, O searchBy);\r\n }", "@Override\n\tpublic Object[] advSearchCondition() {\n\t\treturn null;\n\t}", "private void applyLocationAlgorithms() {\n List<NodeState> states = new ArrayList<NodeState>();\n List<RemoteNode> nodes = new ArrayList<RemoteNode>(nodeManager.getNodes());\n AlgorithmMatchCriteria criteria;\n\n for (Algorithm la : algorithmManager.getAlgorithms()) {\n if (!la.isEnabled()) continue;\n criteria = algorithmManager.getCriteria(la);\n\n List<Node> filteredNodes = criteria.filter(nodes);\n if (filteredNodes.size() > 0) {\n states.add(la.applyTo(nodeManager.getLocalNode(), filteredNodes));\n }\n }\n for (NodeState s : states) {\n nodeManager.getLocalNode().addPending(s);\n }\n }", "public Decision bestFor(Context context, ShapeType type);", "private Node estimateRelevance(Node original) throws Exception {\n Node combineNode = new Node(\"combine\", new NodeParameters(), original.getInternalNodes(), original.getPosition());\n\n // Only get as many as we need\n Parameters localParameters = retrieval.getGlobalParameters().clone();\n int fbDocs = (int) retrieval.getGlobalParameters().get(\"fbDocs\", 10);\n localParameters.set(\"requested\", fbDocs);\n\n // transform and run\n Node transformedCombineNode = retrieval.transformQuery(combineNode, localParameters);\n List<ScoredDocument> initialResults = retrieval.executeQuery(transformedCombineNode, localParameters).scoredDocuments;\n \n // Gather content\n ArrayList<String> names = new ArrayList<String>();\n for (ScoredDocument sd : initialResults) {\n names.add(sd.documentName);\n }\n List<Document> docs = getDocuments(names);\n\n // Now the maps from the different information sources\n // Each of these is a term -> field -> score double-mapping\n HashMap<String, TObjectDoubleHashMap<String>> uCFSs = null;\n double ucfw = p.get(\"ucfw\", 1.0);\n if (ucfw != 0.0) {\n uCFSs = getUnigramCollFieldScores();\n }\n\n HashMap<String, TObjectDoubleHashMap<String>> bCFSs = null;\n double bcfw = p.get(\"bcfw\", 1.0);\n if (bcfw != 0.0) {\n bCFSs = getBigramCollFieldScores();\n }\n\n HashMap<String, TObjectDoubleHashMap<String>> uPRFSs = null;\n double uprfw = p.get(\"uprfw\", 1.0);\n if (uprfw != 0.0) {\n uPRFSs = getUnigramPRFScores(docs);\n }\n\n HashMap<String, TObjectDoubleHashMap<String>> bPRFSs = null;\n double bprfw = p.get(\"bprfw\", 1.0);\n if (bprfw != 0.0) {\n bPRFSs = getBigramPRFScores(docs);\n }\n\n // We can now construct term-field weights using our supplied lambdas\n // and scores\n Node termNodes = new Node(\"combine\", new NodeParameters(), new ArrayList<Node>(), 0);\n termNodes.getNodeParameters().set(\"norm\", false);\n TObjectDoubleHashMap<String> weights = new TObjectDoubleHashMap<String>();\n for (String term : queryTerms) {\n weights.clear();\n for (String field : fields) {\n double sum = 0.0;\n if (uCFSs != null) {\n sum += (ucfw * uCFSs.get(term).get(field));\n }\n\n if (bCFSs != null) {\n TObjectDoubleHashMap<String> termMap = bCFSs.get(term);\n if (termMap != null) {\n sum += (bcfw * termMap.get(field));\n }\n }\n\n if (uPRFSs != null) {\n sum += (uprfw * uPRFSs.get(term).get(field));\n }\n\n if (bPRFSs != null) {\n TObjectDoubleHashMap<String> termMap = bPRFSs.get(term);\n if (termMap != null) {\n sum += (bprfw * termMap.get(field));\n }\n }\n weights.put(field, sum);\n }\n termNodes.addChild(createTermFieldNodes(term, weights));\n }\n return termNodes;\n }", "public Solution solve(ISearchable s) {\n return null;\n }", "public MdCategoryVCriteria() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public interface LdCDef extends Classification {\n\n /** The empty array for no sisters. */\n String[] EMPTY_SISTERS = new String[]{};\n\n /** The empty map for no sub-items. */\n @SuppressWarnings(\"unchecked\")\n Map<String, Object> EMPTY_SUB_ITEM_MAP = (Map<String, Object>)Collections.EMPTY_MAP;\n\n /**\n * はいいいえを示す\n */\n public enum YesNo implements LdCDef {\n /** y */\n y(\"y\", \"y\", EMPTY_SISTERS)\n ,\n /** n */\n n(\"n\", \"n\", EMPTY_SISTERS)\n ;\n private static final Map<String, YesNo> _codeValueMap = new HashMap<String, YesNo>();\n static {\n for (YesNo value : values()) {\n _codeValueMap.put(value.code().toLowerCase(), value);\n for (String sister : value.sisters()) { _codeValueMap.put(sister.toLowerCase(), value); }\n }\n }\n private String _code; private String _alias; private String[] _sisters;\n private YesNo(String code, String alias, String[] sisters)\n { _code = code; _alias = alias; _sisters = sisters; }\n public String code() { return _code; } public String alias() { return _alias; }\n private String[] sisters() { return _sisters; }\n public Map<String, Object> subItemMap() { return EMPTY_SUB_ITEM_MAP; }\n public ClassificationMeta meta() { return LdCDef.DefMeta.YesNo; }\n\n public boolean inGroup(String groupName) {\n return false;\n }\n\n /**\n * Get the classification by the code. (CaseInsensitive)\n * @param code The value of code, which is case-insensitive. (NullAllowed: if null, returns null)\n * @return The instance of the corresponding classification to the code. (NullAllowed: if not found, returns null)\n */\n public static YesNo codeOf(Object code) {\n if (code == null) { return null; }\n if (code instanceof YesNo) { return (YesNo)code; }\n return _codeValueMap.get(code.toString().toLowerCase());\n }\n\n /**\n * Get the classification by the name (also called 'value' in ENUM world).\n * @param name The string of name, which is case-sensitive. (NullAllowed: if null, returns null)\n * @return The instance of the corresponding classification to the name. (NullAllowed: if not found, returns null)\n */\n public static YesNo nameOf(String name) {\n if (name == null) { return null; }\n try { return valueOf(name); } catch (RuntimeException ignored) { return null; }\n }\n\n /**\n * Get the list of all classification elements. (returns new copied list)\n * @return The list of all classification elements. (NotNull)\n */\n public static List<YesNo> listAll() {\n return new ArrayList<YesNo>(Arrays.asList(values()));\n }\n\n /**\n * Get the list of classification elements in the specified group. (returns new copied list) <br />\n * @param groupName The string of group name, which is case-sensitive. (NullAllowed: if null, returns empty list)\n * @return The list of classification elements in the group. (NotNull)\n */\n public static List<YesNo> groupOf(String groupName) {\n return new ArrayList<YesNo>(4);\n }\n\n @Override public String toString() { return code(); }\n }\n\n /**\n * 蔵書の状態を示す\n */\n public enum CollectionStatus implements LdCDef {\n /** NOR: 通常状態を示す */\n NOR(\"NOR\", \"NOR\", EMPTY_SISTERS)\n ,\n /** WAT: 待ち状態を示す */\n WAT(\"WAT\", \"WAT\", EMPTY_SISTERS)\n ,\n /** OUT: 貸し出し中を示す */\n OUT(\"OUT\", \"OUT\", EMPTY_SISTERS)\n ;\n private static final Map<String, CollectionStatus> _codeValueMap = new HashMap<String, CollectionStatus>();\n static {\n for (CollectionStatus value : values()) {\n _codeValueMap.put(value.code().toLowerCase(), value);\n for (String sister : value.sisters()) { _codeValueMap.put(sister.toLowerCase(), value); }\n }\n }\n private String _code; private String _alias; private String[] _sisters;\n private CollectionStatus(String code, String alias, String[] sisters)\n { _code = code; _alias = alias; _sisters = sisters; }\n public String code() { return _code; } public String alias() { return _alias; }\n private String[] sisters() { return _sisters; }\n public Map<String, Object> subItemMap() { return EMPTY_SUB_ITEM_MAP; }\n public ClassificationMeta meta() { return LdCDef.DefMeta.CollectionStatus; }\n\n public boolean inGroup(String groupName) {\n return false;\n }\n\n /**\n * Get the classification by the code. (CaseInsensitive)\n * @param code The value of code, which is case-insensitive. (NullAllowed: if null, returns null)\n * @return The instance of the corresponding classification to the code. (NullAllowed: if not found, returns null)\n */\n public static CollectionStatus codeOf(Object code) {\n if (code == null) { return null; }\n if (code instanceof CollectionStatus) { return (CollectionStatus)code; }\n return _codeValueMap.get(code.toString().toLowerCase());\n }\n\n /**\n * Get the classification by the name (also called 'value' in ENUM world).\n * @param name The string of name, which is case-sensitive. (NullAllowed: if null, returns null)\n * @return The instance of the corresponding classification to the name. (NullAllowed: if not found, returns null)\n */\n public static CollectionStatus nameOf(String name) {\n if (name == null) { return null; }\n try { return valueOf(name); } catch (RuntimeException ignored) { return null; }\n }\n\n /**\n * Get the list of all classification elements. (returns new copied list)\n * @return The list of all classification elements. (NotNull)\n */\n public static List<CollectionStatus> listAll() {\n return new ArrayList<CollectionStatus>(Arrays.asList(values()));\n }\n\n /**\n * Get the list of classification elements in the specified group. (returns new copied list) <br />\n * @param groupName The string of group name, which is case-sensitive. (NullAllowed: if null, returns empty list)\n * @return The list of classification elements in the group. (NotNull)\n */\n public static List<CollectionStatus> groupOf(String groupName) {\n return new ArrayList<CollectionStatus>(4);\n }\n\n @Override public String toString() { return code(); }\n }\n\n /**\n * 登録モジュールタイプ\n */\n public enum RegisterModuleType implements LdCDef {\n /** Online: Online Module */\n Online(\"OLN\", \"Online\", EMPTY_SISTERS)\n ,\n /** Batch: Batch Module */\n Batch(\"BTC\", \"Batch\", EMPTY_SISTERS)\n ;\n private static final Map<String, RegisterModuleType> _codeValueMap = new HashMap<String, RegisterModuleType>();\n static {\n for (RegisterModuleType value : values()) {\n _codeValueMap.put(value.code().toLowerCase(), value);\n for (String sister : value.sisters()) { _codeValueMap.put(sister.toLowerCase(), value); }\n }\n }\n private String _code; private String _alias; private String[] _sisters;\n private RegisterModuleType(String code, String alias, String[] sisters)\n { _code = code; _alias = alias; _sisters = sisters; }\n public String code() { return _code; } public String alias() { return _alias; }\n private String[] sisters() { return _sisters; }\n public Map<String, Object> subItemMap() { return EMPTY_SUB_ITEM_MAP; }\n public ClassificationMeta meta() { return LdCDef.DefMeta.RegisterModuleType; }\n\n public boolean inGroup(String groupName) {\n return false;\n }\n\n /**\n * Get the classification by the code. (CaseInsensitive)\n * @param code The value of code, which is case-insensitive. (NullAllowed: if null, returns null)\n * @return The instance of the corresponding classification to the code. (NullAllowed: if not found, returns null)\n */\n public static RegisterModuleType codeOf(Object code) {\n if (code == null) { return null; }\n if (code instanceof RegisterModuleType) { return (RegisterModuleType)code; }\n return _codeValueMap.get(code.toString().toLowerCase());\n }\n\n /**\n * Get the classification by the name (also called 'value' in ENUM world).\n * @param name The string of name, which is case-sensitive. (NullAllowed: if null, returns null)\n * @return The instance of the corresponding classification to the name. (NullAllowed: if not found, returns null)\n */\n public static RegisterModuleType nameOf(String name) {\n if (name == null) { return null; }\n try { return valueOf(name); } catch (RuntimeException ignored) { return null; }\n }\n\n /**\n * Get the list of all classification elements. (returns new copied list)\n * @return The list of all classification elements. (NotNull)\n */\n public static List<RegisterModuleType> listAll() {\n return new ArrayList<RegisterModuleType>(Arrays.asList(values()));\n }\n\n /**\n * Get the list of classification elements in the specified group. (returns new copied list) <br />\n * @param groupName The string of group name, which is case-sensitive. (NullAllowed: if null, returns empty list)\n * @return The list of classification elements in the group. (NotNull)\n */\n public static List<RegisterModuleType> groupOf(String groupName) {\n return new ArrayList<RegisterModuleType>(4);\n }\n\n @Override public String toString() { return code(); }\n }\n\n /**\n * 更新モジュールタイプ\n */\n public enum UpdateModuleType implements LdCDef {\n /** Online: Online Module */\n Online(\"OLN\", \"Online\", EMPTY_SISTERS)\n ,\n /** Batch: Batch Module */\n Batch(\"BTC\", \"Batch\", EMPTY_SISTERS)\n ;\n private static final Map<String, UpdateModuleType> _codeValueMap = new HashMap<String, UpdateModuleType>();\n static {\n for (UpdateModuleType value : values()) {\n _codeValueMap.put(value.code().toLowerCase(), value);\n for (String sister : value.sisters()) { _codeValueMap.put(sister.toLowerCase(), value); }\n }\n }\n private String _code; private String _alias; private String[] _sisters;\n private UpdateModuleType(String code, String alias, String[] sisters)\n { _code = code; _alias = alias; _sisters = sisters; }\n public String code() { return _code; } public String alias() { return _alias; }\n private String[] sisters() { return _sisters; }\n public Map<String, Object> subItemMap() { return EMPTY_SUB_ITEM_MAP; }\n public ClassificationMeta meta() { return LdCDef.DefMeta.UpdateModuleType; }\n\n public boolean inGroup(String groupName) {\n return false;\n }\n\n /**\n * Get the classification by the code. (CaseInsensitive)\n * @param code The value of code, which is case-insensitive. (NullAllowed: if null, returns null)\n * @return The instance of the corresponding classification to the code. (NullAllowed: if not found, returns null)\n */\n public static UpdateModuleType codeOf(Object code) {\n if (code == null) { return null; }\n if (code instanceof UpdateModuleType) { return (UpdateModuleType)code; }\n return _codeValueMap.get(code.toString().toLowerCase());\n }\n\n /**\n * Get the classification by the name (also called 'value' in ENUM world).\n * @param name The string of name, which is case-sensitive. (NullAllowed: if null, returns null)\n * @return The instance of the corresponding classification to the name. (NullAllowed: if not found, returns null)\n */\n public static UpdateModuleType nameOf(String name) {\n if (name == null) { return null; }\n try { return valueOf(name); } catch (RuntimeException ignored) { return null; }\n }\n\n /**\n * Get the list of all classification elements. (returns new copied list)\n * @return The list of all classification elements. (NotNull)\n */\n public static List<UpdateModuleType> listAll() {\n return new ArrayList<UpdateModuleType>(Arrays.asList(values()));\n }\n\n /**\n * Get the list of classification elements in the specified group. (returns new copied list) <br />\n * @param groupName The string of group name, which is case-sensitive. (NullAllowed: if null, returns empty list)\n * @return The list of classification elements in the group. (NotNull)\n */\n public static List<UpdateModuleType> groupOf(String groupName) {\n return new ArrayList<UpdateModuleType>(4);\n }\n\n @Override public String toString() { return code(); }\n }\n\n public enum DefMeta implements ClassificationMeta {\n /** はいいいえを示す */\n YesNo\n ,\n /** 蔵書の状態を示す */\n CollectionStatus\n ,\n /** 登録モジュールタイプ */\n RegisterModuleType\n ,\n /** 更新モジュールタイプ */\n UpdateModuleType\n ;\n public String classificationName() {\n return name(); // same as definition name\n }\n\n public Classification codeOf(Object code) {\n if (\"YesNo\".equals(name())) { return LdCDef.YesNo.codeOf(code); }\n if (\"CollectionStatus\".equals(name())) { return LdCDef.CollectionStatus.codeOf(code); }\n if (\"RegisterModuleType\".equals(name())) { return LdCDef.RegisterModuleType.codeOf(code); }\n if (\"UpdateModuleType\".equals(name())) { return LdCDef.UpdateModuleType.codeOf(code); }\n throw new IllegalStateException(\"Unknown definition: \" + this); // basically unreachable\n }\n\n public Classification nameOf(String name) {\n if (\"YesNo\".equals(name())) { return LdCDef.YesNo.valueOf(name); }\n if (\"CollectionStatus\".equals(name())) { return LdCDef.CollectionStatus.valueOf(name); }\n if (\"RegisterModuleType\".equals(name())) { return LdCDef.RegisterModuleType.valueOf(name); }\n if (\"UpdateModuleType\".equals(name())) { return LdCDef.UpdateModuleType.valueOf(name); }\n throw new IllegalStateException(\"Unknown definition: \" + this); // basically unreachable\n }\n\n public List<Classification> listAll() {\n if (\"YesNo\".equals(name())) { return toClassificationList(LdCDef.YesNo.listAll()); }\n if (\"CollectionStatus\".equals(name())) { return toClassificationList(LdCDef.CollectionStatus.listAll()); }\n if (\"RegisterModuleType\".equals(name())) { return toClassificationList(LdCDef.RegisterModuleType.listAll()); }\n if (\"UpdateModuleType\".equals(name())) { return toClassificationList(LdCDef.UpdateModuleType.listAll()); }\n throw new IllegalStateException(\"Unknown definition: \" + this); // basically unreachable\n }\n\n public List<Classification> groupOf(String groupName) {\n if (\"YesNo\".equals(name())) { return toClassificationList(LdCDef.YesNo.groupOf(groupName)); }\n if (\"CollectionStatus\".equals(name())) { return toClassificationList(LdCDef.CollectionStatus.groupOf(groupName)); }\n if (\"RegisterModuleType\".equals(name())) { return toClassificationList(LdCDef.RegisterModuleType.groupOf(groupName)); }\n if (\"UpdateModuleType\".equals(name())) { return toClassificationList(LdCDef.UpdateModuleType.groupOf(groupName)); }\n throw new IllegalStateException(\"Unknown definition: \" + this); // basically unreachable\n }\n\n @SuppressWarnings(\"unchecked\")\n private List<Classification> toClassificationList(List<?> clsList) {\n return (List<Classification>)clsList;\n }\n\n public ClassificationCodeType codeType() {\n if (\"YesNo\".equals(name())) { return ClassificationCodeType.String; }\n if (\"CollectionStatus\".equals(name())) { return ClassificationCodeType.String; }\n if (\"RegisterModuleType\".equals(name())) { return ClassificationCodeType.String; }\n if (\"UpdateModuleType\".equals(name())) { return ClassificationCodeType.String; }\n return ClassificationCodeType.String; // as default\n }\n\n public ClassificationUndefinedHandlingType undefinedHandlingType() {\n if (\"YesNo\".equals(name())) { return ClassificationUndefinedHandlingType.EXCEPTION; }\n if (\"CollectionStatus\".equals(name())) { return ClassificationUndefinedHandlingType.EXCEPTION; }\n if (\"RegisterModuleType\".equals(name())) { return ClassificationUndefinedHandlingType.EXCEPTION; }\n if (\"UpdateModuleType\".equals(name())) { return ClassificationUndefinedHandlingType.EXCEPTION; }\n return ClassificationUndefinedHandlingType.LOGGING; // as default\n }\n }\n}", "List<DataTerm> search(String searchTerm);", "public String getSearchString() {\r\n return super.getSearchString();\r\n \r\n// String searchStr = \"\";\r\n// //put exact phrase at the very beginning\r\n// if(exactphrase != null && exactphrase.length() > 0)\r\n// {\r\n// searchStr += \"\\\"\" + exactphrase + \"\\\"\";\r\n// }\r\n//\r\n// String allwordsSearchStr = \"\";\r\n// if(allwords != null && allwords.length() > 0)\r\n// {\r\n// String [] words = allwords.split(\" \");\r\n// if(words.length > 0)\r\n// {\r\n// for(int i=0; i<words.length; i++)\r\n// {\r\n// allwordsSearchStr += \"+\" + words[i];\r\n// }\r\n// }\r\n// }\r\n//\r\n// String withoutwordsSearchStr = \"\";\r\n// if(withoutwords != null && withoutwords.length() > 0)\r\n// {\r\n// String [] words = withoutwords.split(\" \");\r\n// if(words.length > 0)\r\n// {\r\n// for(int i=0; i<words.length; i++)\r\n// {\r\n// withoutwordsSearchStr += \"+-\" + words[i];\r\n// }\r\n// }\r\n// }\r\n//\r\n// searchStr += allwordsSearchStr + withoutwordsSearchStr; //need to add other string\r\n// \r\n// String oneofwordsSearchStr = \"\";\r\n// if(oneofwords != null && oneofwords.length() > 0)\r\n// {\r\n// String [] words = oneofwords.split(\" \");\r\n// if(words.length > 0)\r\n// {\r\n// oneofwordsSearchStr = \"(\";\r\n// for(int i=0; i<words.length; i++)\r\n// {\r\n// oneofwordsSearchStr += words[i] + \" \";\r\n// }\r\n// oneofwordsSearchStr = oneofwordsSearchStr.trim();\r\n// oneofwordsSearchStr += \")\";\r\n// }\r\n// }\r\n// if(oneofwordsSearchStr.length() > 0)\r\n// {\r\n// searchStr += \"+\" + oneofwordsSearchStr;\r\n// }\r\n//\r\n// return searchStr;\r\n }", "List<PilotContainer> Search(String cas, String word);", "@Override\n public void create(@NotNull CrosswordCreationContext context, @NotNull CrosswordCreationListener listener) {\n CrosswordBoard board = context.getBoard();\n containers.addAll(sortForSearch(board.getContainers()));\n boolean takeNextContainer = true;\n log.debug(\"Starting search\");\n int i = 0, sc = 0;\n listener.onStart();\n\n while (i < maxIterationsCount && sc < maxSolutionsCount) {\n log.debug(\"Search iteration: \" + ++i);\n listener.onIteration();\n\n if (takeNextContainer) {\n log.debug(\"Taking next container\");\n currentContainer = containers.pollFirst();\n log.debug(\"Container is taken \" + currentContainer);\n\n if (currentContainer == null) {\n log.debug(\"Solution: \" + placements);\n listener.onSolutionFound(new ArrayList<>(placements));\n sc++;\n } else {\n WordPattern pattern = getContainerPattern(currentContainer);\n log.debug(\"Pattern to find: \" + pattern);\n currentIterator = context.getDictionary().search(pattern);\n }\n }\n\n log.debug(\"Searching next word\");\n Word word = findNextWord();\n log.debug(\"Next word is \" + word);\n if (word != null) {\n log.debug(\"Add placement\");\n placements.offerFirst(new WordPlacementImpl(word, currentContainer));\n iterators.offerFirst(currentIterator);\n takeNextContainer = true;\n\n } else {\n log.debug(\"Remove placement\");\n containers.offerFirst(currentContainer);\n WordPlacement placement = placements.pollFirst();\n if (placement != null) {\n log.debug(\"Placement remove, try another placement\");\n currentContainer = placement.getContainer();\n currentIterator = iterators.pollFirst();\n } else { //no more variants\n log.debug(\"Nothing to remove, no more variants\");\n break;\n }\n\n takeNextContainer = false;\n }\n }\n listener.onFinish();\n }", "private static void RankedQueryMode(DiskIndexWriter diskWriter, DiskPositionalIndex disk_posIndex) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {\n\n if (query.equals(\"q\")) {\n\n System.exit(0);\n }\n\n List<String> word = new ArrayList();\n String[] query_array = query.split(\"\\\\s+\");\n TokenProcessor processor = new NewTokenProcessor();\n\n for (int i = 0; i < query_array.length; i++) {\n word.add(processor.processToken(query_array[i]).get(0));\n }\n\n StrategyFactory sf = new StrategyFactory();\n StrategyInterface strategy = sf.execute(rankedOption);\n\n //maps postings to accumulator value\n HashMap<Integer, Doc_accum> postingMap = new HashMap<Integer, Doc_accum>();\n\n PriorityQueue<Doc_accum> queue = new PriorityQueue<>(Collections.reverseOrder());\n\n List<Posting> postings = new ArrayList<>();\n List<Doc_accum> results = new ArrayList<>();\n\n for (String term : word) {\n\n postings = disk_posIndex.getPosting_noPos(term);\n for (Posting p : postings) { //for each document in the postings list\n double t_fd = p.getT_fd();\n double d_ft = p.getD_ft();\n double w_qt = strategy.calculate_wqt(N, d_ft);\n double accum = 0;\n double w_dt = strategy.get_wdt(t_fd, disk_posIndex, p.getDocumentId());\n\n //pairs (Ranked_posting, accumulator factor)\n if (postingMap.containsKey(p.getDocumentId())) {\n accum = postingMap.get(p.getDocumentId()).getAccumulator();\n accum += (w_qt * w_dt);\n postingMap.replace(p.getDocumentId(), new Doc_accum(p, accum)); //replaces old accum value\n\n } else {\n accum += (w_qt * w_dt);\n postingMap.put(p.getDocumentId(), new Doc_accum(p, accum));\n }\n }\n\n }\n\n for (Integer p : postingMap.keySet()) {\n Doc_accum doc_temp = postingMap.get(p);\n double accum = doc_temp.getAccumulator(); //gets accum associated with doc\n\n if (accum > 0) {\n //search for each p's Ld factor in docWeights.bin\n double l_d = strategy.calculate_Ld(disk_posIndex, doc_temp.getPosting().getDocumentId());\n\n accum /= l_d;\n doc_temp.setAccumulator(accum);\n }\n\n queue.add(postingMap.get(p));\n\n }\n\n //returns top K=10 results \n int topK = 50;\n\n while ((results.size() < topK) && queue.size() > 0) {\n\n results.add(queue.poll()); //gets the posting acc pair and returns only posting\n\n }\n\n display_RankedResults(results);\n\n }", "public static void main(String[] args) throws IOException{\n \n List<List<String>> results;\n String query = \"ADD QUERY OR CATEGORY FOR SEARCH\";\n \n //ADD USER ID WHO SEARCHES\n Long userId = 1;\n PersonalizedSearch searchObj = new PersonalizedSearch();\n \n final CredentialsProvider credsProvider = new BasicCredentialsProvider();\n credsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(\"elastic\",\"elastic\"));\n \n \n RestHighLevelClient client = new RestHighLevelClient(\n RestClient.builder(\n new HttpHost(\"localhost\",9200),\n new HttpHost(\"localhost\",9201))\n .setHttpClientConfigCallback(new RestClientBuilder.HttpClientConfigCallback() {\n @Override\n public HttpAsyncClientBuilder customizeHttpClient(HttpAsyncClientBuilder hacb) {\n return hacb.setDefaultCredentialsProvider(credsProvider);\n }\n }));\n \n /**\n * ---------COMMENT OUT ONE OF THE FOLLOWING TO DO A PERSONALIZED SEARCH FOR A SIGNED IN OR/AND AN ANONYMOUS USER--------\n */\n\n System.out.println(\"Starting collecting queryless/queryfull submissions...\");\n System.out.println(\"\");\n// searchObj.performQuerylessSearchWithPersonalization(client);\n// searchObj.performQueryfullSearchWithPersonalization(client);\n// results = searchObj.performPharm24PersonalizedQueryfullSearch(client, userId, query);\n// results = searchObj.performPharm24PersonalizedQuerylessSearch(client, userId, query);\n \n for(int i=0; i<results.size(); i++){\n for(int j = 0; j<results.get(i).size();j++){\n System.out.println(results.get(i).get(j));\n }\n System.out.println(\"-------RERANKED---------\");\n }\n\n System.out.println(\"\");\n System.out.println(\"I\\'m done!\");\n \n \n }", "public Search createSearch(String searchText)\n\t\t{\n\t\t\tStringBuilder sb = new StringBuilder(searchText);\n\t\t\ttrim(sb);\n\t\t\tSearch current = null;\n\t\t\twhile(sb.length() > 0)\n\t\t\t{\n\t\t\t\tboolean not = false;\n\t\t\t\tif(sb.length() > 1 && lower(sb.charAt(0)) == 'o' && lower(sb.charAt(1)) == 'r')\n\t\t\t\t{ // OR operator\n\t\t\t\t\tsb.delete(0, 2);\n\t\t\t\t\tExpressionSearch exp = exp(false);\n\t\t\t\t\texp.add(current);\n\t\t\t\t\tcurrent = exp;\n\t\t\t\t\ttrim(sb);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\telse if(sb.length() > 2 && lower(sb.charAt(0)) == 'a' && lower(sb.charAt(1)) == 'n'\n\t\t\t\t\t&& lower(sb.charAt(2)) == 'd')\n\t\t\t\t{\n\t\t\t\t\tsb.delete(0, 3);\n\t\t\t\t\ttrim(sb);\n\t\t\t\t}\n\t\t\t\telse if(sb.length() > 1 && sb.charAt(0) == '!')\n\t\t\t\t{\n\t\t\t\t\tsb.delete(0, 1);\n\t\t\t\t\ttrim(sb);\n\t\t\t\t\tnot = true;\n\t\t\t\t}\n\n\t\t\t\tSearch next;\n\t\t\t\tif(sb.charAt(0) == '(')\n\t\t\t\t{\n\t\t\t\t\tint c = goPastParen(sb, 0);\n\t\t\t\t\tString nextExpr = sb.substring(1, c).trim();\n\t\t\t\t\tif(nextExpr.length() == 0)\n\t\t\t\t\t\tthrow new IllegalArgumentException(\"Empty parenthetical expression\");\n\t\t\t\t\tnext = createSearch(nextExpr);\n\t\t\t\t\tsb.delete(0, c + 1);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tnext = parseNext(sb);\n\t\t\t\tif(not)\n\t\t\t\t{\n\t\t\t\t\tNotSearch notS = not();\n\t\t\t\t\tnotS.setOperand(next);\n\t\t\t\t\tnext = notS;\n\t\t\t\t}\n\n\t\t\t\tif(current instanceof ExpressionSearch\n\t\t\t\t\t&& ((ExpressionSearch) current).getOperandCount() == 1)\n\t\t\t\t\t((ExpressionSearch) current).add(next);\n\t\t\t\telse if(current != null)\n\t\t\t\t{\n\t\t\t\t\tExpressionSearch exp = exp(true);\n\t\t\t\t\texp.addOps(current, next);\n\t\t\t\t\tcurrent = exp;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tcurrent = next;\n\n\t\t\t\ttrim(sb);\n\t\t\t}\n\t\t\tif(current instanceof ExpressionSearch)\n\t\t\t\t((ExpressionSearch) current).simplify();\n\t\t\treturn current;\n\t\t}", "Search getSearch();", "public LittleSearchEngine() {\n keywordsIndex = new HashMap<String, ArrayList<Occurrence>>(1000, 2.0f);\n noiseWords = new HashMap<String, String>(100, 2.0f);\n }", "public interface CategoryService {\n\n /**\n * @param type\n * @return\n */\n List<Category> getCategories(String type);\n\n\n /**\n * @param type\n * @param brandCode\n * @return\n */\n List<Category> getCategoriesByBrand(String type, String brandCode);\n\n /**\n * @param type\n * @param brandCodes\n * @return\n */\n List<Category> getCategoriesByBrands(String type, List<String> brandCodes);\n\n\n /**\n * @param type\n * @param goodsCode\n * @return\n */\n List<Category> getCategoriesByGoods(String type, String goodsCode);\n}", "public void execFuzzySearchVariationFunc(){\n\n\n Map map = new HashMap();\n\n if(this.searchParam != null && this.searchParam.length()> 0 ){\n System.out.println(this.searchParam );\n if(this.searchParam.contains(\":\")==true || this.searchParam.startsWith(\"chr\") == true) {\n String chrom = \"\";\n int pstart = -1;\n int pend = -1;\n if (this.searchParam.indexOf(\":\") > -1) {\n int idex = this.searchParam.indexOf(\":\");\n chrom = this.searchParam.substring(0, idex );\n System.out.println(\"chrom=\" + chrom);\n map.put(\"chrom\", chrom);\n if (this.searchParam.indexOf(\"-\") > -1) {\n int idex1 = this.searchParam.indexOf(\"-\");\n pstart = Integer.parseInt(this.searchParam.substring(idex + 1, idex1 ));\n pend = Integer.parseInt(this.searchParam.substring(idex1 + 1, this.searchParam.length()));\n map.put(\"startpos\", pstart);\n map.put(\"endpos\", pend);\n } else {\n pstart = Integer.parseInt(this.searchParam.substring(idex + 1, this.searchParam.length()));\n map.put(\"startpos\", pstart);\n }\n\n } else if (this.searchParam.startsWith(\"chr\") == true) {\n map.put(\"chrom\", this.searchParam);\n }\n }\n\n map.put(\"searchParam\",this.searchParam);\n }\n\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"null\") ==false && this.searchSpecies.equals(\"all\") == false){\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"species\",this.searchSpecies);\n }\n\n if(this.searchTrait != null&& this.searchTrait.equals(\"null\") ==false && this.searchTrait.length()>0){\n\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"searchTrait\", this.searchTrait) ;\n }\n\n if(this.pvalue != null&& this.pvalue.equals(\"null\") ==false && this.pvalue.length()>0){\n\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"psitu\", this.psitu);\n map.put(\"pval\", this.pvalue) ;\n }\n\n\n //here, parse search param and get genotype information\n genotypeBeanList = (List<GenotypeBean>) baseService.findResultList(\"cn.big.gvk.dm.Genotype.selectGenotypeByPos\",map);\n if(genotypeBeanList != null && genotypeBeanList.size() > 0 ){\n for(GenotypeBean tbean :genotypeBeanList ){\n List genotypelist = new ArrayList();\n genotypelist.add(tbean.getGenotypeId()) ;\n\n Map t = new HashMap();\n t.put(\"genotypelist\",genotypelist);\n List<GenotypeAnnotateGeneView> annotateview = baseService.findResultList(\"cn.big.gvk.dm.Genotype.selectGenotypeByList\",t);\n if(annotateview != null && annotateview.size()>0 ){\n //here we need to filter the result\n Map filtermap = new HashMap();\n for(GenotypeAnnotateGeneView tview : annotateview){\n String fkey = tview.getMapGeneId()+\"_\"+tview.getConseqtype();\n if(filtermap.containsKey(fkey) == false){\n filtermap.put(fkey,tview);\n }\n }\n\n if(filtermap.size()>0){\n List<GenotypeAnnotateGeneView> alist = new ArrayList<GenotypeAnnotateGeneView>();\n Iterator it = filtermap.entrySet().iterator();\n while(it.hasNext()){\n Map.Entry entry = (Map.Entry) it.next();\n GenotypeAnnotateGeneView val = (GenotypeAnnotateGeneView) entry.getValue();\n alist.add(val);\n }\n\n tbean.setGenotypeAnnotateGeneView(alist);\n }\n\n\n }\n\n //find association count\n GwasAssociationBean gwas = (GwasAssociationBean) baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectAssociationCountByGenotypeid\",tbean.getGenotypeId());\n if(gwas != null){\n tbean.setTraitCount(gwas.getGwasCount());\n }\n\n //find studycount\n Map cmap = new HashMap();\n cmap.put(\"genotypeId\",tbean.getGenotypeId());\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"all\") == false){\n cmap.put(\"species\",this.searchSpecies);\n }\n\n\n GwasAssociationBean tg_bean1 = (GwasAssociationBean)baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectStudyCountByGenotypeid\",cmap);\n if(tg_bean1 != null ){\n tbean.setStudyCount(tg_bean1.getGwasCount());\n }\n\n }\n\n\n\n }\n\n StringBuffer sb = new StringBuffer() ;\n\n if(genotypeBeanList != null && genotypeBeanList.size()>0){\n for(GenotypeBean genotype: genotypeBeanList){\n sb.append(genotype.getVarId()).append(\"\\t\").append(genotype.getChrom()).append(\":\")\n .append(genotype.getStartPos()).append(\"\\t\").append(genotype.getTraitCount())\n .append(\"\\t\").append(genotype.getStudyCount()).append(\"\\n\");\n }\n }\n\n if(format == 1 ){ //export txt\n this.response.reset();\n this.response.setHeader(\"Content-Disposition\",\n \"attachment;filename=export.txt\");\n this.response.setContentType(\"application/ms-txt\");\n try {\n PrintWriter pr = this.response.getWriter();\n pr.print(sb.toString());\n pr.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n }", "private void setupAssociatedBranchesAType(Map<Integer, Double> inputBranchWithJ)\r\n\t{\r\n\t\tgetOppositeParityEnergies(currentK);\r\n\t\tArrayList<Map<Integer, Double>> branches = new ArrayList<Map<Integer, Double>>();\r\n\t\tint jOffset = 0;\r\n\r\n\t\tif (IS_EVEN_SELECTION_RULES) {\r\n\t\t\tif (INPUT_BRANCH_TYPE.equals(\"Q\")) {\r\n\t\t\t\tcalculateUpperEnergiesLevelsWithJ(inputBranchWithJ, jOffset);\r\n\t\t\t\t\r\n\t\t\t\tif (currentK >= 0) {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedR, -1, 1, 0, -1, true, false);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedP, 1, -1, 1, 0, false, true);\r\n\t\t\t\t\tbranches.add(associatedP);\r\n\t\t\t\t\tbranches.add(associatedR);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"P-<-\", \"R-<-\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedR, -1, 1, 0, -1, false, true);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedP, 1, -1, 1, 0, true, false);\r\n\t\t\t\t\tbranches.add(associatedP);\r\n\t\t\t\t\tbranches.add(associatedR);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"P+<+\", \"R+<+\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (INPUT_BRANCH_TYPE.equals(\"R\")) {\r\n\t\t\t\tjOffset = 1;\r\n\t\t\t\tcalculateUpperEnergiesLevelsWithJ(inputBranchWithJ, jOffset);\r\n\r\n\t\t\t\tif (currentK >= 0) {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedQ, 1, -1, 1, 0, false, true);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedP, 2, -1, 2, 0, true, true);\r\n\t\t\t\t\tbranches.add(associatedQ);\r\n\t\t\t\t\tbranches.add(associatedP);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"Q+<-\", \"P+<+\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedQ, 1, -1, 1, 0, true, false);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedP, 2, -1, 2, 0, false, false);\r\n\t\t\t\t\tbranches.add(associatedQ);\r\n\t\t\t\t\tbranches.add(associatedP);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"Q-<+\", \"P-<-\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (INPUT_BRANCH_TYPE.equals(\"P\")) {\r\n\t\t\t\tjOffset = -1;\r\n\t\t\t\tcalculateUpperEnergiesLevelsWithJ(inputBranchWithJ, jOffset);\r\n\r\n\t\t\t\tif (currentK >= 0) {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedQ, -1, 1, 0, -1, true, false);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedR, -2, 1, 0, -2, true, true);\r\n\t\t\t\t\tbranches.add(associatedQ);\r\n\t\t\t\t\tbranches.add(associatedR);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"Q+<-\", \"R+<+\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedQ, -1, 1, 0, -1, false, true);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedR, -2, 1, 0, -2, false, false);\r\n\t\t\t\t\tbranches.add(associatedQ);\r\n\t\t\t\t\tbranches.add(associatedR);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"Q-<+\", \"R-<-\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\telse {\r\n\t\t\tif (INPUT_BRANCH_TYPE.equals(\"Q\")) {\r\n\t\t\t\tcalculateUpperEnergiesLevelsWithJ(inputBranchWithJ, jOffset);\r\n\t\t\t\t\r\n\t\t\t\tif (currentK >= 0) {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedR, -1, 1, 0, -1, true, false);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedP, 1, -1, 1, 0, false, true);\r\n\t\t\t\t\tbranches.add(associatedP);\r\n\t\t\t\t\tbranches.add(associatedR);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"P+<-\", \"R+<-\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedR, -1, 1, 0, -1, false, true);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedP, 1, -1, 1, 0, true, false);\r\n\t\t\t\t\tbranches.add(associatedP);\r\n\t\t\t\t\tbranches.add(associatedR);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"P-<+\", \"R-<+\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (INPUT_BRANCH_TYPE.equals(\"R\")) {\r\n\t\t\t\tjOffset = 1;\r\n\t\t\t\tcalculateUpperEnergiesLevelsWithJ(inputBranchWithJ, jOffset);\r\n\r\n\t\t\t\tif (currentK >= 0) {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedQ, 1, -1, 1, 0, false, true);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedP, 2, -1, 2, 0, true, true);\r\n\t\t\t\t\tbranches.add(associatedQ);\r\n\t\t\t\t\tbranches.add(associatedP);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"Q-<-\", \"P-<+\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedQ, 1, -1, 1, 0, true, false);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedP, 2, -1, 2, 0, false, false);\r\n\t\t\t\t\tbranches.add(associatedQ);\r\n\t\t\t\t\tbranches.add(associatedP);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"Q+<+\", \"P+<-\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (INPUT_BRANCH_TYPE.equals(\"P\")) {\r\n\t\t\t\tjOffset = -1;\r\n\t\t\t\tcalculateUpperEnergiesLevelsWithJ(inputBranchWithJ, jOffset);\r\n\t\t\t\t\r\n\t\t\t\tif (currentK >= 0) {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedQ, -1, 1, 0, -1, true, false);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedR, -2, 1, 0, -2, true, true);\r\n\t\t\t\t\tbranches.add(associatedQ);\r\n\t\t\t\t\tbranches.add(associatedR);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"Q-<-\", \"R-<+\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedQ, -1, 1, 0, -1, false, true);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedR, -2, 1, 0, -2, false, false);\r\n\t\t\t\t\tbranches.add(associatedQ);\r\n\t\t\t\t\tbranches.add(associatedR);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"Q+<+\", \"R+<-\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (TRANSITION_TYPE.equals(\"b-type\")) {\r\n\t\t\t//The 2 and -2 represent \"get lower energies with K +2 / -2 offset from the current K value, if it exists\"\r\n\t\t\tsetupTriangularTypes(2);\r\n\t\t\tsetupTriangularTypes(-2);\r\n\t\t}\r\n\t}", "List<TypeTreatmentPlanStatuses> search(String query);", "public TinySearchEngine()\n {\n this.myIndex = new HashMap();\n this.documentData = new HashMap();\n this.sorted = false;\n this.sort = new Sort();\n this.search = new BinarySearch();\n }", "protected IBundleProvider performSearch(String theCriteria) {\n\t\tRuntimeResourceDefinition responseResourceDef = getSubscriptionDao().validateCriteriaAndReturnResourceDefinition(theCriteria);\n\t\tSearchParameterMap responseCriteriaUrl = BaseHapiFhirDao.translateMatchUrl(getSubscriptionDao(), getSubscriptionDao().getContext(), theCriteria, responseResourceDef);\n\n\t\tRequestDetails req = new ServletSubRequestDetails();\n\t\treq.setSubRequest(true);\n\n\t\tIFhirResourceDao<? extends IBaseResource> responseDao = getSubscriptionDao().getDao(responseResourceDef.getImplementingClass());\n\t\tresponseCriteriaUrl.setLoadSynchronousUpTo(1);\n\n\t\tIBundleProvider responseResults = responseDao.search(responseCriteriaUrl, req);\n\t\treturn responseResults;\n\t}", "private List<Clause> termSearch(Clause cl\n\t\t\t, List<Clause> aA, List<Clause> aO\n\t\t\t, List<Clause> oA, List<Clause> oO) {\n\t\tif ((cl.getStartOP() == null)\n\t\t\t\t|| cl.getStartOP().equals(Operator.AND)) {\n\t\t\tif (cl.getDefaultOP().equals(Operator.AND)) {\n\t\t\t\taA.add(cl);\n\t\t\t\treturn getFilledList(aO, oA, oO);\n\t\t\t} else {\n\t\t\t\taO.add(cl);\n\t\t\t\treturn getFilledList(oA, oO, aA);\n\t\t\t}\n\t\t} else if (cl.getStartOP().equals(Operator.OR)) {\n\t\t\tif (cl.getDefaultOP().equals(Operator.AND)) {\n\t\t\t\toA.add(cl);\n\t\t\t\treturn getFilledList(oO, aA, aO);\n\t\t\t} else {\n\t\t\t\toO.add(cl);\n\t\t\t\treturn getFilledList(aA, aO, oA);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "private void doSearch(String query, boolean art,\n boolean music,\n boolean tech,\n boolean careers,\n boolean culture,\n boolean sports,\n boolean science,\n boolean education){\n ArrayList<String> categories = new ArrayList<String>();\n if(art) categories.add(\"Art\");\n if(music) categories.add(\"Music\");\n if(tech) categories.add(\"Tech\");\n if(careers) categories.add(\"Careers\");\n if(culture) categories.add(\"Culture\");\n if(sports) categories.add(\"Sports\");\n if(science) categories.add(\"Science\");\n if(education) categories.add(\"Education\");\n\n //if none selected search for all categories\n if(!art && !music && !tech && !careers && !culture && !sports && !science && !education){\n categories.add(\"Art\");\n categories.add(\"Music\");\n categories.add(\"Tech\");\n categories.add(\"Careers\");\n categories.add(\"Culture\");\n categories.add(\"Sports\");\n categories.add(\"Science\");\n categories.add(\"Education\");\n }\n eventServices.searchEventFeed(query, null, null, categories, new AppCallback<List<Event>>() {\n @Override\n public void call(final List<Event> events) {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n eventList.addAll(events);\n adapter.notifyDataSetChanged();\n }\n });\n }\n\n @Override\n public void call() {\n\n }\n });\n\n// Log.d(TAG, \"doSearch: \" + query + \" \" + SearchActivity.DATE_RANGE_LABELS[dateRange] + \" \");\n adapter.notifyDataSetChanged();\n }" ]
[ "0.5818995", "0.54974973", "0.53989065", "0.53488696", "0.52969927", "0.5278454", "0.52701354", "0.52508426", "0.5218992", "0.52141446", "0.5195207", "0.519495", "0.5171149", "0.51686406", "0.5125354", "0.5051217", "0.5044495", "0.50286084", "0.50212765", "0.5005991", "0.5003333", "0.4998948", "0.49929652", "0.49884158", "0.4987474", "0.49858457", "0.4965863", "0.49641722", "0.49579263", "0.4951262", "0.49505994", "0.49382535", "0.49262762", "0.49161002", "0.49101505", "0.49063486", "0.48957244", "0.4887793", "0.48786965", "0.48669687", "0.48624694", "0.4844098", "0.48377773", "0.48291868", "0.4828005", "0.4814383", "0.48124057", "0.4804156", "0.47969058", "0.4772017", "0.476297", "0.47574347", "0.47556674", "0.47345248", "0.4719142", "0.47157538", "0.47122994", "0.471093", "0.47055587", "0.4703291", "0.4701071", "0.4699304", "0.46899667", "0.46898225", "0.46761006", "0.4675074", "0.4669888", "0.46656138", "0.46652368", "0.4655204", "0.46550584", "0.46502018", "0.46470788", "0.46448106", "0.4631182", "0.46254414", "0.46237388", "0.46230558", "0.46224144", "0.462137", "0.46174553", "0.4615968", "0.46154416", "0.46152192", "0.46145934", "0.4609739", "0.46047482", "0.46024296", "0.4601937", "0.46017572", "0.4598716", "0.45959276", "0.45947155", "0.4594081", "0.4593786", "0.45927185", "0.45902544", "0.45874816", "0.45867547", "0.45814902", "0.4580368" ]
0.0
-1
Builds your own assignment strategy based on binary decisions. Selects a variable X and a value V to make the decision X = V. Note that value assignments are the default decision operators. Therefore, they are not mentioned in the search heuristic name.
public static IntStrategy custom(VariableSelector<IntVar> VAR_SELECTOR, IntValueSelector VAL_SELECTOR, IntVar... VARS) { return custom(VAR_SELECTOR, VAL_SELECTOR, assign(), VARS); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static DecisionOperator<IntVar> assign() {\n return DecisionOperator.int_eq;\n }", "@Override\n\tpublic List<Component> caseExprBinary(ExprBinary expr) {\n\t\tint sizeInBits = assignTarget.getVariable().getType().getSizeInBits();\n\t\t// Get the Variables\n\t\tVar e1 = ((ExprVar) expr.getE1()).getUse().getVariable();\n\t\tVar e2 = ((ExprVar) expr.getE2()).getUse().getVariable();\n\t\tList<Var> inVars = new ArrayList<Var>();\n\t\tinVars.add(e1);\n\t\tinVars.add(e2);\n\t\t// Component component = null;\n\t\tif (expr.getOp() == OpBinary.BITAND) {\n\t\t\tcurrentComponent = new AndOp();\n\t\t} else if (expr.getOp() == OpBinary.BITOR) {\n\t\t\tcurrentComponent = new OrOp();\n\t\t} else if (expr.getOp() == OpBinary.BITXOR) {\n\t\t\tcurrentComponent = new XorOp();\n\t\t} else if (expr.getOp() == OpBinary.DIV) {\n\t\t\tcurrentComponent = new DivideOp(sizeInBits);\n\t\t} else if (expr.getOp() == OpBinary.DIV_INT) {\n\t\t\tcurrentComponent = new DivideOp(sizeInBits);\n\t\t} else if (expr.getOp() == OpBinary.EQ) {\n\t\t\tcurrentComponent = new EqualsOp();\n\t\t} else if (expr.getOp() == OpBinary.GE) {\n\t\t\tcurrentComponent = new GreaterThanEqualToOp();\n\t\t} else if (expr.getOp() == OpBinary.GT) {\n\t\t\tcurrentComponent = new GreaterThanOp();\n\t\t} else if (expr.getOp() == OpBinary.LE) {\n\t\t\tcurrentComponent = new LessThanEqualToOp();\n\t\t} else if (expr.getOp() == OpBinary.LOGIC_AND) {\n\t\t\tcurrentComponent = new And(2);\n\t\t} else if (expr.getOp() == OpBinary.LOGIC_OR) {\n\t\t\tcurrentComponent = new Or(2);\n\t\t} else if (expr.getOp() == OpBinary.LT) {\n\t\t\tcurrentComponent = new LessThanOp();\n\t\t} else if (expr.getOp() == OpBinary.MINUS) {\n\t\t\tcurrentComponent = new SubtractOp();\n\t\t} else if (expr.getOp() == OpBinary.MOD) {\n\t\t\tcurrentComponent = new ModuloOp();\n\t\t} else if (expr.getOp() == OpBinary.NE) {\n\t\t\tcurrentComponent = new NotEqualsOp();\n\t\t} else if (expr.getOp() == OpBinary.PLUS) {\n\t\t\tcurrentComponent = new AddOp();\n\t\t} else if (expr.getOp() == OpBinary.SHIFT_LEFT) {\n\t\t\tint log2N = MathStuff.log2(sizeInBits);\n\t\t\tcurrentComponent = new LeftShiftOp(log2N);\n\t\t} else if (expr.getOp() == OpBinary.SHIFT_RIGHT) {\n\t\t\tint log2N = MathStuff.log2(sizeInBits);\n\t\t\tcurrentComponent = new RightShiftOp(log2N);\n\t\t} else if (expr.getOp() == OpBinary.TIMES) {\n\t\t\tcurrentComponent = new MultiplyOp(expr.getType().getSizeInBits());\n\t\t}\n\t\t// currentComponent.setNonRemovable();\n\t\tPortUtil.mapInDataPorts(currentComponent, inVars, portDependency,\n\t\t\t\tportGroupDependency);\n\t\treturn null;\n\t}", "VarAssignment createVarAssignment();", "public void setComparedHeuristics (VariableSelector variableSelector, IntValueSelector valueOrder){\n\t\tIntValueSelector valueSelector = valueOrder;\n\t\t\n\t \n\t\tkb.getModelKB().getSolver().setSearch(Search.intVarSearch(\n \n\t\t\t\tvariableSelector,\n // selects the smallest domain value (lower bound)\n\t\t\t\t \n\t\t\t\tvalueSelector,\n \n // variables to branch on\n\t\t\t\tkb.getVars()\n\t\t));\n\t\t\n\t}", "public abstract void assign(ParameterVector pv) throws SolverException;", "@Override\n public Void visit(AssignmentExpression nd, SuccessorInfo i) {\n if (\"&&=\".equals(nd.getOperator()) || \"||=\".equals(nd.getOperator()) || \"??=\".equals(nd.getOperator())) {\n if (\"&&=\".equals(nd.getOperator())) {\n // from lhs to rhs on truthy. from lhs to false-branch on falsy.\n visitWithSuccessors(nd.getLeft(), First.of(nd.getRight()), i.getSuccessors(false));\n } else if (\"||=\".equals(nd.getOperator())) {\n // from lhs to true-branch on truthy. from lhs to rhs on falsy.\n visitWithSuccessors(nd.getLeft(), i.getSuccessors(true), First.of(nd.getRight()));\n } else { // \"??=\"\n // the union of the above - truthyness is unknown.\n visitWithSuccessors(nd.getLeft(), union(First.of(nd.getRight()), i.getAllSuccessors()));\n }\n \n visitWithSuccessors(nd.getRight(), nd); // from right to assignment.\n\n writeSuccessors(nd, i.getGuardedSuccessors(nd));\n } else {\n visitAssign(nd, nd.getLeft(), nd.getRight());\n writeSuccessors(nd, i.getGuardedSuccessors(nd));\n }\n return null;\n }", "@Override\n\tpublic void visit(AssignNode node) {\n\t\tEvaluator.evaluate(node.getChild(0));\n\t\tEvaluator.evaluate(node.getChild(1));\n\n\t\t/**\n\t\t * Verificam fiii si construim perechea Variabila, Valoare pentru a fi\n\t\t * inserata in HahMap-ul din Evaluator\n\t\t */\n\t\tVariable x = null;\n\t\tValue i = null;\n\t\tif (node.getChild(1) instanceof Variable) {\n\t\t\tx = new Variable(node.getChild(1).getName());\n\t\t} else {\n\t\t\ti = new Value(node.getChild(1).getName());\n\t\t}\n\n\t\tif (node.getChild(0) instanceof Variable) {\n\t\t\tx = new Variable(node.getChild(0).getName());\n\t\t} else {\n\t\t\ti = new Value(node.getChild(0).getName());\n\t\t}\n\t\tEvaluator.variables.put(x.getName(), i.getName());\n\t\tnode.setName(i.getName());\n\t}", "public VariableCoefficientTuple suggestBranchingVariable (TwoIntegerTuple childRectCounts ) {\r\n \r\n VariableCoefficientTuple result= new VariableCoefficientTuple(null, ZERO) ;\r\n \r\n //first get the best lp rects\r\n List<Rectangle> rectanglesToConsiderForBranchingVarCalculation = this.getRectanglesToConsiderForBranchingVarCalculation( );\r\n \r\n //collect 0 direction refcounts into this map\r\n Map<String, Integer> zeroVar_RefCountMap = new HashMap<String, Integer> () ;\r\n //and one diirection refconts into this map\r\n Map<String, Integer> oneVar_RefCountMap = new HashMap<String, Integer> () ;\r\n \r\n List<VariableCoefficientTuple> variablesUsedForBranchingInThisRectangle =null;\r\n for (Rectangle rect: rectanglesToConsiderForBranchingVarCalculation){\r\n variablesUsedForBranchingInThisRectangle = getVariablesUsedForBranchingInThisRectangle (rect);\r\n if (variablesUsedForBranchingInThisRectangle.size()>ZERO) {\r\n this.updateVariableRefCounts(zeroVar_RefCountMap, oneVar_RefCountMap, variablesUsedForBranchingInThisRectangle) ;\r\n }else {\r\n System.err.print(\"trying to branch a node which should have been marked infeasible\" );\r\n exit(ONE);\r\n }\r\n }\r\n \r\n \r\n //now find the highest refcount var, no matter its direction\r\n int highZeroFreq = zeroVar_RefCountMap.isEmpty()?ZERO:Collections.max( zeroVar_RefCountMap.values());\r\n int highOneFreq = oneVar_RefCountMap.isEmpty()? ZERO: Collections.max(oneVar_RefCountMap.values()) ;\r\n \r\n //we need to find the selected var's refcount on the other side\r\n int selectedVarRefCountOnOtherSide = ZERO;\r\n \r\n int totalRects = getNumberOfRects(this.myInfeasibleRectanglesList) ;\r\n \r\n if (highZeroFreq>highOneFreq) {\r\n result.varName=getHighestFreqVar (zeroVar_RefCountMap,highZeroFreq ) ;\r\n result.coeff=highZeroFreq;\r\n selectedVarRefCountOnOtherSide= oneVar_RefCountMap.get( result.varName)==null? ZERO : oneVar_RefCountMap.get( result.varName);\r\n //this is how many rects will survive on either side\r\n childRectCounts.zeroSideCount = totalRects - selectedVarRefCountOnOtherSide;\r\n childRectCounts.oneSideCount=totalRects -highZeroFreq ;\r\n \r\n } else {\r\n result.varName=getHighestFreqVar (oneVar_RefCountMap,highOneFreq ) ;\r\n result.coeff=highOneFreq;\r\n selectedVarRefCountOnOtherSide= zeroVar_RefCountMap.get( result.varName)==null? ZERO : zeroVar_RefCountMap.get( result.varName);\r\n \r\n childRectCounts.zeroSideCount = totalRects - highOneFreq;\r\n childRectCounts.oneSideCount=totalRects - selectedVarRefCountOnOtherSide;\r\n }\r\n \r\n return result;\r\n }", "@Override\n public Integer visitAssign(CalculatorParser.AssignContext ctx) {\n String id = ctx.ID().getText(); // id is left-hand side of '='\n int value = visit(ctx.expr()); // compute value of expression on right\n memory.put(id, value); // store it in memory\n return value;\n }", "protected IExpressionValue assignment(List<Entity> declaredStates, List<Entity> possibleStates) \r\n\t\t\t\t\tthrows InvalidProbabilityRangeException, \r\n\t\t\t\t\t\t TableFunctionMalformedException,\r\n\t\t\t\t\t\t SomeStateUndeclaredException{\r\n\t\t\r\n\t\t// prepare a representation of a cell inside the temporary table\r\n\t\tTempTableProbabilityCell currentCell = new TempTableProbabilityCell(null, null);\r\n\t\t\r\n\t\t// SCAN FOR IDENTIFIER\r\n\t\tscan();\r\n\t\tString userDefinedVariableName = null;\t// this will become non-null if there is an unknown state declared (unknown states will become user-defined variables)\r\n\t\tif (token == 'x') {\r\n\t\t\tif (this.node != null) {\r\n\t\t\t\t// Consistency check C09\r\n\t\t\t\t// Remember declared states, so we can check later if all states was declared\r\n\t\t\t\tEntity possibleValue = null;\r\n\t\t\t\tint index = this.node.getPossibleValueIndex(this.noCaseChangeValue);\r\n\t\t\t\tif (index < 0) {\r\n\t\t\t\t\t// unknown states will be considered as a new variable that user has declared\r\n\t\t\t\t\tuserDefinedVariableName = this.noCaseChangeValue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tpossibleValue = possibleStates.get(index);\r\n\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t//throw new TableFunctionMalformedException(e.getMessage());\r\n\t\t\t\t\t\tthrow new TableFunctionMalformedException(this.node.toString(), e);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (possibleValue == null) {\r\n\t\t\t\t\t\tthrow new TableFunctionMalformedException(getNode().toString());\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdeclaredStates.add(possibleValue);\r\n\t\t\t\t\tcurrentCell.setPossibleValue(possibleValue);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\texpected(\"Identifier\");\r\n\t\t}\r\n\r\n\t\t// LOOK FOR = OPERATOR\r\n\t\tmatch('=');\r\n\r\n\t\t// consistency check C09\r\n\t\t// ret verifies the sum of all declared states' probability (must be 1)\r\n\t\t// boolean hasUnknownValue shows if some ret was negative or NaN.\r\n\t\tIExpressionValue ret = expression();\t\r\n\t\tif (ret == null) {\r\n\t\t\tthrow new TableFunctionMalformedException(getResource().getString(\"NonDeclaredVarStateAssignment\"));\r\n\t\t}\r\n\t\tfloat retValue = 0;\t// initialize with a value which will not impact consistency check (the one that checks if sum is 1)\r\n\t\tif (userDefinedVariableName == null) {\r\n\t\t\t// this is a state of current node, so store the probability in order to calculate consistency later\r\n\t\t\tif (!ret.isNumeric()) {\r\n\t\t\t\t// state of nodes must be probabilities (numbers)\r\n\t\t\t\tthrow new TableFunctionMalformedException(getResource().getString(\"NonNumericProbAssignment\"));\r\n\t\t\t}\r\n\t\t\ttry {\r\n\t\t\t\tretValue = Float.parseFloat(ret.getValue());\r\n\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\tretValue = Float.NaN;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// this is a user-defined value\r\n\t\t\t// store it in the scope of current if-clause\r\n\t\t\tthis.currentHeader.addUserDefinedVariable(userDefinedVariableName, ret);\r\n\t\t}\r\n\t\tboolean hasUnknownValue = Float.isNaN(retValue);\r\n\t\t\r\n\t\t// add cell to header\r\n\t\tcurrentCell.setProbability(ret);\r\n\t\tif (currentCell.getPossibleValue() != null && currentCell.getPossibleValue() != null) {\r\n\t\t\tthis.currentHeader.addCell(currentCell);\r\n\t\t}\r\n\t\t// Debug.println(\"Adding cell: \" + currentCell.getPossibleValue().getName() + \" = \" + ret.toString());\r\n\r\n\t\t// consistency check C09\r\n\t\t// a single state shall never have negative prob \r\n\t\tif ( isToNormalize()\r\n\t\t\t\t&& ((retValue < 0.0) \r\n//\t\t\t\t\t\t|| (1.0 < retValue)\r\n\t\t\t\t\t\t)) {\r\n\t\t\tthrow new InvalidProbabilityRangeException(getNode().toString());\r\n\t\t}\r\n\t\t\r\n\t\t// LOOK FOR , (OPTIONAL)\r\n\t\tif (look == ',') {\r\n\t\t\tmatch(',');\r\n\t\t\tif (look != this.kwcode[this.lookup(\"IF\")]) {\r\n\t\t\t\tIExpressionValue temp = assignment(declaredStates, possibleStates);\r\n\t\t\t\tfloat tempValue = Float.NaN;\r\n\t\t\t\ttry {\r\n\t\t\t\t\ttempValue = Float.parseFloat(temp.getValue());\r\n\t\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\t\ttempValue = Float.NaN;\r\n\t\t\t\t}\r\n\t\t\t\thasUnknownValue = hasUnknownValue || (Float.isNaN(tempValue));\r\n\t\t\t\tif (hasUnknownValue) {\r\n\t\t\t\t\tretValue = Float.NaN;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tretValue += tempValue;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t// this is an if-clause after assignment.\r\n\t\t\t\t// we should finish assignment (assignments in same block of if-clauses must be always before the if clause)\r\n\t\t\t\t// if assignment and if-clause happens in same block, assingments must be only for user-defined variables\r\n\t\t\t\tif (!currentHeader.getCellList().isEmpty()) {\r\n\t\t\t\t\t// user-defined variables are not added to cellList. Assignments to states of variables are added to cell list.\r\n\t\t\t\t\t// if this is not empty, then there were assignments to states of variables, so this is invalid.\r\n\t\t\t\t\tthrow new SomeStateUndeclaredException(getResource().getString(\"NonUserDefinedVariablesFoundBeforeIfClause\"));\r\n\t\t\t\t}\r\n\t\t\t\t// let the upper clause actually handle the if=clause\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Debug.println(\"Returned expression value = \" + retValue);\r\n\t\tif (isToNormalize() && (retValue < 0)) {\r\n\t\t\tthrow new InvalidProbabilityRangeException(getNode().toString());\r\n\t\t}\r\n\t\treturn new SimpleProbabilityValue(retValue);\r\n\t}", "public abstract Object getDecisionValue();", "public static IntStrategy custom(VariableSelector<IntVar> VAR_SELECTOR,\n IntValueSelector VAL_SELECTOR,\n DecisionOperator<IntVar> DEC_OPERATOR,\n IntVar... VARS) {\n return new IntStrategy(VARS, VAR_SELECTOR, VAL_SELECTOR, DEC_OPERATOR);\n }", "@Test\n\tpublic void testAssignment(){\n\t\tVariable x = new Variable(\"x\");\n\t\tOperator plus = new Operator(\"+\");\n\t\tExpression one = f.createNumNode(1);\n\t\tExpression two = f.createNumNode(2);\n\t\tExpression exp = f.createInfixNode(plus, one, two);\n\t\tStatement assign = f.createAssignNode(x,exp);\n\t\tassertEquals(assign.textRepresentation(), \"x = 1 + 2;\");\n\t\n\t\tASTNodeCountVisitor v = new ASTNodeCountVisitor();\n\t\tassign.accept(v);\n\t\tassertEquals(\"assignment test1 fail\", v.numCount, 2);\n\t\tassertEquals(\"assignment test2 fail\", v.infixCount, 1);\n\t\tassertEquals(\"assignment test3 fail\", v.assignCount, 1);\n\t}", "public abstract IDecisionVariable getVariable();", "protected Element evalAssurance(Assurance ass){\n\t\tRecord r1 = ass.getLeftRecord();\n\t\tRecord r2 = ass.getRightRecord();\n\t\tOperator op = ass.getOperator();\n\t\tElement an = el(\"bpws:assign\");\n\t\tif (r1.getType() == RecordType.FORMULAR)\n\t\t\tan.appendChild(setExpr(r1.getFormular(), \"nswomoxsd:leftValue\"));\n\t\tif (r2.getType() == RecordType.FORMULAR)\n\t\t\tan.appendChild(setExpr(r2.getFormular(), \"nswomoxsd:rightValue\"));\n\t\tan.appendChild(\n\t\t\tsetExpr(\n\t\t\t\tgetMyVarPath(\"/nswomoxsd:leftValue\") + \n\t\t\t\top.value() +\n\t\t\t\tgetMyVarPath(\"nswomoxsd:rightValue\"),\n\t\t\t\t\"nswomoxsd:value\"\n\t\t\t)\n\t\t);\n\t\treturn an;\n\t}", "AssignmentRule createAssignmentRule();", "public abstract boolean setValue(Value value, boolean asAssignment);", "public interface AssignmentStrategy {\n\tpublic Map<Integer, Integer> assign(DoubleMatrix matrix);\n}", "public abstract void createAssignment(int p);", "private Term parseAssign(final boolean required) throws ParseException {\n Term t1 = parseConditional(required);\n while (t1 != null) {\n int tt = _tokenizer.next();\n if (tt == '=') {\n Term t2 = parseAssign(true);\n if (t1 instanceof Term.Ref && ((Term.Ref) t1).getVariable() != null) {\n t1 = new Term.Assign(t1, t2);\n } else {\n reportError(\"Variable expected on the left side of assignment '='.\");\n }\n } else {\n _tokenizer.pushBack();\n break;\n }\n }\n return t1;\n }", "public Code visitAssignmentNode(StatementNode.AssignmentNode node) {\n beginGen(\"Assignment\");\n /* Generate code to evaluate the expression */\n Code code = new Code();\n /* Generate the code to load the address of the variable */\n for(int i= 0; i < node.getExps().size(); i++) {\n \tExpNode exp = node.getExps().get(i);\n \tcode.append(exp.genCode(this));\n }\n for(int i = node.getLValues().size() - 1; i >= 0; i--) {\n \tExpNode lValue = node.getLValues().get(i);\n \tcode.append(lValue.genCode(this));\n \tcode.genStore(lValue.getType());\n }\n endGen(\"Assignment\");\n return code;\n }", "public Stmt createAssignment(Assign expr) {\n return createEval(expr);\n }", "public LlvmValue visit(Assign n){\n\t\t\n\t\tSystem.out.format(\"assign********\\n\");\n\t\t\n\t\tLlvmValue rhs = n.exp.accept(this);\n\t\tLlvmRegister returns;\n\t\t//Nesta parte, para retornarmos o tipo certo, tivemos que converter todos os parametros do tipo\n\t\t//[ A x iB] para ponteiros. o Assembly reclamava quando tinha algum store ou algo do genero com tipos\n\t\t// diferentes\n\t\tif(rhs.type.toString().contains(\"x i\")){\n\t\t\t//System.out.format(\"expressao de rhs envolve arrays. fazendo casting...\\n\");\n\t\t\t\n\t\t\t//Fazer bitcast\n\t\t\tif(rhs.type.toString().contains(\" x i32\")){\n\t\t\t\treturns = new LlvmRegister(LlvmPrimitiveType.I32PTR);\n\t\t\t}else if(rhs.type.toString().contains(\" x i8\")){\n\t\t\t\treturns = new LlvmRegister(new LlvmPointer(LlvmPrimitiveType.I8));\n\t\t\t//Esse else eh meio inutil, mas pelo fato de eu querer usar elseif, deixei ele aqui mesmo.\n\t\t\t}else{\n\t\t\t\treturns = new LlvmRegister(rhs.type);\n\t\t\t}\n\t\t\t\n\t\t\tassembler.add(new LlvmBitcast(returns, rhs, returns.type));\n\t\t\tassembler.add(new LlvmStore(returns, n.var.accept(this)));\n\t\t}else{\n\t\t\t//Caso o tipo ja esteja ok, soh damos store com o rhs mesmo.\n\t\t\tassembler.add(new LlvmStore(rhs, n.var.accept(this)));\n\t\t}\n\t\treturn null;\n\t}", "assign_op getAssign_op();", "protected Expr visitSettableAssign(SettableAssign n) throws SemanticException {\n Position pos = n.position();\n MethodInstance mi = n.methodInstance();\n List<Expr> args = new ArrayList<Expr>(n.index());\n if (n.operator() == Assign.ASSIGN) {\n // FIXME: this changes the order of evaluation, (a,i,v) -> (a,v,i)!\n args.add(0, n.right());\n return xnf.Call(pos, n.array(), xnf.Id(pos, mi.name()),\n args).methodInstance(mi).type(mi.returnType());\n }\n X10Binary_c.Operator op = n.operator().binaryOperator();\n X10Call left = (X10Call) n.left();\n MethodInstance ami = left.methodInstance();\n List<Formal> parms = new ArrayList<Formal>();\n Name xn = Name.make(\"x\");\n LocalDef xDef = xts.localDef(pos, xts.Final(), Types.ref(mi.container()), xn);\n Formal x = xnf.Formal(pos, xnf.FlagsNode(pos, xts.Final()),\n xnf.CanonicalTypeNode(pos, mi.container()), xnf.Id(pos, xn)).localDef(xDef);\n parms.add(x);\n List<Expr> idx1 = new ArrayList<Expr>();\n int i = 0;\n for (Type t : ami.formalTypes()) {\n Name yn = Name.make(\"y\"+i);\n LocalDef yDef = xts.localDef(pos, xts.Final(), Types.ref(t), yn);\n Formal y = xnf.Formal(pos, xnf.FlagsNode(pos, xts.Final()),\n xnf.CanonicalTypeNode(pos, t), xnf.Id(pos, yn)).localDef(yDef);\n parms.add(y);\n idx1.add(xnf.Local(pos, xnf.Id(pos, yn)).localInstance(yDef.asInstance()).type(t));\n i++;\n }\n Name zn = Name.make(\"z\");\n Type T = mi.formalTypes().get(0);\n assert (xts.isSubtype(ami.returnType(), T, context()));\n LocalDef zDef = xts.localDef(pos, xts.Final(), Types.ref(T), zn);\n Formal z = xnf.Formal(pos, xnf.FlagsNode(pos, xts.Final()),\n xnf.CanonicalTypeNode(pos, T), xnf.Id(pos, zn)).localDef(zDef);\n parms.add(z);\n Expr val = visitBinary((X10Binary_c) xnf.Binary(pos,\n xnf.Call(pos,\n xnf.Local(pos, xnf.Id(pos, xn)).localInstance(xDef.asInstance()).type(mi.container()),\n xnf.Id(pos, ami.name()), idx1).methodInstance(ami).type(T),\n op, xnf.Local(pos, xnf.Id(pos, zn)).localInstance(zDef.asInstance()).type(T)).type(T));\n List<Expr> args1 = new ArrayList<Expr>(idx1);\n args1.add(0, val);\n Type ret = mi.returnType();\n Expr res = xnf.Call(pos,\n xnf.Local(pos, xnf.Id(pos, xn)).localInstance(xDef.asInstance()).type(mi.container()),\n xnf.Id(pos, mi.name()), args1).methodInstance(mi).type(ret);\n // Have to create the appropriate node in case someone defines a set():void\n Block block = ret.isVoid() ?\n xnf.Block(pos, xnf.Eval(pos, res), xnf.Return(pos, xnf.Call(pos,\n xnf.Local(pos, xnf.Id(pos, xn)).localInstance(xDef.asInstance()).type(mi.container()),\n xnf.Id(pos, ami.name()), idx1).methodInstance(ami).type(T))) :\n xnf.Block(pos, xnf.Return(pos, res));\n Closure c = synth.makeClosure(pos, T, parms, block, context());\n X10MethodInstance ci = c.closureDef().asType().applyMethod();\n args.add(0, n.array());\n args.add(n.right());\n return xnf.ClosureCall(pos, c, args).closureInstance(ci).type(ret);\n }", "public VariableUnit solve() {\n LinkedList<VariableUnit> processor = new LinkedList<VariableUnit>();\n\n VariableUnit vu1 = new VariableUnit(250.0, 'x');\n VariableUnit vu2 = new VariableUnit('+');\n VariableUnit vu3 = new VariableUnit(250.0, 'x');\n VariableUnit vu4 = new VariableUnit(501.0, 'x');\n VariableUnit vu5 = new VariableUnit('y');\n VariableUnit vu6 = new VariableUnit('-');\n alpha_arr.get(('x' - 'a')).addLast(vu1);\n alpha_arr.get(('x' - 'a')).addLast(vu2);\n alpha_arr.get(('x' - 'a')).addLast(vu3);\n op_order.add(vu1); op_order.add(vu2); op_order.add(vu3); op_order.add(vu6);\n op_order.add(vu4); op_order.add(vu6); op_order.add(vu5);\n assignValue(2.0, 'x');\n \n System.out.print(vu1); System.out.print(vu2); System.out.print(vu3);\n System.out.print(vu6); System.out.print(vu4); System.out.print(vu6);\n System.out.print(vu5);\n System.out.println();\n System.out.println(\"------------------------------\");\n \n VariableUnit temp, temp1;\n for (int i = 0; i < op_order.size(); i++) {\n \ttemp = op_order.pollFirst();\n \t\n \t\tswitch (temp.getVariable()) {\n \tcase '+':\n \t\t//if processor.isEmpty(): throw an exception\n \t\ttemp1 = processor.pop().add(op_order.pollFirst());\n \t\tprocessor.push(temp1);\n \t\tbreak;\n \tcase '-':\n \t\t//if processor.isEmpty(): throw an exception\n \t\ttemp1 = processor.pop().subtract(op_order.pollFirst());\n \t\tprocessor.push(temp1);\n \t\tbreak;\n \tdefault:\n \t\tprocessor.push(temp);\n \t\t}\n }\n\n /*\n * System.out.println(\"This equation is currently unsolvable.\");\n \tSystem.out.println(\"Try assigning values to some of the variables.\");\n */\n while (!processor.isEmpty()) {\n \top_order.addFirst(processor.pop());\n }\n \n ListIterator<VariableUnit> iter = op_order.listIterator();\n \n while ( iter.hasNext() ) {\n \tVariableUnit iter_temp = iter.next();\n \t//System.out.print(iter_temp.hasValue());\n \tif (iter_temp.hasValue()) {\n \t\tSystem.out.print( Double.toString(iter_temp.subValue()) );\n \t}\n \telse {\n \t\tSystem.out.print(iter_temp);\n \t}\n };\n System.out.println();\n \n return new VariableUnit(Double.NaN, ' ');\n }", "@Override\n\tpublic Object visitStatement_Assign(Statement_Assign statement_Assign, Object arg) throws Exception {\n\t\tif(statement_Assign.lhs.getTypeName().isType(Type.INTEGER) ||statement_Assign.lhs.getTypeName().isType(Type.BOOLEAN) ){\n\t\t\tstatement_Assign.e.visit(this, arg);\t\t\n\t\t\tstatement_Assign.lhs.visit(this, arg);\n\t\t}\n\t\telse if(statement_Assign.lhs.getTypeName().isType(Type.IMAGE)){\n\t\t\t//if(statement_Assign.lhs.isCartesian){\n\t\t\t\tmv.visitFieldInsn(GETSTATIC, className, statement_Assign.lhs.name, ImageSupport.ImageDesc);\n\t\t\t\tmv.visitInsn(DUP);\n\t\t\t\tmv.visitMethodInsn(INVOKESTATIC, ImageSupport.className, \"getX\", ImageSupport.getXSig, false);\n\t\t\t\tmv.visitIntInsn(ISTORE, 3);\n\t\t\t\tmv.visitMethodInsn(INVOKESTATIC, ImageSupport.className, \"getY\", ImageSupport.getYSig, false);\n\t\t\t\tmv.visitIntInsn(ISTORE, 4);\t\t\t\t\n\t\t\t//}\n\t\t\t\n\t\t\tmv.visitInsn(ICONST_0);\n\t\t\tmv.visitVarInsn(ISTORE, 1);\n\t\t\tLabel l1 = new Label();\n\t\t\tmv.visitLabel(l1);\n\t\t\tLabel l2 = new Label();\n\t\t\tmv.visitJumpInsn(GOTO, l2);\n\t\t\tLabel l3 = new Label();\n\t\t\tmv.visitLabel(l3);\n\t\t\tmv.visitLineNumber(11, l3);\n\t\t\tmv.visitFrame(Opcodes.F_APPEND,1, new Object[] {Opcodes.INTEGER}, 0, null);\n\t\t\tmv.visitInsn(ICONST_0);\n\t\t\tmv.visitVarInsn(ISTORE, 2);\n\t\t\tLabel l4 = new Label();\n\t\t\tmv.visitLabel(l4);\n\t\t\tLabel l5 = new Label();\n\t\t\tmv.visitJumpInsn(GOTO, l5);\n\t\t\tLabel l6 = new Label();\n\t\t\tmv.visitLabel(l6);\n\t\t\tmv.visitFrame(Opcodes.F_APPEND,1, new Object[] {Opcodes.INTEGER}, 0, null);\n\t\t\t\n\t\t\tstatement_Assign.e.visit(this, arg);\n\t\t\tstatement_Assign.lhs.visit(this, arg);\n\t\t\t\n\t\t\tmv.visitIincInsn(2, 1);\n\t\t\tmv.visitLabel(l5);\n\t\t\tmv.visitFrame(Opcodes.F_SAME, 0, null, 0, null);\n\t\t\tmv.visitVarInsn(ILOAD, 2);\n\t\t\tmv.visitIntInsn(ILOAD, 4); // Y MAX VALUE\n\t\t\tmv.visitJumpInsn(IF_ICMPLT, l6);\n\t\t\tLabel l7 = new Label();\n\t\t\tmv.visitLabel(l7);\n\t\t\tmv.visitIincInsn(1, 1);\n\t\t\tmv.visitLabel(l2);\n\t\t\tmv.visitFrame(Opcodes.F_CHOP,1, null, 0, null);\n\t\t\tmv.visitVarInsn(ILOAD, 1);\n\t\t\tmv.visitIntInsn(ILOAD, 3); // X MAX VALUE\n\t\t\tmv.visitJumpInsn(IF_ICMPLT, l3);\n\t\t}\n\t\treturn null;\n\t}", "@Override\n public CodeFragment visitAssignmentStat(AlangParser.AssignmentStatContext ctx) {\n String name = ctx.ID().getText();\n if (!variableExists(name)) {\n this.addError(ctx, name, \"Assignment to undeclared variable\");\n return new CodeFragment(\"\");\n }\n\n Variable v = this.globals.get(name);\n v.setValue(ctx.global_expression().getText());\n v.setHasValue();\n\n return new CodeFragment(\"\");\n }", "@Override\r\n\tpublic Object visit(YoyooAssignmentOperator node, Object data) {\r\n\t\tassignOptMark = new OperatorMark(node.first_token.image);\r\n\t\treturn null;\r\n\t}", "@Override\n public void visit(VariableAssignNode variableAssignNode) {\n }", "@FunctionalInterface\n\tpublic interface Assignment<V> {\n\t\tV set(Program p,V v);\n\t}", "private BDDState handleAssignment(CAssignment assignment, CFANode successor, CFAEdge edge)\n throws UnsupportedCodeException {\n CExpression lhs = assignment.getLeftHandSide();\n\n final String varName;\n if (lhs instanceof CIdExpression) {\n varName = ((CIdExpression) lhs).getDeclaration().getQualifiedName();\n } else {\n varName = functionName + \"::\" + lhs;\n }\n\n final CType targetType = lhs.getExpressionType();\n\n // next line is a shortcut, not necessary\n if (!precision.isTracking(MemoryLocation.fromQualifiedName(varName), targetType, successor)) {\n return state;\n }\n\n BDDState newState = state;\n CRightHandSide rhs = assignment.getRightHandSide();\n if (rhs instanceof CExpression exp) {\n final Partition partition = varClass.getPartitionForEdge(edge);\n\n if (isUsedInExpression(varName, exp)) {\n // make tmp for assignment,\n // this is done to handle assignments like \"a = !a;\" as \"tmp = !a; a = tmp;\"\n String tmpVarName = predmgr.getTmpVariableForPartition(partition);\n final Region[] tmp =\n predmgr.createPredicateWithoutPrecisionCheck(\n tmpVarName, bvComputer.getBitsize(partition, targetType));\n final CFANode location = successor;\n\n // make region for RIGHT SIDE and build equality of var and region\n final Region[] regRHS =\n bvComputer.evaluateVectorExpression(partition, exp, targetType, location, precision);\n newState = newState.addAssignment(tmp, regRHS);\n\n // delete var, make tmp equal to (new) var, then delete tmp\n final Region[] var =\n predmgr.createPredicate(\n scopeVar(lhs),\n targetType,\n successor,\n bvComputer.getBitsize(partition, targetType),\n precision);\n newState = newState.forget(var);\n newState = newState.addAssignment(var, tmp);\n newState = newState.forget(tmp);\n\n } else {\n final Region[] var =\n predmgr.createPredicate(\n scopeVar(lhs),\n targetType,\n successor,\n bvComputer.getBitsize(partition, targetType),\n precision);\n newState = newState.forget(var);\n final CFANode location = successor;\n\n // make region for RIGHT SIDE and build equality of var and region\n final Region[] regRHS =\n bvComputer.evaluateVectorExpression(\n partition, (CExpression) rhs, targetType, location, precision);\n newState = newState.addAssignment(var, regRHS);\n }\n return newState;\n\n } else if (rhs instanceof CFunctionCallExpression) {\n // handle params of functionCall, maybe there is a sideeffect\n newState =\n handleExternalFunctionCall(\n newState, successor, ((CFunctionCallExpression) rhs).getParameterExpressions());\n\n // call of external function: we know nothing, so we delete the value of the var\n // TODO can we assume, that malloc returns something !=0?\n // are there some \"save functions\"?\n\n final Region[] var =\n predmgr.createPredicate(\n scopeVar(lhs),\n targetType,\n successor,\n bitsize,\n precision); // is default bitsize enough?\n newState = newState.forget(var);\n\n return newState;\n\n } else {\n throw new AssertionError(\"unhandled assignment: \" + edge.getRawStatement());\n }\n }", "@Override\r\n\tpublic Instruction lexParse(String[] words, LexicalParser lexParser) {\r\n\t\tif (words.length!=3) return null;\r\n\t\t\r\n\t\tif (!words[1].equals(\"=\")) return null;\r\n\t\t\r\n\t\trhs=TermParser.parse(words[2]);\r\n\t\tif (rhs==null) return null;\r\n\t\t\r\n\t\tTerm var=TermParser.parse(words[0]);\r\n\t\tif (var==null) return null;\r\n\t\t\r\n\t\treturn new SimpleAssignment(words[0], rhs);\r\n\t}", "protected abstract Value evaluate();", "public interface AssignmentNode extends StackOperationNode {\n\n TemporaryVariableName getValueName();\n\n}", "@Override\n\tpublic Solution<TTPVariable> run(SingleObjectiveThiefProblem thief, IEvaluator evaluator, MyRandom rand) {\n\t\tTTPVariable var = TTPVariable.create(new TourOptimalFactory(thief).next(rand), Pack.empty());\n\t\tSolution<TTPVariable> currentBest = thief.evaluate(var);\n\t\t\n\n\t\twhile (evaluator.hasNext()) {\n\n\t\t\t// now take the tour and optimize packing plan\n\t\t\tSolution<Pack> nextPack = optPack(thief, evaluator, rand, currentBest.getVariable().getTour(), currentBest.getVariable().getPack());\n\t\t\t\n\t\t\tSolution<Tour> nextTour = optTour(thief, evaluator, rand, currentBest.getVariable().getTour(), nextPack.getVariable());\n\t\t\t\n\t\t\tTTPVariable next = TTPVariable.create(nextTour.getVariable(), nextPack.getVariable());\n\t\t\tSolution<TTPVariable> s = thief.evaluate(next);\n\t\t\t\n\t\t\t//System.out.println(nextPack);\n\t\t\t//System.out.println(currentBest);\n\t\t\t//System.out.println(\"----------------\");\n\t\t\t\n\t\t\t// update the best found solution\n\t\t\tif (SolutionDominator.isDominating(s, currentBest)) {\n\t\t\t\tcurrentBest = s;\n\t\t\t\t//System.out.println(\"YES\");\n\t\t\t}\n\t\t\tevaluator.notify(currentBest);\n\n\t\t}\n\n\t\treturn currentBest;\n\t}", "@Test\n\tpublic void test() {\n\t\tRandomVariableDefinition RV_DEF_X = new RandomVariableDefinition(\"DEF_X\", Arrays.asList(\"x0\", \"x1\", \"x2\"));\n\t\tRandomVariableDefinition RV_DEF_Y = new RandomVariableDefinition(\"DEF_Y\", Arrays.asList(\"y0\", \"y1\"));\n\t\tRandomVariableDefinition RV_DEF_Z = new RandomVariableDefinition(\"DEF_Y\", Arrays.asList(\"z0\", \"z1\"));\n\n\t\t///////////////////////////////////\n\t\t// define the local probability models\n\t\tLocalProbabilityModel X = new LocalProbabilityModel(\"X\");\n\t\tLocalProbabilityModel Y = new LocalProbabilityModel(\"Y\");\n\t\tLocalProbabilityModel Z = new LocalProbabilityModel(\"Z\");\n\t\tLocalProbabilityModel X1 = new LocalProbabilityModel(\"X1\");\n\t\tLocalProbabilityModel X2 = new LocalProbabilityModel(\"X2\");\n\t\tLocalProbabilityModel X3 = new LocalProbabilityModel(\"X3\");\n\t\tLocalProbabilityModel X7 = new LocalProbabilityModel(\"X7\");\n\t\t\n\t\t////////////////////////////////\n\t\t// specify target variable type, and dependencies\n\t\t\n\t\t// two a-priori variables - target only, no dependencies\n\t\tX.setTargetAndDependencies(RV_DEF_X, null);\n\t\tY.setTargetAndDependencies(RV_DEF_Y, null);\n\t\t\n\t\t// a LPM conditionally dependent on two variables\n\t\tZ.setTargetAndDependencies(RV_DEF_Z, Arrays.asList(X, Y));\n\n\t\t// a LPM conditionally dependent on several variables of the same type\n\t\tX3.setTargetAndDependencies(RV_DEF_X, Arrays.asList(X1, X2));\n\n\t\t// a LPM conditionally dependent on itself (i.e. a state variable)\n\t\tX7.setTargetAndDependencies(RV_DEF_X, Arrays.asList(X7));\n\n\t\n\t\t// the first has no dependencies just values\n\t\tX.setValue(\"x0\", 0.6);\n\t\tX.setValue(\"x1\", 0.1);\n\t\tX.setValue(\"x2\", 0.1);\n\n\t\t// the second has dependencies\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x0\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x0\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x1\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x1\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x2\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x2\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x0\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x0\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x1\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x1\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x2\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x2\"), Y.event(\"y1\")), 0.3);\n\n\t\t// the third has a recurrent dependency\n\t\tX1.setValue(\"x0\", Arrays.asList(X1.event(\"x0\")), 0.1);\n\t\tX1.setValue(\"x0\", Arrays.asList(X1.event(\"x1\")), 0.1);\n\t\tX1.setValue(\"x1\", Arrays.asList(X1.event(\"x0\")), 0.1);\n\t\tX1.setValue(\"x1\", Arrays.asList(X1.event(\"x1\")), 0.1);\n\t\t\n\t\t\n\t\t\n\t\t/* NOTE - should we enforce that a conditional probability should always be 'set' with requirement that the conditioning variables should all be identified ? */\n\t\t// this would be Z.setValue(\n\t//\tZ.setValue(Arrays.asList(X.event(\"x0\"), Y.event(\"y0\")),\n\t//\t\t\tArrays.asList(\n\t//\t\t\t\t\t\"z0\", 0.5,\n\t//\t\t\t\t\t\"z1\", 0.3,\n\t//\t\t\t\t\t\"z2\", 0.7));\n\n\n\n\t\tString s = Z.toString();\n\t\tSystem.out.println(\"==============\\n\" + s);\n\n\t\tSystem.out.println(\"done\");\n\n\n\t}", "public static BinaryExpression addAssign(Expression expression0, Expression expression1) { throw Extensions.todo(); }", "public static BinaryExpression assign(Expression left, Expression right) { throw Extensions.todo(); }", "public JCExpressionStatement makeAssignment(Tag tag, String varname, JCExpression exp1, JCExpression exp2) {\n return treeMaker.Exec(treeMaker.Assign(treeMaker.Ident(getNameFromString(varname)), treeMaker.Binary(tag, exp1, exp2)));\n }", "public Stmt createAssignment(Position pos, Expr target, Operator op, Expr source) {\n return createAssignment(createAssign(pos, target, op, source));\n }", "public Assign createAssign(Position pos, Expr target, Operator op, Expr source) {\n return (Assign) xnf.Assign(pos, target, op, source).type(target.type());\n }", "protected Element initAssuranceToMyVar() {\n\t\tElement an = el(\"bpws:assign\", new Node[]{\n\t\t\t\tinitMyVar(new Node[]{\n\t\t\t\t\tel(\"nswomoxsd:type\", text(\"Assurance\")),\n\t\t\t\t\tel(\"nswomoxsd:leftValue\", text(\"0\")),\n\t\t\t\t\tel(\"nswomoxsd:rightValue\", text(\"0\")),\n\t\t\t\t\tel(\"nswomoxsd:value\", text(\"0\"))\n\t\t\t\t}),\n\t\t\t\tsetProcId()\n\t\t});\n\t\treturn an;\n\t}", "public final void rule__XSwitchExpression__Group_2_0_0_0__1__Impl() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalDroneScript.g:10749:1: ( ( ( rule__XSwitchExpression__DeclaredParamAssignment_2_0_0_0_1 ) ) )\r\n // InternalDroneScript.g:10750:1: ( ( rule__XSwitchExpression__DeclaredParamAssignment_2_0_0_0_1 ) )\r\n {\r\n // InternalDroneScript.g:10750:1: ( ( rule__XSwitchExpression__DeclaredParamAssignment_2_0_0_0_1 ) )\r\n // InternalDroneScript.g:10751:2: ( rule__XSwitchExpression__DeclaredParamAssignment_2_0_0_0_1 )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXSwitchExpressionAccess().getDeclaredParamAssignment_2_0_0_0_1()); \r\n }\r\n // InternalDroneScript.g:10752:2: ( rule__XSwitchExpression__DeclaredParamAssignment_2_0_0_0_1 )\r\n // InternalDroneScript.g:10752:3: rule__XSwitchExpression__DeclaredParamAssignment_2_0_0_0_1\r\n {\r\n pushFollow(FOLLOW_2);\r\n rule__XSwitchExpression__DeclaredParamAssignment_2_0_0_0_1();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXSwitchExpressionAccess().getDeclaredParamAssignment_2_0_0_0_1()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "private void instantiate(Predicate singlePred, Heuristic heuristic) {\n\n\t\tList<Predicate> compatiblePredicates = new ArrayList<>();\n\t\tfor (Predicate currPred : this.currentState.getPredicates().toList()) {\n\t\t\t// find all compatible predicates in current state:\n\t\t\tif (currPred.isCompatibleTo(singlePred)) {\n\t\t\t\tcompatiblePredicates.add(currPred);\n\t\t\t}\n\t\t}\n\n\t\tif (compatiblePredicates.isEmpty()) {\n\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\"There was no compatible predicate found to resolve the predicate \" + singlePred);\n\t\t}\n\n\t\t// Heuristic chooses one candidate from compatiblePredicates\n\t\tPredicate chosenPred = heuristic.choosePredicateForInstantiation(compatiblePredicates, currentState);\n\n\t\t// instantiate with singlePred with constants of chosenPred\n\t\tfor (int i = 0; i < chosenPred.getValence(); i++) {\n\t\t\tif (!singlePred.getArgument(i).isInstantiated()) {\n\t\t\t\t// Update the Java object of the variable.\n\t\t\t\t// All references to this variable in other predicates\n\t\t\t\t// will now reference to the instantiated variable.\n\t\t\t\tsinglePred.getArgument(i).instantiate(chosenPred.getArgument(i).getValue());\n\t\t\t}\n\t\t}\n\n\t}", "Assignment createAssignment();", "Assignment createAssignment();", "@Override\n public ExprType analyzeAssign(AnalyzeInfo info, ExprGenerator value)\n {\n ExprGenerator objGen = ((ExprPro) _objExpr).getGenerator();\n objGen.analyze(info);\n\n value.analyze(info);\n\n // php/3a6e, php/39o3\n // objGen.analyzeSetReference(info);\n objGen.analyzeSetModified(info);\n\n return ExprType.VALUE;\n }", "public void doAction(\r\n\t\t\tAction_To_Choose action,\r\n\t\t\tGuideline_Action_Choices currentDecision,\r\n\t\t\tGuidelineInterpreter interpreter ){\r\n\n\t\tif (getrule_in_conditionValue() != null) {\n\t\t\tCriteria_Evaluation evaluation = HelperFunctions.dummyCriteriaEvaluation();\n\t\t\ttry {\n\t\t\t\tevaluation = (Criteria_Evaluation) ((Criterion)getrule_in_conditionValue()).evaluate(interpreter, false);\n\t\t\t\tif (!(PCAInterfaceUtil.mapTruthValue(evaluation.truth_value))) { // rule-in condition does not hold\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t} catch (PCA_Session_Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\treturn ;\n\t\t\t}\n\t\t}\n\r\n\t\t// each item in alternatives is a Drug Usage.\r\n\t\t// each item in addEvaluation is an Add_Evaluation structure\n\t\tCollection<Slot> recommendationBais = getrecommendation_basisValue();\r\n\t\tCollection alternatives = getalternativesValue();\r\n\t\tList addEvaluations = new ArrayList();\r\n\t\t// addEvaluations is a collection of Choice_Evaluation instances\r\n\t\tfor (Iterator i = alternatives.iterator();i.hasNext();) {\r\n\t\t\tDrug_Usage activity = (Drug_Usage) i.next();\r\n\t\t\tChoice_Evaluation choiceEvaluation = new Choice_Evaluation();\r\n\t\t\ttry {\r\n\t\t\t\tAdd_Evaluation addEval = activity.evaluateAdd(interpreter, \n\t\t\t\t\t\tthis.getfine_grain_priorityValue(), null, recommendationBais);\r\n\t\t\t\tif (addEval != null) {\r\n\t\t\t\t\tchoiceEvaluation.add_eval(addEval);\r\n\t\t\t\t\taddEvaluations.add(choiceEvaluation);\r\n\t\t\t\t}\r\n\t\t\t\tlogger.debug(activity.getlabelValue()+\" got evaluated\");\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tlogger.error(activity.getlabelValue()+\" cannot be evaluated; \"+e.getClass());\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tCollections.sort(addEvaluations, new CompareEvals());\r\n\r\n\t\tinterpreter.addEvaluatedChoice(\r\n\t\t\t\tnew Guideline_Activity_Evaluations(\r\n\t\t\t\t\t\tthis.makeGuideline_Entity(interpreter.getCurrentGuidelineID()),\r\n\t\t\t\t\t\tEvaluation_Type.add,\r\n\t\t\t\t\t\t(Choice_Evaluation[])addEvaluations.toArray(new Choice_Evaluation[0]),\r\n\t\t\t\t\t\tinterpreter.getCurrentGuidelineID())\r\n\t\t\t\t);\r\n\r\n\t}", "public Object visitAssignment(JmmNode node, List<Report> reports) {\n JmmNode left = node.getChildren().get(0);\n // Constant Propagation and Folding\n JmmNode right = node.getChildren().get(1);\n constantPropagationAndFolding(right);\n\n if (left.getKind().equals(\"Var\")) {\n // Left Node is Variable\n String varName = left.get(\"name\");\n Symbol symbol = getVariableSymbol(varName);\n\n // Right Node is the Value\n right = node.getChildren().get(1);\n Object value = getValue(right);\n\n // Modify the Variable Value\n setVariableValue(symbol, value);\n }\n\n return null;\n }", "@Override\n public PermutationSolution<Integer> createSolution() {\n return new DefaultBinaryIntegerPermutationSolution(this) ;\n }", "private ConvertViewReuseWithTernary(CtVariableReference reassignedVariable,\n CtVariableRead checkedVariable,\n CtVariableRead assignedVariable,\n DetectionPhaseContext context) {\n super(context);\n this.reassignedVariable = reassignedVariable;\n this.checkedVariable = checkedVariable;\n this.assignedVariable = assignedVariable;\n }", "@Override\n public Expression visit(LogicalOpNode node) {\n\n Label trueLabel = new Label ();\n Label falseLabel = new Label ();\n Label endLabel = new Label ();\n\n process(node, trueLabel, falseLabel);\n\n cat.footoredo.mx.entity.Variable variable = tmpVariable(node.getType());\n\n label (trueLabel);\n assign (node.getLocation(), ref(variable), new Integer(Type.INT8, 1));\n jump (endLabel);\n\n label (falseLabel);\n assign (node.getLocation(), ref(variable), new Integer(Type.INT8, 0));\n jump (endLabel);\n\n label (endLabel);\n\n return isStatement() ? null : ref (variable);\n }", "public static Pair<Automaton, List<BooleanVariable>> constructAutomatonFromAssignment(Logger logger, List<Assignment> ass,\n\t\t\tScenarioTree tree, int colorSize, boolean complete, CompletenessType completenessType) {\n\t\tList<BooleanVariable> filteredYVars = new ArrayList<>();\n\t\tint[] nodeColors = new int[tree.nodesCount()];\n\n\t\t// color the scenario tree codes according to the assignment\n\t\tass.stream()\n\t\t\t\t.filter(a -> a.value && a.var.name.startsWith(\"x_\"))\n\t\t\t\t.forEach(a -> {\n\t\t\t\t\tString[] tokens = a.var.name.split(\"_\");\n\t\t\t\t\tassert tokens.length == 3;\n\t\t\t\t\tint node = Integer.parseInt(tokens[1]);\n\t\t\t\t\tint color = Integer.parseInt(tokens[2]);\n\t\t\t\t\tnodeColors[node] = color;\n\t\t\t\t});\n\t\t// add transitions from scenarios\n\t\tAutomaton ans = new Automaton(colorSize);\n\t\tfor (int i = 0; i < tree.nodesCount(); i++) {\n\t\t\tint color = nodeColors[i];\n\t\t\tNode state = ans.getState(color);\n\t\t\tfor (Transition t : tree.getNodes().get(i).getTransitions()) {\n\t\t\t\tif (!state.hasTransition(t.getEvent(), t.getExpr())) {\n\t\t\t\t\tint childColor = nodeColors[t.getDst().getNumber()];\n\t\t\t\t\tstate.addTransition(t.getEvent(), t.getExpr(),\n\t\t\t\t\t\tt.getActions(), ans.getState(childColor));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (complete) {\n\t\t\t// add other transitions\n\t\t\tfor (Assignment a : ass.stream()\n\t\t\t\t\t.filter(a -> a.value && a.var.name.startsWith(\"y_\"))\n\t\t\t\t\t.collect(Collectors.toList())) {\n\t\t\t\tString[] tokens = a.var.name.split(\"_\");\n\t\t\t\tassert tokens.length == 4;\n\t\t\t\tint from = Integer.parseInt(tokens[1]);\n\t\t\t\tint to = Integer.parseInt(tokens[2]);\n\t\t\t\tString event = tokens[3];\n\t\n\t\t\t\tNode state = ans.getState(from);\n\t\n\t\t\t\tif (state.hasTransition(event, MyBooleanExpression.getTautology())) {\n\t\t\t\t\tfilteredYVars.add(a.var);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// include transitions not from scenarios\n\t\t\t\tList<String> properUniqueActions = new ArrayList<>();\n\t\t\t\tfor (Assignment az : ass) {\n\t\t\t\t\tif (az.value && az.var.name.startsWith(\"z_\" + from + \"_\")\n\t\t\t\t\t\t\t&& az.var.name.endsWith(\"_\" + event)) {\n\t\t\t\t\t\tproperUniqueActions.add(az.var.name.split(\"_\")[2]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tCollections.sort(properUniqueActions);\n\t\n\t\t\t\tif (!state.hasTransition(event, MyBooleanExpression.getTautology())) {\n\t\t\t\t\t// add\n\t\t\t\t\tboolean include;\n\t\t\t\t\tif (completenessType == CompletenessType.NORMAL) {\n\t\t\t\t\t\tinclude = true;\n\t\t\t\t\t} else if (completenessType == CompletenessType.NO_DEAD_ENDS) {\n\t\t\t\t\t\tinclude = state.transitionsCount() == 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new AssertionError();\n\t\t\t\t\t}\n\t\t\t\t\tif (include) {\n\t\t\t\t\t\tstate.addTransition(event, MyBooleanExpression.getTautology(),\n\t\t\t\t\t\t\tnew StringActions(String.join(\",\",\n\t\t\t\t\t\t\tproperUniqueActions)), ans.getState(to));\n\t\t\t\t\t\tlogger.info(\"ADDING TRANSITION NOT FROM SCENARIOS \" + a.var + \" \" + properUniqueActions);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// check\n\t\t\t\t\tTransition t = state.getTransition(event, MyBooleanExpression.getTautology());\n\t\t\t\t\tif (t.getDst() != ans.getState(to)) {\n\t\t\t\t\t\tlogger.severe(\"INVALID TRANSITION DESTINATION \" + a.var);\n\t\t\t\t\t}\n\t\t\t\t\tList<String> actualActions = new ArrayList<>(new TreeSet<>(\n\t\t\t\t\t\t\tArrays.asList(t.getActions().getActions())));\n\t\t\t\t\tif (!actualActions.equals(properUniqueActions)) {\n\t\t\t\t\t\tlogger.severe(\"ACTIONS DO NOT MATCH\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn Pair.of(ans, filteredYVars);\n\t}", "private void assignJValuesToInputBranch()\r\n\t{\r\n\t\tfor (int j = lowestJValue; j <= highestJValue; j++) {\r\n\t\t\tinputBranchWithJ.put(j, inputBranchArray.get(j - lowestJValue));\r\n\t\t}\r\n\r\n\t\tif (isEType) {\r\n\t\t\tsetupAssociatedBranchesEType(inputBranchWithJ);\r\n\t\t} else {\r\n\t\t\tsetupAssociatedBranchesAType(inputBranchWithJ);\r\n\t\t}\r\n\r\n\t}", "public VariType visit(AssignmentStatement n, Table argu) {\n\t VariType _ret=null;\n\t n.f0.accept(this, argu);\n\t MethodTable methodtable = (MethodTable)argu;\n\t Vari vari = methodtable.getvari(n.f0.f0.tokenImage);\n\t if(vari == null) {\n\t \t ClassTable classtable = methodtable.classtable;\n\t \t vari = classtable.getvari(n.f0.f0.tokenImage);\n\t \t if(vari == null) {\n\t \t\t PrintError.errorexist = true;\n\t\t \t String emsg = \"undefined variable \\\"\"+n.f0.f0.tokenImage+\"\\\"\";\n\t \t\t PrintError.print(emsg, n.f0.f0.beginLine, n.f0.f0.beginColumn, 1);\n\t \t\t return _ret;\n\t \t }\n\t }\n\t n.f1.accept(this, argu);\n\t VariType t2 = n.f2.accept(this, argu);\n\t if(VariType.isTheSameType(methodtable.toptable, vari.vari_type, t2) == false) {\n\t \t PrintError.errorexist = true;\n\t \t String emsg = \"assignstatement does not have matched types, one has type \"+vari.vari_type.type+\" , the other one has type \"+t2.type;\n\t \t PrintError.print(emsg, n.f1.beginLine, n.f1.beginColumn, 1);\n\t \t return _ret;\n\t }\n\t if(t2.type == \"Array\"){\n\t \t vari.init = true;\n\t \t if(t2.ifintegerliteral == true) {\n\t \t\t vari.alen = t2.integerliteral;\n\t \t }\n\t }\n\t n.f3.accept(this, argu);\n\t return _ret;\n\t }", "public void assignValueToVariable(HashMap<String, String> assignment) throws\r\n\t\t\tIllegalOperationException,TypeNotSupportedException, IncompatibleTypeException{\r\n\t\tMap.Entry<String, String> data = assignment.entrySet().iterator().next();\r\n\t\tString variableName = data.getKey();\r\n\t\tString valueName = data.getValue();\r\n\t\tVariable lastAppearanceOfVar = findVariable(variableName);//we'll search a variable named variableName\r\n\t\tif(lastAppearanceOfVar==null||lastAppearanceOfVar.isFinal()){//did'nt find variableName\\ found final\r\n\t\t\tthrow new IllegalOperationException();\r\n\t\t}else {\r\n\t\t\t//if we did find a declared variable named variableName:\r\n\t\t\tif (lastAppearanceOfVar.compatibleWith(valueName)) {//if value's type's illegal -> exception\r\n\t\t\t\t//if we're trying, in a scope other than globalScope, to declare a variable by assigning it\r\n\t\t\t\t// with an uninitialised global variable:\r\n\t\t\t\tif((lastAppearanceOfVar.isGlobal()&&!lastAppearanceOfVar.isInitialized())&&!scopeType\r\n\t\t\t\t\t\t.equals(\"global\")){\r\n\t\t\t\t\t//we'll check if lastAppearanceOfVar was initialised in this scope (else it's illegal):\r\n\t\t\t\t\tassignUninitialisedGlobalVar(lastAppearanceOfVar, valueName);\r\n\t\t\t\t}else{ //else, the assignment's legal and we'll mark lastAppearanceOfVar as initialised:\r\n\t\t\t\t\tlastAppearanceOfVar.initialize();\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tassignWithReference(valueName, lastAppearanceOfVar);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n\tpublic void makeDecision() {\n\t\tint powerMax = (int)(initPower) / 100;\n\t\tint powerMin = (int)(initPower * 0.3) / 100;\n\n\t\t// The value is calculated randomly from 0 to 10% of the initial power\n\t\tRandom rand = new Random();\n\t\tint actualPower = rand.nextInt((powerMax - powerMin) + 1) + powerMin;\n\t\tanswer.setConsumption(actualPower);\n\t}", "public boolean assignVariable(Scanner scan){\n\t\tif (scan.hasNext(\"\\\\=\")){\n\t\t\tif (!Parser.gobble(\"\\\\=\", scan)){ Parser.fail(\"Should have = for variables.\", scan); }\n\t\t\texpr = new Expression();\n\t\t\texpr.parse(scan);\t\t\t\t\t\t//Assignment\n\t\t\tif (!Parser.gobble(\"\\\\;\", scan)){ Parser.fail(\"Should have ; for variables.\", scan); }\n\t\t\t//Add to map\n\t\t\tParser.variables.put(name, this);\n\t\t\treturn true;\n\t\t} else if (scan.hasNext(\"\\\\;\")){\t//DECLARED NOT ASSIGNMENT\n\t\t\tif (!Parser.gobble(\"\\\\;\", scan)){ Parser.fail(\"Should have ; for variables.\", scan); }\n\t\t\t/*\t\t\tNum number = new Num();\n\t\t\tnumber.numberNodeZero();\n\t\t\texpr = number;\t\t\t\t\t//sets expr to 0. \n\t\t\t */\t\t\treturn true; \t\t\t\t\t//Shouldnt set it to 0 if there is already variable in map\n\t\t}\n\t\treturn false;\n\t}", "public Builder setDecisionPointParams(\n speech.multilang.Params.DecisionPointParams.Builder builderForValue) {\n if (decisionPointParamsBuilder_ == null) {\n decisionPointParams_ = builderForValue.build();\n onChanged();\n } else {\n decisionPointParamsBuilder_.setMessage(builderForValue.build());\n }\n bitField0_ |= 0x00000001;\n return this;\n }", "private Expr visitLocalAssign(LocalAssign n) throws SemanticException { \n Position pos = n.position();\n if (n.operator() == Assign.ASSIGN) return n;\n X10Binary_c.Operator op = n.operator().binaryOperator();\n Local left = (Local) n.left();\n Expr right = n.right();\n Type R = left.type();\n Expr val = visitBinary((X10Binary_c) xnf.Binary(pos, left, op, right).type(R));\n return assign(pos, left, Assign.ASSIGN, val);\n }", "@Test\n public void testRun_DecisionWithEquals_IN_A1_D_A2_FN() {\n // Final node creation\n final Node fn = NodeFactory.createNode(\"#6\", NodeType.FINAL);\n\n // Action node 3 (id #5) creation and flow set to final node\n final String A3_ID = \"#5\";\n final Node an3 = NodeFactory.createNode(A3_ID, NodeType.ACTION);\n final ExecutableActionMock objAn3 = ExecutableActionMock.create(KEY, A3_ID);\n ((ContextExecutable) an3).setObject(objAn3);\n ((ContextExecutable) an3).setMethod(objAn3.getPutIdInContextMethod());\n ((SingleControlFlowNode) an3).setFlow(fn);\n\n // Action node 2 (id #4) creation and flow set to final node\n final String A2_ID = \"#4\";\n final Node an2 = NodeFactory.createNode(A2_ID, NodeType.ACTION);\n final ExecutableActionMock objAn2 = ExecutableActionMock.create(KEY, A2_ID);\n ((ContextExecutable) an2).setObject(objAn2);\n ((ContextExecutable) an2).setMethod(objAn2.getPutIdInContextMethod());\n ((SingleControlFlowNode) an2).setFlow(fn);\n\n final String A1_KEY = \"a1_key\";\n final String A1_ID = \"#2\";\n\n // Decision node (id #3) creation\n final Node dn = NodeFactory.createNode(\"#3\", NodeType.DECISION);\n // Flow control from decision to action node 2 (if KEY == #2 goto A2)\n Map<FlowCondition, Node> flows = new HashMap<>(1);\n final FlowCondition fc2a2 = new FlowCondition(A1_KEY, ConditionType.EQ, A1_ID);\n flows.put(fc2a2, an2);\n // Otherwise, goto A3\n ((ConditionalControlFlowNode) dn).setFlows(flows, an3);\n\n // Action node 1 (id #2) creation. Sets the context to be used by the decision\n final Node an1 = NodeFactory.createNode(A1_ID, NodeType.ACTION);\n final ExecutableActionMock objAn1 = ExecutableActionMock.create(A1_KEY, A1_ID);\n ((ContextExecutable) an1).setObject(objAn1);\n ((ContextExecutable) an1).setMethod(objAn1.getPutIdInContextMethod());\n ((SingleControlFlowNode) an1).setFlow(dn);\n\n // Initial node (id #1) creation and flow set to action node 1\n final Node iNode = NodeFactory.createNode(\"#1\", NodeType.INITIAL);\n ((SingleControlFlowNode) iNode).setFlow(an1);\n\n final Jk4flowWorkflow wf = Jk4flowWorkflow.create(iNode);\n\n ENGINE.run(wf);\n\n Assert.assertEquals(A2_ID, wf.getContext().get(KEY));\n }", "public Strategy<S, Integer> buildStrategy() {\n\t\tStrategy<S, Integer> result = new Strategy<S, Integer>();\n\n\t\tSet<S> winningStates = this.getWinningStates();\n\n\t\tfor (S state : losingStates) {\n\t\t\tStrategyState<S, Integer> source = new StrategyState<S, Integer>(\n\t\t\t\t\tstate, DUMMY_GOAL);\n\t\t\tSet<StrategyState<S, Integer>> successors = new HashSet<StrategyState<S, Integer>>();\n\t\t\t// if its uncontrollable and winning it must have winning succesors\n\t\t\tfor (S succ : this.game.getSuccessors(state)) {\n\t\t\t\tif (!winningStates.contains(succ)) {\n\t\t\t\t\tStrategyState<S, Integer> target = new StrategyState<S, Integer>(\n\t\t\t\t\t\t\tsucc, DUMMY_GOAL);\n\t\t\t\t\tsuccessors.add(target);\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult.addSuccessors(source, successors);\n\t\t}\n\t\treturn result;\n\t}", "private ConflictCause assignTruth(int atom, ThriceTruth truth, NoGood impliedBy, int decisionLevel) {\n\t\tAssignment.Entry currentAssignment = assignment.get(atom);\n\t\tif (currentAssignment != null && currentAssignment.getDecisionLevel() <= decisionLevel && (truth.equals(currentAssignment.getTruth()))) {\n\t\t\treturn null;\n\t\t}\n\t\tConflictCause cause = assignment.assign(atom, truth, impliedBy, decisionLevel);\n\t\tif (cause == null) {\n\t\t\tdidPropagate = true;\n\t\t}\n\t\treturn cause;\n\t}", "abstract void assignOne();", "@Override\n\t\t\tpublic Ast binaryOp(BinaryOp ast, Void arg) {\n\t\t\t\tsuper.binaryOp(ast, arg);\n\n\t\t\t\ttry {\n\t\t\t\t\tExpr left = ast.left();\n\t\t\t\t\tExpr right = ast.right();\n\t\t\t\t\tInteger intValue = null;\n\t\t\t\t\tBoolean boolValue = null;\n\n\t\t\t\t\tswitch (ast.operator) {\n\t\t\t\t\tcase B_TIMES:\n\t\t\t\t\t\tintValue = asInt(left) * asInt(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_DIV:\n\t\t\t\t\t\tintValue = asInt(left) / asInt(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_MOD:\n\t\t\t\t\t\tintValue = asInt(left) % asInt(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_PLUS:\n\t\t\t\t\t\tintValue = asInt(left) + asInt(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_MINUS:\n\t\t\t\t\t\tintValue = asInt(left) - asInt(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_AND:\n\t\t\t\t\t\tboolValue = asBool(left) && asBool(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_OR:\n\t\t\t\t\t\tboolValue = asBool(left) || asBool(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_LESS_THAN:\n\t\t\t\t\t\tboolValue = asInt(left) < asInt(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_LESS_OR_EQUAL:\n\t\t\t\t\t\tboolValue = asInt(left) <= asInt(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_GREATER_THAN:\n\t\t\t\t\t\tboolValue = asInt(left) > asInt(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_GREATER_OR_EQUAL:\n\t\t\t\t\t\tboolValue = asInt(left) >= asInt(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_EQUAL:\n\t\t\t\t\t\tboolValue = areEqual(left, right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_NOT_EQUAL:\n\t\t\t\t\t\tboolValue = areEqual(left, right);\n\t\t\t\t\t\tif (boolValue != null)\n\t\t\t\t\t\t\tboolValue = !boolValue;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn replace(ast, intValue, boolValue);\n\t\t\t\t} catch (NotConstantException exc) {\n\t\t\t\t\t// non-constant operands: make no change.\n\t\t\t\t\treturn ast;\n\t\t\t\t} catch (ArithmeticException exc) {\n\t\t\t\t\t// division by zero etc: make no change.\n\t\t\t\t\treturn ast;\n\t\t\t\t}\n\t\t\t}", "public static BinaryExpression addAssign(Expression expression0, Expression expression1, Method method) { throw Extensions.todo(); }", "public final void rule__XSwitchExpression__Group_2_1_0_0__0__Impl() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalDroneScript.g:10884:1: ( ( ( rule__XSwitchExpression__DeclaredParamAssignment_2_1_0_0_0 ) ) )\r\n // InternalDroneScript.g:10885:1: ( ( rule__XSwitchExpression__DeclaredParamAssignment_2_1_0_0_0 ) )\r\n {\r\n // InternalDroneScript.g:10885:1: ( ( rule__XSwitchExpression__DeclaredParamAssignment_2_1_0_0_0 ) )\r\n // InternalDroneScript.g:10886:2: ( rule__XSwitchExpression__DeclaredParamAssignment_2_1_0_0_0 )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXSwitchExpressionAccess().getDeclaredParamAssignment_2_1_0_0_0()); \r\n }\r\n // InternalDroneScript.g:10887:2: ( rule__XSwitchExpression__DeclaredParamAssignment_2_1_0_0_0 )\r\n // InternalDroneScript.g:10887:3: rule__XSwitchExpression__DeclaredParamAssignment_2_1_0_0_0\r\n {\r\n pushFollow(FOLLOW_2);\r\n rule__XSwitchExpression__DeclaredParamAssignment_2_1_0_0_0();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXSwitchExpressionAccess().getDeclaredParamAssignment_2_1_0_0_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "@Override\n public void enterVar_assigment(FSMParser.Var_assigmentContext ctx) {\n if (ctx.getParent() instanceof FSMParser.Var_assignContext) {\n //find the variable and add it to the assignments map\n FSMParser.Var_assignContext varCont = (FSMParser.Var_assignContext) ctx.getParent();\n Var var = (Var) findComp(varCont.var().NAME().getText());\n this.assignments.put(var, Integer.parseInt(ctx.integer().getText()));\n\n\n }\n }", "public double getParameterValue (Assignment input) ;", "public LSMOP9(String solutionType, Integer numberOfVariables,\r\n\t\t\tInteger numberOfObjectives) {\r\n\t\tsuper(solutionType, numberOfVariables, numberOfObjectives);\r\n\t\tnumberOfVariables_ = numberOfVariables;\r\n\t\tnumberOfObjectives_ = numberOfObjectives;\r\n\t\tnumberOfConstraints_ = 0;\r\n\t\tproblemName_ = \"LSMOP9\";\r\n\r\n\t\tnk = 5;\r\n\t\tc = new double[numberOfObjectives_];\r\n\t\tc[0] = 3.8*0.1*(1.0-0.1);\r\n\t\tdouble sumC = c[0];\r\n\t\tfor(int i = 1; i < numberOfObjectives_; i++){\r\n\t\t\tc[i] = 3.8*c[i-1]*(1.0-c[i-1]);\r\n\t\t\tsumC += c[i];\r\n\t\t}\r\n\t\tsublen = new int[numberOfObjectives_];\r\n\t\tfor(int i = 0; i < numberOfObjectives_; i++){\r\n\t\t\t//sublen[i] = (int)Math.ceil(Math.round(numberOfVariables_*c[i]/sumC)/nk);\r\n\t\t\t//sublen[i] = (int)Math.floor(numberOfVariables_*c[i]/sumC/nk);\r\n\t\t\tsublen[i] = (int)Math.floor((numberOfVariables_-numberOfObjectives_+1)*c[i]/sumC/nk);\r\n\t\t}\r\n\t\tlen = new int[numberOfObjectives_+1]; \r\n\t\tlen[0] = 0;\r\n\t\tfor(int i = 0; i < numberOfObjectives_; i++){\r\n\t\t\tlen[i+1] = len[i] + nk*sublen[i];\r\n\t\t}\r\n\t\tlowerLimit_ = new double[numberOfVariables_];\r\n\t\tupperLimit_ = new double[numberOfVariables_];\r\n\t\tfor (int var = 0; var < numberOfObjectives_ - 1; var++) {\r\n\t\t\tlowerLimit_[var] = 0.0;\r\n\t\t\tupperLimit_[var] = 1.0;\r\n\t\t} // for\r\n\t\t\r\n\t\tfor (int var = numberOfObjectives_ - 1; var < numberOfVariables_; var++) {\r\n\t\t\tlowerLimit_[var] = 0.0;\r\n\t\t\tupperLimit_[var] = 10.0;\r\n\t\t} // for\r\n\r\n\t\tif (solutionType.compareTo(\"BinaryReal\") == 0)\r\n\t\t\tsolutionType_ = new BinaryRealSolutionType(this);\r\n\t\telse if (solutionType.compareTo(\"Real\") == 0)\r\n\t\t\tsolutionType_ = new RealSolutionType(this);\r\n\t\telse {\r\n\t\t\tSystem.out.println(\"Error: solution type \" + solutionType\r\n\t\t\t\t\t+ \" invalid\");\r\n\t\t\tSystem.exit(-1);\r\n\t\t}\r\n\t}", "private void assignment() {\n\n\t\t\t}", "public JCExpressionStatement makeAssignment(JCExpression lhs, JCExpression rhs) {\n return treeMaker.Exec(treeMaker.Assign(lhs, rhs));\n }", "public void useNormalVarimax(){\n this. varimaxOption = true;\n }", "@Override\n protected Move makeDecision() {\n myTurn = index();\n /* block the nearest + most effective player (as in, people who arent blocked) */\n ArrayList<Move> pathMoves = new ArrayList<>();\n ArrayList<Move> playMoves = new ArrayList<>();\n ArrayList<Move> discardMoves = new ArrayList<>();\n Map<Integer, Card> destroyCards = new HashMap<Integer, Card>();\n Map<Integer, Card> repairCards = new HashMap<Integer, Card>();\n Map<Integer, Card> blockCards = new HashMap<Integer, Card>();\n Map<Integer, Card> pathCards = new HashMap<Integer, Card>();\n Set<Position> reachable = game().board().getReachable();\n canSee=false;\n canMove=false;\n canBlock=false;\n canRockfall=false;\n canRepair=false;\n int len = hand().size();\n for (int i = 0; i < len; ++i) {\n Card c = hand().get(i);\n if (c instanceof PathCard && !isSabotaged()) {\n pathCards.put(i,c);\n// pathMoves.addAll(generatePossiblePaths(i, (PathCard) c));\n canMove = true;\n }\n if (c instanceof PlayerActionCard) {\n// playMoves.addAll(generatePossiblePlayerActions(i, (PlayerActionCard) c));\n if(c.type()== Card.Type.BLOCK) {\n blockCards.put(i, c);\n canBlock=true;\n }\n else if(c.type()== Card.Type.REPAIR) {\n repairCards.put(i, c);\n canRepair=true;\n }\n }\n if (c.type() == Card.Type.MAP) {\n// playMoves.addAll(generatePossibleMap(i));\n mapIndex = i;\n canSee = true;\n }\n if (c.type() == Card.Type.ROCKFALL) {\n destroyCards.put(i,c);\n// playMoves.addAll(generatePossibleRockfall(i));\n canRockfall = true;\n }\n discardMoves.add(Move.NewDiscardMove(index(), i));\n }\n\n if(canSee) {\n //sum of all heuristics\n double sumGoal[] = new double[3];\n for (Position h : reachable) {\n sumGoal[0]+=(9-(8-h.x)+ 5-(4-h.y));\n sumGoal[1]+=(9-(8-h.x)+ 5-(2-h.y));\n sumGoal[2]+=(9-(8-h.x)+ 5-(-h.y));\n }\n //update goldProb\n for(int i=0; i<3; i++) {\n int seenSum=0;\n for(int j=0; j<numPlayers; j++) {\n if(j!=myTurn) {\n if(haveSeen.get(j)[i]==1) seenSum++;\n }\n }\n goldProb[i] = (i==1?0.5:1)*(1-haveSeen.get(myTurn)[i])*(mapRate*(seenSum/numPlayers)+(sumGoal[i]/10));\n }\n }\n\n// System.out.println(hand());\n// System.out.println(pathMoves);\n\n\n if (role() == Role.GOLD_MINER) {\n //Path\n if(canSee && !goldFound) {\n int selection=0;\n double maxProb=goldProb[0];\n for(int i=0; i<3; i++) {\n if(goldProb[i]>maxProb) {\n maxProb = goldProb[i];\n selection=i;\n }\n }\n Move look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.TOP);\n switch(selection) {\n case 0:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.TOP);\n break;\n case 1:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.MIDDLE);\n break;\n case 2:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.BOTTOM);\n break;\n }\n return look;\n }\n if(canMove) {\n int globalIndex = 0;\n double maxH = 0;\n double oldH;\n Position bp = new Position(0,0);\n boolean rotate = false;\n //Find best path to place;\n Board board = game().board().copy();\n oldH = getClosest(board);\n// System.out.print(getClosest(board)+\" : \");\n for( Map.Entry<Integer, Card> p : pathCards.entrySet()) {\n int index = p.getKey();\n Card path = p.getValue();\n ((PathCard)path).setRotated(false);\n Set<Position> placeable = game().board().getPlaceable((PathCard)path);\n for (Position h : placeable) {\n Board simulated = board.simulatePlaceCardAt((PathCard)path, h.x, h.y);\n// System.out.println(path.type());\n double cH = getClosest(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n maxH = cH;\n rotate=false;\n }\n }\n ((PathCard) path).setRotated(true);\n placeable = game().board().getPlaceable((PathCard)path);\n for (Position h : placeable) {\n Board simulated = board.simulatePlaceCardAt((PathCard)path, h.x, h.y);\n// System.out.println(simulated);\n double cH = getClosest(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n rotate=true;\n maxH = cH;\n }\n }\n }\n// System.out.println(oldH+\": \"+maxH+\" (\"+abs(maxH-oldH)+\")\");\n oldBoard = game().board().copy();\n if(maxH>0 && abs(maxH-oldH)>0.01)\n return Move.NewPathMove(index(), globalIndex, bp.x, bp.y, rotate);\n }\n //Unblock\n if(canRepair) {\n double blockMore = 0.0;\n int targetPlayer = -1;\n int cardIndex = 0;\n for(int i=0; i<numPlayers; i++) {\n //heal self\n if(i == myTurn) {\n for(Map.Entry<Integer, Card> r : repairCards.entrySet()) {\n int index = r.getKey();\n// System.out.println(Arrays.toString(game().playerAt(index()).sabotaged()));\n PlayerActionCard repair = (PlayerActionCard) r.getValue();\n if (game().playerAt(index()).isRepairable(repair.effects())) {\n return Move.NewPlayerActionMove(index(),index, index());\n }\n }\n }\n else if(i!=myTurn) {\n for(Map.Entry<Integer, Card> r : repairCards.entrySet()) {\n int index = r.getKey();\n PlayerActionCard repair = (PlayerActionCard) r.getValue();\n// System.out.println(Arrays.toString(game().playerAt(i).sabotaged()));\n if (game().playerAt(i).isRepairable(repair.effects())) {\n //calculate the should i repair? function\n double shouldIBlockMore = Probability[i]+(0.03*(numPlayers-i));\n if(blockMore<shouldIBlockMore) {\n blockMore = shouldIBlockMore;\n targetPlayer = i;\n cardIndex = index;\n }\n }\n }\n }\n }\n if(blockMore>0.75 && targetPlayer>=0)\n return Move.NewPlayerActionMove(index(), cardIndex, targetPlayer);\n }\n //Block Enemy\n if(canBlock) {\n double blockMore = 0.0;\n int targetPlayer = -1;\n int cardIndex = 0;\n for (int i = 0; i < numPlayers; i++) {\n if (i != myTurn) {\n for (Map.Entry<Integer, Card> b : blockCards.entrySet()) {\n int index = b.getKey();\n PlayerActionCard block = (PlayerActionCard) b.getValue();\n if (game().playerAt(i).isSabotageable(block.effects()[0])) {\n //calculate the should i repair? function\n double shouldIBlockMore = (1 - Probability[i]) * ((1 - Probability[i]) + 0.2 * (numPlayers - i));\n if (blockMore < shouldIBlockMore) {\n blockMore = shouldIBlockMore;\n targetPlayer = i;\n cardIndex = index;\n }\n }\n }\n }\n }\n if(blockMore>0.6 && targetPlayer>=0)\n return Move.NewPlayerActionMove(index(), cardIndex, targetPlayer);\n }\n //Fix (Rockfall)\n if(canRockfall) {\n int globalIndex = 0;\n double maxH = 0.0;\n Position bp = new Position(0,0);\n //Find best path to place;\n Board board = game().board().copy();\n for( Map.Entry<Integer, Card> d : destroyCards.entrySet()) {\n int index = d.getKey();\n Set<Position> destroyable = game().board().getDestroyable();\n for (Position h : destroyable) {\n Board simulated = board.simulateRemoveCardAt(h.x, h.y);\n// System.out.println(path.type());\n double cH = getClosest(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n maxH = cH;\n }\n }\n }\n oldBoard = game().board().copy();\n if(maxH>0)\n return Move.NewRockfallMove(index(), globalIndex, bp.x, bp.y);\n }\n //See map\n\n //Conserve (Find the best card to discard)\n\n //calculate the heuristics and adjust accordingly,\n //choose between playing a card or discarding.\n } else if (role() == Role.SABOTEUR) {\n //See map\n if(canSee && !goldFound) {\n int selection=0;\n //specific for saboteurs\n double maxProb=goldProb[0];\n for(int i=0; i<3; i++) {\n if(goldProb[i]>maxProb) {\n maxProb = goldProb[i];\n selection=i;\n }\n }\n Move look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.TOP);\n switch(selection) {\n case 0:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.TOP);\n break;\n case 1:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.MIDDLE);\n break;\n case 2:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.BOTTOM);\n break;\n }\n return look;\n }\n //Path\n if(canMove) {\n int globalIndex = 0;\n double maxH = 0.0;\n Position bp = new Position(0,0);\n boolean rotate = false;\n //Find best path to place;\n Board board = game().board().copy();\n double oldH = getClosestSabotage(board);\n for( Map.Entry<Integer, Card> p : pathCards.entrySet()) {\n int index = p.getKey();\n Card path = p.getValue();\n ((PathCard)path).setRotated(false);\n Set<Position> placeable = game().board().getPlaceable((PathCard)path);\n for (Position h : placeable) {\n Board simulated = board.simulatePlaceCardAt((PathCard)path, h.x, h.y);\n// System.out.println(path.type());\n double cH = getClosestSabotage(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n maxH = cH;\n rotate=false;\n }\n }\n ((PathCard) path).setRotated(true);\n placeable = game().board().getPlaceable((PathCard)path);\n for (Position h : placeable) {\n Board simulated = board.simulatePlaceCardAt((PathCard)path, h.x, h.y);\n// System.out.println(simulated);\n double cH = getClosestSabotage(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n rotate=true;\n maxH = cH;\n }\n }\n }\n oldBoard = game().board().copy();\n if(maxH>0 && abs(maxH-oldH)>0.01)\n return Move.NewPathMove(index(), globalIndex, bp.x, bp.y, rotate);\n }\n //Unblock Friend\n if(canRepair) {\n double blockMore = 0.0;\n int targetPlayer = -1;\n int cardIndex = 0;\n for(int i=0; i<numPlayers; i++) {\n if(i == myTurn) {\n for(Map.Entry<Integer, Card> r : repairCards.entrySet()) {\n int index = r.getKey();\n PlayerActionCard repair = (PlayerActionCard) r.getValue();\n if (game().playerAt(myTurn).isRepairable(repair.effects())) {\n return Move.NewPlayerActionMove(index(),index, index());\n }\n }\n }\n else if(i!=myTurn) {\n for(Map.Entry<Integer, Card> r : repairCards.entrySet()) {\n int index = r.getKey();\n PlayerActionCard repair = (PlayerActionCard) r.getValue();\n if (game().playerAt(i).isRepairable(repair.effects())) {\n //calculate the should i repair? function\n double shouldIBlockMore = (1-Probability[i])+(0.03*(numPlayers-i));\n if(blockMore<shouldIBlockMore) {\n blockMore = shouldIBlockMore;\n targetPlayer = i;\n cardIndex = index;\n }\n }\n }\n }\n }\n if(blockMore>0.75 && targetPlayer>=0)\n return Move.NewPlayerActionMove(index(), cardIndex, targetPlayer);\n }\n //Block Enemy\n if(canBlock) {\n double blockMore = 0.0;\n int targetPlayer = -1;\n int cardIndex = 0;\n for (int i = 0; i < numPlayers; i++) {\n if (i != myTurn) {\n for (Map.Entry<Integer, Card> b : blockCards.entrySet()) {\n int index = b.getKey();\n PlayerActionCard block = (PlayerActionCard) b.getValue();\n if (game().playerAt(i).isSabotageable(block.effects()[0])) {\n //calculate the should i repair? function\n double shouldIBlockMore = (Probability[i]) * ((Probability[i]) + 0.2 * (numPlayers - i));\n if (blockMore < shouldIBlockMore) {\n blockMore = shouldIBlockMore;\n targetPlayer = i;\n cardIndex = index;\n }\n }\n }\n }\n }\n if(blockMore>0.6 && targetPlayer>=0)\n return Move.NewPlayerActionMove(index(), cardIndex, targetPlayer);\n }\n //Sabotage (Rockfall)\n if(canRockfall) {\n int globalIndex = 0;\n double maxH = 0;\n Position bp = new Position(0,0);\n //Find best path to place;\n Board board = game().board().copy();\n for( Map.Entry<Integer, Card> d : destroyCards.entrySet()) {\n int index = d.getKey();\n Set<Position> destroyable = game().board().getDestroyable();\n for (Position h : destroyable) {\n Board simulated = board.simulateRemoveCardAt(h.x, h.y);\n// System.out.println(path.type());\n double cH = getClosestSabotage(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n maxH = cH;\n }\n }\n }\n oldBoard = game().board().copy();\n if(maxH>0)\n return Move.NewRockfallMove(index(), globalIndex, bp.x, bp.y);\n }\n //Conserve (Find the best card to discard\n\n //calculate the heuristics and adjust accordingly,\n //choose between playing a card or discarding.\n }\n return discardMoves.get(0);\n }", "@Override\r\n public void doEdit ()\r\n throws DoEditException\r\n {\n List<StringWithProperties> criteria = probNet.getDecisionCriteria ();\r\n StringWithProperties criterion = null;\r\n switch (stateAction)\r\n {\r\n case ADD :\r\n if (criteria == null)\r\n {\r\n // agents = new StringsWithProperties();\r\n criteria = new ArrayList<StringWithProperties> ();\r\n }\r\n criterion = new StringWithProperties (criterionName);\r\n // agents.put(agentName);\r\n criteria.add (criterion);\r\n probNet.setDecisionCriteria2 (criteria);\r\n break;\r\n case REMOVE :\r\n for (StringWithProperties criterio : criteria)\r\n {\r\n if (criterio.getString ().equals (criterionName))\r\n {\r\n criterion = criterio;\r\n }\r\n }\r\n criteria.remove (criterion);\r\n // TODO assign criteria to node\r\n // it is also necessary to delete this criteria from the node it\r\n // was assigned to\r\n /*\r\n * if (criteria != null) { for (ProbNode node :\r\n * probNet.getProbNodes()) { if\r\n * (node.getVariable().getDecisionCriteria\r\n * ().getString().equals(criteriaName)) {\r\n * node.getVariable().setDecisionCriteria(null); } } }\r\n */\r\n if (criteria.size () == 0)\r\n {\r\n criteria = null;\r\n }\r\n probNet.setDecisionCriteria2 (criteria);\r\n break;\r\n case DOWN :\r\n // StringsWithProperties newAgentsDown = new\r\n // StringsWithProperties();\r\n ArrayList<StringWithProperties> newCriteriasDown = new ArrayList<StringWithProperties> ();\r\n for (int i = 0; i < dataTable.length; i++)\r\n {\r\n // newAgentsDown.put((String)dataTable[i][0]);\r\n newCriteriasDown.add (new StringWithProperties ((String) dataTable[i][0]));\r\n }\r\n probNet.setDecisionCriteria2 (newCriteriasDown);\r\n break;\r\n case UP :\r\n // StringsWithProperties newAgentsUp = new\r\n // StringsWithProperties();\r\n ArrayList<StringWithProperties> newCriteriasUp = new ArrayList<StringWithProperties> ();\r\n for (int i = 0; i < dataTable.length; i++)\r\n {\r\n // newAgentsUp.put((String)dataTable[i][0]);\r\n newCriteriasUp.add (new StringWithProperties ((String) dataTable[i][0]));\r\n }\r\n probNet.setDecisionCriteria2 (newCriteriasUp);\r\n break;\r\n case RENAME :\r\n // agents.rename(agentName, newName);\r\n // StringsWithProperties newAgentsRename = new\r\n // StringsWithProperties();\r\n ArrayList<StringWithProperties> newCriteriasRename = new ArrayList<StringWithProperties> ();\r\n for (int i = 0; i < dataTable.length; i++)\r\n {\r\n // newAgentsRename.put((String)dataTable[i][0]);\r\n newCriteriasRename.add (new StringWithProperties ((String) dataTable[i][0]));\r\n }\r\n probNet.setDecisionCriteria2 (newCriteriasRename);\r\n break;\r\n }\r\n }", "@Override\n public void exitState(FSMParser.StateContext ctx) {\n for (int i = 0; i < ctx.var_assign().size(); i++) {\n\n //find the variable\n FSMParser.Var_assignContext varAssign = ctx.var_assign(i);\n Var var = (Var) findComp(varAssign.var().NAME().getText());\n\n //find the int value that it is assigned to\n int num = Integer.parseInt(varAssign.var_assigment().integer().getText());\n this.assignments.put(var, num);\n //add that variable value pair to assignments hashmap\n }\n\n //find the statenumber and make the new state\n String temp = ctx.STATENUMBER().getText();\n int temp2 = Integer.parseInt(temp.substring(6, temp.length())); //starts at 6 to ignore 'State:'\n State state = new State(temp2, new HashMap<>(this.assignments), new HashMap<>(this.conditions.get(0))\n , new HashMap<>(this.conditions.get(1)), new ArrayList<>(this.conditionsOrder));\n this.states.add(state);\n //clear maps for new state\n this.assignments.clear();\n this.conditionsOrder.clear();\n this.conditions.get(0).clear();\n this.conditions.get(1).clear();\n\n\n }", "@Test\n public void testComplex() {\n\n Map<Integer, String> dict = new HashMap<>();\n dict.put(0, \"x1\");\n dict.put(1, \"x3\");\n dict.put(2, \"x5\");\n dict.put(3, \"x2\");\n dict.put(4, \"x4\");\n dict.put(5, \"x6\");\n\n Map<String, Integer> rdict = new HashMap<>();\n rdict.put(\"x1\", 0);\n rdict.put(\"x3\", 1);\n rdict.put(\"x5\", 2);\n rdict.put(\"x2\", 3);\n rdict.put(\"x4\", 4);\n rdict.put(\"x6\", 5);\n\n BddManager manager = new BddManager(6);\n manager.variableString((x) -> x < 6 ? dict.get(x) : \"sink\");\n\n BddNode a13 = manager.create(rdict.get(\"x6\"), manager.One, manager.Zero);\n BddNode a12 = manager.create(rdict.get(\"x4\"), manager.One, a13);\n BddNode a11 = manager.create(rdict.get(\"x4\"), manager.One, manager.Zero);\n BddNode a10 = manager.create(rdict.get(\"x2\"), manager.One, manager.Zero);\n BddNode a9 = manager.create(rdict.get(\"x2\"), manager.One, a13);\n BddNode a8 = manager.create(rdict.get(\"x2\"), manager.One, a11);\n BddNode a7 = manager.create(rdict.get(\"x2\"), manager.One, a12);\n BddNode a6 = manager.create(rdict.get(\"x5\"), a13, manager.Zero);\n BddNode a5 = manager.create(rdict.get(\"x5\"), a12, a11);\n BddNode a4 = manager.create(rdict.get(\"x5\"), a9, a10);\n BddNode a3 = manager.create(rdict.get(\"x5\"), a7, a8);\n BddNode a2 = manager.create(rdict.get(\"x3\"), a5, a6);\n BddNode a1 = manager.create(rdict.get(\"x3\"), a3, a4);\n BddNode a0 = manager.create(rdict.get(\"x1\"), a1, a2);\n\n Map<String, Boolean> truth = buildThruthTable(manager, a0);\n\n System.out.println(manager.toDot(a0, (x) -> \"x\" + x.index() + \" (\" + x.refCount() + \")\", true));\n\n BddNode res = manager.sifting(a0);\n\n System.out.println(manager.toDot(res, (x) -> \"x\" + x.index() + \" (\" + x.refCount() + \")\", true));\n\n checkThruthTable(truth, res);\n\n int size = manager.size(res);\n Assert.assertEquals(8, size);\n }", "public final void rule__XAssignment__ValueAssignment_0_3() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalDroneScript.g:17396:1: ( ( ruleXAssignment ) )\r\n // InternalDroneScript.g:17397:2: ( ruleXAssignment )\r\n {\r\n // InternalDroneScript.g:17397:2: ( ruleXAssignment )\r\n // InternalDroneScript.g:17398:3: ruleXAssignment\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXAssignmentAccess().getValueXAssignmentParserRuleCall_0_3_0()); \r\n }\r\n pushFollow(FOLLOW_2);\r\n ruleXAssignment();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXAssignmentAccess().getValueXAssignmentParserRuleCall_0_3_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "protected void assignmentOrIf(INestedIfElseClauseContainer upperIf) \r\n\t\t\tthrows InvalidProbabilityRangeException, \r\n\t\t\t\t TableFunctionMalformedException,\r\n\t\t\t\t SomeStateUndeclaredException,\r\n\t\t\t\t NoDefaultDistributionDeclaredException,\t// if-clause would eventually throw this\r\n\t\t\t\t InvalidConditionantException{\t\t\t// if-clause would eventually throw this\r\n\t\t\r\n\t\ttry {\r\n\t\t\tif (this.tokenLookAhead() == this.kwcode[this.lookup(\"IF\")]) {\r\n\t\t\t\t// this is an if-clause\r\n\t\t\t\tthis.ifStatement(upperIf);\r\n\t\t\t\t// an if-clause doesnt have do return something...\r\n\t\t\t} else {\r\n\t\t\t\t// since it is an assignment, we should check probability consistency as well\r\n\t\t\t\t\r\n\t\t\t\t// Consistency check C09\r\n\t\t\t\t// Structures that allow us to Verify if all states has probability declared\r\n\t\t\t\tList<Entity> declaredStates = new ArrayList<Entity>();\r\n\t\t\t\tList<Entity> possibleStates = null;\t\t\t\r\n\t\t\t\tif (this.node != null) {\r\n\t\t\t\t\tpossibleStates = this.node.getPossibleValueListIncludingEntityInstances();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.assignment(declaredStates, possibleStates);\r\n\t\t\t\t\r\n\r\n\t\t\t\tif (this.look == this.kwcode[this.lookup(\"IF\")]) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t// this is an if-clause after user-defined variable declaration\r\n\t\t\t\t\tthis.ifStatement(upperIf);\r\n\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// After the assignment, if there are undeclared states, distribute the remaining probability uniformly.\r\n\t\t\t\t\t// obtain undeclared states = possibleStates - declaredStates\r\n\t\t\t\t\tCollection<Entity> undeclaredStates = new HashSet<Entity>(possibleStates);\r\n\t\t\t\t\tundeclaredStates.removeAll(declaredStates);\r\n\t\t\t\t\tif (undeclaredStates.size() > 0) {\r\n\t\t\t\t\t\t// get the current (without the undeclared states) sum of probabilities\r\n\t\t\t\t\t\tfloat sumOfDeclaredProb = currentHeader.getProbCellSum();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// distribute the remaining probability (1-sumOfDeclaredProb) uniformly across the non-declared states\r\n\t\t\t\t\t\tfloat probOfUndeclaredState = (1f-sumOfDeclaredProb)/undeclaredStates.size();\r\n\t\t\t\t\t\tif (!isToNormalize() || (sumOfDeclaredProb >= 1)) {\r\n\t\t\t\t\t\t\t// if we don't need to normalize, then simply set all undeclared states to zero\r\n\t\t\t\t\t\t\tprobOfUndeclaredState = 0f;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tfor (Entity entity : undeclaredStates) {\r\n\t\t\t\t\t\t\tif (entity != null) {\r\n\t\t\t\t\t\t\t\t// distribute the remaining probability (1-retValue) uniformly across the non-declared states, but substitute NaN with 0\r\n\t\t\t\t\t\t\t\tif (this.getSSBNNode() != null) {\r\n\t\t\t\t\t\t\t\t\t// use a special type of cell which will recalculate the probability each time getProbabiity is called, by uniformly distributing 1-(probability of declared states)\r\n\t\t\t\t\t\t\t\t\tthis.currentHeader.addCell(new TempTableProbabilityCell(entity, new UniformComplementProbabilityValue(this.currentHeader, entity)));\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tthis.currentHeader.addCell(new TempTableProbabilityCell(entity, new SimpleProbabilityValue(Float.isNaN(probOfUndeclaredState)?0f:probOfUndeclaredState )));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t// the following may be irrelevant now, since we fill all undeclared states automatically anyway\r\n//\t\t\t\t\t\t\t\tdeclaredStates.add(entity);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// the following check may be irrelevant now, since we fill all undeclared states automatically anyway\r\n//\t\t\t\t\tif (this.node != null) {\r\n//\t\t\t\t\t\t// Consistency check C09\r\n//\t\t\t\t\t\t// Verify if all states has probability declared\r\n//\t\t\t\t\t\tif (!declaredStates.containsAll(possibleStates)) {\r\n//\t\t\t\t\t\t\tthrow new SomeStateUndeclaredException();\r\n//\t\t\t\t\t\t}\r\n//\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Consistency check C09\r\n\t\t\t\t\t// Verify if sum of all declared states' probability is 1\r\n\t\t\t\t\t\r\n\t\t\t\t\t// runtime probability bound check (on SSBN generation time)\r\n\t\t\t\t\tif (isToNormalize()\r\n\t\t\t\t\t\t\t&& this.currentHeader.getProbCellSum() < 0.99995\t// check if normalization of probabilities smaller than 1 worked\r\n\t\t\t\t\t\t\t) {\r\n\t\t\t\t\t\t// Debug.println(\"Testing cell's probability value's sum: \" + currentHeader.getProbCellSum());\r\n\t\t\t\t\t\tif (!Float.isNaN(this.currentHeader.getProbCellSum())) {\r\n\t\t\t\t\t\t\tthrow new InvalidProbabilityRangeException(getNode().toString());\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// Debug.println(\"=>NaN found!!!\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t} catch (ArrayIndexOutOfBoundsException e) {\r\n\t\t\t/* \r\n\t\t\t * catching ArrayIndexOutOfBoundsException means that the keyword \"IF\"\r\n\t\t\t * was not found the list of keywords. It is an horrible implementation error!!\r\n\t\t\t */\r\n\t\t\tthrow new RuntimeException(this.getResource().getString(\"FatalError\"),e);\r\n\t\t}\r\n\t\t\r\n\t\t// any other exception should not be treated by this scope (equivalent to \"catch(Exception e){throw e}\")\r\n\t\t\r\n\t}", "IntVar selectVariable(IntVar[] v) {\r\n\r\n if (v.length != 0) {\r\n int index = 0;\r\n int smallestDomain = Integer.MAX_VALUE;\r\n for(int i = 0; i< v.length-1; i++){\r\n if(v[i].domain.getSize()<smallestDomain){\r\n index = i;\r\n smallestDomain = v[i].domain.getSize();\r\n }\r\n\r\n }\r\n if(v[index].min() == v[index].max()){\r\n\r\n searchVariables = new IntVar[v.length-1];\r\n for (int i = 0; i < v.length-1; i++) {\r\n if(i<index){\r\n searchVariables[i] = v[i];\r\n }\r\n else searchVariables[i] = v[i+1];\r\n\r\n }\r\n }\r\n else{\r\n searchVariables = new IntVar[v.length];\r\n for(int i = 0; i < v.length; i++){\r\n searchVariables[i] = v[i];\r\n }\r\n }\r\n return v[index];\r\n\r\n }\r\n else {\r\n System.err.println(\"Zero length list of variables for labeling\");\r\n return new IntVar(store);\r\n }\r\n }", "protected abstract boolean makeDecision (Map<Key, Object> context);", "private void setupAssociatedBranchesAType(Map<Integer, Double> inputBranchWithJ)\r\n\t{\r\n\t\tgetOppositeParityEnergies(currentK);\r\n\t\tArrayList<Map<Integer, Double>> branches = new ArrayList<Map<Integer, Double>>();\r\n\t\tint jOffset = 0;\r\n\r\n\t\tif (IS_EVEN_SELECTION_RULES) {\r\n\t\t\tif (INPUT_BRANCH_TYPE.equals(\"Q\")) {\r\n\t\t\t\tcalculateUpperEnergiesLevelsWithJ(inputBranchWithJ, jOffset);\r\n\t\t\t\t\r\n\t\t\t\tif (currentK >= 0) {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedR, -1, 1, 0, -1, true, false);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedP, 1, -1, 1, 0, false, true);\r\n\t\t\t\t\tbranches.add(associatedP);\r\n\t\t\t\t\tbranches.add(associatedR);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"P-<-\", \"R-<-\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedR, -1, 1, 0, -1, false, true);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedP, 1, -1, 1, 0, true, false);\r\n\t\t\t\t\tbranches.add(associatedP);\r\n\t\t\t\t\tbranches.add(associatedR);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"P+<+\", \"R+<+\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (INPUT_BRANCH_TYPE.equals(\"R\")) {\r\n\t\t\t\tjOffset = 1;\r\n\t\t\t\tcalculateUpperEnergiesLevelsWithJ(inputBranchWithJ, jOffset);\r\n\r\n\t\t\t\tif (currentK >= 0) {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedQ, 1, -1, 1, 0, false, true);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedP, 2, -1, 2, 0, true, true);\r\n\t\t\t\t\tbranches.add(associatedQ);\r\n\t\t\t\t\tbranches.add(associatedP);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"Q+<-\", \"P+<+\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedQ, 1, -1, 1, 0, true, false);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedP, 2, -1, 2, 0, false, false);\r\n\t\t\t\t\tbranches.add(associatedQ);\r\n\t\t\t\t\tbranches.add(associatedP);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"Q-<+\", \"P-<-\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (INPUT_BRANCH_TYPE.equals(\"P\")) {\r\n\t\t\t\tjOffset = -1;\r\n\t\t\t\tcalculateUpperEnergiesLevelsWithJ(inputBranchWithJ, jOffset);\r\n\r\n\t\t\t\tif (currentK >= 0) {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedQ, -1, 1, 0, -1, true, false);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedR, -2, 1, 0, -2, true, true);\r\n\t\t\t\t\tbranches.add(associatedQ);\r\n\t\t\t\t\tbranches.add(associatedR);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"Q+<-\", \"R+<+\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedQ, -1, 1, 0, -1, false, true);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedR, -2, 1, 0, -2, false, false);\r\n\t\t\t\t\tbranches.add(associatedQ);\r\n\t\t\t\t\tbranches.add(associatedR);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"Q-<+\", \"R-<-\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\telse {\r\n\t\t\tif (INPUT_BRANCH_TYPE.equals(\"Q\")) {\r\n\t\t\t\tcalculateUpperEnergiesLevelsWithJ(inputBranchWithJ, jOffset);\r\n\t\t\t\t\r\n\t\t\t\tif (currentK >= 0) {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedR, -1, 1, 0, -1, true, false);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedP, 1, -1, 1, 0, false, true);\r\n\t\t\t\t\tbranches.add(associatedP);\r\n\t\t\t\t\tbranches.add(associatedR);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"P+<-\", \"R+<-\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedR, -1, 1, 0, -1, false, true);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedP, 1, -1, 1, 0, true, false);\r\n\t\t\t\t\tbranches.add(associatedP);\r\n\t\t\t\t\tbranches.add(associatedR);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"P-<+\", \"R-<+\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (INPUT_BRANCH_TYPE.equals(\"R\")) {\r\n\t\t\t\tjOffset = 1;\r\n\t\t\t\tcalculateUpperEnergiesLevelsWithJ(inputBranchWithJ, jOffset);\r\n\r\n\t\t\t\tif (currentK >= 0) {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedQ, 1, -1, 1, 0, false, true);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedP, 2, -1, 2, 0, true, true);\r\n\t\t\t\t\tbranches.add(associatedQ);\r\n\t\t\t\t\tbranches.add(associatedP);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"Q-<-\", \"P-<+\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedQ, 1, -1, 1, 0, true, false);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedP, 2, -1, 2, 0, false, false);\r\n\t\t\t\t\tbranches.add(associatedQ);\r\n\t\t\t\t\tbranches.add(associatedP);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"Q+<+\", \"P+<-\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (INPUT_BRANCH_TYPE.equals(\"P\")) {\r\n\t\t\t\tjOffset = -1;\r\n\t\t\t\tcalculateUpperEnergiesLevelsWithJ(inputBranchWithJ, jOffset);\r\n\t\t\t\t\r\n\t\t\t\tif (currentK >= 0) {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedQ, -1, 1, 0, -1, true, false);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedR, -2, 1, 0, -2, true, true);\r\n\t\t\t\t\tbranches.add(associatedQ);\r\n\t\t\t\t\tbranches.add(associatedR);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"Q-<-\", \"R-<+\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedQ, -1, 1, 0, -1, false, true);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedR, -2, 1, 0, -2, false, false);\r\n\t\t\t\t\tbranches.add(associatedQ);\r\n\t\t\t\t\tbranches.add(associatedR);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"Q+<+\", \"R+<-\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (TRANSITION_TYPE.equals(\"b-type\")) {\r\n\t\t\t//The 2 and -2 represent \"get lower energies with K +2 / -2 offset from the current K value, if it exists\"\r\n\t\t\tsetupTriangularTypes(2);\r\n\t\t\tsetupTriangularTypes(-2);\r\n\t\t}\r\n\t}", "private void constructBuiltinAtom(String name, String operator, String value, OWLDatatype od, Set<SWRLAtom> antecedent) {\n if (!TextUtils.isBlank(value) && !TextUtils.isBlank(operator)) {\n if (od == null) {\n SWRLIArgument ind = factory.getSWRLIndividualArgument(ontologyOWLNamedIndividualVocabulary.get(TextUtil.formatName(value)));\n SWRLIArgument variable = factory.getSWRLIndividualArgument(factory.getOWLNamedIndividual(IRI.create(manager.getOntologyDocumentIRI(domainOntology) + \"#\" + literalVocabulary.get(name))));\n\n switch (operator) {\n case \"equal\": {\n SWRLSameIndividualAtom sameInd = factory.getSWRLSameIndividualAtom(ind, variable);\n antecedent.add(sameInd);\n break;\n }\n case \"notEqual\": {\n SWRLDifferentIndividualsAtom diffInd = factory.getSWRLDifferentIndividualsAtom(ind, variable);\n antecedent.add(diffInd);\n break;\n }\n }\n } else {\n SWRLVariable var2 = factory.getSWRLVariable(IRI.create(manager.getOntologyDocumentIRI(domainOntology) + \"#\" + literalVocabulary.get(name)));\n OWLLiteral lit = factory.getOWLLiteral(value, od);\n SWRLLiteralArgument litArg = factory.getSWRLLiteralArgument(lit);\n List<SWRLDArgument> list = new ArrayList<>();\n list.add(var2);\n list.add(litArg);\n\n switch (operator) {\n case \"equal\": {\n SWRLBuiltInAtom builtins = factory.getSWRLBuiltInAtom(SWRLBuiltInsVocabulary.EQUAL.getIRI(), list);\n antecedent.add(builtins);\n break;\n }\n case \"notEqual\": {\n SWRLBuiltInAtom builtins = factory.getSWRLBuiltInAtom(SWRLBuiltInsVocabulary.NOT_EQUAL.getIRI(), list);\n antecedent.add(builtins);\n break;\n }\n case \"lessThan\": {\n SWRLBuiltInAtom builtins = factory.getSWRLBuiltInAtom(SWRLBuiltInsVocabulary.LESS_THAN.getIRI(), list);\n antecedent.add(builtins);\n break;\n }\n case \"lessOrEqual\": {\n SWRLBuiltInAtom builtins = factory.getSWRLBuiltInAtom(SWRLBuiltInsVocabulary.LESS_THAN_OR_EQUAL.getIRI(), list);\n antecedent.add(builtins);\n break;\n }\n case \"greaterThan\": {\n SWRLBuiltInAtom builtins = factory.getSWRLBuiltInAtom(SWRLBuiltInsVocabulary.GREATER_THAN.getIRI(), list);\n antecedent.add(builtins);\n break;\n }\n case \"greaterOrEqual\": {\n SWRLBuiltInAtom builtins = factory.getSWRLBuiltInAtom(SWRLBuiltInsVocabulary.GREATER_THAN_OR_EQUAL.getIRI(), list);\n antecedent.add(builtins);\n break;\n }\n }\n }\n }\n }", "private DoubleBinaryOperator chooseOperator() {\n\t\tswitch(name) {\n\t\tcase \"+\":\n\t\t\treturn ADD;\n\t\t\t\n\t\tcase \"-\":\n\t\t\treturn SUB;\n\t\t\t\n\t\tcase \"*\":\n\t\t\treturn MULTIPLY;\n\t\t\t\n\t\tcase \"/\":\n\t\t\treturn DIVIDE;\n\t\t\t\n\t\tcase \"x^n\":\n\t\t\treturn POW;\n\t\t\t\n\t\tdefault:\n\t\t\tthrow new IllegalStateException(\"Invalid binary operator\");\n\t\t}\n\t}", "protected Assign assign(Position pos, Expr e, Assign.Operator asgn, Expr val) throws SemanticException {\n Assign a = (Assign) xnf.Assign(pos, e, asgn, val).type(e.type());\n if (a instanceof FieldAssign) {\n assert (e instanceof Field);\n assert ((Field) e).fieldInstance() != null;\n a = ((FieldAssign) a).fieldInstance(((Field)e).fieldInstance());\n } else if (a instanceof SettableAssign) {\n assert (e instanceof X10Call);\n X10Call call = (X10Call) e;\n List<Expr> args = CollectionUtil.append(Collections.singletonList(val), call.arguments());\n X10Call n = xnf.X10Call(pos, call.target(), nf.Id(pos, SettableAssign.SET), call.typeArguments(), args);\n n = (X10Call) n.del().disambiguate(this).typeCheck(this).checkConstants(this);\n X10MethodInstance smi = n.methodInstance();\n X10MethodInstance ami = call.methodInstance();\n // List<Type> aTypes = new ArrayList<Type>(ami.formalTypes());\n // aTypes.add(0, ami.returnType()); // rhs goes before index\n // MethodInstance smi = xts.findMethod(ami.container(),\n // xts.MethodMatcher(ami.container(), SET, aTypes, context));\n a = ((SettableAssign) a).methodInstance(smi);\n a = ((SettableAssign) a).applyMethodInstance(ami);\n }\n return a;\n }", "private String processStatement() {\n StringBuilder result = new StringBuilder();\n //If the line is an instantiation or assignment statement\n if(line.contains(\"=\")) {\n //We get the parts of string before and after the '=' sign.\n String[] parts = line.split(\"=\");\n //Now we get the first and second part in separate strings.\n String firstPart = parts[0].trim();\n String secondPart = parts[1].trim();\n //Remove unnecessary spaces from the first part of the line.\n firstPart = removeUnnecessarySpaces(firstPart);\n //Split the parts further into single words.\n String[] firstPartWords = firstPart.split(\"\\\\s+\");\n\n //Now, process the first part of the line\n for(int i=0; i<firstPartWords.length; i++) {\n String word = firstPartWords[i];\n //Boolean value to check if this word is the last word\n boolean isLast = i==firstPartWords.length-1;\n //Now process each word\n processWordInFirstPart(word, result, isLast);\n }\n\n //Boolean value to check if this statement has anything to\n //do with objects. If secondPart contains 'new'.\n boolean relatedWithObject = secondPart.contains(\"new \");\n //Now adjust the value of secondPart for assigning.\n secondPart = secondPart.replace(\"new\", \"\");\n secondPart = secondPart.trim();\n\n //Now we have the result after processing the first part of\n //this statement.\n //If there are no spaces in the firstPart string, then this\n //is an assignment statement.\n if(firstPart.indexOf(' ')==-1) {\n if(relatedWithObject) {\n //If the second part of the string contains square and not round\n //brackets, this is not an object but an array.\n if(!secondPart.contains(\"(\") && secondPart.contains(\"[\"))\n result.insert(0,\"The array \").append(\" is initialized to value \").\n append(secondPart);\n //Else, this is obviously an object.\n else\n result.insert(0, \"The object \").append(\" is initialized to value \").\n append(secondPart);\n }\n else {\n //Now, we format the assignment statement.\n //Since there can be more than one assignments in the same\n //line, we add all the parts.\n //Here, \\u2190 is the left arrow in UTF-8.\n char arrow = '\\u2190';\n parts = line.split(\"\\\\s+\");\n result = new StringBuilder();\n for(String part : parts) {\n if(part.equals(\"=\")) {\n result.append(arrow).append(\" \");\n }\n else {\n result.append(part).append(\" \");\n }\n }\n }\n }\n //If this statement is not an assignment statement, then this\n //is an initialization statement.\n else {\n if(relatedWithObject) {\n result.append(\" is created with value \").append(secondPart).append(\".\");\n }\n //If the second part (the value) has something to do\n //with arrays, and not objects.\n else if(hasArrayAsMajorValue(secondPart)) {\n //Then process the second part according to array values.\n result.append(\" is instantiated to value in \").append(processArrayValue(secondPart));\n }\n else {\n result.append(\" is instantiated to value \").append(secondPart).append(\".\");\n }\n }\n }\n //If line does not contain \"=\" sign.\n else {\n //Incrementing statement.\n if(line.contains(\"++\")) {\n int index = line.indexOf('+');\n String variable = line.substring(0,index);\n result.append(\"Variable \").append(variable).append(\" is Incremented.\");\n }\n //Decrementing statement.\n else if(line.contains(\"--\")) {\n int index = line.indexOf('-');\n String variable = line.substring(0,index);\n result.append(\"Variable \").append(variable).append(\" is Decremented.\");\n }\n //If line has a dot operator, it means this line calls a function.\n else if(line.contains(\".\")) {\n String[] parts = line.split(\"\\\\.\");\n String object = parts[0].trim();\n String method = parts[1].trim();\n result.append(\"The function \").append(method).append(\" from object \").\n append(object).append(\" is called.\");\n if(parts.length>2) {\n result = new StringBuilder();\n result.append(removeUnnecessarySpaces(line)).append(\" is performed respectively.\");\n }\n }\n //If the line contains a bracket, it is calling a member method.\n else if(line.contains(\"(\")) {\n result.append(\"The member method \").append(line).append(\" is called.\");\n }\n else {\n String[] words = line.split(\"\\\\s+\");\n for(int i=0; i<words.length; i++) {\n String word = words[i];\n boolean isLast = i==words.length-1;\n processWordInFirstPart(word, result, isLast);\n }\n result.append(\" is declared.\");\n }\n }\n return result.toString();\n }", "public void assign() {\n\t\tfinal RandomAccess<U> accessor = img.randomAccess();\n\t\tfinal V output = function.createOutput();\n\t\tINPUT input = null;\n\t\twhile (iter.hasNext()) {\n\t\t\tinput = iter.next(input);\n\t\t\tboolean proceed = (condition == null) || (condition.isTrue(input));\n\t\t\tif (proceed) {\n\t\t\t\tfunction.compute(input, output);\n\t\t\t\taccessor.setPosition(iter.getCurrentPoint());\n\t\t\t\taccessor.get().setReal(output.getRealDouble());\n\t\t\t\taccessor.get().setImaginary(output.getImaginaryDouble());\n\t\t\t\t// FIXME\n\t\t\t\t// Note - for real datasets this imaginary assignment may waste cpu\n\t\t\t\t// cycles. Perhaps it can get optimized away by the JIT. But maybe not\n\t\t\t\t// since the type is not really known because this class is really\n\t\t\t\t// constructed from a raw type. We'd need to test how the JIT handles\n\t\t\t\t// this situation. Note that in past incarnations this class used\n\t\t\t\t// assigner classes. The complex version set R & I but the real\n\t\t\t\t// version just set R. We could adopt that approach once again.\n\t\t\t}\n\t\t}\n\t}", "public static boolean assignment(PsiBuilder builder_, int level_) {\n if (!recursion_guard_(builder_, level_, \"assignment\")) return false;\n boolean result_ = false;\n boolean pinned_ = false;\n Marker marker_ = enter_section_(builder_, level_, _NONE_, \"<assignment>\");\n result_ = object_path(builder_, level_ + 1);\n result_ = result_ && consumeToken(builder_, ASSIGNMENT_OPERATOR);\n pinned_ = result_; // pin = 2\n result_ = result_ && assignment_2(builder_, level_ + 1);\n exit_section_(builder_, level_, marker_, ASSIGNMENT, result_, pinned_, null);\n return result_ || pinned_;\n }", "public final void rule__PredicateComparison__Group_1__1__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:3979:1: ( ( ( rule__PredicateComparison__OpAssignment_1_1 ) ) )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:3980:1: ( ( rule__PredicateComparison__OpAssignment_1_1 ) )\n {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:3980:1: ( ( rule__PredicateComparison__OpAssignment_1_1 ) )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:3981:1: ( rule__PredicateComparison__OpAssignment_1_1 )\n {\n before(grammarAccess.getPredicateComparisonAccess().getOpAssignment_1_1()); \n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:3982:1: ( rule__PredicateComparison__OpAssignment_1_1 )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:3982:2: rule__PredicateComparison__OpAssignment_1_1\n {\n pushFollow(FOLLOW_rule__PredicateComparison__OpAssignment_1_1_in_rule__PredicateComparison__Group_1__1__Impl7829);\n rule__PredicateComparison__OpAssignment_1_1();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getPredicateComparisonAccess().getOpAssignment_1_1()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public Integer visitAssign(ExprParser.AssignContext ctx) {\n String id = ctx.ID().getText();\n int value = visit(ctx.expr());\n memory.put(id, value);\n return value;\n }", "public Decision planBest(Context context, Decision defaultDecision);", "private void intervalsToPTreeCredalSet(PotentialInterval intervalSet,ProbabilityTree probTree,\n Configuration conf,int nvar){\n Vector vars=intervalSet.getVariables();\n \n if(nvar<vars.size()){ // make the top part of the tree with variables in X_I\n FiniteStates currentVar=(FiniteStates)vars.elementAt(nvar);\n int ncases=currentVar.getNumStates();\n probTree.assignVar(currentVar);\n conf.insert(currentVar, 0);\n for(int i=0;i<ncases;i++){\n conf.putValue(currentVar,i);\n intervalsToPTreeCredalSet(intervalSet,probTree.getChild(i),conf,nvar+1);\n }\n } // end if\n else{\n FiniteStates conditionalVar=(FiniteStates)(intervalSet.getVariables().elementAt(0));\n PotentialInterval intervalSetRestricted = (PotentialInterval)intervalSet.restrictVariable(conf);\n Vector extremePoints=intervalSetRestricted.getListExtrems();\n int nExtrems=extremePoints.size();\n FiniteStates transp=appendTransparentVariable(nExtrems);\n int ncases=conditionalVar.getNumStates();\n \n probTree.assignVar(transp);\n for(int i=0;i<nExtrems;i++){\n double array[]=(double [])(extremePoints.elementAt(i));\n probTree.getChild(i).assignVar(conditionalVar);\n for(int j=0;j<ncases;j++){\n probTree.getChild(i).getChild(j).assignProb(array[j]);\n }\n }\n } // end else\n }", "private Operator findOperatorToResolve(Predicate predToResolve) throws Exception {\n\t\tfor (Operator op : this.operators) {\n\t\t\tOperator opCopy = op.getClass().newInstance();\n\t\t\tfor (Predicate predCandidate : opCopy.getAdd().toList()) {\n\t\t\t\tif (predCandidate.isCompatibleTo(predToResolve)) {\n\t\t\t\t\t// instantiate opCopy with predToResolve\n\t\t\t\t\tfor (int i = 0; i < predToResolve.getValence(); i++) {\n\t\t\t\t\t\tif (!predCandidate.getArgument(i).isInstantiated()) {\n\t\t\t\t\t\t\tpredCandidate.getArgument(i).instantiate(predToResolve.getArgument(i).getValue());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn opCopy;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\tthrow new RuntimeException(\"There was no operator found to resolve a predicate. There is no possible plan.\");\n\t}", "protected IDecisionVariable getVariable() {\n return variable;\n }", "public interface TypedComponentAssignment<V> {\n V getAssignedValue ();\n void setAssignedValue (V value);\n}", "Assign createAssign();", "@Override\n protected void doAlgorithmA1() {\n int xP = 0;\n int yP = 0;\n\n\n //Taking the variable out of the list that are in the bounds\n //Testing that the bound has variables\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n xP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX().getPosition();\n }\n int xU = 0;\n int xL = 0;\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n yP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY().getPosition();\n }\n int yU = 0;\n int yL = 0;\n int cright = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCright();\n int cleft = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCleft();\n\n\n\n for (Variable variable : csp.getVars()) {\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n if (variable.getPosition() == xP) {\n xU = variable.getUpperDomainBound();\n xL = variable.getLowerDomainBound();\n }\n }\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n if (variable.getPosition() == yP) {\n yU = variable.getUpperDomainBound();\n yL = variable.getLowerDomainBound();\n }\n }\n }\n\n boolean first = false;\n boolean second = false;\n\n //Testing if the bound is true, false or inconclusive\n\n if (xL + cleft >= yU + cright) {\n first = true;\n }\n if (xU + cleft < yL + cright) {\n second = true;\n }\n\n //are first and second not equal is the bound not inconclusive\n if (first != second) {\n if (first) { //a true Simple Bound was found\n //checks if it was the last constraint in a csp\n //If so the csp is true\n //else check the next constraint and do this method again\n if (csp.getSimpleConstraints().size() - 1 == cIndex) {\n System.out.println(\"P is satisfiable\");\n System.out.println(System.nanoTime()-startTime);\n return;\n } else {\n bIndex = 0;\n cIndex++;\n unit=false;\n doAlgorithmA1();\n }\n } else if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) { //a false Simple Bound was found\n //\n bIndex = 0;\n cIndex = 0;\n if (isInconclusive) {\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n doAlgorithmA2();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n } else {//an inconclusive Simple Bound was found\n //checks if the bound wasn't already inconclusive\n if(!isInconclusive){\n unit=true;\n unitSB = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex);\n }else {\n unit=false;\n }\n isInconclusive = true;\n\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) {\n cIndex = 0;\n bIndex = 0;\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n }\n }", "public final void rule__XSwitchExpression__DefaultAssignment_5_2() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalDroneScript.g:18308:1: ( ( ruleXExpression ) )\r\n // InternalDroneScript.g:18309:2: ( ruleXExpression )\r\n {\r\n // InternalDroneScript.g:18309:2: ( ruleXExpression )\r\n // InternalDroneScript.g:18310:3: ruleXExpression\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXSwitchExpressionAccess().getDefaultXExpressionParserRuleCall_5_2_0()); \r\n }\r\n pushFollow(FOLLOW_2);\r\n ruleXExpression();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXSwitchExpressionAccess().getDefaultXExpressionParserRuleCall_5_2_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "@Test\r\n public void deriveFromAndAssignmentExpressionWithSIUnits() throws IOException {\n check(\"varI_M&=9\", \"(int,m)\");\r\n //example with long m &= int\r\n check(\"varL_KMe2perH&=9\", \"(long,km^2/h)\");\r\n }" ]
[ "0.6307793", "0.58135945", "0.57461715", "0.56529677", "0.55622643", "0.5556349", "0.55516815", "0.54682255", "0.5460991", "0.5388767", "0.5376197", "0.5307139", "0.52690524", "0.5233299", "0.5212639", "0.5168921", "0.51659596", "0.5161488", "0.5108355", "0.50666404", "0.5030831", "0.5030382", "0.5026864", "0.49854895", "0.49849707", "0.49793655", "0.4974543", "0.49722704", "0.49565038", "0.49381408", "0.49283695", "0.4922349", "0.49032262", "0.48821908", "0.48682627", "0.48523495", "0.48277554", "0.4810038", "0.48087364", "0.47880542", "0.47783545", "0.47765878", "0.4764797", "0.47620434", "0.47603658", "0.47527125", "0.47527125", "0.47468063", "0.47435197", "0.47367126", "0.47256675", "0.47137856", "0.47034746", "0.46877834", "0.46857232", "0.4672135", "0.46660742", "0.4654278", "0.46473113", "0.46459687", "0.4643414", "0.46390784", "0.4635388", "0.46220016", "0.46195292", "0.46066567", "0.46014643", "0.45997566", "0.4592528", "0.45877895", "0.45866662", "0.45806548", "0.4572064", "0.45701483", "0.45635036", "0.4562667", "0.45619756", "0.45616582", "0.45601293", "0.45582345", "0.45553508", "0.4554893", "0.45522273", "0.45451397", "0.45437458", "0.45389596", "0.45331067", "0.45293227", "0.45263493", "0.45255917", "0.4525206", "0.4524761", "0.45210332", "0.4516269", "0.4515039", "0.45064324", "0.45058894", "0.4503862", "0.45004407", "0.44987652" ]
0.4629025
63
Create a search strategy which selects the variables to branch on with VAR_SELECTOR, then select the value closest to the middle value of its domain, and split its domain into two intervals (binary decisions will be used). If LOWERFIRST is set to true, the domain is restricted to the left interval first. If LOWERFIRST is set to false, the domain is restricted to the right interval first.
public static IntStrategy dichotomic(VariableSelector<IntVar> VAR_SELECTOR, boolean LOWERFIRST, IntVar... VARS){ if(LOWERFIRST){ return custom(VAR_SELECTOR, ISF.mid_value_selector(LOWERFIRST), DecisionOperator.int_split, VARS); }else{ return custom(VAR_SELECTOR, ISF.mid_value_selector(LOWERFIRST), DecisionOperator.int_reverse_split, VARS); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setComparedHeuristics (VariableSelector variableSelector, IntValueSelector valueOrder){\n\t\tIntValueSelector valueSelector = valueOrder;\n\t\t\n\t \n\t\tkb.getModelKB().getSolver().setSearch(Search.intVarSearch(\n \n\t\t\t\tvariableSelector,\n // selects the smallest domain value (lower bound)\n\t\t\t\t \n\t\t\t\tvalueSelector,\n \n // variables to branch on\n\t\t\t\tkb.getVars()\n\t\t));\n\t\t\n\t}", "public static IntStrategy minDom_LB(IntVar... VARS) {\n return custom(minDomainSize_var_selector(), min_value_selector(), VARS);\n }", "IntVar selectVariable(IntVar[] v) {\r\n\r\n if (v.length != 0) {\r\n int index = 0;\r\n int smallestDomain = Integer.MAX_VALUE;\r\n for(int i = 0; i< v.length-1; i++){\r\n if(v[i].domain.getSize()<smallestDomain){\r\n index = i;\r\n smallestDomain = v[i].domain.getSize();\r\n }\r\n\r\n }\r\n if(v[index].min() == v[index].max()){\r\n\r\n searchVariables = new IntVar[v.length-1];\r\n for (int i = 0; i < v.length-1; i++) {\r\n if(i<index){\r\n searchVariables[i] = v[i];\r\n }\r\n else searchVariables[i] = v[i+1];\r\n\r\n }\r\n }\r\n else{\r\n searchVariables = new IntVar[v.length];\r\n for(int i = 0; i < v.length; i++){\r\n searchVariables[i] = v[i];\r\n }\r\n }\r\n return v[index];\r\n\r\n }\r\n else {\r\n System.err.println(\"Zero length list of variables for labeling\");\r\n return new IntVar(store);\r\n }\r\n }", "public SelectorForNumber[] divide(double divider) {\n SelectorForNumber[] result = new SelectorForNumber[2];\n switch(type) {\n case ALL_VALUES: {\n result[0] = getSelLE(attributeId, divider - delta);\n result[1] = getSelGT(attributeId, divider);\n break;\n }\n case BELONGS_RIGHT_INCLUDING: {\n if (divider == lowerLimit) {\n result[0] = null;\n result[1] = this;\n }\n else {\n if (divider > lowerLimit) {\n if (divider == upperLimit) {\n result[0] = getSelBelongs(attributeId, lowerLimit, divider - delta);\n result[1] = null;\n }\n else if (divider > upperLimit) {\n result[0] = this;\n result[1] = null;\n }\n else {\n // lowerLimit < divider < upperLimit\n result[0] = getSelBelongs(attributeId, lowerLimit, divider - delta);\n result[1] = getSelBelongs(attributeId, divider, upperLimit);\n }\n }\n else {\n // divider < lowerLimit\n result[0] = null;\n result[1] = this;\n }\n }\n break;\n }\n case EQUAL: {\n if (divider == lowerLimit)\n result[0] = this;\n break;\n }\n case GREATER_THAN: {\n if (divider == lowerLimit) {\n result[0] = null;\n result[1] = this;\n }\n else if (divider > lowerLimit) {\n result[0] = getSelBelongs(attributeId, lowerLimit, divider - delta);\n result[1] = getSelGT(attributeId, divider);\n }\n // else -> divider < lowerLimit, so there's no selector to return;\n break;\n }\n case LOWER_OR_EQUAL: {\n if (divider == upperLimit) {\n result[0] = getSelLE(attributeId, divider - delta);\n result[1] = null;\n }\n else if (divider < upperLimit) {\n result[0] = getSelLE(attributeId, divider - delta);\n result[1] = getSelBelongs(attributeId, divider, upperLimit);\n } \n // else -> divider > lowerLimit, so there's no selector to return;\n break;\n }\n case NONE_VALUE: { // Nothing to return.\n break;\n }\n }\n return result;\n }", "public static IntStrategy minDom_MidValue(boolean floor, IntVar... VARS) {\n return custom(minDomainSize_var_selector(), mid_value_selector(floor), VARS);\n }", "public static IntStrategy lexico_Neq_LB(IntVar... VARS) {\n return custom(lexico_var_selector(), min_value_selector(), remove(), VARS);\n }", "public static VariableSelector<IntVar> minDomainSize_var_selector() {\n return new FirstFail();\n }", "@Override\n protected void doAlgorithmA1() {\n int xP = 0;\n int yP = 0;\n\n\n //Taking the variable out of the list that are in the bounds\n //Testing that the bound has variables\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n xP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX().getPosition();\n }\n int xU = 0;\n int xL = 0;\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n yP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY().getPosition();\n }\n int yU = 0;\n int yL = 0;\n int cright = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCright();\n int cleft = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCleft();\n\n\n\n for (Variable variable : csp.getVars()) {\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n if (variable.getPosition() == xP) {\n xU = variable.getUpperDomainBound();\n xL = variable.getLowerDomainBound();\n }\n }\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n if (variable.getPosition() == yP) {\n yU = variable.getUpperDomainBound();\n yL = variable.getLowerDomainBound();\n }\n }\n }\n\n boolean first = false;\n boolean second = false;\n\n //Testing if the bound is true, false or inconclusive\n\n if (xL + cleft >= yU + cright) {\n first = true;\n }\n if (xU + cleft < yL + cright) {\n second = true;\n }\n\n //are first and second not equal is the bound not inconclusive\n if (first != second) {\n if (first) { //a true Simple Bound was found\n //checks if it was the last constraint in a csp\n //If so the csp is true\n //else check the next constraint and do this method again\n if (csp.getSimpleConstraints().size() - 1 == cIndex) {\n System.out.println(\"P is satisfiable\");\n System.out.println(System.nanoTime()-startTime);\n return;\n } else {\n bIndex = 0;\n cIndex++;\n unit=false;\n doAlgorithmA1();\n }\n } else if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) { //a false Simple Bound was found\n //\n bIndex = 0;\n cIndex = 0;\n if (isInconclusive) {\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n doAlgorithmA2();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n } else {//an inconclusive Simple Bound was found\n //checks if the bound wasn't already inconclusive\n if(!isInconclusive){\n unit=true;\n unitSB = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex);\n }else {\n unit=false;\n }\n isInconclusive = true;\n\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) {\n cIndex = 0;\n bIndex = 0;\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n }\n }", "public static IntStrategy minDom_UB(IntVar... VARS) {\n return custom(minDomainSize_var_selector(), max_value_selector(), VARS);\n }", "public static IntStrategy lexico_Split(IntVar... VARS) {\n return dichotomic(ISF.lexico_var_selector(), true, VARS);\n }", "public static VariableSelector<IntVar> lexico_var_selector() {\n return new InputOrder<>();\n }", "public static IntStrategy maxDom_Split(IntVar... VARS) {\n return dichotomic(maxDomainSize_var_selector(), true, VARS);\n }", "public static IntStrategy lexico_LB(IntVar... VARS) {\n return custom(lexico_var_selector(), min_value_selector(), VARS);\n }", "private Set<Variable> extractBlockedDomainVars(Variable rangeVariable, ImmutableSet<Variable> domainVariables,\n ImmutableSet<Variable> aggregationVariables) {\n if (aggregationVariables.contains(rangeVariable))\n return domainVariables;\n\n Sets.SetView<Variable> aggregationDomainVariables = Sets.intersection(domainVariables, aggregationVariables);\n\n // Equalities from an aggregation variable to a grouping variable are blocked\n if (groupingVariables.contains(rangeVariable))\n return aggregationDomainVariables;\n\n // Fresh variables: need at least one variable to become projected\n // the latter may be an aggregation variable if there is no grouping variable\n Variable dominantVariable = aggregationDomainVariables.stream()\n .findAny()\n .orElseGet(() -> domainVariables.iterator().next());\n\n return Sets.difference(aggregationDomainVariables, ImmutableSet.of(dominantVariable));\n }", "public static AbstractStrategy<IntVar> domOverWDeg(IntVar[] VARS, long SEED, IntValueSelector VAL_SELECTOR) {\n return new DomOverWDeg(VARS, SEED, VAL_SELECTOR);\n }", "public static IntStrategy once(VariableSelector<IntVar> VAR_SELECTOR,\n IntValueSelector VAL_SELECTOR,\n IntVar... VARS){\n return new Once(VARS, VAR_SELECTOR, VAL_SELECTOR, assign());\n }", "public static IntStrategy random_value(IntVar[] VARS, long SEED) {\n for (IntVar v : VARS) {\n if (!v.hasEnumeratedDomain()) {\n throw new UnsupportedOperationException(\"Some variables have bounded domains, \" +\n \"please use random heuristic instead\");\n }\n }\n return custom(random_var_selector(SEED), random_value_selector(SEED), VARS);\n }", "public static IntStrategy once(VariableSelector<IntVar> VAR_SELECTOR,\n IntValueSelector VAL_SELECTOR,\n DecisionOperator<IntVar> DEC_OPERATOR,\n IntVar... VARS){\n return new Once(VARS, VAR_SELECTOR, VAL_SELECTOR, DEC_OPERATOR);\n }", "public int chooseVTD(){\n int min=0;\n //this loop is used to avoid a bug\n for(int i=0;i<heuristicArrayTD.length;i++){\n if(heuristicArrayTD[i]< heuristicArrayTD[min]){\n min=i;\n }\n }\n int max=min;\n //returns highest scoring and unused var\n for(int i=0;i<heuristicArrayTD.length;i++){\n if(heuristicArrayTD[i]>= heuristicArrayTD[max] && usageArray[i%variableLength]==0){\n max=i;\n }\n }\n return max%variableLength;\n }", "private static int queryLazy(int[] segtree, int[] lazyValue, int l, int r, int ns, int ne, int index) {\n if(lazyValue[index]!=0){\n segtree[index]+=lazyValue[index];\n if(ns!=ne){\n lazyValue[2*index]+=lazyValue[index];\n lazyValue[2*index+1]+=lazyValue[index];\n }\n lazyValue[index]=0;\n }\n if(r<ns || l>ne){\n //no overlap\n return Integer.MAX_VALUE;\n }\n if(ns>=l && ne<=r){\n //complete overlap\n return segtree[index];\n }else{\n //partial overlap\n int mid=(ns+ne)/2;\n int leftAns=queryLazy(segtree, lazyValue, l, r, ns, mid, 2*index);\n int rightAns=queryLazy(segtree, lazyValue, l, r, mid+1, ne, 2*index+1);\n return Math.min(leftAns,rightAns);\n }\n }", "public abstract DoublePredicate lowerPredicate(double lowerBound);", "public static AbstractStrategy<IntVar> domOverWDeg(IntVar[] VARS, long SEED) {\n return domOverWDeg(VARS, SEED, min_value_selector());\n }", "private List<ComparisonExpression> comparisons(HashMap<TimeSelector, Long> lowerBounds,\n HashMap<TimeSelector, Long> upperBounds) {\n List<ComparisonExpression> newComparisons = new ArrayList<>();\n // for all selectors, as lowerBounds has the same keys as upperBounds\n for (Map.Entry<TimeSelector, Long> entry : lowerBounds.entrySet()) {\n TimeSelector selector = entry.getKey();\n Long lower = entry.getValue();\n Long upper = upperBounds.get(selector);\n if (lower.equals(upper)) {\n newComparisons.add(new ComparisonExpression(\n new Comparison(selector, EQ, new TimeLiteral(lower)),\n new ComparableTPGMFactory()));\n } else {\n if (lower > TemporalElement.DEFAULT_TIME_FROM) {\n // check if informative: lower bound of from is trivial lower bound of to\n if (selector.getTimeProp().equals(TX_TO)) {\n TimeSelector txFromSel = new TimeSelector(selector.getVariable(), TX_FROM);\n if (lowerBounds.getOrDefault(txFromSel, TemporalElement.DEFAULT_TIME_FROM).equals(lower)) {\n continue;\n }\n } else if (selector.getTimeProp().equals(VAL_TO)) {\n TimeSelector valFromSel = new TimeSelector(selector.getVariable(), VAL_FROM);\n if (lowerBounds.getOrDefault(valFromSel, TemporalElement.DEFAULT_TIME_FROM).equals(lower)) {\n continue;\n }\n }\n // informative => build comparison\n newComparisons.add(new ComparisonExpression(\n new Comparison(new TimeLiteral(lower), LTE, selector),\n new ComparableTPGMFactory()));\n }\n if (upper < TemporalElement.DEFAULT_TIME_TO) {\n // analagously as for lower bounds\n // upper bound of to is trivial upper of from\n if (selector.getTimeProp().equals(TimeSelector.TimeField.TX_FROM)) {\n TimeSelector txToSel = new TimeSelector(selector.getVariable(), TX_TO);\n if (upperBounds.getOrDefault(txToSel, TemporalElement.DEFAULT_TIME_TO).equals(upper)) {\n continue;\n }\n } else if (selector.getTimeProp().equals(TimeSelector.TimeField.VAL_FROM)) {\n TimeSelector valToSel = new TimeSelector(selector.getVariable(), VAL_TO);\n if (upperBounds.getOrDefault(valToSel, TemporalElement.DEFAULT_TIME_TO).equals(upper)) {\n continue;\n }\n }\n // informative => build comparison\n newComparisons.add(new ComparisonExpression(\n new Comparison(selector, LTE, new TimeLiteral(upper)),\n new ComparableTPGMFactory()));\n }\n }\n }\n return newComparisons;\n }", "R visitBoundVariable(Formula f, int deBruijnIdx);", "public void SelectDNF(TableVar Variables) {\r\n float perf;\r\n int i, j, k, m, best, posicion[];\r\n\r\n posicion = new int[long_poblacion];\r\n for (i=0;i<long_poblacion;i++) {\r\n posicion[i] = 0;\r\n }\r\n\r\n // Compute the ranking of each individual of the population: element 0 is the better\r\n for (i=0;i<long_poblacion;i++) {\r\n // Find better individual of the rest\r\n best=-1;\r\n perf=0;\r\n for (j=0;j<long_poblacion;j++) {\r\n if (posicion[j]==0 && (best==-1 || Utils.BETTER(poblac.getIndivFitness(j), perf))) {\r\n // If the individual is better\r\n perf = poblac.getIndivFitness(j);\r\n best = j;\r\n }\r\n }\r\n // Mark the individual with the ranking\r\n posicion[best] = i;\r\n }\r\n\r\n // The intermediary population is the ordered copy\r\n for (i=0;i<long_poblacion;i++) {\r\n k = posicion[i];\r\n for (j=0;j<Variables.getNVars();j++)\r\n for (m=0; m<=Variables.getNLabelVar(j); m++)\r\n Inter.setCromElemGene(k,j, m, poblac.getCromElemGene(i,j,m));\r\n Inter.setIndivFitness(k, poblac.getIndivFitness(i));\r\n Inter.setIndivEvaluated(k,true);\r\n }\r\n\r\n }", "@Override\n public Solution solve(ISearchable domain) {\n if(domain==null)\n return null;\n Solution s2=domain.checkIfIsSmall();\n if(s2!=null){\n domain.isClear();\n return s2;\n }\n Solution sol = new Solution();\n temp.add(domain.getStartState());\n numOfNude++;\n domain.isVisit(domain.getStartState());\n ArrayList<AState> neighbors=new ArrayList<AState>();\n while(!temp.isEmpty()){\n AState curr=temp.poll();\n if(domain.isEqual(domain.getGoalState(),curr)){\n numOfNude++;\n sol =solutionPath(curr,sol);\n\n break;\n }\n neighbors=domain.getAllPossibleState(curr);\n for(int i=0;i<neighbors.size();i++){\n if(domain.isEqual(domain.getGoalState(),neighbors.get(i))){\n neighbors.get(i).pervState=curr;\n neighbors.get(i).setPrice(neighbors.get(i).getPrice()+curr.getPrice());\n numOfNude++;\n sol =solutionPath(neighbors.get(i),sol);\n break;\n }\n neighbors.get(i).pervState=curr;\n neighbors.get(i).setPrice(neighbors.get(i).getPrice()+curr.getPrice());\n temp.add(neighbors.get(i));\n numOfNude++;\n }\n }\n\n domain.isClear();\n return sol;\n }", "public VariableCoefficientTuple suggestBranchingVariable (TwoIntegerTuple childRectCounts ) {\r\n \r\n VariableCoefficientTuple result= new VariableCoefficientTuple(null, ZERO) ;\r\n \r\n //first get the best lp rects\r\n List<Rectangle> rectanglesToConsiderForBranchingVarCalculation = this.getRectanglesToConsiderForBranchingVarCalculation( );\r\n \r\n //collect 0 direction refcounts into this map\r\n Map<String, Integer> zeroVar_RefCountMap = new HashMap<String, Integer> () ;\r\n //and one diirection refconts into this map\r\n Map<String, Integer> oneVar_RefCountMap = new HashMap<String, Integer> () ;\r\n \r\n List<VariableCoefficientTuple> variablesUsedForBranchingInThisRectangle =null;\r\n for (Rectangle rect: rectanglesToConsiderForBranchingVarCalculation){\r\n variablesUsedForBranchingInThisRectangle = getVariablesUsedForBranchingInThisRectangle (rect);\r\n if (variablesUsedForBranchingInThisRectangle.size()>ZERO) {\r\n this.updateVariableRefCounts(zeroVar_RefCountMap, oneVar_RefCountMap, variablesUsedForBranchingInThisRectangle) ;\r\n }else {\r\n System.err.print(\"trying to branch a node which should have been marked infeasible\" );\r\n exit(ONE);\r\n }\r\n }\r\n \r\n \r\n //now find the highest refcount var, no matter its direction\r\n int highZeroFreq = zeroVar_RefCountMap.isEmpty()?ZERO:Collections.max( zeroVar_RefCountMap.values());\r\n int highOneFreq = oneVar_RefCountMap.isEmpty()? ZERO: Collections.max(oneVar_RefCountMap.values()) ;\r\n \r\n //we need to find the selected var's refcount on the other side\r\n int selectedVarRefCountOnOtherSide = ZERO;\r\n \r\n int totalRects = getNumberOfRects(this.myInfeasibleRectanglesList) ;\r\n \r\n if (highZeroFreq>highOneFreq) {\r\n result.varName=getHighestFreqVar (zeroVar_RefCountMap,highZeroFreq ) ;\r\n result.coeff=highZeroFreq;\r\n selectedVarRefCountOnOtherSide= oneVar_RefCountMap.get( result.varName)==null? ZERO : oneVar_RefCountMap.get( result.varName);\r\n //this is how many rects will survive on either side\r\n childRectCounts.zeroSideCount = totalRects - selectedVarRefCountOnOtherSide;\r\n childRectCounts.oneSideCount=totalRects -highZeroFreq ;\r\n \r\n } else {\r\n result.varName=getHighestFreqVar (oneVar_RefCountMap,highOneFreq ) ;\r\n result.coeff=highOneFreq;\r\n selectedVarRefCountOnOtherSide= zeroVar_RefCountMap.get( result.varName)==null? ZERO : zeroVar_RefCountMap.get( result.varName);\r\n \r\n childRectCounts.zeroSideCount = totalRects - highOneFreq;\r\n childRectCounts.oneSideCount=totalRects - selectedVarRefCountOnOtherSide;\r\n }\r\n \r\n return result;\r\n }", "public static IntStrategy custom(VariableSelector<IntVar> VAR_SELECTOR,\n IntValueSelector VAL_SELECTOR,\n IntVar... VARS) {\n return custom(VAR_SELECTOR, VAL_SELECTOR, assign(), VARS);\n }", "private void locateBestMatch(int queryStartIdx){\n \n double dist;\n double bsfDist = Double.MAX_VALUE;\n int bsfIdx = -1;\n\n double[] query = zNormalise(series, queryStartIdx, this.windowSize, false);\n double[] comparison;\n\n for(int comparisonStartIdx = 0; comparisonStartIdx <= seriesLength-windowSize; comparisonStartIdx+=stride){\n \n // exclusion zone +/- windowSize/2 around the window\n if(comparisonStartIdx >= queryStartIdx-windowSize*1.5 && comparisonStartIdx <= queryStartIdx+windowSize*1.5){\n continue;\n }\n \n // using a bespoke version of this, rather than the shapelet version, for efficiency - see notes with method\n comparison = zNormalise(series, comparisonStartIdx, windowSize, false);\n dist = 0;\n\n for(int j = 0; j < windowSize;j++){\n dist += (query[j]-comparison[j])*(query[j]-comparison[j]);\n if(dist > bsfDist){\n dist = Double.MAX_VALUE;\n break;\n }\n }\n\n if(dist < bsfDist){\n bsfDist = dist;\n bsfIdx = comparisonStartIdx;\n }\n\n }\n \n this.distances[queryStartIdx] = bsfDist;\n this.indices[queryStartIdx] = bsfIdx;\n }", "public Solution solve(ISearchable domain) {\n if (domain == null)\n return null;\n ArrayList<AState> neighbors;\n Solution solution;\n domain.ResetVisit();\n pathSteps.add(domain.getStartState());\n domain.changeVisitTrue(domain.getStartState());\n numberOfNodes++;\n while (pathSteps.size() > 0) {\n AState temp = pathSteps.poll();\n if (domain.getGoalState().equals(temp)) {\n domain.setGoalState(temp);\n solution = finalSolution(temp);\n return solution;\n }\n neighbors = domain.getAllPossibleStates(temp);\n for (int i=0;i<neighbors.size();i++) {\n if (domain.isVisited(neighbors.get(i))==false) {\n numberOfNodes++;\n domain.changeVisitTrue(neighbors.get(i));\n neighbors.get(i).predecessor = temp;\n pathSteps.add(neighbors.get(i));\n }\n if (neighbors.get(i).equals(domain.getGoalState())) {\n neighbors.get(i).predecessor = temp;\n solution = finalSolution(neighbors.get(i));\n return solution;\n }\n }\n }\n return null;\n }", "private void instantiateVarsSingle(IntVar var, int coeff, int constant, Propagator prop) throws ContradictionException {\n var.instantiateTo(zpz.getSmallestGreaterEqThan(var.getLB(), zpz.div(constant, coeff)), prop);\n }", "@Override\n\tpublic List<Component> caseExprBinary(ExprBinary expr) {\n\t\tint sizeInBits = assignTarget.getVariable().getType().getSizeInBits();\n\t\t// Get the Variables\n\t\tVar e1 = ((ExprVar) expr.getE1()).getUse().getVariable();\n\t\tVar e2 = ((ExprVar) expr.getE2()).getUse().getVariable();\n\t\tList<Var> inVars = new ArrayList<Var>();\n\t\tinVars.add(e1);\n\t\tinVars.add(e2);\n\t\t// Component component = null;\n\t\tif (expr.getOp() == OpBinary.BITAND) {\n\t\t\tcurrentComponent = new AndOp();\n\t\t} else if (expr.getOp() == OpBinary.BITOR) {\n\t\t\tcurrentComponent = new OrOp();\n\t\t} else if (expr.getOp() == OpBinary.BITXOR) {\n\t\t\tcurrentComponent = new XorOp();\n\t\t} else if (expr.getOp() == OpBinary.DIV) {\n\t\t\tcurrentComponent = new DivideOp(sizeInBits);\n\t\t} else if (expr.getOp() == OpBinary.DIV_INT) {\n\t\t\tcurrentComponent = new DivideOp(sizeInBits);\n\t\t} else if (expr.getOp() == OpBinary.EQ) {\n\t\t\tcurrentComponent = new EqualsOp();\n\t\t} else if (expr.getOp() == OpBinary.GE) {\n\t\t\tcurrentComponent = new GreaterThanEqualToOp();\n\t\t} else if (expr.getOp() == OpBinary.GT) {\n\t\t\tcurrentComponent = new GreaterThanOp();\n\t\t} else if (expr.getOp() == OpBinary.LE) {\n\t\t\tcurrentComponent = new LessThanEqualToOp();\n\t\t} else if (expr.getOp() == OpBinary.LOGIC_AND) {\n\t\t\tcurrentComponent = new And(2);\n\t\t} else if (expr.getOp() == OpBinary.LOGIC_OR) {\n\t\t\tcurrentComponent = new Or(2);\n\t\t} else if (expr.getOp() == OpBinary.LT) {\n\t\t\tcurrentComponent = new LessThanOp();\n\t\t} else if (expr.getOp() == OpBinary.MINUS) {\n\t\t\tcurrentComponent = new SubtractOp();\n\t\t} else if (expr.getOp() == OpBinary.MOD) {\n\t\t\tcurrentComponent = new ModuloOp();\n\t\t} else if (expr.getOp() == OpBinary.NE) {\n\t\t\tcurrentComponent = new NotEqualsOp();\n\t\t} else if (expr.getOp() == OpBinary.PLUS) {\n\t\t\tcurrentComponent = new AddOp();\n\t\t} else if (expr.getOp() == OpBinary.SHIFT_LEFT) {\n\t\t\tint log2N = MathStuff.log2(sizeInBits);\n\t\t\tcurrentComponent = new LeftShiftOp(log2N);\n\t\t} else if (expr.getOp() == OpBinary.SHIFT_RIGHT) {\n\t\t\tint log2N = MathStuff.log2(sizeInBits);\n\t\t\tcurrentComponent = new RightShiftOp(log2N);\n\t\t} else if (expr.getOp() == OpBinary.TIMES) {\n\t\t\tcurrentComponent = new MultiplyOp(expr.getType().getSizeInBits());\n\t\t}\n\t\t// currentComponent.setNonRemovable();\n\t\tPortUtil.mapInDataPorts(currentComponent, inVars, portDependency,\n\t\t\t\tportGroupDependency);\n\t\treturn null;\n\t}", "public abstract double[] getLowerBound();", "public static IntStrategy custom(VariableSelector<IntVar> VAR_SELECTOR,\n IntValueSelector VAL_SELECTOR,\n DecisionOperator<IntVar> DEC_OPERATOR,\n IntVar... VARS) {\n return new IntStrategy(VARS, VAR_SELECTOR, VAL_SELECTOR, DEC_OPERATOR);\n }", "public Variable getVariableContaining(int offset);", "public static IntStrategy maxReg_LB(IntVar... VARS) {\n return custom(maxRegret_var_selector(), min_value_selector(), VARS);\n }", "public void initPeriodsSearch() {\n\n\t\t//init fundamentalFreq\n\t\tcalculatefundamentalFreq();\n\n\t\t//set the first search area\n\t\tfinal double confidenceLevel = 5 / 100.;\n\t\tnextPeriodSearchingAreaEnd = (int) Math.floor( hzToPeriod( fundamentalFreq ) * ( 1 + confidenceLevel ) );\n\t}", "Condition between(QueryParameter parameter, Object x, Object y);", "@Override\n public Comparator loadIntoVariable(Comparator comparator, Function value) {\n if (comparator == null) {\n return Comparator.comparing(value);\n }\n return comparator.thenComparing(value);\n }", "public void testConjunctionInQueryVarResolvesWhenBindingsMatch() throws Exception\n {\n resolveAndAssertSolutions(\"[[g(x), f(x)], (?- f(X), g(X)), [[X <-- x]]]\");\n }", "public static IntValueSelector mid_value_selector(boolean floor) {\n return new IntDomainMiddle(floor);\n }", "@Override\n public Variable useHeuristic(Deque<Variable> deque) {\n Variable highDomain = deque.getFirst();\n for (Variable var : deque){\n if (var.getDomain().size() > highDomain.getDomain().size()){\n highDomain = var;\n }\n }\n return highDomain;\n }", "private String indirectAssociations_findSuperClassThatDeclaresVariable(String uniqueClassName, String variableName) {\n \tString result = \"\";\n \tif (inheritanceAssociationsPerClass.containsKey(uniqueClassName)){\n \t\tHashSet<String> inheritanceAssociations = inheritanceAssociationsPerClass.get(uniqueClassName);\n \t\tfor (String superClass : inheritanceAssociations){\n \t\t\tif (superClass.equals(uniqueClassName)) {\n \t\t\t\tbreak; // Otherwise, things go wrong with derived C# classes with the same name.\n \t\t\t}\n\t \t\tString searchKey = superClass + \".\" + variableName;\n \tif (theModel.structuralEntities.containsKey(searchKey)) {\n \t\tresult = superClass;\n \t\tbreak;\n\t }\n\t else {\n\t \tif (inheritanceAssociationsPerClass.containsKey(superClass)){\n\t \t\tresult = indirectAssociations_findSuperClassThatDeclaresVariable(superClass, variableName);\n\t \t\tbreak;\n\t \t}\n\t }\n \t\t} \n \t}\n \treturn result; \n }", "public T caseVariableCondition(VariableCondition object)\n {\n return null;\n }", "public final void rule__FindFirstProperty__ValAssignment_2() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalBrowser.g:4815:1: ( ( ruleWebDriverVarReference ) )\n // InternalBrowser.g:4816:2: ( ruleWebDriverVarReference )\n {\n // InternalBrowser.g:4816:2: ( ruleWebDriverVarReference )\n // InternalBrowser.g:4817:3: ruleWebDriverVarReference\n {\n before(grammarAccess.getFindFirstPropertyAccess().getValWebDriverVarReferenceParserRuleCall_2_0()); \n pushFollow(FOLLOW_2);\n ruleWebDriverVarReference();\n\n state._fsp--;\n\n after(grammarAccess.getFindFirstPropertyAccess().getValWebDriverVarReferenceParserRuleCall_2_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "private void setupDownMonotonicVariables(final InternalQuery<G> query) {\n\t\tfor (final QueryAtom<G> atom : query.getAtoms()) {\n\t\t\tTerm<G> arg;\n\n\t\t\tswitch (atom.getPredicate()) {\n\t\t\tcase PropertyValue:\n\t\t\tcase Type:\n\t\t\t\targ = atom.getArguments().get(0);\n\t\t\t\tif (arg.isVariable()) {\n\t\t\t\t\tdownMonotonic.add(arg.asVariable());\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\targ = null;\n\t\t\t}\n\t\t}\n\t}", "public IExpressionValue getUserDefinedVariable(String key);", "public static Set<AnnotationMirror> findEffectiveLowerBoundAnnotations(final QualifierHierarchy qualifierHierarchy,\n final AnnotatedTypeMirror toSearch) {\n AnnotatedTypeMirror source = toSearch;\n TypeKind kind = source.getKind();\n while (kind == TypeKind.TYPEVAR\n || kind == TypeKind.WILDCARD\n || kind == TypeKind.INTERSECTION) {\n\n switch (source.getKind()) {\n case TYPEVAR:\n source = ((AnnotatedTypeVariable) source).getLowerBound();\n break;\n\n case WILDCARD:\n source = ((AnnotatedWildcardType) source).getSuperBound();\n break;\n\n case INTERSECTION:\n //if there are multiple conflicting annotations, choose the lowest\n final Set<AnnotationMirror> glb = glbOfBounds((AnnotatedIntersectionType) source, qualifierHierarchy);\n return glb;\n\n default:\n ErrorReporter.errorAbort(\"Unexpected AnnotatedTypeMirror with no primary annotation!\"\n + \"toSearch=\" + toSearch\n + \"source=\" + source);\n }\n\n kind = source.getKind();\n }\n\n return source.getAnnotations();\n }", "public static Set<String> variableFeatures(\n\t\t\tfinal Set<ASTNode> boundNodesOfVariable) {\n\t\tfinal Set<String> features = Sets.newHashSet();\n\t\tfor (final ASTNode node : boundNodesOfVariable) {\n\t\t\tif (!(node.getParent() instanceof VariableDeclaration)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tgetDeclarationFeatures(features, node);\n\t\t\tbreak;\n\t\t}\n\t\tcheckArgument(!features.isEmpty());\n\t\treturn features;\n\t}", "public void testBoundToVariable()\n throws Exception\n {\n String varname =\"ITEM\";\n String id = \"occ_hermes1\";\n Occurrence occ = (Occurrence) tm.getObjectByID(id);\n // resolver shall resolve by id\n tag.setOccurrence(occ);\n\n // resolved topic shall be stored in\n // the variable named TOPIC\n tag.setVar(varname);\n \n // resolve\n setScriptForTagBody(tag);\n tag.doTag(null);\n \n // the item should be stored in the variable\n assertEquals(occ, ctx.getVariable(varname));\n \n // make a new tag, bound to the same variable \n // set resolvement to non existant topic\n tag = new UseOccurrenceTag();\n tag.setContext(ctx);\n tag.setVar(varname);\n tag.setId(\"nonexistantntifd\");\n\n // resolve\n tag.doTag(null);\n\n // the variable should be resetted\n assertNull(ctx.getVariable(varname));\n \n }", "private Variable findVariable(String varToFind){\r\n\t\tScope curScope = this;\r\n\t\twhile (curScope!=null) {\r\n\t\t\tif(curScope.contains(varToFind)){\r\n\t\t\t\treturn curScope.getVariable(varToFind);\r\n\t\t\t}else{\r\n\t\t\t\tcurScope = curScope.parent;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public abstract IDecisionVariable getVariable();", "private double computeRangeSelectivity(TableMetadata tableMetadata, RexNode orPred, List<SchemaPath> fieldNames) {\n SchemaPath col = getColumn(orPred, fieldNames);\n if (col != null) {\n ColumnStatistics<?> columnStatistics = tableMetadata != null ? tableMetadata.getColumnStatistics(col) : null;\n Histogram histogram = columnStatistics != null ? ColumnStatisticsKind.HISTOGRAM.getFrom(columnStatistics) : null;\n if (histogram != null) {\n Double totalCount = ColumnStatisticsKind.ROWCOUNT.getFrom(columnStatistics);\n Double ndv = ColumnStatisticsKind.NDV.getFrom(columnStatistics);\n Double sel = histogram.estimatedSelectivity(orPred, totalCount.longValue(), ndv.longValue());\n if (sel != null) {\n return sel;\n }\n }\n }\n return guessSelectivity(orPred);\n }", "static Predicate<Beer> priceRangeQuery(Float priceLowest, Float priceHighest) {\n return b -> b.getPrice() >= priceLowest && b.getPrice() <= priceHighest;\n }", "public void testVariableBindingFromFirstPathPropagatesAccrossConjunction() throws Exception\n {\n resolveAndAssertSolutions(\"[[g(x), h(x), (f(X) :- g(X), h(X))], (?- f(Y)), [[Y <-- x]]]\");\n }", "private static void convertVariablesToZ3(List<QuerySolution> resultList, Context ctx, Solver solver) {\n int intValue;\n for (QuerySolution qs : resultList) {\n RDFNode varNode = qs.get(\"var\");\n RDFNode valNode = qs.get(\"val\");\n RDFNode relationNode = qs.get(\"relation\");\n\n IntExpr var = ctx.mkIntConst(varNode.toString());\n IntExpr val = null;\n intValue = Utils.extractIntFromRdfLiteral(valNode.toString());\n if (intValue != -999) {\n val = ctx.mkInt(intValue);\n } else {\n continue;\n }\n\n if (relationNode.toString().equals(Settings.paIRI + \"greaterEqual\")) {\n solver.add((ctx.mkGe(var, val)));\n } else if (relationNode.toString().equals(Settings.paIRI + \"equals\")) {\n solver.add((ctx.mkEq(var, val)));\n }\n }\n }", "public static VariableSelector<IntVar> random_var_selector(long SEED) {\n return new Random<>(SEED);\n }", "@Test\n public void computeResult_resultAlwaysInsideProvidedBoundaries() {\n int datasetSize = 10;\n for (int i = 0; i < 100; ++i) {\n Random random = new Random();\n double lower = random.nextDouble() * 100;\n double upper = lower + random.nextDouble() * 100;\n\n variance =\n BoundedVariance.builder()\n .epsilon(EPSILON)\n .noise(new LaplaceNoise())\n .maxPartitionsContributed(1)\n .maxContributionsPerPartition(1)\n .lower(lower)\n .upper(upper)\n .build();\n\n List<Double> dataset =\n random\n .doubles()\n .map(x -> x * 300 * getRandomSign(random))\n .limit(datasetSize)\n .boxed()\n .collect(toImmutableList());\n\n variance.addEntries(dataset);\n\n assertWithMessage(\n \"lower = %s\\nupper = %s\\ndataset = [%s]\",\n lower, upper, dataset.stream().map(x -> Double.toString(x)).collect(joining(\",\\n\")))\n .that(variance.computeResult())\n .isIn(Range.closed(0.0, (upper - lower) * (upper - lower) / 4.0));\n }\n }", "public static int interpolationSearch(int[] nums, int val){\n\n int lo = 0, mid = 0, hi = nums.length - 1;\n int range = nums[hi] - nums[lo];\n int normmailized = (hi - lo);\n while(nums[lo] <= val && nums[hi] >= val){\n mid = lo + ((val - nums[lo]) * normmailized)/ range; // normalization\n if(nums[mid] < val){\n lo = mid + 1;\n } else if(nums[mid] > val){\n hi = mid - 1;\n } else return mid;\n }\n if(nums[lo] == val) return lo;\n return -1;\n }", "private List<VariableCoefficientTuple> getVariablesUsedForBranchingInThisRectangle(Rectangle rect){\r\n List<VariableCoefficientTuple> variablesUsedForBranchingInThisRectangle = new ArrayList<VariableCoefficientTuple> ();\r\n \r\n for (String var : rect.zeroFixedVariables) {\r\n if (!treeNode_zeroFixedVariables.contains(var) ) \r\n variablesUsedForBranchingInThisRectangle.add(new VariableCoefficientTuple(var, ZERO) );\r\n }\r\n for (String var : rect.oneFixedVariables){ \r\n if ( !treeNode_oneFixedVariables.contains(var)) {\r\n variablesUsedForBranchingInThisRectangle.add(new VariableCoefficientTuple(var, ONE));\r\n } \r\n }\r\n \r\n return variablesUsedForBranchingInThisRectangle;\r\n }", "List<V> rangeSearch(K key, String comparator) {\r\n\r\n // linked list for return\r\n List<V> val = new LinkedList<>();\r\n LeafNode node_next = this;\r\n LeafNode node_prev = this.previous;\r\n\r\n // to check the current node's next nodes first\r\n while (node_next != null) {\r\n if (comparator.equals(\"<=\")) {\r\n if (node_next.getFirstLeafKey().compareTo(key) > 0) {\r\n node_next = node_next.next;\r\n continue;\r\n }else{\r\n compare((K) key, comparator, (List<V>) val, node_next);\r\n node_next = node_next.next;\r\n }\r\n } else if (comparator.equals(\">=\")){\r\n if (node_next.getFirstLeafKey().compareTo(key) < 0) {\r\n node_next = node_next.next;\r\n continue;\r\n }\r\n else{\r\n compare((K) key, comparator, (List<V>) val, node_next);\r\n node_next = node_next.next;\r\n }\r\n } else if ( comparator.equals(\"==\")){\r\n if (node_next.getFirstLeafKey().compareTo(key) > 0){\r\n node_next = node_next.next;\r\n continue;\r\n } else {\r\n compare((K) key, comparator, (List<V>) val, node_next);\r\n node_next = node_next.next;\r\n }\r\n }\r\n }\r\n\r\n // to check the previous nodes\r\n while (node_prev != null) {\r\n if (comparator.equals(\"<=\")) {\r\n if (node_prev.getFirstLeafKey().compareTo(key) > 0) {\r\n node_prev = node_prev.previous;\r\n continue;\r\n }else{\r\n compare((K) key, comparator, (List<V>) val, node_prev);\r\n node_prev = node_prev.previous;\r\n }\r\n } else if (comparator.equals(\">=\")){\r\n if (node_prev.getFirstLeafKey().compareTo(key) < 0) {\r\n node_prev = node_prev.previous;\r\n continue;\r\n }\r\n else{\r\n compare((K) key, comparator, (List<V>) val, node_prev);\r\n node_prev = node_prev.previous;\r\n }\r\n } else if ( comparator.equals(\"==\")){\r\n if (node_prev.getFirstLeafKey().compareTo(key) > 0){\r\n node_prev = node_prev.previous;\r\n continue;\r\n } else {\r\n compare((K) key, comparator, (List<V>) val, node_prev);\r\n node_prev = node_prev.previous;\r\n }\r\n }\r\n\r\n\r\n }\r\n\r\n return val;\r\n }", "protected Object findBaseObject(String firstName) {\n if (isLoopCurrentVariable(firstName)) {\n return _loopInfo.getCurrentParameter();\n } else {\n return _finder.find(firstName);\n }\n }", "public XzPair structurePosInRegionFast(long xPart, long zPart, long seed, int lowerThen, int higherThen){\n rnd.setSeed(xPart + zPart + seed + 10387313);\n int xRand = (rnd.nextInt(27) + rnd.nextInt(27)) / 2;\n if(xRand <= lowerThen || xRand >= higherThen)\n return new XzPair(xRand, (rnd.nextInt(27) + rnd.nextInt(27)) / 2);\n else\n return null;\n }", "void assignToWhereLists(Expression e, HsqlArrayList[] expressionLists,\n int first) {\n\n set.clear();\n e.collectRangeVariables(rangeVariables, set);\n\n int index = rangeVarSet.getLargestIndex(set);\n\n // condition is independent of tables if no range variable is found\n if (index == -1) {\n index = 0;\n }\n\n // condition is assigned to first non-outer range variable\n if (index < first) {\n index = first;\n }\n\n expressionLists[index].add(e);\n }", "@Override\n\tpublic AbstractValue greatestLowerBound(AbstractValue d) {\n\t\tif ( !(d instanceof Interval) )\n\t\t\tthrow new IllegalArgumentException(\"v should be of type Interval\");\n\t\tInterval i = (Interval) d;\n\n\t\tif (i.isBottom())\n\t\t\treturn i;\n\t\telse if (i.equals(top))\n\t\t\treturn this;\n\n\t\tString newLow = \"-Inf\", newHigh = \"+Inf\";\n\n\t\t//Calcolare limite inferiore\n\n\t\tif ( this.getLow().equals(\"-Inf\")){\n\t\t\tif( !i.getLow().equals(\"-Inf\"))\n\t\t\t\tif(Integer.parseInt(this.getHigh()) > Integer.parseInt(i.getLow()))\n\t\t\t\t\tnewLow = String.valueOf(Integer.max(Integer.parseInt(this.getLow()), Integer.parseInt(i.getLow())));\n\t\t\t\telse\n\t\t\t\t\treturn BottomAV.getInstance();\n\t\t}else if ( i.getLow().equals(\"-Inf\")){\n\t\t\tif( !this.getLow().equals(\"-Inf\"))\n\t\t\t\tif(Integer.parseInt(i.getHigh()) > Integer.parseInt(this.getLow()))\n\t\t\t\t\tnewLow = String.valueOf(Integer.max(Integer.parseInt(i.getLow()), Integer.parseInt(this.getLow())));\n\t\t\t\telse\n\t\t\t\t\treturn BottomAV.getInstance();\n\t\t}else if(!this.getLow().equals(\"-Inf\") && !i.getLow().equals(\"-Inf\")){\n\t\t\tnewLow = String.valueOf(Integer.max(Integer.parseInt(this.getLow()), Integer.parseInt(i.getLow())));\n\t\t}\n\n\t\t// Calcolare limite superiore\n\n\t\tif ( this.getHigh().equals(\"+Inf\")) {\n\t\t\tif (!i.getHigh().equals(\"+Inf\"))\n\t\t\t\tnewHigh = i.getHigh();\n\t\t}else if ( i.getHigh().equals(\"+Inf\")) {\n\t\t\tif (!this.getHigh().equals(\"+Inf\"))\n\t\t\t\tnewHigh = this.getHigh();\n\t\t}else if(!this.getHigh().equals(\"+Inf\") && !i.getHigh().equals(\"+Inf\")){\n\t\t\tnewHigh = String.valueOf(Integer.min(Integer.parseInt(this.getHigh()), Integer.parseInt(i.getHigh())));\n\t\t}\n\n\t\tInterval res = new Interval(newLow, newHigh);\n\n\t\t// Checks whether low > high\n\t\tif ((!newLow.equals(\"-Inf\") && (!newHigh.equals(\"+Inf\")) && Integer.parseInt(newLow) > Integer.parseInt(newHigh)))\n\t\t\treturn BottomAV.getInstance();\n\n\t\treturn amItop() ? top : res;\n\t}", "boolean isBoundVariable(Formula f);", "boolean selectTo(double x, double y);", "@Override\n\tpublic Solution<TTPVariable> run(SingleObjectiveThiefProblem thief, IEvaluator evaluator, MyRandom rand) {\n\t\tTTPVariable var = TTPVariable.create(new TourOptimalFactory(thief).next(rand), Pack.empty());\n\t\tSolution<TTPVariable> currentBest = thief.evaluate(var);\n\t\t\n\n\t\twhile (evaluator.hasNext()) {\n\n\t\t\t// now take the tour and optimize packing plan\n\t\t\tSolution<Pack> nextPack = optPack(thief, evaluator, rand, currentBest.getVariable().getTour(), currentBest.getVariable().getPack());\n\t\t\t\n\t\t\tSolution<Tour> nextTour = optTour(thief, evaluator, rand, currentBest.getVariable().getTour(), nextPack.getVariable());\n\t\t\t\n\t\t\tTTPVariable next = TTPVariable.create(nextTour.getVariable(), nextPack.getVariable());\n\t\t\tSolution<TTPVariable> s = thief.evaluate(next);\n\t\t\t\n\t\t\t//System.out.println(nextPack);\n\t\t\t//System.out.println(currentBest);\n\t\t\t//System.out.println(\"----------------\");\n\t\t\t\n\t\t\t// update the best found solution\n\t\t\tif (SolutionDominator.isDominating(s, currentBest)) {\n\t\t\t\tcurrentBest = s;\n\t\t\t\t//System.out.println(\"YES\");\n\t\t\t}\n\t\t\tevaluator.notify(currentBest);\n\n\t\t}\n\n\t\treturn currentBest;\n\t}", "protected IDecisionVariable dereferenceIfNeeded(IDecisionVariable variable, Value value) {\n IDecisionVariable v = variable;\n if (TypeQueries.isReference(variable.getDeclaration().getType()) \n && !TypeQueries.isReference(value.getType())) {\n v = Configuration.dereference(v);\n if (null == v) { // just a fallback, shall not happen\n v = variable;\n }\n }\n return v;\n }", "public void cleanUpByVarSetName(SSBNNode baseSSBNNode) {\r\n\t\t\t\r\n\t\t\t// no cleanup is necessary when this is a default distro - no boolean evaluation is present\r\n\t\t\tif (this.isDefault()) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// extracts parents' similar sets by strong OV names\r\n\t\t\tCollection<SSBNNode> parents = null;\r\n\t\t\tif (isExactMatchStrongOV()) {\r\n\t\t\t\tparents = baseSSBNNode.getParentSetByStrongOVWithWeakOVCheck(\r\n\t\t\t\t\t\tthis.getVarsetname().split(\"\\\\\" + baseSSBNNode.getStrongOVSeparator()));\r\n\t\t\t} else { // consider all parents that has at least one of the specified OVs in its argument\r\n\t\t\t\tparents = new HashSet<SSBNNode>();\r\n\t\t\t\t// search parents for each specified OV\r\n\t\t\t\tfor (String ovName : this.getVarsetname().split(\"\\\\\" + baseSSBNNode.getStrongOVSeparator())) {\r\n\t\t\t\t\tparents.addAll(baseSSBNNode.getParentSetByStrongOV(\r\n\t\t\t\t\t\t\tfalse,\t\t\t\t\t\t// not an exact match\r\n\t\t\t\t\t\t\tovName\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tboolean found = false;\r\n\t\t\t\r\n\t\t\t// extract condicionants declared within the expression\r\n\t\t\tfor (TempTableHeader headParent : this.getParents()) {\r\n\t\t\t\t found = false;\r\n\t\t\t\t // look for headParent inside parents (set of similar parents)\r\n\t\t\t\t for (SSBNNode node : parents) {\r\n\t\t\t\t\tif (node.getResident().equals(headParent.getParent())) {\r\n\t\t\t\t\t\t// if node names are the same, then we found it\r\n\t\t\t\t\t\tfound = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t }\r\n\t\t\t if (!found) {\r\n\t\t\t \t // if we did not find a condicionant (inside expression) inside the parent set\r\n\t\t\t \t headParent.setKnownValue(true);\r\n\t\t\t }\r\n\t\t\t}\r\n\t\t}", "public boolean label(IntVar[] vars) {\r\n\r\n\r\n //System.out.println(\"ct \" + vars.length);\r\n count++;\r\n if (trace) {\r\n for (int i = 0; i < vars.length; i++)\r\n System.out.print (vars[i] + \" \");\r\n System.out.println ();\r\n }\r\n\r\n ChoicePoint choice = null;\r\n boolean consistent;\r\n\r\n // Instead of imposing constraint just restrict bounds\r\n // -1 since costValue is the cost of last solution\r\n if (costVariable != null) {\r\n try {\r\n if (costVariable.min() <= costValue - 1)\r\n costVariable.domain.in(store.level, costVariable, costVariable.min(), costValue - 1);\r\n else\r\n return false;\r\n } catch (FailException f) {\r\n return false;\r\n }\r\n }\r\n\r\n consistent = store.consistency();\r\n\r\n if (!consistent) {\r\n // Failed leaf of the search tree\r\n return false;\r\n } else { // consistent\r\n\r\n if (vars.length == 0) {\r\n // solution found; no more variables to label\r\n\r\n // update cost if minimization\r\n if (costVariable != null)\r\n costValue = costVariable.min();\r\n\r\n reportSolution();\r\n\r\n return costVariable == null; // true is satisfiability search and false if minimization\r\n }\r\n\r\n choice = new ChoicePoint(vars);\r\n\r\n levelUp();\r\n\r\n store.impose(choice.getConstraint());\r\n\r\n // choice point imposed.\r\n\r\n consistent = label(choice.getSearchVariables());\r\n\r\n if (consistent) {\r\n levelDown();\r\n return true;\r\n } else {\r\n\r\n restoreLevel();\r\n store.impose(new Not(choice.getConstraint()));\r\n\r\n\r\n\r\n // negated choice point imposed.\r\n\r\n consistent = label(vars);\r\n\r\n levelDown();\r\n\r\n if (consistent) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n }\r\n }", "public XPathSelector load() {\n Map<StructuredQName, XPathVariable> declaredVariables = new LinkedHashMap<StructuredQName, XPathVariable>();\n for (Iterator iter = env.iterateExternalVariables(); iter.hasNext(); ) {\n XPathVariable var = (XPathVariable) iter.next();\n declaredVariables.put(var.getVariableQName(), var);\n }\n return new XPathSelector(exp, declaredVariables);\n }", "public abstract Collection<T> getMatchesAboveThreshold(T first,\n double similarityThreshold);", "public static String getVarFromQueryString(String varName, String haystack) {\n\t\tif (haystack == null || haystack.length() == 0) {\n\t\t\treturn null;\n\t\t}\n\t\tif (haystack.charAt(0) == '?') {\n\t\t\thaystack = haystack.substring(1);\n\t\t}\n\t\tString[] vars = haystack.split(\"&\");\n\n\t\tfor (String var : vars) {\n\t\t\tString[] tuple = var.split(\"=\");\n\t\t\tif (tuple.length == 2 && tuple[0].equals(varName)) {\n\t\t\t\treturn tuple[1];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public int compareTo(hl hlVar) {\n int a2;\n int a3;\n int a4;\n int a5;\n int a6;\n int a7;\n int a8;\n if (!getClass().equals(hlVar.getClass())) {\n return getClass().getName().compareTo(hlVar.getClass().getName());\n }\n int compareTo = Boolean.valueOf(a()).compareTo(Boolean.valueOf(hlVar.a()));\n if (compareTo != 0) {\n return compareTo;\n }\n if (a() && (a8 = hv.a(this.a, hlVar.a)) != 0) {\n return a8;\n }\n int compareTo2 = Boolean.valueOf(b()).compareTo(Boolean.valueOf(hlVar.b()));\n if (compareTo2 != 0) {\n return compareTo2;\n }\n if (b() && (a7 = hv.a(this.b, hlVar.b)) != 0) {\n return a7;\n }\n int compareTo3 = Boolean.valueOf(c()).compareTo(Boolean.valueOf(hlVar.c()));\n if (compareTo3 != 0) {\n return compareTo3;\n }\n if (c() && (a6 = hv.a(this.c, hlVar.c)) != 0) {\n return a6;\n }\n int compareTo4 = Boolean.valueOf(d()).compareTo(Boolean.valueOf(hlVar.d()));\n if (compareTo4 != 0) {\n return compareTo4;\n }\n if (d() && (a5 = hv.a(this.d, hlVar.d)) != 0) {\n return a5;\n }\n int compareTo5 = Boolean.valueOf(e()).compareTo(Boolean.valueOf(hlVar.e()));\n if (compareTo5 != 0) {\n return compareTo5;\n }\n if (e() && (a4 = hv.a(this.e, hlVar.e)) != 0) {\n return a4;\n }\n int compareTo6 = Boolean.valueOf(f()).compareTo(Boolean.valueOf(hlVar.f()));\n if (compareTo6 != 0) {\n return compareTo6;\n }\n if (f() && (a3 = hv.a(this.f, hlVar.f)) != 0) {\n return a3;\n }\n int compareTo7 = Boolean.valueOf(g()).compareTo(Boolean.valueOf(hlVar.g()));\n if (compareTo7 != 0) {\n return compareTo7;\n }\n if (!g() || (a2 = hv.a(this.g, hlVar.g)) == 0) {\n return 0;\n }\n return a2;\n }", "void assignToRangeVariables() {\n\n for (int i = 0; i < rangeVariables.length; i++) {\n boolean isOuter = rangeVariables[i].isLeftJoin\n || rangeVariables[i].isRightJoin;\n\n if (isOuter) {\n assignToRangeVariable(rangeVariables[i], i,\n joinExpressions[i], true);\n assignToRangeVariable(rangeVariables[i], i,\n whereExpressions[i], false);\n } else {\n joinExpressions[i].addAll(whereExpressions[i]);\n assignToRangeVariable(rangeVariables[i], i,\n joinExpressions[i], true);\n }\n\n if (rangeVariables[i].hasIndexCondition()\n && inExpressions[i] != null) {\n if (!flags[i] && isOuter) {\n rangeVariables[i].addWhereCondition(inExpressions[i]);\n } else {\n rangeVariables[i].addJoinCondition(inExpressions[i]);\n }\n\n inExpressions[i] = null;\n\n inExpressionCount--;\n }\n }\n\n if (inExpressionCount != 0) {\n setInConditionsAsTables();\n }\n }", "public List<com.hexarchbootdemo.adapter.output.persistence.h2.generated_sources.jooq.tables.pojos.Voter> fetchRangeOfFirstName(String lowerInclusive, String upperInclusive) {\n return fetchRange(Voter.VOTER.FIRST_NAME, lowerInclusive, upperInclusive);\n }", "public static void apply_SPV(String from,double x[],int order[]){\n\r\n\t\tif (temp_full_list == null || temp_full_list.length != x.length){\r\n\t\t\ttemp_full_list = new boolean[x.length];\r\n\t\t}\r\n\t\tfor (int i = 0; i < temp_full_list.length; i++) {\r\n\t\t\ttemp_full_list[i] = false;\r\n\t\t}\r\n\t\t\r\n\t\tboolean min_set;\r\n\t\tfor (int i = 0; i < order.length; i++) {\r\n\t\t\tdouble min = 1000;\r\n\t\t\tint target=0;\r\n\t\t\tmin_set = false;\r\n\t\t\tfor (int j = 0; j < x.length; j++) {\r\n\t\t\t\tif (!temp_full_list[j] && (!min_set || x[j] < min)){\r\n\t\t\t\t\tmin_set = true;\r\n\t\t\t\t\ttarget = j;\r\n\t\t\t\t\tmin = x[j];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\torder[i] = target;\r\n\t\t\ttemp_full_list[target] = true;\r\n\t\t}\r\n\t}", "public interface IVariable<A extends AbstractDomain<?>> extends IReferenceHolder<A>, ITerm {\n\n\t@SuppressWarnings(\"unchecked\")\n\t@Override\n\tpublic default Set<IVariable<?>> getVariables() {\n\t\tSet<IVariable<?>> values = new HashSet<>();\n\t\tvalues.add((IVariable<AbstractDomain<?>>) this);\n\t\treturn values;\n\t}\n\n\t/**\n\t * Lets the visitor visit the variable.\n\t * \n\t * @param IVariableVisitor\n\t * The visitor.\n\t */\n\tpublic void processWith(IVariableVisitor iVariableVisitor);\n\n\t/**\n\t * Returns whether it is a constant.\n\t * \n\t * @return Whether it is a constant.\n\t */\n\tpublic boolean isConstant();\n}", "private void instantiateSecondVar(IntVar var1, int coeff1, IntVar var2, int coeff2, int constant, Propagator prop) throws ContradictionException {\n IntIterableRangeSet possibleValues2 = new IntIterableRangeSet();\n int lb2 = var2.getLB();\n DisposableValueIterator iterator1 = var1.getValueIterator(true);\n while(iterator1.hasNext()){\n int v = iterator1.next();\n possibleValues2.add(zpz.getSmallestGreaterEqThan(lb2, zpz.div(zpz.sub(constant, zpz.mul(zpz.repr(v),coeff1)), coeff2)));\n }\n var2.removeAllValuesBut(possibleValues2, prop);\n }", "protected abstract D getLower(R range);", "private static void solveProblem3D (ISearchable domain, ISearchingAlgorithm searcher) throws NullError, LowBoundInput, OutOfBoundMatrixInput {\n Solution solution = searcher.solve(domain);\n System.out.println(String.format(\"'%s' algorithm - nodes evaluated: %s\", searcher.getName(), searcher.getNumberOfNodesEvaluated()));\n //Printing Solution Path\n System.out.println(\"Solution path:\");\n ArrayList<AState> solutionPath = solution.getSolutionPath();\n for (int i = 0; i < solutionPath.size(); i++) {\n System.out.println(String.format(\"%s %s\", i, solutionPath.get(i)));\n }\n }", "@Test\n\tpublic void testInterpolationSearch() {\n\t\tint[] numbers = {0, 1, 2, 3, 4, 5, 6};\n\t\tint r1 = _02_InterpolationSearch.interpolationSearch(numbers, 2);\n\t\tassertEquals(2, r1);\n\t\t\n\t\tint[] numbers2 = {2, 4, 6, 8, 10};\n\t\tint r2 = _02_InterpolationSearch.interpolationSearch(numbers2, 2);\n\t\tassertEquals(0, r2);\n\t\t\n\t\tint[] numbers3 = {100, 200, 300};\n\t\tint r3 = _02_InterpolationSearch.interpolationSearch(numbers3, 160);\n\t\tassertEquals(-1, r3);\n\n\t}", "public void setInitiallySearchByPrefixValue(boolean initiallySearchByPrefixValue) {\n this.initiallySearchByPrefixValue = initiallySearchByPrefixValue;\n }", "public V getLowerBound();", "@Override\n\tpublic void before(Method method, Object[] args, Object obj) throws Throwable {\n\t\tMap<String, Object> conditionMap = new HashMap<String, Object>();\n\t\t\n\t\tList<Condition> conditionList = new ArrayList<Condition>();\n\t\tfor (int i = 0; i < args.length; i++) {\n\t\t\tif (args[i] instanceof Search) {\n\t\t\t\tSet<String> nameSet = new HashSet<String>();\n\t\t\t\tCondition c = null;\n\t\t\t\tServletRequest request = RequestContext.getCurrentContext().getRequest();\n\t\t\t\t@SuppressWarnings(\"rawtypes\")\n\t\t\t\tEnumeration enu = request.getParameterNames();\n\t\t\t\twhile (enu.hasMoreElements()) {\n\t\t\t\t\tString name = (String)enu.nextElement();\n\t\t\t\t\tString value = request.getParameter(name);\n\t\t\t\t\tList<String> params = Arrays.asList(\"routerName\", \"methods\", \"confirmMethods\", \"gridId\");\n\t\t\t\t\tif (params.contains(name)) {\n\t\t\t\t\t\tc = new Condition();\n\t\t\t\t\t\tc.setName(name);\n\t\t\t\t\t\tc.setValue(value);\n\t\t\t\t\t\tconditionMap.put(name, value);\n\t\t\t\t\t\tnameSet.add(c.getName());\n\t\t\t\t\t\tconditionList.add(c);\n\t\t\t\t\t} else if (name.toLowerCase().startsWith(SEARCH_PREFIX) \n\t\t\t\t\t\t\t&& (value != null && (!value.equals(\"\")))) {\n//\t\t\t\t\t\tboolean has = nameSet.contains(name.split(\"_\")[1]);\n//\t\t\t\t\t\tif (name.toLowerCase().endsWith(SEARCH_SUFFIX_START)) {\n//\t\t\t\t\t\t\tif (has) {\n//\t\t\t\t\t\t\t\tfor (Condition o : conditionList) {\n//\t\t\t\t\t\t\t\t\tif (o.getName().equals(name.split(\"_\")[1])) {\n//\t\t\t\t\t\t\t\t\t\tc = o;\n//\t\t\t\t\t\t\t\t\t\tconditionList.remove(o);\n//\t\t\t\t\t\t\t\t\t\tbreak;\n//\t\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t} else {\n//\t\t\t\t\t\t\t\tc = new MultiCondition();\n//\t\t\t\t\t\t\t\t((MultiCondition)c).setName(name.split(\"_\")[1]);\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\tif (((MultiCondition) c).getOperateType() == 0) {\n//\t\t\t\t\t\t\t\t((MultiCondition) c).setOperateType(ConditionOperator.GTE);\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t((MultiCondition)c).setValue(value);\n//\t\t\t\t\t\t} else if (name.toLowerCase().endsWith(SEARCH_SUFFIX_END)) {\n//\t\t\t\t\t\t\tif (has) {\n//\t\t\t\t\t\t\t\tfor (Condition o : conditionList) {\n//\t\t\t\t\t\t\t\t\tif (o.getName().equals(name.split(\"_\")[1])) {\n//\t\t\t\t\t\t\t\t\t\tc = o;\n//\t\t\t\t\t\t\t\t\t\tconditionList.remove(o);\n//\t\t\t\t\t\t\t\t\t\tbreak;\n//\t\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t} else {\n//\t\t\t\t\t\t\t\tc = new MultiCondition();\n//\t\t\t\t\t\t\t\t((MultiCondition)c).setName(name.split(\"_\")[1]);\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\tif (((MultiCondition) c).getOperateType2() == 0) {\n//\t\t\t\t\t\t\t\t((MultiCondition)c).setOperateType2(ConditionOperator.LTE);\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t((MultiCondition)c).setValue2(value);\n//\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tc = new Condition();\n\t\t\t\t\t\t\tc.setName(name.split(\"_\")[1]);\n//\t\t\t\t\t\t\tif (c.getOperateType() == 0) {\n//\t\t\t\t\t\t\t\tc.setOperateType(ConditionOperator.EQ);\n//\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (value.indexOf(\":\") > 0 && value.length() == 19) {\n\t\t\t\t\t\t\t\tc.setValue(DateUtil.formatTimestampToDate(value));\n\t\t\t\t\t\t\t} else if (\"on\".equals(value)) {\n\t\t\t\t\t\t\t\tvalue = \"1\";\n\t\t\t\t\t\t\t\tc.setValue(value);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tc.setValue(value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tconditionMap.put(name, value);\n//\t\t\t\t\t\t}\n\t\t\t\t\t\tnameSet.add(c.getName());\n\t\t\t\t\t\tconditionList.add(c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (conditionList.size() > 0) {\n\t\t\t\t\t((Search)args[i]).setConditionList(conditionList);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSearchConditionFilter s = method.getAnnotation(SearchConditionFilter.class);\n\t\tif (s != null && s.limits() != null && s.limits().length != 0) {\n\t\t\t//TODO 处理limits,只按照limits限制的条件查询,若不限制则默认全部(即不处理)\n\t\t\tList<Condition> removes = new ArrayList<Condition>();\n\t\t\tList<String> limitList = Arrays.asList(s.limits());\n\t\t\tfor (Condition cond : conditionList) {\n\t\t\t\tif (!limitList.contains(cond.getName())) {\n\t\t\t\t\tremoves.add(cond);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconditionList.removeAll(removes);\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < args.length; i++) {\n\t\t\tif (args[i] instanceof Model && conditionList.size() > 0) {\n\t\t\t\t((Model)args[i]).addAttribute(\"conditions\", conditionMap);\n\t\t\t\tfor (Iterator<Condition> ite = conditionList.iterator(); ite.hasNext();) {\n\t\t\t\t\tCondition cond = ite.next();\n\t\t\t\t\t((Model)args[i]).addAttribute(SEARCH_PREFIX + cond.getName(), conditionMap.get(SEARCH_PREFIX + cond.getName()));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n//\t\tfor (int i = 0; i < args.length; i++) {\n//\t\t\tif (args[i] instanceof Model && conditionList.size() > 0) {\n//\t\t\t\tfor (Iterator<Condition> ite = conditionList.iterator(); ite.hasNext();) {\n//\t\t\t\t\tCondition cond = ite.next();\n//\t\t\t\t\tif (cond instanceof MultiCondition) {\n//\t\t\t\t\t\t((Model)args[i]).addAttribute(SEARCH_PREFIX + cond.getName() + SEARCH_SUFFIX_START, cond.getValue());\n//\t\t\t\t\t\t((Model)args[i]).addAttribute(SEARCH_PREFIX + cond.getName() + SEARCH_SUFFIX_END, ((MultiCondition)cond).getValue2());\n//\t\t\t\t\t\tconditionMap.put(SEARCH_PREFIX + cond.getName() + SEARCH_SUFFIX_START, cond.getValue());\n//\t\t\t\t\t\tconditionMap.put(SEARCH_PREFIX + cond.getName() + SEARCH_SUFFIX_END, ((MultiCondition)cond).getValue2());\n//\t\t\t\t\t} else {\n//\t\t\t\t\t\t((Model)args[i]).addAttribute(SEARCH_PREFIX + cond.getName(), cond.getValue());\n//\t\t\t\t\t\tconditionMap.put(SEARCH_PREFIX + cond.getName(), cond.getValue());\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t\t((Model)args[i]).addAttribute(\"conditions\", conditionMap);\n//\t\t\t}\n//\t\t}\n\t\t\n\t\t\n\t\t//BusinessCallController、listcontent.ftl、BackendHelper、admin.common.js、index.ftl(resume)、\n\t\t//BasicBusinessService、ResumeBusinessService、、、UserBusinessService\n//\t\tString simpleClassName = obj.getClass().getSimpleName();\n//\t\tString beanId = StringUtil.convertFirstChar2LowerCase(simpleClassName.replace(\"Controller\", \"Helper\"));\n//\t\tBaseHelper helper = SpringApplicationContext.getBean(beanId);\n//\t\t\n//\t\tif (null != helper) {//设置Condition中value的类型\n//\t\t\thelper.getConditionValue(propertyName, value);\n//\t\t}\n\t}", "@Test\n public void testBoundsAsCompositesWithSingleEqAndSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n ByteBuffer value4 = ByteBufferUtil.bytes(4);\n ByteBuffer value5 = ByteBufferUtil.bytes(5);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3)\n Restriction singleEq = newSingleEq(cfMetaData, 0, value1);\n Restriction multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(singleEq).mergeWith(multiSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, EOC.END);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) > (2, 3) AND (clustering_1) < (4)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, false, value2, value3);\n Restriction multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, false, value4);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, EOC.START);\n\n // clustering_0 = 1 AND (clustering_1, clustering_2) => (2, 3) AND (clustering_1, clustering_2) <= (4, 5)\n singleEq = newSingleEq(cfMetaData, 0, value1);\n multiSlice = newMultiSlice(cfMetaData, 1, Bound.START, true, value2, value3);\n multiSlice2 = newMultiSlice(cfMetaData, 1, Bound.END, true, value4, value5);\n restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiSlice2).mergeWith(singleEq).mergeWith(multiSlice);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.NONE);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value4, value5, EOC.END);\n }", "public void setLowerBound(String lower) {\n lowerBound = lower;\n }", "public static void main(String[] args) {\n int[] exampleVariableOne = {1, 11, 24, 34, 67, 89, 102};\n int target = 102;\n binarySearch(exampleVariableOne, target);\n }", "public int getLowerBound ();", "private GradsVariable findVar(Variable v2) {\n List<GradsVariable> vars = gradsDDF.getVariables();\n String varName = v2.getFullName();\n for (GradsVariable var : vars) {\n if (var.getName().equals(varName)) {\n return var;\n }\n }\n\n return null; // can't happen?\n }", "public void execFuzzySearchVariationFunc(){\n\n\n Map map = new HashMap();\n\n if(this.searchParam != null && this.searchParam.length()> 0 ){\n System.out.println(this.searchParam );\n if(this.searchParam.contains(\":\")==true || this.searchParam.startsWith(\"chr\") == true) {\n String chrom = \"\";\n int pstart = -1;\n int pend = -1;\n if (this.searchParam.indexOf(\":\") > -1) {\n int idex = this.searchParam.indexOf(\":\");\n chrom = this.searchParam.substring(0, idex );\n System.out.println(\"chrom=\" + chrom);\n map.put(\"chrom\", chrom);\n if (this.searchParam.indexOf(\"-\") > -1) {\n int idex1 = this.searchParam.indexOf(\"-\");\n pstart = Integer.parseInt(this.searchParam.substring(idex + 1, idex1 ));\n pend = Integer.parseInt(this.searchParam.substring(idex1 + 1, this.searchParam.length()));\n map.put(\"startpos\", pstart);\n map.put(\"endpos\", pend);\n } else {\n pstart = Integer.parseInt(this.searchParam.substring(idex + 1, this.searchParam.length()));\n map.put(\"startpos\", pstart);\n }\n\n } else if (this.searchParam.startsWith(\"chr\") == true) {\n map.put(\"chrom\", this.searchParam);\n }\n }\n\n map.put(\"searchParam\",this.searchParam);\n }\n\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"null\") ==false && this.searchSpecies.equals(\"all\") == false){\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"species\",this.searchSpecies);\n }\n\n if(this.searchTrait != null&& this.searchTrait.equals(\"null\") ==false && this.searchTrait.length()>0){\n\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"searchTrait\", this.searchTrait) ;\n }\n\n if(this.pvalue != null&& this.pvalue.equals(\"null\") ==false && this.pvalue.length()>0){\n\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"psitu\", this.psitu);\n map.put(\"pval\", this.pvalue) ;\n }\n\n\n //here, parse search param and get genotype information\n genotypeBeanList = (List<GenotypeBean>) baseService.findResultList(\"cn.big.gvk.dm.Genotype.selectGenotypeByPos\",map);\n if(genotypeBeanList != null && genotypeBeanList.size() > 0 ){\n for(GenotypeBean tbean :genotypeBeanList ){\n List genotypelist = new ArrayList();\n genotypelist.add(tbean.getGenotypeId()) ;\n\n Map t = new HashMap();\n t.put(\"genotypelist\",genotypelist);\n List<GenotypeAnnotateGeneView> annotateview = baseService.findResultList(\"cn.big.gvk.dm.Genotype.selectGenotypeByList\",t);\n if(annotateview != null && annotateview.size()>0 ){\n //here we need to filter the result\n Map filtermap = new HashMap();\n for(GenotypeAnnotateGeneView tview : annotateview){\n String fkey = tview.getMapGeneId()+\"_\"+tview.getConseqtype();\n if(filtermap.containsKey(fkey) == false){\n filtermap.put(fkey,tview);\n }\n }\n\n if(filtermap.size()>0){\n List<GenotypeAnnotateGeneView> alist = new ArrayList<GenotypeAnnotateGeneView>();\n Iterator it = filtermap.entrySet().iterator();\n while(it.hasNext()){\n Map.Entry entry = (Map.Entry) it.next();\n GenotypeAnnotateGeneView val = (GenotypeAnnotateGeneView) entry.getValue();\n alist.add(val);\n }\n\n tbean.setGenotypeAnnotateGeneView(alist);\n }\n\n\n }\n\n //find association count\n GwasAssociationBean gwas = (GwasAssociationBean) baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectAssociationCountByGenotypeid\",tbean.getGenotypeId());\n if(gwas != null){\n tbean.setTraitCount(gwas.getGwasCount());\n }\n\n //find studycount\n Map cmap = new HashMap();\n cmap.put(\"genotypeId\",tbean.getGenotypeId());\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"all\") == false){\n cmap.put(\"species\",this.searchSpecies);\n }\n\n\n GwasAssociationBean tg_bean1 = (GwasAssociationBean)baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectStudyCountByGenotypeid\",cmap);\n if(tg_bean1 != null ){\n tbean.setStudyCount(tg_bean1.getGwasCount());\n }\n\n }\n\n\n\n }\n\n StringBuffer sb = new StringBuffer() ;\n\n if(genotypeBeanList != null && genotypeBeanList.size()>0){\n for(GenotypeBean genotype: genotypeBeanList){\n sb.append(genotype.getVarId()).append(\"\\t\").append(genotype.getChrom()).append(\":\")\n .append(genotype.getStartPos()).append(\"\\t\").append(genotype.getTraitCount())\n .append(\"\\t\").append(genotype.getStudyCount()).append(\"\\n\");\n }\n }\n\n if(format == 1 ){ //export txt\n this.response.reset();\n this.response.setHeader(\"Content-Disposition\",\n \"attachment;filename=export.txt\");\n this.response.setContentType(\"application/ms-txt\");\n try {\n PrintWriter pr = this.response.getWriter();\n pr.print(sb.toString());\n pr.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n }", "private int getLowerBound(Object problem, int upperbound)\n {\n Graph tsp = (Graph)problem;\n if (weight == null)\n weight = new double[tsp.size()];\n hki = new HeldKarpIterative( tsp, included, includedT, excluded, excludedT, iterations, weight, upperbound);\n hki.compute();\n tour = hki.isTour();\n bound = hki.getBound();\n hasRun = true;\n// System.out.println(hki.debugDump());\n return bound;\n }", "private int searchR(Searching[] array, int start, int half, int end, int value) {\n if (value > array[end].getValue() || value < array[start].getValue()) {\n return -1;\n }\n int a = end - start;\n int b = array[end].getValue() - array[start].getValue();\n int c = value - array[start].getValue();\n int d = (c * a) / b;\n int slide = d + start;\n if (slide > end || slide < start) {\n return -1;\n }\n if (array[slide].getValue() == value) {\n return slide;\n }\n if (value < array[slide].getValue()) {\n end = slide;\n return searchR(array, start, half, end, value);\n } else {\n start = slide;\n return searchR(array, start, half, end, value);\n }\n }", "public static AbstractStrategy<IntVar> impact(IntVar[] VARS, long SEED) {\n return impact(VARS, 2, 3, 10, SEED, true);\n }", "@Parameters\n\tpublic static Collection<Object[]> firstValues() {\n\t\tList<Pattern> mceJTD_1 = new LinkedList<Pattern>();\n\t\tmceJTD_1.add(Pattern.compile(\"(.+\\\\.)?Comparator\\\\<String\\\\> stringVar_2 = atr1\\\\.trim\\\\(\\\\)\\\\.CASE_INSENSITIVE_ORDER; //mutGenLimit 0\"));\n\t\tmceJTD_1.add(Pattern.compile(\"(.+\\\\.)?String stringVar_3 = stringMethod_3\\\\( 1, 2 \\\\)\\\\.concat\\\\( \\\"lalala\\\" \\\\)\\\\.intern\\\\(\\\\); //mutGenLimit 0\"));\n\t\tmceJTD_1.add(Pattern.compile(\"(.+\\\\.)?Comparator\\\\<String\\\\> stringVar_4 = stringMethod_4\\\\( 1, 2 \\\\)\\\\.CASE_INSENSITIVE_ORDER; //mutGenLimit 0\"));\n\t\tProperty propJTD_1 = new Property(MutationOperator.JTD,\n\t\t\t\t\t\t\t\t\t\t\t\"test/JTD_1\",\n\t\t\t\t\t\t\t\t\t\t\t\"radiatedMethod\",\n\t\t\t\t\t\t\t\t\t\t\t3,\n\t\t\t\t\t\t\t\t\t\t\t3,\n\t\t\t\t\t\t\t\t\t\t\tmceJTD_1,\n\t\t\t\t\t\t\t\t\t\t\tTestingTools.NO_PATTERN_EXPECTED);\n\t\t\n\t\t/*\n\t\t * Original code\n\t\t * \n\t\t * \tComparator<String> stringVar_2 = this.atr1.trim().CASE_INSENSITIVE_ORDER; //mutGenLimit 1\n\t\t *\tString stringVar_3 = this.stringMethod_3(1, 2); //mutGenLimit 1\n\t\t *\tString stringVar_4 = this.atr2; //mutGenLimit 1\n\t\t *\tString stringVar_5 = this.atr2; //mutGenLimit 1\n\t\t *\n\t\t */\n\t\tList<Pattern> mceJTD_2 = new LinkedList<Pattern>();\n\t\tmceJTD_2.add(Pattern.compile(\"(.+\\\\.)?Comparator\\\\<String\\\\> stringVar_2 = atr1\\\\.trim\\\\(\\\\)\\\\.CASE_INSENSITIVE_ORDER; //mutGenLimit 0\"));\n\t\tmceJTD_2.add(Pattern.compile(\"(.+\\\\.)?String stringVar_3 = stringMethod_3\\\\( 1, 2 \\\\); //mutGenLimit 0\"));\n\t\tmceJTD_2.add(Pattern.compile(\"(.+\\\\.)?String stringVar_4 = atr2; //mutGenLimit 0\"));\n\t\tmceJTD_2.add(Pattern.compile(\"(.+\\\\.)?String stringVar_5 = atr2; //mutGenLimit 0\"));\n\t\tProperty propJTD_2 = new Property(MutationOperator.JTD,\n\t\t\t\t\t\t\t\t\t\t\t\"test/JTD_2\",\n\t\t\t\t\t\t\t\t\t\t\t\"radiatedMethod\",\n\t\t\t\t\t\t\t\t\t\t\t4,\n\t\t\t\t\t\t\t\t\t\t\t4,\n\t\t\t\t\t\t\t\t\t\t\tmceJTD_2,\n\t\t\t\t\t\t\t\t\t\t\tTestingTools.NO_PATTERN_EXPECTED);\n\t\t\n\t\t\n\t\t/*\n\t\t * Original code\n\t\t * \n\t\t * \tint var1 = this.field1; //mutGenLimit 2\n\t\t *\tint var2 = this.method1(field1, field2); //mutGenLimit 2\n\t\t *\tint var3 = this.method1(this.field1, field2); //mutGenLimit 2\n\t\t *\tint var4 = this.method1(this.method1(this.field1, this.method2(this.field2, this.field3)), 0); //mutGenLimit 2\n\t\t *\treturn this.method1(this.field1, var5); //mutGenLimit 2\n\t\t * \n\t\t */\n\t\tList<Pattern> mceJTD_3 = new LinkedList<Pattern>();\n\t\tmceJTD_3.add(Pattern.compile(\"int var1 = field1; //mutGenLimit 1\"));\n\t\tmceJTD_3.add(Pattern.compile(\"int var2 = method1\\\\( field1, field2 \\\\); //mutGenLimit 1\"));\n\t\tmceJTD_3.add(Pattern.compile(\"int var3 = method1\\\\( this\\\\.field1, field2 \\\\); //mutGenLimit 1\"));\n\t\tmceJTD_3.add(Pattern.compile(\"int var3 = this\\\\.method1\\\\( field1, field2 \\\\); //mutGenLimit 1\"));\n\t\tmceJTD_3.add(Pattern.compile(\"int var4 = method1\\\\( this\\\\.method1\\\\( this\\\\.field1, this\\\\.method2\\\\( this\\\\.field2, this\\\\.field3 \\\\) \\\\), 0 \\\\); //mutGenLimit 1\"));\n\t\tmceJTD_3.add(Pattern.compile(\"int var4 = this\\\\.method1\\\\( method1\\\\( this\\\\.field1, this\\\\.method2\\\\( this\\\\.field2, this\\\\.field3 \\\\) \\\\), 0 \\\\); //mutGenLimit 1\"));\n\t\tmceJTD_3.add(Pattern.compile(\"int var4 = this\\\\.method1\\\\( this\\\\.method1\\\\( field1, this\\\\.method2\\\\( this\\\\.field2, this\\\\.field3 \\\\) \\\\), 0 \\\\); //mutGenLimit 1\"));\n\t\tmceJTD_3.add(Pattern.compile(\"int var4 = this\\\\.method1\\\\( this\\\\.method1\\\\( this\\\\.field1, method2\\\\( this\\\\.field2, this\\\\.field3 \\\\) \\\\), 0 \\\\); //mutGenLimit 1\"));\n\t\tmceJTD_3.add(Pattern.compile(\"int var4 = this\\\\.method1\\\\( this\\\\.method1\\\\( this\\\\.field1, this\\\\.method2\\\\( field2, this\\\\.field3 \\\\) \\\\), 0 \\\\); //mutGenLimit 1\"));\n\t\tmceJTD_3.add(Pattern.compile(\"int var4 = this\\\\.method1\\\\( this\\\\.method1\\\\( this\\\\.field1, this\\\\.method2\\\\( this\\\\.field2, field3 \\\\) \\\\), 0 \\\\); //mutGenLimit 1\"));\n\t\tmceJTD_3.add(Pattern.compile(\"\"));\n\t\tmceJTD_3.add(Pattern.compile(\"\"));\n\t\tProperty propJTD_3 = new Property(MutationOperator.JTD,\n\t\t\t\t\t\t\t\t\t\t\t\"test/JTD_3\",\n\t\t\t\t\t\t\t\t\t\t\t\"radiatedMethod\",\n\t\t\t\t\t\t\t\t\t\t\t12,\n\t\t\t\t\t\t\t\t\t\t\t12,\n\t\t\t\t\t\t\t\t\t\t\tmceJTD_3,\n\t\t\t\t\t\t\t\t\t\t\tTestingTools.NO_PATTERN_EXPECTED);\n\t\t\n\t\t//MUTANTS FOLDERS\n\t\tList<MutantInfo> mfJTD_1;\n\t\tList<MutantInfo> mfJTD_2;\n\t\tList<MutantInfo> mfJTD_3;\n\t\t\n\t\t//MUTANTS GENERATION\n\t\tmfJTD_1 = TestingTools.generateMutants(propJTD_1);\n\t\tmfJTD_2 = TestingTools.generateMutants(propJTD_2);\n\t\tmfJTD_3 = TestingTools.generateMutants(propJTD_3);\n\t\t\n\t\t//PARAMETERS\n\t\treturn Arrays.asList(new Object[][] {\n\t\t\t\t{propJTD_1, mfJTD_1},\n\t\t\t\t{propJTD_2, mfJTD_2},\n\t\t\t\t{propJTD_3, mfJTD_3},\n\t\t});\n\t}", "@Test\n public void testBoundsAsCompositesWithMultiEqAndSingleSliceRestrictions()\n {\n CFMetaData cfMetaData = newCFMetaData(Sort.ASC, Sort.ASC, Sort.ASC);\n\n ByteBuffer value1 = ByteBufferUtil.bytes(1);\n ByteBuffer value2 = ByteBufferUtil.bytes(2);\n ByteBuffer value3 = ByteBufferUtil.bytes(3);\n\n // (clustering_0, clustering_1) = (1, 2) AND clustering_2 > 3\n Restriction multiEq = newMultiEq(cfMetaData, 0, value1, value2);\n Restriction singleSlice = newSingleSlice(cfMetaData, 2, Bound.START, false, value3);\n PrimaryKeyRestrictions restrictions = new PrimaryKeyRestrictionSet(cfMetaData.comparator);\n restrictions = restrictions.mergeWith(multiEq).mergeWith(singleSlice);\n\n List<Composite> bounds = restrictions.boundsAsComposites(cfMetaData, Bound.START, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, value3, EOC.END);\n\n bounds = restrictions.boundsAsComposites(cfMetaData, Bound.END, QueryOptions.DEFAULT);\n assertEquals(1, bounds.size());\n assertComposite(bounds.get(0), value1, value2, EOC.END);\n }", "@Override\n public CycList<Object> queryVariables(final CycList<CycVariable> variables,\n final CycList<Object> query,\n final CycObject mt,\n final InferenceParameters queryProperties)\n throws CycConnectionException, com.cyc.base.exception.CycApiException {\n return queryVariablesLow(variables, query, mt, queryProperties, 0);\n }", "@Test\n public void test_lowerBound() {\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(0.0d, new double[] {1, 2, 3})).isEqualTo(0);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(0.5d, new double[] {1, 2, 3})).isEqualTo(0);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(0.9999d, new double[] {1, 2, 3})).isEqualTo(0);\n // good input\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(1.0d, new double[] {1, 2, 3})).isEqualTo(0);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(1.0001d, new double[] {1, 2, 3})).isEqualTo(0);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(1.9999d, new double[] {1, 2, 3})).isEqualTo(0);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(2.0d, new double[] {1, 2, 3})).isEqualTo(1);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(2.0001d, new double[] {1, 2, 3})).isEqualTo(1);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(2.9999d, new double[] {1, 2, 3})).isEqualTo(1);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(3.0d, new double[] {1, 2, 3})).isEqualTo(2);\n // bad input, but still produces good output\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(3.0001d, new double[] {1, 2, 3})).isEqualTo(2);\n // check zero\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(-1.0d, new double[] {-1, 0, 1})).isEqualTo(0);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(-0.9999d, new double[] {-1, 0, 1})).isEqualTo(0);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(-0.0001d, new double[] {-1, 0, 1})).isEqualTo(0);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(-0.0d, new double[] {-1, 0, 1})).isEqualTo(1);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(0.0d, new double[] {-1, 0, 1})).isEqualTo(1);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(1.0d, new double[] {-1, 0, 1})).isEqualTo(2);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(1.5d, new double[] {-1, 0, 1})).isEqualTo(2);\n }", "@Test\n public void testStrategyDifference() {\n RangeTree splittable = ranges(\"12[3-5]xx\", \"12[3-9]x\");\n assertThat(factor(splittable, REQUIRE_EQUAL_EDGES))\n .containsExactly(ranges(\"12[3-5]xx\"), ranges(\"12[3-9]x\"))\n .inOrder();\n assertThat(factor(splittable, ALLOW_EDGE_SPLITTING))\n .containsExactly(ranges(\"12[3-5]xx\", \"12[3-9]x\"));\n\n // In this case, the [3-5] edge in the first factor in only a partial overlap with the [4-9]\n // edge we are trying to merge in. Now both strategies will prefer to treat the shorter path\n // as a separate factor, since there's no clean way to merge into the existing edge.\n RangeTree unsplittable = ranges(\"12[3-5]xx\", \"12[4-9]x\");\n assertThat(factor(unsplittable, REQUIRE_EQUAL_EDGES))\n .containsExactly(ranges(\"12[3-5]xx\"), ranges(\"12[4-9]x\"))\n .inOrder();\n assertThat(factor(unsplittable, ALLOW_EDGE_SPLITTING))\n .containsExactly(ranges(\"12[3-5]xx\"), ranges(\"12[4-9]x\"))\n .inOrder();\n\n // TODO: Find a non-complex example where REQUIRE_EQUAL_EDGES yeilds smaller regex.\n // Approximately 50 out of the 1000+ regex's in the XML get smaller with REQUIRE_EQUAL_EDGES.\n }" ]
[ "0.58519685", "0.5177944", "0.5082667", "0.49668336", "0.4884741", "0.47133583", "0.46993124", "0.4664217", "0.4629112", "0.46021008", "0.45906734", "0.45747724", "0.45600218", "0.44943342", "0.445107", "0.43898678", "0.43589196", "0.43472672", "0.43437177", "0.4334192", "0.43308207", "0.4324099", "0.4280003", "0.42551252", "0.4253157", "0.42289126", "0.41598517", "0.41196623", "0.41096422", "0.41014105", "0.40987787", "0.40874577", "0.40832508", "0.40760824", "0.40631607", "0.40610942", "0.40564704", "0.40551758", "0.40543148", "0.40192127", "0.4012639", "0.39875102", "0.39680687", "0.39549637", "0.395314", "0.395288", "0.3952836", "0.393497", "0.3931142", "0.39291707", "0.3923026", "0.39130193", "0.38975236", "0.38909113", "0.38857", "0.38846", "0.38832825", "0.3872996", "0.38685855", "0.3867725", "0.38677108", "0.38654226", "0.3859394", "0.38545424", "0.38484073", "0.3841846", "0.38372728", "0.38366497", "0.38342306", "0.38330796", "0.38221148", "0.38179857", "0.3814204", "0.38110688", "0.38084748", "0.3806267", "0.38056487", "0.3803118", "0.37983477", "0.3797028", "0.37968588", "0.3789989", "0.37874255", "0.37793663", "0.3774419", "0.37696856", "0.37669724", "0.3765233", "0.3759339", "0.37542957", "0.37516353", "0.3749812", "0.37497056", "0.37446418", "0.37430614", "0.3742221", "0.37420505", "0.37289408", "0.37227467", "0.37200683" ]
0.6208901
0
Builds your own search strategy based on unary decisions, that is, decisions can be applied but not refuted.
public static IntStrategy once(VariableSelector<IntVar> VAR_SELECTOR, IntValueSelector VAL_SELECTOR, DecisionOperator<IntVar> DEC_OPERATOR, IntVar... VARS){ return new Once(VARS, VAR_SELECTOR, VAL_SELECTOR, DEC_OPERATOR); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Search createSearch(String searchText)\n\t\t{\n\t\t\tStringBuilder sb = new StringBuilder(searchText);\n\t\t\ttrim(sb);\n\t\t\tSearch current = null;\n\t\t\twhile(sb.length() > 0)\n\t\t\t{\n\t\t\t\tboolean not = false;\n\t\t\t\tif(sb.length() > 1 && lower(sb.charAt(0)) == 'o' && lower(sb.charAt(1)) == 'r')\n\t\t\t\t{ // OR operator\n\t\t\t\t\tsb.delete(0, 2);\n\t\t\t\t\tExpressionSearch exp = exp(false);\n\t\t\t\t\texp.add(current);\n\t\t\t\t\tcurrent = exp;\n\t\t\t\t\ttrim(sb);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\telse if(sb.length() > 2 && lower(sb.charAt(0)) == 'a' && lower(sb.charAt(1)) == 'n'\n\t\t\t\t\t&& lower(sb.charAt(2)) == 'd')\n\t\t\t\t{\n\t\t\t\t\tsb.delete(0, 3);\n\t\t\t\t\ttrim(sb);\n\t\t\t\t}\n\t\t\t\telse if(sb.length() > 1 && sb.charAt(0) == '!')\n\t\t\t\t{\n\t\t\t\t\tsb.delete(0, 1);\n\t\t\t\t\ttrim(sb);\n\t\t\t\t\tnot = true;\n\t\t\t\t}\n\n\t\t\t\tSearch next;\n\t\t\t\tif(sb.charAt(0) == '(')\n\t\t\t\t{\n\t\t\t\t\tint c = goPastParen(sb, 0);\n\t\t\t\t\tString nextExpr = sb.substring(1, c).trim();\n\t\t\t\t\tif(nextExpr.length() == 0)\n\t\t\t\t\t\tthrow new IllegalArgumentException(\"Empty parenthetical expression\");\n\t\t\t\t\tnext = createSearch(nextExpr);\n\t\t\t\t\tsb.delete(0, c + 1);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tnext = parseNext(sb);\n\t\t\t\tif(not)\n\t\t\t\t{\n\t\t\t\t\tNotSearch notS = not();\n\t\t\t\t\tnotS.setOperand(next);\n\t\t\t\t\tnext = notS;\n\t\t\t\t}\n\n\t\t\t\tif(current instanceof ExpressionSearch\n\t\t\t\t\t&& ((ExpressionSearch) current).getOperandCount() == 1)\n\t\t\t\t\t((ExpressionSearch) current).add(next);\n\t\t\t\telse if(current != null)\n\t\t\t\t{\n\t\t\t\t\tExpressionSearch exp = exp(true);\n\t\t\t\t\texp.addOps(current, next);\n\t\t\t\t\tcurrent = exp;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tcurrent = next;\n\n\t\t\t\ttrim(sb);\n\t\t\t}\n\t\t\tif(current instanceof ExpressionSearch)\n\t\t\t\t((ExpressionSearch) current).simplify();\n\t\t\treturn current;\n\t\t}", "public abstract Solution<T> search(Searchable<T> s);", "public interface SearchAlgorithm {\n\t/**\n\t * Searches the state space for a solution.\n\t * @param root\n\t * The root state to begin search from.\n\t * @param expanded_list\n\t * The expanded list in order of expansion. Filled by function.\n\t * @param goal\n\t * The goal state representation used to test if we reached the goal state.\n\t * @return\n\t * The search results containing all needed information about the search and the results.\n\t */\n\tSearchResult search(State root, List<State> expanded_list, State goal);\n}", "public abstract Search defaultSearch(StringBuilder sb);", "public interface SearchStrategy<T> {\n\t\n\t/**\n\t * Sucht den gewünschten Knoten.\n\t * @return gesuchten Knoten - wenn nicht gefunden, dann null.\n\t */\n\tpublic Node<T> search(T value, Node<T> root);\n\t\n\t/**\n\t * Gibt den Pfad der zuletzt ausgeführten Suche zurück.\n\t * \n\t * @return Liste der Knoten, die durchsucht wurden.\n\t */\n\tpublic ArrayList<Node<T>> getPath();\n}", "public MagicSearch createMagicSearch();", "public abstract Search create(String search, SearchBuilder builder);", "public interface TraversalStrategy {\n\n public static final int SEARCH_FOCUS_UNKNOWN = 0;\n public static final int SEARCH_FOCUS_FORWARD = 1;\n public static final int SEARCH_FOCUS_BACKWARD = 2;\n public static final int SEARCH_FOCUS_LEFT = 3;\n public static final int SEARCH_FOCUS_RIGHT = 4;\n public static final int SEARCH_FOCUS_UP = 5;\n public static final int SEARCH_FOCUS_DOWN = 6;\n\n @IntDef({SEARCH_FOCUS_FORWARD, SEARCH_FOCUS_BACKWARD,\n SEARCH_FOCUS_LEFT, SEARCH_FOCUS_RIGHT, SEARCH_FOCUS_UP, SEARCH_FOCUS_DOWN})\n @Retention(RetentionPolicy.SOURCE)\n public @interface SearchDirection {}\n\n @IntDef({SEARCH_FOCUS_UNKNOWN,\n SEARCH_FOCUS_FORWARD, SEARCH_FOCUS_BACKWARD,\n SEARCH_FOCUS_LEFT, SEARCH_FOCUS_RIGHT, SEARCH_FOCUS_UP, SEARCH_FOCUS_DOWN})\n @Retention(RetentionPolicy.SOURCE)\n public @interface SearchDirectionOrUnknown {}\n\n /**\n * The method searches next node to be focused\n * @param startNode - pivot node the search is start from\n * @param direction - direction to find focus\n * @return {@link android.support.v4.view.accessibility.AccessibilityNodeInfoCompat} node\n * that has next focus\n */\n public AccessibilityNodeInfoCompat findFocus(AccessibilityNodeInfoCompat startNode,\n @SearchDirection int direction);\n\n /**\n * Finds the initial focusable accessibility node in hierarchy started from root node when\n * searching in the given direction.\n *\n * For example, if {@code direction} is {@link #SEARCH_FOCUS_FORWARD}, then the\n * method should return the first node in the traversal order. If {@code direction} is\n * {@link #SEARCH_FOCUS_BACKWARD} then the method should return the last node\n * in the traversal order.\n *\n * @param root - root node\n * @param direction - the direction to search from\n * @return returns the first node that could be focused\n */\n public AccessibilityNodeInfoCompat focusInitial(AccessibilityNodeInfoCompat root,\n @SearchDirection int direction);\n\n /**\n * Calculating if node is speaking node according to AccessibilityNodeInfoUtils.isSpeakingNode()\n * method is time consuming. Traversal strategy may use cache for already calculated values.\n * If traversal strategy does not need in such cache use it could return null.\n * @return speaking node cache map. Could be null if cache is not used by traversal strategy\n */\n public Map<AccessibilityNodeInfoCompat, Boolean> getSpeakingNodesCache();\n\n /**\n * When there is no need in traversal strategy object it must be recycled before\n * garbage collected\n */\n public void recycle();\n}", "private Search() {}", "SearchResult search(State root, List<State> expanded_list, State goal);", "public interface ISearchable {\n\n\n AState getStartState () throws NullError;\n\n AState getGoalState () throws NullError;\n\n ArrayList<AState> getAllSuccessors (AState state) throws LowBoundInput, OutOfBoundMatrixInput, NullError;\n\n}", "public interface SearchSolver {\n\n /**\n * initializes the algorithm. This method has to be called before calling any other method\n * @param graph the graph of the map where the search takes place\n * @param targetStart the start position for the target (in our case the thief)\n * @param searchStart the start position for the searcher (in our case the police)\n * @param counter the counter object that counts the expanded nodes\n */\n void initialize(Graph graph, Node targetStart, Node searchStart, ExpandCounter counter);\n\n /**\n * gets the shortest path from search start to target\n * @return list of edges that describe the path\n * @throws NoPathFoundException if there is no path to the target\n */\n List<Edge> getPath() throws NoPathFoundException;\n}", "public interface Searcher {\r\n\t\r\n\t/**\r\n\t * Performs a search.\r\n\t * \r\n\t * @param searchComp reference to the text search component\r\n\t * @param forward tells if search is to be performed forward\r\n\t * @param searchLastMatch tells if last search match must be searched/included\r\n\t */\r\n\tvoid performSearch( TextSearchComp searchComp, boolean forward, boolean searchLastMatch );\r\n\t\r\n}", "abstract public boolean performSearch();", "public AbstractSearchEngine() {}", "public interface RuleConstruction extends SelectRule, DeleteRule, UpdateRule {\n\n /**\n * Check whether word is key-word\n *\n * @param word - word\n * @return false - word is not key-word\n * true - word is key-word\n */\n boolean isNotKeyWord(String word);\n\n /**\n * Check whether word is By-word\n *\n * @param currentIndex - word index\n * @param words - list of words\n * @return true - word is correct\n * false - word is not correct\n */\n boolean isByCorrect(int currentIndex, List<String> words);\n\n /**\n * Check whether word is And-word or Or-word\n *\n * @param currentIndex - word index\n * @param words - list of words\n * @return true - word is correct\n * false - word is not correct\n */\n boolean isAndOrCorrect(int currentIndex, List<String> words);\n\n /**\n * Check whether word is Between-word\n *\n * @param currentIndex - word index\n * @param words - list of words\n * @return true - word is correct\n * false - word is not correct\n */\n boolean isBetweenCorrect(int currentIndex, List<String> words);\n}", "Boolean getSearchObjective();", "public interface SearchInterface {\n int ACTION_TYPE_AMBIGUOUS = 1;\n int ACTION_TYPE_SWITCH_CHANNEL = 2;\n int ACTION_TYPE_SWITCH_INPUT = 3;\n\n /**\n * Search channels, inputs, or programs.\n * This assumes that parental control settings will not be change while searching.\n *\n * @param action One of {@link #ACTION_TYPE_SWITCH_CHANNEL}, {@link #ACTION_TYPE_SWITCH_INPUT},\n * or {@link #ACTION_TYPE_AMBIGUOUS},\n */\n List<SearchResult> search(String query, int limit, int action);\n}", "abstract public void search();", "public QueryResultBuilder<T> applySearch(Option<Search> search);", "public Strategy<S, Integer> buildStrategy() {\n\t\tStrategy<S, Integer> result = new Strategy<S, Integer>();\n\n\t\tSet<S> winningStates = this.getWinningStates();\n\n\t\tfor (S state : losingStates) {\n\t\t\tStrategyState<S, Integer> source = new StrategyState<S, Integer>(\n\t\t\t\t\tstate, DUMMY_GOAL);\n\t\t\tSet<StrategyState<S, Integer>> successors = new HashSet<StrategyState<S, Integer>>();\n\t\t\t// if its uncontrollable and winning it must have winning succesors\n\t\t\tfor (S succ : this.game.getSuccessors(state)) {\n\t\t\t\tif (!winningStates.contains(succ)) {\n\t\t\t\t\tStrategyState<S, Integer> target = new StrategyState<S, Integer>(\n\t\t\t\t\t\t\tsucc, DUMMY_GOAL);\n\t\t\t\t\tsuccessors.add(target);\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult.addSuccessors(source, successors);\n\t\t}\n\t\treturn result;\n\t}", "@Override\n\tpublic boolean startSearch() {\n\t\tString str = \"\";\n\t\t\n\t\tDimension d = view.getInit();\n\t\tif (d == null) {\n\t\t\tstr = str + \"Falta la posicion de inicio.\\n\";\n\t\t} else {\n\t\t\ty0 = (int) d.getHeight();\n\t\t\tx0 = (int) d.getWidth();\n\t\t}\n\t\t\n\t\td = view.getGoal();\n\t\tif (d == null) {\n\t\t\tstr = str + \"Falta la posicion de meta.\\n\";\n\t\t} else {\n\t\t\tyf = (int) d.getHeight();\n\t\t\txf = (int) d.getWidth();\n\t\t}\n\t\t\n\t\tif (view.isBreadth()) {\n\t\t\tstrategy = new Breadth();\n\t\t} else if (view.isDepth()) {\n\t\t\tstrategy = new Depth();\n\t\t} else if (view.isAStar()) {\n\t\t\tstrategy = new AStar();\n\t\t\tif (view.isH0()) {\n\t\t\t\theuristic = Horse.H0;\n\t\t\t} else if (view.isH1()) {\n\t\t\t\theuristic = Horse.H1;\n\t\t\t} else if (view.isH2()) {\n\t\t\t\theuristic = Horse.H2;\n\t\t\t} else\n\t\t\t\tstr = str + \"Falta por escoger el tipo de heur’stica.\\n\";\n\t\t} else\n\t\t\tstr = str + \"Falta la estrategia de bœsqueda.\\n\";\n\t\t\n\t\tboard = view.getBoard();\n\t\t\n\t\tif (str.equals(\"\")) {\n\t\t\trootNode = new Node(new Horse(x0,y0,xf,yf, board, heuristic));\n\t\t}\n\t\t\n\t\tif (view.isTree()) {\n\t\t\tif (str.equals(\"\"))\n\t\t\t\tsearch = new Tree(rootNode, strategy);\n\t\t} else if (view.isGraph()) {\n\t\t\tif (str.equals(\"\"))\n\t\t\t\tsearch = new Graph(rootNode, strategy);\n\t\t} else \n\t\t\tstr = str + \"Falta el algoritmo de bœsqueda.\\n\";\n\t\t\n\t\tif (!str.equals(\"\")) {\n\t\t\tview.showError(str);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tgoSearch();\n\t\treturn true;\n\t}", "private BFSRunner getSearcher(Predicate<Cell> isAccessible, Predicate<Cell> isGoal) {\n\t\treturn new BFSRunner(map, msgUtil, currentCell, isAccessible, isGoal, actionQueue);\n\t}", "public SearchQuery build() {\n this._Web_search.set_maxDepth(_maxDepth);\n this._Web_search.set_maxResults(_maxResults);\n this._Web_search.set_threshold(_threshold);\n this._Web_search.set_beamWidth(_beamWidth);\n if (heuristicSearchType == null) {\n this._Web_search.setHeuristicSearchType(Enums.HeuristicSearchType.BEST_FIRST);\n } else {\n this._Web_search.setHeuristicSearchType(heuristicSearchType);\n }\n\n return new SearchQuery(this._query, this._Web_search);\n }", "public abstract S getSearch();", "public interface SearchService {\n\n /**\n * Parameter that is appended to the generated links that contains the positive search terms and phrases of the\n * search expression. For several terms it occurs several times.\n */\n String PARAMETER_SEARCHTERM = \"search.term\";\n\n /**\n * Represents a result of the search consisting of a target page and one or more matching subresources. For use by\n * the search result renderer.\n */\n interface Result {\n\n /** The page which contains matches. */\n @NotNull\n Resource getTarget();\n\n /** The content child of the page which contains matches. */\n @NotNull\n Resource getTargetContent();\n\n /** A link that shows the target, including search terms with {@link #PARAMETER_SEARCHTERM} */\n @NotNull\n String getTargetUrl();\n\n /** The title of the search result. */\n @NotNull\n String getTitle();\n\n /** The score of the search result. */\n Float getScore();\n\n /**\n * One or more descendants of {@link #getTarget()} that potentially match the search expression. Mostly useful\n * for generating excerpts; can contain false positives in some search algorithms.\n */\n @NotNull\n List<Resource> getMatches();\n\n /** The fulltext search expression for which this result was found. */\n @NotNull\n String getSearchExpression();\n\n /**\n * A basic excerpt from the matches that demonstrates the occurrences of the terms from {@link\n * #getSearchExpression()} in this result. Might be empty if not applicable (e.g. if the search terms were found\n * in meta information). If there are several matches, we just give one excerpt. You might want to provide your\n * own implementation for that to accommodate for specific requirements.\n *\n * @return a text with the occurrences of the words marked with HTML tag em .\n */\n @NotNull\n String getExcerpt() throws SearchTermParseException;\n }\n\n /**\n * Fulltext search for resources. The resources are grouped if they are subresources of one target page, as\n * determined by the parameter targetResourceFilter.\n * <p>\n * Limitations: if the searchExpression consists of several search terms (implicitly combined with AND) this finds\n * only resources where a single property matches the whole search condition, i.e., all those terms. If several\n * resources of a page contain different subsets of those terms, the page is not found.\n *\n * @param context The context we use for the search.\n * @param selectors a selector string to determine the right search strategy, e.g. 'page'\n * @param root Optional parameter for the node below which we search.\n * @param searchExpression Mandatory parameter for the fulltext search expression to search for. For the syntax\n * see\n * {@link QueryConditionDsl.QueryConditionBuilder#contains(String)}\n * . It is advisable to avoid using AND and OR.\n * @param searchFilter an optional filter to drop resources to ignore.\n * @return possibly empty list of results\n * @see com.composum.sling.core.mapping.jcr.ResourceFilterMapping\n */\n @NotNull\n List<Result> search(@NotNull BeanContext context, @NotNull String selectors,\n @NotNull String root, @NotNull String searchExpression, @Nullable ResourceFilter searchFilter,\n int offset, @Nullable Integer limit)\n throws RepositoryException, SearchTermParseException;\n\n\n interface LimitedQuery {\n\n /**\n * Executes the query with the given limit; returns a pair of a boolean that is true when we are sure that all\n * results have been found in spite of the limit, and the results themselves.\n */\n Pair<Boolean, List<Result>> execQuery(int matchLimit);\n }\n\n /**\n * Execute the query with raising limit until the required number of results is met. We don't know in advance how\n * large we have to set the limit in the query to get all neccesary results, since each page can have an a priori\n * unknown number of matches. Thus, the query is executed with an estimated limit, and is reexecuted with tripled\n * limit if the number of results is not sufficient and there are more limits.\n *\n * @return up to limit elements of the result list with the offset first elements skipped.\n */\n @NotNull\n List<Result> executeQueryWithRaisingLimits(LimitedQuery limitedQuery, int offset, Integer limit);\n}", "CampusSearchQuery generateQuery();", "private Operator findOperatorToResolve(Predicate predToResolve) throws Exception {\n\t\tfor (Operator op : this.operators) {\n\t\t\tOperator opCopy = op.getClass().newInstance();\n\t\t\tfor (Predicate predCandidate : opCopy.getAdd().toList()) {\n\t\t\t\tif (predCandidate.isCompatibleTo(predToResolve)) {\n\t\t\t\t\t// instantiate opCopy with predToResolve\n\t\t\t\t\tfor (int i = 0; i < predToResolve.getValence(); i++) {\n\t\t\t\t\t\tif (!predCandidate.getArgument(i).isInstantiated()) {\n\t\t\t\t\t\t\tpredCandidate.getArgument(i).instantiate(predToResolve.getArgument(i).getValue());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn opCopy;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\tthrow new RuntimeException(\"There was no operator found to resolve a predicate. There is no possible plan.\");\n\t}", "public Solution solve(ISearchable s) {\n return null;\n }", "@Override\n protected Move makeDecision() {\n myTurn = index();\n /* block the nearest + most effective player (as in, people who arent blocked) */\n ArrayList<Move> pathMoves = new ArrayList<>();\n ArrayList<Move> playMoves = new ArrayList<>();\n ArrayList<Move> discardMoves = new ArrayList<>();\n Map<Integer, Card> destroyCards = new HashMap<Integer, Card>();\n Map<Integer, Card> repairCards = new HashMap<Integer, Card>();\n Map<Integer, Card> blockCards = new HashMap<Integer, Card>();\n Map<Integer, Card> pathCards = new HashMap<Integer, Card>();\n Set<Position> reachable = game().board().getReachable();\n canSee=false;\n canMove=false;\n canBlock=false;\n canRockfall=false;\n canRepair=false;\n int len = hand().size();\n for (int i = 0; i < len; ++i) {\n Card c = hand().get(i);\n if (c instanceof PathCard && !isSabotaged()) {\n pathCards.put(i,c);\n// pathMoves.addAll(generatePossiblePaths(i, (PathCard) c));\n canMove = true;\n }\n if (c instanceof PlayerActionCard) {\n// playMoves.addAll(generatePossiblePlayerActions(i, (PlayerActionCard) c));\n if(c.type()== Card.Type.BLOCK) {\n blockCards.put(i, c);\n canBlock=true;\n }\n else if(c.type()== Card.Type.REPAIR) {\n repairCards.put(i, c);\n canRepair=true;\n }\n }\n if (c.type() == Card.Type.MAP) {\n// playMoves.addAll(generatePossibleMap(i));\n mapIndex = i;\n canSee = true;\n }\n if (c.type() == Card.Type.ROCKFALL) {\n destroyCards.put(i,c);\n// playMoves.addAll(generatePossibleRockfall(i));\n canRockfall = true;\n }\n discardMoves.add(Move.NewDiscardMove(index(), i));\n }\n\n if(canSee) {\n //sum of all heuristics\n double sumGoal[] = new double[3];\n for (Position h : reachable) {\n sumGoal[0]+=(9-(8-h.x)+ 5-(4-h.y));\n sumGoal[1]+=(9-(8-h.x)+ 5-(2-h.y));\n sumGoal[2]+=(9-(8-h.x)+ 5-(-h.y));\n }\n //update goldProb\n for(int i=0; i<3; i++) {\n int seenSum=0;\n for(int j=0; j<numPlayers; j++) {\n if(j!=myTurn) {\n if(haveSeen.get(j)[i]==1) seenSum++;\n }\n }\n goldProb[i] = (i==1?0.5:1)*(1-haveSeen.get(myTurn)[i])*(mapRate*(seenSum/numPlayers)+(sumGoal[i]/10));\n }\n }\n\n// System.out.println(hand());\n// System.out.println(pathMoves);\n\n\n if (role() == Role.GOLD_MINER) {\n //Path\n if(canSee && !goldFound) {\n int selection=0;\n double maxProb=goldProb[0];\n for(int i=0; i<3; i++) {\n if(goldProb[i]>maxProb) {\n maxProb = goldProb[i];\n selection=i;\n }\n }\n Move look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.TOP);\n switch(selection) {\n case 0:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.TOP);\n break;\n case 1:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.MIDDLE);\n break;\n case 2:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.BOTTOM);\n break;\n }\n return look;\n }\n if(canMove) {\n int globalIndex = 0;\n double maxH = 0;\n double oldH;\n Position bp = new Position(0,0);\n boolean rotate = false;\n //Find best path to place;\n Board board = game().board().copy();\n oldH = getClosest(board);\n// System.out.print(getClosest(board)+\" : \");\n for( Map.Entry<Integer, Card> p : pathCards.entrySet()) {\n int index = p.getKey();\n Card path = p.getValue();\n ((PathCard)path).setRotated(false);\n Set<Position> placeable = game().board().getPlaceable((PathCard)path);\n for (Position h : placeable) {\n Board simulated = board.simulatePlaceCardAt((PathCard)path, h.x, h.y);\n// System.out.println(path.type());\n double cH = getClosest(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n maxH = cH;\n rotate=false;\n }\n }\n ((PathCard) path).setRotated(true);\n placeable = game().board().getPlaceable((PathCard)path);\n for (Position h : placeable) {\n Board simulated = board.simulatePlaceCardAt((PathCard)path, h.x, h.y);\n// System.out.println(simulated);\n double cH = getClosest(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n rotate=true;\n maxH = cH;\n }\n }\n }\n// System.out.println(oldH+\": \"+maxH+\" (\"+abs(maxH-oldH)+\")\");\n oldBoard = game().board().copy();\n if(maxH>0 && abs(maxH-oldH)>0.01)\n return Move.NewPathMove(index(), globalIndex, bp.x, bp.y, rotate);\n }\n //Unblock\n if(canRepair) {\n double blockMore = 0.0;\n int targetPlayer = -1;\n int cardIndex = 0;\n for(int i=0; i<numPlayers; i++) {\n //heal self\n if(i == myTurn) {\n for(Map.Entry<Integer, Card> r : repairCards.entrySet()) {\n int index = r.getKey();\n// System.out.println(Arrays.toString(game().playerAt(index()).sabotaged()));\n PlayerActionCard repair = (PlayerActionCard) r.getValue();\n if (game().playerAt(index()).isRepairable(repair.effects())) {\n return Move.NewPlayerActionMove(index(),index, index());\n }\n }\n }\n else if(i!=myTurn) {\n for(Map.Entry<Integer, Card> r : repairCards.entrySet()) {\n int index = r.getKey();\n PlayerActionCard repair = (PlayerActionCard) r.getValue();\n// System.out.println(Arrays.toString(game().playerAt(i).sabotaged()));\n if (game().playerAt(i).isRepairable(repair.effects())) {\n //calculate the should i repair? function\n double shouldIBlockMore = Probability[i]+(0.03*(numPlayers-i));\n if(blockMore<shouldIBlockMore) {\n blockMore = shouldIBlockMore;\n targetPlayer = i;\n cardIndex = index;\n }\n }\n }\n }\n }\n if(blockMore>0.75 && targetPlayer>=0)\n return Move.NewPlayerActionMove(index(), cardIndex, targetPlayer);\n }\n //Block Enemy\n if(canBlock) {\n double blockMore = 0.0;\n int targetPlayer = -1;\n int cardIndex = 0;\n for (int i = 0; i < numPlayers; i++) {\n if (i != myTurn) {\n for (Map.Entry<Integer, Card> b : blockCards.entrySet()) {\n int index = b.getKey();\n PlayerActionCard block = (PlayerActionCard) b.getValue();\n if (game().playerAt(i).isSabotageable(block.effects()[0])) {\n //calculate the should i repair? function\n double shouldIBlockMore = (1 - Probability[i]) * ((1 - Probability[i]) + 0.2 * (numPlayers - i));\n if (blockMore < shouldIBlockMore) {\n blockMore = shouldIBlockMore;\n targetPlayer = i;\n cardIndex = index;\n }\n }\n }\n }\n }\n if(blockMore>0.6 && targetPlayer>=0)\n return Move.NewPlayerActionMove(index(), cardIndex, targetPlayer);\n }\n //Fix (Rockfall)\n if(canRockfall) {\n int globalIndex = 0;\n double maxH = 0.0;\n Position bp = new Position(0,0);\n //Find best path to place;\n Board board = game().board().copy();\n for( Map.Entry<Integer, Card> d : destroyCards.entrySet()) {\n int index = d.getKey();\n Set<Position> destroyable = game().board().getDestroyable();\n for (Position h : destroyable) {\n Board simulated = board.simulateRemoveCardAt(h.x, h.y);\n// System.out.println(path.type());\n double cH = getClosest(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n maxH = cH;\n }\n }\n }\n oldBoard = game().board().copy();\n if(maxH>0)\n return Move.NewRockfallMove(index(), globalIndex, bp.x, bp.y);\n }\n //See map\n\n //Conserve (Find the best card to discard)\n\n //calculate the heuristics and adjust accordingly,\n //choose between playing a card or discarding.\n } else if (role() == Role.SABOTEUR) {\n //See map\n if(canSee && !goldFound) {\n int selection=0;\n //specific for saboteurs\n double maxProb=goldProb[0];\n for(int i=0; i<3; i++) {\n if(goldProb[i]>maxProb) {\n maxProb = goldProb[i];\n selection=i;\n }\n }\n Move look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.TOP);\n switch(selection) {\n case 0:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.TOP);\n break;\n case 1:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.MIDDLE);\n break;\n case 2:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.BOTTOM);\n break;\n }\n return look;\n }\n //Path\n if(canMove) {\n int globalIndex = 0;\n double maxH = 0.0;\n Position bp = new Position(0,0);\n boolean rotate = false;\n //Find best path to place;\n Board board = game().board().copy();\n double oldH = getClosestSabotage(board);\n for( Map.Entry<Integer, Card> p : pathCards.entrySet()) {\n int index = p.getKey();\n Card path = p.getValue();\n ((PathCard)path).setRotated(false);\n Set<Position> placeable = game().board().getPlaceable((PathCard)path);\n for (Position h : placeable) {\n Board simulated = board.simulatePlaceCardAt((PathCard)path, h.x, h.y);\n// System.out.println(path.type());\n double cH = getClosestSabotage(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n maxH = cH;\n rotate=false;\n }\n }\n ((PathCard) path).setRotated(true);\n placeable = game().board().getPlaceable((PathCard)path);\n for (Position h : placeable) {\n Board simulated = board.simulatePlaceCardAt((PathCard)path, h.x, h.y);\n// System.out.println(simulated);\n double cH = getClosestSabotage(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n rotate=true;\n maxH = cH;\n }\n }\n }\n oldBoard = game().board().copy();\n if(maxH>0 && abs(maxH-oldH)>0.01)\n return Move.NewPathMove(index(), globalIndex, bp.x, bp.y, rotate);\n }\n //Unblock Friend\n if(canRepair) {\n double blockMore = 0.0;\n int targetPlayer = -1;\n int cardIndex = 0;\n for(int i=0; i<numPlayers; i++) {\n if(i == myTurn) {\n for(Map.Entry<Integer, Card> r : repairCards.entrySet()) {\n int index = r.getKey();\n PlayerActionCard repair = (PlayerActionCard) r.getValue();\n if (game().playerAt(myTurn).isRepairable(repair.effects())) {\n return Move.NewPlayerActionMove(index(),index, index());\n }\n }\n }\n else if(i!=myTurn) {\n for(Map.Entry<Integer, Card> r : repairCards.entrySet()) {\n int index = r.getKey();\n PlayerActionCard repair = (PlayerActionCard) r.getValue();\n if (game().playerAt(i).isRepairable(repair.effects())) {\n //calculate the should i repair? function\n double shouldIBlockMore = (1-Probability[i])+(0.03*(numPlayers-i));\n if(blockMore<shouldIBlockMore) {\n blockMore = shouldIBlockMore;\n targetPlayer = i;\n cardIndex = index;\n }\n }\n }\n }\n }\n if(blockMore>0.75 && targetPlayer>=0)\n return Move.NewPlayerActionMove(index(), cardIndex, targetPlayer);\n }\n //Block Enemy\n if(canBlock) {\n double blockMore = 0.0;\n int targetPlayer = -1;\n int cardIndex = 0;\n for (int i = 0; i < numPlayers; i++) {\n if (i != myTurn) {\n for (Map.Entry<Integer, Card> b : blockCards.entrySet()) {\n int index = b.getKey();\n PlayerActionCard block = (PlayerActionCard) b.getValue();\n if (game().playerAt(i).isSabotageable(block.effects()[0])) {\n //calculate the should i repair? function\n double shouldIBlockMore = (Probability[i]) * ((Probability[i]) + 0.2 * (numPlayers - i));\n if (blockMore < shouldIBlockMore) {\n blockMore = shouldIBlockMore;\n targetPlayer = i;\n cardIndex = index;\n }\n }\n }\n }\n }\n if(blockMore>0.6 && targetPlayer>=0)\n return Move.NewPlayerActionMove(index(), cardIndex, targetPlayer);\n }\n //Sabotage (Rockfall)\n if(canRockfall) {\n int globalIndex = 0;\n double maxH = 0;\n Position bp = new Position(0,0);\n //Find best path to place;\n Board board = game().board().copy();\n for( Map.Entry<Integer, Card> d : destroyCards.entrySet()) {\n int index = d.getKey();\n Set<Position> destroyable = game().board().getDestroyable();\n for (Position h : destroyable) {\n Board simulated = board.simulateRemoveCardAt(h.x, h.y);\n// System.out.println(path.type());\n double cH = getClosestSabotage(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n maxH = cH;\n }\n }\n }\n oldBoard = game().board().copy();\n if(maxH>0)\n return Move.NewRockfallMove(index(), globalIndex, bp.x, bp.y);\n }\n //Conserve (Find the best card to discard\n\n //calculate the heuristics and adjust accordingly,\n //choose between playing a card or discarding.\n }\n return discardMoves.get(0);\n }", "private SearchAction makeSearchAction(boolean isSearchFree)\r\n throws MakeActionException, InvalidDateRangeException {\r\n if (params.length == 0) {\r\n throw new MakeActionException(SearchAction.ERR_INSUFFICIENT_ARGS);\r\n }\r\n\r\n SearchAction searchAction = new SearchAction(goku);\r\n\r\n // determine if search is to find free slots\r\n if (isSearchFree == true) {\r\n // test if datetime received is free of tasks\r\n searchAction.isSearchFree = isSearchFree;\r\n searchAction.freeDateQuery = parseDate();\r\n if (searchAction.freeDateQuery == null) {\r\n throw new MakeActionException(SearchAction.ERR_NO_VALID_DATE_FOUND);\r\n }\r\n } else {\r\n // search normally\r\n DateTime dq = extractDateQuery();\r\n DateTime dl = extractDeadline();\r\n DateRange dr = extractPeriod();\r\n searchAction.onDateQuery = dq;\r\n searchAction.dline = dl;\r\n searchAction.period = dr;\r\n\r\n // if datequery, deadline or periods are null, ignore keywords\r\n // \"on, by, from, to\"\r\n if (dq == null) {\r\n paramsOnIndex = null;\r\n }\r\n if (dl == null) {\r\n paramsByIndex = null;\r\n }\r\n if (dr == null) {\r\n paramsFromIndex = null;\r\n }\r\n\r\n String title = extractTitle();\r\n if (!title.isEmpty()) {\r\n searchAction.title = title;\r\n }\r\n }\r\n\r\n return searchAction;\r\n }", "TSearchResults searchWithQuery(TSearchQuery searchQuery, SearchParametersAPI overrideParameters, TRepo repo, AreaFactory<TContent, TArea> areaFactory, ContentFactory<TContent> contentFactory);", "public Search applyFilters() {\n if (building.getValue() == null) {\n CustomAlert.warningAlert(\"Please select a building.\");\n return null;\n }\n if (capacity.getCharacters() == null) {\n CustomAlert.warningAlert(\"Please select a capacity.\");\n return null;\n }\n if (nuOfPlugs.getCharacters() == null) {\n CustomAlert.warningAlert(\"Please select the amount of plugs.\");\n return null;\n }\n boolean isScreen = false;\n boolean isBeamer = false;\n if (screen.isSelected()) {\n isScreen = true;\n }\n if (beamer.isSelected()) {\n isBeamer = true;\n }\n int intCapacity;\n String stringCapacity = (String) capacity.getCharacters();\n intCapacity = Integer.parseInt(stringCapacity);\n int intPlugs;\n String stringPlugs = (String) nuOfPlugs.getCharacters();\n intPlugs = Integer.parseInt(stringPlugs);\n return new Search(isScreen, isBeamer, intCapacity, building.getValue(), intPlugs);\n }", "@Override\n\tpublic Object[] advSearchCondition() {\n\t\treturn null;\n\t}", "List<Hybridization> searchByCriteria(PageSortParams<Hybridization> params, HybridizationSearchCriteria criteria);", "public abstract boolean getSensitiveSearch();", "public interface ISearchEngine {\n\n enum SearchParam {\n CORE,\n EXPERIMENT,\n HOST,\n PORT\n }\n\n /**\n * Query engine for searching relevant documents\n * @return\n */\n SearchResponse query(SearchRequest request, Map<SearchParam, String> params);\n\n /**\n * Query search engine for spell correction\n * @param request: spell check request\n * @return\n */\n SpellResponse spellQuery(SearchRequest request, Map<SearchParam, String> params);\n}", "public interface Strategy {\n\n StrategySolution solve(List<Item> items, int weight);\n}", "public RankedSearch(CourseDataCache cache) {\n this.cache = cache;\n this.corpus = cache.getCorpus();\n\n\n setUpMappingsAndShortenings();\n this.whitespaceSuggestions = new HashMap<>();\n this.descriptionSearch = new DescriptionSearch(cache);\n this.courseCodeSearch = new CourseCodeSearch(cache);\n this.titleSearch = new TitleSearch(cache);\n this.smallWords = new HashSet<>();\n setUpSmallWords();\n }", "public Optimizer getOptimizedCriteria() {\r\n\r\n\t\tLog.d(\"Criteria\", \"Inside getOC:\" + isIntelligenceOverridden);\r\n\r\n\t\tif (!isIntelligenceOverridden) {\r\n\r\n\t\t\t/* BATTERY LEVEL - \"HIGH\" */\r\n\t\t\tif (batteryLevel > Constants.BATTERY_LEVEL.HIGH) {\r\n\t\t\t\tLog.d(\"Test\", \"Entered High\");\r\n\t\t\t\toptimizer.setFrequency(Constants.FREQUENCY_LEVEL.HIGH);\r\n\t\t\t\toptimizer.setPriority(Constants.PRIORITY_LEVEL.HIGH);\r\n\t\t\t}\r\n\r\n\t\t\t/* BATTERY LEVEL - \"MEDIUM\" */\r\n\t\t\telse if (batteryLevel > Constants.BATTERY_LEVEL.MEDIUM\r\n\t\t\t\t\t&& batteryLevel <= Constants.BATTERY_LEVEL.HIGH) {\r\n\t\t\t\tLog.d(\"Criteria\", \"Entered Medium\");\r\n\t\t\t\toptimizer.setFrequency(Constants.FREQUENCY_LEVEL.MEDIUM);\r\n\t\t\t\toptimizer.setPriority(Constants.PRIORITY_LEVEL.MEDIUM);\r\n\t\t\t}\r\n\r\n\t\t\t/* BATTERY LEVEL - \"LOW\" */\r\n\t\t\telse if (batteryLevel <= Constants.BATTERY_LEVEL.MEDIUM) {\r\n\t\t\t\tLog.d(\"Criteria\", \"Checking Moderate Mode\");\r\n\t\t\t\tmModerateMode();\r\n\t\t\t}\r\n\t\t\tLog.d(\"Criteria\", \"Returning Op obj\");\r\n\t\t\treturn optimizer;\r\n\t\t}\r\n\r\n\t\tLog.d(\"Criteria\", \"Then continuing\");\r\n\t\tswitch (userScheme) {\r\n\t\tcase \"moderate\":\r\n\t\t\tLog.d(\"Test\", \"Entered Moderate\");\r\n\t\t\tmModerateMode();\r\n\t\t\tbreak;\r\n\t\tcase \"lazy\":\r\n\t\t\tLog.d(\"Test\", \"Lazy\");\r\n\t\t\tmLazyMode();\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tmModerateMode();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn optimizer;\r\n\t}", "public Algorithms.Search<State<E>,HeuristicNode<State<E>,Double>>.Result search(Signature<E> request){\n log.info(\"Initializing composition search problem...\");\n // Composition starts with the request:\n Stopwatch compositionWatch = Stopwatch.createStarted();\n // Build the initial match graph network (first pass)\n ServiceMatchNetwork<E, T> network = discoverer.search(request);\n // Apply optimizations\n Stopwatch optWatch = Stopwatch.createStarted();\n for(NetworkOptimizer<E,T> opt : optimizations){\n network = opt.optimize(network);\n }\n optWatch.stop();\n log.info(\"Graph optimizations done in {}\", optWatch);\n log.info(\"Starting search over a network with {} levels and {} operations\", network.numberOfLevels(), network.listOperations().size());\n // Run search over network\n Algorithms.Search<State<E>,HeuristicNode<State<E>,Double>>.Result searchResult = CompositSearch.create(network).search();\n log.info(\"Optimal composition search finished in {}\", searchResult.getStopwatch().toString());\n log.debug(\" Composition : {}\", searchResult.getOptimalPath());\n log.debug(\" Total iterations : {}\", searchResult.getIterations());\n log.info(\" Composition runpath : {}\", searchResult.getOptimalPath().size()-2);\n log.info(\" Composition services: {}\", searchResult.getGoalNode().getScore());\n log.info(\"Total composition time : {}\", compositionWatch.stop().toString());\n\n List<State<E>> states = searchResult.getOptimalPath();\n List<Set<Operation<E>>> ops = Lists.transform(states, new Function<State<E>, Set<Operation<E>>>() {\n @Override\n public Set<Operation<E>> apply(State<E> state) {\n return state.getStateOperations();\n }\n });\n return searchResult;\n }", "private void applyLocationAlgorithms() {\n List<NodeState> states = new ArrayList<NodeState>();\n List<RemoteNode> nodes = new ArrayList<RemoteNode>(nodeManager.getNodes());\n AlgorithmMatchCriteria criteria;\n\n for (Algorithm la : algorithmManager.getAlgorithms()) {\n if (!la.isEnabled()) continue;\n criteria = algorithmManager.getCriteria(la);\n\n List<Node> filteredNodes = criteria.filter(nodes);\n if (filteredNodes.size() > 0) {\n states.add(la.applyTo(nodeManager.getLocalNode(), filteredNodes));\n }\n }\n for (NodeState s : states) {\n nodeManager.getLocalNode().addPending(s);\n }\n }", "private static Searcher createSearcher(String[] args) {\n if (args.length > 1 && \"duden\".equals(args[1])) {//Use DWDS by default, Duden only on explicit request\n return SearcherFactory.newDuden();\n } else {\n return SearcherFactory.newDwds();\n }\n }", "List<TAlgmntBussRule> findTAlgmntBussRules(SearchFilter<TAlgmntBussRule> searchFilter);", "void searchProbed (Search search);", "protected Criteria constuctCriteria(SearchCriteria searchCriteria, boolean withOrder)\n {\n Criteria criteria = getSession().createCriteria(persistentClass);\n if (searchCriteria == null){\n return criteria;\n }\n constuctCriteria(searchCriteria, criteria, withOrder);\n return criteria;\n }", "public interface IRealTimeSearchAlgorithm {\n\n /**\n * This function will calculate a prefix from the start node to the goal node path\n * @param start - The start node\n * @param goal - The goal node\n * @param numOfNodesToDevelop - The number of nodes to develop in the search\n * @param agent - The agent\n * @return - A prefix from the start node to the goal node path\n */\n public List<Node> calculatePrefix(Node start, Node goal, int numOfNodesToDevelop, Agent agent);\n}", "public interface SolutionSearchService {\n\n\t/**\n\t * Searches for instances matching all or one of the query parameters, depending\n\t * on the isOr parameter.\n\t * \n\t * @param queryParameters\n\t * field-name, field-value pairs. Value may be scalar or array.\n\t * @param isOr\n\t * If true, the query is a disjunction (\"or\"); otherwise the query is\n\t * a conjunction (\"and\").\n\t * @param pageable\n\t * Page and sort criteria\n\t * @return Page of instances, which may be empty.\n\t */\n\tPage<MLPSolution> findSolutions(Map<String, ? extends Object> queryParameters, boolean isOr, Pageable pageable);\n\n\t/**\n\t * Gets a page of instances matching all query parameters.\n\t * \n\t * @param nameKeywords\n\t * Searches the name field for the keywords using case-insensitive\n\t * LIKE after surrounding with wildcard '%' characters; ignored if\n\t * null or empty\n\t * @param descriptionKeywords\n\t * Searches the description field for the keywords using\n\t * case-insensitive LIKE after surrounding with wildcard '%'\n\t * characters; ignored if null or empty\n\t * @param active\n\t * Active status: true or false; required.\n\t * @param ownerIds\n\t * Limits match to solutions with one of the specified values;\n\t * ignored if null or empty\n\t * @param modelTypeCodes\n\t * Limits match to solutions with one of the specified values\n\t * including null (not the 4-character sequence \"null\"); ignored if\n\t * null or empty\n\t * @param accessTypeCodes\n\t * Limits match to solutions containing revisions with one of the\n\t * specified values including null (not the 4-character sequence\n\t * \"null\"); ignored if null or empty\n\t * @param validationStatusCodes\n\t * Limits match to solutions containing revisions with one of the\n\t * specified values including null (not the 4-character sequence\n\t * \"null\"); ignored if null or empty\n\t * @param tags\n\t * Limits match to solutions with one of the specified tags; ignored\n\t * if null or empty\n\t * @param pageable\n\t * Page and sort info\n\t * @return Page of matches\n\t */\n\tPage<MLPSolution> findPortalSolutions(String[] nameKeywords, String[] descriptionKeywords, boolean active,\n\t\t\tString[] ownerIds, String[] modelTypeCodes, String[] accessTypeCodes, String[] validationStatusCodes,\n\t\t\tString[] tags, Pageable pageable);\n\n\t/**\n\t * Gets a page of solutions with a change after the specified date. A match is\n\t * found if the solution's modified field, an associated revision's modified\n\t * field, or an associated artifact's modified field has a value larger than the\n\t * specified date. Only finds solutions that have 1+ revision(s) and in turn 1+\n\t * artifact(s). A freshly created solution with no revisions will not be found.\n\t * \n\t * @param active\n\t * Active status: true or false; required\n\t * @param accessTypeCodes\n\t * Limits match to solutions with one of the specified values\n\t * including null (not the 4-character sequence \"null\"); ignored if\n\t * null or empty\n\t * @param validationStatusCodes\n\t * Limits match to solutions with one of the specified values\n\t * including null (not the 4-character sequence \"null\"); ignored if\n\t * null or empty\n\t * @param modifiedDate\n\t * Last-modified date\n\t * @param pageable\n\t * Page and sort info\n\t * @return Page of matches\n\t */\n\tPage<MLPSolution> findSolutionsByModifiedDate(boolean active, String[] accessTypeCodes,\n\t\t\tString[] validationStatusCodes, Date modifiedDate, Pageable pageable);\n\n}", "public interface ISearch {\n\n Object build();\n}", "public SearchConditionSB() {\r\n }", "TSearchResults createSearchResults(TSearchQuery searchQuery);", "public interface SearchQuerySet extends QuerySet\n{\n\n // for AbstractSearch\n public static final int STAT_MODELS = 1;\n public static final int STAT_CLUSTERS = 2;\n public static final int STAT_GENOMES = 4;\n public static final int STAT_MODEL_CLUSTERS = 8;\n\n public String getStatsById(Collection data);\n public String getStatsByQuery(String query);\n public String getStatsById(Collection data,int stats);\n public String getStatsByQuery(String query,int stats);\n \n // for BlastSearch\n public String getBlastSearchQuery(Collection dbNames, Collection keys, KeyTypeUser.KeyType keyType);\n \n //for ClusterIDSearch\n public String getClusterIDSearchQuery(Collection input, int limit, int[] DBs, KeyTypeUser.KeyType keyType);\n \n // for ClusterNameSearch\n public String getClusterNameSearchQuery(Collection input, int limit, int[] DBs, KeyTypeUser.KeyType keyType);\n \n // for DescriptionSearch\n public String getDescriptionSearchQuery(Collection input, int limit, int[] DBs, KeyTypeUser.KeyType keyType);\n \n // for GoSearch \n public String getGoSearchQuery(Collection input, int limit, KeyTypeUser.KeyType keyType);\n \n // for GoTextSearch\n public String getGoTextSearchQuery(Collection input, int limit, KeyTypeUser.KeyType keyType);\n \n // for IdSearch\n public String getIdSearchQuery(Collection input, int limit, int[] DBs, KeyTypeUser.KeyType keyType);\n \n // for QueryCompSearch\n public String getQueryCompSearchQuery(String comp_id, String status, KeyTypeUser.KeyType keyType);\n \n // for QuerySearch\n public String getQuerySearchQuery(String queries_id, KeyTypeUser.KeyType keyType); \n \n // for SeqModelSearch\n public String getSeqModelSearchQuery(Collection model_ids, KeyTypeUser.KeyType keyType);\n \n // for UnknowclusterIdSearch\n public String getUnknownClusterIdSearchQuery(int cluster_id, KeyTypeUser.KeyType keyType);\n \n // for ProbeSetSearch\n public String getProbeSetSearchQuery(Collection input, int limit, KeyTypeUser.KeyType keyType);\n \n // for ProbeSetKeySearch\n public String getProbeSetKeySearchQuery(Collection input, int limit, KeyTypeUser.KeyType keyType);\n \n // for QueryTestSearch\n public String getQueryTestSearchQuery(String query_id, String version, String genome_id);\n \n // for QueryStatsSearch\n public String getQueryStatsSearchQuery(List query_ids,List DBs);\n \n // for PskClusterSearch\n public String getPskClusterSearchQuery(int cluster_id,KeyTypeUser.KeyType keyType);\n \n // for ClusterCorrSearch\n public String getClusterCorrSearchQuery(int cluster_id, int psk_id, KeyTypeUser.KeyType keyType);\n \n // for UnknownGenesSearch\n public String getUnknownGenesSearchQuery(Collection sources, KeyTypeUser.KeyType keyType);\n \n}", "public interface Searcher<T> {\r\n\t\r\n\t//the search method\r\n\tpublic Solution<T> search(Searchable<T> s);\r\n\t\r\n\t//get how many nodes were evaluated by the algorithm\r\n\tpublic int getNumberOfNodesEvaluated();\r\n}", "public NotSearch()\n\t\t{\n\t\t}", "Algorithm createAlgorithm();", "public TinySearchEngine()\n {\n this.myIndex = new HashMap();\n this.documentData = new HashMap();\n this.sorted = false;\n this.sort = new Sort();\n this.search = new BinarySearch();\n }", "void stateBacktracked (Search search);", "@Test\n public void test_shortcut_needed_bidirectional() {\n CHPreparationGraph graph = CHPreparationGraph.edgeBased(5, 4, (in, via, out) -> in == out ? 10 : 0);\n int edge = 0;\n graph.addEdge(0, 1, edge++, 10, 10);\n graph.addEdge(1, 2, edge++, 10, 10);\n graph.addEdge(2, 3, edge++, 10, 10);\n graph.addEdge(3, 4, edge++, 10, 10);\n graph.prepareForContraction();\n EdgeBasedWitnessPathSearcher searcher = new EdgeBasedWitnessPathSearcher(graph);\n searcher.initSearch(0, 1, 2, new EdgeBasedWitnessPathSearcher.Stats());\n double weight = searcher.runSearch(3, 6, 20.0, 100);\n assertTrue(Double.isInfinite(weight));\n }", "private Suggestion buildSuggestion(String linearization,\n Interpretation interpretation,\n Map<String, WordType> originalWords, boolean matchAllWords) {\n String[] words = linearization.split(\"\\\\s+\");\n\n Map<String, Integer> namesMissing = new HashMap(\n interpretation.getNameTypeCounts().counts);\n\n int additionalNamesCount = 0;\n\n Set<String> wordsNotMatched = new HashSet<>(originalWords.keySet());\n for (Entry<String, WordType> entry : originalWords.entrySet()) {\n if (entry.getValue() == WordType.Name) {\n wordsNotMatched.remove(entry.getKey());\n }\n }\n int additionalGrammarWordsCount = 0;\n\n\n for (String word : words) {\n\n //name word\n if (defTempl.isVariable(word)) {\n String nameType = word.substring(2, word.length() - 2);\n if (namesMissing.containsKey(nameType)) {\n Integer missingCount = namesMissing.get(nameType);\n if (missingCount > 1) {\n namesMissing.put(nameType, missingCount - 1);\n }\n else {\n namesMissing.remove(nameType);\n }\n }\n else {\n additionalNamesCount++;\n }\n }\n //grammar word\n else {\n String lowerCaseWord = word.toLowerCase();\n\n if (wordsNotMatched.contains(lowerCaseWord)) {\n wordsNotMatched.remove(lowerCaseWord);\n }\n else {\n additionalGrammarWordsCount++;\n }\n }\n }\n\n //if removing words from query is not allowed\n if (matchAllWords && !wordsNotMatched.isEmpty()) {\n return null;\n }\n\n int grammarWordsAltered = wordsNotMatched.size();\n int grammarWordsAdded = additionalGrammarWordsCount - grammarWordsAltered;\n\n return new Suggestion(linearization, false,\n additionalNamesCount, grammarWordsAdded, grammarWordsAltered);\n }", "public final Nfa buildNoAccept() {\n return buildInternal();\n }", "OperationalizingSoftgoal createOperationalizingSoftgoal();", "public search() {\n }", "public Search(UserInput userInput) {\n\t\tthis.userInput = userInput;\n\t\tstorage = Storage.getInstance();\n\t\tfeedback = Feedback.getInstance();\n\t\tnew ArrayList<Task>();\n\t}", "private static UriMatcher buildUriMatcher() {\r\n\r\n\t\tUriMatcher matcher = new UriMatcher(UriMatcher.NO_MATCH);\r\n\t\tmatcher.addURI(AUTHORITY, SearchManager.SUGGEST_URI_PATH_QUERY, SEARCH_SUGGEST);\r\n\t\tmatcher.addURI(AUTHORITY, SearchManager.SUGGEST_URI_PATH_QUERY + \"/*\", SEARCH_SUGGEST);\r\n\t\tmatcher.addURI(AUTHORITY, SearchManager.SUGGEST_URI_PATH_SHORTCUT, SHORTCUT_REFRESH);\r\n\t\tmatcher.addURI(AUTHORITY, SearchManager.SUGGEST_URI_PATH_SHORTCUT + \"/*\", SHORTCUT_REFRESH);\r\n\t\treturn matcher;\r\n\t}", "@Override\r\n\tpublic void search() {\n\r\n\t}", "interface BuildingRepositoryCustom {\n\n /**\n * The constant ALL_RESULTS.\n */\n int ALL_RESULTS = 0;\n\n /**\n * Find by filter text list.\n *\n * @param words the words\n * @param justIds the just ids\n * @return the list\n */\n List findByFilterText(Set<String> words, boolean justIds);\n\n /**\n * Find building coordinates by type list.\n *\n * @param type the type\n * @return the list\n */\n List<Building> findBuildingCoordinatesByType(String type);\n\n /**\n * Find by distance list.\n *\n * @param latitude the latitude\n * @param longitude the longitude\n * @param maxDistance the max distance\n * @param maxResults the max results\n * @return the list\n */\n List findByDistance(Double latitude, Double longitude, int maxDistance, int maxResults);\n}", "public void build(FuzzyEngine engine) throws FuzzyEngineException;", "@Override\n\tpublic void before(Method method, Object[] args, Object obj) throws Throwable {\n\t\tMap<String, Object> conditionMap = new HashMap<String, Object>();\n\t\t\n\t\tList<Condition> conditionList = new ArrayList<Condition>();\n\t\tfor (int i = 0; i < args.length; i++) {\n\t\t\tif (args[i] instanceof Search) {\n\t\t\t\tSet<String> nameSet = new HashSet<String>();\n\t\t\t\tCondition c = null;\n\t\t\t\tServletRequest request = RequestContext.getCurrentContext().getRequest();\n\t\t\t\t@SuppressWarnings(\"rawtypes\")\n\t\t\t\tEnumeration enu = request.getParameterNames();\n\t\t\t\twhile (enu.hasMoreElements()) {\n\t\t\t\t\tString name = (String)enu.nextElement();\n\t\t\t\t\tString value = request.getParameter(name);\n\t\t\t\t\tList<String> params = Arrays.asList(\"routerName\", \"methods\", \"confirmMethods\", \"gridId\");\n\t\t\t\t\tif (params.contains(name)) {\n\t\t\t\t\t\tc = new Condition();\n\t\t\t\t\t\tc.setName(name);\n\t\t\t\t\t\tc.setValue(value);\n\t\t\t\t\t\tconditionMap.put(name, value);\n\t\t\t\t\t\tnameSet.add(c.getName());\n\t\t\t\t\t\tconditionList.add(c);\n\t\t\t\t\t} else if (name.toLowerCase().startsWith(SEARCH_PREFIX) \n\t\t\t\t\t\t\t&& (value != null && (!value.equals(\"\")))) {\n//\t\t\t\t\t\tboolean has = nameSet.contains(name.split(\"_\")[1]);\n//\t\t\t\t\t\tif (name.toLowerCase().endsWith(SEARCH_SUFFIX_START)) {\n//\t\t\t\t\t\t\tif (has) {\n//\t\t\t\t\t\t\t\tfor (Condition o : conditionList) {\n//\t\t\t\t\t\t\t\t\tif (o.getName().equals(name.split(\"_\")[1])) {\n//\t\t\t\t\t\t\t\t\t\tc = o;\n//\t\t\t\t\t\t\t\t\t\tconditionList.remove(o);\n//\t\t\t\t\t\t\t\t\t\tbreak;\n//\t\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t} else {\n//\t\t\t\t\t\t\t\tc = new MultiCondition();\n//\t\t\t\t\t\t\t\t((MultiCondition)c).setName(name.split(\"_\")[1]);\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\tif (((MultiCondition) c).getOperateType() == 0) {\n//\t\t\t\t\t\t\t\t((MultiCondition) c).setOperateType(ConditionOperator.GTE);\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t((MultiCondition)c).setValue(value);\n//\t\t\t\t\t\t} else if (name.toLowerCase().endsWith(SEARCH_SUFFIX_END)) {\n//\t\t\t\t\t\t\tif (has) {\n//\t\t\t\t\t\t\t\tfor (Condition o : conditionList) {\n//\t\t\t\t\t\t\t\t\tif (o.getName().equals(name.split(\"_\")[1])) {\n//\t\t\t\t\t\t\t\t\t\tc = o;\n//\t\t\t\t\t\t\t\t\t\tconditionList.remove(o);\n//\t\t\t\t\t\t\t\t\t\tbreak;\n//\t\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t} else {\n//\t\t\t\t\t\t\t\tc = new MultiCondition();\n//\t\t\t\t\t\t\t\t((MultiCondition)c).setName(name.split(\"_\")[1]);\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\tif (((MultiCondition) c).getOperateType2() == 0) {\n//\t\t\t\t\t\t\t\t((MultiCondition)c).setOperateType2(ConditionOperator.LTE);\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t((MultiCondition)c).setValue2(value);\n//\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tc = new Condition();\n\t\t\t\t\t\t\tc.setName(name.split(\"_\")[1]);\n//\t\t\t\t\t\t\tif (c.getOperateType() == 0) {\n//\t\t\t\t\t\t\t\tc.setOperateType(ConditionOperator.EQ);\n//\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (value.indexOf(\":\") > 0 && value.length() == 19) {\n\t\t\t\t\t\t\t\tc.setValue(DateUtil.formatTimestampToDate(value));\n\t\t\t\t\t\t\t} else if (\"on\".equals(value)) {\n\t\t\t\t\t\t\t\tvalue = \"1\";\n\t\t\t\t\t\t\t\tc.setValue(value);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tc.setValue(value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tconditionMap.put(name, value);\n//\t\t\t\t\t\t}\n\t\t\t\t\t\tnameSet.add(c.getName());\n\t\t\t\t\t\tconditionList.add(c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (conditionList.size() > 0) {\n\t\t\t\t\t((Search)args[i]).setConditionList(conditionList);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSearchConditionFilter s = method.getAnnotation(SearchConditionFilter.class);\n\t\tif (s != null && s.limits() != null && s.limits().length != 0) {\n\t\t\t//TODO 处理limits,只按照limits限制的条件查询,若不限制则默认全部(即不处理)\n\t\t\tList<Condition> removes = new ArrayList<Condition>();\n\t\t\tList<String> limitList = Arrays.asList(s.limits());\n\t\t\tfor (Condition cond : conditionList) {\n\t\t\t\tif (!limitList.contains(cond.getName())) {\n\t\t\t\t\tremoves.add(cond);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconditionList.removeAll(removes);\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < args.length; i++) {\n\t\t\tif (args[i] instanceof Model && conditionList.size() > 0) {\n\t\t\t\t((Model)args[i]).addAttribute(\"conditions\", conditionMap);\n\t\t\t\tfor (Iterator<Condition> ite = conditionList.iterator(); ite.hasNext();) {\n\t\t\t\t\tCondition cond = ite.next();\n\t\t\t\t\t((Model)args[i]).addAttribute(SEARCH_PREFIX + cond.getName(), conditionMap.get(SEARCH_PREFIX + cond.getName()));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n//\t\tfor (int i = 0; i < args.length; i++) {\n//\t\t\tif (args[i] instanceof Model && conditionList.size() > 0) {\n//\t\t\t\tfor (Iterator<Condition> ite = conditionList.iterator(); ite.hasNext();) {\n//\t\t\t\t\tCondition cond = ite.next();\n//\t\t\t\t\tif (cond instanceof MultiCondition) {\n//\t\t\t\t\t\t((Model)args[i]).addAttribute(SEARCH_PREFIX + cond.getName() + SEARCH_SUFFIX_START, cond.getValue());\n//\t\t\t\t\t\t((Model)args[i]).addAttribute(SEARCH_PREFIX + cond.getName() + SEARCH_SUFFIX_END, ((MultiCondition)cond).getValue2());\n//\t\t\t\t\t\tconditionMap.put(SEARCH_PREFIX + cond.getName() + SEARCH_SUFFIX_START, cond.getValue());\n//\t\t\t\t\t\tconditionMap.put(SEARCH_PREFIX + cond.getName() + SEARCH_SUFFIX_END, ((MultiCondition)cond).getValue2());\n//\t\t\t\t\t} else {\n//\t\t\t\t\t\t((Model)args[i]).addAttribute(SEARCH_PREFIX + cond.getName(), cond.getValue());\n//\t\t\t\t\t\tconditionMap.put(SEARCH_PREFIX + cond.getName(), cond.getValue());\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t\t((Model)args[i]).addAttribute(\"conditions\", conditionMap);\n//\t\t\t}\n//\t\t}\n\t\t\n\t\t\n\t\t//BusinessCallController、listcontent.ftl、BackendHelper、admin.common.js、index.ftl(resume)、\n\t\t//BasicBusinessService、ResumeBusinessService、、、UserBusinessService\n//\t\tString simpleClassName = obj.getClass().getSimpleName();\n//\t\tString beanId = StringUtil.convertFirstChar2LowerCase(simpleClassName.replace(\"Controller\", \"Helper\"));\n//\t\tBaseHelper helper = SpringApplicationContext.getBean(beanId);\n//\t\t\n//\t\tif (null != helper) {//设置Condition中value的类型\n//\t\t\thelper.getConditionValue(propertyName, value);\n//\t\t}\n\t}", "public Iterable<JMDictEntry> getEntriesFromPron(Iterable<ForwardingToken> tokensToSearch, Mode mode, POS pos) {\n Set<String> readingsToQuery = new HashSet<>();\n List<String> acceptablePOS;\n final String restrictPOSClause;\n final String properNounsClause;\n boolean ignoreProperNouns = true;\n\n switch (mode) { // Note: most likely could search by baseForm for all of these. Not sure there's ever any difference in these cases.\n case READINGS_IN_HIRAGANA:\n tokensToSearch.forEach(forwardingToken -> {\n if (forwardingToken.isVerb()) readingsToQuery.add(forwardingToken.getBaseForm()); // search for verbsAndAux by their baseform eg. する\n else readingsToQuery.add(Utils.convertKana(forwardingToken.getReading())); // search for native words in hiragana eg. として\n });\n break;\n case READINGS_IN_KATAKANA:\n tokensToSearch.forEach(forwardingToken ->\n readingsToQuery.add(forwardingToken.getReading()) // search for possible loan words in their native katakana. eg. キャンパス\n );\n break;\n default:\n throw new NotImplementedException();\n }\n\n\n switch(pos){\n case particles:\n case conjunctions:\n// acceptablePOS = particles;\n restrictPOSClause = \"AND s.particles = 1 \";\n break;\n case adverbs:\n// acceptablePOS = adverbs;\n restrictPOSClause = \"AND s.adverbs = 1 \";\n break;\n case adjectives:\n// acceptablePOS = adjectives;\n restrictPOSClause = \"AND s.adjectives = 1 \";\n break;\n case adnominals:\n// acceptablePOS = adnominals;\n restrictPOSClause = \"AND s.adnominals = 1 \";\n break;\n case prefixes:\n// acceptablePOS = adfixes;\n restrictPOSClause = \"AND s.adfixes = 1 \";\n break;\n case nouns:\n// acceptablePOS = nouns;\n restrictPOSClause = \"AND s.nouns = 1 \";\n break;\n case properNouns:\n// acceptablePOS = properNouns;\n restrictPOSClause = \"AND s.propernouns = 1 \";\n ignoreProperNouns = false;\n break;\n case verbsAndAux:\n// acceptablePOS = verbsAndAux;\n restrictPOSClause = \"AND s.verbsandaux = 1 \";\n break;\n // Take all you can find\n case exclamations:\n case symbols:\n case fillers:\n case others:\n case unclassified:\n restrictPOSClause = \"\";\n// acceptablePOS = all;\n break;\n default:\n throw new IllegalStateException();\n }\n\n\n if(ignoreProperNouns) properNounsClause = \"WHERE a.id < \" + START_OF_PROPER_NOUNS_ID + \" \";\n else properNounsClause = \"WHERE a.id > \" + (START_OF_PROPER_NOUNS_ID - 1) + \" \";\n// restrictPOSClause = \"AND t.senseDataKey.data IN :acceptablePOS \";\n\n if(readingsToQuery.isEmpty()) return new ArrayList<>(); // bail out if nothing to search database with.\n\n List<List<String>> partitionedReadingsToQuery = Lists.partition(\n// readingsToQuery.stream().collect(Collectors.toList()), MAX_HOST_PARAMETERS - acceptablePOS.size()\n readingsToQuery.stream().collect(Collectors.toList()), MAX_HOST_PARAMETERS\n );\n\n List<JMDictEntry> resultList = new ArrayList<>();\n partitionedReadingsToQuery.parallelStream().forEach(partition -> {\n TypedQuery<JMDictEntry> query = em.createQuery(\n \"SELECT a \" + // JOIN FETCH is certainly faster (2s).\n \"FROM JMDictEntry a \" +\n \"JOIN FETCH JMDictPron p \" +\n \" ON a.id = p.idDataKey.id \" +\n \"JOIN FETCH JMDictSense s \" +\n \" ON s.id = a.id \"\n// + \"JOIN JMDictType t \" +\n// \"ON t.senseDataKey.sense = s.data \"\n + properNounsClause\n + \" AND p.idDataKey.data IN :readingsToQuery \"\n + restrictPOSClause\n + \" GROUP BY p.idDataKey.id\"\n ,\n JMDictEntry.class\n );\n query.setParameter(\"readingsToQuery\", partition);\n// query.setParameter(\"acceptablePOS\", acceptablePOS);\n resultList.addAll(query.getResultList());\n });\n\n return resultList;\n }", "TSearchQuery prepareSearchQuery(SearchQueryDefinitionAPI searchQueryDefinition);", "public interface Search {\n public List<Node> find(Node start, Node finish);\n public Node selectNode(List<Node> nodes);\n public List<Node> getPath(Node node);\n public List<Node> getAdjacent(Node node);\n}", "public Decision planBest(Context context, Decision defaultDecision);", "protected OpinionFinding() {/* intentionally empty block */}", "@java.lang.Override\n public boolean hasSearch() {\n return inputSourceCase_ == 10;\n }", "@Override\n\tpublic void search() {\n\t}", "public Decision bestFor(Context context);", "List<SearchResult> search(SearchQuery searchQuery);", "public BaseOptimizer() {\r\n Candidates = new ArrayList<>();\r\n }", "public FindOperationEvaluator(boolean negate) {\r\n this.negate = negate;\r\n }", "public WikiSearch or(WikiSearch that)\n\t{\n Map<String, Double> union = new HashMap<String, Double>();\n Set<String> keys = map.keySet();\n for(String current: keys)\n {\n \tunion.put(current, totalRelevance(getRelevance(current), that.getRelevance(current)));\n }\n\n keys = that.map.keySet();\n for(String current: keys)\n {\n \tif(!union.containsKey(current))\n \t\tunion.put(current, that.getRelevance(current));\n }\n\n return new WikiSearch(union);\n\t}", "GeneralPredicate createGeneralPredicate();", "public ApplyExample() {\r\n oredCriteria = new ArrayList<Criteria>();\r\n }", "Search getSearch();", "@java.lang.Override\n public boolean hasSearch() {\n return inputSourceCase_ == 10;\n }", "public void search(Indexer indexer, CityIndexer cityIndexer, Ranker ranker, String query, boolean withSemantic, ArrayList<String> chosenCities, ObservableList<String> citiesByTag, boolean withStemming, String saveInPath, String queryId, String queryDescription) {\n String[] originalQueryTerms = query.split(\" \");\n String originQuery = query;\n docsResults = new HashMap<>();\n parser = new Parse(withStemming, saveInPath, saveInPath);\n HashSet<String> docsOfChosenCities = new HashSet<>();\n query = \"\" + query + queryDescription;\n HashMap<String, Integer> queryTerms = parser.parseQuery(query);\n HashMap<String, ArrayList<Integer>> dictionary = indexer.getDictionary();\n if (!withStemming){\n setDocsInfo(saveInPath + \"\\\\docsInformation.txt\");\n }\n else{\n setDocsInfo(saveInPath + \"\\\\docsInformation_stemming.txt\");\n }\n\n\n //add semantic words of each term in query to 'queryTerms'\n if(withSemantic) {\n HashMap<String,ArrayList<String>> semanticWords = ws.connectToApi(originQuery);\n }\n\n //give an ID to query if it's a regular query (not queries file)\n if(queryId.equals(\"\")){\n queryId = \"\" + Searcher.queryID;\n Searcher.queryID++;\n }\n\n String postingDir;\n if (!withStemming) {\n postingDir = \"\\\\indexResults\\\\postingFiles\";\n } else {\n postingDir = \"\\\\indexResults\\\\postingFiles_Stemming\";\n }\n int pointer = 0;\n\n //find docs that contain the terms in the query in their text\n HashMap<String, Integer> queryTermsIgnoreCase = new HashMap<>();\n for (String term : queryTerms.keySet()) {\n String originTerm = term;\n if (!dictionary.containsKey(term.toUpperCase()) && !dictionary.containsKey(term.toLowerCase())) {\n continue;\n }\n if(dictionary.containsKey(term.toLowerCase())){\n term = term.toLowerCase();\n }\n else {\n term = term.toUpperCase();\n }\n queryTermsIgnoreCase.put(term,queryTerms.get(originTerm));\n pointer = dictionary.get(term).get(2);\n String chunk = (\"\" + term.charAt(0)).toUpperCase();\n\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + postingDir + \"\\\\posting_\" + chunk + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsResults'\n if(line != null) {\n findDocsFromLine(line, term);\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n //find docs that contain the chosen cities in their text\n for (String cityTerm : chosenCities) {\n if (!dictionary.containsKey(cityTerm) && !dictionary.containsKey(cityTerm.toLowerCase())) {\n continue;\n }\n if(dictionary.containsKey(cityTerm.toLowerCase())){\n cityTerm = cityTerm.toLowerCase();\n }\n pointer = dictionary.get(cityTerm).get(2);\n // char chunk = indexer.classifyToPosting(term).charAt(0);\n String chunk = (\"\" + cityTerm.charAt(0)).toUpperCase();\n\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + postingDir + \"\\\\posting_\" + chunk + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsOfChosenCities'\n String docs = line.substring(0, line.indexOf(\"[\") - 1); //get 'docsListStr'\n String[] docsArr = docs.split(\";\");\n for (String docInfo : docsArr) {\n String doc = docInfo.substring(0, docInfo.indexOf(\": \"));\n while(doc.charAt(0) == ' '){\n doc = doc.substring(1);\n }\n docsOfChosenCities.add(doc);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n //find docs that contain the chosen cities in their city tag\n if(!chosenCities.isEmpty()){\n for (String cityDicRec: chosenCities) {\n //get pointer to posting from cityDictionary\n try {\n pointer = cityIndexer.getCitiesDictionary().get(cityDicRec);\n } catch (NumberFormatException e) {\n e.printStackTrace();\n }\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + \"\\\\cityIndexResults\" + \"\\\\posting_city\" + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsOfChosenCities'\n String docs = line.substring(line.indexOf(\"[\") + 1, line.indexOf(\"]\")); //get 'docsListStr'\n String[] docsArr = docs.split(\"; \");\n for (String doc : docsArr) {\n docsOfChosenCities.add(doc);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n\n\n ranker.rank(docsResults, docsOfChosenCities, queryTermsIgnoreCase, dictionary, docsInfo,entities, queryId);\n }", "List<Corretor> search(String query);", "public Solver(WorldState initial) {\n solution = new ArrayList<>();\n\n // create a priority queue of search nodes\n MinPQ<SNode> pq = new MinPQ<>();\n\n // insert an “initial search node” into the priority queue\n SNode start = new SNode(initial, 0, null);\n pq.insert(start);\n\n // If the search node with minimum priority is the goal node, then we’re done.\n while (!pq.min().ws.isGoal()) {\n\n // Remove the search node with minimum priority.\n SNode X = pq.delMin();\n\n // for each neighbor of X’s world state, create a new search node and\n // insert it into the priority queue.\n for (WorldState nb: X.ws.neighbors()) {\n\n // critical optimization\n if (X.prev == null || !(nb.equals(X.prev.ws))) {\n SNode nbNode = new SNode(nb, X.numberOfMove + 1, X);\n pq.insert(nbNode);\n }\n }\n }\n\n // generate the solution\n SNode goal = pq.min();\n while (goal != null) {\n solution.add(0, goal.ws);\n goal = goal.prev;\n }\n }", "public Decision planWorst(Context context, Decision defaultDecision);", "private List<Clause> termSearch(Clause cl\n\t\t\t, List<Clause> aA, List<Clause> aO\n\t\t\t, List<Clause> oA, List<Clause> oO) {\n\t\tif ((cl.getStartOP() == null)\n\t\t\t\t|| cl.getStartOP().equals(Operator.AND)) {\n\t\t\tif (cl.getDefaultOP().equals(Operator.AND)) {\n\t\t\t\taA.add(cl);\n\t\t\t\treturn getFilledList(aO, oA, oO);\n\t\t\t} else {\n\t\t\t\taO.add(cl);\n\t\t\t\treturn getFilledList(oA, oO, aA);\n\t\t\t}\n\t\t} else if (cl.getStartOP().equals(Operator.OR)) {\n\t\t\tif (cl.getDefaultOP().equals(Operator.AND)) {\n\t\t\t\toA.add(cl);\n\t\t\t\treturn getFilledList(oO, aA, aO);\n\t\t\t} else {\n\t\t\t\toO.add(cl);\n\t\t\t\treturn getFilledList(aA, aO, oA);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public Query<T, R> build() {\n // if criteria.size == 0, rootCriterion = null\n Criterion rootCriterion = null;\n if (criteria.size() == 1) {\n rootCriterion = criteria.get(0);\n } else if (criteria.size() > 1) {\n rootCriterion = Restrictions.and(criteria\n .toArray(new Criterion[criteria.size()]));\n }\n return new QueryImpl<T, R>(entityClass, returnType, rootCriterion,\n orderings, maxResults, returnFields);\n }", "SearchResult getBestResult(List<SearchResult> results, SearchQuery query);", "private void searchFunction() {\n\t\t\r\n\t}", "private static Runnable makeTaskGang(String[] wordList,\n TestsToRun choice) {\n switch(choice) {\n case COUNTDOWNLATCH:\n return new OneShotSearchWithCountDownLatch(wordList,\n mOneShotInputStrings);\n case CYCLIC_BARRIER:\n return new CyclicSearchWithCyclicBarrier(wordList,\n mFixedNumberOfInputStrings);\n case PHASER:\n return new CyclicSearchWithPhaser(wordList,\n mVariableNumberOfInputStrings);\n }\n return null;\n }", "@Test\n public void test_shortcut_needed_basic() {\n CHPreparationGraph graph = CHPreparationGraph.edgeBased(5, 4, (in, via, out) -> in == out ? 10 : 0);\n int edge = 0;\n graph.addEdge(0, 1, edge++, 10, Double.POSITIVE_INFINITY);\n graph.addEdge(1, 2, edge++, 10, Double.POSITIVE_INFINITY);\n graph.addEdge(2, 3, edge++, 10, Double.POSITIVE_INFINITY);\n graph.addEdge(3, 4, edge++, 10, Double.POSITIVE_INFINITY);\n graph.prepareForContraction();\n EdgeBasedWitnessPathSearcher searcher = new EdgeBasedWitnessPathSearcher(graph);\n searcher.initSearch(0, 1, 2, new EdgeBasedWitnessPathSearcher.Stats());\n double weight = searcher.runSearch(3, 6, 20.0, 100);\n assertTrue(Double.isInfinite(weight));\n }", "public static void main(String[] args) {\n String[] user0 = {\"/start\", \"/pink\", \"/register\", \"/orange\", \"/red\", \"a\"};\n String[] user1 = {\"/start\", \"/green\", \"/blue\", \"/pink\", \"/register\", \"/orange\", \"/one/two\"};\n String[] user2 = {\"a\", \"/one\", \"/two\"};\n String[] user3 = {\"/red\", \"/orange\", \"/yellow\", \"/green\", \"/blue\", \"/purple\", \"/white\", \"/amber\", \"/HotRodPink\", \"/BritishRacingGreen\"};\n String[] user4 = {\"/red\", \"/orange\", \"/amber\", \"/green\", \"/blue\", \"/purple\", \"/white\", \"/lavender\", \"/HotRodPink\", \"/BritishRacingGreen\"};\n String[] user5 = {\"a\"};\n\n// out.println(rawr(user0, user1));\n// out.println(rawr(user1, user2));\n// out.println(rawr(user2, user0));\n// out.println(rawr(user5, user2));\n out.println(rawr(user3, user4));\n// out.println(rawr(user4, user3));\n\n P1 c=new P1();\n c.findContiguousHistory(user0, user1);\n c.findContiguousHistory(user1, user2);\n c.findContiguousHistory(user2, user0);\n c.findContiguousHistory(user5, user2);\n c.findContiguousHistory(user3, user4);\n\n // below scenaro is tricky because amber match later and user3 string. We have to come back again.\n // String[] user4 = {\"/red\", \"/orange\", \"/amber\", \"/green\", \"/blue\", \"/purple\", \"/white\", \"/lavender\", \"/HotRodPink\", \"/BritishRacingGreen\"};\n // String[] user3 = {\"/red\", \"/orange\", \"/yellow\", \"/green\", \"/blue\", \"/purple\", \"/white\", \"/amber\", \"/HotRodPink\", \"/BritishRacingGreen\"};\n\n c.findContiguousHistory(user4, user3);\n }", "Strategy createStrategy();", "public SearchCriteria initSearchCriteria() throws Exception {\n\t\treturn null;\n\t}", "@Override\n\tpublic boolean isSearching() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isSearching() {\n\t\treturn false;\n\t}", "public SearchBuilder(final SearchableRepository<T> repository) {\n\t\tthis.repository = repository;\n\t\torder = new ArrayList<Map.Entry<String, Boolean>>(1);\n\t}", "public void testSearchRules() throws Exception {\n Project project = new Project();\r\n \r\n DateFormatSymbols symbols = new DateFormatSymbols(Locale.US);\r\n \r\n for (int i = 0; i < 12; i++) {\r\n \r\n String month = symbols.getMonths()[i];\r\n String shortMonth = symbols.getShortMonths()[i];\r\n \r\n // Basic project info\r\n project.setId(i);\r\n project.setCategoryId(1);\r\n project.setAllowGuests(true);\r\n project.setMembershipRequired(false);\r\n project.setApproved(true);\r\n project.setClosed(false);\r\n project.setPortal(false);\r\n \r\n // Unique Title\r\n project.setTitle(month + \" test project\");\r\n project.setShortDescription(month + \" description word\");\r\n project.setKeywords(shortMonth);\r\n \r\n // Unique Location\r\n project.setCity(\"Virginia Beach\");\r\n project.setState(\"VA\");\r\n project.setPostalCode(\"234\" + String.valueOf(50 + i));\r\n \r\n // Random Rating for now\r\n project.setRatingCount(i + 1);\r\n project.setRatingValue(project.getRatingCount() * StringUtils.rand(1, 5));\r\n project.setRatingAverage(project.getRatingValue() / project.getRatingCount());\r\n \r\n // Index it\r\n ProjectIndexer indexer = new ProjectIndexer();\r\n indexer.add(snowballWriter, project, true);\r\n }\r\n \r\n QueryParser parser = new QueryParser(\"contents\", snowballAnalyzer);\r\n \r\n {\r\n // Make sure a single matching term yields a single hit\r\n SearchBean search = new SearchBean();\r\n search.setQuery(symbols.getMonths()[0]);\r\n search.setLocation(\"Virginia Beach\");\r\n assertNotNull(search.getQuery());\r\n assertNotNull(search.getLocation());\r\n search.parseQuery();\r\n assertTrue(search.isValid());\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n assertNotNull(queryString);\r\n \r\n // (approved:1)\r\n // AND (guests:1)\r\n // AND (closed:0)\r\n // AND (website:0)\r\n // AND (\"january\"^20 OR january^15 OR january*^4) AND (location:(\"virginia beach\"^30))\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == 1);\r\n }\r\n \r\n {\r\n // Make sure a single matching term stem yields a single hit\r\n SearchBean search = new SearchBean();\r\n search.setQuery(symbols.getMonths()[0] + \"'s\");\r\n search.setLocation(\"Virginia Beach\");\r\n assertNotNull(search.getQuery());\r\n assertNotNull(search.getLocation());\r\n search.parseQuery();\r\n assertTrue(search.isValid());\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n assertNotNull(queryString);\r\n \r\n // (approved:1)\r\n // AND (guests:1)\r\n // AND (closed:0)\r\n // AND (website:0)\r\n // AND (\"january's\"^20 OR january's^15 OR january's*^4) AND (location:(\"virginia beach\"^30))\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == 1);\r\n }\r\n \r\n {\r\n // Make sure multiple matching words yield two hits\r\n SearchBean search = new SearchBean();\r\n search.setQuery(symbols.getMonths()[0] + \" \" + symbols.getMonths()[1]);\r\n search.setLocation(\"Virginia Beach\");\r\n search.parseQuery();\r\n assertTrue(search.isValid());\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n assertNotNull(queryString);\r\n \r\n // (approved:1)\r\n // AND (guests:1)\r\n // AND (closed:0)\r\n // AND (website:0)\r\n // AND (\"january february\"^20 OR january^15 OR february^14 OR january*^4 OR february*^3) AND (location:(\"virginia beach\"^30))\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == 2);\r\n }\r\n \r\n {\r\n // Make sure wilcards yield multiple hits\r\n SearchBean search = new SearchBean();\r\n search.setQuery(\"j\");\r\n search.setLocation(\"Virginia Beach\");\r\n search.parseQuery();\r\n assertTrue(search.isValid());\r\n \r\n // Look for data with a \"j\" for comparison\r\n int jCount = 0;\r\n for (int i = 0; i < symbols.getMonths().length; i++) {\r\n if (symbols.getMonths()[i].toLowerCase().indexOf(\"j\") > -1 ||\r\n symbols.getShortMonths()[i].toLowerCase().indexOf(\"j\") > -1) {\r\n ++jCount;\r\n }\r\n }\r\n assertTrue(jCount > 0);\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n assertNotNull(queryString);\r\n \r\n // (approved:1)\r\n // AND (guests:1)\r\n // AND (closed:0)\r\n // AND (website:0)\r\n // AND (\"j\"^20 OR j^15 OR j*^4) AND (location:(\"virginia beach\"^30))\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == jCount);\r\n }\r\n \r\n {\r\n // Make sure alternate locations do not yield any hits\r\n SearchBean search = new SearchBean();\r\n search.setQuery(symbols.getMonths()[0]);\r\n search.setLocation(\"Norfolk\");\r\n search.parseQuery();\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == 0);\r\n }\r\n \r\n {\r\n // Make sure locations as query terms do not yield any hits\r\n SearchBean search = new SearchBean();\r\n search.setQuery(\"Virginia Beach\");\r\n search.setLocation(\"Virginia Beach\");\r\n search.parseQuery();\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == 0);\r\n }\r\n }" ]
[ "0.5723581", "0.5592949", "0.54952425", "0.5487554", "0.5461776", "0.53680944", "0.5366077", "0.5312419", "0.5312415", "0.5250675", "0.5246214", "0.52376837", "0.5211201", "0.5203409", "0.5158546", "0.51551116", "0.5139134", "0.50980085", "0.5059312", "0.5038648", "0.5014733", "0.50137895", "0.5013402", "0.5010506", "0.4967222", "0.49527678", "0.49423552", "0.49251735", "0.49088714", "0.48746932", "0.4844534", "0.4837756", "0.48366138", "0.48295873", "0.47883078", "0.47858554", "0.47797725", "0.4779026", "0.47736079", "0.47733617", "0.47598955", "0.4745863", "0.47445276", "0.47424376", "0.4729482", "0.47139353", "0.47059166", "0.46858853", "0.46787918", "0.4677822", "0.4672559", "0.4672455", "0.46704713", "0.46482304", "0.46369973", "0.46331266", "0.46218815", "0.46190462", "0.46066168", "0.45931113", "0.45898664", "0.45857182", "0.45824492", "0.45787895", "0.45769095", "0.45757526", "0.45743242", "0.45707032", "0.45648578", "0.45586446", "0.4556398", "0.45551676", "0.45531163", "0.45510784", "0.45490047", "0.4547844", "0.45445654", "0.45433745", "0.45428035", "0.45406938", "0.45346037", "0.45314953", "0.45293325", "0.45261025", "0.45246336", "0.45184803", "0.4499863", "0.44972232", "0.4493882", "0.4493136", "0.44931254", "0.4488717", "0.44817525", "0.44803837", "0.44751212", "0.44728586", "0.44690907", "0.44601107", "0.44601107", "0.44478622", "0.44459802" ]
0.0
-1
Builds your own assignment strategy based on unary decisions, that is, decisions can be applied but not refuted. Selects a variable X and a value V to make the decision X = V. Note that value assignments are the default decision operators. Therefore, they are not mentioned in the search heuristic name.
public static IntStrategy once(VariableSelector<IntVar> VAR_SELECTOR, IntValueSelector VAL_SELECTOR, IntVar... VARS){ return new Once(VARS, VAR_SELECTOR, VAL_SELECTOR, assign()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static DecisionOperator<IntVar> assign() {\n return DecisionOperator.int_eq;\n }", "@Override\n public Void visit(AssignmentExpression nd, SuccessorInfo i) {\n if (\"&&=\".equals(nd.getOperator()) || \"||=\".equals(nd.getOperator()) || \"??=\".equals(nd.getOperator())) {\n if (\"&&=\".equals(nd.getOperator())) {\n // from lhs to rhs on truthy. from lhs to false-branch on falsy.\n visitWithSuccessors(nd.getLeft(), First.of(nd.getRight()), i.getSuccessors(false));\n } else if (\"||=\".equals(nd.getOperator())) {\n // from lhs to true-branch on truthy. from lhs to rhs on falsy.\n visitWithSuccessors(nd.getLeft(), i.getSuccessors(true), First.of(nd.getRight()));\n } else { // \"??=\"\n // the union of the above - truthyness is unknown.\n visitWithSuccessors(nd.getLeft(), union(First.of(nd.getRight()), i.getAllSuccessors()));\n }\n \n visitWithSuccessors(nd.getRight(), nd); // from right to assignment.\n\n writeSuccessors(nd, i.getGuardedSuccessors(nd));\n } else {\n visitAssign(nd, nd.getLeft(), nd.getRight());\n writeSuccessors(nd, i.getGuardedSuccessors(nd));\n }\n return null;\n }", "VarAssignment createVarAssignment();", "@Override\n public Integer visitAssign(CalculatorParser.AssignContext ctx) {\n String id = ctx.ID().getText(); // id is left-hand side of '='\n int value = visit(ctx.expr()); // compute value of expression on right\n memory.put(id, value); // store it in memory\n return value;\n }", "private Term parseAssign(final boolean required) throws ParseException {\n Term t1 = parseConditional(required);\n while (t1 != null) {\n int tt = _tokenizer.next();\n if (tt == '=') {\n Term t2 = parseAssign(true);\n if (t1 instanceof Term.Ref && ((Term.Ref) t1).getVariable() != null) {\n t1 = new Term.Assign(t1, t2);\n } else {\n reportError(\"Variable expected on the left side of assignment '='.\");\n }\n } else {\n _tokenizer.pushBack();\n break;\n }\n }\n return t1;\n }", "@Override\n\tpublic void visit(AssignNode node) {\n\t\tEvaluator.evaluate(node.getChild(0));\n\t\tEvaluator.evaluate(node.getChild(1));\n\n\t\t/**\n\t\t * Verificam fiii si construim perechea Variabila, Valoare pentru a fi\n\t\t * inserata in HahMap-ul din Evaluator\n\t\t */\n\t\tVariable x = null;\n\t\tValue i = null;\n\t\tif (node.getChild(1) instanceof Variable) {\n\t\t\tx = new Variable(node.getChild(1).getName());\n\t\t} else {\n\t\t\ti = new Value(node.getChild(1).getName());\n\t\t}\n\n\t\tif (node.getChild(0) instanceof Variable) {\n\t\t\tx = new Variable(node.getChild(0).getName());\n\t\t} else {\n\t\t\ti = new Value(node.getChild(0).getName());\n\t\t}\n\t\tEvaluator.variables.put(x.getName(), i.getName());\n\t\tnode.setName(i.getName());\n\t}", "@Override\r\n\tpublic Instruction lexParse(String[] words, LexicalParser lexParser) {\r\n\t\tif (words.length!=3) return null;\r\n\t\t\r\n\t\tif (!words[1].equals(\"=\")) return null;\r\n\t\t\r\n\t\trhs=TermParser.parse(words[2]);\r\n\t\tif (rhs==null) return null;\r\n\t\t\r\n\t\tTerm var=TermParser.parse(words[0]);\r\n\t\tif (var==null) return null;\r\n\t\t\r\n\t\treturn new SimpleAssignment(words[0], rhs);\r\n\t}", "public void setComparedHeuristics (VariableSelector variableSelector, IntValueSelector valueOrder){\n\t\tIntValueSelector valueSelector = valueOrder;\n\t\t\n\t \n\t\tkb.getModelKB().getSolver().setSearch(Search.intVarSearch(\n \n\t\t\t\tvariableSelector,\n // selects the smallest domain value (lower bound)\n\t\t\t\t \n\t\t\t\tvalueSelector,\n \n // variables to branch on\n\t\t\t\tkb.getVars()\n\t\t));\n\t\t\n\t}", "protected IExpressionValue assignment(List<Entity> declaredStates, List<Entity> possibleStates) \r\n\t\t\t\t\tthrows InvalidProbabilityRangeException, \r\n\t\t\t\t\t\t TableFunctionMalformedException,\r\n\t\t\t\t\t\t SomeStateUndeclaredException{\r\n\t\t\r\n\t\t// prepare a representation of a cell inside the temporary table\r\n\t\tTempTableProbabilityCell currentCell = new TempTableProbabilityCell(null, null);\r\n\t\t\r\n\t\t// SCAN FOR IDENTIFIER\r\n\t\tscan();\r\n\t\tString userDefinedVariableName = null;\t// this will become non-null if there is an unknown state declared (unknown states will become user-defined variables)\r\n\t\tif (token == 'x') {\r\n\t\t\tif (this.node != null) {\r\n\t\t\t\t// Consistency check C09\r\n\t\t\t\t// Remember declared states, so we can check later if all states was declared\r\n\t\t\t\tEntity possibleValue = null;\r\n\t\t\t\tint index = this.node.getPossibleValueIndex(this.noCaseChangeValue);\r\n\t\t\t\tif (index < 0) {\r\n\t\t\t\t\t// unknown states will be considered as a new variable that user has declared\r\n\t\t\t\t\tuserDefinedVariableName = this.noCaseChangeValue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tpossibleValue = possibleStates.get(index);\r\n\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t//throw new TableFunctionMalformedException(e.getMessage());\r\n\t\t\t\t\t\tthrow new TableFunctionMalformedException(this.node.toString(), e);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (possibleValue == null) {\r\n\t\t\t\t\t\tthrow new TableFunctionMalformedException(getNode().toString());\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdeclaredStates.add(possibleValue);\r\n\t\t\t\t\tcurrentCell.setPossibleValue(possibleValue);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\texpected(\"Identifier\");\r\n\t\t}\r\n\r\n\t\t// LOOK FOR = OPERATOR\r\n\t\tmatch('=');\r\n\r\n\t\t// consistency check C09\r\n\t\t// ret verifies the sum of all declared states' probability (must be 1)\r\n\t\t// boolean hasUnknownValue shows if some ret was negative or NaN.\r\n\t\tIExpressionValue ret = expression();\t\r\n\t\tif (ret == null) {\r\n\t\t\tthrow new TableFunctionMalformedException(getResource().getString(\"NonDeclaredVarStateAssignment\"));\r\n\t\t}\r\n\t\tfloat retValue = 0;\t// initialize with a value which will not impact consistency check (the one that checks if sum is 1)\r\n\t\tif (userDefinedVariableName == null) {\r\n\t\t\t// this is a state of current node, so store the probability in order to calculate consistency later\r\n\t\t\tif (!ret.isNumeric()) {\r\n\t\t\t\t// state of nodes must be probabilities (numbers)\r\n\t\t\t\tthrow new TableFunctionMalformedException(getResource().getString(\"NonNumericProbAssignment\"));\r\n\t\t\t}\r\n\t\t\ttry {\r\n\t\t\t\tretValue = Float.parseFloat(ret.getValue());\r\n\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\tretValue = Float.NaN;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// this is a user-defined value\r\n\t\t\t// store it in the scope of current if-clause\r\n\t\t\tthis.currentHeader.addUserDefinedVariable(userDefinedVariableName, ret);\r\n\t\t}\r\n\t\tboolean hasUnknownValue = Float.isNaN(retValue);\r\n\t\t\r\n\t\t// add cell to header\r\n\t\tcurrentCell.setProbability(ret);\r\n\t\tif (currentCell.getPossibleValue() != null && currentCell.getPossibleValue() != null) {\r\n\t\t\tthis.currentHeader.addCell(currentCell);\r\n\t\t}\r\n\t\t// Debug.println(\"Adding cell: \" + currentCell.getPossibleValue().getName() + \" = \" + ret.toString());\r\n\r\n\t\t// consistency check C09\r\n\t\t// a single state shall never have negative prob \r\n\t\tif ( isToNormalize()\r\n\t\t\t\t&& ((retValue < 0.0) \r\n//\t\t\t\t\t\t|| (1.0 < retValue)\r\n\t\t\t\t\t\t)) {\r\n\t\t\tthrow new InvalidProbabilityRangeException(getNode().toString());\r\n\t\t}\r\n\t\t\r\n\t\t// LOOK FOR , (OPTIONAL)\r\n\t\tif (look == ',') {\r\n\t\t\tmatch(',');\r\n\t\t\tif (look != this.kwcode[this.lookup(\"IF\")]) {\r\n\t\t\t\tIExpressionValue temp = assignment(declaredStates, possibleStates);\r\n\t\t\t\tfloat tempValue = Float.NaN;\r\n\t\t\t\ttry {\r\n\t\t\t\t\ttempValue = Float.parseFloat(temp.getValue());\r\n\t\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\t\ttempValue = Float.NaN;\r\n\t\t\t\t}\r\n\t\t\t\thasUnknownValue = hasUnknownValue || (Float.isNaN(tempValue));\r\n\t\t\t\tif (hasUnknownValue) {\r\n\t\t\t\t\tretValue = Float.NaN;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tretValue += tempValue;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t// this is an if-clause after assignment.\r\n\t\t\t\t// we should finish assignment (assignments in same block of if-clauses must be always before the if clause)\r\n\t\t\t\t// if assignment and if-clause happens in same block, assingments must be only for user-defined variables\r\n\t\t\t\tif (!currentHeader.getCellList().isEmpty()) {\r\n\t\t\t\t\t// user-defined variables are not added to cellList. Assignments to states of variables are added to cell list.\r\n\t\t\t\t\t// if this is not empty, then there were assignments to states of variables, so this is invalid.\r\n\t\t\t\t\tthrow new SomeStateUndeclaredException(getResource().getString(\"NonUserDefinedVariablesFoundBeforeIfClause\"));\r\n\t\t\t\t}\r\n\t\t\t\t// let the upper clause actually handle the if=clause\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Debug.println(\"Returned expression value = \" + retValue);\r\n\t\tif (isToNormalize() && (retValue < 0)) {\r\n\t\t\tthrow new InvalidProbabilityRangeException(getNode().toString());\r\n\t\t}\r\n\t\treturn new SimpleProbabilityValue(retValue);\r\n\t}", "@Override\n\tpublic List<Component> caseExprBinary(ExprBinary expr) {\n\t\tint sizeInBits = assignTarget.getVariable().getType().getSizeInBits();\n\t\t// Get the Variables\n\t\tVar e1 = ((ExprVar) expr.getE1()).getUse().getVariable();\n\t\tVar e2 = ((ExprVar) expr.getE2()).getUse().getVariable();\n\t\tList<Var> inVars = new ArrayList<Var>();\n\t\tinVars.add(e1);\n\t\tinVars.add(e2);\n\t\t// Component component = null;\n\t\tif (expr.getOp() == OpBinary.BITAND) {\n\t\t\tcurrentComponent = new AndOp();\n\t\t} else if (expr.getOp() == OpBinary.BITOR) {\n\t\t\tcurrentComponent = new OrOp();\n\t\t} else if (expr.getOp() == OpBinary.BITXOR) {\n\t\t\tcurrentComponent = new XorOp();\n\t\t} else if (expr.getOp() == OpBinary.DIV) {\n\t\t\tcurrentComponent = new DivideOp(sizeInBits);\n\t\t} else if (expr.getOp() == OpBinary.DIV_INT) {\n\t\t\tcurrentComponent = new DivideOp(sizeInBits);\n\t\t} else if (expr.getOp() == OpBinary.EQ) {\n\t\t\tcurrentComponent = new EqualsOp();\n\t\t} else if (expr.getOp() == OpBinary.GE) {\n\t\t\tcurrentComponent = new GreaterThanEqualToOp();\n\t\t} else if (expr.getOp() == OpBinary.GT) {\n\t\t\tcurrentComponent = new GreaterThanOp();\n\t\t} else if (expr.getOp() == OpBinary.LE) {\n\t\t\tcurrentComponent = new LessThanEqualToOp();\n\t\t} else if (expr.getOp() == OpBinary.LOGIC_AND) {\n\t\t\tcurrentComponent = new And(2);\n\t\t} else if (expr.getOp() == OpBinary.LOGIC_OR) {\n\t\t\tcurrentComponent = new Or(2);\n\t\t} else if (expr.getOp() == OpBinary.LT) {\n\t\t\tcurrentComponent = new LessThanOp();\n\t\t} else if (expr.getOp() == OpBinary.MINUS) {\n\t\t\tcurrentComponent = new SubtractOp();\n\t\t} else if (expr.getOp() == OpBinary.MOD) {\n\t\t\tcurrentComponent = new ModuloOp();\n\t\t} else if (expr.getOp() == OpBinary.NE) {\n\t\t\tcurrentComponent = new NotEqualsOp();\n\t\t} else if (expr.getOp() == OpBinary.PLUS) {\n\t\t\tcurrentComponent = new AddOp();\n\t\t} else if (expr.getOp() == OpBinary.SHIFT_LEFT) {\n\t\t\tint log2N = MathStuff.log2(sizeInBits);\n\t\t\tcurrentComponent = new LeftShiftOp(log2N);\n\t\t} else if (expr.getOp() == OpBinary.SHIFT_RIGHT) {\n\t\t\tint log2N = MathStuff.log2(sizeInBits);\n\t\t\tcurrentComponent = new RightShiftOp(log2N);\n\t\t} else if (expr.getOp() == OpBinary.TIMES) {\n\t\t\tcurrentComponent = new MultiplyOp(expr.getType().getSizeInBits());\n\t\t}\n\t\t// currentComponent.setNonRemovable();\n\t\tPortUtil.mapInDataPorts(currentComponent, inVars, portDependency,\n\t\t\t\tportGroupDependency);\n\t\treturn null;\n\t}", "@Test\n\tpublic void testAssignment(){\n\t\tVariable x = new Variable(\"x\");\n\t\tOperator plus = new Operator(\"+\");\n\t\tExpression one = f.createNumNode(1);\n\t\tExpression two = f.createNumNode(2);\n\t\tExpression exp = f.createInfixNode(plus, one, two);\n\t\tStatement assign = f.createAssignNode(x,exp);\n\t\tassertEquals(assign.textRepresentation(), \"x = 1 + 2;\");\n\t\n\t\tASTNodeCountVisitor v = new ASTNodeCountVisitor();\n\t\tassign.accept(v);\n\t\tassertEquals(\"assignment test1 fail\", v.numCount, 2);\n\t\tassertEquals(\"assignment test2 fail\", v.infixCount, 1);\n\t\tassertEquals(\"assignment test3 fail\", v.assignCount, 1);\n\t}", "AssignmentRule createAssignmentRule();", "protected Element evalAssurance(Assurance ass){\n\t\tRecord r1 = ass.getLeftRecord();\n\t\tRecord r2 = ass.getRightRecord();\n\t\tOperator op = ass.getOperator();\n\t\tElement an = el(\"bpws:assign\");\n\t\tif (r1.getType() == RecordType.FORMULAR)\n\t\t\tan.appendChild(setExpr(r1.getFormular(), \"nswomoxsd:leftValue\"));\n\t\tif (r2.getType() == RecordType.FORMULAR)\n\t\t\tan.appendChild(setExpr(r2.getFormular(), \"nswomoxsd:rightValue\"));\n\t\tan.appendChild(\n\t\t\tsetExpr(\n\t\t\t\tgetMyVarPath(\"/nswomoxsd:leftValue\") + \n\t\t\t\top.value() +\n\t\t\t\tgetMyVarPath(\"nswomoxsd:rightValue\"),\n\t\t\t\t\"nswomoxsd:value\"\n\t\t\t)\n\t\t);\n\t\treturn an;\n\t}", "assign_op getAssign_op();", "public VariableUnit solve() {\n LinkedList<VariableUnit> processor = new LinkedList<VariableUnit>();\n\n VariableUnit vu1 = new VariableUnit(250.0, 'x');\n VariableUnit vu2 = new VariableUnit('+');\n VariableUnit vu3 = new VariableUnit(250.0, 'x');\n VariableUnit vu4 = new VariableUnit(501.0, 'x');\n VariableUnit vu5 = new VariableUnit('y');\n VariableUnit vu6 = new VariableUnit('-');\n alpha_arr.get(('x' - 'a')).addLast(vu1);\n alpha_arr.get(('x' - 'a')).addLast(vu2);\n alpha_arr.get(('x' - 'a')).addLast(vu3);\n op_order.add(vu1); op_order.add(vu2); op_order.add(vu3); op_order.add(vu6);\n op_order.add(vu4); op_order.add(vu6); op_order.add(vu5);\n assignValue(2.0, 'x');\n \n System.out.print(vu1); System.out.print(vu2); System.out.print(vu3);\n System.out.print(vu6); System.out.print(vu4); System.out.print(vu6);\n System.out.print(vu5);\n System.out.println();\n System.out.println(\"------------------------------\");\n \n VariableUnit temp, temp1;\n for (int i = 0; i < op_order.size(); i++) {\n \ttemp = op_order.pollFirst();\n \t\n \t\tswitch (temp.getVariable()) {\n \tcase '+':\n \t\t//if processor.isEmpty(): throw an exception\n \t\ttemp1 = processor.pop().add(op_order.pollFirst());\n \t\tprocessor.push(temp1);\n \t\tbreak;\n \tcase '-':\n \t\t//if processor.isEmpty(): throw an exception\n \t\ttemp1 = processor.pop().subtract(op_order.pollFirst());\n \t\tprocessor.push(temp1);\n \t\tbreak;\n \tdefault:\n \t\tprocessor.push(temp);\n \t\t}\n }\n\n /*\n * System.out.println(\"This equation is currently unsolvable.\");\n \tSystem.out.println(\"Try assigning values to some of the variables.\");\n */\n while (!processor.isEmpty()) {\n \top_order.addFirst(processor.pop());\n }\n \n ListIterator<VariableUnit> iter = op_order.listIterator();\n \n while ( iter.hasNext() ) {\n \tVariableUnit iter_temp = iter.next();\n \t//System.out.print(iter_temp.hasValue());\n \tif (iter_temp.hasValue()) {\n \t\tSystem.out.print( Double.toString(iter_temp.subValue()) );\n \t}\n \telse {\n \t\tSystem.out.print(iter_temp);\n \t}\n };\n System.out.println();\n \n return new VariableUnit(Double.NaN, ' ');\n }", "public interface AssignmentNode extends StackOperationNode {\n\n TemporaryVariableName getValueName();\n\n}", "public abstract void assign(ParameterVector pv) throws SolverException;", "public Stmt createAssignment(Assign expr) {\n return createEval(expr);\n }", "protected Expr visitSettableAssign(SettableAssign n) throws SemanticException {\n Position pos = n.position();\n MethodInstance mi = n.methodInstance();\n List<Expr> args = new ArrayList<Expr>(n.index());\n if (n.operator() == Assign.ASSIGN) {\n // FIXME: this changes the order of evaluation, (a,i,v) -> (a,v,i)!\n args.add(0, n.right());\n return xnf.Call(pos, n.array(), xnf.Id(pos, mi.name()),\n args).methodInstance(mi).type(mi.returnType());\n }\n X10Binary_c.Operator op = n.operator().binaryOperator();\n X10Call left = (X10Call) n.left();\n MethodInstance ami = left.methodInstance();\n List<Formal> parms = new ArrayList<Formal>();\n Name xn = Name.make(\"x\");\n LocalDef xDef = xts.localDef(pos, xts.Final(), Types.ref(mi.container()), xn);\n Formal x = xnf.Formal(pos, xnf.FlagsNode(pos, xts.Final()),\n xnf.CanonicalTypeNode(pos, mi.container()), xnf.Id(pos, xn)).localDef(xDef);\n parms.add(x);\n List<Expr> idx1 = new ArrayList<Expr>();\n int i = 0;\n for (Type t : ami.formalTypes()) {\n Name yn = Name.make(\"y\"+i);\n LocalDef yDef = xts.localDef(pos, xts.Final(), Types.ref(t), yn);\n Formal y = xnf.Formal(pos, xnf.FlagsNode(pos, xts.Final()),\n xnf.CanonicalTypeNode(pos, t), xnf.Id(pos, yn)).localDef(yDef);\n parms.add(y);\n idx1.add(xnf.Local(pos, xnf.Id(pos, yn)).localInstance(yDef.asInstance()).type(t));\n i++;\n }\n Name zn = Name.make(\"z\");\n Type T = mi.formalTypes().get(0);\n assert (xts.isSubtype(ami.returnType(), T, context()));\n LocalDef zDef = xts.localDef(pos, xts.Final(), Types.ref(T), zn);\n Formal z = xnf.Formal(pos, xnf.FlagsNode(pos, xts.Final()),\n xnf.CanonicalTypeNode(pos, T), xnf.Id(pos, zn)).localDef(zDef);\n parms.add(z);\n Expr val = visitBinary((X10Binary_c) xnf.Binary(pos,\n xnf.Call(pos,\n xnf.Local(pos, xnf.Id(pos, xn)).localInstance(xDef.asInstance()).type(mi.container()),\n xnf.Id(pos, ami.name()), idx1).methodInstance(ami).type(T),\n op, xnf.Local(pos, xnf.Id(pos, zn)).localInstance(zDef.asInstance()).type(T)).type(T));\n List<Expr> args1 = new ArrayList<Expr>(idx1);\n args1.add(0, val);\n Type ret = mi.returnType();\n Expr res = xnf.Call(pos,\n xnf.Local(pos, xnf.Id(pos, xn)).localInstance(xDef.asInstance()).type(mi.container()),\n xnf.Id(pos, mi.name()), args1).methodInstance(mi).type(ret);\n // Have to create the appropriate node in case someone defines a set():void\n Block block = ret.isVoid() ?\n xnf.Block(pos, xnf.Eval(pos, res), xnf.Return(pos, xnf.Call(pos,\n xnf.Local(pos, xnf.Id(pos, xn)).localInstance(xDef.asInstance()).type(mi.container()),\n xnf.Id(pos, ami.name()), idx1).methodInstance(ami).type(T))) :\n xnf.Block(pos, xnf.Return(pos, res));\n Closure c = synth.makeClosure(pos, T, parms, block, context());\n X10MethodInstance ci = c.closureDef().asType().applyMethod();\n args.add(0, n.array());\n args.add(n.right());\n return xnf.ClosureCall(pos, c, args).closureInstance(ci).type(ret);\n }", "@Override\n public void visit(VariableAssignNode variableAssignNode) {\n }", "public abstract IDecisionVariable getVariable();", "@Override\n public CodeFragment visitAssignmentStat(AlangParser.AssignmentStatContext ctx) {\n String name = ctx.ID().getText();\n if (!variableExists(name)) {\n this.addError(ctx, name, \"Assignment to undeclared variable\");\n return new CodeFragment(\"\");\n }\n\n Variable v = this.globals.get(name);\n v.setValue(ctx.global_expression().getText());\n v.setHasValue();\n\n return new CodeFragment(\"\");\n }", "private BDDState handleAssignment(CAssignment assignment, CFANode successor, CFAEdge edge)\n throws UnsupportedCodeException {\n CExpression lhs = assignment.getLeftHandSide();\n\n final String varName;\n if (lhs instanceof CIdExpression) {\n varName = ((CIdExpression) lhs).getDeclaration().getQualifiedName();\n } else {\n varName = functionName + \"::\" + lhs;\n }\n\n final CType targetType = lhs.getExpressionType();\n\n // next line is a shortcut, not necessary\n if (!precision.isTracking(MemoryLocation.fromQualifiedName(varName), targetType, successor)) {\n return state;\n }\n\n BDDState newState = state;\n CRightHandSide rhs = assignment.getRightHandSide();\n if (rhs instanceof CExpression exp) {\n final Partition partition = varClass.getPartitionForEdge(edge);\n\n if (isUsedInExpression(varName, exp)) {\n // make tmp for assignment,\n // this is done to handle assignments like \"a = !a;\" as \"tmp = !a; a = tmp;\"\n String tmpVarName = predmgr.getTmpVariableForPartition(partition);\n final Region[] tmp =\n predmgr.createPredicateWithoutPrecisionCheck(\n tmpVarName, bvComputer.getBitsize(partition, targetType));\n final CFANode location = successor;\n\n // make region for RIGHT SIDE and build equality of var and region\n final Region[] regRHS =\n bvComputer.evaluateVectorExpression(partition, exp, targetType, location, precision);\n newState = newState.addAssignment(tmp, regRHS);\n\n // delete var, make tmp equal to (new) var, then delete tmp\n final Region[] var =\n predmgr.createPredicate(\n scopeVar(lhs),\n targetType,\n successor,\n bvComputer.getBitsize(partition, targetType),\n precision);\n newState = newState.forget(var);\n newState = newState.addAssignment(var, tmp);\n newState = newState.forget(tmp);\n\n } else {\n final Region[] var =\n predmgr.createPredicate(\n scopeVar(lhs),\n targetType,\n successor,\n bvComputer.getBitsize(partition, targetType),\n precision);\n newState = newState.forget(var);\n final CFANode location = successor;\n\n // make region for RIGHT SIDE and build equality of var and region\n final Region[] regRHS =\n bvComputer.evaluateVectorExpression(\n partition, (CExpression) rhs, targetType, location, precision);\n newState = newState.addAssignment(var, regRHS);\n }\n return newState;\n\n } else if (rhs instanceof CFunctionCallExpression) {\n // handle params of functionCall, maybe there is a sideeffect\n newState =\n handleExternalFunctionCall(\n newState, successor, ((CFunctionCallExpression) rhs).getParameterExpressions());\n\n // call of external function: we know nothing, so we delete the value of the var\n // TODO can we assume, that malloc returns something !=0?\n // are there some \"save functions\"?\n\n final Region[] var =\n predmgr.createPredicate(\n scopeVar(lhs),\n targetType,\n successor,\n bitsize,\n precision); // is default bitsize enough?\n newState = newState.forget(var);\n\n return newState;\n\n } else {\n throw new AssertionError(\"unhandled assignment: \" + edge.getRawStatement());\n }\n }", "public VariableCoefficientTuple suggestBranchingVariable (TwoIntegerTuple childRectCounts ) {\r\n \r\n VariableCoefficientTuple result= new VariableCoefficientTuple(null, ZERO) ;\r\n \r\n //first get the best lp rects\r\n List<Rectangle> rectanglesToConsiderForBranchingVarCalculation = this.getRectanglesToConsiderForBranchingVarCalculation( );\r\n \r\n //collect 0 direction refcounts into this map\r\n Map<String, Integer> zeroVar_RefCountMap = new HashMap<String, Integer> () ;\r\n //and one diirection refconts into this map\r\n Map<String, Integer> oneVar_RefCountMap = new HashMap<String, Integer> () ;\r\n \r\n List<VariableCoefficientTuple> variablesUsedForBranchingInThisRectangle =null;\r\n for (Rectangle rect: rectanglesToConsiderForBranchingVarCalculation){\r\n variablesUsedForBranchingInThisRectangle = getVariablesUsedForBranchingInThisRectangle (rect);\r\n if (variablesUsedForBranchingInThisRectangle.size()>ZERO) {\r\n this.updateVariableRefCounts(zeroVar_RefCountMap, oneVar_RefCountMap, variablesUsedForBranchingInThisRectangle) ;\r\n }else {\r\n System.err.print(\"trying to branch a node which should have been marked infeasible\" );\r\n exit(ONE);\r\n }\r\n }\r\n \r\n \r\n //now find the highest refcount var, no matter its direction\r\n int highZeroFreq = zeroVar_RefCountMap.isEmpty()?ZERO:Collections.max( zeroVar_RefCountMap.values());\r\n int highOneFreq = oneVar_RefCountMap.isEmpty()? ZERO: Collections.max(oneVar_RefCountMap.values()) ;\r\n \r\n //we need to find the selected var's refcount on the other side\r\n int selectedVarRefCountOnOtherSide = ZERO;\r\n \r\n int totalRects = getNumberOfRects(this.myInfeasibleRectanglesList) ;\r\n \r\n if (highZeroFreq>highOneFreq) {\r\n result.varName=getHighestFreqVar (zeroVar_RefCountMap,highZeroFreq ) ;\r\n result.coeff=highZeroFreq;\r\n selectedVarRefCountOnOtherSide= oneVar_RefCountMap.get( result.varName)==null? ZERO : oneVar_RefCountMap.get( result.varName);\r\n //this is how many rects will survive on either side\r\n childRectCounts.zeroSideCount = totalRects - selectedVarRefCountOnOtherSide;\r\n childRectCounts.oneSideCount=totalRects -highZeroFreq ;\r\n \r\n } else {\r\n result.varName=getHighestFreqVar (oneVar_RefCountMap,highOneFreq ) ;\r\n result.coeff=highOneFreq;\r\n selectedVarRefCountOnOtherSide= zeroVar_RefCountMap.get( result.varName)==null? ZERO : zeroVar_RefCountMap.get( result.varName);\r\n \r\n childRectCounts.zeroSideCount = totalRects - highOneFreq;\r\n childRectCounts.oneSideCount=totalRects - selectedVarRefCountOnOtherSide;\r\n }\r\n \r\n return result;\r\n }", "public abstract Object getDecisionValue();", "@Override\r\n\tpublic Object visit(YoyooAssignmentOperator node, Object data) {\r\n\t\tassignOptMark = new OperatorMark(node.first_token.image);\r\n\t\treturn null;\r\n\t}", "public static BinaryExpression addAssign(Expression expression0, Expression expression1) { throw Extensions.todo(); }", "public LlvmValue visit(Assign n){\n\t\t\n\t\tSystem.out.format(\"assign********\\n\");\n\t\t\n\t\tLlvmValue rhs = n.exp.accept(this);\n\t\tLlvmRegister returns;\n\t\t//Nesta parte, para retornarmos o tipo certo, tivemos que converter todos os parametros do tipo\n\t\t//[ A x iB] para ponteiros. o Assembly reclamava quando tinha algum store ou algo do genero com tipos\n\t\t// diferentes\n\t\tif(rhs.type.toString().contains(\"x i\")){\n\t\t\t//System.out.format(\"expressao de rhs envolve arrays. fazendo casting...\\n\");\n\t\t\t\n\t\t\t//Fazer bitcast\n\t\t\tif(rhs.type.toString().contains(\" x i32\")){\n\t\t\t\treturns = new LlvmRegister(LlvmPrimitiveType.I32PTR);\n\t\t\t}else if(rhs.type.toString().contains(\" x i8\")){\n\t\t\t\treturns = new LlvmRegister(new LlvmPointer(LlvmPrimitiveType.I8));\n\t\t\t//Esse else eh meio inutil, mas pelo fato de eu querer usar elseif, deixei ele aqui mesmo.\n\t\t\t}else{\n\t\t\t\treturns = new LlvmRegister(rhs.type);\n\t\t\t}\n\t\t\t\n\t\t\tassembler.add(new LlvmBitcast(returns, rhs, returns.type));\n\t\t\tassembler.add(new LlvmStore(returns, n.var.accept(this)));\n\t\t}else{\n\t\t\t//Caso o tipo ja esteja ok, soh damos store com o rhs mesmo.\n\t\t\tassembler.add(new LlvmStore(rhs, n.var.accept(this)));\n\t\t}\n\t\treturn null;\n\t}", "private Expr visitLocalAssign(LocalAssign n) throws SemanticException { \n Position pos = n.position();\n if (n.operator() == Assign.ASSIGN) return n;\n X10Binary_c.Operator op = n.operator().binaryOperator();\n Local left = (Local) n.left();\n Expr right = n.right();\n Type R = left.type();\n Expr val = visitBinary((X10Binary_c) xnf.Binary(pos, left, op, right).type(R));\n return assign(pos, left, Assign.ASSIGN, val);\n }", "protected ConstraintSyntaxTree reduce(OCLFeatureCall assignment) { \n result = assignment;\n \n if (OclKeyWords.ASSIGNMENT.equals(assignment.getOperation())) {\n result = null;\n assignment.getParameter(0).accept(this);\n \n if (filtered && null != result) {\n result = new OCLFeatureCall(assignment.getOperand(), assignment.getOperation(), result);\n try {\n // Needed for setting the correct operation\n result.inferDatatype();\n } catch (CSTSemanticException e) {\n result = null;\n Bundle.getLogger(AssignmentReducer.class).exception(e);\n }\n } else if (!filtered) {\n result = assignment;\n }\n }\n \n return result;\n }", "public static IntStrategy custom(VariableSelector<IntVar> VAR_SELECTOR,\n IntValueSelector VAL_SELECTOR,\n DecisionOperator<IntVar> DEC_OPERATOR,\n IntVar... VARS) {\n return new IntStrategy(VARS, VAR_SELECTOR, VAL_SELECTOR, DEC_OPERATOR);\n }", "public VariType visit(AssignmentStatement n, Table argu) {\n\t VariType _ret=null;\n\t n.f0.accept(this, argu);\n\t MethodTable methodtable = (MethodTable)argu;\n\t Vari vari = methodtable.getvari(n.f0.f0.tokenImage);\n\t if(vari == null) {\n\t \t ClassTable classtable = methodtable.classtable;\n\t \t vari = classtable.getvari(n.f0.f0.tokenImage);\n\t \t if(vari == null) {\n\t \t\t PrintError.errorexist = true;\n\t\t \t String emsg = \"undefined variable \\\"\"+n.f0.f0.tokenImage+\"\\\"\";\n\t \t\t PrintError.print(emsg, n.f0.f0.beginLine, n.f0.f0.beginColumn, 1);\n\t \t\t return _ret;\n\t \t }\n\t }\n\t n.f1.accept(this, argu);\n\t VariType t2 = n.f2.accept(this, argu);\n\t if(VariType.isTheSameType(methodtable.toptable, vari.vari_type, t2) == false) {\n\t \t PrintError.errorexist = true;\n\t \t String emsg = \"assignstatement does not have matched types, one has type \"+vari.vari_type.type+\" , the other one has type \"+t2.type;\n\t \t PrintError.print(emsg, n.f1.beginLine, n.f1.beginColumn, 1);\n\t \t return _ret;\n\t }\n\t if(t2.type == \"Array\"){\n\t \t vari.init = true;\n\t \t if(t2.ifintegerliteral == true) {\n\t \t\t vari.alen = t2.integerliteral;\n\t \t }\n\t }\n\t n.f3.accept(this, argu);\n\t return _ret;\n\t }", "public abstract boolean setValue(Value value, boolean asAssignment);", "@Override\n\tpublic Object visitStatement_Assign(Statement_Assign statement_Assign, Object arg) throws Exception {\n\t\tif(statement_Assign.lhs.getTypeName().isType(Type.INTEGER) ||statement_Assign.lhs.getTypeName().isType(Type.BOOLEAN) ){\n\t\t\tstatement_Assign.e.visit(this, arg);\t\t\n\t\t\tstatement_Assign.lhs.visit(this, arg);\n\t\t}\n\t\telse if(statement_Assign.lhs.getTypeName().isType(Type.IMAGE)){\n\t\t\t//if(statement_Assign.lhs.isCartesian){\n\t\t\t\tmv.visitFieldInsn(GETSTATIC, className, statement_Assign.lhs.name, ImageSupport.ImageDesc);\n\t\t\t\tmv.visitInsn(DUP);\n\t\t\t\tmv.visitMethodInsn(INVOKESTATIC, ImageSupport.className, \"getX\", ImageSupport.getXSig, false);\n\t\t\t\tmv.visitIntInsn(ISTORE, 3);\n\t\t\t\tmv.visitMethodInsn(INVOKESTATIC, ImageSupport.className, \"getY\", ImageSupport.getYSig, false);\n\t\t\t\tmv.visitIntInsn(ISTORE, 4);\t\t\t\t\n\t\t\t//}\n\t\t\t\n\t\t\tmv.visitInsn(ICONST_0);\n\t\t\tmv.visitVarInsn(ISTORE, 1);\n\t\t\tLabel l1 = new Label();\n\t\t\tmv.visitLabel(l1);\n\t\t\tLabel l2 = new Label();\n\t\t\tmv.visitJumpInsn(GOTO, l2);\n\t\t\tLabel l3 = new Label();\n\t\t\tmv.visitLabel(l3);\n\t\t\tmv.visitLineNumber(11, l3);\n\t\t\tmv.visitFrame(Opcodes.F_APPEND,1, new Object[] {Opcodes.INTEGER}, 0, null);\n\t\t\tmv.visitInsn(ICONST_0);\n\t\t\tmv.visitVarInsn(ISTORE, 2);\n\t\t\tLabel l4 = new Label();\n\t\t\tmv.visitLabel(l4);\n\t\t\tLabel l5 = new Label();\n\t\t\tmv.visitJumpInsn(GOTO, l5);\n\t\t\tLabel l6 = new Label();\n\t\t\tmv.visitLabel(l6);\n\t\t\tmv.visitFrame(Opcodes.F_APPEND,1, new Object[] {Opcodes.INTEGER}, 0, null);\n\t\t\t\n\t\t\tstatement_Assign.e.visit(this, arg);\n\t\t\tstatement_Assign.lhs.visit(this, arg);\n\t\t\t\n\t\t\tmv.visitIincInsn(2, 1);\n\t\t\tmv.visitLabel(l5);\n\t\t\tmv.visitFrame(Opcodes.F_SAME, 0, null, 0, null);\n\t\t\tmv.visitVarInsn(ILOAD, 2);\n\t\t\tmv.visitIntInsn(ILOAD, 4); // Y MAX VALUE\n\t\t\tmv.visitJumpInsn(IF_ICMPLT, l6);\n\t\t\tLabel l7 = new Label();\n\t\t\tmv.visitLabel(l7);\n\t\t\tmv.visitIincInsn(1, 1);\n\t\t\tmv.visitLabel(l2);\n\t\t\tmv.visitFrame(Opcodes.F_CHOP,1, null, 0, null);\n\t\t\tmv.visitVarInsn(ILOAD, 1);\n\t\t\tmv.visitIntInsn(ILOAD, 3); // X MAX VALUE\n\t\t\tmv.visitJumpInsn(IF_ICMPLT, l3);\n\t\t}\n\t\treturn null;\n\t}", "public Assign createAssign(Position pos, Expr target, Operator op, Expr source) {\n return (Assign) xnf.Assign(pos, target, op, source).type(target.type());\n }", "public static BinaryExpression assign(Expression left, Expression right) { throw Extensions.todo(); }", "private ConvertViewReuseWithTernary(CtVariableReference reassignedVariable,\n CtVariableRead checkedVariable,\n CtVariableRead assignedVariable,\n DetectionPhaseContext context) {\n super(context);\n this.reassignedVariable = reassignedVariable;\n this.checkedVariable = checkedVariable;\n this.assignedVariable = assignedVariable;\n }", "public abstract void createAssignment(int p);", "@Override\n public Expression visit(LogicalOpNode node) {\n\n Label trueLabel = new Label ();\n Label falseLabel = new Label ();\n Label endLabel = new Label ();\n\n process(node, trueLabel, falseLabel);\n\n cat.footoredo.mx.entity.Variable variable = tmpVariable(node.getType());\n\n label (trueLabel);\n assign (node.getLocation(), ref(variable), new Integer(Type.INT8, 1));\n jump (endLabel);\n\n label (falseLabel);\n assign (node.getLocation(), ref(variable), new Integer(Type.INT8, 0));\n jump (endLabel);\n\n label (endLabel);\n\n return isStatement() ? null : ref (variable);\n }", "@FunctionalInterface\n\tpublic interface Assignment<V> {\n\t\tV set(Program p,V v);\n\t}", "Syntax.Node ParseAssignment(Token t, Syntax.NodeVar left) throws Exception{\n while (true){\n if(t.type==TokenType.ASSIGNMENT_OPERATOR){\n var right = ParseExpression();\n return new Syntax.AssignmentNode(\":=\", left, right);\n }\n else {\n lexer.putBack(t);\n break;\n //throw new Exception(\"Error in ParseAssignment!!! can't assign it \");\n }\n }\n throw new Exception(\"Error in ParseAssignment!!! \");\n\n }", "protected abstract Value evaluate();", "@Override\n\t\t\tpublic Ast unaryOp(UnaryOp ast, Void dummy) {\n\t\t\t\tsuper.unaryOp(ast, dummy);\n\t\t\t\ttry {\n\t\t\t\t\tInteger intValue = null;\n\t\t\t\t\tBoolean boolValue = null;\n\n\t\t\t\t\tswitch (ast.operator) {\n\t\t\t\t\tcase U_BOOL_NOT:\n\t\t\t\t\t\tboolValue = !asBool(ast.arg());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase U_MINUS:\n\t\t\t\t\t\tintValue = -asInt(ast.arg());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase U_PLUS:\n\t\t\t\t\t\tintValue = asInt(ast.arg());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn replace(ast, intValue, boolValue);\n\t\t\t\t} catch (NotConstantException e) {\n\t\t\t\t\t// non-constant argument, no effect\n\t\t\t\t\treturn ast;\n\t\t\t\t}\n\t\t\t}", "private Operator findOperatorToResolve(Predicate predToResolve) throws Exception {\n\t\tfor (Operator op : this.operators) {\n\t\t\tOperator opCopy = op.getClass().newInstance();\n\t\t\tfor (Predicate predCandidate : opCopy.getAdd().toList()) {\n\t\t\t\tif (predCandidate.isCompatibleTo(predToResolve)) {\n\t\t\t\t\t// instantiate opCopy with predToResolve\n\t\t\t\t\tfor (int i = 0; i < predToResolve.getValence(); i++) {\n\t\t\t\t\t\tif (!predCandidate.getArgument(i).isInstantiated()) {\n\t\t\t\t\t\t\tpredCandidate.getArgument(i).instantiate(predToResolve.getArgument(i).getValue());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn opCopy;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\tthrow new RuntimeException(\"There was no operator found to resolve a predicate. There is no possible plan.\");\n\t}", "static InfixExpression.Operator assignmentToInfix(final Assignment.Operator o) {\n return o == PLUS_ASSIGN ? InfixExpression.Operator.PLUS\n : o == MINUS_ASSIGN ? MINUS\n : o == TIMES_ASSIGN ? TIMES\n : o == DIVIDE_ASSIGN ? DIVIDE\n : o == BIT_AND_ASSIGN ? AND\n : o == BIT_OR_ASSIGN ? OR\n : o == BIT_XOR_ASSIGN ? XOR\n : o == REMAINDER_ASSIGN ? REMAINDER\n : o == LEFT_SHIFT_ASSIGN ? LEFT_SHIFT\n : o == RIGHT_SHIFT_SIGNED_ASSIGN ? RIGHT_SHIFT_SIGNED\n : o == RIGHT_SHIFT_UNSIGNED_ASSIGN ? RIGHT_SHIFT_UNSIGNED : null;\n }", "@Override\n public Operator visitAssign(Assign operator)\n {\n throw new AssertionError();\n }", "public Stmt createAssignment(Position pos, Expr target, Operator op, Expr source) {\n return createAssignment(createAssign(pos, target, op, source));\n }", "private List<State> expandStateOperatorNode(State s, OperatorNode n, VariableNode v) {\n\n List<State> ret = new ArrayList<>();\n\n // do not continue if we are trying to replace argument of notcc with a op node\n if (v.parent != null && !(v.parent instanceof RepSketchNode)) {\n if (((OperatorNode) v.parent).operatorName.equals(\"notcc\")) {\n return ret;\n }\n }\n\n // Added on 1014\n Node add = expandStateArgNode(s, n, v.parent, v.depth);\n\n s.pp.substituteVar(v, add, true);\n if (evalApprox(s)) ret.add(s);\n\n return ret;\n }", "@Override\n public Boolean visitVariableAttribution(FormScriptGrammarParser.VariableAttributionContext ctx) {\n if (!declaredVariables.containsKey(ctx.VARIABLE().getText())) {\n // this is validated in UI/controlled by flow in the UI so should never happen, but it remains here just in case\n throw new IllegalArgumentException(\"Semantic error at line: \" + ctx.getStart().getLine() + \": variable \" + ctx.VARIABLE().getText() + \" wasn't declared!\");\n// return false; //if we wanted to return the NOTOK/false result recursively, this would be here instead of the throw\n }\n DataType dataType = declaredVariables.get(ctx.VARIABLE().getText());\n boolean correctType = dataType.lexerValue().equals(ctx.value().start.getType());\n /*will verify if the attribution is actually semantically valid, e.g if\n the variable was defined as an INTEGER, it can't be assigned a DATE*/\n if (!correctType) {\n throw new IllegalArgumentException(\"Semantic error at line: \" + ctx.getStart().getLine() + \":\" + ctx.getStart().getCharPositionInLine()\n + \": Invalid attribution type!\" + \" variable \" + ctx.VARIABLE().getText() + \" can't be assigned the value \" + ctx.value().getText());\n// return false; //if we wanted to return the NOTOK/false result recursively, this would be here instead of the throw\n }\n //verify if operators are valid in the context of the datatype\n String operator = ctx.COMPARISON_OPERATORS().getText();\n if (operator.equals(\"<\") || operator.equals(\">\")) {\n if (dataType.equals(DataType.BOOLEAN) || dataType.equals(DataType.DATE) || dataType.equals(DataType.FILE)) {\n throw new IllegalArgumentException(\"Semantic error at line: \" + ctx.getStart().getLine() + \":\" + ctx.getStart().getCharPositionInLine()\n + \": Invalid comparison type!\" + \" variable \" + ctx.VARIABLE().getText() + \" can't be compared with operator '\" + operator + \"'\");\n }\n }\n return true;\n }", "public final void rule__XAssignment__ValueAssignment_0_3() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalDroneScript.g:17396:1: ( ( ruleXAssignment ) )\r\n // InternalDroneScript.g:17397:2: ( ruleXAssignment )\r\n {\r\n // InternalDroneScript.g:17397:2: ( ruleXAssignment )\r\n // InternalDroneScript.g:17398:3: ruleXAssignment\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXAssignmentAccess().getValueXAssignmentParserRuleCall_0_3_0()); \r\n }\r\n pushFollow(FOLLOW_2);\r\n ruleXAssignment();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXAssignmentAccess().getValueXAssignmentParserRuleCall_0_3_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "public Arginfo visit(AssignmentStatement n, Arginfo argu) {\n Arginfo _ret=null;\n n.f0.accept(this, argu);\n \n String classname=argu.classname;\n String methodname=argu.methodname;\n String strtofind=n.f0.f0.tokenImage;\n if(globalmap.containsKey(strtofind)){\n \t System.out.print(\"\\tMOVE TEMP \"+globalmap.get(strtofind)+\" \");\n }\n else{\n \t System.out.print(\"\\tHSTORE TEMP 0 \"+classpos(strtofind,classname)+\" \");\n }\n \n n.f1.accept(this, argu);\n n.f2.accept(this, argu);\n n.f3.accept(this, argu);\n return _ret;\n }", "public boolean assignVariable(Scanner scan){\n\t\tif (scan.hasNext(\"\\\\=\")){\n\t\t\tif (!Parser.gobble(\"\\\\=\", scan)){ Parser.fail(\"Should have = for variables.\", scan); }\n\t\t\texpr = new Expression();\n\t\t\texpr.parse(scan);\t\t\t\t\t\t//Assignment\n\t\t\tif (!Parser.gobble(\"\\\\;\", scan)){ Parser.fail(\"Should have ; for variables.\", scan); }\n\t\t\t//Add to map\n\t\t\tParser.variables.put(name, this);\n\t\t\treturn true;\n\t\t} else if (scan.hasNext(\"\\\\;\")){\t//DECLARED NOT ASSIGNMENT\n\t\t\tif (!Parser.gobble(\"\\\\;\", scan)){ Parser.fail(\"Should have ; for variables.\", scan); }\n\t\t\t/*\t\t\tNum number = new Num();\n\t\t\tnumber.numberNodeZero();\n\t\t\texpr = number;\t\t\t\t\t//sets expr to 0. \n\t\t\t */\t\t\treturn true; \t\t\t\t\t//Shouldnt set it to 0 if there is already variable in map\n\t\t}\n\t\treturn false;\n\t}", "public void visit(AssignmentOperator n) {\n n.f0.accept(this);\n }", "public Code visitAssignmentNode(StatementNode.AssignmentNode node) {\n beginGen(\"Assignment\");\n /* Generate code to evaluate the expression */\n Code code = new Code();\n /* Generate the code to load the address of the variable */\n for(int i= 0; i < node.getExps().size(); i++) {\n \tExpNode exp = node.getExps().get(i);\n \tcode.append(exp.genCode(this));\n }\n for(int i = node.getLValues().size() - 1; i >= 0; i--) {\n \tExpNode lValue = node.getLValues().get(i);\n \tcode.append(lValue.genCode(this));\n \tcode.genStore(lValue.getType());\n }\n endGen(\"Assignment\");\n return code;\n }", "VariableExp createVariableExp();", "public interface AssignmentStrategy {\n\tpublic Map<Integer, Integer> assign(DoubleMatrix matrix);\n}", "public final void rule__OpMultiAssign__Alternatives() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalDroneScript.g:2499:1: ( ( '+=' ) | ( '-=' ) | ( '*=' ) | ( '/=' ) | ( '%=' ) | ( ( rule__OpMultiAssign__Group_5__0 ) ) | ( ( rule__OpMultiAssign__Group_6__0 ) ) )\r\n int alt7=7;\r\n switch ( input.LA(1) ) {\r\n case 16:\r\n {\r\n alt7=1;\r\n }\r\n break;\r\n case 17:\r\n {\r\n alt7=2;\r\n }\r\n break;\r\n case 18:\r\n {\r\n alt7=3;\r\n }\r\n break;\r\n case 19:\r\n {\r\n alt7=4;\r\n }\r\n break;\r\n case 20:\r\n {\r\n alt7=5;\r\n }\r\n break;\r\n case 27:\r\n {\r\n alt7=6;\r\n }\r\n break;\r\n case 26:\r\n {\r\n alt7=7;\r\n }\r\n break;\r\n default:\r\n if (state.backtracking>0) {state.failed=true; return ;}\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 7, 0, input);\r\n\r\n throw nvae;\r\n }\r\n\r\n switch (alt7) {\r\n case 1 :\r\n // InternalDroneScript.g:2500:2: ( '+=' )\r\n {\r\n // InternalDroneScript.g:2500:2: ( '+=' )\r\n // InternalDroneScript.g:2501:3: '+='\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getOpMultiAssignAccess().getPlusSignEqualsSignKeyword_0()); \r\n }\r\n match(input,16,FOLLOW_2); if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getOpMultiAssignAccess().getPlusSignEqualsSignKeyword_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n break;\r\n case 2 :\r\n // InternalDroneScript.g:2506:2: ( '-=' )\r\n {\r\n // InternalDroneScript.g:2506:2: ( '-=' )\r\n // InternalDroneScript.g:2507:3: '-='\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getOpMultiAssignAccess().getHyphenMinusEqualsSignKeyword_1()); \r\n }\r\n match(input,17,FOLLOW_2); if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getOpMultiAssignAccess().getHyphenMinusEqualsSignKeyword_1()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n break;\r\n case 3 :\r\n // InternalDroneScript.g:2512:2: ( '*=' )\r\n {\r\n // InternalDroneScript.g:2512:2: ( '*=' )\r\n // InternalDroneScript.g:2513:3: '*='\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getOpMultiAssignAccess().getAsteriskEqualsSignKeyword_2()); \r\n }\r\n match(input,18,FOLLOW_2); if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getOpMultiAssignAccess().getAsteriskEqualsSignKeyword_2()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n break;\r\n case 4 :\r\n // InternalDroneScript.g:2518:2: ( '/=' )\r\n {\r\n // InternalDroneScript.g:2518:2: ( '/=' )\r\n // InternalDroneScript.g:2519:3: '/='\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getOpMultiAssignAccess().getSolidusEqualsSignKeyword_3()); \r\n }\r\n match(input,19,FOLLOW_2); if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getOpMultiAssignAccess().getSolidusEqualsSignKeyword_3()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n break;\r\n case 5 :\r\n // InternalDroneScript.g:2524:2: ( '%=' )\r\n {\r\n // InternalDroneScript.g:2524:2: ( '%=' )\r\n // InternalDroneScript.g:2525:3: '%='\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getOpMultiAssignAccess().getPercentSignEqualsSignKeyword_4()); \r\n }\r\n match(input,20,FOLLOW_2); if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getOpMultiAssignAccess().getPercentSignEqualsSignKeyword_4()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n break;\r\n case 6 :\r\n // InternalDroneScript.g:2530:2: ( ( rule__OpMultiAssign__Group_5__0 ) )\r\n {\r\n // InternalDroneScript.g:2530:2: ( ( rule__OpMultiAssign__Group_5__0 ) )\r\n // InternalDroneScript.g:2531:3: ( rule__OpMultiAssign__Group_5__0 )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getOpMultiAssignAccess().getGroup_5()); \r\n }\r\n // InternalDroneScript.g:2532:3: ( rule__OpMultiAssign__Group_5__0 )\r\n // InternalDroneScript.g:2532:4: rule__OpMultiAssign__Group_5__0\r\n {\r\n pushFollow(FOLLOW_2);\r\n rule__OpMultiAssign__Group_5__0();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getOpMultiAssignAccess().getGroup_5()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n break;\r\n case 7 :\r\n // InternalDroneScript.g:2536:2: ( ( rule__OpMultiAssign__Group_6__0 ) )\r\n {\r\n // InternalDroneScript.g:2536:2: ( ( rule__OpMultiAssign__Group_6__0 ) )\r\n // InternalDroneScript.g:2537:3: ( rule__OpMultiAssign__Group_6__0 )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getOpMultiAssignAccess().getGroup_6()); \r\n }\r\n // InternalDroneScript.g:2538:3: ( rule__OpMultiAssign__Group_6__0 )\r\n // InternalDroneScript.g:2538:4: rule__OpMultiAssign__Group_6__0\r\n {\r\n pushFollow(FOLLOW_2);\r\n rule__OpMultiAssign__Group_6__0();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getOpMultiAssignAccess().getGroup_6()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n break;\r\n\r\n }\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "private ConflictCause assignTruth(int atom, ThriceTruth truth, NoGood impliedBy, int decisionLevel) {\n\t\tAssignment.Entry currentAssignment = assignment.get(atom);\n\t\tif (currentAssignment != null && currentAssignment.getDecisionLevel() <= decisionLevel && (truth.equals(currentAssignment.getTruth()))) {\n\t\t\treturn null;\n\t\t}\n\t\tConflictCause cause = assignment.assign(atom, truth, impliedBy, decisionLevel);\n\t\tif (cause == null) {\n\t\t\tdidPropagate = true;\n\t\t}\n\t\treturn cause;\n\t}", "public void useNormalVarimax(){\n this. varimaxOption = true;\n }", "private void instantiate(Predicate singlePred, Heuristic heuristic) {\n\n\t\tList<Predicate> compatiblePredicates = new ArrayList<>();\n\t\tfor (Predicate currPred : this.currentState.getPredicates().toList()) {\n\t\t\t// find all compatible predicates in current state:\n\t\t\tif (currPred.isCompatibleTo(singlePred)) {\n\t\t\t\tcompatiblePredicates.add(currPred);\n\t\t\t}\n\t\t}\n\n\t\tif (compatiblePredicates.isEmpty()) {\n\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\"There was no compatible predicate found to resolve the predicate \" + singlePred);\n\t\t}\n\n\t\t// Heuristic chooses one candidate from compatiblePredicates\n\t\tPredicate chosenPred = heuristic.choosePredicateForInstantiation(compatiblePredicates, currentState);\n\n\t\t// instantiate with singlePred with constants of chosenPred\n\t\tfor (int i = 0; i < chosenPred.getValence(); i++) {\n\t\t\tif (!singlePred.getArgument(i).isInstantiated()) {\n\t\t\t\t// Update the Java object of the variable.\n\t\t\t\t// All references to this variable in other predicates\n\t\t\t\t// will now reference to the instantiated variable.\n\t\t\t\tsinglePred.getArgument(i).instantiate(chosenPred.getArgument(i).getValue());\n\t\t\t}\n\t\t}\n\n\t}", "public static BinaryExpression addAssign(Expression expression0, Expression expression1, Method method) { throw Extensions.todo(); }", "private <E> Assignment<E> backtracking(CSP<E> csp, Assignment<E> assignment, HashMap<String,Set<E>> explored) {\r\n\t\t++iterationCount;\r\n\t\tif(assignment.isComplete(csp) || iterationCount>10000){\r\n\t\t\treturn assignment;\r\n\t\t}\r\n\t\tString var=selectUnassignedVariable(csp, assignment);\r\n\t\tList<E> values= orderDomainValues(csp, var, assignment);\r\n\t\tSet<E> valuesSet = new HashSet<>();\r\n\t\tfor(int i=0;i<values.size();i++){\r\n\t\t\tboolean consistent=true;\r\n\t\t\tif(!Visited(explored,var,values.get(i))){\r\n\t\t\t\tvaluesSet.add(values.get(i));\r\n\t\t\t\tassignment.put(var,values.get(i));\r\n\t\t\t\texplored.put(var,valuesSet);\r\n\t\t\t\tif(csp.isConsistent(assignment)){\r\n\t\t\t\t\tAssignment<E> result = backtracking(csp, assignment, explored);\r\n\t\t\t\t\tif(result!=null) {\r\n\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tassignment.remove(var);\r\n\t\t\t}\r\n\t\t}\r\n\t\texplored.get(var).clear();\r\n\t\treturn null;\r\n\t}", "protected Element initAssuranceToMyVar() {\n\t\tElement an = el(\"bpws:assign\", new Node[]{\n\t\t\t\tinitMyVar(new Node[]{\n\t\t\t\t\tel(\"nswomoxsd:type\", text(\"Assurance\")),\n\t\t\t\t\tel(\"nswomoxsd:leftValue\", text(\"0\")),\n\t\t\t\t\tel(\"nswomoxsd:rightValue\", text(\"0\")),\n\t\t\t\t\tel(\"nswomoxsd:value\", text(\"0\"))\n\t\t\t\t}),\n\t\t\t\tsetProcId()\n\t\t});\n\t\treturn an;\n\t}", "public void doAction(\r\n\t\t\tAction_To_Choose action,\r\n\t\t\tGuideline_Action_Choices currentDecision,\r\n\t\t\tGuidelineInterpreter interpreter ){\r\n\n\t\tif (getrule_in_conditionValue() != null) {\n\t\t\tCriteria_Evaluation evaluation = HelperFunctions.dummyCriteriaEvaluation();\n\t\t\ttry {\n\t\t\t\tevaluation = (Criteria_Evaluation) ((Criterion)getrule_in_conditionValue()).evaluate(interpreter, false);\n\t\t\t\tif (!(PCAInterfaceUtil.mapTruthValue(evaluation.truth_value))) { // rule-in condition does not hold\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t} catch (PCA_Session_Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\treturn ;\n\t\t\t}\n\t\t}\n\r\n\t\t// each item in alternatives is a Drug Usage.\r\n\t\t// each item in addEvaluation is an Add_Evaluation structure\n\t\tCollection<Slot> recommendationBais = getrecommendation_basisValue();\r\n\t\tCollection alternatives = getalternativesValue();\r\n\t\tList addEvaluations = new ArrayList();\r\n\t\t// addEvaluations is a collection of Choice_Evaluation instances\r\n\t\tfor (Iterator i = alternatives.iterator();i.hasNext();) {\r\n\t\t\tDrug_Usage activity = (Drug_Usage) i.next();\r\n\t\t\tChoice_Evaluation choiceEvaluation = new Choice_Evaluation();\r\n\t\t\ttry {\r\n\t\t\t\tAdd_Evaluation addEval = activity.evaluateAdd(interpreter, \n\t\t\t\t\t\tthis.getfine_grain_priorityValue(), null, recommendationBais);\r\n\t\t\t\tif (addEval != null) {\r\n\t\t\t\t\tchoiceEvaluation.add_eval(addEval);\r\n\t\t\t\t\taddEvaluations.add(choiceEvaluation);\r\n\t\t\t\t}\r\n\t\t\t\tlogger.debug(activity.getlabelValue()+\" got evaluated\");\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tlogger.error(activity.getlabelValue()+\" cannot be evaluated; \"+e.getClass());\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tCollections.sort(addEvaluations, new CompareEvals());\r\n\r\n\t\tinterpreter.addEvaluatedChoice(\r\n\t\t\t\tnew Guideline_Activity_Evaluations(\r\n\t\t\t\t\t\tthis.makeGuideline_Entity(interpreter.getCurrentGuidelineID()),\r\n\t\t\t\t\t\tEvaluation_Type.add,\r\n\t\t\t\t\t\t(Choice_Evaluation[])addEvaluations.toArray(new Choice_Evaluation[0]),\r\n\t\t\t\t\t\tinterpreter.getCurrentGuidelineID())\r\n\t\t\t\t);\r\n\r\n\t}", "Assignment createAssignment();", "Assignment createAssignment();", "public void assignValueToVariable(HashMap<String, String> assignment) throws\r\n\t\t\tIllegalOperationException,TypeNotSupportedException, IncompatibleTypeException{\r\n\t\tMap.Entry<String, String> data = assignment.entrySet().iterator().next();\r\n\t\tString variableName = data.getKey();\r\n\t\tString valueName = data.getValue();\r\n\t\tVariable lastAppearanceOfVar = findVariable(variableName);//we'll search a variable named variableName\r\n\t\tif(lastAppearanceOfVar==null||lastAppearanceOfVar.isFinal()){//did'nt find variableName\\ found final\r\n\t\t\tthrow new IllegalOperationException();\r\n\t\t}else {\r\n\t\t\t//if we did find a declared variable named variableName:\r\n\t\t\tif (lastAppearanceOfVar.compatibleWith(valueName)) {//if value's type's illegal -> exception\r\n\t\t\t\t//if we're trying, in a scope other than globalScope, to declare a variable by assigning it\r\n\t\t\t\t// with an uninitialised global variable:\r\n\t\t\t\tif((lastAppearanceOfVar.isGlobal()&&!lastAppearanceOfVar.isInitialized())&&!scopeType\r\n\t\t\t\t\t\t.equals(\"global\")){\r\n\t\t\t\t\t//we'll check if lastAppearanceOfVar was initialised in this scope (else it's illegal):\r\n\t\t\t\t\tassignUninitialisedGlobalVar(lastAppearanceOfVar, valueName);\r\n\t\t\t\t}else{ //else, the assignment's legal and we'll mark lastAppearanceOfVar as initialised:\r\n\t\t\t\t\tlastAppearanceOfVar.initialize();\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tassignWithReference(valueName, lastAppearanceOfVar);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static IntStrategy lexico_Neq_LB(IntVar... VARS) {\n return custom(lexico_var_selector(), min_value_selector(), remove(), VARS);\n }", "@Override\n public ExprType analyzeAssign(AnalyzeInfo info, ExprGenerator value)\n {\n ExprGenerator objGen = ((ExprPro) _objExpr).getGenerator();\n objGen.analyze(info);\n\n value.analyze(info);\n\n // php/3a6e, php/39o3\n // objGen.analyzeSetReference(info);\n objGen.analyzeSetModified(info);\n\n return ExprType.VALUE;\n }", "@Override\n\t\t\tpublic Ast binaryOp(BinaryOp ast, Void arg) {\n\t\t\t\tsuper.binaryOp(ast, arg);\n\n\t\t\t\ttry {\n\t\t\t\t\tExpr left = ast.left();\n\t\t\t\t\tExpr right = ast.right();\n\t\t\t\t\tInteger intValue = null;\n\t\t\t\t\tBoolean boolValue = null;\n\n\t\t\t\t\tswitch (ast.operator) {\n\t\t\t\t\tcase B_TIMES:\n\t\t\t\t\t\tintValue = asInt(left) * asInt(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_DIV:\n\t\t\t\t\t\tintValue = asInt(left) / asInt(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_MOD:\n\t\t\t\t\t\tintValue = asInt(left) % asInt(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_PLUS:\n\t\t\t\t\t\tintValue = asInt(left) + asInt(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_MINUS:\n\t\t\t\t\t\tintValue = asInt(left) - asInt(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_AND:\n\t\t\t\t\t\tboolValue = asBool(left) && asBool(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_OR:\n\t\t\t\t\t\tboolValue = asBool(left) || asBool(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_LESS_THAN:\n\t\t\t\t\t\tboolValue = asInt(left) < asInt(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_LESS_OR_EQUAL:\n\t\t\t\t\t\tboolValue = asInt(left) <= asInt(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_GREATER_THAN:\n\t\t\t\t\t\tboolValue = asInt(left) > asInt(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_GREATER_OR_EQUAL:\n\t\t\t\t\t\tboolValue = asInt(left) >= asInt(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_EQUAL:\n\t\t\t\t\t\tboolValue = areEqual(left, right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_NOT_EQUAL:\n\t\t\t\t\t\tboolValue = areEqual(left, right);\n\t\t\t\t\t\tif (boolValue != null)\n\t\t\t\t\t\t\tboolValue = !boolValue;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn replace(ast, intValue, boolValue);\n\t\t\t\t} catch (NotConstantException exc) {\n\t\t\t\t\t// non-constant operands: make no change.\n\t\t\t\t\treturn ast;\n\t\t\t\t} catch (ArithmeticException exc) {\n\t\t\t\t\t// division by zero etc: make no change.\n\t\t\t\t\treturn ast;\n\t\t\t\t}\n\t\t\t}", "public static VariableSelector<IntVar> lexico_var_selector() {\n return new InputOrder<>();\n }", "public LocalDecisionVariable(DecisionVariableDeclaration decl, IConfiguration conf, IDecisionVariable parent) {\r\n this.decl = decl;\r\n this.state = AssignmentState.UNDEFINED;\r\n this.conf = conf;\r\n this.parent = parent;\r\n }", "public IncrementableAssignment(Literal lit) {\n super(lit, false);\n variableOrdering.add(lit.variable());\n }", "<C, PM> VariableExp<C, PM> createVariableExp();", "@Override\n public TreeNode parse() {\n TreeNode first = ArithmeticSubexpression.getAdditive(environment).parse();\n if (first == null) return null;\n\n // Try to parse something starting with an operator.\n List<Wrapper> wrappers = RightSideSubexpression.createKleene(\n environment, ArithmeticSubexpression.getAdditive(environment),\n BemTeVicTokenType.EQUAL, BemTeVicTokenType.DIFFERENT,\n BemTeVicTokenType.GREATER_OR_EQUALS, BemTeVicTokenType.GREATER_THAN,\n BemTeVicTokenType.LESS_OR_EQUALS, BemTeVicTokenType.LESS_THAN\n ).parse();\n\n // If did not found anything starting with an operator, return the first node.\n if (wrappers.isEmpty()) return first;\n\n // Constructs a binary operator node containing the expression.\n Iterator<Wrapper> it = wrappers.iterator();\n Wrapper secondWrapper = it.next();\n BinaryOperatorNode second = new BinaryOperatorNode(secondWrapper.getTokenType(), first, secondWrapper.getOutput());\n\n if (wrappers.size() == 1) return second;\n\n // If we reach this far, the expression has more than one operator. i.e. (x = y = z),\n // which is a shortcut for (x = y AND y = z).\n\n // Firstly, determine if the operators are compatible.\n RelationalOperatorSide side = RelationalOperatorSide.NONE;\n for (Wrapper w : wrappers) {\n side = side.next(w.getTokenType());\n }\n if (side.isMixed()) {\n environment.emitError(\"XXX\");\n }\n\n // Creates the other nodes. In the expression (a = b = c = d), The \"a = b\"\n // is in the \"second\" node. Creates \"b = c\", and \"c = d\" nodes.\n List<BinaryOperatorNode> nodes = new LinkedList<BinaryOperatorNode>();\n nodes.add(second);\n\n TreeNode prev = secondWrapper.getOutput();\n while (it.hasNext()) {\n Wrapper w = it.next();\n BinaryOperatorNode current = new BinaryOperatorNode(w.getTokenType(), prev, w.getOutput());\n prev = w.getOutput();\n nodes.add(current);\n }\n\n // Combines all of the nodes in a single one using AND.\n return new VariableArityOperatorNode(BemTeVicTokenType.AND, nodes);\n }", "public static Pair<Automaton, List<BooleanVariable>> constructAutomatonFromAssignment(Logger logger, List<Assignment> ass,\n\t\t\tScenarioTree tree, int colorSize, boolean complete, CompletenessType completenessType) {\n\t\tList<BooleanVariable> filteredYVars = new ArrayList<>();\n\t\tint[] nodeColors = new int[tree.nodesCount()];\n\n\t\t// color the scenario tree codes according to the assignment\n\t\tass.stream()\n\t\t\t\t.filter(a -> a.value && a.var.name.startsWith(\"x_\"))\n\t\t\t\t.forEach(a -> {\n\t\t\t\t\tString[] tokens = a.var.name.split(\"_\");\n\t\t\t\t\tassert tokens.length == 3;\n\t\t\t\t\tint node = Integer.parseInt(tokens[1]);\n\t\t\t\t\tint color = Integer.parseInt(tokens[2]);\n\t\t\t\t\tnodeColors[node] = color;\n\t\t\t\t});\n\t\t// add transitions from scenarios\n\t\tAutomaton ans = new Automaton(colorSize);\n\t\tfor (int i = 0; i < tree.nodesCount(); i++) {\n\t\t\tint color = nodeColors[i];\n\t\t\tNode state = ans.getState(color);\n\t\t\tfor (Transition t : tree.getNodes().get(i).getTransitions()) {\n\t\t\t\tif (!state.hasTransition(t.getEvent(), t.getExpr())) {\n\t\t\t\t\tint childColor = nodeColors[t.getDst().getNumber()];\n\t\t\t\t\tstate.addTransition(t.getEvent(), t.getExpr(),\n\t\t\t\t\t\tt.getActions(), ans.getState(childColor));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (complete) {\n\t\t\t// add other transitions\n\t\t\tfor (Assignment a : ass.stream()\n\t\t\t\t\t.filter(a -> a.value && a.var.name.startsWith(\"y_\"))\n\t\t\t\t\t.collect(Collectors.toList())) {\n\t\t\t\tString[] tokens = a.var.name.split(\"_\");\n\t\t\t\tassert tokens.length == 4;\n\t\t\t\tint from = Integer.parseInt(tokens[1]);\n\t\t\t\tint to = Integer.parseInt(tokens[2]);\n\t\t\t\tString event = tokens[3];\n\t\n\t\t\t\tNode state = ans.getState(from);\n\t\n\t\t\t\tif (state.hasTransition(event, MyBooleanExpression.getTautology())) {\n\t\t\t\t\tfilteredYVars.add(a.var);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// include transitions not from scenarios\n\t\t\t\tList<String> properUniqueActions = new ArrayList<>();\n\t\t\t\tfor (Assignment az : ass) {\n\t\t\t\t\tif (az.value && az.var.name.startsWith(\"z_\" + from + \"_\")\n\t\t\t\t\t\t\t&& az.var.name.endsWith(\"_\" + event)) {\n\t\t\t\t\t\tproperUniqueActions.add(az.var.name.split(\"_\")[2]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tCollections.sort(properUniqueActions);\n\t\n\t\t\t\tif (!state.hasTransition(event, MyBooleanExpression.getTautology())) {\n\t\t\t\t\t// add\n\t\t\t\t\tboolean include;\n\t\t\t\t\tif (completenessType == CompletenessType.NORMAL) {\n\t\t\t\t\t\tinclude = true;\n\t\t\t\t\t} else if (completenessType == CompletenessType.NO_DEAD_ENDS) {\n\t\t\t\t\t\tinclude = state.transitionsCount() == 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new AssertionError();\n\t\t\t\t\t}\n\t\t\t\t\tif (include) {\n\t\t\t\t\t\tstate.addTransition(event, MyBooleanExpression.getTautology(),\n\t\t\t\t\t\t\tnew StringActions(String.join(\",\",\n\t\t\t\t\t\t\tproperUniqueActions)), ans.getState(to));\n\t\t\t\t\t\tlogger.info(\"ADDING TRANSITION NOT FROM SCENARIOS \" + a.var + \" \" + properUniqueActions);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// check\n\t\t\t\t\tTransition t = state.getTransition(event, MyBooleanExpression.getTautology());\n\t\t\t\t\tif (t.getDst() != ans.getState(to)) {\n\t\t\t\t\t\tlogger.severe(\"INVALID TRANSITION DESTINATION \" + a.var);\n\t\t\t\t\t}\n\t\t\t\t\tList<String> actualActions = new ArrayList<>(new TreeSet<>(\n\t\t\t\t\t\t\tArrays.asList(t.getActions().getActions())));\n\t\t\t\t\tif (!actualActions.equals(properUniqueActions)) {\n\t\t\t\t\t\tlogger.severe(\"ACTIONS DO NOT MATCH\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn Pair.of(ans, filteredYVars);\n\t}", "public JCExpressionStatement makeAssignment(JCExpression lhs, JCExpression rhs) {\n return treeMaker.Exec(treeMaker.Assign(lhs, rhs));\n }", "private void constructBuiltinAtom(String name, String operator, String value, OWLDatatype od, Set<SWRLAtom> antecedent) {\n if (!TextUtils.isBlank(value) && !TextUtils.isBlank(operator)) {\n if (od == null) {\n SWRLIArgument ind = factory.getSWRLIndividualArgument(ontologyOWLNamedIndividualVocabulary.get(TextUtil.formatName(value)));\n SWRLIArgument variable = factory.getSWRLIndividualArgument(factory.getOWLNamedIndividual(IRI.create(manager.getOntologyDocumentIRI(domainOntology) + \"#\" + literalVocabulary.get(name))));\n\n switch (operator) {\n case \"equal\": {\n SWRLSameIndividualAtom sameInd = factory.getSWRLSameIndividualAtom(ind, variable);\n antecedent.add(sameInd);\n break;\n }\n case \"notEqual\": {\n SWRLDifferentIndividualsAtom diffInd = factory.getSWRLDifferentIndividualsAtom(ind, variable);\n antecedent.add(diffInd);\n break;\n }\n }\n } else {\n SWRLVariable var2 = factory.getSWRLVariable(IRI.create(manager.getOntologyDocumentIRI(domainOntology) + \"#\" + literalVocabulary.get(name)));\n OWLLiteral lit = factory.getOWLLiteral(value, od);\n SWRLLiteralArgument litArg = factory.getSWRLLiteralArgument(lit);\n List<SWRLDArgument> list = new ArrayList<>();\n list.add(var2);\n list.add(litArg);\n\n switch (operator) {\n case \"equal\": {\n SWRLBuiltInAtom builtins = factory.getSWRLBuiltInAtom(SWRLBuiltInsVocabulary.EQUAL.getIRI(), list);\n antecedent.add(builtins);\n break;\n }\n case \"notEqual\": {\n SWRLBuiltInAtom builtins = factory.getSWRLBuiltInAtom(SWRLBuiltInsVocabulary.NOT_EQUAL.getIRI(), list);\n antecedent.add(builtins);\n break;\n }\n case \"lessThan\": {\n SWRLBuiltInAtom builtins = factory.getSWRLBuiltInAtom(SWRLBuiltInsVocabulary.LESS_THAN.getIRI(), list);\n antecedent.add(builtins);\n break;\n }\n case \"lessOrEqual\": {\n SWRLBuiltInAtom builtins = factory.getSWRLBuiltInAtom(SWRLBuiltInsVocabulary.LESS_THAN_OR_EQUAL.getIRI(), list);\n antecedent.add(builtins);\n break;\n }\n case \"greaterThan\": {\n SWRLBuiltInAtom builtins = factory.getSWRLBuiltInAtom(SWRLBuiltInsVocabulary.GREATER_THAN.getIRI(), list);\n antecedent.add(builtins);\n break;\n }\n case \"greaterOrEqual\": {\n SWRLBuiltInAtom builtins = factory.getSWRLBuiltInAtom(SWRLBuiltInsVocabulary.GREATER_THAN_OR_EQUAL.getIRI(), list);\n antecedent.add(builtins);\n break;\n }\n }\n }\n }\n }", "@Override\n public void visit(VariableEvalNode variableEvalNode) {\n }", "static void translate() {\n if(!token.equals(\"IF\")) {\r\n stack.add(lexeme);\r\n index++;\r\n\r\n // Add assignment operator to the intermediate stack\r\n lex();\r\n stack.add(lexeme);\r\n index++;\r\n\r\n lex();\r\n while (!token.equals(\"END\")) {\r\n\r\n if (lexeme.equals(\"(\")) {\r\n tParen();\r\n } else if (token.equals(\"PLUS\") || token.equals(\"MINUS\") || token.equals(\"STAR\") || token.equals(\"DIVOP\") || token.equals(\"MOD\")) {\r\n stack.add(index, lexeme);\r\n index++;\r\n\r\n lex();\r\n if (lexeme.equals(\"(\")) {\r\n tParen();\r\n } else {\r\n index--;\r\n stack.add(index, lexeme);\r\n index++;\r\n index++;\r\n }\r\n } else {\r\n index--;\r\n stack.add(index, lexeme);\r\n index++;\r\n }\r\n\r\n lex();\r\n\r\n if (token.equals(\"END\"))\r\n break;\r\n\r\n if (token.equals(\"IDENTIFIER\")) {\r\n index++;\r\n break;\r\n }\r\n\r\n if (token.equals(\"IF\")) {\r\n index++;\r\n break;\r\n }\r\n }\r\n\r\n // Beginning the execution and evaluation of the translated code.\r\n index = 0;\r\n\r\n while (!stack.get(index).equals(\"=\") && !stack.get(index).equals(\"+\") && !stack.get(index).equals(\"-\") &&\r\n !stack.get(index).equals(\"*\") && !stack.get(index).equals(\"/\") && !stack.get(index).equals(\"%\")) {\r\n index ++;\r\n }\r\n\r\n int value = 0;\r\n int operand1 = 0;\r\n int operand2 = 0;\r\n String operator = stack.get(index);\r\n stack.remove(index);\r\n index--;\r\n\r\n if (operator.equals(\"=\")) {\r\n\r\n try {\r\n value = Integer.parseInt(stack.get(index));\r\n }\r\n catch (NumberFormatException e) {\r\n value = Integer.parseInt(varList.get(search(stack.get(index)) + 1));\r\n }\r\n\r\n stack.remove(index);\r\n index--;\r\n\r\n String id = stack.get(index);\r\n stack.remove(index);\r\n\r\n //System.out.println(\"\\n\" + id + \" is equal to \" + value);\r\n\r\n if (search(id) == -1) {\r\n varList.add(id);\r\n varList.add(Integer.toString(value));\r\n } else {\r\n varList.set(search(id) + 1, Integer.toString(value));\r\n }\r\n }\r\n\r\n else {\r\n try {\r\n operand2 = Integer.parseInt(stack.get(index));\r\n }\r\n catch (NumberFormatException e) {\r\n operand2 = Integer.parseInt(varList.get(search(stack.get(index)) + 1));\r\n }\r\n stack.remove(index);\r\n index--;\r\n\r\n try {\r\n operand1 = Integer.parseInt(stack.get(index));\r\n }\r\n catch (NumberFormatException e) {\r\n operand1 = Integer.parseInt(varList.get(search(stack.get(index)) + 1));\r\n }\r\n stack.remove(index);\r\n\r\n execute(evaluate(operand1, operand2, operator));\r\n }\r\n\r\n if (!token.equals(\"END\")) {\r\n translate();\r\n }\r\n }\r\n\r\n // IF STATEMENTS\r\n else {\r\n if(translateIF())\r\n translate();\r\n else\r\n skipStatement();\r\n }\r\n }", "void visit(final Assignment assignment);", "private void assignment() {\n\n\t\t\t}", "static void unifyVariable(Solution solution, Type.Variable v, Type against) {\n\t\tif (v == against) solution.trivial();\n\t\telse if (Variable(against, a -> solution.alias(v, a))) ;\n\t\telse if (occurs(v, against)) solution.recursive(v, against);\n\t\telse solution.substitute(v, against);\n\t}", "public void setObjective(Variable v) {\r\n\t\tobjective = v;\r\n\t\tif (v != null) {\r\n\t\t\tadd(v);\r\n\t\t}\r\n\t}", "private Operation expression(Scope scope, Vector queue)\r\n {\r\n Operation root = expression1(scope, queue);\r\n\r\n if (assign.contains(nextSymbol))\r\n {\r\n Operation op = new Operation();\r\n\r\n op.left = root;\r\n\r\n op.operator = assignmentOperator();\r\n op.right = expression(scope, queue);\r\n\r\n root = op;\r\n }\r\n\r\n return root;\r\n }", "private static <V extends Variable<A>, A extends Value> boolean BACKTRACK(SharedDomainVariableSet<V, A> variableSet) {\n\t\tif (variableSet.isComplete()) {return true;}\n\t\t\n\t\t// get variable to assign\n\t\tV var = variableSet.getUnassignedVariable();\n\t\tSystem.out.println(x + \" --> \" + variableSet.getCountSet() + \": \" + var.getIndex());\n\t\tx += 1;\n\t\t//System.out.println(var);\n\t\t\n\t\t// for each possible value\n\t\tfor (A val : variableSet.getDomain(var)) {\n\n\t\t\t// add the assignment\n\t\t\tvar.assign(val);\n\t\t\t\n\t\t\t// test acceptability and infer the feasibility of the assignment && INFER(variableSet, var)\n\t\t\tif (INFER(variableSet, var)) {\n\t\t\t//if (true) {\t\n\t\t\t\ttry {\n\t\t\t\t\t\n\t\t\t\t\t// domain reduction, throws exception if invalid\n\t\t\t\t\tMap<V, DomainReduction<A>> domainReduction2 = FORWARD_CHECK2(variableSet, var);\n\t\t\t\t\t\n\t\t\t\t\t//Map<V, DomainReduction<A>> domainReduction = FORWARD_CHECK(variableSet, var);\n\t\t\t\t\t\n\t\t\t\t\t// add domain reduction to set\n\t\t\t\t\t//variableSet.addDomainReduction(domainReduction);\n\t\t\t\t\t\n\t\t\t\t\t// backtrack\n\t\t\t\t\t//boolean result = BACKTRACK(variableSet);\n\t\t\t\t\t\n\t\t\t\t\t// stop if solution found\n\t\t\t\t\tif (INFER(variableSet, var) && BACKTRACK(variableSet)) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// clear domain reduction\n\t\t\t\t\t//variableSet.clearDomainReduction(domainReduction);\n\t\t\t\t\tvariableSet.clearDomainReduction(domainReduction2);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t\t// clean assignment\n\t\t\tvar.unassign();\n\t\t\t\n\t\t}\n\t\t\n\t\t// no assignment found\n\t\treturn false;\n\t\t\n\t}", "@Override\n protected Move makeDecision() {\n myTurn = index();\n /* block the nearest + most effective player (as in, people who arent blocked) */\n ArrayList<Move> pathMoves = new ArrayList<>();\n ArrayList<Move> playMoves = new ArrayList<>();\n ArrayList<Move> discardMoves = new ArrayList<>();\n Map<Integer, Card> destroyCards = new HashMap<Integer, Card>();\n Map<Integer, Card> repairCards = new HashMap<Integer, Card>();\n Map<Integer, Card> blockCards = new HashMap<Integer, Card>();\n Map<Integer, Card> pathCards = new HashMap<Integer, Card>();\n Set<Position> reachable = game().board().getReachable();\n canSee=false;\n canMove=false;\n canBlock=false;\n canRockfall=false;\n canRepair=false;\n int len = hand().size();\n for (int i = 0; i < len; ++i) {\n Card c = hand().get(i);\n if (c instanceof PathCard && !isSabotaged()) {\n pathCards.put(i,c);\n// pathMoves.addAll(generatePossiblePaths(i, (PathCard) c));\n canMove = true;\n }\n if (c instanceof PlayerActionCard) {\n// playMoves.addAll(generatePossiblePlayerActions(i, (PlayerActionCard) c));\n if(c.type()== Card.Type.BLOCK) {\n blockCards.put(i, c);\n canBlock=true;\n }\n else if(c.type()== Card.Type.REPAIR) {\n repairCards.put(i, c);\n canRepair=true;\n }\n }\n if (c.type() == Card.Type.MAP) {\n// playMoves.addAll(generatePossibleMap(i));\n mapIndex = i;\n canSee = true;\n }\n if (c.type() == Card.Type.ROCKFALL) {\n destroyCards.put(i,c);\n// playMoves.addAll(generatePossibleRockfall(i));\n canRockfall = true;\n }\n discardMoves.add(Move.NewDiscardMove(index(), i));\n }\n\n if(canSee) {\n //sum of all heuristics\n double sumGoal[] = new double[3];\n for (Position h : reachable) {\n sumGoal[0]+=(9-(8-h.x)+ 5-(4-h.y));\n sumGoal[1]+=(9-(8-h.x)+ 5-(2-h.y));\n sumGoal[2]+=(9-(8-h.x)+ 5-(-h.y));\n }\n //update goldProb\n for(int i=0; i<3; i++) {\n int seenSum=0;\n for(int j=0; j<numPlayers; j++) {\n if(j!=myTurn) {\n if(haveSeen.get(j)[i]==1) seenSum++;\n }\n }\n goldProb[i] = (i==1?0.5:1)*(1-haveSeen.get(myTurn)[i])*(mapRate*(seenSum/numPlayers)+(sumGoal[i]/10));\n }\n }\n\n// System.out.println(hand());\n// System.out.println(pathMoves);\n\n\n if (role() == Role.GOLD_MINER) {\n //Path\n if(canSee && !goldFound) {\n int selection=0;\n double maxProb=goldProb[0];\n for(int i=0; i<3; i++) {\n if(goldProb[i]>maxProb) {\n maxProb = goldProb[i];\n selection=i;\n }\n }\n Move look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.TOP);\n switch(selection) {\n case 0:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.TOP);\n break;\n case 1:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.MIDDLE);\n break;\n case 2:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.BOTTOM);\n break;\n }\n return look;\n }\n if(canMove) {\n int globalIndex = 0;\n double maxH = 0;\n double oldH;\n Position bp = new Position(0,0);\n boolean rotate = false;\n //Find best path to place;\n Board board = game().board().copy();\n oldH = getClosest(board);\n// System.out.print(getClosest(board)+\" : \");\n for( Map.Entry<Integer, Card> p : pathCards.entrySet()) {\n int index = p.getKey();\n Card path = p.getValue();\n ((PathCard)path).setRotated(false);\n Set<Position> placeable = game().board().getPlaceable((PathCard)path);\n for (Position h : placeable) {\n Board simulated = board.simulatePlaceCardAt((PathCard)path, h.x, h.y);\n// System.out.println(path.type());\n double cH = getClosest(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n maxH = cH;\n rotate=false;\n }\n }\n ((PathCard) path).setRotated(true);\n placeable = game().board().getPlaceable((PathCard)path);\n for (Position h : placeable) {\n Board simulated = board.simulatePlaceCardAt((PathCard)path, h.x, h.y);\n// System.out.println(simulated);\n double cH = getClosest(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n rotate=true;\n maxH = cH;\n }\n }\n }\n// System.out.println(oldH+\": \"+maxH+\" (\"+abs(maxH-oldH)+\")\");\n oldBoard = game().board().copy();\n if(maxH>0 && abs(maxH-oldH)>0.01)\n return Move.NewPathMove(index(), globalIndex, bp.x, bp.y, rotate);\n }\n //Unblock\n if(canRepair) {\n double blockMore = 0.0;\n int targetPlayer = -1;\n int cardIndex = 0;\n for(int i=0; i<numPlayers; i++) {\n //heal self\n if(i == myTurn) {\n for(Map.Entry<Integer, Card> r : repairCards.entrySet()) {\n int index = r.getKey();\n// System.out.println(Arrays.toString(game().playerAt(index()).sabotaged()));\n PlayerActionCard repair = (PlayerActionCard) r.getValue();\n if (game().playerAt(index()).isRepairable(repair.effects())) {\n return Move.NewPlayerActionMove(index(),index, index());\n }\n }\n }\n else if(i!=myTurn) {\n for(Map.Entry<Integer, Card> r : repairCards.entrySet()) {\n int index = r.getKey();\n PlayerActionCard repair = (PlayerActionCard) r.getValue();\n// System.out.println(Arrays.toString(game().playerAt(i).sabotaged()));\n if (game().playerAt(i).isRepairable(repair.effects())) {\n //calculate the should i repair? function\n double shouldIBlockMore = Probability[i]+(0.03*(numPlayers-i));\n if(blockMore<shouldIBlockMore) {\n blockMore = shouldIBlockMore;\n targetPlayer = i;\n cardIndex = index;\n }\n }\n }\n }\n }\n if(blockMore>0.75 && targetPlayer>=0)\n return Move.NewPlayerActionMove(index(), cardIndex, targetPlayer);\n }\n //Block Enemy\n if(canBlock) {\n double blockMore = 0.0;\n int targetPlayer = -1;\n int cardIndex = 0;\n for (int i = 0; i < numPlayers; i++) {\n if (i != myTurn) {\n for (Map.Entry<Integer, Card> b : blockCards.entrySet()) {\n int index = b.getKey();\n PlayerActionCard block = (PlayerActionCard) b.getValue();\n if (game().playerAt(i).isSabotageable(block.effects()[0])) {\n //calculate the should i repair? function\n double shouldIBlockMore = (1 - Probability[i]) * ((1 - Probability[i]) + 0.2 * (numPlayers - i));\n if (blockMore < shouldIBlockMore) {\n blockMore = shouldIBlockMore;\n targetPlayer = i;\n cardIndex = index;\n }\n }\n }\n }\n }\n if(blockMore>0.6 && targetPlayer>=0)\n return Move.NewPlayerActionMove(index(), cardIndex, targetPlayer);\n }\n //Fix (Rockfall)\n if(canRockfall) {\n int globalIndex = 0;\n double maxH = 0.0;\n Position bp = new Position(0,0);\n //Find best path to place;\n Board board = game().board().copy();\n for( Map.Entry<Integer, Card> d : destroyCards.entrySet()) {\n int index = d.getKey();\n Set<Position> destroyable = game().board().getDestroyable();\n for (Position h : destroyable) {\n Board simulated = board.simulateRemoveCardAt(h.x, h.y);\n// System.out.println(path.type());\n double cH = getClosest(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n maxH = cH;\n }\n }\n }\n oldBoard = game().board().copy();\n if(maxH>0)\n return Move.NewRockfallMove(index(), globalIndex, bp.x, bp.y);\n }\n //See map\n\n //Conserve (Find the best card to discard)\n\n //calculate the heuristics and adjust accordingly,\n //choose between playing a card or discarding.\n } else if (role() == Role.SABOTEUR) {\n //See map\n if(canSee && !goldFound) {\n int selection=0;\n //specific for saboteurs\n double maxProb=goldProb[0];\n for(int i=0; i<3; i++) {\n if(goldProb[i]>maxProb) {\n maxProb = goldProb[i];\n selection=i;\n }\n }\n Move look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.TOP);\n switch(selection) {\n case 0:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.TOP);\n break;\n case 1:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.MIDDLE);\n break;\n case 2:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.BOTTOM);\n break;\n }\n return look;\n }\n //Path\n if(canMove) {\n int globalIndex = 0;\n double maxH = 0.0;\n Position bp = new Position(0,0);\n boolean rotate = false;\n //Find best path to place;\n Board board = game().board().copy();\n double oldH = getClosestSabotage(board);\n for( Map.Entry<Integer, Card> p : pathCards.entrySet()) {\n int index = p.getKey();\n Card path = p.getValue();\n ((PathCard)path).setRotated(false);\n Set<Position> placeable = game().board().getPlaceable((PathCard)path);\n for (Position h : placeable) {\n Board simulated = board.simulatePlaceCardAt((PathCard)path, h.x, h.y);\n// System.out.println(path.type());\n double cH = getClosestSabotage(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n maxH = cH;\n rotate=false;\n }\n }\n ((PathCard) path).setRotated(true);\n placeable = game().board().getPlaceable((PathCard)path);\n for (Position h : placeable) {\n Board simulated = board.simulatePlaceCardAt((PathCard)path, h.x, h.y);\n// System.out.println(simulated);\n double cH = getClosestSabotage(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n rotate=true;\n maxH = cH;\n }\n }\n }\n oldBoard = game().board().copy();\n if(maxH>0 && abs(maxH-oldH)>0.01)\n return Move.NewPathMove(index(), globalIndex, bp.x, bp.y, rotate);\n }\n //Unblock Friend\n if(canRepair) {\n double blockMore = 0.0;\n int targetPlayer = -1;\n int cardIndex = 0;\n for(int i=0; i<numPlayers; i++) {\n if(i == myTurn) {\n for(Map.Entry<Integer, Card> r : repairCards.entrySet()) {\n int index = r.getKey();\n PlayerActionCard repair = (PlayerActionCard) r.getValue();\n if (game().playerAt(myTurn).isRepairable(repair.effects())) {\n return Move.NewPlayerActionMove(index(),index, index());\n }\n }\n }\n else if(i!=myTurn) {\n for(Map.Entry<Integer, Card> r : repairCards.entrySet()) {\n int index = r.getKey();\n PlayerActionCard repair = (PlayerActionCard) r.getValue();\n if (game().playerAt(i).isRepairable(repair.effects())) {\n //calculate the should i repair? function\n double shouldIBlockMore = (1-Probability[i])+(0.03*(numPlayers-i));\n if(blockMore<shouldIBlockMore) {\n blockMore = shouldIBlockMore;\n targetPlayer = i;\n cardIndex = index;\n }\n }\n }\n }\n }\n if(blockMore>0.75 && targetPlayer>=0)\n return Move.NewPlayerActionMove(index(), cardIndex, targetPlayer);\n }\n //Block Enemy\n if(canBlock) {\n double blockMore = 0.0;\n int targetPlayer = -1;\n int cardIndex = 0;\n for (int i = 0; i < numPlayers; i++) {\n if (i != myTurn) {\n for (Map.Entry<Integer, Card> b : blockCards.entrySet()) {\n int index = b.getKey();\n PlayerActionCard block = (PlayerActionCard) b.getValue();\n if (game().playerAt(i).isSabotageable(block.effects()[0])) {\n //calculate the should i repair? function\n double shouldIBlockMore = (Probability[i]) * ((Probability[i]) + 0.2 * (numPlayers - i));\n if (blockMore < shouldIBlockMore) {\n blockMore = shouldIBlockMore;\n targetPlayer = i;\n cardIndex = index;\n }\n }\n }\n }\n }\n if(blockMore>0.6 && targetPlayer>=0)\n return Move.NewPlayerActionMove(index(), cardIndex, targetPlayer);\n }\n //Sabotage (Rockfall)\n if(canRockfall) {\n int globalIndex = 0;\n double maxH = 0;\n Position bp = new Position(0,0);\n //Find best path to place;\n Board board = game().board().copy();\n for( Map.Entry<Integer, Card> d : destroyCards.entrySet()) {\n int index = d.getKey();\n Set<Position> destroyable = game().board().getDestroyable();\n for (Position h : destroyable) {\n Board simulated = board.simulateRemoveCardAt(h.x, h.y);\n// System.out.println(path.type());\n double cH = getClosestSabotage(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n maxH = cH;\n }\n }\n }\n oldBoard = game().board().copy();\n if(maxH>0)\n return Move.NewRockfallMove(index(), globalIndex, bp.x, bp.y);\n }\n //Conserve (Find the best card to discard\n\n //calculate the heuristics and adjust accordingly,\n //choose between playing a card or discarding.\n }\n return discardMoves.get(0);\n }", "@Override\n\tpublic Solution<TTPVariable> run(SingleObjectiveThiefProblem thief, IEvaluator evaluator, MyRandom rand) {\n\t\tTTPVariable var = TTPVariable.create(new TourOptimalFactory(thief).next(rand), Pack.empty());\n\t\tSolution<TTPVariable> currentBest = thief.evaluate(var);\n\t\t\n\n\t\twhile (evaluator.hasNext()) {\n\n\t\t\t// now take the tour and optimize packing plan\n\t\t\tSolution<Pack> nextPack = optPack(thief, evaluator, rand, currentBest.getVariable().getTour(), currentBest.getVariable().getPack());\n\t\t\t\n\t\t\tSolution<Tour> nextTour = optTour(thief, evaluator, rand, currentBest.getVariable().getTour(), nextPack.getVariable());\n\t\t\t\n\t\t\tTTPVariable next = TTPVariable.create(nextTour.getVariable(), nextPack.getVariable());\n\t\t\tSolution<TTPVariable> s = thief.evaluate(next);\n\t\t\t\n\t\t\t//System.out.println(nextPack);\n\t\t\t//System.out.println(currentBest);\n\t\t\t//System.out.println(\"----------------\");\n\t\t\t\n\t\t\t// update the best found solution\n\t\t\tif (SolutionDominator.isDominating(s, currentBest)) {\n\t\t\t\tcurrentBest = s;\n\t\t\t\t//System.out.println(\"YES\");\n\t\t\t}\n\t\t\tevaluator.notify(currentBest);\n\n\t\t}\n\n\t\treturn currentBest;\n\t}", "public final void ruleXAssignment() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalDroneScript.g:492:2: ( ( ( rule__XAssignment__Alternatives ) ) )\r\n // InternalDroneScript.g:493:2: ( ( rule__XAssignment__Alternatives ) )\r\n {\r\n // InternalDroneScript.g:493:2: ( ( rule__XAssignment__Alternatives ) )\r\n // InternalDroneScript.g:494:3: ( rule__XAssignment__Alternatives )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXAssignmentAccess().getAlternatives()); \r\n }\r\n // InternalDroneScript.g:495:3: ( rule__XAssignment__Alternatives )\r\n // InternalDroneScript.g:495:4: rule__XAssignment__Alternatives\r\n {\r\n pushFollow(FOLLOW_2);\r\n rule__XAssignment__Alternatives();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXAssignmentAccess().getAlternatives()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "protected Expr visitFieldAssign(FieldAssign n) throws SemanticException { \n Position pos = n.position();\n if (n.operator() == Assign.ASSIGN) return n;\n X10Binary_c.Operator op = n.operator().binaryOperator();\n Field left = (Field) n.left();\n Expr right = n.right();\n Type R = left.type();\n if (left.flags().isStatic()) {\n Expr val = visitBinary((X10Binary_c) xnf.Binary(pos, left, op, right).type(R));\n return assign(pos, left, Assign.ASSIGN, val);\n }\n Expr e = (Expr) left.target();\n Type E = e.type();\n List<Formal> parms = new ArrayList<Formal>();\n Name xn = Name.make(\"x\");\n LocalDef xDef = xts.localDef(pos, xts.Final(), Types.ref(E), xn);\n Formal x = xnf.Formal(pos, xnf.FlagsNode(pos, xts.Final()),\n xnf.CanonicalTypeNode(pos, E), xnf.Id(pos, xn)).localDef(xDef);\n parms.add(x);\n Name yn = Name.make(\"y\");\n Type T = right.type();\n LocalDef yDef = xts.localDef(pos, xts.Final(), Types.ref(T), yn);\n Formal y = xnf.Formal(pos, xnf.FlagsNode(pos, xts.Final()),\n xnf.CanonicalTypeNode(pos, T), xnf.Id(pos, yn)).localDef(yDef);\n parms.add(y);\n Expr lhs = xnf.Field(pos,\n xnf.Local(pos, xnf.Id(pos, xn)).localInstance(xDef.asInstance()).type(E),\n xnf.Id(pos, left.name().id())).fieldInstance(left.fieldInstance()).type(R);\n Expr val = visitBinary((X10Binary_c) xnf.Binary(pos,\n lhs, op, xnf.Local(pos, xnf.Id(pos, yn)).localInstance(yDef.asInstance()).type(T)).type(R));\n Expr res = assign(pos, lhs, Assign.ASSIGN, val);\n Block body = xnf.Block(pos, xnf.Return(pos, res));\n Closure c = synth.makeClosure(pos, R, parms, body, context());\n X10MethodInstance ci = c.closureDef().asType().applyMethod();\n List<Expr> args = new ArrayList<Expr>();\n args.add(0, e);\n args.add(right);\n return xnf.ClosureCall(pos, c, args).closureInstance(ci).type(R);\n }", "private <E> Assignment<E> backtrackingMRVLCVDH(CSP<E> csp, Assignment<E> assignment, HashMap<String,Set<E>> explored) {\r\n\t\t++iterationCount;\r\n\t\tif(assignment.isComplete(csp) || iterationCount>10000){\r\n\t\t\treturn assignment;\r\n\t\t}\r\n\t\tString var=MinRemainingValue(csp, assignment);\r\n\t\tList<E> values= LeastConstrainingValue(csp,var);\r\n\t\tSet<E> valuesSet = new HashSet<>();\r\n\t\tfor(int i=0;i<values.size();i++){\r\n\t\t\tboolean consistent=true;\r\n\t\t\tif(!Visited(explored,var,values.get(i))){\r\n\t\t\t\tvaluesSet.add(values.get(i));\r\n\t\t\t\tassignment.put(var,values.get(i));\r\n\t\t\t\texplored.put(var,valuesSet);\r\n\t\t\t\tif(csp.isConsistent(assignment)){\r\n\t\t\t\t\tAssignment<E> result = backtracking(csp, assignment, explored);\r\n\t\t\t\t\tif(result!=null) {\r\n\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tassignment.remove(var);\r\n\t\t\t}\r\n\t\t}\r\n\t\texplored.get(var).clear();\r\n\t\treturn null;\r\n\t}", "public static BinaryExpression addAssignChecked(Expression expression0, Expression expression1) { throw Extensions.todo(); }", "@Test\r\n public void deriveFromOrAssignmentExpressionWithSIUnits() throws IOException {\n check(\"varI_M|=9\", \"(int,m)\");\r\n //example with long m &= int\r\n check(\"varL_KMe2perH|=9\", \"(long,km^2/h)\");\r\n }", "public ArrayList<Predicate> expandInConjunctiveFormula(){\n\t\tArrayList<Predicate> formula = new ArrayList<Predicate>();\n\t\t\n\t\t// (x, (0,2)) (y,1) \n\t\t//holds positions of the vars\n\t\tHashtable<String,ArrayList<String>> pos = new Hashtable<String,ArrayList<String>>();\n\t\t//(const3, \"10\")\n\t\t//holds vars that have constants assigned\n\t\tHashtable<String,String> constants = new Hashtable<String,String>();\n\t\t\n\t\tRelationPredicate p = this.clone();\n\t\t//rename each term to a unique name\n\t\tfor(int i=0; i<p.terms.size(); i++){\n\t\t\tTerm t = p.terms.get(i);\n\t\t\tt.changeVarName(i);\n\n\t\t}\n\t\tformula.add(p);\n\n\t\tArrayList<String> attrsOld = getVarsAndConst();\n\t\tArrayList<String> attrsNew = p.getVarsAndConst();\n\n\t\t\n\t\tfor(int i=0; i<attrsOld.size(); i++){\n\t\t\tTerm t = terms.get(i);\n\t\t\tif(t instanceof ConstTerm){\n\t\t\t\t//get the constant value\n\t\t\t\tconstants.put(attrsNew.get(i),t.getVal());\n\t\t\t}\n\t\t\t\n\t\t\tArrayList<String> posVals = pos.get(attrsOld.get(i));\n\t\t\tif(posVals==null){\n\t\t\t\tposVals=new ArrayList<String>();\n\t\t\t\tpos.put(attrsOld.get(i),posVals);\n\t\t\t}\n\t\t\tposVals.add(String.valueOf(i));\n\n\t\t}\n\t\t\n\t\t//System.out.println(\"Position of attrs=\" + pos + \" Constants= \" + constants);\n\t\n\t\t//deal with var equality x0=x2\n\t\tIterator<String> it = pos.keySet().iterator();\n\t\twhile(it.hasNext()){\n\t\t\tString key = (String)it.next();\n\t\t\tArrayList<String> vals = pos.get(key);\n\t\t\tif(vals.size()>1){\n\t\t\t\t//add x0=x2 & x2=x9, etc\n\t\t\t\tfor(int i=1; i<vals.size(); i++){\n\t\t\t\t\tBuiltInPredicate p1 = new BuiltInPredicate(MediatorConstants.EQUALS);\n\t\t\t\t\t//p1.addTerm(new VarTerm(key+vals.get(i)));\n\t\t\t\t\t//p1.addTerm(new VarTerm(key+vals.get(i+1)));\n\t\t\t\t\tVarTerm v1 = new VarTerm(key);\n\t\t\t\t\tv1.changeVarName(Integer.valueOf(vals.get(i-1)).intValue());\n\t\t\t\t\tp1.addTerm(v1);\n\t\t\t\t\tVarTerm v2 = new VarTerm(key);\n\t\t\t\t\tv2.changeVarName(Integer.valueOf(vals.get(i)).intValue());\n\t\t\t\t\tp1.addTerm(v2);\n\t\t\t\t\tformula.add(p1);\n\t\t\t\t\t//i=i+1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//deal with constants\n\t\tit = constants.keySet().iterator();\n\t\twhile(it.hasNext()){\n\t\t\tString key = (String)it.next();\n\t\t\tString val = constants.get(key);\n\t\t\t//it's a constant\n\t\t\t//add const3=\"10\"\n\t\t\tBuiltInPredicate p1 = new BuiltInPredicate(MediatorConstants.EQUALS);\n\t\t\tp1.addTerm(new VarTerm(key));\n\t\t\tp1.addTerm(new ConstTerm(val));\n\t\t\tformula.add(p1);\n\t\t}\n\t\treturn formula;\n\t}", "public Object visitAssignment(JmmNode node, List<Report> reports) {\n JmmNode left = node.getChildren().get(0);\n // Constant Propagation and Folding\n JmmNode right = node.getChildren().get(1);\n constantPropagationAndFolding(right);\n\n if (left.getKind().equals(\"Var\")) {\n // Left Node is Variable\n String varName = left.get(\"name\");\n Symbol symbol = getVariableSymbol(varName);\n\n // Right Node is the Value\n right = node.getChildren().get(1);\n Object value = getValue(right);\n\n // Modify the Variable Value\n setVariableValue(symbol, value);\n }\n\n return null;\n }", "@Test\r\n public void deriveFromAndAssignmentExpressionWithSIUnits() throws IOException {\n check(\"varI_M&=9\", \"(int,m)\");\r\n //example with long m &= int\r\n check(\"varL_KMe2perH&=9\", \"(long,km^2/h)\");\r\n }", "public SeparateChainingHashTable<Character, Boolean> solve2SAT(String formula) {\n HashSet<Character> variables = new HashSet<>();\n char[] charsInFormula = formula.toCharArray();\n for (int i = 0; i < charsInFormula.length; i++) {\n if (charsInFormula[i] != '('\n && charsInFormula[i] != ')'\n && charsInFormula[i] != 'V'\n && charsInFormula[i] != '^'\n && charsInFormula[i] != ' '\n && charsInFormula[i] != '!') {\n variables.add(charsInFormula[i]);\n }\n }\n\n Digraph digraph = new Digraph(variables.size() * 2);\n\n String[] values = formula.split(\" \");\n\n SeparateChainingHashTable<String, Integer> variableToIdMap = new SeparateChainingHashTable<>();\n SeparateChainingHashTable<Integer, String> idToVariableMap = new SeparateChainingHashTable<>();\n\n // Second pass to get vertices\n for (int i = 0; i < values.length; i += 2) {\n boolean isVariable1Negation;\n boolean isVariable2Negation;\n\n // Read variables\n String variable1;\n String variable2;\n\n String variable1Negation;\n String variable2Negation;\n\n if (values[i].charAt(1) == '!') {\n variable1 = values[i].substring(2, 3);\n isVariable1Negation = true;\n } else {\n variable1 = String.valueOf(values[i].charAt(1));\n isVariable1Negation = false;\n }\n variable1Negation = \"!\" + variable1;\n\n i += 2;\n\n if (values[i].charAt(0) == '!') {\n variable2 = values[i].substring(1, 2);\n isVariable2Negation = true;\n } else {\n variable2 = String.valueOf(values[i].charAt(0));\n isVariable2Negation = false;\n }\n variable2Negation = \"!\" + variable2;\n\n // Add variables to mappings if they do not exist yet\n if (!variableToIdMap.contains(variable1)) {\n addVariableToMappings(variable1, variableToIdMap, idToVariableMap);\n addVariableToMappings(variable1Negation, variableToIdMap, idToVariableMap);\n }\n if (!variableToIdMap.contains(variable2)) {\n addVariableToMappings(variable2, variableToIdMap, idToVariableMap);\n addVariableToMappings(variable2Negation, variableToIdMap, idToVariableMap);\n }\n\n // Add edges to implication digraph\n // Map (A V B) to (A -> !B) and (B -> !A)\n // based on http://www.geeksforgeeks.org/2-satisfiability-2-sat-problem/\n int variable1Id = variableToIdMap.get(variable1);\n int variable1NegationId = variableToIdMap.get(variable1Negation);\n int variable2Id = variableToIdMap.get(variable2);\n int variable2NegationId = variableToIdMap.get(variable2Negation);\n\n if (!isVariable1Negation) {\n if (!isVariable2Negation) {\n digraph.addEdge(variable1Id, variable2NegationId);\n digraph.addEdge(variable2Id, variable1NegationId);\n } else {\n digraph.addEdge(variable1Id, variable2Id);\n digraph.addEdge(variable2NegationId, variable1NegationId);\n }\n } else {\n if (!isVariable2Negation) {\n digraph.addEdge(variable1NegationId, variable2NegationId);\n digraph.addEdge(variable2Id, variable1Id);\n } else {\n digraph.addEdge(variable1NegationId, variable2Id);\n digraph.addEdge(variable2NegationId, variable1Id);\n }\n }\n }\n\n // Compute strongly connected components\n KosarajuSharirSCC kosarajuSharirSCC = new KosarajuSharirSCC(digraph);\n\n // Check if formula is satisfiable\n if (!isFormulaSatisfiable(digraph, kosarajuSharirSCC)) {\n return null;\n }\n\n // Solve 2-SAT by assigning variables to true using the strongly connected components topological order\n List<Integer>[] stronglyConnectedComponents = (List<Integer>[]) new ArrayList[kosarajuSharirSCC.count()];\n\n for (int scc = 0; scc < stronglyConnectedComponents.length; scc++) {\n stronglyConnectedComponents[scc] = new ArrayList<>();\n }\n\n for (int vertex = 0; vertex < digraph.vertices(); vertex++) {\n int stronglyConnectedComponentId = kosarajuSharirSCC.id(vertex);\n stronglyConnectedComponents[stronglyConnectedComponentId].add(vertex);\n }\n\n SeparateChainingHashTable<Character, Boolean> solution = new SeparateChainingHashTable<>();\n\n // Iterate through strongly connected components in topological order to assign the variables.\n // There is a lot of conflicting literature as how the variables should be assigned and in which order.\n // The only correct literature that I found was in the Competitive Programmers Handbook, by Antti Laaksonen\n // This implementation uses a reverse approach of the approach described in the book, because it seems\n // more logical to iterate in topological order and assign a value of TRUE to variables X\n // and FALSE to variables !X found along the way.\n for (int scc = stronglyConnectedComponents.length - 1; scc >= 0; scc--) {\n for (int vertexId : stronglyConnectedComponents[scc]) {\n String vertexVariable = idToVariableMap.get(vertexId);\n\n char variable;\n\n boolean isNegation = vertexVariable.charAt(0) == '!';\n if (!isNegation) {\n variable = vertexVariable.charAt(0);\n } else {\n variable = vertexVariable.charAt(1);\n }\n\n if (!solution.contains(variable)) {\n if (!isNegation) {\n solution.put(variable, true);\n } else {\n solution.put(variable, false);\n }\n }\n }\n }\n\n return solution;\n }", "public MType visit(AssignmentStatement n, MType argu) {\n \t\n \tMType _ret=null;\n \t\n \t//左边f0这个变量如果没有在该方法或该方法所在类或其继承的所有的类中声明则报未定义错\n \tString leftname = n.f0.accept(this, argu).getName();\n \tMType left = Judge.isVarDeclared(leftname, argu);\n \tif (left == null)\n \t\tConsole.UndefinedVariable(n.f0.f0.beginLine, leftname);\n \t\n \t\tn.f2.accept(this, argu);\n \t\t\n \t\treturn _ret;\n }", "public final void rule__PredicateComparison__Group_1__1__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:3979:1: ( ( ( rule__PredicateComparison__OpAssignment_1_1 ) ) )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:3980:1: ( ( rule__PredicateComparison__OpAssignment_1_1 ) )\n {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:3980:1: ( ( rule__PredicateComparison__OpAssignment_1_1 ) )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:3981:1: ( rule__PredicateComparison__OpAssignment_1_1 )\n {\n before(grammarAccess.getPredicateComparisonAccess().getOpAssignment_1_1()); \n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:3982:1: ( rule__PredicateComparison__OpAssignment_1_1 )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:3982:2: rule__PredicateComparison__OpAssignment_1_1\n {\n pushFollow(FOLLOW_rule__PredicateComparison__OpAssignment_1_1_in_rule__PredicateComparison__Group_1__1__Impl7829);\n rule__PredicateComparison__OpAssignment_1_1();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getPredicateComparisonAccess().getOpAssignment_1_1()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public static void isSAT(Predicate pred, int[] vList){\n\t\t\n\t\tStack<Integer> assignedVariables = new Stack<Integer>();\n\t\tboolean satisfiability = false;\n\t\twhile(assignedCount<vList.length/2){\n\t\t\tif(pred.isContainsVariable(assignedCount+1, vList.length/2) == 0){\n\t\t\t\tvList[assignedCount] = 0;\n\t\t\t\tvList[assignedCount+vList.length/2] = 1;\n\t\t\t\tassignedCount++;\n\t\t\t} else {\n\t\t\t\tfailedPoint = assignedCount+1;\n\t\t\t\tsatisfiability = assignVariableAndEvaluatePred(pred, vList, assignedVariables);\n\t\t\t\t\n\t\t\t\tif(!satisfiability){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(satisfiability){\n\t\t\t\n\t\t\tsats.add(vList);\n\t\t\t\n\t\t\tgetAllSat(pred, vList);\n\t\t\t\n\t\t\tSystem.out.println(\"Satisfied Assigned Values for Variables:\");\n\t\t\tfor(int[] arr: sats){\n\t\t\t\tfor(int i=0; i<vList.length/2; i++){\n\t\t\t\t\tSystem.out.print(arr[i] + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Satisfied Clauses:\");\n\t\t\tfor(int i : pred.clauses.keySet()){\n\t\t\t\tClause c = pred.clauses.get(i);\n\t\t\t\tif(i==pred.clauses.size()){\n\t\t\t\t\tSystem.out.print(\"(\" + c.getL1().value + \" V \" + c.getL2().value + \" V \" + c.getL3().value + \" )\");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(\"(\" + c.getL1().value + \" V \" + c.getL2().value + \" V \" + c.getL3().value + \" ) ^ \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t\t\n\t\t} else {\n\t\t\tSystem.out.println(\"No Possible Variable Values for Satisfiability\");\n\t\t\t\n\t\t\tSystem.out.println(\"UnSatisfied Variable: \" + failedPoint);\n\t\t\t\n\t\t\tSystem.out.println(\"Backtracked Node Count: \" + backTrackedCount);\n\t\t\t\n\t\t\tSystem.out.println(\"UnSatisfied Clauses:\");\n\t\t\tfor(int i : pred.clauses.keySet()){\n\t\t\t\tClause c = pred.clauses.get(i);\n\t\t\t\tif(i==pred.clauses.size()){\n\t\t\t\t\tSystem.out.print(\"(\" + c.getL1().value + \" V \" + c.getL2().value + \" V \" + c.getL3().value + \")\");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(\"(\" + c.getL1().value + \" V \" + c.getL2().value + \" V \" + c.getL3().value + \") ^ \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public final void rule__PredicateComparison__OpAssignment_1_1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:9934:1: ( ( ( rule__PredicateComparison__OpAlternatives_1_1_0 ) ) )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:9935:1: ( ( rule__PredicateComparison__OpAlternatives_1_1_0 ) )\n {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:9935:1: ( ( rule__PredicateComparison__OpAlternatives_1_1_0 ) )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:9936:1: ( rule__PredicateComparison__OpAlternatives_1_1_0 )\n {\n before(grammarAccess.getPredicateComparisonAccess().getOpAlternatives_1_1_0()); \n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:9937:1: ( rule__PredicateComparison__OpAlternatives_1_1_0 )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:9937:2: rule__PredicateComparison__OpAlternatives_1_1_0\n {\n pushFollow(FOLLOW_rule__PredicateComparison__OpAlternatives_1_1_0_in_rule__PredicateComparison__OpAssignment_1_119494);\n rule__PredicateComparison__OpAlternatives_1_1_0();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getPredicateComparisonAccess().getOpAlternatives_1_1_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }" ]
[ "0.63113034", "0.5930139", "0.58747274", "0.5586384", "0.5560579", "0.5512583", "0.54280734", "0.5423264", "0.53979903", "0.539607", "0.5390928", "0.53856564", "0.53527546", "0.53042865", "0.5279831", "0.5270075", "0.52665377", "0.5246666", "0.5234831", "0.5224159", "0.5220339", "0.52089345", "0.5175818", "0.517159", "0.5103625", "0.50901395", "0.50898534", "0.5063707", "0.5056838", "0.5044555", "0.50401974", "0.49699023", "0.49593884", "0.49065614", "0.48975852", "0.48794925", "0.48740405", "0.48700327", "0.4851704", "0.4844506", "0.48421448", "0.48267078", "0.48258856", "0.48130405", "0.4811829", "0.48097566", "0.4794968", "0.4792255", "0.4788611", "0.47709", "0.47672656", "0.47637194", "0.47548908", "0.47538096", "0.47530523", "0.47525027", "0.47437206", "0.47422376", "0.47372454", "0.47369456", "0.47359973", "0.4734859", "0.47348025", "0.4728035", "0.4724079", "0.4724079", "0.47199792", "0.47153446", "0.4706652", "0.47057626", "0.4695039", "0.4674671", "0.46722588", "0.4672252", "0.46632892", "0.4659885", "0.465947", "0.46538663", "0.46507388", "0.46496126", "0.46490932", "0.46479395", "0.46453738", "0.4643136", "0.46403474", "0.4636781", "0.46301416", "0.46297863", "0.46276027", "0.46241733", "0.46235755", "0.46212587", "0.46188703", "0.46136957", "0.4603895", "0.4599637", "0.45959705", "0.45957425", "0.45942917", "0.45922226", "0.45910463" ]
0.0
-1
SOME EXAMPLES OF STRATEGIES YOU CAN BUILD Assigns the first noninstantiated variable to its lower bound.
public static IntStrategy lexico_LB(IntVar... VARS) { return custom(lexico_var_selector(), min_value_selector(), VARS); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getLowerBound ();", "@Override\n\tprotected void setLowerBound() {\n\t\t\n\t}", "public int getLowerBound() {\r\n return lowerBound;\r\n }", "public V getLowerBound();", "public void setLowerBound (int lowerBound) throws ModelException;", "public void setLowerBound(String lower) {\n lowerBound = lower;\n }", "@Override\n\tprotected double getLowerBound() {\n\t\treturn 0;\n\t}", "TrackingToken lowerBound();", "public void setLowerBound(final int lowerBound) {\r\n this.lowerBound = lowerBound;\r\n }", "@Override\r\n public Integer minLowerBound() {\r\n return this.getImpl().minLowerBound();\r\n }", "private int getLowerBound(Object problem, int upperbound)\n {\n Graph tsp = (Graph)problem;\n if (weight == null)\n weight = new double[tsp.size()];\n hki = new HeldKarpIterative( tsp, included, includedT, excluded, excludedT, iterations, weight, upperbound);\n hki.compute();\n tour = hki.isTour();\n bound = hki.getBound();\n hasRun = true;\n// System.out.println(hki.debugDump());\n return bound;\n }", "public String getLower() {\n return lowerBound;\n }", "public double lower()\n\t{\n\t\treturn _dblLower;\n\t}", "protected abstract D getLower(R range);", "public default Type lowerBound() throws LookupException {\n return this;\n }", "public Variable(String s, String in, String nom, int a, int b) {\n ident=new String(s);\n internal=new String(in);\n if (nom!=null) {name=new String(nom);} else {name=\"(Variable interne)\";}\n lowbound=a;\n highbound=b;\n noccur=0;\n \n \n }", "public int getBound();", "public abstract double[] getLowerBound();", "protected final void setMin() {\n\tint prevmin = this.min;\n\n\tint i1 = this.low;\n\tint i2 = left.min;\n\tint i3 = right.min;\n\n\tif (i2 == -1) \n\t i2 = i1;\n\tif (i3 == -1) \n\t i3 = i1;\n\n\tif ((i1 <= i2) && (i1 <= i3)) {\n\t this.min = i1;\n\t} else if ((i2 <= i1) && (i2 <= i3)) {\n\t this.min = i2;\n\t} else {\n\t this.min = i3;\n\t}\n\n\tif ((p != IntervalNode.nullIntervalNode) &&\n\t (prevmin != this.min)) {\n \t p.setMin();\n\t}\n }", "boolean impliedByLowerBound(InfinitNumber lbound) {\n\t\treturn getInverseBound().lesseq(lbound);\n\t}", "@Override\n public Expression assign(String var, Expression expression) {\n return new Minus(getExpression1().assign(var, expression), getExpression2().assign(var, expression));\n }", "public abstract int getMinimumValue();", "public int getLowerBound ()\n\t{\n\t\treturn getRelationshipImpl().getLowerBound();\n\t}", "@Basic\n\t@Raw\n\t@Immutable\n\tpublic static double getVelocityLowerBound() {\n\t\treturn VELOCITYLOWERBOUND;\n\t}", "void assignRange() {\n rangeIndex = (int) Math.floor(value / step);\n }", "VarAssignment createVarAssignment();", "void lowerNumberOfStonesLeftToPlace();", "E minVal();", "public void testVariableBindingFromFirstPathPropagatesAccrossConjunctionAndFailsOnNonUnification() throws Exception\n {\n resolveAndAssertFailure(new String[] { \"g(x)\", \"h(y)\", \"f(X) :- g(X), h(X)\" }, \"?- f(Y)\");\n }", "public void changeConstraintsToLessThan() throws IloException {\n /*\n IloRange notes:\n for expr == rhs, set lb = ub = rhs\n for expr <= rhs, set lb = -infinity and ub = rhs\n for expr >= rhs, set lb = rhs and ub = infinity\n */\n for (int i = 0; i < matrix.getNrows(); i++) {\n IloRange rangedExpression = matrix.getRange(i);\n if (rangedExpression.getUB() >= Double.POSITIVE_INFINITY) {\n rangedExpression.setBounds(Double.NEGATIVE_INFINITY, -rangedExpression.getUB());\n for (int j = 0; j < matrix.getNrows(); j++) {\n matrix.setNZ(i, j, -matrix.getNZ(i, j));\n }\n }\n }\n }", "public IncrementableAssignment(final Collection<? extends Literal> lits) {\n super(lits, false);\n lits.stream().map(Literal::variable).collect(Collectors.toCollection(() -> variableOrdering));\n }", "public int GetMinVal();", "public void setLowerBound (int lowerBound) throws ModelException\n\t{\n\t\tif ((lowerBound > getUpperBound()) || (lowerBound < 0))\n\t\t{\n\t\t\tthrow new ModelException(I18NHelper.getMessage(getMessages(),\n\t\t\t\t\"jdo.relationship.lower_cardinality_invalid\"));\t\t// NOI18N\n\t\t}\n\n\t\tgetRelationshipImpl().setLowerBound(lowerBound);\n\t}", "protected void mapValueToWithinBounds() {\n if (getAllele() != null) {\n \tFloat d_value = ( (Float) getAllele());\n if (d_value.isInfinite()) {\n // Here we have to break to avoid a stack overflow.\n // ------------------------------------------------\n return;\n }\n // If the value exceeds either the upper or lower bounds, then\n // map the value to within the legal range. To do this, we basically\n // calculate the distance between the value and the float min,\n // then multiply it with a random number and then care that the lower\n // boundary is added.\n // ------------------------------------------------------------------\n if (d_value.floatValue() > m_upperBound ||\n d_value.floatValue() < m_lowerBound) {\n RandomGenerator rn;\n if (getConfiguration() != null) {\n rn = getConfiguration().getRandomGenerator();\n }\n else {\n rn = new StockRandomGenerator();\n }\n setAllele(new Float((rn.nextFloat()\n * ((m_upperBound - m_lowerBound))) + m_lowerBound));\n }\n }\n }", "public void setLowerPoint(Point lower) {\n this.lower = lower;\n }", "static int min(int a, int b) { return a < b ? a : b; }", "@Override\n\tpublic AbstractValue greatestLowerBound(AbstractValue d) {\n\t\tif ( !(d instanceof Interval) )\n\t\t\tthrow new IllegalArgumentException(\"v should be of type Interval\");\n\t\tInterval i = (Interval) d;\n\n\t\tif (i.isBottom())\n\t\t\treturn i;\n\t\telse if (i.equals(top))\n\t\t\treturn this;\n\n\t\tString newLow = \"-Inf\", newHigh = \"+Inf\";\n\n\t\t//Calcolare limite inferiore\n\n\t\tif ( this.getLow().equals(\"-Inf\")){\n\t\t\tif( !i.getLow().equals(\"-Inf\"))\n\t\t\t\tif(Integer.parseInt(this.getHigh()) > Integer.parseInt(i.getLow()))\n\t\t\t\t\tnewLow = String.valueOf(Integer.max(Integer.parseInt(this.getLow()), Integer.parseInt(i.getLow())));\n\t\t\t\telse\n\t\t\t\t\treturn BottomAV.getInstance();\n\t\t}else if ( i.getLow().equals(\"-Inf\")){\n\t\t\tif( !this.getLow().equals(\"-Inf\"))\n\t\t\t\tif(Integer.parseInt(i.getHigh()) > Integer.parseInt(this.getLow()))\n\t\t\t\t\tnewLow = String.valueOf(Integer.max(Integer.parseInt(i.getLow()), Integer.parseInt(this.getLow())));\n\t\t\t\telse\n\t\t\t\t\treturn BottomAV.getInstance();\n\t\t}else if(!this.getLow().equals(\"-Inf\") && !i.getLow().equals(\"-Inf\")){\n\t\t\tnewLow = String.valueOf(Integer.max(Integer.parseInt(this.getLow()), Integer.parseInt(i.getLow())));\n\t\t}\n\n\t\t// Calcolare limite superiore\n\n\t\tif ( this.getHigh().equals(\"+Inf\")) {\n\t\t\tif (!i.getHigh().equals(\"+Inf\"))\n\t\t\t\tnewHigh = i.getHigh();\n\t\t}else if ( i.getHigh().equals(\"+Inf\")) {\n\t\t\tif (!this.getHigh().equals(\"+Inf\"))\n\t\t\t\tnewHigh = this.getHigh();\n\t\t}else if(!this.getHigh().equals(\"+Inf\") && !i.getHigh().equals(\"+Inf\")){\n\t\t\tnewHigh = String.valueOf(Integer.min(Integer.parseInt(this.getHigh()), Integer.parseInt(i.getHigh())));\n\t\t}\n\n\t\tInterval res = new Interval(newLow, newHigh);\n\n\t\t// Checks whether low > high\n\t\tif ((!newLow.equals(\"-Inf\") && (!newHigh.equals(\"+Inf\")) && Integer.parseInt(newLow) > Integer.parseInt(newHigh)))\n\t\t\treturn BottomAV.getInstance();\n\n\t\treturn amItop() ? top : res;\n\t}", "private void setMinThreshold() {\n minThreshold = value + value * postBoundChange / 100;\n }", "public IncrementableAssignment(Literal lit) {\n super(lit, false);\n variableOrdering.add(lit.variable());\n }", "public int getMinimumValue() {\n/* 276 */ return -this.s.getMaximumValue();\n/* */ }", "public void setLower(int value) {\n this.lower = value;\n }", "private int deadZone(int value, int minValue)\n\t{\n\t\tif (Math.abs(value) < minValue) value = 0;\n\t\t\n\t\treturn value;\n\t}", "private SWRLVariable initalizeVariable(String name, SWRLVariable var1) {\n\n if (literalVocabulary.containsKey(name)) {\n var1 = factory.getSWRLVariable(IRI.create(manager.getOntologyDocumentIRI(domainOntology) + \"#\" + literalVocabulary.get(name)));\n } else {\n char variable = this.generateVariable();\n literalVocabulary.put(name, String.valueOf(variable));\n var1 = factory.getSWRLVariable(IRI.create(manager.getOntologyDocumentIRI(domainOntology) + \"#\" + variable));\n }\n\n return var1;\n }", "abstract void assign(int i);", "public final EObject ruleRange() throws RecognitionException {\n EObject current = null;\n\n Token otherlv_1=null;\n AntlrDatatypeRuleToken lv_LOWER_BOUND_0_0 = null;\n\n AntlrDatatypeRuleToken lv_HIGHER_BOUND_2_0 = null;\n\n\n\n \tenterRule();\n\n try {\n // InternalMyDsl.g:3362:2: ( ( ( (lv_LOWER_BOUND_0_0= ruleNUMBER ) ) otherlv_1= ':' ( (lv_HIGHER_BOUND_2_0= ruleNUMBER ) ) ) )\n // InternalMyDsl.g:3363:2: ( ( (lv_LOWER_BOUND_0_0= ruleNUMBER ) ) otherlv_1= ':' ( (lv_HIGHER_BOUND_2_0= ruleNUMBER ) ) )\n {\n // InternalMyDsl.g:3363:2: ( ( (lv_LOWER_BOUND_0_0= ruleNUMBER ) ) otherlv_1= ':' ( (lv_HIGHER_BOUND_2_0= ruleNUMBER ) ) )\n // InternalMyDsl.g:3364:3: ( (lv_LOWER_BOUND_0_0= ruleNUMBER ) ) otherlv_1= ':' ( (lv_HIGHER_BOUND_2_0= ruleNUMBER ) )\n {\n // InternalMyDsl.g:3364:3: ( (lv_LOWER_BOUND_0_0= ruleNUMBER ) )\n // InternalMyDsl.g:3365:4: (lv_LOWER_BOUND_0_0= ruleNUMBER )\n {\n // InternalMyDsl.g:3365:4: (lv_LOWER_BOUND_0_0= ruleNUMBER )\n // InternalMyDsl.g:3366:5: lv_LOWER_BOUND_0_0= ruleNUMBER\n {\n if ( state.backtracking==0 ) {\n\n \t\t\t\t\tnewCompositeNode(grammarAccess.getRangeAccess().getLOWER_BOUNDNUMBERParserRuleCall_0_0());\n \t\t\t\t\n }\n pushFollow(FOLLOW_28);\n lv_LOWER_BOUND_0_0=ruleNUMBER();\n\n state._fsp--;\n if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n \t\t\t\t\tif (current==null) {\n \t\t\t\t\t\tcurrent = createModelElementForParent(grammarAccess.getRangeRule());\n \t\t\t\t\t}\n \t\t\t\t\tset(\n \t\t\t\t\t\tcurrent,\n \t\t\t\t\t\t\"LOWER_BOUND\",\n \t\t\t\t\t\tlv_LOWER_BOUND_0_0,\n \t\t\t\t\t\t\"org.xtext.example.mydsl.MyDsl.NUMBER\");\n \t\t\t\t\tafterParserOrEnumRuleCall();\n \t\t\t\t\n }\n\n }\n\n\n }\n\n otherlv_1=(Token)match(input,42,FOLLOW_25); if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n \t\t\tnewLeafNode(otherlv_1, grammarAccess.getRangeAccess().getColonKeyword_1());\n \t\t\n }\n // InternalMyDsl.g:3387:3: ( (lv_HIGHER_BOUND_2_0= ruleNUMBER ) )\n // InternalMyDsl.g:3388:4: (lv_HIGHER_BOUND_2_0= ruleNUMBER )\n {\n // InternalMyDsl.g:3388:4: (lv_HIGHER_BOUND_2_0= ruleNUMBER )\n // InternalMyDsl.g:3389:5: lv_HIGHER_BOUND_2_0= ruleNUMBER\n {\n if ( state.backtracking==0 ) {\n\n \t\t\t\t\tnewCompositeNode(grammarAccess.getRangeAccess().getHIGHER_BOUNDNUMBERParserRuleCall_2_0());\n \t\t\t\t\n }\n pushFollow(FOLLOW_2);\n lv_HIGHER_BOUND_2_0=ruleNUMBER();\n\n state._fsp--;\n if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n \t\t\t\t\tif (current==null) {\n \t\t\t\t\t\tcurrent = createModelElementForParent(grammarAccess.getRangeRule());\n \t\t\t\t\t}\n \t\t\t\t\tset(\n \t\t\t\t\t\tcurrent,\n \t\t\t\t\t\t\"HIGHER_BOUND\",\n \t\t\t\t\t\tlv_HIGHER_BOUND_2_0,\n \t\t\t\t\t\t\"org.xtext.example.mydsl.MyDsl.NUMBER\");\n \t\t\t\t\tafterParserOrEnumRuleCall();\n \t\t\t\t\n }\n\n }\n\n\n }\n\n\n }\n\n\n }\n\n if ( state.backtracking==0 ) {\n\n \tleaveRule();\n\n }\n }\n\n catch (RecognitionException re) {\n recover(input,re);\n appendSkippedTokens();\n }\n finally {\n }\n return current;\n }", "private void setMin(int min) { this.min = new SimplePosition(false,false,min); }", "public final EObject ruleMultiplicityBoundsCS() throws RecognitionException {\n EObject current = null;\n\n Token otherlv_1=null;\n AntlrDatatypeRuleToken lv_lowerBound_0_0 = null;\n\n AntlrDatatypeRuleToken lv_upperBound_2_0 = null;\n\n\n\n \tenterRule();\n\n try {\n // InternalMyDsl.g:9315:2: ( ( ( (lv_lowerBound_0_0= ruleLOWER ) ) (otherlv_1= '..' ( (lv_upperBound_2_0= ruleUPPER ) ) )? ) )\n // InternalMyDsl.g:9316:2: ( ( (lv_lowerBound_0_0= ruleLOWER ) ) (otherlv_1= '..' ( (lv_upperBound_2_0= ruleUPPER ) ) )? )\n {\n // InternalMyDsl.g:9316:2: ( ( (lv_lowerBound_0_0= ruleLOWER ) ) (otherlv_1= '..' ( (lv_upperBound_2_0= ruleUPPER ) ) )? )\n // InternalMyDsl.g:9317:3: ( (lv_lowerBound_0_0= ruleLOWER ) ) (otherlv_1= '..' ( (lv_upperBound_2_0= ruleUPPER ) ) )?\n {\n // InternalMyDsl.g:9317:3: ( (lv_lowerBound_0_0= ruleLOWER ) )\n // InternalMyDsl.g:9318:4: (lv_lowerBound_0_0= ruleLOWER )\n {\n // InternalMyDsl.g:9318:4: (lv_lowerBound_0_0= ruleLOWER )\n // InternalMyDsl.g:9319:5: lv_lowerBound_0_0= ruleLOWER\n {\n if ( state.backtracking==0 ) {\n\n \t\t\t\t\tnewCompositeNode(grammarAccess.getMultiplicityBoundsCSAccess().getLowerBoundLOWERParserRuleCall_0_0());\n \t\t\t\t\n }\n pushFollow(FOLLOW_68);\n lv_lowerBound_0_0=ruleLOWER();\n\n state._fsp--;\n if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n \t\t\t\t\tif (current==null) {\n \t\t\t\t\t\tcurrent = createModelElementForParent(grammarAccess.getMultiplicityBoundsCSRule());\n \t\t\t\t\t}\n \t\t\t\t\tset(\n \t\t\t\t\t\tcurrent,\n \t\t\t\t\t\t\"lowerBound\",\n \t\t\t\t\t\tlv_lowerBound_0_0,\n \t\t\t\t\t\t\"org.eclipse.ocl.xtext.base.Base.LOWER\");\n \t\t\t\t\tafterParserOrEnumRuleCall();\n \t\t\t\t\n }\n\n }\n\n\n }\n\n // InternalMyDsl.g:9336:3: (otherlv_1= '..' ( (lv_upperBound_2_0= ruleUPPER ) ) )?\n int alt136=2;\n int LA136_0 = input.LA(1);\n\n if ( (LA136_0==101) ) {\n alt136=1;\n }\n switch (alt136) {\n case 1 :\n // InternalMyDsl.g:9337:4: otherlv_1= '..' ( (lv_upperBound_2_0= ruleUPPER ) )\n {\n otherlv_1=(Token)match(input,101,FOLLOW_97); if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n \t\t\t\tnewLeafNode(otherlv_1, grammarAccess.getMultiplicityBoundsCSAccess().getFullStopFullStopKeyword_1_0());\n \t\t\t\n }\n // InternalMyDsl.g:9341:4: ( (lv_upperBound_2_0= ruleUPPER ) )\n // InternalMyDsl.g:9342:5: (lv_upperBound_2_0= ruleUPPER )\n {\n // InternalMyDsl.g:9342:5: (lv_upperBound_2_0= ruleUPPER )\n // InternalMyDsl.g:9343:6: lv_upperBound_2_0= ruleUPPER\n {\n if ( state.backtracking==0 ) {\n\n \t\t\t\t\t\tnewCompositeNode(grammarAccess.getMultiplicityBoundsCSAccess().getUpperBoundUPPERParserRuleCall_1_1_0());\n \t\t\t\t\t\n }\n pushFollow(FOLLOW_2);\n lv_upperBound_2_0=ruleUPPER();\n\n state._fsp--;\n if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n \t\t\t\t\t\tif (current==null) {\n \t\t\t\t\t\t\tcurrent = createModelElementForParent(grammarAccess.getMultiplicityBoundsCSRule());\n \t\t\t\t\t\t}\n \t\t\t\t\t\tset(\n \t\t\t\t\t\t\tcurrent,\n \t\t\t\t\t\t\t\"upperBound\",\n \t\t\t\t\t\t\tlv_upperBound_2_0,\n \t\t\t\t\t\t\t\"org.eclipse.ocl.xtext.base.Base.UPPER\");\n \t\t\t\t\t\tafterParserOrEnumRuleCall();\n \t\t\t\t\t\n }\n\n }\n\n\n }\n\n\n }\n break;\n\n }\n\n\n }\n\n\n }\n\n if ( state.backtracking==0 ) {\n\n \tleaveRule();\n\n }\n }\n\n catch (RecognitionException re) {\n recover(input,re);\n appendSkippedTokens();\n }\n finally {\n }\n return current;\n }", "R visitBoundVariable(Formula f, int deBruijnIdx);", "public T caseAssignMin(AssignMin object)\n {\n return null;\n }", "public abstract DoublePredicate lowerPredicate(double lowerBound);", "public static void c1_vl() {\n\t}", "protected <E> String MinRemainingValue(CSP<E> csp, Assignment<E> assignment) {\r\n\t\tString var=\"\";\r\n\t\tint minVar=100;\r\n\t\tfor(String i:csp.variables){\r\n\t\t\tif(!assignment.containsKey(i)){\r\n\t\t\t\tint min = csp.domains.get(i).size();\r\n\t\t\t\tif(min<=minVar) {\r\n\t\t\t\t\tif(min==minVar) {\r\n\t\t\t\t\t\tString varLess=OneDegreeHeuristics(csp,i,var);\r\n\t\t\t\t\t\tminVar=csp.domains.get(varLess).size();;\r\n\t\t\t\t\t\tvar=varLess;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tminVar=min;\r\n\t\t\t\t\t\tvar=i;\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn var;\t\r\n\t}", "public void setMinValue(double x) {\r\n\t\tminValue = x;\r\n\t}", "public Point getLowerPoint() {\n return lower;\n }", "public void setMinValue(int x) {\r\n\t\tminValue = x;\r\n\t}", "@Override\n public void setSoftLowerLimit(double position)\n {\n final String funcName = \"setSoftLowerLimit\";\n\n if (debugEnabled)\n {\n dbgTrace.traceEnter(funcName, TrcDbgTrace.TraceLevel.API, \"position=%f\", position);\n dbgTrace.traceExit(funcName, TrcDbgTrace.TraceLevel.API);\n }\n\n softLowerLimit = position;\n }", "int prevInt(int origin, int bound);", "public void setLow(double value){low = value;}", "public long getLowerTBound() {\n\t\treturn this.lowerTBound;\n\t}", "private double bound(int iter, Solution next) {\n return Math.exp((-1.0 * (next.getValue() - bestSol.getValue())) / denominator(iter));\n }", "void setLowNode(Node n){\n low = n;\n }", "abstract void assignZero();", "public LocalVariableGen addLocalVariable(String name, Type type, InstructionHandle start, InstructionHandle end) {\n/* 170 */ return this._allocatorInit ? addLocalVariable2(name, type, start) : super.addLocalVariable(name, type, start, end);\n/* */ }", "@Test\n\tpublic void testMakeSureVarVariablesCanShadowLetVariables()\n\t{\n\t\tString[] code = {\n\t\t\t\"let a = 1;\",\n\t\t \"let b = 2;\",\n\t\t \"var c = 3;\",\n\n\t\t \"function sup(a) {\",\n\t\t \"var b = 4;\",\n\t\t \"let c = 5;\",\n\t\t \"let d = 6;\",\n\t\t \"if (false) {\",\n\t\t \"var d = 7;\",\n\t\t \"}\",\n\t\t \"return b + c + a + d;\",\n\t\t \"}\",\n\n\t\t \"sup();\"\n\t\t};\n\t\t\n\t\tth.addError(1, 5, \"'a' is defined but never used.\");\n\t th.addError(2, 5, \"'b' is defined but never used.\");\n\t th.addError(3, 5, \"'c' is defined but never used.\");\n\t th.addError(9, 5, \"'d' has already been declared.\");\n\t\tth.test(code, new LinterOptions().set(\"esnext\", true).set(\"unused\", true).set(\"undef\", true).set(\"funcscope\", true));\n\t}", "Intervalle(double bas, double haut){\n this.inf = bas;\n this.sup = haut;\n }", "TrackingToken upperBound();", "public void testVariableBindingFromFirstPathPropagatesAccrossConjunction() throws Exception\n {\n resolveAndAssertSolutions(\"[[g(x), h(x), (f(X) :- g(X), h(X))], (?- f(Y)), [[Y <-- x]]]\");\n }", "public static void c0_vl() {\n\t}", "protected abstract int getInitialValue();", "String lowValue(String comp) { return null; }", "public int getMinIntValue();", "public double getMinimumDouble() {\n/* 201 */ return this.min;\n/* */ }", "public static void bi_vl() {\n\t}", "int getMin( int min );", "private void setDefaultValidRange ()\r\n\t{\r\n\t\tm_lowerBounds = Integer.MIN_VALUE;\r\n\t\tm_upperBounds = Integer.MAX_VALUE;\r\n\t}", "Aliasing getVariable();", "private static final EvaluationAccessor min(EvaluationAccessor operand, EvaluationAccessor[] arguments) {\r\n EvaluationAccessor result = null;\r\n Value oVal = operand.getValue();\r\n if (oVal instanceof ContainerValue) {\r\n ContainerValue cont = (ContainerValue) oVal;\r\n IDatatype contType = ((Container) cont.getType()).getContainedType();\r\n int contSize = cont.getElementSize();\r\n \r\n if (contSize > 0) {\r\n Value rValue = null;\r\n \r\n // Determine min for number containers \r\n if (contType.isAssignableFrom(RealType.TYPE)) {\r\n // Handle min for Reals\r\n double min = (Double) cont.getElement(0).getValue();\r\n for (int i = 1; i < contSize; i++) {\r\n double tmp = (Double) cont.getElement(i).getValue();\r\n if (tmp < min) {\r\n min = tmp;\r\n }\r\n }\r\n \r\n try {\r\n rValue = ValueFactory.createValue(contType, min);\r\n } catch (ValueDoesNotMatchTypeException e) {\r\n EASyLoggerFactory.INSTANCE.getLogger(GenericNumberOperations.class, Bundle.ID)\r\n .debug(e.getMessage());\r\n }\r\n } else if (contType.isAssignableFrom(IntegerType.TYPE)) {\r\n // Handle min for Reals\r\n int min = (Integer) cont.getElement(0).getValue();\r\n for (int i = 1; i < contSize; i++) {\r\n int tmp = (Integer) cont.getElement(i).getValue();\r\n if (tmp < min) {\r\n min = tmp;\r\n }\r\n }\r\n \r\n // Create min value\r\n try {\r\n rValue = ValueFactory.createValue(contType, min);\r\n } catch (ValueDoesNotMatchTypeException e) {\r\n EASyLoggerFactory.INSTANCE.getLogger(GenericNumberOperations.class, Bundle.ID)\r\n .debug(e.getMessage());\r\n }\r\n }\r\n \r\n if (null != rValue) {\r\n result = ConstantAccessor.POOL.getInstance().bind(rValue, operand.getContext());\r\n }\r\n }\r\n }\r\n return result;\r\n }", "Double getMinimumValue();", "private void assign(DefinitionStmt stmt) {\n \n soot.Value rightOp = stmt.getRightOp();\n Value result;\n \n if (rightOp instanceof Immediate) {\n Immediate immediate = (Immediate) rightOp;\n result = immediate(stmt, immediate);\n } else if (rightOp instanceof ThisRef) {\n result = function.getParameterRef(1);\n } else if (rightOp instanceof ParameterRef) {\n ParameterRef ref = (ParameterRef) rightOp;\n int index = (sootMethod.isStatic() ? 1 : 2) + ref.getIndex();\n Value p = new VariableRef(\"p\" + index, getType(ref.getType()));\n result = widenToI32Value(p, isUnsigned(ref.getType()));\n } else if (rightOp instanceof CaughtExceptionRef) {\n result = call(BC_EXCEPTION_CLEAR, env);\n } else if (rightOp instanceof ArrayRef) {\n ArrayRef ref = (ArrayRef) rightOp;\n VariableRef base = (VariableRef) immediate(stmt, (Immediate) ref.getBase());\n if (ref.getType() instanceof NullType) {\n // The base value is always null. Do a null check which will\n // always throw NPE.\n checkNull(stmt, base);\n return;\n } else {\n Value index = immediate(stmt, (Immediate) ref.getIndex());\n checkNull(stmt, base);\n checkBounds(stmt, base, index);\n result = call(getArrayLoad(ref.getType()), base, index);\n result = widenToI32Value(result, isUnsigned(ref.getType()));\n }\n } else if (rightOp instanceof InstanceFieldRef) {\n InstanceFieldRef ref = (InstanceFieldRef) rightOp;\n Value base = immediate(stmt, (Immediate) ref.getBase());\n checkNull(stmt, base);\n FunctionRef fn = null;\n if (canAccessDirectly(ref)) {\n fn = new FunctionRef(mangleField(ref.getFieldRef()) + \"_getter\", \n new FunctionType(getType(ref.getType()), ENV_PTR, OBJECT_PTR));\n } else {\n soot.Type runtimeType = ref.getBase().getType();\n String targetClassName = getInternalName(ref.getFieldRef().declaringClass());\n String runtimeClassName = runtimeType == NullType.v() ? targetClassName : getInternalName(runtimeType);\n Trampoline trampoline = new GetField(this.className, targetClassName, \n ref.getFieldRef().name(), getDescriptor(ref.getFieldRef().type()), runtimeClassName);\n trampolines.add(trampoline);\n fn = trampoline.getFunctionRef();\n }\n result = call(fn, env, base);\n result = widenToI32Value(result, isUnsigned(ref.getType()));\n } else if (rightOp instanceof StaticFieldRef) {\n StaticFieldRef ref = (StaticFieldRef) rightOp;\n FunctionRef fn = Intrinsics.getIntrinsic(sootMethod, stmt);\n if (fn == null) {\n if (canAccessDirectly(ref)) {\n fn = new FunctionRef(mangleField(ref.getFieldRef()) + \"_getter\", \n new FunctionType(getType(ref.getType()), ENV_PTR));\n } else {\n String targetClassName = getInternalName(ref.getFieldRef().declaringClass());\n Trampoline trampoline = new GetStatic(this.className, targetClassName, \n ref.getFieldRef().name(), getDescriptor(ref.getFieldRef().type()));\n trampolines.add(trampoline);\n fn = trampoline.getFunctionRef();\n }\n }\n result = call(fn, env);\n result = widenToI32Value(result, isUnsigned(ref.getType()));\n } else if (rightOp instanceof Expr) {\n if (rightOp instanceof BinopExpr) {\n BinopExpr expr = (BinopExpr) rightOp;\n Type rightType = getLocalType(expr.getType());\n Variable resultVar = function.newVariable(rightType);\n result = resultVar.ref();\n Value op1 = immediate(stmt, (Immediate) expr.getOp1());\n Value op2 = immediate(stmt, (Immediate) expr.getOp2());\n if (rightOp instanceof AddExpr) {\n if (rightType instanceof IntegerType) {\n function.add(new Add(resultVar, op1, op2));\n } else {\n function.add(new Fadd(resultVar, op1, op2));\n }\n } else if (rightOp instanceof AndExpr) {\n function.add(new And(resultVar, op1, op2));\n } else if (rightOp instanceof CmpExpr) {\n Variable t1 = function.newVariable(I1);\n Variable t2 = function.newVariable(I1);\n Variable t3 = function.newVariable(resultVar.getType());\n Variable t4 = function.newVariable(resultVar.getType());\n function.add(new Icmp(t1, Condition.slt, op1, op2));\n function.add(new Icmp(t2, Condition.sgt, op1, op2));\n function.add(new Zext(t3, new VariableRef(t1), resultVar.getType()));\n function.add(new Zext(t4, new VariableRef(t2), resultVar.getType()));\n function.add(new Sub(resultVar, new VariableRef(t4), new VariableRef(t3)));\n } else if (rightOp instanceof DivExpr) {\n if (rightType instanceof IntegerType) {\n FunctionRef f = rightType == I64 ? LDIV : IDIV;\n result = call(f, env, op1, op2);\n } else {\n // float or double\n function.add(new Fdiv(resultVar, op1, op2));\n }\n } else if (rightOp instanceof MulExpr) {\n if (rightType instanceof IntegerType) {\n function.add(new Mul(resultVar, op1, op2));\n } else {\n function.add(new Fmul(resultVar, op1, op2));\n }\n } else if (rightOp instanceof OrExpr) {\n function.add(new Or(resultVar, op1, op2));\n } else if (rightOp instanceof RemExpr) {\n if (rightType instanceof IntegerType) {\n FunctionRef f = rightType == I64 ? LREM : IREM;\n result = call(f, env, op1, op2);\n } else {\n FunctionRef f = rightType == DOUBLE ? DREM : FREM;\n result = call(f, env, op1, op2);\n }\n } else if (rightOp instanceof ShlExpr || rightOp instanceof ShrExpr || rightOp instanceof UshrExpr) {\n IntegerType type = (IntegerType) op1.getType();\n int bits = type.getBits();\n Variable t = function.newVariable(op2.getType());\n function.add(new And(t, op2, new IntegerConstant(bits - 1, (IntegerType) op2.getType())));\n Value shift = t.ref();\n if (((IntegerType) shift.getType()).getBits() < bits) {\n Variable tmp = function.newVariable(type);\n function.add(new Zext(tmp, shift, type));\n shift = tmp.ref();\n }\n if (rightOp instanceof ShlExpr) {\n function.add(new Shl(resultVar, op1, shift));\n } else if (rightOp instanceof ShrExpr) {\n function.add(new Ashr(resultVar, op1, shift));\n } else {\n function.add(new Lshr(resultVar, op1, shift));\n }\n } else if (rightOp instanceof SubExpr) {\n if (rightType instanceof IntegerType) {\n function.add(new Sub(resultVar, op1, op2));\n } else {\n function.add(new Fsub(resultVar, op1, op2));\n }\n } else if (rightOp instanceof XorExpr) {\n function.add(new Xor(resultVar, op1, op2));\n } else if (rightOp instanceof XorExpr) {\n function.add(new Xor(resultVar, op1, op2));\n } else if (rightOp instanceof CmplExpr) {\n FunctionRef f = op1.getType() == FLOAT ? FCMPL : DCMPL;\n function.add(new Call(resultVar, f, op1, op2));\n } else if (rightOp instanceof CmpgExpr) {\n FunctionRef f = op1.getType() == FLOAT ? FCMPG : DCMPG;\n function.add(new Call(resultVar, f, op1, op2));\n } else {\n throw new IllegalArgumentException(\"Unknown type for rightOp: \" + rightOp.getClass());\n }\n } else if (rightOp instanceof CastExpr) {\n Value op = immediate(stmt, (Immediate) ((CastExpr) rightOp).getOp());\n soot.Type sootTargetType = ((CastExpr) rightOp).getCastType();\n soot.Type sootSourceType = ((CastExpr) rightOp).getOp().getType();\n if (sootTargetType instanceof PrimType) {\n Type targetType = getType(sootTargetType);\n Type sourceType = getType(sootSourceType);\n if (targetType instanceof IntegerType && sourceType instanceof IntegerType) {\n // op is at least I32 and has already been widened if source type had fewer bits then I32\n IntegerType toType = (IntegerType) targetType;\n IntegerType fromType = (IntegerType) op.getType();\n Variable v = function.newVariable(toType);\n if (fromType.getBits() < toType.getBits()) {\n // Widening\n if (isUnsigned(sootSourceType)) {\n function.add(new Zext(v, op, toType));\n } else {\n function.add(new Sext(v, op, toType));\n }\n } else if (fromType.getBits() == toType.getBits()) {\n function.add(new Bitcast(v, op, toType));\n } else {\n // Narrow\n function.add(new Trunc(v, op, toType));\n }\n result = widenToI32Value(v.ref(), isUnsigned(sootTargetType));\n } else if (targetType instanceof FloatingPointType && sourceType instanceof IntegerType) {\n // we always to a signed conversion since if op is char it has already been zero extended to I32\n Variable v = function.newVariable(targetType);\n function.add(new Sitofp(v, op, targetType));\n result = v.ref();\n } else if (targetType instanceof FloatingPointType && sourceType instanceof FloatingPointType) {\n Variable v = function.newVariable(targetType);\n if (targetType == FLOAT && sourceType == DOUBLE) {\n function.add(new Fptrunc(v, op, targetType));\n } else if (targetType == DOUBLE && sourceType == FLOAT) {\n function.add(new Fpext(v, op, targetType));\n } else {\n function.add(new Bitcast(v, op, targetType));\n }\n result = v.ref();\n } else {\n // F2I, F2L, D2I, D2L\n FunctionRef f = null;\n if (targetType == I32 && sourceType == FLOAT) {\n f = F2I;\n } else if (targetType == I64 && sourceType == FLOAT) {\n f = F2L;\n } else if (targetType == I32 && sourceType == DOUBLE) {\n f = D2I;\n } else if (targetType == I64 && sourceType == DOUBLE) {\n f = D2L;\n } else {\n throw new IllegalArgumentException();\n }\n Variable v = function.newVariable(targetType);\n function.add(new Call(v, f, op));\n result = v.ref();\n }\n } else {\n if (sootTargetType instanceof soot.ArrayType \n && ((soot.ArrayType) sootTargetType).getElementType() instanceof PrimType) {\n soot.Type primType = ((soot.ArrayType) sootTargetType).getElementType();\n GlobalRef arrayClassPtr = new GlobalRef(\"array_\" + getDescriptor(primType), CLASS_PTR);\n Variable arrayClass = function.newVariable(CLASS_PTR);\n function.add(new Load(arrayClass, arrayClassPtr));\n result = call(CHECKCAST_PRIM_ARRAY, env, arrayClass.ref(), op);\n } else {\n String targetClassName = getInternalName(sootTargetType);\n Trampoline trampoline = new Checkcast(this.className, targetClassName);\n trampolines.add(trampoline);\n result = call(trampoline.getFunctionRef(), env, op);\n }\n }\n } else if (rightOp instanceof InstanceOfExpr) {\n Value op = immediate(stmt, (Immediate) ((InstanceOfExpr) rightOp).getOp());\n soot.Type checkType = ((InstanceOfExpr) rightOp).getCheckType();\n if (checkType instanceof soot.ArrayType \n && ((soot.ArrayType) checkType).getElementType() instanceof PrimType) {\n soot.Type primType = ((soot.ArrayType) checkType).getElementType();\n GlobalRef arrayClassPtr = new GlobalRef(\"array_\" + getDescriptor(primType), CLASS_PTR);\n Variable arrayClass = function.newVariable(CLASS_PTR);\n function.add(new Load(arrayClass, arrayClassPtr));\n result = call(INSTANCEOF_PRIM_ARRAY, env, arrayClass.ref(), op);\n } else {\n String targetClassName = getInternalName(checkType);\n Trampoline trampoline = new Instanceof(this.className, targetClassName);\n trampolines.add(trampoline);\n result = call(trampoline.getFunctionRef(), env, op);\n }\n } else if (rightOp instanceof NewExpr) {\n String targetClassName = getInternalName(((NewExpr) rightOp).getBaseType());\n FunctionRef fn = null;\n if (targetClassName.equals(this.className)) {\n fn = FunctionBuilder.allocator(sootMethod.getDeclaringClass()).ref();\n } else {\n Trampoline trampoline = new New(this.className, targetClassName);\n trampolines.add(trampoline);\n fn = trampoline.getFunctionRef();\n }\n result = call(fn, env);\n } else if (rightOp instanceof NewArrayExpr) {\n NewArrayExpr expr = (NewArrayExpr) rightOp;\n Value size = immediate(stmt, (Immediate) expr.getSize());\n if (expr.getBaseType() instanceof PrimType) {\n result = call(getNewArray(expr.getBaseType()), env, size);\n } else {\n String targetClassName = getInternalName(expr.getType());\n Trampoline trampoline = new Anewarray(this.className, targetClassName);\n trampolines.add(trampoline);\n result = call(trampoline.getFunctionRef(), env, size);\n }\n } else if (rightOp instanceof NewMultiArrayExpr) {\n NewMultiArrayExpr expr = (NewMultiArrayExpr) rightOp;\n if (expr.getBaseType().numDimensions == 1 && expr.getBaseType().getElementType() instanceof PrimType) {\n Value size = immediate(stmt, (Immediate) expr.getSize(0));\n result = call(getNewArray(expr.getBaseType().getElementType()), env, size);\n } else {\n for (int i = 0; i < expr.getSizeCount(); i++) {\n Value size = immediate(stmt, (Immediate) expr.getSize(i));\n Variable ptr = function.newVariable(new PointerType(I32));\n function.add(new Getelementptr(ptr, dims.ref(), 0, i));\n function.add(new Store(size, ptr.ref()));\n }\n Variable dimsI32 = function.newVariable(new PointerType(I32));\n function.add(new Bitcast(dimsI32, dims.ref(), dimsI32.getType()));\n String targetClassName = getInternalName(expr.getType());\n Trampoline trampoline = new Multianewarray(this.className, targetClassName);\n trampolines.add(trampoline);\n result = call(trampoline.getFunctionRef(), env, new IntegerConstant(expr.getSizeCount()), dimsI32.ref());\n }\n } else if (rightOp instanceof InvokeExpr) {\n result = invokeExpr(stmt, (InvokeExpr) rightOp);\n } else if (rightOp instanceof LengthExpr) {\n Value op = immediate(stmt, (Immediate) ((LengthExpr) rightOp).getOp());\n checkNull(stmt, op);\n Variable v = function.newVariable(I32);\n function.add(new Call(v, ARRAY_LENGTH, op));\n result = v.ref();\n } else if (rightOp instanceof NegExpr) {\n NegExpr expr = (NegExpr) rightOp;\n Value op = immediate(stmt, (Immediate) expr.getOp());\n Type rightType = op.getType();\n Variable v = function.newVariable(op.getType());\n if (rightType instanceof IntegerType) {\n function.add(new Sub(v, new IntegerConstant(0, (IntegerType) rightType), op));\n } else {\n function.add(new Fmul(v, new FloatingPointConstant(-1.0, (FloatingPointType) rightType), op));\n }\n result = v.ref();\n } else {\n throw new IllegalArgumentException(\"Unknown type for rightOp: \" + rightOp.getClass());\n }\n } else {\n throw new IllegalArgumentException(\"Unknown type for rightOp: \" + rightOp.getClass());\n }\n \n soot.Value leftOp = stmt.getLeftOp();\n \n if (leftOp instanceof Local) {\n Local local = (Local) leftOp;\n VariableRef v = new VariableRef(local.getName(), new PointerType(getLocalType(leftOp.getType())));\n function.add(new Store(result, v, !sootMethod.getActiveBody().getTraps().isEmpty()));\n } else {\n Type leftType = getType(leftOp.getType());\n Value narrowedResult = narrowFromI32Value(leftType, result);\n if (leftOp instanceof ArrayRef) {\n ArrayRef ref = (ArrayRef) leftOp;\n VariableRef base = (VariableRef) immediate(stmt, (Immediate) ref.getBase());\n Value index = immediate(stmt, (Immediate) ref.getIndex());\n checkNull(stmt, base);\n checkBounds(stmt, base, index);\n if (leftOp.getType() instanceof RefLikeType) {\n call(BC_SET_OBJECT_ARRAY_ELEMENT, env, base, index, narrowedResult);\n } else {\n call(getArrayStore(leftOp.getType()), base, index, narrowedResult);\n }\n } else if (leftOp instanceof InstanceFieldRef) {\n InstanceFieldRef ref = (InstanceFieldRef) leftOp;\n Value base = immediate(stmt, (Immediate) ref.getBase());\n checkNull(stmt, base);\n FunctionRef fn = null;\n if (canAccessDirectly(ref)) {\n fn = new FunctionRef(mangleField(ref.getFieldRef()) + \"_setter\", \n new FunctionType(VOID, ENV_PTR, OBJECT_PTR, getType(ref.getType())));\n } else {\n soot.Type runtimeType = ref.getBase().getType();\n String targetClassName = getInternalName(ref.getFieldRef().declaringClass());\n String runtimeClassName = runtimeType == NullType.v() ? targetClassName : getInternalName(runtimeType);\n Trampoline trampoline = new PutField(this.className, targetClassName, \n ref.getFieldRef().name(), getDescriptor(ref.getFieldRef().type()), runtimeClassName);\n trampolines.add(trampoline);\n fn = trampoline.getFunctionRef();\n }\n call(fn, env, base, narrowedResult);\n } else if (leftOp instanceof StaticFieldRef) {\n StaticFieldRef ref = (StaticFieldRef) leftOp;\n FunctionRef fn = null;\n if (canAccessDirectly(ref)) {\n fn = new FunctionRef(mangleField(ref.getFieldRef()) + \"_setter\", \n new FunctionType(VOID, ENV_PTR, getType(ref.getType())));\n } else {\n String targetClassName = getInternalName(ref.getFieldRef().declaringClass());\n Trampoline trampoline = new PutStatic(this.className, targetClassName, \n ref.getFieldRef().name(), getDescriptor(ref.getFieldRef().type()));\n trampolines.add(trampoline);\n fn = trampoline.getFunctionRef();\n }\n call(fn, env, narrowedResult);\n } else {\n throw new IllegalArgumentException(\"Unknown type for leftOp: \" + leftOp.getClass());\n }\n }\n }", "double getMin();", "double getMin();", "int getLower();", "double getLeft(double min);", "@Override\n\tpublic AbstractValue leastUpperBound(AbstractValue v) {\n\t\tif ( !(v instanceof Interval) )\n\t\t\tthrow new IllegalArgumentException(\"v should be of type Interval\");\n\t\tInterval i = (Interval) v;\n\n\t\tif (i.equals(top))\n\t\t\treturn i;\n\t\telse if (i.isBottom())\n\t\t\treturn this;\n\n\t\tString newLow, newHigh;\n\n\t\tif (this.getLow().equals(\"-Inf\") || i.getLow().equals(\"-Inf\"))\n\t\t\tnewLow = \"-Inf\";\n\t\telse\n\t\t\tnewLow = String.valueOf(Long.min(Long.parseLong(this.getLow()), Long.parseLong(i.getLow())));\n\n\t\tif (this.getHigh().equals(\"+Inf\") || i.getHigh().equals(\"+Inf\"))\n\t\t\tnewHigh = \"+Inf\";\n\t\telse\n\t\t\tnewHigh = String.valueOf(Long.max(Long.parseLong(this.getHigh()), Long.parseLong(i.getHigh())));\n\n\t\tInterval res = new Interval(newLow, newHigh);\n\t\treturn amItop() ? top : res ;\n\t}", "public interface ILits {\n\n public static int UNDEFINED = -1;\n\n public abstract void init(int nvar);\n\n /**\n * Translates a Dimacs literal into an internal representation literal.\n * \n * @param x\n * the Dimacs literal (a non null integer).\n * @return the literal in the internal representation.\n */\n public abstract int getFromPool(int x);\n\n /**\n * Returns true iff the variable is used in the set of constraints.\n * \n * @param x\n * @return true iff the variable belongs to the formula.\n */\n boolean belongsToPool(int x);\n\n public abstract void resetPool();\n\n public abstract void ensurePool(int howmany);\n\n public abstract void unassign(int lit);\n\n public abstract void satisfies(int lit);\n\n public abstract boolean isSatisfied(int lit);\n\n public abstract boolean isFalsified(int lit);\n\n public abstract boolean isUnassigned(int lit);\n\n /**\n * @param lit\n * @return true iff the truth value of that literal is due to a unit\n * propagation or a decision.\n */\n public abstract boolean isImplied(int lit);\n\n /**\n * to obtain the max id of the variable\n * \n * @return the maximum number of variables in the formula\n */\n public abstract int nVars();\n\n /**\n * to obtain the real number of variables appearing in the formula\n * \n * @return the number of variables used in the pool\n */\n int realnVars();\n\n public abstract int not(int lit);\n\n public abstract void reset(int lit);\n\n public abstract int getLevel(int lit);\n\n public abstract void setLevel(int lit, int l);\n\n public abstract Constr getReason(int lit);\n\n public abstract void setReason(int lit, Constr r);\n\n public abstract IVec<Undoable> undos(int lit);\n\n public abstract void attach(int lit, Propagatable c);\n\n /**\n * @param lit\n * a literal\n * @return the list of all the constraints that watch the negation of lit\n */\n public abstract IVec<Propagatable> attaches(int lit);\n\n public abstract String valueToString(int lit);\n}", "public int lowerBoundary(){\r\n\t\treturn this.ypoints[0];\r\n\t}", "public Point getXLower()\n {\n return (Point)xLow.clone();\n }", "public void setLow(int L)\t\n\t{\t//start of setLow method\n\t\tLOW_NUM = L;\n\t}", "private zzfl$zzg$zzc() {\n void var3_1;\n void var2_-1;\n void var1_-1;\n this.value = var3_1;\n }", "public int getMinimumInteger() {\n/* 190 */ return (int)this.min;\n/* */ }", "private int min(int a, int b) {\n\t\treturn a<b?a:b;\n\t}", "public Number getMinimumNumber() {\n/* 167 */ if (this.minObject == null) {\n/* 168 */ this.minObject = new Long(this.min);\n/* */ }\n/* 170 */ return this.minObject;\n/* */ }", "public double getDomainMin1() throws IllegalStateException {\n\treturn -Double.MAX_VALUE;\n }", "public int maxLocals();", "private void instantiateVarsSingle(IntVar var, int coeff, int constant, Propagator prop) throws ContradictionException {\n var.instantiateTo(zpz.getSmallestGreaterEqThan(var.getLB(), zpz.div(constant, coeff)), prop);\n }", "public static DecisionOperator<IntVar> assign() {\n return DecisionOperator.int_eq;\n }", "public interface AssignmentNode extends StackOperationNode {\n\n TemporaryVariableName getValueName();\n\n}", "public double getMinValue(double defaultMin, Date start, Date end)\n\t{\n\t\tdouble min = Double.MAX_VALUE;\n\t\tfor(TimedVariable tv : vars)\n\t\t{\n\t\t\tDate t = tv.getTime();\n\t\t\tif (start != null && start.compareTo(t) > 0)\n\t\t\t\tcontinue;\n\t\t\tif (end != null && end.compareTo(t) < 0)\n\t\t\t\tcontinue;\n\t\t\tint fl = tv.getFlags();\n\t\t\tif ((fl & IFlags.IS_MISSING) == 0)\n\t\t\t{\n\t\t\t\ttry \n\t\t\t\t{\n\t\t\t\t\tdouble d = tv.getDoubleValue();\n\t\t\t\t\tif (d < min)\n\t\t\t\t\t\tmin = d;\n\t\t\t\t}\n\t\t\t\tcatch(NoConversionException ex) {}\n\t\t\t}\n\t\t}\n\t\treturn min == Double.MAX_VALUE ? defaultMin : min;\n\t}", "double getLowerThreshold();", "private static final void setUpLowVar(final CMProps props, final Str varNum, String val) {\n if (varNum == null)\n return;\n if (val == null)\n val = \"\";\n props.sysVars[varNum.ordinal()] = val;\n if (varNum == Str.PKILL) {\n final int x = val.indexOf('-');\n if (x > 0)\n props.pkillLevelDiff = CMath.s_int(val.substring(x + 1));\n }\n }" ]
[ "0.64422303", "0.64204246", "0.62325317", "0.6195147", "0.6169089", "0.61403984", "0.60196924", "0.58673537", "0.58543575", "0.56957626", "0.5625129", "0.5563599", "0.5546278", "0.54507804", "0.54012406", "0.53939486", "0.5373368", "0.5348131", "0.5338412", "0.53317523", "0.53246075", "0.53100294", "0.529643", "0.52958935", "0.527034", "0.5263915", "0.5240986", "0.52390397", "0.52246505", "0.5210415", "0.5209744", "0.51957446", "0.5182261", "0.518059", "0.5177552", "0.5169747", "0.5163611", "0.51566976", "0.5146439", "0.5140819", "0.5140275", "0.5130832", "0.51253146", "0.5121568", "0.51213574", "0.5103955", "0.50983256", "0.50963205", "0.50905794", "0.5073577", "0.50693065", "0.50667316", "0.5066662", "0.50641525", "0.5053085", "0.50385445", "0.50330836", "0.5026735", "0.5023383", "0.50091136", "0.49987665", "0.4984232", "0.49816695", "0.49807352", "0.49756518", "0.4970274", "0.49527365", "0.4940373", "0.49377754", "0.49356917", "0.49348402", "0.49246916", "0.4918335", "0.49149868", "0.49125358", "0.49119315", "0.49117926", "0.4911022", "0.491068", "0.49097872", "0.49097872", "0.49096903", "0.49082765", "0.48969385", "0.4890241", "0.48898023", "0.48897827", "0.48875013", "0.48773915", "0.4875153", "0.4864591", "0.4864013", "0.48629433", "0.48591775", "0.4854214", "0.4854121", "0.48431656", "0.483635", "0.4820972", "0.48207116" ]
0.50984377
46
Removes the lower bound value from the domain of the first noninstantiated variable
public static IntStrategy lexico_Neq_LB(IntVar... VARS) { return custom(lexico_var_selector(), min_value_selector(), remove(), VARS); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tprotected double getLowerBound() {\n\t\treturn 0;\n\t}", "public void setLowerBound (int lowerBound) throws ModelException;", "public double getDomainMin1() throws IllegalStateException {\n\treturn -Double.MAX_VALUE;\n }", "public V getLowerBound();", "public T removeMin ();", "@Override\n\tprotected void setLowerBound() {\n\t\t\n\t}", "void unsetFractionalMinimum();", "@Override\n\t\t\tpublic IFuzzySet cut(double minValue) {\n\t\t\t\treturn null;\n\t\t\t}", "@Override\n\t\t\tpublic IFuzzySet cut(double minValue) {\n\t\t\t\treturn null;\n\t\t\t}", "public abstract double[] getLowerBound();", "public int getLowerBound ();", "public int getLowerBound() {\r\n return lowerBound;\r\n }", "public void removeMin() {\n if (isEmpty()) throw new RuntimeException(\"underflow\");\n root = removeMin(root);\n }", "public double getDomainMin2() throws IllegalStateException {\n\treturn -Double.MAX_VALUE;\n }", "private int deadZone(int value, int minValue)\n\t{\n\t\tif (Math.abs(value) < minValue) value = 0;\n\t\t\n\t\treturn value;\n\t}", "void unsetSingleBetMinimum();", "public double getMinDoubleValue();", "public void setLowerBound(final int lowerBound) {\r\n this.lowerBound = lowerBound;\r\n }", "public void removeSmaller(double value){\r\n\t DoubleNode cursor2; \r\n\tfor(cursor = head; cursor != null; cursor = cursor.getLink()){\r\n\t\tif(cursor.getData() < value){\r\n\t\t\tif(cursor == head){\r\n\t\t\t\thead = head.getLink(); \r\n\t\t\t\tmanyNodes--; \r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tcursor2 = cursor; \r\n\t\t\t\tthis.removeCurrent();\r\n\t\t\t\tcursor = cursor2;\r\n\t\t\t\tmanyNodes--; \r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n }", "public void setMinValue(double x) {\r\n\t\tminValue = x;\r\n\t}", "Double getMinimumValue();", "public void setLowerBound (int lowerBound) throws ModelException\n\t{\n\t\tif ((lowerBound > getUpperBound()) || (lowerBound < 0))\n\t\t{\n\t\t\tthrow new ModelException(I18NHelper.getMessage(getMessages(),\n\t\t\t\t\"jdo.relationship.lower_cardinality_invalid\"));\t\t// NOI18N\n\t\t}\n\n\t\tgetRelationshipImpl().setLowerBound(lowerBound);\n\t}", "void unsetWagerMinimum();", "public void update_domain(int value, int lowerBound, int upperBound) {\n domain_history.push(domain.copy());\n domain.getDomain().remove((Integer) value);\n domain.getDomain().removeIf(d -> d > upperBound || d < lowerBound);\n }", "protected abstract D getLower(R range);", "public void setLowerBound(String lower) {\n lowerBound = lower;\n }", "default DiscreteDoubleMap2D nonPositivePart() {\r\n\t\treturn pointWiseMinimum(ZERO);\r\n\t}", "@Basic\n\t@Raw\n\t@Immutable\n\tpublic static double getVelocityLowerBound() {\n\t\treturn VELOCITYLOWERBOUND;\n\t}", "TrackingToken lowerBound();", "public void removeMin() {\n\t\troot = removeMin(root);\n\t}", "public double obterXmin() {\n\t\treturn xmin;\n\t}", "@Basic\n\t@Immutable\n\tpublic abstract double getRadiusLowerBound();", "void unsetMaximum();", "Nodefh removeMin(){\n\t\t\n\t\tif(min == null){\n\t\t\tNodefh dummy = new Nodefh();\n\t\t\tdummy.index = -1;\n\t\t\treturn dummy;\n\t\t}\n\t\tNodefh temp = new Nodefh();\n\t\ttemp = min;\n\t\tif((min.Child == null) && (min == min.Right)){\n\t\t\tmin = null;\n\t\t\treturn temp;\n\t\t}\n\t\tpairwiseCombine();\n\t\treturn temp;\n\t}", "@Override\r\n public Integer minLowerBound() {\r\n return this.getImpl().minLowerBound();\r\n }", "public void clamp() //TODO: implement\n {\n System.out.println(\"clamp was called!\"); //DEBUGG: check if called, delete if i know when\n /*\n IntegerVectorSpecies _species = (IntegerVectorSpecies)species;\n for (int i = 0; i < genomeLength(); i++)\n {\n int minGene = (int)_species.minGene(i);\n if (genome[i].getValue() < minGene)\n genome[i].setValue(minGene); //what do do for the TraceID?\n else\n {\n int maxGene = (int)_species.maxGene(i);\n if (genome[i].getValue() > maxGene)\n genome[i] = maxGene;\n }\n }\n\n */\n }", "public Point getXLower()\n {\n return (Point)xLow.clone();\n }", "public abstract DoublePredicate lowerPredicate(double lowerBound);", "boolean impliedByLowerBound(InfinitNumber lbound) {\n\t\treturn getInverseBound().lesseq(lbound);\n\t}", "public E removeMin() {\n // TODO: YOUR CODE HERE\n E min = getElement(1);\n swap(1, size());\n setElement(size(), null);\n bubbleDown(1);\n size -= 1;\n return min;\n }", "public void changeConstraintsToLessThan() throws IloException {\n /*\n IloRange notes:\n for expr == rhs, set lb = ub = rhs\n for expr <= rhs, set lb = -infinity and ub = rhs\n for expr >= rhs, set lb = rhs and ub = infinity\n */\n for (int i = 0; i < matrix.getNrows(); i++) {\n IloRange rangedExpression = matrix.getRange(i);\n if (rangedExpression.getUB() >= Double.POSITIVE_INFINITY) {\n rangedExpression.setBounds(Double.NEGATIVE_INFINITY, -rangedExpression.getUB());\n for (int j = 0; j < matrix.getNrows(); j++) {\n matrix.setNZ(i, j, -matrix.getNZ(i, j));\n }\n }\n }\n }", "private int getLowerBound(Object problem, int upperbound)\n {\n Graph tsp = (Graph)problem;\n if (weight == null)\n weight = new double[tsp.size()];\n hki = new HeldKarpIterative( tsp, included, includedT, excluded, excludedT, iterations, weight, upperbound);\n hki.compute();\n tour = hki.isTour();\n bound = hki.getBound();\n hasRun = true;\n// System.out.println(hki.debugDump());\n return bound;\n }", "public double getDomainMax1() throws IllegalStateException {\n\treturn Double.MAX_VALUE;\n }", "public final void setUnbounded() {_occ.setUnbounded();}", "R visitBoundVariable(Formula f, int deBruijnIdx);", "public int lowerBoundary(){\r\n\t\treturn this.ypoints[0];\r\n\t}", "public void testFindDomainBounds() {\n XYBlockRenderer renderer = new XYBlockRenderer();\n XYSeriesCollection dataset = new XYSeriesCollection();\n XYSeries series = new XYSeries(\"S1\");\n series.add(1.0, null);\n dataset.addSeries(series);\n Range r = renderer.findDomainBounds(dataset);\n dataset.removeAllSeries();\n r = renderer.findDomainBounds(dataset);\n }", "float xMin();", "private void setMinThreshold() {\n minThreshold = value + value * postBoundChange / 100;\n }", "public double minValue() {\n return 0;\r\n }", "public double lower()\n\t{\n\t\treturn _dblLower;\n\t}", "default DiscreteDoubleMap2D minus(double value) {\r\n\t\treturn pushForward(d -> d - value);\r\n\t}", "public void setLowerPoint(Point lower) {\n this.lower = lower;\n }", "double getMin();", "double getMin();", "public Point getLowerPoint() {\n return lower;\n }", "public double lowerExtent(int coord) throws IllegalArgumentException { \n double le = measurements[coord].value();\n if ( ! Double.isNaN( measurements[coord].errorMinus() ) )\n le -= measurements[coord].errorMinus();\n\treturn le;\n }", "E minVal();", "public Node removeMin() {\n \t\t// TODO Complete this method!\n \t\tif (indexOfLeastPriority == 2) {\n \t\t\tNode toReturn = getNode(1);\n \t\t\tsetNode(1, null);\n \t\t\treturn toReturn;\n \t\t}\n \t\tint indexOfReplacement = indexOfLeastPriority - 1;\n \t\tNode nodeOfReplacement = getNode(indexOfReplacement);\n \t\tNode toRemove = getNode(1);\n \t\tsetNode(indexOfReplacement, null);\n \t\tsetNode(1, nodeOfReplacement);\n \t\tbubbleDown(1);\n \t\t//decrement IoLP\n \t\tindexOfLeastPriority--;\n \t\treturn toRemove;\n \t}", "protected void mapValueToWithinBounds() {\n if (getAllele() != null) {\n \tFloat d_value = ( (Float) getAllele());\n if (d_value.isInfinite()) {\n // Here we have to break to avoid a stack overflow.\n // ------------------------------------------------\n return;\n }\n // If the value exceeds either the upper or lower bounds, then\n // map the value to within the legal range. To do this, we basically\n // calculate the distance between the value and the float min,\n // then multiply it with a random number and then care that the lower\n // boundary is added.\n // ------------------------------------------------------------------\n if (d_value.floatValue() > m_upperBound ||\n d_value.floatValue() < m_lowerBound) {\n RandomGenerator rn;\n if (getConfiguration() != null) {\n rn = getConfiguration().getRandomGenerator();\n }\n else {\n rn = new StockRandomGenerator();\n }\n setAllele(new Float((rn.nextFloat()\n * ((m_upperBound - m_lowerBound))) + m_lowerBound));\n }\n }\n }", "public double getXRangeMin() {\n return xRangeMin;\n }", "public InfinitNumber getBound() {\n\t\treturn mBound;\n\t}", "public Cut<C> b(BoundType boundType, DiscreteDomain<C> discreteDomain) {\n switch (boundType) {\n case CLOSED:\n Comparable previous = discreteDomain.previous(this.a);\n return previous == null ? Cut.e() : new AboveValue<>(previous);\n case OPEN:\n return this;\n default:\n throw new AssertionError();\n }\n }", "@Override\r\n\tpublic double derivativeOf(double x) {\r\n\t\treturn ( 1 / (x - this.getLower_bound()) ) + ( 1 / (this.getUpper_bound() - x) ); \r\n\t}", "public double getMinValue() {\r\n\t\treturn minValue;\r\n\t}", "protected Vector unfilterLabelInternal(Vector before)\n\t{\n\t\tdouble[] after = new double[labelMaxes.length];\n\n\t\tfor (int c = 0; c < after.length; c++)\n\t\t{\n\t\t\tif(Vector.isUnknown(labelMins[c])) // if the attribute is nominal or ignored...\n\t\t\t\tafter[c] = before.get(c);\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (labelMaxes[c] == labelMins[c])\n\t\t\t\t{\n\t\t\t\t\t// There was only 1 value in this column when the filter was initialized.\n\t\t\t\t\tafter[c] = labelMaxes[c];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tafter[c] = ((before.get(c) - base) / range) * (labelMaxes[c] - labelMins[c]) + labelMins[c];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn new Vector(after, before.getWeight());\n\t}", "public int getLowerBound ()\n\t{\n\t\treturn getRelationshipImpl().getLowerBound();\n\t}", "@Override\n\tpublic AbstractValue greatestLowerBound(AbstractValue d) {\n\t\tif ( !(d instanceof Interval) )\n\t\t\tthrow new IllegalArgumentException(\"v should be of type Interval\");\n\t\tInterval i = (Interval) d;\n\n\t\tif (i.isBottom())\n\t\t\treturn i;\n\t\telse if (i.equals(top))\n\t\t\treturn this;\n\n\t\tString newLow = \"-Inf\", newHigh = \"+Inf\";\n\n\t\t//Calcolare limite inferiore\n\n\t\tif ( this.getLow().equals(\"-Inf\")){\n\t\t\tif( !i.getLow().equals(\"-Inf\"))\n\t\t\t\tif(Integer.parseInt(this.getHigh()) > Integer.parseInt(i.getLow()))\n\t\t\t\t\tnewLow = String.valueOf(Integer.max(Integer.parseInt(this.getLow()), Integer.parseInt(i.getLow())));\n\t\t\t\telse\n\t\t\t\t\treturn BottomAV.getInstance();\n\t\t}else if ( i.getLow().equals(\"-Inf\")){\n\t\t\tif( !this.getLow().equals(\"-Inf\"))\n\t\t\t\tif(Integer.parseInt(i.getHigh()) > Integer.parseInt(this.getLow()))\n\t\t\t\t\tnewLow = String.valueOf(Integer.max(Integer.parseInt(i.getLow()), Integer.parseInt(this.getLow())));\n\t\t\t\telse\n\t\t\t\t\treturn BottomAV.getInstance();\n\t\t}else if(!this.getLow().equals(\"-Inf\") && !i.getLow().equals(\"-Inf\")){\n\t\t\tnewLow = String.valueOf(Integer.max(Integer.parseInt(this.getLow()), Integer.parseInt(i.getLow())));\n\t\t}\n\n\t\t// Calcolare limite superiore\n\n\t\tif ( this.getHigh().equals(\"+Inf\")) {\n\t\t\tif (!i.getHigh().equals(\"+Inf\"))\n\t\t\t\tnewHigh = i.getHigh();\n\t\t}else if ( i.getHigh().equals(\"+Inf\")) {\n\t\t\tif (!this.getHigh().equals(\"+Inf\"))\n\t\t\t\tnewHigh = this.getHigh();\n\t\t}else if(!this.getHigh().equals(\"+Inf\") && !i.getHigh().equals(\"+Inf\")){\n\t\t\tnewHigh = String.valueOf(Integer.min(Integer.parseInt(this.getHigh()), Integer.parseInt(i.getHigh())));\n\t\t}\n\n\t\tInterval res = new Interval(newLow, newHigh);\n\n\t\t// Checks whether low > high\n\t\tif ((!newLow.equals(\"-Inf\") && (!newHigh.equals(\"+Inf\")) && Integer.parseInt(newLow) > Integer.parseInt(newHigh)))\n\t\t\treturn BottomAV.getInstance();\n\n\t\treturn amItop() ? top : res;\n\t}", "public abstract Cut<C> b(BoundType boundType, DiscreteDomain<C> discreteDomain);", "int getXMin();", "private Node<Value> delMin(Node<Value> x)\r\n {\r\n if (x.left == null) return x.right;\r\n x.left = delMin(x.left);\r\n return x;\r\n }", "public int removeMin() {\n // FILL IN CODE\n\n return -1; // don't forget to change it\n }", "private void scaleToPositive() {\r\n // Obtain min value\r\n double minScalarization = Double.MAX_VALUE;\r\n for (S solution : solutions()) {\r\n if (scalarization.getAttribute(solution) < minScalarization) {\r\n minScalarization = scalarization.getAttribute(solution);\r\n }\r\n }\r\n if (minScalarization < 0) {\r\n // Avoid scalarization values of 0\r\n double eps = 10e-6;\r\n for (S solution : solutions()) {\r\n scalarization.setAttribute(solution, eps + scalarization.getAttribute(solution) + minScalarization);\r\n }\r\n }\r\n }", "void unsetValuePeriod();", "public int getBound();", "@Override\n public void prune(long boundaryValue)\n {\n Iterator<MemorySegment> iterator = segments.iterator();\n while(iterator.hasNext())\n {\n MemorySegment segment = iterator.next();\n if(segment.lastVal() < boundaryValue)\n {\n iterator.remove();\n }\n }\n\n //Note: This maintains a currentSegment even if all segments have\n // been pruned.\n if(segments.size() == 0)\n {\n addSegment();\n }\n }", "public void setUnrealizedPnl(double value) {\r\n this.unrealizedPnl = value;\r\n }", "private double clamp(double v, double min, double max) { return (v < min ? min : (v > max ? max : v)); }", "@Override\r\n\tpublic LogicalValue removeRange(int min, int max)\r\n\t\t\tthrows NonRemovableRangeException {\r\n\t\tthrow new NonRemovableRangeException(\r\n\t\t\t\t\"No portion of a pointer may be eliminated\");\r\n\t}", "public abstract Cut<C> a(BoundType boundType, DiscreteDomain<C> discreteDomain);", "public void lower() {\n fangSolenoid.set(DoubleSolenoid.Value.kForward);\n }", "public String getLower() {\n return lowerBound;\n }", "public void normalize() {\n // determine the maximum value\n \n Double max = getMaxValue();\n \n if(max!=null) {\n normalize(max);\n }\n }", "public int getMinimumValue() {\n/* 276 */ return -this.s.getMaximumValue();\n/* */ }", "@Override\n\tprotected double getUpperBound() {\n\t\treturn 0;\n\t}", "public Point getXMin()\n {\n return (Point)xMin.clone();\n }", "protected final void setMin() {\n\tint prevmin = this.min;\n\n\tint i1 = this.low;\n\tint i2 = left.min;\n\tint i3 = right.min;\n\n\tif (i2 == -1) \n\t i2 = i1;\n\tif (i3 == -1) \n\t i3 = i1;\n\n\tif ((i1 <= i2) && (i1 <= i3)) {\n\t this.min = i1;\n\t} else if ((i2 <= i1) && (i2 <= i3)) {\n\t this.min = i2;\n\t} else {\n\t this.min = i3;\n\t}\n\n\tif ((p != IntervalNode.nullIntervalNode) &&\n\t (prevmin != this.min)) {\n \t p.setMin();\n\t}\n }", "public void narrowRange(int min, int max, Boolean axis) {\n\t\tint counter=0; // how much points we erasing total ?\n\t\tboolean erasingAll=false; // if we eventually erasing all the database\n\t\t// by axis X-----------------------------------------//\n\t\tif (axis){ \n\t\t\tthis.current = this.minx;\n\t\t\twhile (!erasingAll && this.current.getData().getX()<min){\n\t\t\t\tnarrowOppPoint(this.current,axis); // deleting this point in y axis\n\t\t\t\tthis.current = this.current.getNextX(); \n\t\t\t\tcounter++;\n\t\t\t\tif (this.current==null) //if we get to the edge of the DS\n\t\t\t\t\terasingAll=true;\n\t\t\t}\n\t\t\tif (!erasingAll)\n\t\t\t\tthis.current.setPrevX(null);\n\t\t\tthis.minx = this.current; // the actual erasing\n\t\t\t//---//\n\t\t\tthis.current = this.maxx;\n\t\t\twhile (!erasingAll && this.current.getData().getX() > max){\n\t\t\t\tnarrowOppPoint(this.current,axis);\n\t\t\t\tthis.current = this.current.getPrevX(); \n\t\t\t\tcounter++;\n\t\t\t\tif (this.current==null) //if we get to the edge of the DS\n\t\t\t\t\terasingAll=true;\n\t\t\t}\n\t\t\tif (!erasingAll)\n\t\t\t\tthis.current.setNextX(null);\n\t\t\tthis.maxx = this.current; //the actual erasing\n\t\t}\n\t\t// by axis Y -----------------------------------------------------------//\n\t\telse{ \n\t\t\tthis.current = this.miny;\n\t\t\twhile (!erasingAll && this.current.getData().getY()<min){\n\t\t\t\tnarrowOppPoint(this.current,axis);\n\t\t\t\tthis.current = this.current.getNextY(); \n\t\t\t\tcounter++;\n\t\t\t\tif (this.current==null) //if we get to the edge of the DS\n\t\t\t\t\terasingAll=true;\n\t\t\t}\n\t\t\tif (!erasingAll)\n\t\t\t\tthis.current.setPrevY(null);\n\t\t\tthis.miny = this.current; //the actual erasing\n\t\t\t//--//\n\t\t\tthis.current = this.maxy;\n\t\t\twhile (!erasingAll && this.current.getData().getY() > max){\n\t\t\t\tnarrowOppPoint(this.current,axis);\n\t\t\t\tthis.current = this.current.getPrevY(); \n\t\t\t\tcounter++;\n\t\t\t\tif (this.current==null) //if we get to the edge of the DS\n\t\t\t\t\terasingAll=true;\n\t\t\t}\n\t\t\tif (!erasingAll)\n\t\t\t\tthis.current.setNextY(null);\n\t\t\tthis.maxy = this.current; //the actual erasing\n\t\t}\n\t\tthis.size = this.size - counter; // Update the size of the DS\n\t}", "public double getLeft(double min) {\n return min - this.size; \n }", "public void removeLocalVariable(LocalVariableGen lvg) {\n/* 183 */ this._slotAllocator.releaseSlot(lvg);\n/* 184 */ super.removeLocalVariable(lvg);\n/* */ }", "public Comparable<?> a(DiscreteDomain<Comparable<?>> discreteDomain) {\n return discreteDomain.minValue();\n }", "public Double getMinimumValue () {\r\n\t\treturn (minValue);\r\n\t}", "public double getMinRange() {\n return minRange;\n }", "float getXStepMin();", "public ReversedLinearValueFunction(double min, double max) {\n if (min == max) {\n LOGGER.error(\n \"The upper bound is equal to the lower bound in the constructor of the\"\n + \" LinearValueFunction.\");\n throw new IllegalArgumentException(\"The upper bound can't be equal to the lower bound.\");\n }\n interval = Range.closed(min, max);\n LOGGER.info(\n \"The interval [{}, {}] has been set with success in the LinearValueFunction class.\",\n min,\n max);\n }", "public void setMinValue(int x) {\r\n\t\tminValue = x;\r\n\t}", "private Double getMin(Double[] values) {\n Double ret = null;\n for (Double d: values) {\n if (d != null) ret = (ret == null) ? d : Math.min(d, ret);\n }\n return ret;\n }", "public AnyType deleteMin() {\n if (isEmpty())\n throw new UnderflowException();\n\n AnyType minItem = root.element;\n root = merge(root.left, root.right);\n\n return minItem;\n }", "public void setBaseUnrealizedPnl(double value) {\r\n this.baseUnrealizedPnl = value;\r\n }", "@Override\n\tpublic AbstractValue leastUpperBound(AbstractValue v) {\n\t\tif ( !(v instanceof Interval) )\n\t\t\tthrow new IllegalArgumentException(\"v should be of type Interval\");\n\t\tInterval i = (Interval) v;\n\n\t\tif (i.equals(top))\n\t\t\treturn i;\n\t\telse if (i.isBottom())\n\t\t\treturn this;\n\n\t\tString newLow, newHigh;\n\n\t\tif (this.getLow().equals(\"-Inf\") || i.getLow().equals(\"-Inf\"))\n\t\t\tnewLow = \"-Inf\";\n\t\telse\n\t\t\tnewLow = String.valueOf(Long.min(Long.parseLong(this.getLow()), Long.parseLong(i.getLow())));\n\n\t\tif (this.getHigh().equals(\"+Inf\") || i.getHigh().equals(\"+Inf\"))\n\t\t\tnewHigh = \"+Inf\";\n\t\telse\n\t\t\tnewHigh = String.valueOf(Long.max(Long.parseLong(this.getHigh()), Long.parseLong(i.getHigh())));\n\n\t\tInterval res = new Interval(newLow, newHigh);\n\t\treturn amItop() ? top : res ;\n\t}", "void unsetMultipleBetMinimum();" ]
[ "0.62962407", "0.6256597", "0.6129022", "0.60399014", "0.59879094", "0.5932331", "0.593132", "0.58774483", "0.58774483", "0.57875687", "0.5774897", "0.5772342", "0.56470925", "0.56275684", "0.55812275", "0.5575049", "0.5554826", "0.55239576", "0.5520796", "0.5497395", "0.54933965", "0.54884475", "0.5482655", "0.5467575", "0.5452971", "0.5437172", "0.5401465", "0.5391198", "0.53805184", "0.5366937", "0.5360709", "0.5359798", "0.53375447", "0.533317", "0.5310672", "0.5307349", "0.53006804", "0.52996445", "0.5298722", "0.5286481", "0.5238884", "0.52249515", "0.52156436", "0.5211932", "0.52116305", "0.52083576", "0.51759857", "0.51687855", "0.51576066", "0.5139917", "0.51326895", "0.5130583", "0.5128174", "0.5125746", "0.5125746", "0.5125192", "0.5123658", "0.5123594", "0.5121308", "0.5109268", "0.5103405", "0.50957376", "0.5093014", "0.5087948", "0.5082996", "0.50798446", "0.50767106", "0.5062711", "0.50464237", "0.5043078", "0.50365984", "0.50336736", "0.5024297", "0.50205415", "0.5014528", "0.5004818", "0.50017303", "0.49998662", "0.49945226", "0.49899524", "0.49816334", "0.498023", "0.49733385", "0.4968933", "0.49658826", "0.49493036", "0.49438646", "0.4940234", "0.49365216", "0.4928998", "0.49245074", "0.4924068", "0.49154767", "0.4913284", "0.49114475", "0.49111354", "0.49076077", "0.49069268", "0.49039233", "0.49024335", "0.4894923" ]
0.0
-1
Splits the domain of the first noninstantiated variable in the middle and branch first on the left interval
public static IntStrategy lexico_Split(IntVar... VARS) { return dichotomic(ISF.lexico_var_selector(), true, VARS); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void divideDomain(){\n \tfor (int i = 0 ; i < getBoardSize() ; i++)\n \t\tfor (int j = 0 ; j < getBoardSize() ; j++){\n\t\t\tgetPoint(i, j).setHolder(GoPlayer.UNKNOWN);\n\t\t}\n\n \t\tfor (int i = 0 ; i < getBoardSize() ; i++)\n \t\tfor (int j = 0 ; j < getBoardSize() ; j++){\n if (getPoint(i, j).getHolder() == GoPlayer.UNKNOWN){\n \tif (getPoint(i, j).getState() == GoPoint.BLACK){\n getPoint(i, j).setHolder(GoPlayer.BLACK);\n \t}\n \telse if (getPoint(i, j).getState() == GoPoint.WHITE){\n getPoint(i, j).setHolder(GoPlayer.WHITE);\n \t}\n \telse {\n \t\tVector v = getBody(i,j);\n \t\tfindSpaceHolder(v);\n \t}\n }\n\t\t}\n }", "boolean splitAndInsert(T t, Pair<String,LeafNode> ln){\n\n int splitTimes=0;\n\n Interval[] intervals = ln.second().getIntervals();\n assert intervals.length==leafNodeCapacity;\n Interval[] leftIntervals = new Interval[leafNodeCapacity];\n Interval[] rightIntervals = new Interval[leafNodeCapacity];\n Interval[] tempIntervals = null;\n\n int leftIntervalNumber=0;\n int rightIntervalNumber=0;\n TriangleShape lnTriangle = ln.second().triangle;\n String lnString=ln.first();\n TriangleShape leftTriangle=null;\n TriangleShape rightTriangle=null;\n String leftString=null;\n String rightString =null;\n\n while(leftIntervalNumber==0 || rightIntervalNumber==0){\n\n if(splitTimes==10000) {\n System.out.println(\"splitTimes=\"+splitTimes);\n System.out.println(\"you should increase the parameter leafNodeCapaity value!!!\");\n assert false;\n }\n else\n splitTimes++;\n\n leftTriangle=lnTriangle.leftTriangle();\n leftIntervalNumber=0;\n rightIntervalNumber=0;\n\n for(Interval i: intervals){\n if(Geom2DSuits.contains(leftTriangle,i.getLowerBound(),i.getUpperBound())){\n leftIntervals[leftIntervalNumber]=i;\n leftIntervalNumber++;\n }\n else{\n rightIntervals[rightIntervalNumber]=i;\n rightIntervalNumber++;\n }\n }\n\n if(leftIntervalNumber==0){//all located at left side\n rightTriangle = lnTriangle.rightTriangle();\n rightString = lnString+\"1\";\n leftString=lnString+\"0\";\n emptyNodes.add(leftString);\n lnTriangle = rightTriangle;\n lnString=rightString;\n\n tempIntervals=intervals;\n intervals=rightIntervals;\n rightIntervals=tempIntervals;\n }\n else if(rightIntervalNumber==0){//all located at right side\n rightString = lnString+\"1\";\n leftString=lnString+\"0\";\n emptyNodes.add(rightString);\n lnTriangle = leftTriangle;\n lnString=leftString;\n\n tempIntervals=intervals;\n intervals=leftIntervals;\n leftIntervals=tempIntervals;\n }\n else { //spit successfully\n\n leftString=lnString+\"0\";\n LeafNode leftNode = new LeafNode();\n leftNode.intervals=leftIntervals;\n leftNode.size=leftIntervalNumber;\n leftNode.triangle=leftTriangle;\n\n rightString = lnString+\"1\";\n LeafNode rightNode = new LeafNode();\n rightTriangle = lnTriangle.rightTriangle();\n rightNode.triangle=rightTriangle;\n rightNode.size=rightIntervalNumber;\n rightNode.intervals=rightIntervals;\n\n if(leftNode.insert(t)!=1){\n rightNode.insert(t);\n }\n\n Identifier lnPage =leafInfos.remove(ln.first());\n writeNode(leftNode,lnPage);\n Identifier rightPage = CommonSuits.createIdentifier(-1L);\n writeNode(rightNode,rightPage);\n\n leafInfos.put(leftString,lnPage);\n leafInfos.put(rightString,rightPage);\n return true;\n }\n }\n return false;\n }", "public AVLTree[] split(int x)\r\n\t {\r\n\t\t AVLTree[] splitedTrees = new AVLTree[2];\r\n\t\t splitedTrees[0] = new AVLTree();\r\n\t\t splitedTrees[1] = new AVLTree();\r\n\t\t if(!this.root.isRealNode()) \r\n\t\t\t return splitedTrees;\r\n\t\t \r\n\t\t IAVLNode nodeX = searchFor(this.root, x);\r\n\t\t splitedTrees = splitLoop(nodeX,splitedTrees);\r\n\t\t return splitedTrees;\r\n\t\t \r\n\t\t }", "public static IntStrategy maxDom_Split(IntVar... VARS) {\n return dichotomic(maxDomainSize_var_selector(), true, VARS);\n }", "private void splitHelper(double splitStartFraction, String name1, String name2) {\n\t\tthis.children = new Zone[2];\n\t\tthis.splitStartFraction = splitStartFraction;\n\t\tthis.children[0] = new Zone(this, name1);\n\t\tthis.children[1] = new Zone(this, name2);\n\t}", "public void testFindDomainBounds() {\n XYBlockRenderer renderer = new XYBlockRenderer();\n XYSeriesCollection dataset = new XYSeriesCollection();\n XYSeries series = new XYSeries(\"S1\");\n series.add(1.0, null);\n dataset.addSeries(series);\n Range r = renderer.findDomainBounds(dataset);\n dataset.removeAllSeries();\n r = renderer.findDomainBounds(dataset);\n }", "public Bounds[] subdivide() {\n return new Bounds[] {\n getSubdivision(0, 0, 0), getSubdivision(1, 0, 0), getSubdivision(0, 0, 1), getSubdivision(1, 0, 1),\n getSubdivision(0, 1, 0), getSubdivision(1, 1, 0), getSubdivision(0, 1, 1), getSubdivision(1, 1, 1)\n };\n }", "public static IntStrategy minDom_MidValue(boolean floor, IntVar... VARS) {\n return custom(minDomainSize_var_selector(), mid_value_selector(floor), VARS);\n }", "protected String maskTopLevelDomainByX(String address, int splitAddress, int splitDomain) {\n StringBuilder sb = new StringBuilder(address);\n\n ArrayList<Integer> indexes = getPointPostions(address, splitAddress);\n\n for (Integer index : indexes) {\n for (int i = splitAddress + 1; i < index; i++)\n sb.setCharAt(i, 'X');\n splitAddress = index;\n }\n return sb.toString();\n }", "public SelectorForNumber[] divide(double divider) {\n SelectorForNumber[] result = new SelectorForNumber[2];\n switch(type) {\n case ALL_VALUES: {\n result[0] = getSelLE(attributeId, divider - delta);\n result[1] = getSelGT(attributeId, divider);\n break;\n }\n case BELONGS_RIGHT_INCLUDING: {\n if (divider == lowerLimit) {\n result[0] = null;\n result[1] = this;\n }\n else {\n if (divider > lowerLimit) {\n if (divider == upperLimit) {\n result[0] = getSelBelongs(attributeId, lowerLimit, divider - delta);\n result[1] = null;\n }\n else if (divider > upperLimit) {\n result[0] = this;\n result[1] = null;\n }\n else {\n // lowerLimit < divider < upperLimit\n result[0] = getSelBelongs(attributeId, lowerLimit, divider - delta);\n result[1] = getSelBelongs(attributeId, divider, upperLimit);\n }\n }\n else {\n // divider < lowerLimit\n result[0] = null;\n result[1] = this;\n }\n }\n break;\n }\n case EQUAL: {\n if (divider == lowerLimit)\n result[0] = this;\n break;\n }\n case GREATER_THAN: {\n if (divider == lowerLimit) {\n result[0] = null;\n result[1] = this;\n }\n else if (divider > lowerLimit) {\n result[0] = getSelBelongs(attributeId, lowerLimit, divider - delta);\n result[1] = getSelGT(attributeId, divider);\n }\n // else -> divider < lowerLimit, so there's no selector to return;\n break;\n }\n case LOWER_OR_EQUAL: {\n if (divider == upperLimit) {\n result[0] = getSelLE(attributeId, divider - delta);\n result[1] = null;\n }\n else if (divider < upperLimit) {\n result[0] = getSelLE(attributeId, divider - delta);\n result[1] = getSelBelongs(attributeId, divider, upperLimit);\n } \n // else -> divider > lowerLimit, so there's no selector to return;\n break;\n }\n case NONE_VALUE: { // Nothing to return.\n break;\n }\n }\n return result;\n }", "public final AstValidator.split_clause_return split_clause() throws RecognitionException {\n AstValidator.split_clause_return retval = new AstValidator.split_clause_return();\n retval.start = input.LT(1);\n\n\n CommonTree root_0 = null;\n\n CommonTree _first_0 = null;\n CommonTree _last = null;\n\n CommonTree SPLIT403=null;\n AstValidator.rel_return rel404 =null;\n\n AstValidator.split_branch_return split_branch405 =null;\n\n AstValidator.split_otherwise_return split_otherwise406 =null;\n\n\n CommonTree SPLIT403_tree=null;\n\n try {\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:624:14: ( ^( SPLIT rel ( split_branch )+ ( split_otherwise )? ) )\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:624:16: ^( SPLIT rel ( split_branch )+ ( split_otherwise )? )\n {\n root_0 = (CommonTree)adaptor.nil();\n\n\n _last = (CommonTree)input.LT(1);\n {\n CommonTree _save_last_1 = _last;\n CommonTree _first_1 = null;\n CommonTree root_1 = (CommonTree)adaptor.nil();\n _last = (CommonTree)input.LT(1);\n SPLIT403=(CommonTree)match(input,SPLIT,FOLLOW_SPLIT_in_split_clause3322); if (state.failed) return retval;\n if ( state.backtracking==0 ) {\n SPLIT403_tree = (CommonTree)adaptor.dupNode(SPLIT403);\n\n\n root_1 = (CommonTree)adaptor.becomeRoot(SPLIT403_tree, root_1);\n }\n\n\n match(input, Token.DOWN, null); if (state.failed) return retval;\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_rel_in_split_clause3324);\n rel404=rel();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_1, rel404.getTree());\n\n\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:624:29: ( split_branch )+\n int cnt113=0;\n loop113:\n do {\n int alt113=2;\n int LA113_0 = input.LA(1);\n\n if ( (LA113_0==SPLIT_BRANCH) ) {\n alt113=1;\n }\n\n\n switch (alt113) {\n \tcase 1 :\n \t // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:624:29: split_branch\n \t {\n \t _last = (CommonTree)input.LT(1);\n \t pushFollow(FOLLOW_split_branch_in_split_clause3326);\n \t split_branch405=split_branch();\n\n \t state._fsp--;\n \t if (state.failed) return retval;\n \t if ( state.backtracking==0 ) \n \t adaptor.addChild(root_1, split_branch405.getTree());\n\n\n \t if ( state.backtracking==0 ) {\n \t }\n \t }\n \t break;\n\n \tdefault :\n \t if ( cnt113 >= 1 ) break loop113;\n \t if (state.backtracking>0) {state.failed=true; return retval;}\n EarlyExitException eee =\n new EarlyExitException(113, input);\n throw eee;\n }\n cnt113++;\n } while (true);\n\n\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:624:43: ( split_otherwise )?\n int alt114=2;\n int LA114_0 = input.LA(1);\n\n if ( (LA114_0==OTHERWISE) ) {\n alt114=1;\n }\n switch (alt114) {\n case 1 :\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:624:43: split_otherwise\n {\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_split_otherwise_in_split_clause3329);\n split_otherwise406=split_otherwise();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_1, split_otherwise406.getTree());\n\n\n if ( state.backtracking==0 ) {\n }\n }\n break;\n\n }\n\n\n match(input, Token.UP, null); if (state.failed) return retval;\n adaptor.addChild(root_0, root_1);\n _last = _save_last_1;\n }\n\n\n if ( state.backtracking==0 ) {\n }\n }\n\n if ( state.backtracking==0 ) {\n\n retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);\n }\n\n }\n\n catch(RecognitionException re) {\n throw re;\n }\n\n finally {\n \t// do for sure before leaving\n }\n return retval;\n }", "@Test\n public void testSplitDomain2() {\n System.out.println(\"splitDomain2\");\n String domain = \"example.com\";\n Map<URLParser.DomainParts, String> expResult = new HashMap<>();\n expResult.put(URLParser.DomainParts.TLD, \"com\");\n expResult.put(URLParser.DomainParts.DOMAINNAME, \"example\");\n expResult.put(URLParser.DomainParts.SUBDOMAIN, null);\n \n \n Map<URLParser.DomainParts, String> result = URLParser.splitDomain(domain);\n assertEquals(expResult, result);\n }", "public void buildInitialBand()\r\n\t{\n\t\r\n\tint bl = boundary.size();\r\n\tfor(int i=0; i<bl; i++) \r\n\t\t{\r\n\t\tInt2d bCur = boundary.get(i);\r\n\t\t//System.out.println(bCur.x + \", \" + bCur.y + \": size = \" + heap.size());\r\n\t\t\r\n\t\ttestPointsAround(bCur.x,bCur.y);\r\n\t\t}\r\n\t\r\n\t}", "public static PredicateSplit splitPredicate(ScalarOperator predicate) {\n if (predicate == null) {\n return PredicateSplit.of(null, null, null);\n }\n List<ScalarOperator> rangePredicates = Lists.newArrayList();\n RangeExtractor extractor = new RangeExtractor();\n Map<ColumnRefOperator, TreeRangeSet<ConstantOperator>> rangeSet =\n predicate.accept(extractor, new RangeExtractorContext());\n if (rangeSet != null) {\n rangeSet.forEach((column, range) -> rangePredicates.add(rangeSetToExpr(range, column)));\n } else if (extractor.columnEqualityPredicates.isEmpty() && extractor.residualPredicates.isEmpty()) {\n extractor.residualPredicates.add(predicate);\n }\n return PredicateSplit.of(Utils.compoundAnd(extractor.columnEqualityPredicates), Utils.compoundAnd(rangePredicates),\n Utils.compoundAnd(extractor.residualPredicates));\n }", "P getSplitPoint();", "abstract Node split();", "abstract Node split();", "int getSplitAxis();", "public void boundsLex(int [] a , IntDomainVar [] x , int [] b,int j) throws ContradictionException{\n\n int i =0;\n\n\n while( i< n && a[i]==b[i]){\n\n\n if((x[i].getInf()==a[i] || x[i].updateInf(a[i], this, false)) &&\n (x[i].getSup()==b[i] || x[i].updateSup(b[i], this, false))){\n i++;\n }else{\n this.fail();\n }\n\n }\n\n\n if(i<n )\n if ((x[i].getInf()==a[i] || x[i].updateInf(a[i], this, false)) &&\n (x[i].getSup()==b[i] || x[i].updateSup(b[i], this, false))){\n }else{\n this.fail();\n }\n\n\n if(i==n || x[i].getNextDomainValue(a[i])<b[i]){\n return ;\n }\n\n i+=1;\n\n while(i<n && (b[i]+1 <= a[i]-1) && x[i].getInf()==b[i] && x[i].getSup()==a[i]){\n if(x[i].removeInterval(b[i]+1,a[i]-1, this, false)){\n i++;\n }else{\n this.fail();\n\n }\n }\n\n if(i<n) {\n if (b[i] + 1 <= a[i] - 1 && x[i].getInf() <= b[i] &&\n b[i] <= x[i].getSup() && x[i].getSup() >= a[i] && a[i] >= x[i].getInf()) {\n if (!x[i].removeInterval(b[i] + 1, a[i] - 1, this, false)) {\n this.fail();\n }\n }\n }\n\n }", "public abstract int getMinimumDividerLocation(JSplitPane jc);", "void split(Node n,Stack<Long> nodes);", "@Test(timeout = 4000)\n public void test034() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.SPACE_BASED;\n Range range0 = Range.of(range_CoordinateSystem0, 2127L, 2127L);\n List<Range> list0 = range0.split(1L);\n List<Range> list1 = range0.complementFrom(list0);\n assertFalse(list1.isEmpty());\n \n range0.getBegin(range_CoordinateSystem0);\n range0.equals(range_CoordinateSystem0);\n long long0 = range0.getBegin(range_CoordinateSystem0);\n assertTrue(range0.isEmpty());\n assertEquals(2127L, long0);\n }", "public double getDomainMin1() throws IllegalStateException {\n\treturn -Double.MAX_VALUE;\n }", "@Test\n public void testSplitDomain3() {\n System.out.println(\"splitDomain3\");\n String domain = \"www.example.com\";\n Map<URLParser.DomainParts, String> expResult = new HashMap<>();\n expResult.put(URLParser.DomainParts.TLD, \"com\");\n expResult.put(URLParser.DomainParts.DOMAINNAME, \"example\");\n expResult.put(URLParser.DomainParts.SUBDOMAIN, \"www\");\n \n \n Map<URLParser.DomainParts, String> result = URLParser.splitDomain(domain);\n assertEquals(expResult, result);\n }", "@Test\n public void testSplitDomain1() {\n System.out.println(\"splitDomain1\");\n String domain = \"www.cars.example.co.uk\";\n Map<URLParser.DomainParts, String> expResult = new HashMap<>();\n expResult.put(URLParser.DomainParts.TLD, \"co.uk\");\n expResult.put(URLParser.DomainParts.DOMAINNAME, \"example\");\n expResult.put(URLParser.DomainParts.SUBDOMAIN, \"www.cars\");\n \n \n Map<URLParser.DomainParts, String> result = URLParser.splitDomain(domain);\n assertEquals(expResult, result);\n }", "R visitBoundVariable(Formula f, int deBruijnIdx);", "public AVLTree[] split(int x) {\n\t\tAVLNode root = (AVLNode) this.root;\n\t\tAVLNode node = root.delFindNode(x);\n\t\tAVLTree leftTree = new AVLTree(node.getLeft());\n\t\tAVLTree rightTree = new AVLTree(node.getRight());\n\t\tAVLNode pivot = (AVLNode) node.getParent();\n\t\twhile (pivot != null) {\n\t\t\tchar side = node.parentSide();\n\t\t\tif (side == 'L') {\n\t\t\t\tleftTree.join(pivot, new AVLTree(pivot.getLeft()));\n\t\t\t} else {// if side =='R'\n\t\t\t\trightTree.join(pivot, new AVLTree(pivot.getRight()));\n\n\t\t\t}\n\t\t\tnode = pivot;\n\t\t\tif (!pivot.checkRoot()) {\n\t\t\t\tpivot = (AVLNode) pivot.getParent();\n\t\t\t} else {\n\t\t\t\tpivot = null;\n\t\t\t}\n\t\t}\n\n\t\tAVLTree[] arrAVL = new AVLTree[2];\n\t\tarrAVL[0] = leftTree;\n\t\tarrAVL[1] = rightTree;\n\n\t\treturn arrAVL;\n\t}", "@Test(timeout = 4000)\n public void test02() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.ZERO_BASED;\n Range range0 = Range.of(range_CoordinateSystem0, 0L, 4294967295L);\n range0.getBegin();\n // Undeclared exception!\n try { \n range0.split(0L);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // max splitLength must be >= 1\n //\n verifyException(\"org.jcvi.jillion.core.Range\", e);\n }\n }", "public interface AxisSplitter<P> {\n\t/**\n\t * Given the a set of points, select the axis to split the data along and select a point to divide the data.\n\t * Points whput items below the threshold\n\t * into left and above into right. Data is optional and should be ignored if null. The selected\n\t *\n\t * @param points Input: Set of points.\n\t * @param indexes Input: (Optional) Option index asssociated with points. Can be null.\n\t * @param left Output: Storage for points less than the split point.\n\t * @param leftIndexes Output: (Optional) Storage for indexes associated with left. Can be null.\n\t * @param right Output: Storage for points more than the split point.\n\t * @param righrIndexes Output: (Optional) Storage for indexes associated with right. Can be null.\n\t */\n\tvoid splitData( List<P> points , @Nullable GrowQueue_I32 indexes ,\n\t\t\t\t\tList<P> left , @Nullable GrowQueue_I32 leftIndexes ,\n\t\t\t\t\tList<P> right , @Nullable GrowQueue_I32 righrIndexes );\n\n\t/**\n\t * Returns the point used to split the data\n\t */\n\tP getSplitPoint();\n\n\t/**\n\t * Index associated with the split point\n\t */\n\tint getSplitIndex();\n\n\t/**\n\t * The axis/dimension that the input list was split on\n\t */\n\tint getSplitAxis();\n\n\t/**\n\t * Number of elements in a point\n\t */\n\tint getPointLength();\n}", "private void splitLevels() {\n\t\tint first = 0;\n\t\tfor(int i = 1; i<allCoords.size(); i++) {\n\t\t\tif (allCoords.get(i).z != allCoords.get(i-1).z) {\n\t\t\t\tfor(int j=first; j<i; j++) {\n\t\t\t\t\tcurrentLevel.add(allCoords.get(j));\n\t\t\t\t}\n\t\t\t\tsplitIntoRoots(); // automatically splits the cross section into roots\n\t\t\t\tcurrentLevel.clear();\n\t\t\t\tfirst = i;\n\t\t\t}\n\t\t}\n\t}", "private void splitIntoRoots() {\n\t\tArrayList<ArrayList<Coord>> circ = findCircles();\n\t\tcombinePastRoots(circ);\n\t}", "public static DecisionOperator<IntVar> split() {\n return DecisionOperator.int_split;\n }", "public final AstValidator.split_statement_return split_statement() throws RecognitionException {\n AstValidator.split_statement_return retval = new AstValidator.split_statement_return();\n retval.start = input.LT(1);\n\n\n CommonTree root_0 = null;\n\n CommonTree _first_0 = null;\n CommonTree _last = null;\n\n AstValidator.split_clause_return split_clause8 =null;\n\n\n\n try {\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:123:17: ( split_clause )\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:123:19: split_clause\n {\n root_0 = (CommonTree)adaptor.nil();\n\n\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_split_clause_in_split_statement159);\n split_clause8=split_clause();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_0, split_clause8.getTree());\n\n\n if ( state.backtracking==0 ) {\n }\n }\n\n if ( state.backtracking==0 ) {\n\n retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);\n }\n\n }\n\n catch(RecognitionException re) {\n throw re;\n }\n\n finally {\n \t// do for sure before leaving\n }\n return retval;\n }", "public abstract int getDividerLocation(JSplitPane jc);", "public IDomain[] getDomainComponents();", "public static int[] makeBeforeInterval(ArrayList<Firm> list)\n\t{\n\t\tint dis = 1;\n\t\tint first = 0;\n\t\t\n\t\tint dis2 = 120;\t\t\n\t\tint last = 0;\n\t\t\n\t\tint years = (int)((float)(2*366));\n\t\tint quarter = 92; // # days in a qtr\n\t\t\n\t\tInteger filed = (Integer)(utils.qM2.get(list.get(0).getBankrupcy().get(0).filedIndex - quarter));\n\t\tInteger beforeFiled = (Integer)(utils.qM2.get(list.get(0).getBankrupcy().get(0).filedIndex - years));\n\n\t\tif(filed != null &&\n\t\t beforeFiled != null){\n\t\t\tlast = filed;\n\t\t\tfirst = beforeFiled;\n\t\t} else {\n\t\t\tlast = dis2;\n\t\t\tfirst = dis2 - years;\n\t\t}\t\t\n\t\t\n\t\tint mid = (first+last)/2;\n\t\tint[] x = new int[3];\n\t\tx[0]=first;\n\t\tx[1]=mid;\n\t\tx[2]=last;\t\t\n\t\treturn x;\t\n\t}", "@Test(timeout = 4000)\n public void test105() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.RESIDUE_BASED;\n Range range0 = Range.of(range_CoordinateSystem0, 9223372032559808509L, 9223372036854775806L);\n // Undeclared exception!\n try { \n range0.split((-797L));\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // max splitLength must be >= 1\n //\n verifyException(\"org.jcvi.jillion.core.Range\", e);\n }\n }", "double[] getSplitRatios();", "private void split(){\n // Slice horizontaly to get sub nodes width\n float subWidth = this.getBounds().width / 2;\n // Slice vertically to get sub nodes height\n float subHeight = this.getBounds().height / 2;\n float x = this.getBounds().x;\n float y = this.getBounds().y;\n int newLevel = this.level + 1;\n\n // Create the 4 nodes\n this.getNodes().add(0, new QuadTree(newLevel, new Rectangle(x + subWidth, y, subWidth, subHeight)));\n this.getNodes().add(1, new QuadTree(newLevel, new Rectangle(x, y, subWidth, subHeight)));\n this.getNodes().add(2, new QuadTree(newLevel, new Rectangle(x, y + subHeight, subWidth, subHeight)));\n this.getNodes().add(3, new QuadTree(newLevel, new Rectangle(x + subWidth, y + subHeight, subWidth, subHeight)));\n\n }", "private static List<Integer> getSplitBeginIndexes(TimeSeries series, Duration splitDuration) {\n ArrayList<Integer> beginIndexes = new ArrayList<>();\n\n int beginIndex = series.getBeginIndex();\n int endIndex = series.getEndIndex();\n \n // Adding the first begin index\n beginIndexes.add(beginIndex);\n\n // Building the first interval before next split\n ZonedDateTime beginInterval = series.getFirstBar().getEndTime();\n ZonedDateTime endInterval = beginInterval.plus(splitDuration);\n\n for (int i = beginIndex; i <= endIndex; i++) {\n // For each tick...\n ZonedDateTime tickTime = series.getBar(i).getEndTime();\n if (tickTime.isBefore(beginInterval) || !tickTime.isBefore(endInterval)) {\n // Tick out of the interval\n if (!endInterval.isAfter(tickTime)) {\n // Tick after the interval\n // --> Adding a new begin index\n beginIndexes.add(i);\n }\n\n // Building the new interval before next split\n beginInterval = endInterval.isBefore(tickTime) ? tickTime : endInterval;\n endInterval = beginInterval.plus(splitDuration);\n }\n }\n return beginIndexes;\n }", "@Override\n public Map<Boolean, Sort> split2 (int delim) {\n int subcl = 0, offset=0;//index of the non-single-values sub-intv, and marker offset\n if (isSplit()) //the class is partitioned in subclasses\n for (int j =0; j < this.constraints.length; j++) //we seek the non-single-values sub-intv\n if (this.constraints[j].singleValue()) \n offset += this.constraints[j].lb();\n else \n subcl = j;\n \n return split2(delim - offset, subcl + 1);\n }", "HasValue<String> getMiddleInitial();", "AssignmentPathSegment beforeLast(int n);", "@Test(timeout = 4000)\n public void test12() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.RESIDUE_BASED;\n Range.of(range_CoordinateSystem0, 0L, 4294967295L);\n Range range0 = Range.of(range_CoordinateSystem0, (-1241L), 848L);\n // Undeclared exception!\n try { \n range0.split(0L);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // max splitLength must be >= 1\n //\n verifyException(\"org.jcvi.jillion.core.Range\", e);\n }\n }", "public double getDomainMin2() throws IllegalStateException {\n\treturn -Double.MAX_VALUE;\n }", "public static Zone getZoneLeft(int x, int y){\n\n int posY;\n\n if (y ==0){\n posY = N -1;\n }else {\n posY = y-1;\n }\n\n return zone[x][posY];\n\n }", "private Bounds getSubdivision(int x, int y, int z) {\n final int xStep = (maxX - minX + 1) / 2;\n final int yStep = (maxY - minY + 1) / 2;\n final int zStep = (maxZ - minZ + 1) / 2;\n final int newMinX = minX + xStep * x;\n final int newMinY = minY + yStep * y;\n final int newMinZ = minZ + zStep * z;\n return new Bounds(newMinX, newMinY, newMinZ, newMinX + xStep, newMinY + yStep, newMinZ + zStep);\n }", "String getBeginSplited();", "Node split() {\r\n LeafNode Sibling = new LeafNode();\r\n int index = (branchingFactor + 1) / 2;\r\n int to = key_num();\r\n Sibling.keys.addAll(keys.subList(index, to));\r\n Sibling.values.addAll(values.subList(index, to));\r\n\r\n keys.subList(index, to).clear();\r\n values.subList(index, to).clear();\r\n\r\n\r\n // to make connections between the old node and the new node\r\n Sibling.next = next;\r\n Sibling.previous = this;\r\n // the current's next may be null so to check on that\r\n if (next != null) {\r\n next.previous = Sibling;\r\n }\r\n next = Sibling;\r\n\r\n return Sibling;\r\n }", "public abstract double[] getLowerBound();", "@Test(timeout = 4000)\n public void test028() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.SPACE_BASED;\n Range range0 = Range.of(range_CoordinateSystem0, 2147483647L, 2147483647L);\n range0.toString();\n Object object0 = new Object();\n range0.getBegin();\n Object object1 = new Object();\n range0.split(2147483647L);\n range0.equals(object1);\n range0.getEnd();\n Range.CoordinateSystem[] range_CoordinateSystemArray0 = Range.CoordinateSystem.values();\n assertEquals(3, range_CoordinateSystemArray0.length);\n }", "private int findTreeNodeLeftBoundary(RSTTreeNode node)\n {\n // recursive call for children (if applicable)\n if (node instanceof DiscourseRelation) {\n return findTreeNodeLeftBoundary(((DiscourseRelation) node).getArg1());\n }\n\n // it's EDU\n return node.getBegin();\n }", "private static List<TimeSeries> splitSeries(TimeSeries series, Duration splitDuration, Duration sliceDuration) {\n ArrayList<TimeSeries> subseries = new ArrayList<>();\n if (splitDuration != null && !splitDuration.isZero() && \n sliceDuration != null && !sliceDuration.isZero()) {\n\n List<Integer> beginIndexes = getSplitBeginIndexes(series, splitDuration);\n beginIndexes.forEach((subseriesBegin) -> {\n subseries.add(subseries(series, subseriesBegin, sliceDuration));\n });\n }\n return subseries;\n }", "public static int findSplitR(int [] sortedMortonCodes, int first, int end)\n {\n int left = first;\n int right = end;\n \n // Calculate the number of identical bits from higher end\n int num_identical = delta(sortedMortonCodes, left, right);\n \n System.out.println(num_identical);\n \n do\n {\n // Proposed split\n int new_split = (right + left) / 2;\n\n // If it has more equal leading bits than left and right accept it\n if (delta(sortedMortonCodes, left, new_split) > num_identical) \n left = new_split; \n else \n right = new_split; \n }\n while (right > left + 1);\n \n return left;\n }", "public Segments(Point[] points) { //1 slopeTo\n double slope = points[points.length - 1].slopeTo(points[0]);\n if (Double.compare(slope ,0) < 0) {\n left = points[points.length - 1];\n right = points[0];\n } else { //>=\n right = points[points.length - 1];\n left = points[0];\n }\n }", "@Test\n\tpublic void testStartingIndicesRegression(){\n\t\tassertLeftmostStartingIndices(\"5,1,7,3,2|-..xxx$1..x...xxx$3....-xx........\", 0, 6, 8, 18, 22);\n\t\tassertRightmostStartingIndices(\"7,5|.......xxx$1....xxx$2..-\", 6, 14);\n\t\t\n\t}", "private void splitState( State state, int i, State split, List<State> result)\n {\n if ( split == null)\n {\n State v1 = copy( state);\n v1.stackOps[ i] = nullShift;\n result.add( v1);\n }\n \n State v2 = copy( state);\n v2.stackOps[ i-1] = nullShift;\n result.add( v2);\n }", "public void includeDomainInRangeCalculator(IntegerRangeCalculator i)\r\n\t{\r\n\t\ti.include(start);\r\n\t\tif(data.length>0) i.include(start+data.length-1);\r\n\t}", "public final AstValidator.split_branch_return split_branch() throws RecognitionException {\n AstValidator.split_branch_return retval = new AstValidator.split_branch_return();\n retval.start = input.LT(1);\n\n\n CommonTree root_0 = null;\n\n CommonTree _first_0 = null;\n CommonTree _last = null;\n\n CommonTree SPLIT_BRANCH407=null;\n AstValidator.alias_return alias408 =null;\n\n AstValidator.cond_return cond409 =null;\n\n\n CommonTree SPLIT_BRANCH407_tree=null;\n\n try {\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:628:2: ( ^( SPLIT_BRANCH alias cond ) )\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:628:4: ^( SPLIT_BRANCH alias cond )\n {\n root_0 = (CommonTree)adaptor.nil();\n\n\n _last = (CommonTree)input.LT(1);\n {\n CommonTree _save_last_1 = _last;\n CommonTree _first_1 = null;\n CommonTree root_1 = (CommonTree)adaptor.nil();\n _last = (CommonTree)input.LT(1);\n SPLIT_BRANCH407=(CommonTree)match(input,SPLIT_BRANCH,FOLLOW_SPLIT_BRANCH_in_split_branch3344); if (state.failed) return retval;\n if ( state.backtracking==0 ) {\n SPLIT_BRANCH407_tree = (CommonTree)adaptor.dupNode(SPLIT_BRANCH407);\n\n\n root_1 = (CommonTree)adaptor.becomeRoot(SPLIT_BRANCH407_tree, root_1);\n }\n\n\n match(input, Token.DOWN, null); if (state.failed) return retval;\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_alias_in_split_branch3346);\n alias408=alias();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_1, alias408.getTree());\n\n\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_cond_in_split_branch3348);\n cond409=cond();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_1, cond409.getTree());\n\n\n match(input, Token.UP, null); if (state.failed) return retval;\n adaptor.addChild(root_0, root_1);\n _last = _save_last_1;\n }\n\n\n if ( state.backtracking==0 ) {\n aliases.add( (alias408!=null?alias408.name:null) );\n }\n\n if ( state.backtracking==0 ) {\n }\n }\n\n if ( state.backtracking==0 ) {\n\n retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);\n }\n\n }\n\n catch(RecognitionException re) {\n throw re;\n }\n\n finally {\n \t// do for sure before leaving\n }\n return retval;\n }", "public interface ISplitter {\n\t\n\t/**\n\t * Metodo para obtener la tupla de registros base de los nuevos nodos que se crearan.\n\t * @param registers Lista de registros de las que se obtendra la tupla.\n\t * @return Tupla de registros bases para los nuevos nodos.\n\t */\n RegisterTuple pickSeeds(ArrayList<Register> registers);\n \n /**\n * Selecciona el proximo registro que se eligira desde la lista de registros.\n * @param n Nuevo Nodo donde se repartiran los registros.\n * @param nn Nuevo Nodo donde se repartiran los registros.\n * @param registers Lista con registros.\n * @return\n */\n Register pickNext(Node n, Node nn, ArrayList<Register> registers);\n \n /**\n * Metodo para hacer split de un Nodo.\n * @param n Nodo en el que se hara split.\n * @param nodes Stack con nodos por actualizar.\n */\n void split(Node n,Stack<Long> nodes);\n}", "public void testBug1766646A() {\n XYBlockRenderer r = new XYBlockRenderer();\n Range range = r.findDomainBounds(null);\n DefaultXYZDataset emptyDataset = new DefaultXYZDataset();\n range = r.findDomainBounds(emptyDataset);\n }", "public static double[] bracket(UnivariateFunction function, double initial, double lowerBound, double upperBound)\r\n/* 88: */ {\r\n/* 89:207 */ return bracket(function, initial, lowerBound, upperBound, 2147483647);\r\n/* 90: */ }", "public abstract int getMaximumDividerLocation(JSplitPane jc);", "public line subDivide(MyTreeNode n, line l){\r\n line t = n.data; //store the line\r\n while (true){ //while we still can\r\n if(n.leftChild == null && n.rightChild == null){\r\n break; //break when there is nowhere left to go\r\n }\r\n //should just check if point is invalid, why did I do this?\r\n else if(n.leftChild == null && Geometry.endTest(n.data, n.rightChild.data).equals(new point(-10,-10))){ //if the left child is null, and the point isn't valid\r\n break;\r\n }\r\n else if(n.rightChild == null && Geometry.endTest(n.data, n.leftChild.data).equals(new point(-10,-10))){ //right child null point isn't valid\r\n break;\r\n }\r\n else if(n.leftChild == null){ //if the left child is null jsut check the right\r\n point temp = Geometry.endTest(n.data, n.rightChild.data);\r\n if (!(Geometry.intersect(new line (n.data.start, temp), l).equals(new point(-10,-10)))){\r\n t = new line(n.data.start, temp);\r\n }\r\n else{\r\n t = new line(temp, n.data.end);\r\n }\r\n n = n.rightChild;\r\n }\r\n\r\n else if(n.rightChild == null){ //if the right is null just check the left\r\n point temp = Geometry.endTest(n.data, n.leftChild.data);\r\n if (!(Geometry.intersect(new line (n.data.start, temp), l).equals(new point(-10,-10)))){\r\n t = new line(n.data.start, temp);\r\n }\r\n else{\r\n t = new line(temp, n.data.end);\r\n }\r\n n = n.leftChild;\r\n }\r\n //Should update else to allow for both children to be checked w/o the continue...\r\n else{ //otherwise check them both\r\n point temp = Geometry.endTest(n.data, n.leftChild.data); //find the point of intsection between the line and its children\r\n point rtemp = Geometry.endTest(n.data, n.rightChild.data);\r\n if (!(temp.equals(new point (-10, -10)))){ //if not an invalid point, check left child possibilities\r\n if (!(Geometry.intersect(new line (n.data.start, temp), l).equals(new point(-10,-10)))){\r\n t = new line(n.data.start, temp);\r\n n = n.leftChild;\r\n continue;\r\n }\r\n else if (!(Geometry.intersect(new line (n.data.end, temp), l).equals(new point(-10,-10)))){\r\n t = new line(n.data.end, temp);\r\n n = n.leftChild;\r\n continue;\r\n }\r\n }\r\n if (!(rtemp.equals(new point (-10, -10)))){//if not an invalid point, check right child\r\n if (!(Geometry.intersect(new line (n.data.start, rtemp), l).equals(new point(-10,-10)))){\r\n t = new line(n.data.start, rtemp);\r\n n = n.rightChild;\r\n continue;\r\n }\r\n else if (!(Geometry.intersect(new line (n.data.end, rtemp), l).equals(new point(-10,-10)))){\r\n t = new line(n.data.end, rtemp);\r\n n = n.rightChild;\r\n continue;\r\n }\r\n\r\n break; //so this also should never really be hit, but when it is it is because of (as far as I could tell) rounding errors in the math.\r\n }\r\n else{\r\n System.out.println(\"This line cannot be broken down more, due to issues with the mathematcal rounding\");\r\n return t;\r\n }\r\n }\r\n }\r\n return t;\r\n }", "static String getNextDomain(String curDomain) {\n String nextDomain;\n\n int idxCheckedChar = curDomain.length() - 1; // right most character\n char checkedCh;\n\n while (idxCheckedChar >= 0) { // to the first character\n checkedCh = curDomain.charAt(idxCheckedChar);\n if (checkedCh < 'z') { //\n nextDomain = curDomain.substring(0, idxCheckedChar) + (char) (checkedCh + 1)\n + curDomain.substring(idxCheckedChar + 1);\n return nextDomain;\n } else { // last character reaches to 'z'\n // check the left side character\n idxCheckedChar--;\n }\n }\n nextDomain = curDomain + 'a';\n\n return nextDomain;\n }", "public static double[][] sliceEquidist(double[] start, double[] end, int snum){\n\t\t//don't do anything with improper aguments\n\t\tif(start==null || end==null || snum<=1 || start.length==0 || end.length==0)\n\t\t\treturn null;\n\t\t//create \"divisor\" vector\n\t\tint m = start.length;\n\t\tdouble[] div = new double[m];\n\t\tdouble divlen=0.0;\n\t\tfor(int i=0; i<m; i++){\n\t\t\tdiv[i] = (end[i] - start[i])/(double)snum;\n\t\t\tdivlen += (div[i]*div[i]);\n\t\t}\n\t\t//don't do anything if the divisor has only zero entries\n\t\tif(divlen==0.0) return null;\n\n\t\tdouble[][] ret = new double[snum-1][m];\n\t\tfor(int i=0; i<snum-1; i++){\n\t\t\tfor(int j=0; j<m; j++){\n\t\t\t\tret[i][j] = start[j] + (double)(i+1) * div[j];\n\t\t\t}//next j\n\t\t}//next i\n\n\t\treturn ret;\n\t}", "private String reassemble(int start, String[] split)\n {\n int count = split.length - start;\n\n if (count == 0)\n return null;\n\n if (count == 1)\n return split[split.length - 1];\n\n StringBuffer buffer = new StringBuffer();\n\n for (int i = start; i < split.length; i++)\n {\n if (i > start)\n buffer.append('.');\n\n buffer.append(split[i]);\n }\n\n return buffer.toString();\n }", "public abstract void split(Space s);", "private DataStructure copyAndCut (int min, int max, boolean axis){\r\n\t\tDataStructure newDS = new DataStructure();\r\n\t\tPoint[] regAxis = getPointsInRangeRegAxis(min, max, axis); //O(n)\r\n\t\tPoint[] oppAxis = getPointsInRangeOppAxis(min, max, axis); //O(n)\r\n\t\t\r\n\t\tfor(int i=0; i<regAxis.length ; i++)\r\n\t\t\tnewDS.naiveAddLast(regAxis[i], axis); //O(1) * n times\r\n\t\t\r\n\t\tfor(int i=0; i<oppAxis.length ; i++)\r\n\t\t\tnewDS.naiveAddLast(oppAxis[i], !axis); //O(1) * n times\r\n\t\t\r\n\t\treturn newDS;\r\n\t}", "protected final void setLeft(IntervalNode x) {\n\tthis.left = x;\n\n\t// recalc max and min\n\tsetMax();\n\tsetMin();\n }", "@Override\n public SplitResult<ByteKeyRange> trySplit(double fractionOfRemainder) {\n if (NO_KEYS.equals(range)\n || (!range.getEndKey().isEmpty() && range.getStartKey().equals(range.getEndKey()))) {\n return null;\n }\n // There is no more remaining work after the entire range has been claimed.\n if (lastAttemptedKey != null && lastAttemptedKey.isEmpty()) {\n return null;\n }\n\n ByteKey unprocessedRangeStartKey =\n (lastAttemptedKey == null) ? range.getStartKey() : next(lastAttemptedKey);\n ByteKey endKey = range.getEndKey();\n // There is no more space for split.\n if (!endKey.isEmpty() && unprocessedRangeStartKey.compareTo(endKey) >= 0) {\n return null;\n }\n\n // Treat checkpoint specially because {@link ByteKeyRange#interpolateKey} computes a key with\n // trailing zeros when fraction is 0.\n if (fractionOfRemainder == 0.0) {\n // If we haven't done any work, we should return the original range we were processing\n // as the checkpoint.\n if (lastAttemptedKey == null) {\n // We update our current range to an interval that contains no elements.\n ByteKeyRange rval = range;\n range =\n range.getStartKey().isEmpty()\n ? NO_KEYS\n : ByteKeyRange.of(range.getStartKey(), range.getStartKey());\n return SplitResult.of(range, rval);\n } else {\n range = ByteKeyRange.of(range.getStartKey(), unprocessedRangeStartKey);\n return SplitResult.of(range, ByteKeyRange.of(unprocessedRangeStartKey, endKey));\n }\n }\n\n ByteKeyRange unprocessedRange = ByteKeyRange.of(unprocessedRangeStartKey, range.getEndKey());\n ByteKey splitPos;\n try {\n // The interpolateKey shouldn't return empty key. Please refer to {@link\n // ByteKeyRange#interpolateKey}.\n splitPos = unprocessedRange.interpolateKey(fractionOfRemainder);\n checkState(!splitPos.isEmpty());\n } catch (Exception e) {\n // There is no way to interpolate a key based on provided fraction.\n return null;\n }\n // Computed splitPos is out of current tracking restriction.\n if (!range.getEndKey().isEmpty() && splitPos.compareTo(range.getEndKey()) >= 0) {\n return null;\n }\n\n range = ByteKeyRange.of(range.getStartKey(), splitPos);\n return SplitResult.of(range, ByteKeyRange.of(splitPos, endKey));\n }", "public void splitExpression(String expression, String op) {\n operator = new arithmetic_op(op);\n expression = expression.trim();\n int index = expression.indexOf(op);\n left = new arithmetic_ex((expression.substring(0, index)).trim());\n right = new arithmetic_ex((expression.substring(index + 1)).trim());\n }", "IMotion splice(int splitTickStart, int splitTickEnd);", "public static Interval division(Interval in1, Interval in2){\r\n if(in2.getSecondExtreme()==0.0||in2.getFirstExtreme()==0.0){\r\n System.out.println(\"División por cero!\");\r\n System.exit(1);\r\n return new Interval();\r\n }else{\r\n return new Interval(in1.getFirstExtreme()/in2.getSecondExtreme(),in1.getSecondExtreme()/in2.getFirstExtreme(),in1.getFEincluded()=='['&&in2.getSEincluded()==']'?in1.getFEincluded():'(',in1.getSEincluded()==']'&&in2.getFEincluded()=='['?in1.getSEincluded():')');\r\n }\r\n }", "private void splitArrayB() {\r\n //find upper bound. anything below goes within.\r\n //calculate highest A, loop through b til above that, then iterate b index til at end of b\r\n int a_count = 0;\r\n int b_count = 0;\r\n int highA = A[splitA[a_count]];\r\n boolean first = true;\r\n for(int i = 0; i < B.length; i++){\r\n if(highA >= B[i]){\r\n first = false;\r\n }\r\n else if(highA < B[i]){\r\n if(first == false){\r\n splitB[b_count] = i - 1;\r\n b_count++;\r\n highA = A[splitA[a_count]];\r\n a_count++;\r\n }\r\n else{\r\n while(a_count != splitA.length){\r\n if(highA < B[i]){\r\n splitB[b_count] = - 1;\r\n b_count++;\r\n a_count++;\r\n highA = A[splitA[a_count]];\r\n }\r\n else{\r\n splitB[b_count] = i;\r\n b_count++;\r\n a_count++;\r\n highA = A[splitA[a_count]];\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if(b_count != splitB.length){\r\n splitB[b_count] = splitB.length - 1;\r\n b_count++;\r\n while(b_count < splitB.length){\r\n splitB[b_count] = -1;\r\n b_count++;\r\n }\r\n return;\r\n }\r\n splitB[b_count - 1] = b_count - 1;\r\n }", "void splitData( List<P> points , @Nullable GrowQueue_I32 indexes ,\n\t\t\t\t\tList<P> left , @Nullable GrowQueue_I32 leftIndexes ,\n\t\t\t\t\tList<P> right , @Nullable GrowQueue_I32 righrIndexes );", "private static void workDown(Record[] theArray, int initial, int end, int field){\r\n\r\n\t\tint root = initial;\r\n\r\n\t\twhile(((root * 2) + 1) <= end) //keep going condition\r\n\t\t{\r\n\t\t\tint child = (root * 2) + 1; //location\r\n\t\t\t//conditional check\r\n\r\n\t\t\tif((child + 1) <= end && (theArray[child].getData()[field].compareTo(theArray[child + 1].getData()[field]) < 0)) //smaller than\r\n\t\t\t\tchild = child + 1; // point right\r\n\r\n\t\t\tif(theArray[root].getData()[field].compareTo(theArray[child].getData()[field]) < 0){ //smaller than\r\n\t\t\t\tRecord ghostTwo = theArray[root];\r\n\t\t\t\ttheArray[root] = theArray[child];\r\n\t\t\t\ttheArray[child] = ghostTwo;\r\n\t\t\t\troot = child; //continue with child\r\n\t\t\t}else\r\n\r\n\t\t\t\treturn;\r\n\t\t}\r\n\t}", "double getLeft(double min);", "public void split()\r\n\t\t{\r\n\t\t\t/*\r\n\t\t\tThe splitting is performed as follows:\r\n\t\t\ta single median is chosen from among the leaf's elements and the new element.\r\n\t\t\tThe values less than the median are put in the new left node\r\n\t\t\tand the values greater than the median are put in the new right node,\r\n\t\t\twith the median acting as a separation value.\r\n\t\t\t */\r\n\t\t\tTreeNode lNode = new TreeNode(); //new left node\r\n\t\t\tlNode.insertData(popData()); //insert the two left values to the left node\r\n\t\t\t//lNode.insertData(popData());\r\n\t\t\tData tempData = popData(); //hold the middle value for later\r\n\t\t\tTreeNode rNode = new TreeNode(); //new right node\r\n\t\t\trNode.insertData(popData()); //insert the two right values to the right node\r\n\t\t\t//rNode.insertData(popData());\r\n\t\t\tthis.insertData(tempData);\r\n\r\n\t\t\tTreeNode holdLT = tempData.getLT(); //hold the current node's Less Than pointer\r\n\t\t\tTreeNode holdGT = tempData.getGT(); //hold the current node's Greater Than pointer\r\n\t\t\ttempData.setLT(lNode); //set the Less Than pointer to our new less node\r\n\t\t\ttempData.setGT(rNode); //set the Greater Than pointer to our new greater node\r\n\r\n\t\t\tif (holdLT != null) //if the previous LT was not null then re-insert the data\r\n\t\t\t{\r\n\t\t\t\tData fillLeft = holdLT.popData();\r\n\t\t\t\twhile (fillLeft != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tlNode.insert(fillLeft);\r\n\t\t\t\t\tfillLeft = holdLT.popData();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (holdGT != null) //if the previous GT was not null then re-insert the data\r\n\t\t\t{\r\n\t\t\t\tData fillRight = holdGT.popData();\r\n\t\t\t\twhile (fillRight != null)\r\n\t\t\t\t{\r\n\t\t\t\t\trNode.insert(fillRight);\r\n\t\t\t\t\tfillRight = holdGT.popData();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "private Set<Variable> extractBlockedDomainVars(Variable rangeVariable, ImmutableSet<Variable> domainVariables,\n ImmutableSet<Variable> aggregationVariables) {\n if (aggregationVariables.contains(rangeVariable))\n return domainVariables;\n\n Sets.SetView<Variable> aggregationDomainVariables = Sets.intersection(domainVariables, aggregationVariables);\n\n // Equalities from an aggregation variable to a grouping variable are blocked\n if (groupingVariables.contains(rangeVariable))\n return aggregationDomainVariables;\n\n // Fresh variables: need at least one variable to become projected\n // the latter may be an aggregation variable if there is no grouping variable\n Variable dominantVariable = aggregationDomainVariables.stream()\n .findAny()\n .orElseGet(() -> domainVariables.iterator().next());\n\n return Sets.difference(aggregationDomainVariables, ImmutableSet.of(dominantVariable));\n }", "public static IntValueSelector mid_value_selector(boolean floor) {\n return new IntDomainMiddle(floor);\n }", "private ArrayList<Integer> fillDomain() {\n ArrayList<Integer> elements = new ArrayList<>();\n\n for (int i = 1; i <= 10; i++) {\n elements.add(i);\n }\n\n return elements;\n }", "public double slice(polyfun.Polynomial poly, double sleft, double sright) {\n\t\tdouble areatrapslice = (sright-sleft)*((PolyPractice.eval(poly, sright)+PolyPractice.eval(poly, sleft))/2); //defines arealeftslice as the product of (b-a) and the average of the polynomial evaluated at left endpoint of subinterval and the polynmial evaluated at the right endpoint of subinterval\n\t\treturn areatrapslice; //returns areatrapslice\n\t}", "private int first_leaf() { return n/2; }", "public Node split(Node head){\r\n\t\t\tif(head == null || head.next == null)\r\n\t\t\t\treturn head;\r\n\t\t\telse{\r\n\t\t\t\tNode normalSpeed = head;\r\n\t\t\t\tNode doubleSpeed = head.next;\r\n\t\t\t\twhile(doubleSpeed.next!=null && doubleSpeed.next.next !=null){\r\n\t\t\t\t\tdoubleSpeed = doubleSpeed.next.next;\r\n\t\t\t\t\tnormalSpeed = normalSpeed.next;\r\n\t\t\t\t}\r\n\t\t\t\tNode temp = normalSpeed.next;\r\n\t\t\t\tnormalSpeed.next = null;\r\n\t\t\t\treturn temp;\r\n\t\t\t}\r\n\t\t}", "@DataProvider(name = \"SplitAssemblyRegion\")\n public Object[][] makeSplitAssemblyRegion() {\n final List<Object[]> tests = new ArrayList<>();\n\n final SimpleInterval whole_span = new SimpleInterval(\"1\", 1, 500);\n final SimpleInterval gl_before = new SimpleInterval(\"1\", 1, 9);\n final SimpleInterval gl_after = new SimpleInterval(\"1\", 250, 500);\n final SimpleInterval gl_diff_contig = new SimpleInterval(\"2\", 40, 50);\n\n final int regionStart = 10;\n final int regionStop = 100;\n final SimpleInterval region = new SimpleInterval(\"1\", regionStart, regionStop);\n\n for ( final SimpleInterval noEffect : Arrays.asList(whole_span) )\n tests.add(new Object[]{\n region,\n Arrays.asList(noEffect),\n Arrays.asList(region)});\n\n for ( final SimpleInterval noOverlap : Arrays.asList(gl_before, gl_after, gl_diff_contig) )\n tests.add(new Object[]{\n region,\n Arrays.asList(noOverlap),\n Arrays.asList()});\n\n tests.add(new Object[]{region,\n Arrays.asList(new SimpleInterval(\"1\", 5, 50)),\n Arrays.asList(new SimpleInterval(\"1\", regionStart, 50))});\n\n tests.add(new Object[]{region,\n Arrays.asList(new SimpleInterval(\"1\", 50, 200)),\n Arrays.asList(new SimpleInterval(\"1\", 50, regionStop))});\n\n tests.add(new Object[]{region,\n Arrays.asList(new SimpleInterval(\"1\", 40, 50)),\n Arrays.asList(new SimpleInterval(\"1\", 40, 50))});\n\n tests.add(new Object[]{region,\n Arrays.asList(new SimpleInterval(\"1\", 20, 30), new SimpleInterval(\"1\", 40, 50)),\n Arrays.asList(new SimpleInterval(\"1\", 20, 30), new SimpleInterval(\"1\", 40, 50))});\n\n tests.add(new Object[]{region,\n Arrays.asList(new SimpleInterval(\"1\", 1, 30), new SimpleInterval(\"1\", 40, 50)),\n Arrays.asList(new SimpleInterval(\"1\", regionStart, 30), new SimpleInterval(\"1\", 40, 50))});\n\n tests.add(new Object[]{region,\n Arrays.asList(new SimpleInterval(\"1\", 1, 30), new SimpleInterval(\"1\", 70, 200)),\n Arrays.asList(new SimpleInterval(\"1\", regionStart, 30), new SimpleInterval(\"1\", 70, regionStop))});\n\n tests.add(new Object[]{region,\n Arrays.asList(new SimpleInterval(\"1\", 1, 30), new SimpleInterval(\"1\", 40, 50), new SimpleInterval(\"1\", 70, 200)),\n Arrays.asList(new SimpleInterval(\"1\", regionStart, 30), new SimpleInterval(\"1\", 40, 50), new SimpleInterval(\"1\", 70, regionStop))});\n\n return tests.toArray(new Object[][]{});\n }", "public Node interval()\r\n\t{\r\n\t\tint index = lexer.getPosition();\r\n\t\tLexer.Token lp = lexer.getToken();\r\n\t\tif(lp==Lexer.Token.LEFT_PARENTHESIS\r\n\t\t|| lp==Lexer.Token.LEFT_BRACKETS)\r\n\t\t{\r\n\t\t\tNode exp1 = expression();\r\n\t\t\tif(exp1!=null)\r\n\t\t\t{\r\n\t\t\t\tif(lexer.getToken()==Lexer.Token.COMMA)\r\n\t\t\t\t{\r\n\t\t\t\t\tNode exp2 = expression();\r\n\t\t\t\t\tif(exp2!=null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tLexer.Token rp = lexer.getToken();\r\n\t\t\t\t\t\tif(rp==Lexer.Token.RIGHT_PARENTHESIS\r\n\t\t\t\t\t\t|| rp==Lexer.Token.RIGHT_BRACKETS)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tInterval iv = new Interval(exp1,exp2);\r\n\t\t\t\t\t\t\tif(lp==Lexer.Token.LEFT_PARENTHESIS) iv.lhsClosed(false);\r\n\t\t\t\t\t\t\telse iv.lhsClosed(true);\r\n\t\t\t\t\t\t\tif(rp==Lexer.Token.RIGHT_PARENTHESIS) iv.rhsClosed(false);\r\n\t\t\t\t\t\t\telse iv.rhsClosed(true);\r\n\t\t\t\t\t\t\treturn iv;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tlexer.setPosition(index);\r\n\t\treturn null;\r\n\t}", "private AVLTree[] splitLoop(IAVLNode nodeX, AVLTree [] arr){\r\n\t\t\tAVLTree tmp1 = new AVLTree();\r\n\t\t\tAVLTree tmp2 = new AVLTree();\r\n\t\t\tAVLTree tmp3 = new AVLTree();\r\n\t\t\tAVLTree tmp4 = new AVLTree();\r\n\t\t\tIAVLNode preOfX, newNodeForJoin; \r\n\t\t\tint newHeight, newSize;\r\n\t\t\t\r\n\t\t\tIAVLNode curr = nodeX;\r\n\t\t\ttmp1.setRoot(curr.getLeft());\r\n\t\t\ttmp1.getRoot().setParent(null);\r\n\t\t\ttmp3.setRoot(curr.getRight());\r\n\t\t\ttmp3.getRoot().setParent(null);\r\n\t\t\twhile (curr != null) {\r\n\t\t\t\tif(curr.getParent() == null)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tif(curr.getParent().getRight() == curr) // im his left son\r\n\t\t\t\t\t{preOfX = curr.getParent();\r\n\t\t\t\t\ttmp2.setRoot(preOfX.getLeft());\r\n\t\t\t\t\ttmp2.getRoot().setParent(null);\r\n\t\t\t\t\tnewNodeForJoin= new AVLNode(preOfX.getKey(), preOfX.getValue());\r\n\t\t\t\t\tnewNodeForJoin.setHeight(0);\r\n\t\t\t\t\ttmp1.join(newNodeForJoin, tmp2);\r\n\t\t\t\t\tnewHeight = tmp1.HeightCalc(tmp1.getRoot());\r\n\t\t\t\t\tnewSize = tmp1.sizeCalc(tmp1.getRoot());\r\n\t\t\t\t\ttmp1.getRoot().setHeight(newHeight);\r\n\t\t\t\t\ttmp1.getRoot().setSize(newSize);\r\n\t\t\t\t\ttmp2.setRoot(null);\r\n\t\t\t\t\tcurr = preOfX;\r\n\t\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tpreOfX = curr.getParent();\r\n\t\t\t\t\ttmp4.setRoot(preOfX.getRight());\r\n\t\t\t\t\ttmp4.getRoot().setParent(null);\r\n\t\t\t\t\tnewNodeForJoin= new AVLNode(preOfX.getKey(), preOfX.getValue());\r\n\t\t\t\t\tnewNodeForJoin.setHeight(0);\r\n\t\t\t\t\ttmp3.join(newNodeForJoin, tmp4);\r\n\t\t\t\t\tnewHeight = tmp3.HeightCalc(tmp3.getRoot());\r\n\t\t\t\t\tnewSize = tmp3.sizeCalc(tmp3.getRoot());\r\n\t\t\t\t\ttmp3.getRoot().setHeight(newHeight);\r\n\t\t\t\t\ttmp3.getRoot().setSize(newSize);\r\n\t\t\t\t\ttmp4.setRoot(null);\r\n\t\t\t\t\tcurr = preOfX;\r\n\t\t\t\t}\r\n\t\t\t\tnewNodeForJoin = new AVLNode(null);\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tarr[0] = tmp1;\r\n\t\t\t\tarr[1]= tmp3;\r\n\t\t\t\tarr[0].minimum = arr[0].minPointer(arr[0].getRoot());\r\n\t\t\t\tarr[1].minimum = arr[1].minPointer(arr[1].getRoot());\r\n\t\t\t\tarr[0].maximum = arr[0].maxPointer(arr[0].getRoot());\r\n\t\t\t\tarr[1].maximum = arr[1].maxPointer(arr[1].getRoot());\r\n\t\r\n\t\t\t\treturn arr;\r\n\t\t\t\t\r\n\t\t\t}", "public abstract boolean satisfiesSplit(Instance<?> inst);", "private void checkForInvariant(int start, String[] split)\n {\n // For now, all of our conditions are two properties\n // from a root component.\n\n if (split.length - start != 2)\n return;\n\n try\n {\n if (!Ognl.isSimpleNavigationChain(_parsedExpression, getOgnlContext()))\n return;\n }\n catch (OgnlException ex)\n {\n throw new BindingException(\n Tapestry.format(\n \"ExpressionBinding.unable-to-resolve-expression\",\n _expression,\n _root),\n this,\n ex);\n }\n\n String first = split[start];\n\n if (first.equals(\"listeners\"))\n {\n _invariant = true;\n\n // Could cast to AbstractComponent, get listenersMap, etc.,\n // but this is easier.\n\n _cachedValue = resolveProperty();\n return;\n }\n\n if (first.equals(\"assets\"))\n {\n String name = split[start + 1];\n\n _invariant = true;\n _cachedValue = _root.getAsset(name);\n return;\n }\n\n if (first.equals(\"beans\"))\n {\n String name = split[start + 1];\n\n IBeanSpecification bs = _root.getSpecification().getBeanSpecification(name);\n\n if (bs == null || bs.getLifecycle() != BeanLifecycle.PAGE)\n return;\n\n // Again, could cast to AbstractComponent, but this\n // is easier.\n\n _invariant = true;\n _cachedValue = resolveProperty();\n return;\n }\n\n if (first.equals(\"bindings\"))\n {\n String name = split[start + 1];\n\n _invariant = true;\n _cachedValue = _root.getBinding(name);\n return;\n }\n\n // Not a recognized pattern for conversion\n // to invariant.\n }", "@Test\n public void testCaseNumberSplit() {\n String caseNumber1 = \"NTN-57930\";\n String[] parts1 = caseNumber1.split( \"-\" );\n //String[] parts2 = caseNumber2.split(\"-\");\n //String[] parts3 = caseNumber3.split(\"-\");\n System.out.println( parts1.length );\n //System.out.println( parts2.length);\n //System.out.println( parts3.length);\n if (parts1.length > 2) {\n System.out.println( parts1[0] );\n String case1 = caseNumber1.substring( caseNumber1.indexOf( caseNumber1.split( \"-\" )[0] ), caseNumber1.indexOf( caseNumber1.split( \"-\" )[2] ) - 1 );\n System.out.println( case1 );\n } else {\n String case1 = caseNumber1;\n System.out.println( case1 );\n }\n }", "@Override\n public Variable useHeuristic(Deque<Variable> deque) {\n Variable highDomain = deque.getFirst();\n for (Variable var : deque){\n if (var.getDomain().size() > highDomain.getDomain().size()){\n highDomain = var;\n }\n }\n return highDomain;\n }", "public void divider(int start_value, int end_value) {\n\t\t// Divide until undividable\n if (start_value < end_value && (end_value - start_value) >= 1) {\n int middle_value = (end_value + start_value) / 2;\n divider(start_value, middle_value);\n divider(middle_value + 1, end_value); \n \n merger(start_value, middle_value, end_value); \n } \n }", "LogicExpression getLeft();", "public Value splitBy(Value s,Value start,Value end) {\n String[] split = this.toString().split(s.toString());\r\n return new Values(split);\r\n }", "IntVar selectVariable(IntVar[] v) {\r\n\r\n if (v.length != 0) {\r\n int index = 0;\r\n int smallestDomain = Integer.MAX_VALUE;\r\n for(int i = 0; i< v.length-1; i++){\r\n if(v[i].domain.getSize()<smallestDomain){\r\n index = i;\r\n smallestDomain = v[i].domain.getSize();\r\n }\r\n\r\n }\r\n if(v[index].min() == v[index].max()){\r\n\r\n searchVariables = new IntVar[v.length-1];\r\n for (int i = 0; i < v.length-1; i++) {\r\n if(i<index){\r\n searchVariables[i] = v[i];\r\n }\r\n else searchVariables[i] = v[i+1];\r\n\r\n }\r\n }\r\n else{\r\n searchVariables = new IntVar[v.length];\r\n for(int i = 0; i < v.length; i++){\r\n searchVariables[i] = v[i];\r\n }\r\n }\r\n return v[index];\r\n\r\n }\r\n else {\r\n System.err.println(\"Zero length list of variables for labeling\");\r\n return new IntVar(store);\r\n }\r\n }", "@Override\n protected void doAlgorithmA1() {\n int xP = 0;\n int yP = 0;\n\n\n //Taking the variable out of the list that are in the bounds\n //Testing that the bound has variables\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n xP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX().getPosition();\n }\n int xU = 0;\n int xL = 0;\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n yP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY().getPosition();\n }\n int yU = 0;\n int yL = 0;\n int cright = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCright();\n int cleft = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCleft();\n\n\n\n for (Variable variable : csp.getVars()) {\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n if (variable.getPosition() == xP) {\n xU = variable.getUpperDomainBound();\n xL = variable.getLowerDomainBound();\n }\n }\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n if (variable.getPosition() == yP) {\n yU = variable.getUpperDomainBound();\n yL = variable.getLowerDomainBound();\n }\n }\n }\n\n boolean first = false;\n boolean second = false;\n\n //Testing if the bound is true, false or inconclusive\n\n if (xL + cleft >= yU + cright) {\n first = true;\n }\n if (xU + cleft < yL + cright) {\n second = true;\n }\n\n //are first and second not equal is the bound not inconclusive\n if (first != second) {\n if (first) { //a true Simple Bound was found\n //checks if it was the last constraint in a csp\n //If so the csp is true\n //else check the next constraint and do this method again\n if (csp.getSimpleConstraints().size() - 1 == cIndex) {\n System.out.println(\"P is satisfiable\");\n System.out.println(System.nanoTime()-startTime);\n return;\n } else {\n bIndex = 0;\n cIndex++;\n unit=false;\n doAlgorithmA1();\n }\n } else if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) { //a false Simple Bound was found\n //\n bIndex = 0;\n cIndex = 0;\n if (isInconclusive) {\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n doAlgorithmA2();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n } else {//an inconclusive Simple Bound was found\n //checks if the bound wasn't already inconclusive\n if(!isInconclusive){\n unit=true;\n unitSB = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex);\n }else {\n unit=false;\n }\n isInconclusive = true;\n\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) {\n cIndex = 0;\n bIndex = 0;\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n }\n }", "LogicExpression getLeftExp();", "public void subdivide() {\n\t\tif (!divided) {\n\t\t\tdivided = true;\n\t\t\t\n\t\t\t// Calculate the width and height of the sub nodes\n\t\t\tint width = (int) Math.ceil(boundary.width/2.0) + 1;\n\t\t\tint height = (int) Math.ceil(boundary.height/2.0) + 1;\n\t\t\t\n\t\t\t// Create ArrayList for the nodes and insert them\n\t\t\tnodes = new ArrayList<QuadTreeNode<E>>();\n\t\t\t\n\t\t\tnodes.add(new QuadTreeNode<E>(boundary.x, boundary.y, height, width));\n\t\t\tnodes.add(new QuadTreeNode<E>(boundary.x + width, boundary.y, height, width));\n\t\t\tnodes.add(new QuadTreeNode<E>(boundary.x, boundary.y + height, height, width));\n\t\t\tnodes.add(new QuadTreeNode<E>(boundary.x + width, boundary.y + height, height, width));\n\t\t\t\n\t\t\t// Take all the points and insert them into the best sub node\n\t\t\tfor (Point p : points.keySet()) {\n\t\t\t\tQuadTreeNode<E> q = this.getBestQuad(p);\n\t\t\t\tq.add(p, points.get(p));\n\t\t\t}\n\t\t\t\n\t\t\tpoints = null;\n\t\t}\n\t}", "public abstract String division();" ]
[ "0.5811586", "0.5416447", "0.52763224", "0.52257663", "0.51041096", "0.5039043", "0.5028468", "0.4985596", "0.49839246", "0.49310657", "0.4910619", "0.48373452", "0.4821575", "0.48185533", "0.47635597", "0.47423702", "0.47423702", "0.47388655", "0.47239152", "0.4704735", "0.47020116", "0.46927553", "0.46926835", "0.4685663", "0.4675367", "0.4664746", "0.4662529", "0.46538275", "0.46357822", "0.46242014", "0.46195528", "0.460135", "0.45957917", "0.45889732", "0.45857093", "0.45831454", "0.45637113", "0.45580053", "0.45420763", "0.45301118", "0.45165822", "0.44997588", "0.4496184", "0.44732076", "0.4470194", "0.44649538", "0.44474548", "0.44470882", "0.44351125", "0.44249377", "0.44182718", "0.44177607", "0.44059578", "0.4405284", "0.44006684", "0.43996036", "0.43934909", "0.4391059", "0.43882573", "0.438424", "0.4380374", "0.43738365", "0.43712467", "0.43664706", "0.436577", "0.43590593", "0.435355", "0.43513116", "0.4348348", "0.43416333", "0.43359834", "0.43344918", "0.4325388", "0.4325322", "0.43215495", "0.43211848", "0.43152744", "0.43139133", "0.4303841", "0.4303014", "0.4293462", "0.4290924", "0.42849505", "0.42818865", "0.42755014", "0.42696697", "0.42532328", "0.42526552", "0.42525202", "0.4251372", "0.4244304", "0.42354763", "0.42219257", "0.42217094", "0.42206424", "0.4217723", "0.4215963", "0.42120755", "0.42103657", "0.420982" ]
0.4435933
48
Assigns the first noninstantiated variable to its upper bound.
public static IntStrategy lexico_UB(IntVar... VARS) { return custom(lexico_var_selector(), max_value_selector(), VARS); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setUpperBound(String upper) {\n upperBound = upper;\n }", "public void setUpperBound(final int upperBound) {\r\n this.upperBound = upperBound;\r\n }", "public void setHighestVariable(int v) {\n\t\tHighestVariable = (HighestVariable + v);\n\t}", "public int getUpperBound() {\r\n return upperBound;\r\n }", "@Override\n\tprotected void setUpperBound() {\n\t\t\n\t}", "public int upperBound() {\n\t\tif(step > 0)\n\t\t\treturn last;\n\t\telse\n\t\t\treturn first;\n\t}", "public int getUpperBound() {\n\t\treturn upperBound;\n\t}", "protected final void setMax() {\n\n\tint prevmax = this.max;\n\n\tint i1 = this.high;\n\tint i2 = left.max;\n\tint i3 = right.max;\n\n\tif ((i1 >= i2) && (i1 >= i3)) {\n\t this.max = i1;\n\t} else if ((i2 >= i1) && (i2 >= i3)) {\n\t this.max = i2;\n\t} else {\n\t this.max = i3;\n\t}\n\t\n\tif ((p != IntervalNode.nullIntervalNode) &&\n\t (prevmax != this.max)) {\n \t p.setMax();\n\t}\n }", "TrackingToken upperBound();", "public default Type upperBound() throws LookupException {\n return this;\n }", "public void setUpperPoint(Point upper) {\n this.upper = upper;\n }", "public int getUpperBound() {\n\t\treturn this.upperBound;\n\t}", "boolean impliedByUpperBound(InfinitNumber ubound) {\n\t\treturn ubound.lesseq(mBound);\n\t}", "VarAssignment createVarAssignment();", "public final void rule__JvmUpperBound__Group__1__Impl() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalDroneScript.g:16479:1: ( ( ( rule__JvmUpperBound__TypeReferenceAssignment_1 ) ) )\r\n // InternalDroneScript.g:16480:1: ( ( rule__JvmUpperBound__TypeReferenceAssignment_1 ) )\r\n {\r\n // InternalDroneScript.g:16480:1: ( ( rule__JvmUpperBound__TypeReferenceAssignment_1 ) )\r\n // InternalDroneScript.g:16481:2: ( rule__JvmUpperBound__TypeReferenceAssignment_1 )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getJvmUpperBoundAccess().getTypeReferenceAssignment_1()); \r\n }\r\n // InternalDroneScript.g:16482:2: ( rule__JvmUpperBound__TypeReferenceAssignment_1 )\r\n // InternalDroneScript.g:16482:3: rule__JvmUpperBound__TypeReferenceAssignment_1\r\n {\r\n pushFollow(FOLLOW_2);\r\n rule__JvmUpperBound__TypeReferenceAssignment_1();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getJvmUpperBoundAccess().getTypeReferenceAssignment_1()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "public void unAssign(){\n\t\tthis.value = 0;\n\t}", "abstract void assign(int i);", "public final void rule__JvmUpperBound__Group__1__Impl() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:16639:1: ( ( ( rule__JvmUpperBound__TypeReferenceAssignment_1 ) ) )\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:16640:1: ( ( rule__JvmUpperBound__TypeReferenceAssignment_1 ) )\r\n {\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:16640:1: ( ( rule__JvmUpperBound__TypeReferenceAssignment_1 ) )\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:16641:1: ( rule__JvmUpperBound__TypeReferenceAssignment_1 )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getJvmUpperBoundAccess().getTypeReferenceAssignment_1()); \r\n }\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:16642:1: ( rule__JvmUpperBound__TypeReferenceAssignment_1 )\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:16642:2: rule__JvmUpperBound__TypeReferenceAssignment_1\r\n {\r\n pushFollow(FOLLOW_rule__JvmUpperBound__TypeReferenceAssignment_1_in_rule__JvmUpperBound__Group__1__Impl33581);\r\n rule__JvmUpperBound__TypeReferenceAssignment_1();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getJvmUpperBoundAccess().getTypeReferenceAssignment_1()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "@Override\n\tprotected double getUpperBound() {\n\t\treturn 0;\n\t}", "private void assignUninitialisedGlobalVar(Variable lastAppearanceOfVar,String valueName)throws\r\n\t\t\tTypeNotSupportedException{\r\n\t\t\tVariable variablesCopy = vFactory.createVariable(true, false, lastAppearanceOfVar.isArgument(),\r\n\t\t\t\t\tlastAppearanceOfVar.getType(), true);\r\n\t\t\tuninitialisedGlobalVariables.put(valueName, variablesCopy);\r\n\t}", "public String getUpper() {\n return upperBound;\n }", "public final void rule__JvmWildcardTypeReference__ConstraintsAssignment_2_0_0() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalDroneScript.g:19368:1: ( ( ruleJvmUpperBound ) )\r\n // InternalDroneScript.g:19369:2: ( ruleJvmUpperBound )\r\n {\r\n // InternalDroneScript.g:19369:2: ( ruleJvmUpperBound )\r\n // InternalDroneScript.g:19370:3: ruleJvmUpperBound\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getJvmWildcardTypeReferenceAccess().getConstraintsJvmUpperBoundParserRuleCall_2_0_0_0()); \r\n }\r\n pushFollow(FOLLOW_2);\r\n ruleJvmUpperBound();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getJvmWildcardTypeReferenceAccess().getConstraintsJvmUpperBoundParserRuleCall_2_0_0_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "void assignRange() {\n rangeIndex = (int) Math.floor(value / step);\n }", "public V getUpperBound();", "public final void rule__JvmUpperBound__Group__1__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:11790:1: ( ( ( rule__JvmUpperBound__TypeReferenceAssignment_1 ) ) )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:11791:1: ( ( rule__JvmUpperBound__TypeReferenceAssignment_1 ) )\n {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:11791:1: ( ( rule__JvmUpperBound__TypeReferenceAssignment_1 ) )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:11792:1: ( rule__JvmUpperBound__TypeReferenceAssignment_1 )\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getJvmUpperBoundAccess().getTypeReferenceAssignment_1()); \n }\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:11793:1: ( rule__JvmUpperBound__TypeReferenceAssignment_1 )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:11793:2: rule__JvmUpperBound__TypeReferenceAssignment_1\n {\n pushFollow(FOLLOW_rule__JvmUpperBound__TypeReferenceAssignment_1_in_rule__JvmUpperBound__Group__1__Impl23645);\n rule__JvmUpperBound__TypeReferenceAssignment_1();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n if ( state.backtracking==0 ) {\n after(grammarAccess.getJvmUpperBoundAccess().getTypeReferenceAssignment_1()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public int getBound();", "public void addUpperConstraint(String type) {\n\t\tfinal JvmUpperBound constraint = this.jvmTypesFactory.createJvmUpperBound();\n\t\tconstraint.setTypeReference(newTypeRef(this.context, type));\n\t\tgetJvmTypeParameter().getConstraints().add(constraint);\n\t}", "abstract void assignZero();", "public int getHighestVariable() {\n\t\treturn HighestVariable;\n\t}", "abstract void assignOne();", "public Delta addStateUpperBoundConstraint(Scope<?> scope, StateModelDefId stateModelDefId,\n State state, int upperBound) {\n return addStateUpperBoundConstraint(scope, stateModelDefId, state,\n Integer.toString(upperBound));\n }", "public long getUpperTbound() {\n\t\treturn this.upperTBound;\n\t}", "public int getLowerBound() {\r\n return lowerBound;\r\n }", "public int getLowerBound ();", "public final void rule__JvmUpperBoundAnded__Group__1__Impl() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:16702:1: ( ( ( rule__JvmUpperBoundAnded__TypeReferenceAssignment_1 ) ) )\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:16703:1: ( ( rule__JvmUpperBoundAnded__TypeReferenceAssignment_1 ) )\r\n {\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:16703:1: ( ( rule__JvmUpperBoundAnded__TypeReferenceAssignment_1 ) )\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:16704:1: ( rule__JvmUpperBoundAnded__TypeReferenceAssignment_1 )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getJvmUpperBoundAndedAccess().getTypeReferenceAssignment_1()); \r\n }\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:16705:1: ( rule__JvmUpperBoundAnded__TypeReferenceAssignment_1 )\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:16705:2: rule__JvmUpperBoundAnded__TypeReferenceAssignment_1\r\n {\r\n pushFollow(FOLLOW_rule__JvmUpperBoundAnded__TypeReferenceAssignment_1_in_rule__JvmUpperBoundAnded__Group__1__Impl33704);\r\n rule__JvmUpperBoundAnded__TypeReferenceAssignment_1();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getJvmUpperBoundAndedAccess().getTypeReferenceAssignment_1()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "public void setLowerBound (int lowerBound) throws ModelException;", "@Override\n public void setSoftUpperLimit(double position)\n {\n final String funcName = \"setSoftUpperLimit\";\n\n if (debugEnabled)\n {\n dbgTrace.traceEnter(funcName, TrcDbgTrace.TraceLevel.API, \"position=%f\", position);\n dbgTrace.traceExit(funcName, TrcDbgTrace.TraceLevel.API);\n }\n\n softUpperLimit = position;\n }", "public final void rule__JvmUpperBoundAnded__Group__1__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:11853:1: ( ( ( rule__JvmUpperBoundAnded__TypeReferenceAssignment_1 ) ) )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:11854:1: ( ( rule__JvmUpperBoundAnded__TypeReferenceAssignment_1 ) )\n {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:11854:1: ( ( rule__JvmUpperBoundAnded__TypeReferenceAssignment_1 ) )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:11855:1: ( rule__JvmUpperBoundAnded__TypeReferenceAssignment_1 )\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getJvmUpperBoundAndedAccess().getTypeReferenceAssignment_1()); \n }\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:11856:1: ( rule__JvmUpperBoundAnded__TypeReferenceAssignment_1 )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:11856:2: rule__JvmUpperBoundAnded__TypeReferenceAssignment_1\n {\n pushFollow(FOLLOW_rule__JvmUpperBoundAnded__TypeReferenceAssignment_1_in_rule__JvmUpperBoundAnded__Group__1__Impl23768);\n rule__JvmUpperBoundAnded__TypeReferenceAssignment_1();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n if ( state.backtracking==0 ) {\n after(grammarAccess.getJvmUpperBoundAndedAccess().getTypeReferenceAssignment_1()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void setUnbounded() {_occ.setUnbounded();}", "private int getValue(int lowerBound, int upperBound) {\n int problemRange = upperBound - lowerBound + 1;\n\n return lowerBound + rng.nextInt(problemRange);\n }", "@Override\n\tprotected void setLowerBound() {\n\t\t\n\t}", "public final void rule__JvmWildcardTypeReference__ConstraintsAssignment_2_0_1() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalDroneScript.g:19383:1: ( ( ruleJvmUpperBoundAnded ) )\r\n // InternalDroneScript.g:19384:2: ( ruleJvmUpperBoundAnded )\r\n {\r\n // InternalDroneScript.g:19384:2: ( ruleJvmUpperBoundAnded )\r\n // InternalDroneScript.g:19385:3: ruleJvmUpperBoundAnded\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getJvmWildcardTypeReferenceAccess().getConstraintsJvmUpperBoundAndedParserRuleCall_2_0_1_0()); \r\n }\r\n pushFollow(FOLLOW_2);\r\n ruleJvmUpperBoundAnded();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getJvmWildcardTypeReferenceAccess().getConstraintsJvmUpperBoundAndedParserRuleCall_2_0_1_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "public static VariableSelector<IntVar> maxDomainSize_var_selector() {\n return new AntiFirstFail();\n }", "public final void rule__JvmUpperBoundAnded__Group__1__Impl() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalDroneScript.g:16533:1: ( ( ( rule__JvmUpperBoundAnded__TypeReferenceAssignment_1 ) ) )\r\n // InternalDroneScript.g:16534:1: ( ( rule__JvmUpperBoundAnded__TypeReferenceAssignment_1 ) )\r\n {\r\n // InternalDroneScript.g:16534:1: ( ( rule__JvmUpperBoundAnded__TypeReferenceAssignment_1 ) )\r\n // InternalDroneScript.g:16535:2: ( rule__JvmUpperBoundAnded__TypeReferenceAssignment_1 )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getJvmUpperBoundAndedAccess().getTypeReferenceAssignment_1()); \r\n }\r\n // InternalDroneScript.g:16536:2: ( rule__JvmUpperBoundAnded__TypeReferenceAssignment_1 )\r\n // InternalDroneScript.g:16536:3: rule__JvmUpperBoundAnded__TypeReferenceAssignment_1\r\n {\r\n pushFollow(FOLLOW_2);\r\n rule__JvmUpperBoundAnded__TypeReferenceAssignment_1();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getJvmUpperBoundAndedAccess().getTypeReferenceAssignment_1()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "R visitBoundVariable(Formula f, int deBruijnIdx);", "public void setUpperValue(int value) {\n // Compute new extent.\n int lowerValue = getValue();\n int newExtent = Math.min(Math.max(0, value - lowerValue), getMaximum() - lowerValue);\n \n // Set extent to set upper value.\n setExtent(newExtent);\n }", "public Point getUpperPoint() {\n return upper;\n }", "public abstract int getMaximumValue();", "protected abstract D getUpper(R range);", "@Basic\n\t@Raw\n\t@Immutable\n\tpublic static double getVelocityUpperBound() {\n\t\treturn VELOCITYUPPERBOUND;\n\t}", "protected void mapValueToWithinBounds() {\n if (getAllele() != null) {\n \tFloat d_value = ( (Float) getAllele());\n if (d_value.isInfinite()) {\n // Here we have to break to avoid a stack overflow.\n // ------------------------------------------------\n return;\n }\n // If the value exceeds either the upper or lower bounds, then\n // map the value to within the legal range. To do this, we basically\n // calculate the distance between the value and the float min,\n // then multiply it with a random number and then care that the lower\n // boundary is added.\n // ------------------------------------------------------------------\n if (d_value.floatValue() > m_upperBound ||\n d_value.floatValue() < m_lowerBound) {\n RandomGenerator rn;\n if (getConfiguration() != null) {\n rn = getConfiguration().getRandomGenerator();\n }\n else {\n rn = new StockRandomGenerator();\n }\n setAllele(new Float((rn.nextFloat()\n * ((m_upperBound - m_lowerBound))) + m_lowerBound));\n }\n }\n }", "public final void rule__JvmUpperBound__Group__1__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCsv.g:3042:1: ( ( ( rule__JvmUpperBound__TypeReferenceAssignment_1 ) ) )\n // InternalCsv.g:3043:1: ( ( rule__JvmUpperBound__TypeReferenceAssignment_1 ) )\n {\n // InternalCsv.g:3043:1: ( ( rule__JvmUpperBound__TypeReferenceAssignment_1 ) )\n // InternalCsv.g:3044:2: ( rule__JvmUpperBound__TypeReferenceAssignment_1 )\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getJvmUpperBoundAccess().getTypeReferenceAssignment_1()); \n }\n // InternalCsv.g:3045:2: ( rule__JvmUpperBound__TypeReferenceAssignment_1 )\n // InternalCsv.g:3045:3: rule__JvmUpperBound__TypeReferenceAssignment_1\n {\n pushFollow(FOLLOW_2);\n rule__JvmUpperBound__TypeReferenceAssignment_1();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n if ( state.backtracking==0 ) {\n after(grammarAccess.getJvmUpperBoundAccess().getTypeReferenceAssignment_1()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public BoundType b() {\n throw new AssertionError(\"this statement should be unreachable\");\n }", "public InfinitNumber getBound() {\n\t\treturn mBound;\n\t}", "public void init()\r\n {\r\n myMax = null;\r\n }", "void assignItem(int bid, int item) {\n assignment[item] = 1;\n value = Math.min(maxValue, value + bid);\n assignRange();\n }", "@Override\n\tpublic AbstractValue leastUpperBound(AbstractValue v) {\n\t\tif ( !(v instanceof Interval) )\n\t\t\tthrow new IllegalArgumentException(\"v should be of type Interval\");\n\t\tInterval i = (Interval) v;\n\n\t\tif (i.equals(top))\n\t\t\treturn i;\n\t\telse if (i.isBottom())\n\t\t\treturn this;\n\n\t\tString newLow, newHigh;\n\n\t\tif (this.getLow().equals(\"-Inf\") || i.getLow().equals(\"-Inf\"))\n\t\t\tnewLow = \"-Inf\";\n\t\telse\n\t\t\tnewLow = String.valueOf(Long.min(Long.parseLong(this.getLow()), Long.parseLong(i.getLow())));\n\n\t\tif (this.getHigh().equals(\"+Inf\") || i.getHigh().equals(\"+Inf\"))\n\t\t\tnewHigh = \"+Inf\";\n\t\telse\n\t\t\tnewHigh = String.valueOf(Long.max(Long.parseLong(this.getHigh()), Long.parseLong(i.getHigh())));\n\n\t\tInterval res = new Interval(newLow, newHigh);\n\t\treturn amItop() ? top : res ;\n\t}", "public int maxLocals();", "protected final void setMax(Comparable max)\r\n {\r\n myMax = max;\r\n }", "private void assignWithReference(String valueName, Variable lastAppearanceOfVar) throws\r\n\t\t\tIllegalOperationException,IncompatibleTypeException,TypeNotSupportedException {\r\n\t\t//we'll check if the assignment is made with a reference to another variable:\r\n\t\tVariable reference = findVariable(valueName);\r\n\t\tif(reference==null){//if not, valueName variable was ever declared and it's type isn't legal.\r\n\t\t\tthrow new IllegalOperationException();\r\n\t\t}else if(reference.isGlobal()&&!reference.isInitialized()){//reference's an uninitialised global var\r\n\t\t\treference = uninitialisedGlobalVariables.get(valueName);//see if it was assigned in this scope\r\n\t\t\tif(reference==null){//if not:\r\n\t\t\t\tthrow new IllegalOperationException();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (!reference.isInitialized()) {//if the referenced variable was never initialised:\r\n\t\t\tthrow new IllegalOperationException();\r\n\t\t}\r\n\t\tlastAppearanceOfVar.compatibleWith(reference);//val's type's illegal-> exception\r\n\t\tif(lastAppearanceOfVar.isGlobal()&&!lastAppearanceOfVar.isInitialized()&&!scopeType.equals//\r\n\t\t\t\t(\"global\")){//we're trying, in a scope other than globalScope, to assign a value to an\r\n\t\t\t // uninitialised global variable\r\n\t\t\tassignUninitialisedGlobalVar(lastAppearanceOfVar,valueName);//see methods's documentation.\r\n\t\t}else{\r\n\t\t\tlastAppearanceOfVar.initialize();\r\n\t\t}\r\n\t}", "public double upper()\n\t{\n\t\treturn _dblUpper;\n\t}", "public final void rule__JvmWildcardTypeReference__ConstraintsAssignment_2_0_0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCsv.g:4025:1: ( ( ruleJvmUpperBound ) )\n // InternalCsv.g:4026:2: ( ruleJvmUpperBound )\n {\n // InternalCsv.g:4026:2: ( ruleJvmUpperBound )\n // InternalCsv.g:4027:3: ruleJvmUpperBound\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getJvmWildcardTypeReferenceAccess().getConstraintsJvmUpperBoundParserRuleCall_2_0_0_0()); \n }\n pushFollow(FOLLOW_2);\n ruleJvmUpperBound();\n\n state._fsp--;\n if (state.failed) return ;\n if ( state.backtracking==0 ) {\n after(grammarAccess.getJvmWildcardTypeReferenceAccess().getConstraintsJvmUpperBoundParserRuleCall_2_0_0_0()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public void setUpper(int value) {\n this.upper = value;\n }", "public void setMaxValue(int x) {\r\n\t\tmaxValue = x;\r\n\t}", "void setMaximum(int max);", "public static void main(String[] args){\n\n System.out.printf(\"The max is: %d \\n\", maxy(4, 8, 2));\n\n Holder<String> stringValue = new Holder<>();\n stringValue.setMyVar(\"myStringVariable\");\n System.out.println(stringValue.getMyVar());\n\n Holder<Integer> integerValue = new Holder<>();\n integerValue.setMyVar(10);\n System.out.println(integerValue.getMyVar());\n\n\n }", "@Override\n\tpublic AbstractValue greatestLowerBound(AbstractValue d) {\n\t\tif ( !(d instanceof Interval) )\n\t\t\tthrow new IllegalArgumentException(\"v should be of type Interval\");\n\t\tInterval i = (Interval) d;\n\n\t\tif (i.isBottom())\n\t\t\treturn i;\n\t\telse if (i.equals(top))\n\t\t\treturn this;\n\n\t\tString newLow = \"-Inf\", newHigh = \"+Inf\";\n\n\t\t//Calcolare limite inferiore\n\n\t\tif ( this.getLow().equals(\"-Inf\")){\n\t\t\tif( !i.getLow().equals(\"-Inf\"))\n\t\t\t\tif(Integer.parseInt(this.getHigh()) > Integer.parseInt(i.getLow()))\n\t\t\t\t\tnewLow = String.valueOf(Integer.max(Integer.parseInt(this.getLow()), Integer.parseInt(i.getLow())));\n\t\t\t\telse\n\t\t\t\t\treturn BottomAV.getInstance();\n\t\t}else if ( i.getLow().equals(\"-Inf\")){\n\t\t\tif( !this.getLow().equals(\"-Inf\"))\n\t\t\t\tif(Integer.parseInt(i.getHigh()) > Integer.parseInt(this.getLow()))\n\t\t\t\t\tnewLow = String.valueOf(Integer.max(Integer.parseInt(i.getLow()), Integer.parseInt(this.getLow())));\n\t\t\t\telse\n\t\t\t\t\treturn BottomAV.getInstance();\n\t\t}else if(!this.getLow().equals(\"-Inf\") && !i.getLow().equals(\"-Inf\")){\n\t\t\tnewLow = String.valueOf(Integer.max(Integer.parseInt(this.getLow()), Integer.parseInt(i.getLow())));\n\t\t}\n\n\t\t// Calcolare limite superiore\n\n\t\tif ( this.getHigh().equals(\"+Inf\")) {\n\t\t\tif (!i.getHigh().equals(\"+Inf\"))\n\t\t\t\tnewHigh = i.getHigh();\n\t\t}else if ( i.getHigh().equals(\"+Inf\")) {\n\t\t\tif (!this.getHigh().equals(\"+Inf\"))\n\t\t\t\tnewHigh = this.getHigh();\n\t\t}else if(!this.getHigh().equals(\"+Inf\") && !i.getHigh().equals(\"+Inf\")){\n\t\t\tnewHigh = String.valueOf(Integer.min(Integer.parseInt(this.getHigh()), Integer.parseInt(i.getHigh())));\n\t\t}\n\n\t\tInterval res = new Interval(newLow, newHigh);\n\n\t\t// Checks whether low > high\n\t\tif ((!newLow.equals(\"-Inf\") && (!newHigh.equals(\"+Inf\")) && Integer.parseInt(newLow) > Integer.parseInt(newHigh)))\n\t\t\treturn BottomAV.getInstance();\n\n\t\treturn amItop() ? top : res;\n\t}", "public void assign (String name, int value){\n Closure exist = find_var(name);\n exist.getValues().put(name, new IntegerValue(value));\n }", "public final void rule__JvmWildcardTypeReference__ConstraintsAssignment_2_0() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:19091:1: ( ( ruleJvmUpperBound ) )\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:19092:1: ( ruleJvmUpperBound )\r\n {\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:19092:1: ( ruleJvmUpperBound )\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:19093:1: ruleJvmUpperBound\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getJvmWildcardTypeReferenceAccess().getConstraintsJvmUpperBoundParserRuleCall_2_0_0()); \r\n }\r\n pushFollow(FOLLOW_ruleJvmUpperBound_in_rule__JvmWildcardTypeReference__ConstraintsAssignment_2_038590);\r\n ruleJvmUpperBound();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getJvmWildcardTypeReferenceAccess().getConstraintsJvmUpperBoundParserRuleCall_2_0_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "public float getUpperBound()\n {\n return fUpperBound;\n }", "E maxVal();", "public Variable(){\n name = \"\";\n initialValue = 0;\n }", "public void setMaxValue(double x) {\r\n\t\tmaxValue = x;\r\n\t}", "public Builder addStateUpperBoundConstraint(Scope<?> scope, StateModelDefId stateModelDefId,\n State state, int upperBound) {\n return addStateUpperBoundConstraint(scope, stateModelDefId, state,\n Integer.toString(upperBound));\n }", "public CategoryBuilder setUpperBound(float upperBound)\n {\n fUpperBound = upperBound;\n return this;\n }", "public final void rule__JvmWildcardTypeReference__ConstraintsAssignment_2_0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:13552:1: ( ( ruleJvmUpperBound ) )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:13553:1: ( ruleJvmUpperBound )\n {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:13553:1: ( ruleJvmUpperBound )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:13554:1: ruleJvmUpperBound\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getJvmWildcardTypeReferenceAccess().getConstraintsJvmUpperBoundParserRuleCall_2_0_0()); \n }\n pushFollow(FOLLOW_ruleJvmUpperBound_in_rule__JvmWildcardTypeReference__ConstraintsAssignment_2_027241);\n ruleJvmUpperBound();\n\n state._fsp--;\n if (state.failed) return ;\n if ( state.backtracking==0 ) {\n after(grammarAccess.getJvmWildcardTypeReferenceAccess().getConstraintsJvmUpperBoundParserRuleCall_2_0_0()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public BoundType a() {\n throw new AssertionError(\"this statement should be unreachable\");\n }", "public int getUpperValue() {\n return getValue() + getExtent();\n }", "public void setMaxLocals() {\n/* 292 */ int maxLocals = getMaxLocals();\n/* 293 */ int prevLocals = maxLocals;\n/* */ \n/* */ \n/* 296 */ LocalVariableGen[] localVars = getLocalVariables();\n/* 297 */ if (localVars != null && \n/* 298 */ localVars.length > maxLocals) {\n/* 299 */ maxLocals = localVars.length;\n/* */ }\n/* */ \n/* */ \n/* 303 */ if (maxLocals < 5) maxLocals = 5;\n/* */ \n/* 305 */ setMaxLocals(maxLocals);\n/* */ }", "void setMaxValue();", "public int upperBoundary(){\r\n\t\treturn yStart - Constants.FLOOR_HEIGHT;\r\n\t}", "private int deadZone(int value, int minValue)\n\t{\n\t\tif (Math.abs(value) < minValue) value = 0;\n\t\t\n\t\treturn value;\n\t}", "public GuessingGame(int upperBound) {\n\t\tthis.upperBound = upperBound;\n\t\tthis.secret = getRandomNumber(upperBound);\n\t\tthis.hint = \"I'm thinking of a number between 1 and \" + upperBound;\n\t}", "public void setLowerBound(final int lowerBound) {\r\n this.lowerBound = lowerBound;\r\n }", "public UpperBoundType1Elements getUpperBoundType1Access() {\n\t\treturn pUpperBoundType1;\n\t}", "private int getLowerBound(Object problem, int upperbound)\n {\n Graph tsp = (Graph)problem;\n if (weight == null)\n weight = new double[tsp.size()];\n hki = new HeldKarpIterative( tsp, included, includedT, excluded, excludedT, iterations, weight, upperbound);\n hki.compute();\n tour = hki.isTour();\n bound = hki.getBound();\n hasRun = true;\n// System.out.println(hki.debugDump());\n return bound;\n }", "private static int getUpperBound(String expression) {\r\n\t\t\r\n\t\texpression = expression.substring(7, expression.length());\r\n\t\t\r\n\t\treturn new Integer(expression);\r\n\t\t\r\n\t}", "@Override\n public CodeFragment visitAssignmentStat(AlangParser.AssignmentStatContext ctx) {\n String name = ctx.ID().getText();\n if (!variableExists(name)) {\n this.addError(ctx, name, \"Assignment to undeclared variable\");\n return new CodeFragment(\"\");\n }\n\n Variable v = this.globals.get(name);\n v.setValue(ctx.global_expression().getText());\n v.setHasValue();\n\n return new CodeFragment(\"\");\n }", "public void setUpperClause(INestedIfElseClauseContainer upper);", "public Variable(String name, int initialValue){\n this.name = name;\n this.initialValue = initialValue;\n }", "public void MIPSme()\n\t{\n\t\t\n\t\tTEMP varAddress = null;\n\t\t//v := v - this is the right side of the assignment - we want to load the value of v from memory\n\t\tif (isRight){\n\t\t\tif(isParamFromStack){\n\t\t\t\t// we want value from stack\n\t\t\t\tsir_MIPS_a_lot.getInstance().loadFromFrame(dst,(this.localVarOffset+1)*4);\n\t\t\t}\n\t\t\t//need to be modified\n\t\t\telse{\n\t\t\t\tsir_MIPS_a_lot.getInstance().loadFromFrame(dst,-(this.localVarOffset+1)*4);\n\t\t\t}\n\t\t}\n\t\t//left side - we want to get variable address into temp t \n\t\telse{\n\t\t\t//variable is a parameter of a function\n\t\t\tif (isParamFromStack){\n\t\t\t\tvarAddress = sir_MIPS_a_lot.getInstance().addressParamVar(this.localVarOffset);\n\t\t\t}\n\t\t\t//for now it represents local variable but need to be changed.... (data members, globals...) \n\t\t\telse{\n\t\t\t\tvarAddress = sir_MIPS_a_lot.getInstance().addressLocalVar(this.localVarOffset);\n\t\t\t}\n\t\t\tsir_MIPS_a_lot.getInstance().move(dst,varAddress);\n\t\t}\n\t}", "ChangeObserver<T> setInitialMaxValue(Object value);", "public void setMaxLocals(int maxLocals);", "private double bound(int iter, Solution next) {\n return Math.exp((-1.0 * (next.getValue() - bestSol.getValue())) / denominator(iter));\n }", "@Override\n public Expression assign(String var, Expression expression) {\n return new Minus(getExpression1().assign(var, expression), getExpression2().assign(var, expression));\n }", "public void changeConstraintsToMoreThan() throws IloException {\n /*\n IloRange notes:\n for expr == rhs, set lb = ub = rhs\n for expr <= rhs, set lb = -infinity and ub = rhs\n for expr >= rhs, set lb = rhs and ub = infinity\n */\n for (int i = 0; i < matrix.getNrows(); i++) {\n IloRange rangedExpression = matrix.getRange(i);\n if (rangedExpression.getLB() <= Double.NEGATIVE_INFINITY) {\n rangedExpression.setBounds(-rangedExpression.getLB(), Double.POSITIVE_INFINITY);\n for (int j = 0; j < matrix.getNrows(); j++) {\n matrix.setNZ(i, j, -matrix.getNZ(i, j));\n }\n }\n }\n }", "public synchronized int getUpperSizeLimit() {\n \t\treturn upper;\n \t}", "public void setBounds(int var1, int var2, int var3, int var4) {\n if(var1 < 0) {\n var1 = 0;\n }\n\n if(var2 < 0) {\n var2 = 0;\n }\n\n if(var3 > this.field_723) {\n var3 = this.field_723;\n }\n\n if(var4 > this.field_724) {\n var4 = this.field_724;\n }\n\n this.field_745 = var1;\n this.field_743 = var2;\n this.field_746 = var3;\n this.field_744 = var4;\n }", "public V getLowerBound();", "public abstract int getBindingVariable();" ]
[ "0.6040425", "0.59285706", "0.570044", "0.5587151", "0.55197084", "0.5488147", "0.5481018", "0.54661644", "0.544405", "0.54438883", "0.5352405", "0.5262978", "0.5236659", "0.5201994", "0.51689166", "0.5165874", "0.5161796", "0.51480126", "0.51218575", "0.5119139", "0.5101716", "0.5082764", "0.5081217", "0.50769687", "0.5076929", "0.5070522", "0.50432616", "0.5036937", "0.5035499", "0.4961259", "0.4943009", "0.4939293", "0.49303147", "0.49094045", "0.4909346", "0.49091354", "0.49070087", "0.4905977", "0.4900541", "0.4874778", "0.4872088", "0.48702395", "0.48658383", "0.48575434", "0.48530677", "0.4838703", "0.48358735", "0.48331", "0.48251665", "0.48182502", "0.48156756", "0.48008963", "0.47906289", "0.4788943", "0.4786256", "0.47802952", "0.4779986", "0.47671938", "0.47590676", "0.47489643", "0.47313797", "0.47293326", "0.47268814", "0.47251347", "0.47099438", "0.47060427", "0.47009417", "0.46934208", "0.46932936", "0.46915632", "0.46875185", "0.46861812", "0.46807232", "0.46784896", "0.46714386", "0.4669285", "0.46673456", "0.46662763", "0.46626726", "0.46617353", "0.46612066", "0.4641064", "0.4637004", "0.4634149", "0.46338844", "0.46296972", "0.462959", "0.4628103", "0.46252802", "0.46039045", "0.46029234", "0.45996603", "0.4590581", "0.4581414", "0.457991", "0.45769656", "0.45768327", "0.45750168", "0.4567841", "0.4567446" ]
0.49605384
30
Assigns the noninstantiated variable of smallest domain size to its lower bound.
public static IntStrategy minDom_LB(IntVar... VARS) { return custom(minDomainSize_var_selector(), min_value_selector(), VARS); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setLowerBound (int lowerBound) throws ModelException;", "public void setLowerBound(final int lowerBound) {\r\n this.lowerBound = lowerBound;\r\n }", "public void setLowerBound(String lower) {\n lowerBound = lower;\n }", "public int getLowerBound() {\r\n return lowerBound;\r\n }", "public V getLowerBound();", "@Override\n\tprotected void setLowerBound() {\n\t\t\n\t}", "public void setLowerBound (int lowerBound) throws ModelException\n\t{\n\t\tif ((lowerBound > getUpperBound()) || (lowerBound < 0))\n\t\t{\n\t\t\tthrow new ModelException(I18NHelper.getMessage(getMessages(),\n\t\t\t\t\"jdo.relationship.lower_cardinality_invalid\"));\t\t// NOI18N\n\t\t}\n\n\t\tgetRelationshipImpl().setLowerBound(lowerBound);\n\t}", "public void setMinValue(double x) {\r\n\t\tminValue = x;\r\n\t}", "private void setMinThreshold() {\n minThreshold = value + value * postBoundChange / 100;\n }", "public int getLowerBound ();", "public void setLimit_lin_x_lower(float limit_lin_x_lower) throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeFloat(__io__address + 32, limit_lin_x_lower);\n\t\t} else {\n\t\t\t__io__block.writeFloat(__io__address + 24, limit_lin_x_lower);\n\t\t}\n\t}", "public void setMinValue(int x) {\r\n\t\tminValue = x;\r\n\t}", "@Override\r\n public Integer minLowerBound() {\r\n return this.getImpl().minLowerBound();\r\n }", "@Basic\n\t@Raw\n\t@Immutable\n\tpublic static double getVelocityLowerBound() {\n\t\treturn VELOCITYLOWERBOUND;\n\t}", "@Override\n\tprotected double getLowerBound() {\n\t\treturn 0;\n\t}", "@Override\n public void setSoftLowerLimit(double position)\n {\n final String funcName = \"setSoftLowerLimit\";\n\n if (debugEnabled)\n {\n dbgTrace.traceEnter(funcName, TrcDbgTrace.TraceLevel.API, \"position=%f\", position);\n dbgTrace.traceExit(funcName, TrcDbgTrace.TraceLevel.API);\n }\n\n softLowerLimit = position;\n }", "public static VariableSelector<IntVar> minDomainSize_var_selector() {\n return new FirstFail();\n }", "public double getLeft(double min) {\n return min - this.size; \n }", "public void SetMinVal(int min_val);", "public void setMin(Vect3d min) {\r\n this.min = min;\r\n }", "public void changeConstraintsToLessThan() throws IloException {\n /*\n IloRange notes:\n for expr == rhs, set lb = ub = rhs\n for expr <= rhs, set lb = -infinity and ub = rhs\n for expr >= rhs, set lb = rhs and ub = infinity\n */\n for (int i = 0; i < matrix.getNrows(); i++) {\n IloRange rangedExpression = matrix.getRange(i);\n if (rangedExpression.getUB() >= Double.POSITIVE_INFINITY) {\n rangedExpression.setBounds(Double.NEGATIVE_INFINITY, -rangedExpression.getUB());\n for (int j = 0; j < matrix.getNrows(); j++) {\n matrix.setNZ(i, j, -matrix.getNZ(i, j));\n }\n }\n }\n }", "protected final void setMin() {\n\tint prevmin = this.min;\n\n\tint i1 = this.low;\n\tint i2 = left.min;\n\tint i3 = right.min;\n\n\tif (i2 == -1) \n\t i2 = i1;\n\tif (i3 == -1) \n\t i3 = i1;\n\n\tif ((i1 <= i2) && (i1 <= i3)) {\n\t this.min = i1;\n\t} else if ((i2 <= i1) && (i2 <= i3)) {\n\t this.min = i2;\n\t} else {\n\t this.min = i3;\n\t}\n\n\tif ((p != IntervalNode.nullIntervalNode) &&\n\t (prevmin != this.min)) {\n \t p.setMin();\n\t}\n }", "Double getMinimumValue();", "private void setMin(int min) { this.min = new SimplePosition(false,false,min); }", "protected abstract D getLower(R range);", "public double getDomainMin1() throws IllegalStateException {\n\treturn -Double.MAX_VALUE;\n }", "public Point getXLower()\n {\n return (Point)xLow.clone();\n }", "public void setLowerPoint(Point lower) {\n this.lower = lower;\n }", "public float getLimit_lin_x_lower() throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\treturn __io__block.readFloat(__io__address + 32);\n\t\t} else {\n\t\t\treturn __io__block.readFloat(__io__address + 24);\n\t\t}\n\t}", "protected void mapValueToWithinBounds() {\n if (getAllele() != null) {\n \tFloat d_value = ( (Float) getAllele());\n if (d_value.isInfinite()) {\n // Here we have to break to avoid a stack overflow.\n // ------------------------------------------------\n return;\n }\n // If the value exceeds either the upper or lower bounds, then\n // map the value to within the legal range. To do this, we basically\n // calculate the distance between the value and the float min,\n // then multiply it with a random number and then care that the lower\n // boundary is added.\n // ------------------------------------------------------------------\n if (d_value.floatValue() > m_upperBound ||\n d_value.floatValue() < m_lowerBound) {\n RandomGenerator rn;\n if (getConfiguration() != null) {\n rn = getConfiguration().getRandomGenerator();\n }\n else {\n rn = new StockRandomGenerator();\n }\n setAllele(new Float((rn.nextFloat()\n * ((m_upperBound - m_lowerBound))) + m_lowerBound));\n }\n }\n }", "public double obterXmin() {\n\t\treturn xmin;\n\t}", "public abstract int getMinimumValue();", "public void setMinimum(Number min) {\n this.min = min;\n }", "float xMin();", "public double lower()\n\t{\n\t\treturn _dblLower;\n\t}", "public void setarXmin(double xmin) {\n\t\tthis.xmin = xmin;\n\t}", "public abstract double[] getLowerBound();", "public synchronized int getLowerSizeLimit() {\n \t\treturn lower;\n \t}", "public long getLowerTBound() {\n\t\treturn this.lowerTBound;\n\t}", "E minVal();", "public void setMinimumValue (double min) {\r\n\t\tminValue = new Double(min);\r\n\t\tvalidateMin = (minValue.compareTo(DOUBLE_ZERO) != 1);\r\n\t}", "private int getLowerBound(Object problem, int upperbound)\n {\n Graph tsp = (Graph)problem;\n if (weight == null)\n weight = new double[tsp.size()];\n hki = new HeldKarpIterative( tsp, included, includedT, excluded, excludedT, iterations, weight, upperbound);\n hki.compute();\n tour = hki.isTour();\n bound = hki.getBound();\n hasRun = true;\n// System.out.println(hki.debugDump());\n return bound;\n }", "public String getLower() {\n return lowerBound;\n }", "public double getMinDoubleValue();", "public DynamicPart min(float min) {\n this.min = min;\n return this;\n }", "double getMin();", "double getMin();", "public int getLowerBound ()\n\t{\n\t\treturn getRelationshipImpl().getLowerBound();\n\t}", "private double getMinInitProb(){\r\n\t\treturn probThreshold;\r\n\t}", "public void setMin ( Point min ) {\r\n\r\n\tsetA ( min );\r\n }", "public int getBound();", "public double lowerExtent(int coord) throws IllegalArgumentException { \n double le = measurements[coord].value();\n if ( ! Double.isNaN( measurements[coord].errorMinus() ) )\n le -= measurements[coord].errorMinus();\n\treturn le;\n }", "public double getXRangeMin() {\n return xRangeMin;\n }", "public double getMinimumValue() { return this.minimumValue; }", "private void scaleToPositive() {\r\n // Obtain min value\r\n double minScalarization = Double.MAX_VALUE;\r\n for (S solution : solutions()) {\r\n if (scalarization.getAttribute(solution) < minScalarization) {\r\n minScalarization = scalarization.getAttribute(solution);\r\n }\r\n }\r\n if (minScalarization < 0) {\r\n // Avoid scalarization values of 0\r\n double eps = 10e-6;\r\n for (S solution : solutions()) {\r\n scalarization.setAttribute(solution, eps + scalarization.getAttribute(solution) + minScalarization);\r\n }\r\n }\r\n }", "public void initMaxMin(){\n\t\tmax = dja.max();\n\t\tmin = dja.min();\n\t}", "public void setLower(int value) {\n this.lower = value;\n }", "public void setMin(int min) {\n this.min = min;\n }", "public void setMin(int min) {\n this.min = min;\n }", "public Double getMinimumValue () {\r\n\t\treturn (minValue);\r\n\t}", "public void setLimit_ang_x_lower(float limit_ang_x_lower) throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeFloat(__io__address + 56, limit_ang_x_lower);\n\t\t} else {\n\t\t\t__io__block.writeFloat(__io__address + 48, limit_ang_x_lower);\n\t\t}\n\t}", "public InterestScale sizeOfLowerLimit(String sizeOfLowerLimit) {\n this.sizeOfLowerLimit = sizeOfLowerLimit;\n return this;\n }", "public int GetMinVal();", "public double getMinX() {\n\t\treturn nx;\n\t}", "public void setMinimumValue (Double min) {\r\n\t\tminValue = min;\r\n\t\tvalidateMin = (minValue.compareTo(DOUBLE_ZERO) != 1);\r\n\t}", "boolean impliedByLowerBound(InfinitNumber lbound) {\n\t\treturn getInverseBound().lesseq(lbound);\n\t}", "public Point getXMin()\n {\n return (Point)xMin.clone();\n }", "public static IntStrategy minDom_UB(IntVar... VARS) {\n return custom(minDomainSize_var_selector(), max_value_selector(), VARS);\n }", "public void setLow(double value){low = value;}", "public void setMinRange(double minRange) {\n this.minRange = minRange;\n }", "public double getMinRange() {\n return minRange;\n }", "final int getMinimumSize(int axis) {\n if (min == UNSET) {\n min = constrain(calculateMinimumSize(axis));\n }\n return min;\n }", "public int getMinimumValue() {\n/* 276 */ return -this.s.getMaximumValue();\n/* */ }", "public void setXRangeMin(double xRangeMin) {\n this.xRangeMin = xRangeMin;\n }", "private double getMinThreshold() {\n return minThreshold;\n }", "public double getMinValue() {\r\n\t\treturn minValue;\r\n\t}", "public Number getMinimumNumber() {\n/* 167 */ if (this.minObject == null) {\n/* 168 */ this.minObject = new Long(this.min);\n/* */ }\n/* 170 */ return this.minObject;\n/* */ }", "private double clamp(double v, double min, double max) { return (v < min ? min : (v > max ? max : v)); }", "public void setMinimumValue(double minimumValue)\n {\n this.minimumValue = minimumValue;\n }", "public void setMinValue(int minValue) {\n this.minValue = minValue;\n }", "@Basic\n\t@Immutable\n\tpublic abstract double getRadiusLowerBound();", "int getMin( int min );", "@Override\n\tpublic AbstractValue greatestLowerBound(AbstractValue d) {\n\t\tif ( !(d instanceof Interval) )\n\t\t\tthrow new IllegalArgumentException(\"v should be of type Interval\");\n\t\tInterval i = (Interval) d;\n\n\t\tif (i.isBottom())\n\t\t\treturn i;\n\t\telse if (i.equals(top))\n\t\t\treturn this;\n\n\t\tString newLow = \"-Inf\", newHigh = \"+Inf\";\n\n\t\t//Calcolare limite inferiore\n\n\t\tif ( this.getLow().equals(\"-Inf\")){\n\t\t\tif( !i.getLow().equals(\"-Inf\"))\n\t\t\t\tif(Integer.parseInt(this.getHigh()) > Integer.parseInt(i.getLow()))\n\t\t\t\t\tnewLow = String.valueOf(Integer.max(Integer.parseInt(this.getLow()), Integer.parseInt(i.getLow())));\n\t\t\t\telse\n\t\t\t\t\treturn BottomAV.getInstance();\n\t\t}else if ( i.getLow().equals(\"-Inf\")){\n\t\t\tif( !this.getLow().equals(\"-Inf\"))\n\t\t\t\tif(Integer.parseInt(i.getHigh()) > Integer.parseInt(this.getLow()))\n\t\t\t\t\tnewLow = String.valueOf(Integer.max(Integer.parseInt(i.getLow()), Integer.parseInt(this.getLow())));\n\t\t\t\telse\n\t\t\t\t\treturn BottomAV.getInstance();\n\t\t}else if(!this.getLow().equals(\"-Inf\") && !i.getLow().equals(\"-Inf\")){\n\t\t\tnewLow = String.valueOf(Integer.max(Integer.parseInt(this.getLow()), Integer.parseInt(i.getLow())));\n\t\t}\n\n\t\t// Calcolare limite superiore\n\n\t\tif ( this.getHigh().equals(\"+Inf\")) {\n\t\t\tif (!i.getHigh().equals(\"+Inf\"))\n\t\t\t\tnewHigh = i.getHigh();\n\t\t}else if ( i.getHigh().equals(\"+Inf\")) {\n\t\t\tif (!this.getHigh().equals(\"+Inf\"))\n\t\t\t\tnewHigh = this.getHigh();\n\t\t}else if(!this.getHigh().equals(\"+Inf\") && !i.getHigh().equals(\"+Inf\")){\n\t\t\tnewHigh = String.valueOf(Integer.min(Integer.parseInt(this.getHigh()), Integer.parseInt(i.getHigh())));\n\t\t}\n\n\t\tInterval res = new Interval(newLow, newHigh);\n\n\t\t// Checks whether low > high\n\t\tif ((!newLow.equals(\"-Inf\") && (!newHigh.equals(\"+Inf\")) && Integer.parseInt(newLow) > Integer.parseInt(newHigh)))\n\t\t\treturn BottomAV.getInstance();\n\n\t\treturn amItop() ? top : res;\n\t}", "int getXMin();", "public void setMinSize(int size) {\n if (initialized)\n throw new IllegalStateException(INITIALIZED);\n minSize = size;\n if (maxSize != 0 && minSize > maxSize) {\n maxSize = minSize;\n log.warn(\"pool max size set to \" + maxSize + \" to stay >= min size\");\n }\n }", "public abstract DoublePredicate lowerPredicate(double lowerBound);", "void assignRange() {\n rangeIndex = (int) Math.floor(value / step);\n }", "public void setLimit_lin_z_lower(float limit_lin_z_lower) throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeFloat(__io__address + 48, limit_lin_z_lower);\n\t\t} else {\n\t\t\t__io__block.writeFloat(__io__address + 40, limit_lin_z_lower);\n\t\t}\n\t}", "public void setBounds(int var1, int var2, int var3, int var4) {\n if(var1 < 0) {\n var1 = 0;\n }\n\n if(var2 < 0) {\n var2 = 0;\n }\n\n if(var3 > this.field_723) {\n var3 = this.field_723;\n }\n\n if(var4 > this.field_724) {\n var4 = this.field_724;\n }\n\n this.field_745 = var1;\n this.field_743 = var2;\n this.field_746 = var3;\n this.field_744 = var4;\n }", "public void setLow(int L)\t\n\t{\t//start of setLow method\n\t\tLOW_NUM = L;\n\t}", "public void clamp() //TODO: implement\n {\n System.out.println(\"clamp was called!\"); //DEBUGG: check if called, delete if i know when\n /*\n IntegerVectorSpecies _species = (IntegerVectorSpecies)species;\n for (int i = 0; i < genomeLength(); i++)\n {\n int minGene = (int)_species.minGene(i);\n if (genome[i].getValue() < minGene)\n genome[i].setValue(minGene); //what do do for the TraceID?\n else\n {\n int maxGene = (int)_species.maxGene(i);\n if (genome[i].getValue() > maxGene)\n genome[i] = maxGene;\n }\n }\n\n */\n }", "public static double constrain(double value, double min, double max) {\n if(value > max) value = max;\n else if(value < min) value = min;\n return value;\n }", "public void setMinWeight(double inMinWeight) {\n minWeight = inMinWeight;\n }", "public int getxMin() {\n\t\treturn xMin;\n\t}", "private static final EvaluationAccessor min(EvaluationAccessor operand, EvaluationAccessor[] arguments) {\r\n EvaluationAccessor result = null;\r\n Value oVal = operand.getValue();\r\n if (oVal instanceof ContainerValue) {\r\n ContainerValue cont = (ContainerValue) oVal;\r\n IDatatype contType = ((Container) cont.getType()).getContainedType();\r\n int contSize = cont.getElementSize();\r\n \r\n if (contSize > 0) {\r\n Value rValue = null;\r\n \r\n // Determine min for number containers \r\n if (contType.isAssignableFrom(RealType.TYPE)) {\r\n // Handle min for Reals\r\n double min = (Double) cont.getElement(0).getValue();\r\n for (int i = 1; i < contSize; i++) {\r\n double tmp = (Double) cont.getElement(i).getValue();\r\n if (tmp < min) {\r\n min = tmp;\r\n }\r\n }\r\n \r\n try {\r\n rValue = ValueFactory.createValue(contType, min);\r\n } catch (ValueDoesNotMatchTypeException e) {\r\n EASyLoggerFactory.INSTANCE.getLogger(GenericNumberOperations.class, Bundle.ID)\r\n .debug(e.getMessage());\r\n }\r\n } else if (contType.isAssignableFrom(IntegerType.TYPE)) {\r\n // Handle min for Reals\r\n int min = (Integer) cont.getElement(0).getValue();\r\n for (int i = 1; i < contSize; i++) {\r\n int tmp = (Integer) cont.getElement(i).getValue();\r\n if (tmp < min) {\r\n min = tmp;\r\n }\r\n }\r\n \r\n // Create min value\r\n try {\r\n rValue = ValueFactory.createValue(contType, min);\r\n } catch (ValueDoesNotMatchTypeException e) {\r\n EASyLoggerFactory.INSTANCE.getLogger(GenericNumberOperations.class, Bundle.ID)\r\n .debug(e.getMessage());\r\n }\r\n }\r\n \r\n if (null != rValue) {\r\n result = ConstantAccessor.POOL.getInstance().bind(rValue, operand.getContext());\r\n }\r\n }\r\n }\r\n return result;\r\n }", "public double getMinimumDouble() {\n/* 201 */ return this.min;\n/* */ }", "public double min() {\n/* 305 */ Preconditions.checkState((this.count != 0L));\n/* 306 */ return this.min;\n/* */ }", "void setNilWagerMinimum();", "public double getDomainMin2() throws IllegalStateException {\n\treturn -Double.MAX_VALUE;\n }", "void setNilSingleBetMinimum();" ]
[ "0.6604706", "0.63143456", "0.62544096", "0.6254404", "0.5967962", "0.5946686", "0.5940829", "0.5891488", "0.584639", "0.5778068", "0.57638174", "0.57580847", "0.57380635", "0.569202", "0.5681723", "0.56486565", "0.5623933", "0.5621599", "0.56170124", "0.5611931", "0.5595616", "0.5578806", "0.5538379", "0.55288875", "0.55240005", "0.5523335", "0.55226016", "0.55029964", "0.5461746", "0.54586786", "0.5450083", "0.5444657", "0.5431504", "0.5421595", "0.5420292", "0.54075205", "0.5404382", "0.53984666", "0.5387005", "0.53785735", "0.53735864", "0.5365343", "0.5340341", "0.5338082", "0.5336368", "0.5320839", "0.5320839", "0.5312474", "0.5304361", "0.5298824", "0.52987117", "0.52703166", "0.52686626", "0.52659", "0.52568", "0.52561384", "0.5251746", "0.5249592", "0.5249592", "0.52485216", "0.5247611", "0.5245445", "0.52438676", "0.52172035", "0.52152914", "0.52134067", "0.521236", "0.5204468", "0.52034724", "0.5202266", "0.51950175", "0.5188097", "0.51648337", "0.51624423", "0.5156554", "0.5152556", "0.5152509", "0.51474845", "0.51398903", "0.5138084", "0.513767", "0.5137169", "0.51362246", "0.51346236", "0.5128929", "0.5119467", "0.51161397", "0.5111073", "0.5108518", "0.51044035", "0.5099546", "0.5097349", "0.5089789", "0.50870216", "0.5084931", "0.50814605", "0.50803524", "0.5068588", "0.5065312", "0.50621635" ]
0.54432017
32
Assigns the noninstantiated variable of smallest domain size to a value at the middle of its domain.
public static IntStrategy minDom_MidValue(boolean floor, IntVar... VARS) { return custom(minDomainSize_var_selector(), mid_value_selector(floor), VARS); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static VariableSelector<IntVar> minDomainSize_var_selector() {\n return new FirstFail();\n }", "@Override\n public Expression assign(String var, Expression expression) {\n return new Minus(getExpression1().assign(var, expression), getExpression2().assign(var, expression));\n }", "void assignRange() {\n rangeIndex = (int) Math.floor(value / step);\n }", "private static int minCoststore(int[] dimensions, int start, int end,int[][] storage) {\n\t\tif(start>=end)\r\n\t\t{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(storage[start][end]!=-1)\r\n\t\t{\r\n\t\t\treturn storage[start][end];\r\n\t\t}\r\n\t\tint mincost=Integer.MAX_VALUE;\r\n\t\tfor(int k=start;k<end;k++)\r\n\t\t{\r\n\t\t\tint cost=minCoststore(dimensions,start,k,storage)+minCoststore(dimensions,k+1,end,storage)+\r\n\t\t\t\t\tdimensions[start-1]*dimensions[k]*dimensions[end];\r\n\t\t\tif(cost<mincost)\r\n\t\t\t{\r\n\t\t\t\tmincost=cost;\r\n\t\t\t}\r\n\t\t}\r\n\t\tstorage[start][end]=mincost;\r\n\t\treturn mincost;\r\n\t}", "abstract void assignZero();", "abstract void assign(int i);", "public void setDomain(Concept _domain) { domain = _domain; }", "public void setNX(int nx){\n newX=nx;\n }", "private void setMin(int min) { this.min = new SimplePosition(false,false,min); }", "public void insert(int value) {\r\n\t\tif (this.empty) {\r\n\t\t\tthis.empty = false;\r\n\t\t\tthis.size++;\r\n\t\t\tHeapTreesArray[0] = new HeapNode(value);\r\n\t\t\tthis.min = HeapTreesArray[0];\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tHeapNode hN = new HeapNode(value);\r\n\t\tBinomialHeap bH = new BinomialHeap();\r\n\t\tbH.insert(value);\r\n\t\tthis.meld(bH);\r\n\t\tif (this.min.value > value) {\r\n\t\t\tthis.min = hN;\r\n\t\t}\r\n\t}", "protected void mapValueToWithinBounds() {\n if (getAllele() != null) {\n \tFloat d_value = ( (Float) getAllele());\n if (d_value.isInfinite()) {\n // Here we have to break to avoid a stack overflow.\n // ------------------------------------------------\n return;\n }\n // If the value exceeds either the upper or lower bounds, then\n // map the value to within the legal range. To do this, we basically\n // calculate the distance between the value and the float min,\n // then multiply it with a random number and then care that the lower\n // boundary is added.\n // ------------------------------------------------------------------\n if (d_value.floatValue() > m_upperBound ||\n d_value.floatValue() < m_lowerBound) {\n RandomGenerator rn;\n if (getConfiguration() != null) {\n rn = getConfiguration().getRandomGenerator();\n }\n else {\n rn = new StockRandomGenerator();\n }\n setAllele(new Float((rn.nextFloat()\n * ((m_upperBound - m_lowerBound))) + m_lowerBound));\n }\n }\n }", "public void insertValue(Integer variable, Integer currentValue) {\n variables.put(variable, new ImmutablePair<>(currentValue, currentValue));\n }", "public abstract void assign(ParameterVector pv) throws SolverException;", "public static int setDimension( int d ) {\n int temp = DPoint.d;\n DPoint.d = d;\n return temp;\n }", "VarAssignment createVarAssignment();", "public void setSpaceAt(int x, int y, int val){\n grids[x][y].setValue(val);\n }", "private Type set_value_type(Node n, long xx ) {\n Type[] alltypes = Type.ALL_TYPES();\n _gvn.setype(_ins[0], alltypes[xx(xx,0)]);\n _gvn.setype(_ins[1],((ConNode)_ins[1])._t = alltypes[xx(xx,1)]);\n _gvn.setype(_ins[2],((ConNode)_ins[2])._t = alltypes[xx(xx,2)]);\n _gvn.setype(_ins[3],((ConNode)_ins[3])._t = alltypes[xx(xx,3)]);\n Type vt = n.value(_gvn);\n Type old = _values.put(xx,vt);\n assert old==null;\n return vt;\n }", "public void setLocalSize(int size);", "public double getDomainMin1() throws IllegalStateException {\n\treturn -Double.MAX_VALUE;\n }", "public void assign(double x, double y, double z) {\n xCoord = x;\n yCoord = y;\n zCoord = z;\n }", "void setFirstValueFreeAt(int x, int y) {\n \tboolean tr = false;\n \tif (state[--y][--x] == 'X') {\n \t\tstate[y][x] = '.';\n \t\tfor (int i = 0; i < state.length && !tr; i++) {\n\t\t\t\tfor (int j = 0; j < state[0].length && !tr; j++) {\n\t\t\t\t\tif (state[i][j] == '.' && i != y && j != x) {\n\t\t\t\t\t\tstate[i][j] = 'X';\n\t\t\t\t\t\ttr = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n \t}\n \tsetValueFreeAt(++x, ++y);\n }", "IntVar selectVariable(IntVar[] v) {\r\n\r\n if (v.length != 0) {\r\n int index = 0;\r\n int smallestDomain = Integer.MAX_VALUE;\r\n for(int i = 0; i< v.length-1; i++){\r\n if(v[i].domain.getSize()<smallestDomain){\r\n index = i;\r\n smallestDomain = v[i].domain.getSize();\r\n }\r\n\r\n }\r\n if(v[index].min() == v[index].max()){\r\n\r\n searchVariables = new IntVar[v.length-1];\r\n for (int i = 0; i < v.length-1; i++) {\r\n if(i<index){\r\n searchVariables[i] = v[i];\r\n }\r\n else searchVariables[i] = v[i+1];\r\n\r\n }\r\n }\r\n else{\r\n searchVariables = new IntVar[v.length];\r\n for(int i = 0; i < v.length; i++){\r\n searchVariables[i] = v[i];\r\n }\r\n }\r\n return v[index];\r\n\r\n }\r\n else {\r\n System.err.println(\"Zero length list of variables for labeling\");\r\n return new IntVar(store);\r\n }\r\n }", "public abstract void insertRange(int start, double value, int count,\r\n int validSize);", "public void assign(int indice, T element) {\r\n\t\tif (theHeap.size() == 0 || indice > theHeap.size()) {\r\n\t\t\ttheHeap.add(element);\r\n\t\t} else {\r\n\t\t\ttheHeap.add(indice, element);\r\n\t\t}\r\n\t}", "public void setValue(int size) {\n s.setValue(-size);\n }", "public abstract int getMinimumValue();", "public void divideDomain(){\n \tfor (int i = 0 ; i < getBoardSize() ; i++)\n \t\tfor (int j = 0 ; j < getBoardSize() ; j++){\n\t\t\tgetPoint(i, j).setHolder(GoPlayer.UNKNOWN);\n\t\t}\n\n \t\tfor (int i = 0 ; i < getBoardSize() ; i++)\n \t\tfor (int j = 0 ; j < getBoardSize() ; j++){\n if (getPoint(i, j).getHolder() == GoPlayer.UNKNOWN){\n \tif (getPoint(i, j).getState() == GoPoint.BLACK){\n getPoint(i, j).setHolder(GoPlayer.BLACK);\n \t}\n \telse if (getPoint(i, j).getState() == GoPoint.WHITE){\n getPoint(i, j).setHolder(GoPlayer.WHITE);\n \t}\n \telse {\n \t\tVector v = getBody(i,j);\n \t\tfindSpaceHolder(v);\n \t}\n }\n\t\t}\n }", "private void assignSpacePerimeter()\n {\n\n }", "public void setX(int x) { loc.x = x; }", "protected <E> String MinRemainingValue(CSP<E> csp, Assignment<E> assignment) {\r\n\t\tString var=\"\";\r\n\t\tint minVar=100;\r\n\t\tfor(String i:csp.variables){\r\n\t\t\tif(!assignment.containsKey(i)){\r\n\t\t\t\tint min = csp.domains.get(i).size();\r\n\t\t\t\tif(min<=minVar) {\r\n\t\t\t\t\tif(min==minVar) {\r\n\t\t\t\t\t\tString varLess=OneDegreeHeuristics(csp,i,var);\r\n\t\t\t\t\t\tminVar=csp.domains.get(varLess).size();;\r\n\t\t\t\t\t\tvar=varLess;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tminVar=min;\r\n\t\t\t\t\t\tvar=i;\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn var;\t\r\n\t}", "public Comparable<?> a(DiscreteDomain<Comparable<?>> discreteDomain) {\n return discreteDomain.minValue();\n }", "public int asignacionMemoriaEnteraDim(int value, int size){\n int i = 0;\n while(i<size){\n memoriaEntera[enteroAct] = value;\n enteroAct = enteroAct + 1;\n i++;\n }\n return inicioMem + enteroAct - size;\n }", "public Expression assign(String var, Expression expression) {\n Cos p = new Cos(this.getExp().assign(var, expression));\n return p;\n }", "public void setMinValue(double x) {\r\n\t\tminValue = x;\r\n\t}", "public void setX(int x){ xPosition = x; }", "public void update_domain(int value, int lowerBound, int upperBound) {\n domain_history.push(domain.copy());\n domain.getDomain().remove((Integer) value);\n domain.getDomain().removeIf(d -> d > upperBound || d < lowerBound);\n }", "public void setFixedValueAt(Integer position, LikelyValue likelyValue)\r\n {\r\n this.fixedValueMap.put(position, likelyValue);\r\n }", "public abstract void setRange(double value, int start, int count);", "public void set_min(byte value) {\n setSIntBEElement(offsetBits_min(), 8, value);\n }", "public Variable getVariableContaining(int offset);", "E minVal();", "public void setLowerBound (int lowerBound) throws ModelException;", "public void setMinValue(int x) {\r\n\t\tminValue = x;\r\n\t}", "public void setValue(int n) {\r\n Throwable t = new Throwable();\r\n t.printStackTrace();\r\n int newValue = Math.max(n, min);\r\n if (newValue + getExtent() > max) {\r\n newValue = max - getExtent();\r\n }\r\n\r\n setRangeProperties(newValue, getExtent(), min, max, isAdjusting);\r\n }", "public void setBounds(int var1, int var2, int var3, int var4) {\n if(var1 < 0) {\n var1 = 0;\n }\n\n if(var2 < 0) {\n var2 = 0;\n }\n\n if(var3 > this.field_723) {\n var3 = this.field_723;\n }\n\n if(var4 > this.field_724) {\n var4 = this.field_724;\n }\n\n this.field_745 = var1;\n this.field_743 = var2;\n this.field_746 = var3;\n this.field_744 = var4;\n }", "@Test\n public final void testSetSize() {\n int expRes = 5;\n int falseEnter = -4;\n ship.setSize(falseEnter);\n int result = this.ship.getSize();\n assertEquals(expRes, result);\n falseEnter = -1;\n ship.setSize(falseEnter);\n result = this.ship.getSize();\n assertEquals(expRes, result);\n }", "public void assign (String name, int value){\n Closure exist = find_var(name);\n exist.getValues().put(name, new IntegerValue(value));\n }", "private void putVariable(String memVar, int value){\n\t\tram[Integer.parseInt(\n\t\t\t\tCharacter.toString(memVar.charAt(1)))]\n\t\t\t\t= value;\n\t}", "public void set(double d);", "public double getLeft(double min) {\n return min - this.size; \n }", "public static IntStrategy minDom_UB(IntVar... VARS) {\n return custom(minDomainSize_var_selector(), max_value_selector(), VARS);\n }", "public void SetMinVal(int min_val);", "public void assignValue (String variable, String x) {\n Map.Entry<String, Value> var = findVariable(variable);\n if (var != null) {\n if (var.getValue().getType() == Value.Type.STRING)\n var.getValue().setValue(x);\n else if (var.getValue().getType() == Value.Type.REAL && x.contains(\".\"))\n try {\n var.getValue().setValue(Double.parseDouble(x));\n } catch (Exception e) {\n throw new RuntimeException(\"Error Type mismatch\");\n }\n else if (var.getValue().getType() == Value.Type.INT)\n try {\n var.getValue().setValue(Integer.parseInt(x));\n } catch (Exception e) {\n throw new RuntimeException(\"Error Type mismatch\");\n }\n else if (var.getValue().getType() == Value.Type.BOOL) {\n try {\n var.getValue().setValue(Boolean.parseBoolean(x));\n } catch (Exception e) {\n throw new RuntimeException(\"Error Type mismatch\");\n }\n } else\n throw new RuntimeException(\"Error: Type mismatch\");\n } else {\n throw new RuntimeException(\"Error: Variable was not declared\");\n }\n }", "public Expression assign(String var, Expression expression) {\n return new Cos(super.getExpression().assign(var, expression));\n }", "protected final void setP(IntervalNode x) {\n\tthis.p = x;\n\n\t// recalc max and min\n\tsetMax();\n\tsetMin();\n }", "public void setX(Double x);", "public void setHighestVariable(int v) {\n\t\tHighestVariable = (HighestVariable + v);\n\t}", "void setNilFractionalMinimum();", "Double getMinimumValue();", "private int deadZone(int value, int minValue)\n\t{\n\t\tif (Math.abs(value) < minValue) value = 0;\n\t\t\n\t\treturn value;\n\t}", "public LinearConstraint putVariable(Object var, Double value) {\n constraints.put(var, value);\n return this;\n }", "public void sett(int pos, T x);", "public void setLeftVector(Vector u) throws IncorrectSpaceException {\n if (u.getSpace() != outputSpace) {\n throw new IncorrectSpaceException();\n }\n this.u = u;\n }", "public abstract void assign(Object value) throws IllegalStateException, InterruptedException;", "public void setDimX (int value)\n {\n m_dim_x = value;\n }", "public void setMinimum(int n) {\r\n int newMax = Math.max(n, max);\r\n int newValue = Math.max(n, getValue());\r\n int newExtent = Math.min(newMax - newValue, getExtent());\r\n setRangeProperties(newValue, newExtent, n, newMax, isAdjusting);\r\n }", "abstract void assignOne();", "public final synchronized void mo39719a(C15630dn dnVar) {\n this.f40700A = dnVar;\n }", "public void setCenterX(double x) { centerX.set(clamp(x, X_MIN, X_MAX)); }", "public void setMin(Vect3d min) {\r\n this.min = min;\r\n }", "public static Double SmallX() {\n return SmallX;\n }", "private void smem_variable_set(smem_variable_key variable_id, long variable_value) throws SQLException\n {\n final PreparedStatement var_set = db.var_set;\n \n var_set.setLong(1, variable_value);\n var_set.setInt(2, variable_id.ordinal());\n \n var_set.execute();\n }", "public Expression assign(String var, Expression expression) {\r\n // if this variable is val no meter if is capital or small letter.\r\n if (this.variable.equalsIgnoreCase(var)) {\r\n return expression;\r\n }\r\n return this;\r\n }", "public void MIPSme()\n\t{\n\t\t\n\t\tTEMP varAddress = null;\n\t\t//v := v - this is the right side of the assignment - we want to load the value of v from memory\n\t\tif (isRight){\n\t\t\tif(isParamFromStack){\n\t\t\t\t// we want value from stack\n\t\t\t\tsir_MIPS_a_lot.getInstance().loadFromFrame(dst,(this.localVarOffset+1)*4);\n\t\t\t}\n\t\t\t//need to be modified\n\t\t\telse{\n\t\t\t\tsir_MIPS_a_lot.getInstance().loadFromFrame(dst,-(this.localVarOffset+1)*4);\n\t\t\t}\n\t\t}\n\t\t//left side - we want to get variable address into temp t \n\t\telse{\n\t\t\t//variable is a parameter of a function\n\t\t\tif (isParamFromStack){\n\t\t\t\tvarAddress = sir_MIPS_a_lot.getInstance().addressParamVar(this.localVarOffset);\n\t\t\t}\n\t\t\t//for now it represents local variable but need to be changed.... (data members, globals...) \n\t\t\telse{\n\t\t\t\tvarAddress = sir_MIPS_a_lot.getInstance().addressLocalVar(this.localVarOffset);\n\t\t\t}\n\t\t\tsir_MIPS_a_lot.getInstance().move(dst,varAddress);\n\t\t}\n\t}", "private void assignUninitialisedGlobalVar(Variable lastAppearanceOfVar,String valueName)throws\r\n\t\t\tTypeNotSupportedException{\r\n\t\t\tVariable variablesCopy = vFactory.createVariable(true, false, lastAppearanceOfVar.isArgument(),\r\n\t\t\t\t\tlastAppearanceOfVar.getType(), true);\r\n\t\t\tuninitialisedGlobalVariables.put(valueName, variablesCopy);\r\n\t}", "public void setLow(double value){low = value;}", "public void insertFirst(int val) {\r\n\t\tif(isFull()) return;\r\n\t\t// If we are inserting at front end for the first time, then make it point to front of the array, that is maxSize. i treated maxsize-1 index as front end\r\n\t\telse if(front==-1 || front ==0) front = maxSize-1;\r\n\t\t// else decrement the front pointer, maxSize is for dealing with negative values\r\n\t\telse front = (front+maxSize-1)%maxSize;\r\n\t\tarr[front] = val;\r\n\t}", "@Test\n public final void testNormalSetPositionStart() {\n int expResX = 2;\n int expResY = 3;\n int resultX = ship.getX();\n int resultY = ship.getY();\n assertEquals(expResX, resultX);\n assertEquals(expResY, resultY);\n // Ship s = new Ship(1, true, 4, 5);\n IShip s = createShip(1, true, 4, 5);\n expResX = 4;\n expResY = 5;\n resultX = s.getX();\n resultY = s.getY();\n assertEquals(expResX, resultX);\n assertEquals(expResY, resultY);\n }", "public void clamp() //TODO: implement\n {\n System.out.println(\"clamp was called!\"); //DEBUGG: check if called, delete if i know when\n /*\n IntegerVectorSpecies _species = (IntegerVectorSpecies)species;\n for (int i = 0; i < genomeLength(); i++)\n {\n int minGene = (int)_species.minGene(i);\n if (genome[i].getValue() < minGene)\n genome[i].setValue(minGene); //what do do for the TraceID?\n else\n {\n int maxGene = (int)_species.maxGene(i);\n if (genome[i].getValue() > maxGene)\n genome[i] = maxGene;\n }\n }\n\n */\n }", "public void fillVector(){\n int n = min.length;\n for (int i = 0; i < n; i++) {\n this.x[i] = min.x[i] + (max.x[i] - min.x[i])*rn.uniformDeviate();\n }\n }", "public void insertValue(int value) {\n if (arraySize < 50) {\n theArray[arraySize] = value;\n arraySize++;\n }\n }", "public void dim(int value) {\n\n\t}", "public node_data heapExtractMin(){\n\t\tdouble min = _positiveInfinity;\n\t\tnode_data v=null;\n\t\tif (!isEmpty()){\n\t\t\tv = _a[0];\n\t\t\tmin = v.getWeight();\n\t\t\t_a[0]=_a[_size-1];\n\t\t\t_size = _size-1;\n\t\t\tminHeapify(0, _size);\n\t\t}\n\t\treturn v;\n\t}", "private Node put(Node x, Point2D p, Value val, boolean test) {\n\t\tif (x == null) {\n\t\t\tsize++;\n\t\t\treturn new Node(p, val,\n\t\t\t\t\tnew RectHV(-Double.MAX_VALUE, -Double.MAX_VALUE, Double.MAX_VALUE, Double.MAX_VALUE));\n\t\t}\n\t\t// decides where to place to point\n\t\tdouble comp = comparePoints(x, p, test);\n\t\tif (comp < 0)\n\t\t\tx.left = put(x.left, p, val, !test);\n\t\telse if (comp > 0)\n\t\t\tx.right = put(x.right, p, val, !test);\n\t\telse if (x.point.equals(p))\n\t\t\tx.val = val;\n\t\telse\n\t\t\tx.right = put(x.right, p, val, !test);\n\t\treturn x;\n\n\t}", "public void setX(double val) {\r\n\t\t this.xCoord = val;\r\n\t }", "public void insert(Integer x) {\n pq[++N] = x;\n swim(N);\n }", "void setLowNode(Node n){\n low = n;\n }", "void setFullPelForwardVector(int value)\n {\n forwardVector.setFullPel(value);\n }", "public Space(int value)\n {\n this._valuesToPut = new ArrayList<>();\n this._defaultSpace = true;\n this._lock = true;\n AddValue(value);\n }", "public void putValue(double value) {\n\t\tdata[size] = value;\n\t\tsize++;\n\t\tsize %= limit;\n\t}", "public com.dj.model.avro.LargeObjectAvro.Builder setVar104(java.lang.Float value) {\n validate(fields()[105], value);\n this.var104 = value;\n fieldSetFlags()[105] = true;\n return this;\n }", "private static final EvaluationAccessor min(EvaluationAccessor operand, EvaluationAccessor[] arguments) {\r\n EvaluationAccessor result = null;\r\n Value oVal = operand.getValue();\r\n if (oVal instanceof ContainerValue) {\r\n ContainerValue cont = (ContainerValue) oVal;\r\n IDatatype contType = ((Container) cont.getType()).getContainedType();\r\n int contSize = cont.getElementSize();\r\n \r\n if (contSize > 0) {\r\n Value rValue = null;\r\n \r\n // Determine min for number containers \r\n if (contType.isAssignableFrom(RealType.TYPE)) {\r\n // Handle min for Reals\r\n double min = (Double) cont.getElement(0).getValue();\r\n for (int i = 1; i < contSize; i++) {\r\n double tmp = (Double) cont.getElement(i).getValue();\r\n if (tmp < min) {\r\n min = tmp;\r\n }\r\n }\r\n \r\n try {\r\n rValue = ValueFactory.createValue(contType, min);\r\n } catch (ValueDoesNotMatchTypeException e) {\r\n EASyLoggerFactory.INSTANCE.getLogger(GenericNumberOperations.class, Bundle.ID)\r\n .debug(e.getMessage());\r\n }\r\n } else if (contType.isAssignableFrom(IntegerType.TYPE)) {\r\n // Handle min for Reals\r\n int min = (Integer) cont.getElement(0).getValue();\r\n for (int i = 1; i < contSize; i++) {\r\n int tmp = (Integer) cont.getElement(i).getValue();\r\n if (tmp < min) {\r\n min = tmp;\r\n }\r\n }\r\n \r\n // Create min value\r\n try {\r\n rValue = ValueFactory.createValue(contType, min);\r\n } catch (ValueDoesNotMatchTypeException e) {\r\n EASyLoggerFactory.INSTANCE.getLogger(GenericNumberOperations.class, Bundle.ID)\r\n .debug(e.getMessage());\r\n }\r\n }\r\n \r\n if (null != rValue) {\r\n result = ConstantAccessor.POOL.getInstance().bind(rValue, operand.getContext());\r\n }\r\n }\r\n }\r\n return result;\r\n }", "public void fill(float value) {\n for (int i = 0; i < storage.length; i++) {\n storage[i] = value;\n }\n }", "public int GetMinVal();", "public void set(int index,Fraction x)\r\n\t{\r\n\t\tif(index<0 || index >=n)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Invalid index\");\r\n\t\t}\r\n\t\telse\r\n\t\t\ta[index]=x;\r\n\t}", "public abstract double set\r\n ( DataID dID // input\r\n , double value // input\r\n );", "public static VariableSelector<IntVar> maxDomainSize_var_selector() {\n return new AntiFirstFail();\n }", "public void setDistanceToStart(double val) {\r\n startDistance = val;\r\n }", "protected abstract int getInitialValue();", "public void assign(Position p) {\n xCoord = p.xCoord;\n yCoord = p.yCoord;\n zCoord = p.zCoord;\n }" ]
[ "0.5165434", "0.51501155", "0.4936752", "0.49239764", "0.48818427", "0.48681837", "0.48418492", "0.4801046", "0.47878015", "0.47866282", "0.47722945", "0.4725808", "0.47209722", "0.47203887", "0.4704475", "0.4690621", "0.46855113", "0.46779945", "0.466965", "0.46683824", "0.46523818", "0.4648216", "0.464389", "0.46249247", "0.46246046", "0.4604849", "0.45928904", "0.45920545", "0.45911244", "0.45827296", "0.45827127", "0.45720693", "0.4569646", "0.45295474", "0.4527673", "0.45245832", "0.4524538", "0.4516302", "0.45144755", "0.4505161", "0.45045716", "0.44976845", "0.44946146", "0.44931358", "0.44914827", "0.44854364", "0.44835567", "0.44835085", "0.44653162", "0.44576004", "0.44480205", "0.44466045", "0.44460475", "0.4440012", "0.4435606", "0.44283944", "0.44282964", "0.4427533", "0.4426674", "0.4422056", "0.44203463", "0.44187805", "0.4414865", "0.44145536", "0.4411043", "0.44094676", "0.44071886", "0.4405443", "0.43985817", "0.43959475", "0.43937433", "0.43834236", "0.43803617", "0.43777344", "0.43754557", "0.43705267", "0.4366865", "0.43645954", "0.43637222", "0.43636352", "0.43616468", "0.43592635", "0.4358809", "0.4353428", "0.43519855", "0.43503857", "0.43471277", "0.43436664", "0.4340256", "0.43324172", "0.43300337", "0.43279865", "0.43256646", "0.43231732", "0.43223497", "0.4320774", "0.43161485", "0.4315966", "0.43097246", "0.43073058" ]
0.45833895
29
Splits the domain of the variable of largest domain
public static IntStrategy maxDom_Split(IntVar... VARS) { return dichotomic(maxDomainSize_var_selector(), true, VARS); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Variable useHeuristic(Deque<Variable> deque) {\n Variable highDomain = deque.getFirst();\n for (Variable var : deque){\n if (var.getDomain().size() > highDomain.getDomain().size()){\n highDomain = var;\n }\n }\n return highDomain;\n }", "@Test\n public void testSplitDomain2() {\n System.out.println(\"splitDomain2\");\n String domain = \"example.com\";\n Map<URLParser.DomainParts, String> expResult = new HashMap<>();\n expResult.put(URLParser.DomainParts.TLD, \"com\");\n expResult.put(URLParser.DomainParts.DOMAINNAME, \"example\");\n expResult.put(URLParser.DomainParts.SUBDOMAIN, null);\n \n \n Map<URLParser.DomainParts, String> result = URLParser.splitDomain(domain);\n assertEquals(expResult, result);\n }", "@Test\n public void testSplitDomain3() {\n System.out.println(\"splitDomain3\");\n String domain = \"www.example.com\";\n Map<URLParser.DomainParts, String> expResult = new HashMap<>();\n expResult.put(URLParser.DomainParts.TLD, \"com\");\n expResult.put(URLParser.DomainParts.DOMAINNAME, \"example\");\n expResult.put(URLParser.DomainParts.SUBDOMAIN, \"www\");\n \n \n Map<URLParser.DomainParts, String> result = URLParser.splitDomain(domain);\n assertEquals(expResult, result);\n }", "@Test\n public void testSplitDomain1() {\n System.out.println(\"splitDomain1\");\n String domain = \"www.cars.example.co.uk\";\n Map<URLParser.DomainParts, String> expResult = new HashMap<>();\n expResult.put(URLParser.DomainParts.TLD, \"co.uk\");\n expResult.put(URLParser.DomainParts.DOMAINNAME, \"example\");\n expResult.put(URLParser.DomainParts.SUBDOMAIN, \"www.cars\");\n \n \n Map<URLParser.DomainParts, String> result = URLParser.splitDomain(domain);\n assertEquals(expResult, result);\n }", "public void divideDomain(){\n \tfor (int i = 0 ; i < getBoardSize() ; i++)\n \t\tfor (int j = 0 ; j < getBoardSize() ; j++){\n\t\t\tgetPoint(i, j).setHolder(GoPlayer.UNKNOWN);\n\t\t}\n\n \t\tfor (int i = 0 ; i < getBoardSize() ; i++)\n \t\tfor (int j = 0 ; j < getBoardSize() ; j++){\n if (getPoint(i, j).getHolder() == GoPlayer.UNKNOWN){\n \tif (getPoint(i, j).getState() == GoPoint.BLACK){\n getPoint(i, j).setHolder(GoPlayer.BLACK);\n \t}\n \telse if (getPoint(i, j).getState() == GoPoint.WHITE){\n getPoint(i, j).setHolder(GoPlayer.WHITE);\n \t}\n \telse {\n \t\tVector v = getBody(i,j);\n \t\tfindSpaceHolder(v);\n \t}\n }\n\t\t}\n }", "double[] getSplitRatios();", "public Comparable<?> b(DiscreteDomain<Comparable<?>> discreteDomain) {\n return discreteDomain.maxValue();\n }", "public AVLTree[] split(int x)\r\n\t {\r\n\t\t AVLTree[] splitedTrees = new AVLTree[2];\r\n\t\t splitedTrees[0] = new AVLTree();\r\n\t\t splitedTrees[1] = new AVLTree();\r\n\t\t if(!this.root.isRealNode()) \r\n\t\t\t return splitedTrees;\r\n\t\t \r\n\t\t IAVLNode nodeX = searchFor(this.root, x);\r\n\t\t splitedTrees = splitLoop(nodeX,splitedTrees);\r\n\t\t return splitedTrees;\r\n\t\t \r\n\t\t }", "public double getDomainMax2() throws IllegalStateException {\n\treturn Double.MAX_VALUE;\n }", "public Long getDomain()\n\t{\n\t\treturn domain;\n\t}", "public void testFindDomainBounds() {\n XYBlockRenderer renderer = new XYBlockRenderer();\n XYSeriesCollection dataset = new XYSeriesCollection();\n XYSeries series = new XYSeries(\"S1\");\n series.add(1.0, null);\n dataset.addSeries(series);\n Range r = renderer.findDomainBounds(dataset);\n dataset.removeAllSeries();\n r = renderer.findDomainBounds(dataset);\n }", "int getSplitAxis();", "public IDomain[] getDomainComponents();", "public double getDomainMax1() throws IllegalStateException {\n\treturn Double.MAX_VALUE;\n }", "private IndividualGroupList adaptativeSplitIntoGroups(List<Individual> individuals) \n {\n int individualCount = individuals.size();\n\n IndividualGroupList groups = new IndividualGroupList();\n IndividualGroup group = new IndividualGroup();\n int currentGroupSize = 8;\n \n for (int i = 0; i < individualCount; i++)\n {\n Individual individual = individuals.get(i);\n\n int individualGroupSize = getGroupSize(individual.getPositiveProbability());\n\n if (individualGroupSize != currentGroupSize || group.countIndividuals() == currentGroupSize)\n {\n groups.add(group);\n group = new IndividualGroup();\n currentGroupSize = individualGroupSize;\n }\n\n group.add(individual);\n }\n\n if (group.countIndividuals() > 0)\n groups.add(group);\n \n return groups;\n }", "public int h(Variable n)\n {\n int h = n.getDomain().size();\n return h;\n }", "private void splitArrayB() {\r\n //find upper bound. anything below goes within.\r\n //calculate highest A, loop through b til above that, then iterate b index til at end of b\r\n int a_count = 0;\r\n int b_count = 0;\r\n int highA = A[splitA[a_count]];\r\n boolean first = true;\r\n for(int i = 0; i < B.length; i++){\r\n if(highA >= B[i]){\r\n first = false;\r\n }\r\n else if(highA < B[i]){\r\n if(first == false){\r\n splitB[b_count] = i - 1;\r\n b_count++;\r\n highA = A[splitA[a_count]];\r\n a_count++;\r\n }\r\n else{\r\n while(a_count != splitA.length){\r\n if(highA < B[i]){\r\n splitB[b_count] = - 1;\r\n b_count++;\r\n a_count++;\r\n highA = A[splitA[a_count]];\r\n }\r\n else{\r\n splitB[b_count] = i;\r\n b_count++;\r\n a_count++;\r\n highA = A[splitA[a_count]];\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if(b_count != splitB.length){\r\n splitB[b_count] = splitB.length - 1;\r\n b_count++;\r\n while(b_count < splitB.length){\r\n splitB[b_count] = -1;\r\n b_count++;\r\n }\r\n return;\r\n }\r\n splitB[b_count - 1] = b_count - 1;\r\n }", "public int domainDimension() {\n return dvModel.totalParamSize();\r\n }", "public Object getDomain ();", "private ArrayList<Integer> fillDomain() {\n ArrayList<Integer> elements = new ArrayList<>();\n\n for (int i = 1; i <= 10; i++) {\n elements.add(i);\n }\n\n return elements;\n }", "protected String maskTopLevelDomainByX(String address, int splitAddress, int splitDomain) {\n StringBuilder sb = new StringBuilder(address);\n\n ArrayList<Integer> indexes = getPointPostions(address, splitAddress);\n\n for (Integer index : indexes) {\n for (int i = splitAddress + 1; i < index; i++)\n sb.setCharAt(i, 'X');\n splitAddress = index;\n }\n return sb.toString();\n }", "public Bounds[] subdivide() {\n return new Bounds[] {\n getSubdivision(0, 0, 0), getSubdivision(1, 0, 0), getSubdivision(0, 0, 1), getSubdivision(1, 0, 1),\n getSubdivision(0, 1, 0), getSubdivision(1, 1, 0), getSubdivision(0, 1, 1), getSubdivision(1, 1, 1)\n };\n }", "@Override\n public Map<Boolean, Sort> split2 (int delim) {\n int subcl = 0, offset=0;//index of the non-single-values sub-intv, and marker offset\n if (isSplit()) //the class is partitioned in subclasses\n for (int j =0; j < this.constraints.length; j++) //we seek the non-single-values sub-intv\n if (this.constraints[j].singleValue()) \n offset += this.constraints[j].lb();\n else \n subcl = j;\n \n return split2(delim - offset, subcl + 1);\n }", "public Concept getDomain() { return domain; }", "public abstract double[] getUpperBound();", "String getDomain();", "private boolean isValidDomain(String domain) {\r\n\t\tif (domain.length() >= 3) {\r\n\t\t\tString[] tokens = domain.split(\"\\\\.\");\r\n\t\t\tif (Character.isLetter(tokens[0].charAt(0)) && tokens.length >= 2\r\n\t\t\t\t\t&& tokens[0].length() >= 0 && tokens[1].length() >= 0)\r\n\t\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public interface AxisSplitter<P> {\n\t/**\n\t * Given the a set of points, select the axis to split the data along and select a point to divide the data.\n\t * Points whput items below the threshold\n\t * into left and above into right. Data is optional and should be ignored if null. The selected\n\t *\n\t * @param points Input: Set of points.\n\t * @param indexes Input: (Optional) Option index asssociated with points. Can be null.\n\t * @param left Output: Storage for points less than the split point.\n\t * @param leftIndexes Output: (Optional) Storage for indexes associated with left. Can be null.\n\t * @param right Output: Storage for points more than the split point.\n\t * @param righrIndexes Output: (Optional) Storage for indexes associated with right. Can be null.\n\t */\n\tvoid splitData( List<P> points , @Nullable GrowQueue_I32 indexes ,\n\t\t\t\t\tList<P> left , @Nullable GrowQueue_I32 leftIndexes ,\n\t\t\t\t\tList<P> right , @Nullable GrowQueue_I32 righrIndexes );\n\n\t/**\n\t * Returns the point used to split the data\n\t */\n\tP getSplitPoint();\n\n\t/**\n\t * Index associated with the split point\n\t */\n\tint getSplitIndex();\n\n\t/**\n\t * The axis/dimension that the input list was split on\n\t */\n\tint getSplitAxis();\n\n\t/**\n\t * Number of elements in a point\n\t */\n\tint getPointLength();\n}", "private Set<Variable> extractBlockedDomainVars(Variable rangeVariable, ImmutableSet<Variable> domainVariables,\n ImmutableSet<Variable> aggregationVariables) {\n if (aggregationVariables.contains(rangeVariable))\n return domainVariables;\n\n Sets.SetView<Variable> aggregationDomainVariables = Sets.intersection(domainVariables, aggregationVariables);\n\n // Equalities from an aggregation variable to a grouping variable are blocked\n if (groupingVariables.contains(rangeVariable))\n return aggregationDomainVariables;\n\n // Fresh variables: need at least one variable to become projected\n // the latter may be an aggregation variable if there is no grouping variable\n Variable dominantVariable = aggregationDomainVariables.stream()\n .findAny()\n .orElseGet(() -> domainVariables.iterator().next());\n\n return Sets.difference(aggregationDomainVariables, ImmutableSet.of(dominantVariable));\n }", "com.google.appengine.v1.TrafficSplit getSplit();", "public void update_domain(int value, int lowerBound, int upperBound) {\n domain_history.push(domain.copy());\n domain.getDomain().remove((Integer) value);\n domain.getDomain().removeIf(d -> d > upperBound || d < lowerBound);\n }", "private void getMaxValue(){\n maxValue = array[0];\n for(int preIndex = -1; preIndex<number; preIndex++){\n for(int sufIndex = preIndex+1; sufIndex<=number;sufIndex++){\n long maxTmp = getPrefixValue(preIndex)^getSuffixCValue(sufIndex);\n if(maxTmp>maxValue){\n maxValue = maxTmp;\n }\n }\n }\n System.out.println(maxValue);\n }", "Double maxOfDisplacements(ArrayList<Double> dispA){\r\n\t\tObject minvalobj = Collections.min(dispA);\r\n\t\tObject maxvalobj = Collections.max(dispA);\r\n\t\tIJ.log(\"Max displacement\" + maxvalobj);\r\n\t\tIJ.log(\"Min displacement\" + minvalobj);\r\n\t\tdouble minval = (Double) minvalobj;\r\n\t\tdouble maxval = (Double) maxvalobj;\t\t\r\n\t\tdouble maxdisp = maxval;\r\n\t\tif (Math.abs(maxval) < Math.abs(minval)) \r\n\t\t\tmaxdisp = minval;\r\n\t\telse\r\n\t\t\tmaxdisp = maxval;\t\t\r\n\t\treturn maxdisp;\r\n\t}", "static String getNextDomain(String curDomain) {\n String nextDomain;\n\n int idxCheckedChar = curDomain.length() - 1; // right most character\n char checkedCh;\n\n while (idxCheckedChar >= 0) { // to the first character\n checkedCh = curDomain.charAt(idxCheckedChar);\n if (checkedCh < 'z') { //\n nextDomain = curDomain.substring(0, idxCheckedChar) + (char) (checkedCh + 1)\n + curDomain.substring(idxCheckedChar + 1);\n return nextDomain;\n } else { // last character reaches to 'z'\n // check the left side character\n idxCheckedChar--;\n }\n }\n nextDomain = curDomain + 'a';\n\n return nextDomain;\n }", "void split(Node n,Stack<Long> nodes);", "SubjectType [] getHistoryDomains(Object value) throws PrismsRecordException;", "private String getDomain(String host){\n StringBuffer sb = new StringBuffer(\"\");\r\n try{\r\n StringTokenizer stk = new StringTokenizer(host, \".\");\r\n sb.append(stk.nextToken());\r\n sb.append(\".\");\r\n sb.append(stk.nextToken());\r\n sb.append(\".\");\r\n sb.append(stk.nextToken());\r\n sb.append(\".\");\r\n sb.append(\"*\");\r\n }catch(Exception e){\r\n e.printStackTrace();\r\n }\r\n return sb.toString();\r\n }", "public static int pointFree(double[] numbers){\n String completeString = \"\";\n String redactedString = \"\";\n int newArray[] = new int[numbers.length];\n int greatestValue=0;\n \n \n \n for (double x : numbers) {\n int currentValue;\n \n completeString = String.valueOf(x);\n redactedString = completeString.replaceAll(\"\\\\.\",\"\");\n currentValue = Integer.parseInt(redactedString);\n for (int i = 0; i < newArray.length; i++) {\n \n newArray[i]=currentValue;\n \n \n }\n greatestValue=newArray[0];\n for (int i = 0; i < newArray.length; i++) {\n if(newArray[i]>greatestValue){\n greatestValue=newArray[i];\n \n }\n \n }\n \n \n }\n return greatestValue;\n \n }", "protected <E> List<E> orderDomainValues(CSP<E> csp, String variable, Assignment<E> assignment) {\r\n\t\treturn csp.domains.get(variable);\r\n\t}", "DomainNumber createDomainNumber();", "private static void solve() {\n\t\tList<Integer> rgtMax= new ArrayList<>();\n\t\tList<Integer> lftMax= new ArrayList<>();\n\t\t\n\t\tpopulateRgtMax(rgtMax);\n\t\tpopulateLftMax(lftMax);\n\t\t\t\t\n\t\tint area=findMaxArea(lftMax,rgtMax);\n\t\tSystem.out.println(area);\n\t\t\n\t}", "public VirtualDataSet[] partitionByNumericAttribute(int attributeIndex, int valueIndex) {\n\t\t// WRITE YOUR CODE HERE!\n\n\t\t if(attributes[attributeIndex].getType()==AttributeType.NOMINAL){ \t\t\t\t\t\t\t// avoid passing through nominal value to current method\n return null; \n }\n\t\t\tVirtualDataSet [] partitions = new VirtualDataSet[2]; \t\t\t\t\t\t\t\t\t// creates two split path \n\n\t\t\tdouble split = Double.parseDouble(getValueAt(valueIndex , attributeIndex));\t\t\t// determine the middle number in order to split \n\t\t\t\n\t\t\tLinkedList<Integer> rowsLess = new LinkedList<Integer> (); \t\t\t\t\t\t\t// using linkedlist to do collection of split rows that less than valueIndex value\n\t\t\t\n\t\t\tLinkedList<Integer> rowsMore = new LinkedList<Integer> ();\t\t\t\t\t\t\t\t// using linkedlist to do collection of split rows that less than valueIndex value\n\t\t\t\n\t\t\tint countLess = 0;\n\t\t\tint countMore = 0; \n\n\t\t\tString []arrayOfNums = attributes[attributeIndex].getValues();\n\n\t\t\tfor(int j = 0; j < source.numRows; j++){ \n\t\t\t\t\n\t\t\t\tif(Double.parseDouble(getValueAt(j,attributeIndex)) <= split){ \t\t\t\t// transform from string to integer in order to compare the number smaller than middle number\n\t\t\t\t\t\n\t\t\t\t\trowsLess.add(j);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// add rows that correspond with the current attribute of spliting \n\t\t\t\t\tcountLess++;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// determine the size of partition rows array \n\t\t\t\t}else if(Double.parseDouble(getValueAt(j,attributeIndex)) > split){\t\t\t// transform from string to integer in order to compare the number bigger than middle number\n\t\t\t\t\t\n\t\t\t\t\trowsMore.add(j); \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// add rows that correspond with the current attribute of spliting \n\t\t\t\t\tcountMore++;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// determine the size of partition rows array \n\t\t\t\t}\n\t\t\t}\n\n\t\t\tint [] partitionRowsLess = new int [countLess]; \t\t\t\t\t\t\t\t\t\t// the collection of rows represents all number that smaller than middle number\n\t\t\tint [] partitionRowsMore = new int [countMore]; \t\t\t\t\t\t\t\t\t\t// the collection of rows represents all number that bigger than middle number\n\t\t\tfor(int k = 0; k < countLess; k++){\n\t\t\t\tpartitionRowsLess[k] = rowsLess.poll(); \t\t\t\t\t\t\t\t\t\t\t// transform from linkedlist to array \n\t\t\t}\n\t\t\tfor(int k = 0; k < countMore; k++){\n\t\t\t\tpartitionRowsMore[k] = rowsMore.poll(); \t\t\t\t\t\t\t\t\t\t\t// transform from linkedlist to array \n\t\t\t}\n\t\t\t\n\t\t\tpartitions[0] = new VirtualDataSet(source,partitionRowsLess, attributes); \t\t\t\t// send partition to VirtualDataSet constructor \n\t\t\tpartitions[1] = new VirtualDataSet(source,partitionRowsMore, attributes); \n\t\t\t\n\n\n\t\t\treturn partitions;\n\t\t\n\t}", "private void checkDomainSizes()\n\t{\n\t\tfor (int var = 0; var < domainSizes.size(); var++)\n\t\t{\n\t\t\tif (domainSizes.get(var) < 1)\n\t\t\t{\n\t\t\t\tSystem.err.println(\"Variable \" + var + \" has a domain size of \"\n\t\t\t\t\t\t+ domainSizes.get(var) + \".\");\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t}\n\t}", "public ArrayList<Domain> GetDomain()\r\n\t\t{\r\n\t\t\tArrayList<Domain> res = null;\r\n query.settype(MsgId.GET_DOMAIN);\r\n query.setdomlist(null);\r\n query.setrettype(RetID.INVALID);\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t scon.sendmsg(query);\r\n\t\t\t MessageObject result = (MessageObject) scon.getmsg(query);\r\n\t\t\t \r\n\t\t\t if (result.getrettype() == RetID.DOMAIN_LIST) {\r\n\t\t\t \t res = result.getdomlist();\r\n\t\t\t }\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tHandleException(e, MsgId.GET_DOMAIN);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn res;\r\n\t\t}", "public abstract int getMaximumDividerLocation(JSplitPane jc);", "public double max (double firstside, double secondside, double thirdside){\n \n \n\t \n if(firstside > secondside && firstside > thirdside)\n maxlenght = firstside;\n\t \n if (secondside >firstside && secondside >thirdside)\n maxlenght = secondside;\n\t\telse\n maxlenght = thirdside;\n return maxlenght; \n }", "static MaxSeparation findMaxSeparation(PolygonShape poly1, XForm xf1,\n \t\t\t\t\t\t\t\t\t PolygonShape poly2, XForm xf2) {\n MaxSeparation separation = new MaxSeparation();\n\n int count1 = poly1.m_vertexCount;\n \n // Vector pointing from the centroid of poly1 to the centroid of poly2.\n \tVec2 d = XForm.mul(xf2, poly2.m_centroid).subLocal(XForm.mul(xf1, poly1.m_centroid));\n \tVec2 dLocal1 = Mat22.mulT(xf1.R, d);\n\n \t// Find edge normal on poly1 that has the largest projection onto d.\n int edge = 0;\n float maxDot = -Float.MAX_VALUE;\n for (int i = 0; i < count1; ++i) {\n float dot = Vec2.dot(poly1.m_normals[i], dLocal1);\n if (dot > maxDot) {\n maxDot = dot;\n edge = i;\n }\n }\n\n // Get the separation for the edge normal.\n float s = edgeSeparation(poly1, xf1, edge, poly2, xf2);\n if (s > 0.0f){\n separation.bestSeparation = s;\n return separation;\n }\n\n // Check the separation for the previous edge normal.\n int prevEdge = edge - 1 >= 0 ? edge - 1 : count1 - 1;\n float sPrev = edgeSeparation(poly1, xf1, prevEdge, poly2, xf2);\n if (sPrev > 0.0f) {\n separation.bestSeparation = sPrev;\n return separation;\n }\n\n int nextEdge = edge + 1 < count1 ? edge + 1 : 0;\n float sNext = edgeSeparation(poly1, xf1, nextEdge, poly2, xf2);\n if (sNext > 0.0f){\n separation.bestSeparation = sNext;\n return separation;\n }\n\n // Find the best edge and the search direction.\n int bestEdge;\n float bestSeparation;\n int increment;\n if (sPrev > s && sPrev > sNext) {\n increment = -1;\n bestEdge = prevEdge;\n bestSeparation = sPrev;\n }\n else if (sNext > s){\n increment = 1;\n bestEdge = nextEdge;\n bestSeparation = sNext;\n } else {\n separation.bestFaceIndex = edge;\n separation.bestSeparation = s;\n return separation;\n }\n\n // Perform a local search for the best edge normal.\n while (true) {\n if (increment == -1)\n edge = bestEdge - 1 >= 0 ? bestEdge - 1 : count1 - 1;\n else\n edge = bestEdge + 1 < count1 ? bestEdge + 1 : 0;\n\n s = edgeSeparation(poly1, xf1, edge, poly2, xf2);\n if (s > 0.0f) {\n separation.bestSeparation = s;\n return separation;\n }\n\n if (s > bestSeparation){\n bestEdge = edge;\n bestSeparation = s;\n } else {\n break;\n }\n }\n\n separation.bestFaceIndex = bestEdge;\n separation.bestSeparation = bestSeparation;\n\n return separation;\n }", "static Map<Integer, Set<Integer>> dividersList(int max) {\n Map<Integer, Set<Integer>> resultMap = new TreeMap<>(); // implementacja nowej mapy, jako klucze ma Integery, jako wartosci sety integerów\n for (int i = 1; i < max; i++) {\n resultMap.put(i, getDividers(i)); // i jest kluczem, jako wartość przypisujemy jej dzielniki metodą get dividers\n\n }\n return resultMap;\n }", "public void setDomain(Concept _domain) { domain = _domain; }", "static public Vector2 locationFromDomain(String domain){\n\t\t\n\t\t//remove protocol\n\t\tdomain = domain.substring(domain.indexOf(\"//\")+1);\n\t\t\n\t\t\n\t\tString Xletters = \"\";\n\t\tString Yletters = \"\";\n\t\tint charnum=0;\n\t\t//divide letters\n\t\tfor (char character : domain.toCharArray()) {\n\t\t\t\n\t\t\tif (charnum%2==0){\n\t\t\t\tXletters = Xletters + character;\n\t\t\t} else {\n\t\t\t\tYletters = Yletters + character;\n\t\t\t}\n\t\t\t\n\t\t\t\tcharnum++;\n\t\t}\n\t\t\n\tLog.info(\"Xletters=\"+Xletters);\n\tLog.info(\"Yletters=\"+Yletters);\n\t\t\n\t\tint Xlex = (Xletters.compareTo(\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\")-10)*100;\n\t\tint Ylex = (Yletters.compareTo(\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\")-10)*100;\n\t\t/*\n\t\tint TestValue = \"ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ\".compareTo(\"AAAAAAAAAAAAAAAAAAAAAAA\");\t\t\n\t\tLog.info(\"TestValue=\"+TestValue); 25\n\n\t\t TestValue = \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\".compareTo(\"AAAAAAAAAAAAAAAAAAAAAAA\");\t\t\n\t\tLog.info(\"TestValue=\"+TestValue); 14\n\t\t\n\t\t TestValue = \"AAAAAAAAAAAAAAAAAAA\".compareTo(\"AAAAAAAAAAAAAAAAAAAAAAA\");\t\t\n\t\t\tLog.info(\"TestValue=\"+TestValue); -4\n\t\t\t*/\n\t\treturn new Vector2(Xlex,Ylex);\n\t\t\n\t}", "public String getBaseDomain(String url)\r\n\t{\r\n\t\tString host = getHost(url);\r\n\r\n\t\tint startIndex = 0;\r\n\t\tint nextIndex = host.indexOf('.');\r\n\t\tint lastIndex = host.lastIndexOf('.');\r\n\t\twhile (nextIndex < lastIndex)\r\n\t\t{\r\n\t\t\tstartIndex = nextIndex + 1;\r\n\t\t\tnextIndex = host.indexOf('.', startIndex);\r\n\t\t}\r\n\t\tif(startIndex > 0)\r\n\t\t{\r\n\t\t\treturn host.substring(startIndex);\r\n\t\t} else\r\n\t\t{\r\n\t\t\treturn host;\r\n\t\t}\r\n\t}", "P getSplitPoint();", "public String[] domain(Vec modelResp) {\n return domain(_N, modelResp, _data.vecs()[_classcol], _model_classes_mapping, _data_classes_mapping);\n }", "public int chooseDimension(ArrayList<double[]> partition){\n\t\t// setting max values to a default value\n\t\tint maxDim = -1;\n\t\tdouble maxWidth = 0;\n\t\t\n\t\t/*\n\t\t* for each dimension calculate the width and get the maximum of all the widths\n\t\t*/\n\t\tfor(int i = 0; i < partition.get(0).length; i++){\n\t\t\tdouble width = getWidth(partition, i);\n\t\t\tif(width > maxWidth){\n\t\t\t\tmaxWidth = width;\n\t\t\t\tmaxDim = i;\n\t\t\t}\n\t\t}\n\t\treturn maxDim;\n\t}", "public String getDomain() {\r\n return domain;\r\n }", "@Override\n public IndividualGroupList splitIndividualsIntoGroups(List<Individual> individuals) \n {\n sortByPositiveProbability(individuals);\n return adaptativeSplitIntoGroups(individuals);\n }", "public static BsonDocument createPartitionBounds(final BsonValue lower, final BsonValue upper) {\n BsonDocument partitionBoundary = new BsonDocument();\n if (lower.getBsonType() != BsonType.MIN_KEY) {\n partitionBoundary.append(\"$gte\", lower);\n }\n if (upper.getBsonType() != BsonType.MAX_KEY) {\n partitionBoundary.append(\"$lt\", upper);\n }\n return partitionBoundary;\n }", "public static String getDomain(String nodeId) {\r\n\r\n\t\treturn nodeId.split(\":\")[0];\r\n\t}", "public static int max1Max2(number[] arr, int start, int end){\n\n if(start < end){\n int max1Index = 0;\n int middle = (end+start)/2;\n int index1 = max1Max2(arr, start, middle);\n int index2 = max1Max2(arr, middle+1, end);\n if (arr[index1].getKey() > arr[index2].getKey()){\n arr[index1].getPotentialMax2().push(arr[index2].getKey());\n max1Index = index1;\n }\n else{\n arr[index2].getPotentialMax2().push(arr[index1].getKey());\n max1Index = index2;\n }\n return max1Index; //recursion will arrive to this line at the end after it will split to pairs.\n }\n return start; // when the condition of (start<end) will be false because start==end,\n // it will tell us that the recursion split and arrived to subarray in length 1 (one node)\n // so we will return start\\end and it will enter to index1 / index2 params\n // depend on who calls the function max1Max2 with params of start, middle when\n //middle == start. or middle==end....\n //after this will happen it will get in to the code at lines 37-43 will be executed on the first pair\n //then the next pair and so on, each pair will return to index1 and index2 the index of the bigger\n // number from the pair, and will create new pair and so on\n }", "public static final String getSubDomain(String serverName) {\n\t\tString subDomain = null;\n\t\tboolean hitDomainType = false;\n\n\t\tint i = serverName.length() - 1;\n\n\t\tfor (; i > 0; i--) {\n\t\t\tchar character = serverName.charAt(i);\n\n\t\t\tif (character == '.') {\n\t\t\t\tif (hitDomainType) {\n\t\t\t\t\tsubDomain = serverName.substring(0, i);\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\thitDomainType = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn subDomain;\n\t}", "public double getDomainMin2() throws IllegalStateException {\n\treturn -Double.MAX_VALUE;\n }", "boolean splitAndInsert(T t, Pair<String,LeafNode> ln){\n\n int splitTimes=0;\n\n Interval[] intervals = ln.second().getIntervals();\n assert intervals.length==leafNodeCapacity;\n Interval[] leftIntervals = new Interval[leafNodeCapacity];\n Interval[] rightIntervals = new Interval[leafNodeCapacity];\n Interval[] tempIntervals = null;\n\n int leftIntervalNumber=0;\n int rightIntervalNumber=0;\n TriangleShape lnTriangle = ln.second().triangle;\n String lnString=ln.first();\n TriangleShape leftTriangle=null;\n TriangleShape rightTriangle=null;\n String leftString=null;\n String rightString =null;\n\n while(leftIntervalNumber==0 || rightIntervalNumber==0){\n\n if(splitTimes==10000) {\n System.out.println(\"splitTimes=\"+splitTimes);\n System.out.println(\"you should increase the parameter leafNodeCapaity value!!!\");\n assert false;\n }\n else\n splitTimes++;\n\n leftTriangle=lnTriangle.leftTriangle();\n leftIntervalNumber=0;\n rightIntervalNumber=0;\n\n for(Interval i: intervals){\n if(Geom2DSuits.contains(leftTriangle,i.getLowerBound(),i.getUpperBound())){\n leftIntervals[leftIntervalNumber]=i;\n leftIntervalNumber++;\n }\n else{\n rightIntervals[rightIntervalNumber]=i;\n rightIntervalNumber++;\n }\n }\n\n if(leftIntervalNumber==0){//all located at left side\n rightTriangle = lnTriangle.rightTriangle();\n rightString = lnString+\"1\";\n leftString=lnString+\"0\";\n emptyNodes.add(leftString);\n lnTriangle = rightTriangle;\n lnString=rightString;\n\n tempIntervals=intervals;\n intervals=rightIntervals;\n rightIntervals=tempIntervals;\n }\n else if(rightIntervalNumber==0){//all located at right side\n rightString = lnString+\"1\";\n leftString=lnString+\"0\";\n emptyNodes.add(rightString);\n lnTriangle = leftTriangle;\n lnString=leftString;\n\n tempIntervals=intervals;\n intervals=leftIntervals;\n leftIntervals=tempIntervals;\n }\n else { //spit successfully\n\n leftString=lnString+\"0\";\n LeafNode leftNode = new LeafNode();\n leftNode.intervals=leftIntervals;\n leftNode.size=leftIntervalNumber;\n leftNode.triangle=leftTriangle;\n\n rightString = lnString+\"1\";\n LeafNode rightNode = new LeafNode();\n rightTriangle = lnTriangle.rightTriangle();\n rightNode.triangle=rightTriangle;\n rightNode.size=rightIntervalNumber;\n rightNode.intervals=rightIntervals;\n\n if(leftNode.insert(t)!=1){\n rightNode.insert(t);\n }\n\n Identifier lnPage =leafInfos.remove(ln.first());\n writeNode(leftNode,lnPage);\n Identifier rightPage = CommonSuits.createIdentifier(-1L);\n writeNode(rightNode,rightPage);\n\n leafInfos.put(leftString,lnPage);\n leafInfos.put(rightString,rightPage);\n return true;\n }\n }\n return false;\n }", "private void splitLevels() {\n\t\tint first = 0;\n\t\tfor(int i = 1; i<allCoords.size(); i++) {\n\t\t\tif (allCoords.get(i).z != allCoords.get(i-1).z) {\n\t\t\t\tfor(int j=first; j<i; j++) {\n\t\t\t\t\tcurrentLevel.add(allCoords.get(j));\n\t\t\t\t}\n\t\t\t\tsplitIntoRoots(); // automatically splits the cross section into roots\n\t\t\t\tcurrentLevel.clear();\n\t\t\t\tfirst = i;\n\t\t\t}\n\t\t}\n\t}", "IntVar selectVariable(IntVar[] v) {\r\n\r\n if (v.length != 0) {\r\n int index = 0;\r\n int smallestDomain = Integer.MAX_VALUE;\r\n for(int i = 0; i< v.length-1; i++){\r\n if(v[i].domain.getSize()<smallestDomain){\r\n index = i;\r\n smallestDomain = v[i].domain.getSize();\r\n }\r\n\r\n }\r\n if(v[index].min() == v[index].max()){\r\n\r\n searchVariables = new IntVar[v.length-1];\r\n for (int i = 0; i < v.length-1; i++) {\r\n if(i<index){\r\n searchVariables[i] = v[i];\r\n }\r\n else searchVariables[i] = v[i+1];\r\n\r\n }\r\n }\r\n else{\r\n searchVariables = new IntVar[v.length];\r\n for(int i = 0; i < v.length; i++){\r\n searchVariables[i] = v[i];\r\n }\r\n }\r\n return v[index];\r\n\r\n }\r\n else {\r\n System.err.println(\"Zero length list of variables for labeling\");\r\n return new IntVar(store);\r\n }\r\n }", "public String getDimensionPresupuesto()\r\n/* 217: */ {\r\n/* 218:256 */ OrganizacionConfiguracion aux = AppUtil.getOrganizacion().getOrganizacionConfiguracion();\r\n/* 219:257 */ String numeroDimension = \"\";\r\n/* 220:258 */ if ((!aux.getNombreDimension1().equals(\"\")) && (aux.isIndicadorUsoPresupuestoDimension1()))\r\n/* 221: */ {\r\n/* 222:259 */ this.arregloMascara = aux.getMascaraDimension1().split(\"\\\\.\");\r\n/* 223:260 */ numeroDimension = \"1\";\r\n/* 224: */ }\r\n/* 225:261 */ else if ((!aux.getNombreDimension2().equals(\"\")) && (aux.isIndicadorUsoPresupuestoDimension2()))\r\n/* 226: */ {\r\n/* 227:262 */ this.arregloMascara = aux.getMascaraDimension2().split(\"\\\\.\");\r\n/* 228:263 */ numeroDimension = \"2\";\r\n/* 229: */ }\r\n/* 230:264 */ else if ((!aux.getNombreDimension3().equals(\"\")) && (aux.isIndicadorUsoPresupuestoDimension3()))\r\n/* 231: */ {\r\n/* 232:265 */ this.arregloMascara = aux.getMascaraDimension3().split(\"\\\\.\");\r\n/* 233:266 */ numeroDimension = \"3\";\r\n/* 234: */ }\r\n/* 235:267 */ else if ((!aux.getNombreDimension4().equals(\"\")) && (aux.isIndicadorUsoPresupuestoDimension4()))\r\n/* 236: */ {\r\n/* 237:268 */ this.arregloMascara = aux.getMascaraDimension4().split(\"\\\\.\");\r\n/* 238:269 */ numeroDimension = \"4\";\r\n/* 239: */ }\r\n/* 240:270 */ else if ((!aux.getNombreDimension5().equals(\"\")) && (aux.isIndicadorUsoPresupuestoDimension5()))\r\n/* 241: */ {\r\n/* 242:271 */ this.arregloMascara = aux.getMascaraDimension5().split(\"\\\\.\");\r\n/* 243:272 */ numeroDimension = \"5\";\r\n/* 244: */ }\r\n/* 245:274 */ return numeroDimension;\r\n/* 246: */ }", "public String getDomain() {\n\t\treturn domain;\n\t}", "private void splitHelper(double splitStartFraction, String name1, String name2) {\n\t\tthis.children = new Zone[2];\n\t\tthis.splitStartFraction = splitStartFraction;\n\t\tthis.children[0] = new Zone(this, name1);\n\t\tthis.children[1] = new Zone(this, name2);\n\t}", "public String getDomain() {\n return domain;\n }", "public String getDomain() {\n return domain;\n }", "public Domain getDomain() {\n return domain;\n }", "public interface IDomain {\n\t\n\t/**\n\t * Vrati ime domene\n\t * @return ime domene\n\t */\n\tpublic String getName();\n\t\n\t/**\n\t * Stvori objekt domene iz stringa\n\t * @param value string reprezentacija objekta\n\t * @return objekt domene\n\t */\n\tpublic Object[] fromStringRepresentation(String... value);\n\t\n\tpublic String toStringRepresentation(Object... value);\n\t\n\t/**\n\t * Vrati indeks zadanog elementa\n\t * @param value element\n\t * @return indeks elementa, -1 ako element nije pronadjen\n\t */\n\tpublic int getIndexOfElement(Object... value);\n\t\n\t/**\n\t * Vrati element na zadanom indeksu\n\t * @param index trazeni indeks\n\t * @return trazeni element\n\t */\n\tpublic Object[] elementAt(int index);\n\t\n\t/**\n\t * Vrati kardinalnost domene\n\t * @return kardinalnost domene\n\t */\n\tpublic int getCardinality();\n\t\n\t/**\n\t * Vrati komponente ove domene\n\t * @return ako je domena kartezijev produkt vraca\n\t * komponente, inace vraca samu domenu\n\t */\n\tpublic IDomain[] getDomainComponents();\n\t\n\t/**\n\t * Konstruiraj domenu na zadanom fuzzy stroju\n\t * @param engine fuzzy stroj\n\t * @throws FuzzyEngineException \n\t */\n\tpublic void build(FuzzyEngine engine) throws FuzzyEngineException;\n\n}", "public void printDomains() {\n\t\tSystem.out.println(\"Printing all domains\");\n\t\tfor (int row = 0; row < Sudoku.ROWS; row++ ) {\n\t\t\tfor (int col = 0; col < Sudoku.COLUMNS; col++) {\n\t\t\t\tSystem.out.printf(\"Domain of row %d column %d: {\", row, col);\n\t\t\t\tSudoku.grid[row][col].printDomain();\n\t\t\t\tSystem.out.print(\"}\\n\");\n\t\t\t}\n\t\t}\n\t}", "public final AstValidator.split_clause_return split_clause() throws RecognitionException {\n AstValidator.split_clause_return retval = new AstValidator.split_clause_return();\n retval.start = input.LT(1);\n\n\n CommonTree root_0 = null;\n\n CommonTree _first_0 = null;\n CommonTree _last = null;\n\n CommonTree SPLIT403=null;\n AstValidator.rel_return rel404 =null;\n\n AstValidator.split_branch_return split_branch405 =null;\n\n AstValidator.split_otherwise_return split_otherwise406 =null;\n\n\n CommonTree SPLIT403_tree=null;\n\n try {\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:624:14: ( ^( SPLIT rel ( split_branch )+ ( split_otherwise )? ) )\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:624:16: ^( SPLIT rel ( split_branch )+ ( split_otherwise )? )\n {\n root_0 = (CommonTree)adaptor.nil();\n\n\n _last = (CommonTree)input.LT(1);\n {\n CommonTree _save_last_1 = _last;\n CommonTree _first_1 = null;\n CommonTree root_1 = (CommonTree)adaptor.nil();\n _last = (CommonTree)input.LT(1);\n SPLIT403=(CommonTree)match(input,SPLIT,FOLLOW_SPLIT_in_split_clause3322); if (state.failed) return retval;\n if ( state.backtracking==0 ) {\n SPLIT403_tree = (CommonTree)adaptor.dupNode(SPLIT403);\n\n\n root_1 = (CommonTree)adaptor.becomeRoot(SPLIT403_tree, root_1);\n }\n\n\n match(input, Token.DOWN, null); if (state.failed) return retval;\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_rel_in_split_clause3324);\n rel404=rel();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_1, rel404.getTree());\n\n\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:624:29: ( split_branch )+\n int cnt113=0;\n loop113:\n do {\n int alt113=2;\n int LA113_0 = input.LA(1);\n\n if ( (LA113_0==SPLIT_BRANCH) ) {\n alt113=1;\n }\n\n\n switch (alt113) {\n \tcase 1 :\n \t // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:624:29: split_branch\n \t {\n \t _last = (CommonTree)input.LT(1);\n \t pushFollow(FOLLOW_split_branch_in_split_clause3326);\n \t split_branch405=split_branch();\n\n \t state._fsp--;\n \t if (state.failed) return retval;\n \t if ( state.backtracking==0 ) \n \t adaptor.addChild(root_1, split_branch405.getTree());\n\n\n \t if ( state.backtracking==0 ) {\n \t }\n \t }\n \t break;\n\n \tdefault :\n \t if ( cnt113 >= 1 ) break loop113;\n \t if (state.backtracking>0) {state.failed=true; return retval;}\n EarlyExitException eee =\n new EarlyExitException(113, input);\n throw eee;\n }\n cnt113++;\n } while (true);\n\n\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:624:43: ( split_otherwise )?\n int alt114=2;\n int LA114_0 = input.LA(1);\n\n if ( (LA114_0==OTHERWISE) ) {\n alt114=1;\n }\n switch (alt114) {\n case 1 :\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:624:43: split_otherwise\n {\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_split_otherwise_in_split_clause3329);\n split_otherwise406=split_otherwise();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_1, split_otherwise406.getTree());\n\n\n if ( state.backtracking==0 ) {\n }\n }\n break;\n\n }\n\n\n match(input, Token.UP, null); if (state.failed) return retval;\n adaptor.addChild(root_0, root_1);\n _last = _save_last_1;\n }\n\n\n if ( state.backtracking==0 ) {\n }\n }\n\n if ( state.backtracking==0 ) {\n\n retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);\n }\n\n }\n\n catch(RecognitionException re) {\n throw re;\n }\n\n finally {\n \t// do for sure before leaving\n }\n return retval;\n }", "public void getDomain(){\n String requestDomain = IPAddressTextField.getText();\n Connection conn = new Connection();\n\n String ip = conn.getDomain(requestDomain);\n\n output.writeln(requestDomain + \" --> \" + ip);\n }", "int getGroupIdUpperBound();", "public static double denormalizeMapminmax(double num) {\r\n \t\tint MAXsetvaluefaktor = 1;\r\n \t\tint MINsetvaluefaktor = 1;\r\n \r\n \t\tswitch (GAMETYPE) {\r\n \t\tcase SAYISALLOTO: {\r\n \t\t\tif (INPUTVALUETYPE == DIGITAL) {\r\n \t\t\t\tMAXsetvaluefaktor = SAYISALMINSETVALUE1;\r\n \t\t\t\tMINsetvaluefaktor = 0;\r\n \t\t\t} else if (INPUTVALUETYPE == RAWVALUE) {\r\n \t\t\t\tMAXsetvaluefaktor = SAYISALMAXSETVALUE49;\r\n \t\t\t\tMINsetvaluefaktor = SAYISALMINSETVALUE1;\r\n \t\t\t}\r\n \t\t\tbreak;\r\n \t\t}\r\n \t\tdefault: {\r\n \r\n \t\t}\r\n \t\t}\r\n \r\n \t\tdouble result = num - MAPMIN;\r\n \t\tresult = result * (MAXsetvaluefaktor - MINsetvaluefaktor);\r\n \t\tresult = result / (MAPMAX - MAPMIN);\r\n \t\tresult = result + MINsetvaluefaktor;\r\n \t\treturn result;\r\n \t}", "public static DecisionOperator<IntVar> split() {\n return DecisionOperator.int_split;\n }", "public void boundsLex(int [] a , IntDomainVar [] x , int [] b,int j) throws ContradictionException{\n\n int i =0;\n\n\n while( i< n && a[i]==b[i]){\n\n\n if((x[i].getInf()==a[i] || x[i].updateInf(a[i], this, false)) &&\n (x[i].getSup()==b[i] || x[i].updateSup(b[i], this, false))){\n i++;\n }else{\n this.fail();\n }\n\n }\n\n\n if(i<n )\n if ((x[i].getInf()==a[i] || x[i].updateInf(a[i], this, false)) &&\n (x[i].getSup()==b[i] || x[i].updateSup(b[i], this, false))){\n }else{\n this.fail();\n }\n\n\n if(i==n || x[i].getNextDomainValue(a[i])<b[i]){\n return ;\n }\n\n i+=1;\n\n while(i<n && (b[i]+1 <= a[i]-1) && x[i].getInf()==b[i] && x[i].getSup()==a[i]){\n if(x[i].removeInterval(b[i]+1,a[i]-1, this, false)){\n i++;\n }else{\n this.fail();\n\n }\n }\n\n if(i<n) {\n if (b[i] + 1 <= a[i] - 1 && x[i].getInf() <= b[i] &&\n b[i] <= x[i].getSup() && x[i].getSup() >= a[i] && a[i] >= x[i].getInf()) {\n if (!x[i].removeInterval(b[i] + 1, a[i] - 1, this, false)) {\n this.fail();\n }\n }\n }\n\n }", "private DataStructure copyAndCut (int min, int max, boolean axis){\r\n\t\tDataStructure newDS = new DataStructure();\r\n\t\tPoint[] regAxis = getPointsInRangeRegAxis(min, max, axis); //O(n)\r\n\t\tPoint[] oppAxis = getPointsInRangeOppAxis(min, max, axis); //O(n)\r\n\t\t\r\n\t\tfor(int i=0; i<regAxis.length ; i++)\r\n\t\t\tnewDS.naiveAddLast(regAxis[i], axis); //O(1) * n times\r\n\t\t\r\n\t\tfor(int i=0; i<oppAxis.length ; i++)\r\n\t\t\tnewDS.naiveAddLast(oppAxis[i], !axis); //O(1) * n times\r\n\t\t\r\n\t\treturn newDS;\r\n\t}", "public int deplacementMax(Couleur couleurJoueur) {\n\t\tint max = 0;\n\t\tDeplacement deplacementCourant;\n\t\tfor(int i = 0; i < Constantes.N; i++) {\n\t\t\tfor(int j = 0; j < Constantes.N; j++) {\n\t\t\t\tPosition pos = new Position(i, j);\n\t\t\t\tif((obtenirPion(pos) != null) && obtenirPion(pos).aMemeCouleur(couleurJoueur)) {\n\t\t\t\t\tdeplacementCourant = new Deplacement();\n\t\t\t\t\tdeplacementCourant.add(pos);\n\t\t\t\t\tint maxCourant = backtrack(deplacementCourant, couleurJoueur);\n\t\t\t\t\tif(maxCourant > max) {\n\t\t\t\t\t\tmax = maxCourant;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"DeplMax: \" + max);\n\t\treturn max;\n\t}", "private static int[] calculateLotto(int size, int min, int max) {\n int[] lotto = new int [size];\n int[] numbers = new int [max - min + 1];\n for(int i = 0; i < numbers.length; i++) {\n numbers [i] = min + i;\n }\n for(int i = 0; i < lotto.length; i++) {\n int index = Math.getRandom(0, numbers.length - 1);\n lotto [i] = numbers [index];\n numbers = Arrays.removeIndex(numbers, index);\n }\n return lotto;\n }", "public static String getDomainName(URL url) {\n\t\tDomainSuffixes tlds = DomainSuffixes.getInstance();\n\t\tString host = url.getHost();\n\t\t// it seems that java returns hostnames ending with .\n\t\tif (host.endsWith(\".\"))\n\t\t\thost = host.substring(0, host.length() - 1);\n\t\tif (IP_PATTERN.matcher(host).matches())\n\t\t\treturn host;\n\n\t\tint index = 0;\n\t\tString candidate = host;\n\t\tfor (; index >= 0;) {\n\t\t\tindex = candidate.indexOf('.');\n\t\t\tString subCandidate = candidate.substring(index + 1);\n\t\t\tif (tlds.isDomainSuffix(subCandidate)) {\n\t\t\t\treturn candidate;\n\t\t\t}\n\t\t\tcandidate = subCandidate;\n\t\t}\n\t\treturn candidate;\n\t}", "@iri(\"http://persistent.name/rdf/2010/purl#domainOf\")\n\tSet<Domain> getPurlDomainOf();", "public int getMaxFloor();", "public List<String> subdomainVisits(String[] cpdomains) {\n if (cpdomains == null) {\n return new ArrayList<>();\n }\n\n Map<String, Integer> map = new HashMap<>();\n for (String cpdomain : cpdomains) {\n int count = 0;\n for (int p = 0; p < cpdomain.length(); p++) {\n char c = cpdomain.charAt(p);\n if (c == ' ') {\n count = Integer.valueOf(cpdomain.substring(0, p));\n }\n\n if (c == ' ' || c == '.') {\n String url = cpdomain.substring(p + 1);\n int oldCount = map.getOrDefault(url, 0);\n map.put(url, oldCount + count);\n }\n }\n }\n\n List<String> res = new ArrayList<>();\n for (Map.Entry<String, Integer> e : map.entrySet()) {\n // StringBuilder is faster than: res.add(e.getValue() + \" \" + e.getKey());\n // 14ms -> 7ms\n StringBuilder sb = new StringBuilder();\n sb.append(e.getValue()).append(\" \").append(e.getKey());\n res.add(sb.toString());\n }\n\n return res;\n }", "private void generateIntervalArray(){\n BigDecimal maximumValue = this.getTfMaximumInterval();\n BigDecimal minimumValue = this.getTfMinimumInterval();\n BigDecimal stepValue = this.getTfStepInterval();\n \n intervalArray = new ArrayList<BigDecimal>();\n BigDecimal step = maximumValue;\n \n //Adiciona os valores \"inteiros\"\n while(step.doubleValue() >= minimumValue.doubleValue()){\n intervalArray.add(step);\n step = step.subtract(stepValue);\n }\n }", "@Test(timeout = 4000)\n public void test105() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.RESIDUE_BASED;\n Range range0 = Range.of(range_CoordinateSystem0, 9223372032559808509L, 9223372036854775806L);\n // Undeclared exception!\n try { \n range0.split((-797L));\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // max splitLength must be >= 1\n //\n verifyException(\"org.jcvi.jillion.core.Range\", e);\n }\n }", "private Map<Boolean, Sort> split2 (final int delim, final int subcl) {\n Interval[] split = getConstraint(subcl).split(delim);//the interval to be split\n if (split.length == 0)\n return Collections.EMPTY_MAP;\n else if (split.length == 2) {\n Map<Boolean, Sort> res = new HashMap<>();\n Interval[] newarrc = this.constraints.clone();//the original constraints is copied\n newarrc[subcl - 1] = split[0];\n res.put(false, setConstraint(newarrc)); //false trands for \"0\"\n newarrc = this.constraints.clone();\n newarrc[subcl - 1] = split[1];\n res.put(true, setConstraint(newarrc)); //true stands for \"1\"\n return res;\n }\n throw new IllegalArgumentException(\"binary splits are assumed!\");\n }", "public Page getMaxHub(List<Page> result) {\n\t\tPage maxHub = null;\n\t\tfor (Page currPage : result) {\n\t\t\tif (maxHub == null || currPage.hub > maxHub.hub)\n\t\t\t\tmaxHub = currPage;\n\t\t}\n\t\treturn maxHub;\n\t}", "public void buildMaxHeap(Comparable[] array) {\n\t\tint n = array.length; //number of elements need to build\n\n\t\tfor (int pos = n/2; pos >= 1; pos--) { //start from position n/2\n\t\t\tint i = pos;\n\t\t\tComparable tmp = array[i - 1];\n\t\t\tboolean check = false;\n\n\t\t\twhile (!check && (2 * i <= n) ) {\n\t\t\t\tint j = 2 * i;\n\t\t\t\tif (j < n) {\n\t\t\t\t\t//choose the larger element\n\t\t\t\t\tif (array[j - 1].compareTo(array[j]) < 0 ) {\n\t\t\t\t\t\tj++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( tmp.compareTo(array[j - 1]) > 0 ) {\n\t\t\t\t\tcheck = true;\n\t\t\t\t} else {\n\t\t\t\t\tarray[i - 1] = array[j - 1];\n\t\t\t\t\ti = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tarray[i - 1] = tmp;\n\t\t}\n\t}", "public List<Integer> largestDivisibleSubset(int[] nums) {\n longest = new ArrayList<>();\n if (nums == null) {\n return longest;\n }\n Arrays.sort(nums);\n sorted = nums;\n System.out.println(\"Sorted = \" + Arrays.toString(sorted));\n int[] beDividor = new int[nums.length]; // 统计一个数被整除的次数\n Map<Integer, List<Integer>> edges = new HashMap<>();\n for (int i = 0; i < sorted.length - 1; i++) {\n for (int j = i + 1; j < sorted.length; j++) {\n if (sorted[j] % sorted[i] == 0) {\n beDividor[j]++;\n if (!edges.containsKey(i)) {\n edges.put(i, new ArrayList<Integer>());\n }\n edges.get(i).add(j);\n }\n }\n }\n System.out.println(\"Map =\\t\" + edges);\n max = 0;\n List<Integer> chain = new ArrayList<>();\n for (int i = 0; i < beDividor.length; i++) {\n if (beDividor[i] == 0) { // 无法整除任何其他元素的数\n chain.add(sorted[i]);\n if (max < 1) {\n max = 1;\n longest = new ArrayList<Integer>(chain);\n } \n backtracking(i, 1, chain, edges);\n chain.remove(chain.size() - 1);\n }\n }\n return longest;\n }", "private void createNumPartitions(Integer[] splits, FeatureField featFld, \n \t\tList<Integer[]> newSplitList) {\n \t\tint min = (int)(featFld.getMin() + 0.01);\n \t\tint max = (int)(featFld.getMax() + 0.01);\n \t\tint binWidth = featFld.getBucketWidth();\n \tif (null == splits) {\n \t\t//first time\n \t\tfor (int split = min + binWidth ; split < max; split += binWidth) {\n \t\t\tInteger[] newSplits = new Integer[1];\n \t\t\tnewSplits[0] = split;\n \t\t\tnewSplitList.add(newSplits);\n \t\t\tcreateNumPartitions(newSplits, featFld,newSplitList);\n \t\t}\n \t} else {\n \t\t//create split based off last split that will contain one additinal split point\n \t\tint len = splits.length;\n \t\tif (len < featFld.getMaxSplit() -1) {\n\t \t\tfor (int split = splits[len -1] + binWidth; split < max; split += binWidth) {\n\t \t\t\tInteger[] newSplits = new Integer[len + 1];\n\t \t\t\tint i = 0;\n\t \t\t\tfor (; i < len; ++i) {\n\t \t\t\t\tnewSplits[i] = splits[i];\n\t \t\t\t}\n\t \t\t\tnewSplits[i] = split;\n\t \t\t\tnewSplitList.add(newSplits);\n\t \t\t\t\n\t \t\t\t//recurse to generate additional splits\n\t \t\t\tcreateNumPartitions(newSplits, featFld,newSplitList);\n\t \t\t}\n \t\t}\n \t}\n }", "public static IntStrategy minDom_UB(IntVar... VARS) {\n return custom(minDomainSize_var_selector(), max_value_selector(), VARS);\n }", "R visitBoundVariable(Formula f, int deBruijnIdx);", "public static VariableSelector<IntVar> maxDomainSize_var_selector() {\n return new AntiFirstFail();\n }", "double largestNumber(double[] a) {\n\t\tdouble max = a[0];\n\t\tdouble no = 0;\n\t\tfor (int index = 1; index < a.length; index++) {\n\t\t\tif (max > a[index] && max > a[index + 1]) {\n\t\t\t\tno = max;\n\t\t\t\tbreak;\n\t\t\t} else if (a[index] > max && a[index] > a[index + 1]) {\n\t\t\t\tno = a[index];\n\t\t\t\tbreak;\n\t\t\t} else if (a[index + 1] > max && a[index + 1] > a[index]) {\n\t\t\t\tno = a[index + 1];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn no;\n\t}", "public SelectorForNumber[] divide(double divider) {\n SelectorForNumber[] result = new SelectorForNumber[2];\n switch(type) {\n case ALL_VALUES: {\n result[0] = getSelLE(attributeId, divider - delta);\n result[1] = getSelGT(attributeId, divider);\n break;\n }\n case BELONGS_RIGHT_INCLUDING: {\n if (divider == lowerLimit) {\n result[0] = null;\n result[1] = this;\n }\n else {\n if (divider > lowerLimit) {\n if (divider == upperLimit) {\n result[0] = getSelBelongs(attributeId, lowerLimit, divider - delta);\n result[1] = null;\n }\n else if (divider > upperLimit) {\n result[0] = this;\n result[1] = null;\n }\n else {\n // lowerLimit < divider < upperLimit\n result[0] = getSelBelongs(attributeId, lowerLimit, divider - delta);\n result[1] = getSelBelongs(attributeId, divider, upperLimit);\n }\n }\n else {\n // divider < lowerLimit\n result[0] = null;\n result[1] = this;\n }\n }\n break;\n }\n case EQUAL: {\n if (divider == lowerLimit)\n result[0] = this;\n break;\n }\n case GREATER_THAN: {\n if (divider == lowerLimit) {\n result[0] = null;\n result[1] = this;\n }\n else if (divider > lowerLimit) {\n result[0] = getSelBelongs(attributeId, lowerLimit, divider - delta);\n result[1] = getSelGT(attributeId, divider);\n }\n // else -> divider < lowerLimit, so there's no selector to return;\n break;\n }\n case LOWER_OR_EQUAL: {\n if (divider == upperLimit) {\n result[0] = getSelLE(attributeId, divider - delta);\n result[1] = null;\n }\n else if (divider < upperLimit) {\n result[0] = getSelLE(attributeId, divider - delta);\n result[1] = getSelBelongs(attributeId, divider, upperLimit);\n } \n // else -> divider > lowerLimit, so there's no selector to return;\n break;\n }\n case NONE_VALUE: { // Nothing to return.\n break;\n }\n }\n return result;\n }", "public String getDomainId() {\n return domain;\n }", "public static String getSegWithLongestWords(HashSet<String> segs) {\n Iterator<String> itr = segs.iterator();\n String longestOverall = \"\";\n while(itr.hasNext()) {\n String s = itr.next();\n if (greaterThan(s,longestOverall)) {\n longestOverall=s;\n }\n }\n return longestOverall;\n }", "public static int splitMaximum(int ans, int n, int t){\n\t t = kbd.nextInt();\n\t while(t-- != 0) \n\t {\n\t n = kbd.nextInt();\n\t\tif(n == 1 || n == 2 || n == 3 || n == 5 || n == 7 || n == 11)\n\t\t{\n\t\t ans = -1;\n\t\t}\n\t\telse if (n % 2 == 1)\n\t\t{\n\t\t ans = (n - 9) / 4 + 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t ans = n / 4;\n\t\t}\n\t\treturn ans;\n\t\t}\n\treturn t;\n\t}" ]
[ "0.5231829", "0.51654905", "0.513158", "0.5115658", "0.50935596", "0.5074795", "0.49770278", "0.49417087", "0.4925437", "0.4904337", "0.49038664", "0.4894424", "0.486725", "0.48064697", "0.48052612", "0.4772556", "0.47667062", "0.47528046", "0.4739733", "0.4720487", "0.4706445", "0.46935192", "0.46839878", "0.46760654", "0.46632507", "0.46628198", "0.46616068", "0.46332595", "0.46330833", "0.4616265", "0.45981085", "0.45793703", "0.4578101", "0.4563579", "0.45588797", "0.45520622", "0.45422944", "0.45261788", "0.45186076", "0.4496748", "0.44901168", "0.44879434", "0.44792435", "0.4477202", "0.4476963", "0.44606462", "0.4458723", "0.4444345", "0.444181", "0.4440802", "0.4440494", "0.44319952", "0.44302467", "0.44294178", "0.44272423", "0.44206962", "0.44180527", "0.44172016", "0.44156656", "0.44110548", "0.44080108", "0.44014382", "0.43996993", "0.43837312", "0.43739724", "0.43730813", "0.4370068", "0.4362573", "0.4362573", "0.43580586", "0.43554693", "0.43506157", "0.43436083", "0.4341594", "0.4334682", "0.43331447", "0.43301103", "0.432381", "0.43222052", "0.4321404", "0.43145615", "0.4314359", "0.43091506", "0.43085936", "0.43067855", "0.43063784", "0.4294461", "0.4294439", "0.42903078", "0.42890072", "0.42836735", "0.42822593", "0.4279344", "0.4278756", "0.42774102", "0.42758197", "0.42749563", "0.42732307", "0.42633033", "0.42632273" ]
0.6544626
0
Assigns the noninstantiated variable of smallest domain size to its upper bound.
public static IntStrategy minDom_UB(IntVar... VARS) { return custom(minDomainSize_var_selector(), max_value_selector(), VARS); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setUpperBound(String upper) {\n upperBound = upper;\n }", "public void setUpperBound(final int upperBound) {\r\n this.upperBound = upperBound;\r\n }", "@Override\n\tprotected void setUpperBound() {\n\t\t\n\t}", "public int getUpperBound() {\r\n return upperBound;\r\n }", "public int getUpperBound() {\n\t\treturn upperBound;\n\t}", "public static VariableSelector<IntVar> maxDomainSize_var_selector() {\n return new AntiFirstFail();\n }", "public int getUpperBound() {\n\t\treturn this.upperBound;\n\t}", "public int getBound();", "public static VariableSelector<IntVar> minDomainSize_var_selector() {\n return new FirstFail();\n }", "protected void mapValueToWithinBounds() {\n if (getAllele() != null) {\n \tFloat d_value = ( (Float) getAllele());\n if (d_value.isInfinite()) {\n // Here we have to break to avoid a stack overflow.\n // ------------------------------------------------\n return;\n }\n // If the value exceeds either the upper or lower bounds, then\n // map the value to within the legal range. To do this, we basically\n // calculate the distance between the value and the float min,\n // then multiply it with a random number and then care that the lower\n // boundary is added.\n // ------------------------------------------------------------------\n if (d_value.floatValue() > m_upperBound ||\n d_value.floatValue() < m_lowerBound) {\n RandomGenerator rn;\n if (getConfiguration() != null) {\n rn = getConfiguration().getRandomGenerator();\n }\n else {\n rn = new StockRandomGenerator();\n }\n setAllele(new Float((rn.nextFloat()\n * ((m_upperBound - m_lowerBound))) + m_lowerBound));\n }\n }\n }", "@Override\n\tprotected double getUpperBound() {\n\t\treturn 0;\n\t}", "boolean impliedByUpperBound(InfinitNumber ubound) {\n\t\treturn ubound.lesseq(mBound);\n\t}", "public void setLowerBound (int lowerBound) throws ModelException;", "public void setHighestVariable(int v) {\n\t\tHighestVariable = (HighestVariable + v);\n\t}", "public V getUpperBound();", "public void setMaxValue(double x) {\r\n\t\tmaxValue = x;\r\n\t}", "@Basic\n\t@Raw\n\t@Immutable\n\tpublic static double getVelocityUpperBound() {\n\t\treturn VELOCITYUPPERBOUND;\n\t}", "public synchronized int getUpperSizeLimit() {\n \t\treturn upper;\n \t}", "protected final void setMax() {\n\n\tint prevmax = this.max;\n\n\tint i1 = this.high;\n\tint i2 = left.max;\n\tint i3 = right.max;\n\n\tif ((i1 >= i2) && (i1 >= i3)) {\n\t this.max = i1;\n\t} else if ((i2 >= i1) && (i2 >= i3)) {\n\t this.max = i2;\n\t} else {\n\t this.max = i3;\n\t}\n\t\n\tif ((p != IntervalNode.nullIntervalNode) &&\n\t (prevmax != this.max)) {\n \t p.setMax();\n\t}\n }", "public void setMaxValue(int x) {\r\n\t\tmaxValue = x;\r\n\t}", "public double getDomainMax1() throws IllegalStateException {\n\treturn Double.MAX_VALUE;\n }", "public void update_domain(int value, int lowerBound, int upperBound) {\n domain_history.push(domain.copy());\n domain.getDomain().remove((Integer) value);\n domain.getDomain().removeIf(d -> d > upperBound || d < lowerBound);\n }", "@Override\n public void setSoftUpperLimit(double position)\n {\n final String funcName = \"setSoftUpperLimit\";\n\n if (debugEnabled)\n {\n dbgTrace.traceEnter(funcName, TrcDbgTrace.TraceLevel.API, \"position=%f\", position);\n dbgTrace.traceExit(funcName, TrcDbgTrace.TraceLevel.API);\n }\n\n softUpperLimit = position;\n }", "void setMaxValue();", "public void setBounds(int var1, int var2, int var3, int var4) {\n if(var1 < 0) {\n var1 = 0;\n }\n\n if(var2 < 0) {\n var2 = 0;\n }\n\n if(var3 > this.field_723) {\n var3 = this.field_723;\n }\n\n if(var4 > this.field_724) {\n var4 = this.field_724;\n }\n\n this.field_745 = var1;\n this.field_743 = var2;\n this.field_746 = var3;\n this.field_744 = var4;\n }", "void assignRange() {\n rangeIndex = (int) Math.floor(value / step);\n }", "public abstract double[] getUpperBound();", "public float getUpperBound()\n {\n return fUpperBound;\n }", "public void setMaxSize(int size) {\n if (initialized)\n throw new IllegalStateException(INITIALIZED);\n maxSize = size;\n if (maxSize != 0 && minSize > maxSize) {\n minSize = maxSize;\n log.warn(\"pool min size set to \" + minSize + \" to stay <= max size\");\n }\n }", "public Delta addStateUpperBoundConstraint(Scope<?> scope, StateModelDefId stateModelDefId,\n State state, int upperBound) {\n return addStateUpperBoundConstraint(scope, stateModelDefId, state,\n Integer.toString(upperBound));\n }", "public int upperBound() {\n\t\tif(step > 0)\n\t\t\treturn last;\n\t\telse\n\t\t\treturn first;\n\t}", "public int getLowerBound() {\r\n return lowerBound;\r\n }", "public void computeSRectangleBound()\n {\n this.savedSRectangleBound = getSRectangleBound();\n }", "@Override\n\tpublic int getVariableSize()\n\t{\n\t\treturn con.getVariableSize() - 1;\n\t}", "public CategoryBuilder setUpperBound(float upperBound)\n {\n fUpperBound = upperBound;\n return this;\n }", "public InfinitNumber getBound() {\n\t\treturn mBound;\n\t}", "private void setBound(String[] wordBoardIn) {\r\n squareDimension = ((int) Math.sqrt(wordBoardIn.length));\r\n }", "public void initMaxMin(){\n\t\tmax = dja.max();\n\t\tmin = dja.min();\n\t}", "public abstract double getRangeSize();", "private void setMaxThreshold() {\n maxThreshold = value - value * postBoundChange / 100;\n }", "public void setUpperValue(int value) {\n // Compute new extent.\n int lowerValue = getValue();\n int newExtent = Math.min(Math.max(0, value - lowerValue), getMaximum() - lowerValue);\n \n // Set extent to set upper value.\n setExtent(newExtent);\n }", "public void changeConstraintsToMoreThan() throws IloException {\n /*\n IloRange notes:\n for expr == rhs, set lb = ub = rhs\n for expr <= rhs, set lb = -infinity and ub = rhs\n for expr >= rhs, set lb = rhs and ub = infinity\n */\n for (int i = 0; i < matrix.getNrows(); i++) {\n IloRange rangedExpression = matrix.getRange(i);\n if (rangedExpression.getLB() <= Double.NEGATIVE_INFINITY) {\n rangedExpression.setBounds(-rangedExpression.getLB(), Double.POSITIVE_INFINITY);\n for (int j = 0; j < matrix.getNrows(); j++) {\n matrix.setNZ(i, j, -matrix.getNZ(i, j));\n }\n }\n }\n }", "public void setLowerBound(final int lowerBound) {\r\n this.lowerBound = lowerBound;\r\n }", "void setNilMaximum();", "public void addUpperConstraint(String type) {\n\t\tfinal JvmUpperBound constraint = this.jvmTypesFactory.createJvmUpperBound();\n\t\tconstraint.setTypeReference(newTypeRef(this.context, type));\n\t\tgetJvmTypeParameter().getConstraints().add(constraint);\n\t}", "public Delta addStateUpperBoundConstraint(Scope<?> scope, StateModelDefId stateModelDefId,\n State state, String dynamicUpperBound) {\n _builder.addStateUpperBoundConstraint(scope, stateModelDefId, state, dynamicUpperBound);\n return this;\n }", "public double getDomainMax2() throws IllegalStateException {\n\treturn Double.MAX_VALUE;\n }", "R visitBoundVariable(Formula f, int deBruijnIdx);", "public long getUpperTbound() {\n\t\treturn this.upperTBound;\n\t}", "public final void rule__JvmWildcardTypeReference__ConstraintsAssignment_2_0_0() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalDroneScript.g:19368:1: ( ( ruleJvmUpperBound ) )\r\n // InternalDroneScript.g:19369:2: ( ruleJvmUpperBound )\r\n {\r\n // InternalDroneScript.g:19369:2: ( ruleJvmUpperBound )\r\n // InternalDroneScript.g:19370:3: ruleJvmUpperBound\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getJvmWildcardTypeReferenceAccess().getConstraintsJvmUpperBoundParserRuleCall_2_0_0_0()); \r\n }\r\n pushFollow(FOLLOW_2);\r\n ruleJvmUpperBound();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getJvmWildcardTypeReferenceAccess().getConstraintsJvmUpperBoundParserRuleCall_2_0_0_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "public InterestScale sizeOfUpperLimit(String sizeOfUpperLimit) {\n this.sizeOfUpperLimit = sizeOfUpperLimit;\n return this;\n }", "protected final void setMax(Comparable max)\r\n {\r\n myMax = max;\r\n }", "public Builder addStateUpperBoundConstraint(Scope<?> scope, StateModelDefId stateModelDefId,\n State state, int upperBound) {\n return addStateUpperBoundConstraint(scope, stateModelDefId, state,\n Integer.toString(upperBound));\n }", "public void setUpperPoint(Point upper) {\n this.upper = upper;\n }", "public static double constrain(double value, double min, double max) {\n if(value > max) value = max;\n else if(value < min) value = min;\n return value;\n }", "public void setLimit_lin_x_upper(float limit_lin_x_upper) throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeFloat(__io__address + 36, limit_lin_x_upper);\n\t\t} else {\n\t\t\t__io__block.writeFloat(__io__address + 28, limit_lin_x_upper);\n\t\t}\n\t}", "public double getDomainMin1() throws IllegalStateException {\n\treturn -Double.MAX_VALUE;\n }", "public Comparable<?> b(DiscreteDomain<Comparable<?>> discreteDomain) {\n return discreteDomain.maxValue();\n }", "public void setValidRange (int lowerBounds, int upperBounds)\r\n\t{\r\n\t\tm_lowerBounds = lowerBounds;\r\n\t\tm_upperBounds = upperBounds;\r\n\t}", "@Override\n\tprotected void setLowerBound() {\n\t\t\n\t}", "private void setMax(int max) { this.max = new SimplePosition(false,false,max); }", "void decNetSize(){\r\n\t\t\t\tif (size>50)size-=50;\r\n\t\t\t\telse System.out.println(\"Minimum net size reached!\");\r\n\t\t\t}", "boolean isBoundVariable(Formula f);", "@Override\n public Variable useHeuristic(Deque<Variable> deque) {\n Variable highDomain = deque.getFirst();\n for (Variable var : deque){\n if (var.getDomain().size() > highDomain.getDomain().size()){\n highDomain = var;\n }\n }\n return highDomain;\n }", "void setMaximum(int max);", "public Cut<Comparable<?>> b(BoundType boundType, DiscreteDomain<Comparable<?>> discreteDomain) {\n throw new AssertionError(\"this statement should be unreachable\");\n }", "public RandomVaries(String name, int probability, float minUnits, float maxUnits){\n super(name);\n this.probability=probability;\n if(minUnits<0)generator=true;\n this.minUnits=Math.abs(minUnits);\n this.maxUnits=Math.abs(maxUnits);\n }", "public void setLowerBound(String lower) {\n lowerBound = lower;\n }", "public synchronized void setSize(int lower, int upper) {\n \t\tthis.lower = lower;\n \t\tthis.upper = upper;\n \t\tadjustThreadCount();\n \t}", "public abstract int getMaximumValue();", "protected int getBoundedValue(int aNumber) {\r\n if (aNumber < getMin()) {\r\n aNumber = getMin();\r\n } else if (aNumber > getMax()) {\r\n aNumber = getMax();\r\n }\r\n return aNumber;\r\n }", "public double getDomainMin2() throws IllegalStateException {\n\treturn -Double.MAX_VALUE;\n }", "public void SetMaxVal(int max_val);", "public void setMaximum(int n) {\r\n int newMin = Math.min(n, min);\r\n int newValue = Math.min(n, getValue());\r\n int newExtent = Math.min(n - newValue, getExtent());\r\n setRangeProperties(newValue, newExtent, newMin, n, isAdjusting);\r\n }", "public abstract T getMaxValue();", "@Override\n\tpublic AbstractValue greatestLowerBound(AbstractValue d) {\n\t\tif ( !(d instanceof Interval) )\n\t\t\tthrow new IllegalArgumentException(\"v should be of type Interval\");\n\t\tInterval i = (Interval) d;\n\n\t\tif (i.isBottom())\n\t\t\treturn i;\n\t\telse if (i.equals(top))\n\t\t\treturn this;\n\n\t\tString newLow = \"-Inf\", newHigh = \"+Inf\";\n\n\t\t//Calcolare limite inferiore\n\n\t\tif ( this.getLow().equals(\"-Inf\")){\n\t\t\tif( !i.getLow().equals(\"-Inf\"))\n\t\t\t\tif(Integer.parseInt(this.getHigh()) > Integer.parseInt(i.getLow()))\n\t\t\t\t\tnewLow = String.valueOf(Integer.max(Integer.parseInt(this.getLow()), Integer.parseInt(i.getLow())));\n\t\t\t\telse\n\t\t\t\t\treturn BottomAV.getInstance();\n\t\t}else if ( i.getLow().equals(\"-Inf\")){\n\t\t\tif( !this.getLow().equals(\"-Inf\"))\n\t\t\t\tif(Integer.parseInt(i.getHigh()) > Integer.parseInt(this.getLow()))\n\t\t\t\t\tnewLow = String.valueOf(Integer.max(Integer.parseInt(i.getLow()), Integer.parseInt(this.getLow())));\n\t\t\t\telse\n\t\t\t\t\treturn BottomAV.getInstance();\n\t\t}else if(!this.getLow().equals(\"-Inf\") && !i.getLow().equals(\"-Inf\")){\n\t\t\tnewLow = String.valueOf(Integer.max(Integer.parseInt(this.getLow()), Integer.parseInt(i.getLow())));\n\t\t}\n\n\t\t// Calcolare limite superiore\n\n\t\tif ( this.getHigh().equals(\"+Inf\")) {\n\t\t\tif (!i.getHigh().equals(\"+Inf\"))\n\t\t\t\tnewHigh = i.getHigh();\n\t\t}else if ( i.getHigh().equals(\"+Inf\")) {\n\t\t\tif (!this.getHigh().equals(\"+Inf\"))\n\t\t\t\tnewHigh = this.getHigh();\n\t\t}else if(!this.getHigh().equals(\"+Inf\") && !i.getHigh().equals(\"+Inf\")){\n\t\t\tnewHigh = String.valueOf(Integer.min(Integer.parseInt(this.getHigh()), Integer.parseInt(i.getHigh())));\n\t\t}\n\n\t\tInterval res = new Interval(newLow, newHigh);\n\n\t\t// Checks whether low > high\n\t\tif ((!newLow.equals(\"-Inf\") && (!newHigh.equals(\"+Inf\")) && Integer.parseInt(newLow) > Integer.parseInt(newHigh)))\n\t\t\treturn BottomAV.getInstance();\n\n\t\treturn amItop() ? top : res;\n\t}", "private void setDefaultValidRange ()\r\n\t{\r\n\t\tm_lowerBounds = Integer.MIN_VALUE;\r\n\t\tm_upperBounds = Integer.MAX_VALUE;\r\n\t}", "public void setValue(int n) {\r\n Throwable t = new Throwable();\r\n t.printStackTrace();\r\n int newValue = Math.max(n, min);\r\n if (newValue + getExtent() > max) {\r\n newValue = max - getExtent();\r\n }\r\n\r\n setRangeProperties(newValue, getExtent(), min, max, isAdjusting);\r\n }", "private int getValue(int lowerBound, int upperBound) {\n int problemRange = upperBound - lowerBound + 1;\n\n return lowerBound + rng.nextInt(problemRange);\n }", "public static BsonDocument createPartitionBounds(final BsonValue lower, final BsonValue upper) {\n BsonDocument partitionBoundary = new BsonDocument();\n if (lower.getBsonType() != BsonType.MIN_KEY) {\n partitionBoundary.append(\"$gte\", lower);\n }\n if (upper.getBsonType() != BsonType.MAX_KEY) {\n partitionBoundary.append(\"$lt\", upper);\n }\n return partitionBoundary;\n }", "public abstract void assign(ParameterVector pv) throws SolverException;", "public Cut<Comparable<?>> a(BoundType boundType, DiscreteDomain<Comparable<?>> discreteDomain) {\n throw new AssertionError(\"this statement should be unreachable\");\n }", "private double clamp(double v, double min, double max) { return (v < min ? min : (v > max ? max : v)); }", "public final void rule__JvmWildcardTypeReference__ConstraintsAssignment_2_0_1() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalDroneScript.g:19383:1: ( ( ruleJvmUpperBoundAnded ) )\r\n // InternalDroneScript.g:19384:2: ( ruleJvmUpperBoundAnded )\r\n {\r\n // InternalDroneScript.g:19384:2: ( ruleJvmUpperBoundAnded )\r\n // InternalDroneScript.g:19385:3: ruleJvmUpperBoundAnded\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getJvmWildcardTypeReferenceAccess().getConstraintsJvmUpperBoundAndedParserRuleCall_2_0_1_0()); \r\n }\r\n pushFollow(FOLLOW_2);\r\n ruleJvmUpperBoundAnded();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getJvmWildcardTypeReferenceAccess().getConstraintsJvmUpperBoundAndedParserRuleCall_2_0_1_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "E maxVal();", "public void setMax ( Point max ) {\r\n\r\n\tsetB ( max );\r\n }", "void setMaxScale(int value);", "@Test\n public final void testSetSize() {\n int expRes = 5;\n int falseEnter = -4;\n ship.setSize(falseEnter);\n int result = this.ship.getSize();\n assertEquals(expRes, result);\n falseEnter = -1;\n ship.setSize(falseEnter);\n result = this.ship.getSize();\n assertEquals(expRes, result);\n }", "public void setLocalSize(int size);", "private void assignUninitialisedGlobalVar(Variable lastAppearanceOfVar,String valueName)throws\r\n\t\t\tTypeNotSupportedException{\r\n\t\t\tVariable variablesCopy = vFactory.createVariable(true, false, lastAppearanceOfVar.isArgument(),\r\n\t\t\t\t\tlastAppearanceOfVar.getType(), true);\r\n\t\t\tuninitialisedGlobalVariables.put(valueName, variablesCopy);\r\n\t}", "public synchronized int getLowerSizeLimit() {\n \t\treturn lower;\n \t}", "ChangeObserver<T> setInitialMaxValue(Object value);", "public abstract float getMaxValue();", "public void computeStoredBounds()\n {\n computeSRectangleBound();\n computeCircleBound();\n }", "public String getUpper() {\n return upperBound;\n }", "public void setBound(final Bounds bounds) {\n\t\tbound.setBound(relation, bounds);\n\t}", "TrackingToken upperBound();", "public void clamp() //TODO: implement\n {\n System.out.println(\"clamp was called!\"); //DEBUGG: check if called, delete if i know when\n /*\n IntegerVectorSpecies _species = (IntegerVectorSpecies)species;\n for (int i = 0; i < genomeLength(); i++)\n {\n int minGene = (int)_species.minGene(i);\n if (genome[i].getValue() < minGene)\n genome[i].setValue(minGene); //what do do for the TraceID?\n else\n {\n int maxGene = (int)_species.maxGene(i);\n if (genome[i].getValue() > maxGene)\n genome[i] = maxGene;\n }\n }\n\n */\n }", "private void assignSpacePerimeter()\n {\n\n }", "public void computeCircleBound()\n {\n this.savedCircleBound = getCircleBound();\n }" ]
[ "0.6164166", "0.6161353", "0.58765846", "0.5845968", "0.5731805", "0.55900913", "0.55453485", "0.55312574", "0.55041265", "0.5499343", "0.5484886", "0.5457605", "0.5431549", "0.5423194", "0.5419346", "0.5419218", "0.5381126", "0.53786534", "0.5289421", "0.5270844", "0.5182853", "0.51691157", "0.51621234", "0.51597977", "0.51409847", "0.5132203", "0.5125673", "0.5125354", "0.51199746", "0.511133", "0.50931716", "0.5054259", "0.5052094", "0.5052048", "0.504022", "0.503881", "0.50342894", "0.50274825", "0.5020533", "0.5012386", "0.50086117", "0.5004802", "0.5000091", "0.49897915", "0.49896523", "0.4963202", "0.49581215", "0.49393225", "0.49373147", "0.49200773", "0.4912338", "0.4911883", "0.49028835", "0.4897513", "0.48941317", "0.4889875", "0.4864778", "0.48579013", "0.485751", "0.4853994", "0.4841236", "0.48303315", "0.48182666", "0.48105967", "0.48085213", "0.48035085", "0.47968075", "0.47965443", "0.4792687", "0.47861597", "0.47853857", "0.4784009", "0.4779721", "0.47763062", "0.47723767", "0.47671127", "0.4767074", "0.47624612", "0.47564995", "0.4751667", "0.47465274", "0.4745375", "0.4745025", "0.47426334", "0.47411707", "0.4740601", "0.4737431", "0.47318274", "0.47261322", "0.47197998", "0.47136357", "0.47100013", "0.47094935", "0.47094172", "0.47043654", "0.47037002", "0.47011214", "0.46916533", "0.4690572", "0.46870917" ]
0.5169303
21
Assigns the noninstantiated variable of maximum regret to its lower bound.
public static IntStrategy maxReg_LB(IntVar... VARS) { return custom(maxRegret_var_selector(), min_value_selector(), VARS); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected final void setMax() {\n\n\tint prevmax = this.max;\n\n\tint i1 = this.high;\n\tint i2 = left.max;\n\tint i3 = right.max;\n\n\tif ((i1 >= i2) && (i1 >= i3)) {\n\t this.max = i1;\n\t} else if ((i2 >= i1) && (i2 >= i3)) {\n\t this.max = i2;\n\t} else {\n\t this.max = i3;\n\t}\n\t\n\tif ((p != IntervalNode.nullIntervalNode) &&\n\t (prevmax != this.max)) {\n \t p.setMax();\n\t}\n }", "public void initMaxMin(){\n\t\tmax = dja.max();\n\t\tmin = dja.min();\n\t}", "public void setMax ( Point max ) {\r\n\r\n\tsetB ( max );\r\n }", "protected final void setMax(Comparable max)\r\n {\r\n myMax = max;\r\n }", "private void setMaxThreshold() {\n maxThreshold = value - value * postBoundChange / 100;\n }", "Double getMaximumValue();", "void setMaximum(int max);", "public void setMaxValue(double x) {\r\n\t\tmaxValue = x;\r\n\t}", "public void setMaximumValue (Double max) {\r\n\t\tmaxValue = max;\r\n\t}", "public void setMaximumValue (double max) {\r\n\t\tmaxValue = new Double(max);\r\n\t}", "public void setMaxVal(double maxVal) {\n this.maxVal = maxVal;\n }", "public void SetMaxVal(int max_val);", "public void setMaximum( final double max )\n\t{\n\t\tthis.max = max;\n\t\tthis.oneOverMax = 1d / this.max;\n\t}", "public void setMaximum(Number max) {\n this.max = max;\n }", "public double getMaximumValue() { return this.maximumValue; }", "public void setMaxValue(int x) {\r\n\t\tmaxValue = x;\r\n\t}", "public void setLowerBound (int lowerBound) throws ModelException;", "E maxVal();", "public abstract int getMaximumValue();", "public static double constrain(double value, double min, double max) {\n if(value > max) value = max;\n else if(value < min) value = min;\n return value;\n }", "protected void setVxmax(double vxmax) {\n\t\tthis.vxmax = vxmax;\n\t}", "double getMax();", "double getMax();", "int getMaximum();", "public double clamp(double num, double max, double min){\n \t\tif(num < min){return min;}else if(num > max){return max;}else{return num;}\n \t}", "public void setMaximumPoints(int maximum);", "public double getMaximum() {\n return (max);\n }", "public void setMaximumWaterRequirement(double w) {\n this.Maximum_Water_Requirement = w;\n }", "float xMax();", "public void setMaxRange(double maxRange) {\n this.maxRange = maxRange;\n }", "public void setMaximumValue(double maximumValue)\n {\n this.maximumValue = maximumValue;\n }", "void setMaxValue();", "private void setMax(int max) { this.max = new SimplePosition(false,false,max); }", "public static int clamp(int var, int min, int max){\n\n if(var >= max){return var = max;}\n else if(var <= min){return var = min;}\n else return var;\n\n }", "protected void mapValueToWithinBounds() {\n if (getAllele() != null) {\n \tFloat d_value = ( (Float) getAllele());\n if (d_value.isInfinite()) {\n // Here we have to break to avoid a stack overflow.\n // ------------------------------------------------\n return;\n }\n // If the value exceeds either the upper or lower bounds, then\n // map the value to within the legal range. To do this, we basically\n // calculate the distance between the value and the float min,\n // then multiply it with a random number and then care that the lower\n // boundary is added.\n // ------------------------------------------------------------------\n if (d_value.floatValue() > m_upperBound ||\n d_value.floatValue() < m_lowerBound) {\n RandomGenerator rn;\n if (getConfiguration() != null) {\n rn = getConfiguration().getRandomGenerator();\n }\n else {\n rn = new StockRandomGenerator();\n }\n setAllele(new Float((rn.nextFloat()\n * ((m_upperBound - m_lowerBound))) + m_lowerBound));\n }\n }\n }", "public void setHighestVariable(int v) {\n\t\tHighestVariable = (HighestVariable + v);\n\t}", "public static int clamp(int var, int min, int max) {\n\n // Clamping means literally in this instance.\n //// it's used to restrict a value to a given range\n if (var >= max) {\n return var = max;\n } else if (var <= min) {\n return var = min;\n } else {\n return var;\n }\n }", "public void validateMaximum() {\n/* */ double newMax;\n/* */ try {\n/* 392 */ newMax = Double.parseDouble(this.maximumRangeValue.getText());\n/* 393 */ if (newMax <= this.minimumValue) {\n/* 394 */ newMax = this.maximumValue;\n/* */ }\n/* */ }\n/* 397 */ catch (NumberFormatException e) {\n/* 398 */ newMax = this.maximumValue;\n/* */ } \n/* */ \n/* 401 */ this.maximumValue = newMax;\n/* 402 */ this.maximumRangeValue.setText(Double.toString(this.maximumValue));\n/* */ }", "private void setMinThreshold() {\n minThreshold = value + value * postBoundChange / 100;\n }", "public void setMaximumAir ( int ticks ) {\n\t\texecute ( handle -> handle.setMaximumAir ( ticks ) );\n\t}", "public ReversedLinearValueFunction(double min, double max) {\n if (min == max) {\n LOGGER.error(\n \"The upper bound is equal to the lower bound in the constructor of the\"\n + \" LinearValueFunction.\");\n throw new IllegalArgumentException(\"The upper bound can't be equal to the lower bound.\");\n }\n interval = Range.closed(min, max);\n LOGGER.info(\n \"The interval [{}, {}] has been set with success in the LinearValueFunction class.\",\n min,\n max);\n }", "public static double limitRange( double val , double max , double min )\n {\n //If number is greater than maximum, it becomes the maximum.\n if( val > max )\n {\n val = max; \n }\n else if( val < min )//Else if the number is less than minimum, it becomes the minimum.\n {\n val = min;\n }\n \n //Returns the limited number.\n return val;\n }", "public double getXRangeMax() {\n return xRangeMax;\n }", "public void setMaxMin(long maxMin) {\n\t\tthis.maxMin = maxMin;\r\n\t}", "public int getLowerBound() {\r\n return lowerBound;\r\n }", "public double getMaxValue() {\r\n\t\treturn maxValue;\r\n\t}", "private void setRegToMax(int register) {\r\n\t\tsim40.memory[register] = 1024;\r\n\t\tswitchOnFlag(2);\r\n\t}", "public double getMaxVal() {\n return maxVal;\n }", "public Point getMax () {\r\n\r\n\treturn getB();\r\n }", "public Double getMaximumValue () {\r\n\t\treturn (maxValue);\r\n\t}", "public double getMaxRange() {\n return maxRange;\n }", "public float getMaxValue();", "public void setMaxWeight(double inMaxWeight) {\n maxWeight = inMaxWeight;\n }", "public void setLowerBound(final int lowerBound) {\r\n this.lowerBound = lowerBound;\r\n }", "private double clamp(double v, double min, double max) { return (v < min ? min : (v > max ? max : v)); }", "@Override\n\tprotected void setUpperBound() {\n\t\t\n\t}", "protected final Comparable getMax()\r\n {\r\n return myMax;\r\n }", "public static VariableSelector<IntVar> maxRegret_var_selector() {\n return new MaxRegret();\n }", "public int getMaxValue(){\n\t\treturn maxValue;\n\t}", "double getMax() {\n\t\t\treturn value_max;\n\t\t}", "void setMaximum(java.math.BigDecimal maximum);", "void updateMax(StockNode a){\n\t\tif(maxNode==null){\r\n\t\t\tmaxNode=a;\r\n\t\t} else { \r\n\t\t\tif(a.stockValue>maxNode.stockValue){\r\n\t\t\t\tmaxNode=a;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public Double getMaximum() {\n\t\treturn maximum;\n\t}", "public void setMaximumPoint(BlockVector pt) {\r\n setMinMaxPoints(this.getMinimumPoint(), pt);\r\n }", "public abstract float getMaxValue();", "public double max(){\r\n\t\t//variable for max val\r\n\t\tdouble max = this.data[0];\r\n\t\t\r\n\t\tfor (int i = 1; i < this.data.length; i++){\r\n\t\t\t//if the maximum is less than the current index, change max to that value\r\n\t\t\tif (max < this.data[i]){\r\n\t\t\t\tmax = this.data[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\t//return the maximum val\r\n\t\treturn max;\r\n\t}", "public int getMaxValue() {\n return maxValue;\n }", "public DynamicPart minMax(float min, float max) {\n return this.min(min).max(max);\n }", "@Override\n\tprotected void setLowerBound() {\n\t\t\n\t}", "public double getMaximumDouble() {\n/* 255 */ return this.max;\n/* */ }", "public void setMaxSR(float maxSR) {\n this.maxSR = maxSR;\n }", "@Raw\n private void setMaxVelocity(double max){\n \tif (!isValidMaxVelocity(max)) this.maxVelocity = SPEED_OF_LIGHT;\n \telse this.maxVelocity = max;\n }", "private double getMaxThreshold() {\n return maxThreshold;\n }", "static MwMaxNode addMwMax(HazardModel model, MwMaxNode node) {\n OptionalDouble mMax = StreamSupport.stream(model.spliterator(), false)\n .flatMap(sourceSet -> StreamSupport.stream(\n sourceSet.spliterator(),\n false))\n .filter(new SourceFilter(node.loc))\n .mapToDouble(source -> source.mfds().get(0).x(0))\n .min();\n// if (mMax.isPresent() && mMax.getAsDouble() < M_MAX) {\n// System.out.println(mMax.getAsDouble());\n// }\n node.mMax = mMax.isPresent()\n ? Double.min(mMax.getAsDouble(), M_MAX)\n : M_MAX;\n return node;\n }", "public void setMaxRange(Range r) {\n maximumViewableRange = r;\n LOG.debug(\"Setting maximum range to \" + r);\n }", "@Basic\n\tpublic double getVxmax() {\n\t\treturn this.vxmax;\n\t}", "public void setVarimaxMaximumIterations(int max){\n this.nVarimaxMax = max;\n }", "private void setMaxLoss(float maxloss) \n\t{\n\t\tif (Math.abs(maxloss) < 1.0f)\n\t\t{\n\t\t\t_maxloss = Math.abs(maxloss);\t\n\t\t}\n\t}", "public void setMaxValue(int maxValue) {\n this.maxValue = maxValue;\n }", "public void clamp(double min, double max) {\n\n\t\tr = Math.max(Math.min(r, max), min);\n\t\tg = Math.max(Math.min(g, max), min);\n\t\tb = Math.max(Math.min(b, max), min);\n\n\t}", "public M csmiPlaceMax(Object max){this.put(\"csmiPlaceMax\", max);return this;}", "public int getMinimumValue() {\n/* 276 */ return -this.s.getMaximumValue();\n/* */ }", "Expression getMax();", "void setNilMaximum();", "Double getMinimumValue();", "public void setLimit_ang_y_lower(float limit_ang_y_lower) throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeFloat(__io__address + 64, limit_ang_y_lower);\n\t\t} else {\n\t\t\t__io__block.writeFloat(__io__address + 56, limit_ang_y_lower);\n\t\t}\n\t}", "protected void calcMinMax() {\n }", "public void setMaximum() {\n getReel().setMaxValue(getVerticalScrollBar().getMaximum());\n }", "public void setLimit_lin_x_lower(float limit_lin_x_lower) throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeFloat(__io__address + 32, limit_lin_x_lower);\n\t\t} else {\n\t\t\t__io__block.writeFloat(__io__address + 24, limit_lin_x_lower);\n\t\t}\n\t}", "double getRight(double max);", "public DynamicPart max(float max) {\n this.max = max;\n return this;\n }", "public void SetMinVal(int min_val);", "public static void setMaxAu(int max) {\n\t\tmaxAu = max;\n\t}", "public void setMaxRange(int max_range) {\n\t\t// Do not allow negative numbers\n\t\tthis.max_range = Math.max(0, max_range);\n\t}", "public final void adjustLimits(int max) {\n this.invalid = false;\n if (this.value < 1) {\n this.value = 1;\n this.invalid = true;\n }\n if (max > 0) {\n if (this.value > max) {\n this.value = max;\n this.invalid = true;\n }\n }\n }", "private void calculateMaxTemperatureNormalisation() {\n maxTemperatureNormalisation = (temperatureMax - temperatureMin) / 2;\n }", "protected double asRelativeValue(final int generalization, final int max) {\n if (model != null && model.getResult() != null && model.getResult().getLattice() != null &&\n model.getResult().getLattice().getBottom() != null && model.getResult().getLattice().getTop() != null) {\n return ((double) generalization / (double) max) * 100d;\n } else {\n return 0;\n }\n }", "public void setMinValue(double x) {\r\n\t\tminValue = x;\r\n\t}", "public JTensor clamp(JType minValue, JType maxValue) {\n JTensor r = new JTensor();\n TH.THTensor_(clamp)(r, this, minValue, maxValue);\n return r;\n }", "public Number getMaximumNumber() {\n/* 221 */ if (this.maxObject == null) {\n/* 222 */ this.maxObject = new Long(this.max);\n/* */ }\n/* 224 */ return this.maxObject;\n/* */ }" ]
[ "0.67291915", "0.6275249", "0.62166077", "0.61767554", "0.61490995", "0.61477387", "0.6119975", "0.6115725", "0.60964465", "0.60697633", "0.6038798", "0.60330784", "0.60156906", "0.597816", "0.59277755", "0.59142303", "0.5881163", "0.58649856", "0.58474594", "0.57695234", "0.57586646", "0.5748121", "0.5748121", "0.57449424", "0.5732713", "0.572564", "0.57183266", "0.570793", "0.5706642", "0.5706553", "0.5703537", "0.56863296", "0.568199", "0.5680524", "0.56799287", "0.5660188", "0.56564224", "0.5651808", "0.5650912", "0.56488717", "0.56253934", "0.56218165", "0.5609658", "0.55980724", "0.55971974", "0.5593016", "0.5579674", "0.55745625", "0.5559232", "0.55540377", "0.55525064", "0.5547726", "0.5543447", "0.554161", "0.55368394", "0.5536047", "0.5523526", "0.5511127", "0.550336", "0.5496677", "0.54936177", "0.54864395", "0.54811", "0.54676485", "0.5461352", "0.5446285", "0.54395884", "0.54372275", "0.5436993", "0.5429369", "0.54251397", "0.5417751", "0.54140264", "0.54123044", "0.54098475", "0.54054075", "0.5404151", "0.53980654", "0.5382894", "0.53823507", "0.5381861", "0.53711534", "0.53675944", "0.5367063", "0.53625625", "0.5361018", "0.5354571", "0.5354099", "0.5351971", "0.53492427", "0.5339205", "0.5336059", "0.533501", "0.53306293", "0.5324655", "0.5323568", "0.5322812", "0.5322024", "0.5309506", "0.53081113" ]
0.59277403
15
A branching strategy over the objective variable. It is activated on the first solution, and iterates over the domain in decreasing order (upper bound first).
public static ObjectiveStrategy objective_bottom_up(IntVar OBJECTIVE){ return new ObjectiveStrategy(OBJECTIVE, OptimizationPolicy.BOTTOM_UP); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean solveBranchingModel(BranchingConstraintSet targetSet) {\n for (BranchingConstraint branching : targetSet.branchingConstraints) {\n Map<String, Double> terms = new HashMap<>();\n terms.put(branching.branchingVarName, 1.0);\n\n if (branching.branchingType == ConstraintType.LEQL)\n origin.addConstraint(branching.name, terms, branching.branchingType, -Double.MAX_VALUE, branching.bound);\n else\n origin.addConstraint(branching.name, terms, branching.branchingType, branching.bound, Double.MAX_VALUE);\n\n }\n\n origin.solveLP();\n\n for (BranchingConstraint branching : targetSet.branchingConstraints) {\n origin.removeConstraint(branching.name);\n }\n\n if (origin.getStatus() == Model.Status.OPTIMAL) {\n// System.out.println(\"Objective: \" + origin.getOptimum()); /* Get objective value */\n if (integerSolution()) {\n if (origin.getOptimum() < ub)\n ub = origin.getOptimum();\n return false;\n } else {\n if (origin.getOptimum() > lb)\n lb = origin.getOptimum();\n return true;\n }\n } else {\n System.out.println(\"Current branch is infeasible!\");\n return false;\n }\n }", "@Override\n protected void doAlgorithmA1() {\n int xP = 0;\n int yP = 0;\n\n\n //Taking the variable out of the list that are in the bounds\n //Testing that the bound has variables\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n xP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX().getPosition();\n }\n int xU = 0;\n int xL = 0;\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n yP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY().getPosition();\n }\n int yU = 0;\n int yL = 0;\n int cright = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCright();\n int cleft = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCleft();\n\n\n\n for (Variable variable : csp.getVars()) {\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n if (variable.getPosition() == xP) {\n xU = variable.getUpperDomainBound();\n xL = variable.getLowerDomainBound();\n }\n }\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n if (variable.getPosition() == yP) {\n yU = variable.getUpperDomainBound();\n yL = variable.getLowerDomainBound();\n }\n }\n }\n\n boolean first = false;\n boolean second = false;\n\n //Testing if the bound is true, false or inconclusive\n\n if (xL + cleft >= yU + cright) {\n first = true;\n }\n if (xU + cleft < yL + cright) {\n second = true;\n }\n\n //are first and second not equal is the bound not inconclusive\n if (first != second) {\n if (first) { //a true Simple Bound was found\n //checks if it was the last constraint in a csp\n //If so the csp is true\n //else check the next constraint and do this method again\n if (csp.getSimpleConstraints().size() - 1 == cIndex) {\n System.out.println(\"P is satisfiable\");\n System.out.println(System.nanoTime()-startTime);\n return;\n } else {\n bIndex = 0;\n cIndex++;\n unit=false;\n doAlgorithmA1();\n }\n } else if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) { //a false Simple Bound was found\n //\n bIndex = 0;\n cIndex = 0;\n if (isInconclusive) {\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n doAlgorithmA2();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n } else {//an inconclusive Simple Bound was found\n //checks if the bound wasn't already inconclusive\n if(!isInconclusive){\n unit=true;\n unitSB = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex);\n }else {\n unit=false;\n }\n isInconclusive = true;\n\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) {\n cIndex = 0;\n bIndex = 0;\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n }\n }", "double getBranchProbability();", "@Override\n public Solution solve(ISearchable domain) {\n if(domain==null)\n return null;\n Solution s2=domain.checkIfIsSmall();\n if(s2!=null){\n domain.isClear();\n return s2;\n }\n Solution sol = new Solution();\n temp.add(domain.getStartState());\n numOfNude++;\n domain.isVisit(domain.getStartState());\n ArrayList<AState> neighbors=new ArrayList<AState>();\n while(!temp.isEmpty()){\n AState curr=temp.poll();\n if(domain.isEqual(domain.getGoalState(),curr)){\n numOfNude++;\n sol =solutionPath(curr,sol);\n\n break;\n }\n neighbors=domain.getAllPossibleState(curr);\n for(int i=0;i<neighbors.size();i++){\n if(domain.isEqual(domain.getGoalState(),neighbors.get(i))){\n neighbors.get(i).pervState=curr;\n neighbors.get(i).setPrice(neighbors.get(i).getPrice()+curr.getPrice());\n numOfNude++;\n sol =solutionPath(neighbors.get(i),sol);\n break;\n }\n neighbors.get(i).pervState=curr;\n neighbors.get(i).setPrice(neighbors.get(i).getPrice()+curr.getPrice());\n temp.add(neighbors.get(i));\n numOfNude++;\n }\n }\n\n domain.isClear();\n return sol;\n }", "public VariableCoefficientTuple suggestBranchingVariable (TwoIntegerTuple childRectCounts ) {\r\n \r\n VariableCoefficientTuple result= new VariableCoefficientTuple(null, ZERO) ;\r\n \r\n //first get the best lp rects\r\n List<Rectangle> rectanglesToConsiderForBranchingVarCalculation = this.getRectanglesToConsiderForBranchingVarCalculation( );\r\n \r\n //collect 0 direction refcounts into this map\r\n Map<String, Integer> zeroVar_RefCountMap = new HashMap<String, Integer> () ;\r\n //and one diirection refconts into this map\r\n Map<String, Integer> oneVar_RefCountMap = new HashMap<String, Integer> () ;\r\n \r\n List<VariableCoefficientTuple> variablesUsedForBranchingInThisRectangle =null;\r\n for (Rectangle rect: rectanglesToConsiderForBranchingVarCalculation){\r\n variablesUsedForBranchingInThisRectangle = getVariablesUsedForBranchingInThisRectangle (rect);\r\n if (variablesUsedForBranchingInThisRectangle.size()>ZERO) {\r\n this.updateVariableRefCounts(zeroVar_RefCountMap, oneVar_RefCountMap, variablesUsedForBranchingInThisRectangle) ;\r\n }else {\r\n System.err.print(\"trying to branch a node which should have been marked infeasible\" );\r\n exit(ONE);\r\n }\r\n }\r\n \r\n \r\n //now find the highest refcount var, no matter its direction\r\n int highZeroFreq = zeroVar_RefCountMap.isEmpty()?ZERO:Collections.max( zeroVar_RefCountMap.values());\r\n int highOneFreq = oneVar_RefCountMap.isEmpty()? ZERO: Collections.max(oneVar_RefCountMap.values()) ;\r\n \r\n //we need to find the selected var's refcount on the other side\r\n int selectedVarRefCountOnOtherSide = ZERO;\r\n \r\n int totalRects = getNumberOfRects(this.myInfeasibleRectanglesList) ;\r\n \r\n if (highZeroFreq>highOneFreq) {\r\n result.varName=getHighestFreqVar (zeroVar_RefCountMap,highZeroFreq ) ;\r\n result.coeff=highZeroFreq;\r\n selectedVarRefCountOnOtherSide= oneVar_RefCountMap.get( result.varName)==null? ZERO : oneVar_RefCountMap.get( result.varName);\r\n //this is how many rects will survive on either side\r\n childRectCounts.zeroSideCount = totalRects - selectedVarRefCountOnOtherSide;\r\n childRectCounts.oneSideCount=totalRects -highZeroFreq ;\r\n \r\n } else {\r\n result.varName=getHighestFreqVar (oneVar_RefCountMap,highOneFreq ) ;\r\n result.coeff=highOneFreq;\r\n selectedVarRefCountOnOtherSide= zeroVar_RefCountMap.get( result.varName)==null? ZERO : zeroVar_RefCountMap.get( result.varName);\r\n \r\n childRectCounts.zeroSideCount = totalRects - highOneFreq;\r\n childRectCounts.oneSideCount=totalRects - selectedVarRefCountOnOtherSide;\r\n }\r\n \r\n return result;\r\n }", "public void calcObjective() {\n double obj;\n double objectives[];\n\n for (int i = 0; i < population.getPopulationSize(); i++) { //300\n objectives = population.getObjectiveValues(i);\n obj = evaluateAll(population.getSingleChromosome(i)); //evaluateAll(chromosome chromosome1)\n objectives[indexOfObjective] = obj;\n population.setObjectiveValue(i, objectives);\n }\n }", "public Collection<Stmt> branches() {\n if(branches_computed) {\n return branches_value;\n }\n ASTNode$State state = state();\n int num = state.boundariesCrossed;\n boolean isFinal = this.is$Final();\n branches_value = branches_compute();\n if (isFinal && num == state().boundariesCrossed) {\n branches_computed = true;\n } else {\n }\n\n return branches_value;\n }", "public Variable getObjective() {\r\n\t\treturn objective;\r\n\t}", "public Solution solve(ISearchable domain) {\n if (domain == null)\n return null;\n ArrayList<AState> neighbors;\n Solution solution;\n domain.ResetVisit();\n pathSteps.add(domain.getStartState());\n domain.changeVisitTrue(domain.getStartState());\n numberOfNodes++;\n while (pathSteps.size() > 0) {\n AState temp = pathSteps.poll();\n if (domain.getGoalState().equals(temp)) {\n domain.setGoalState(temp);\n solution = finalSolution(temp);\n return solution;\n }\n neighbors = domain.getAllPossibleStates(temp);\n for (int i=0;i<neighbors.size();i++) {\n if (domain.isVisited(neighbors.get(i))==false) {\n numberOfNodes++;\n domain.changeVisitTrue(neighbors.get(i));\n neighbors.get(i).predecessor = temp;\n pathSteps.add(neighbors.get(i));\n }\n if (neighbors.get(i).equals(domain.getGoalState())) {\n neighbors.get(i).predecessor = temp;\n solution = finalSolution(neighbors.get(i));\n return solution;\n }\n }\n }\n return null;\n }", "public boolean label(IntVar[] vars) {\r\n\r\n\r\n //System.out.println(\"ct \" + vars.length);\r\n count++;\r\n if (trace) {\r\n for (int i = 0; i < vars.length; i++)\r\n System.out.print (vars[i] + \" \");\r\n System.out.println ();\r\n }\r\n\r\n ChoicePoint choice = null;\r\n boolean consistent;\r\n\r\n // Instead of imposing constraint just restrict bounds\r\n // -1 since costValue is the cost of last solution\r\n if (costVariable != null) {\r\n try {\r\n if (costVariable.min() <= costValue - 1)\r\n costVariable.domain.in(store.level, costVariable, costVariable.min(), costValue - 1);\r\n else\r\n return false;\r\n } catch (FailException f) {\r\n return false;\r\n }\r\n }\r\n\r\n consistent = store.consistency();\r\n\r\n if (!consistent) {\r\n // Failed leaf of the search tree\r\n return false;\r\n } else { // consistent\r\n\r\n if (vars.length == 0) {\r\n // solution found; no more variables to label\r\n\r\n // update cost if minimization\r\n if (costVariable != null)\r\n costValue = costVariable.min();\r\n\r\n reportSolution();\r\n\r\n return costVariable == null; // true is satisfiability search and false if minimization\r\n }\r\n\r\n choice = new ChoicePoint(vars);\r\n\r\n levelUp();\r\n\r\n store.impose(choice.getConstraint());\r\n\r\n // choice point imposed.\r\n\r\n consistent = label(choice.getSearchVariables());\r\n\r\n if (consistent) {\r\n levelDown();\r\n return true;\r\n } else {\r\n\r\n restoreLevel();\r\n store.impose(new Not(choice.getConstraint()));\r\n\r\n\r\n\r\n // negated choice point imposed.\r\n\r\n consistent = label(vars);\r\n\r\n levelDown();\r\n\r\n if (consistent) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n }\r\n }", "public abstract OptimisationSolution getBestSolution();", "public static ObjectiveStrategy objective_top_bottom(IntVar OBJECTIVE){\n return new ObjectiveStrategy(OBJECTIVE, OptimizationPolicy.TOP_DOWN);\n }", "public LSMOP9(String solutionType, Integer numberOfVariables,\r\n\t\t\tInteger numberOfObjectives) {\r\n\t\tsuper(solutionType, numberOfVariables, numberOfObjectives);\r\n\t\tnumberOfVariables_ = numberOfVariables;\r\n\t\tnumberOfObjectives_ = numberOfObjectives;\r\n\t\tnumberOfConstraints_ = 0;\r\n\t\tproblemName_ = \"LSMOP9\";\r\n\r\n\t\tnk = 5;\r\n\t\tc = new double[numberOfObjectives_];\r\n\t\tc[0] = 3.8*0.1*(1.0-0.1);\r\n\t\tdouble sumC = c[0];\r\n\t\tfor(int i = 1; i < numberOfObjectives_; i++){\r\n\t\t\tc[i] = 3.8*c[i-1]*(1.0-c[i-1]);\r\n\t\t\tsumC += c[i];\r\n\t\t}\r\n\t\tsublen = new int[numberOfObjectives_];\r\n\t\tfor(int i = 0; i < numberOfObjectives_; i++){\r\n\t\t\t//sublen[i] = (int)Math.ceil(Math.round(numberOfVariables_*c[i]/sumC)/nk);\r\n\t\t\t//sublen[i] = (int)Math.floor(numberOfVariables_*c[i]/sumC/nk);\r\n\t\t\tsublen[i] = (int)Math.floor((numberOfVariables_-numberOfObjectives_+1)*c[i]/sumC/nk);\r\n\t\t}\r\n\t\tlen = new int[numberOfObjectives_+1]; \r\n\t\tlen[0] = 0;\r\n\t\tfor(int i = 0; i < numberOfObjectives_; i++){\r\n\t\t\tlen[i+1] = len[i] + nk*sublen[i];\r\n\t\t}\r\n\t\tlowerLimit_ = new double[numberOfVariables_];\r\n\t\tupperLimit_ = new double[numberOfVariables_];\r\n\t\tfor (int var = 0; var < numberOfObjectives_ - 1; var++) {\r\n\t\t\tlowerLimit_[var] = 0.0;\r\n\t\t\tupperLimit_[var] = 1.0;\r\n\t\t} // for\r\n\t\t\r\n\t\tfor (int var = numberOfObjectives_ - 1; var < numberOfVariables_; var++) {\r\n\t\t\tlowerLimit_[var] = 0.0;\r\n\t\t\tupperLimit_[var] = 10.0;\r\n\t\t} // for\r\n\r\n\t\tif (solutionType.compareTo(\"BinaryReal\") == 0)\r\n\t\t\tsolutionType_ = new BinaryRealSolutionType(this);\r\n\t\telse if (solutionType.compareTo(\"Real\") == 0)\r\n\t\t\tsolutionType_ = new RealSolutionType(this);\r\n\t\telse {\r\n\t\t\tSystem.out.println(\"Error: solution type \" + solutionType\r\n\t\t\t\t\t+ \" invalid\");\r\n\t\t\tSystem.exit(-1);\r\n\t\t}\r\n\t}", "private List<Rectangle> getRectanglesToConsiderForBranchingVarCalculation () {\r\n \r\n List<Rectangle> rectanglesToConsider = new ArrayList<Rectangle> ();\r\n \r\n //for every constraint, see if it has rects at the best lp\r\n \r\n for (Map <Double, List<Rectangle>> rectMap: myInfeasibleRectanglesList) {\r\n for (List<Rectangle> rectList : rectMap.values()) { \r\n \r\n rectanglesToConsider.addAll(rectList );\r\n \r\n } \r\n }\r\n \r\n return rectanglesToConsider;\r\n }", "@Override\n public Variable useHeuristic(Deque<Variable> deque) {\n Variable highDomain = deque.getFirst();\n for (Variable var : deque){\n if (var.getDomain().size() > highDomain.getDomain().size()){\n highDomain = var;\n }\n }\n return highDomain;\n }", "R visitBoundVariable(Formula f, int deBruijnIdx);", "public void testLPState()\n \t{\n \t\tsolver.buildLPState();\n \t\tassertTrue(solver.hasLPState());\n \t\t\n \t\tfinal int nLPVars = solver.getNumberOfLPVariables();\n \t\tassertTrue(nLPVars >= 0);\n \t\t\n \t\tfinal double[] objective = solver.getObjectiveFunction();\n \t\tassertEquals(nLPVars, objective.length);\n \t\t\n \t\tint nVarsUsed = 0;\n \t\t\n \t\tfor (VariableBase var : model.getVariables())\n \t\t{\n \t\t\tSVariable svar = solver.getSolverVariable(var);\n \t\t\tassertSame(svar, solver.createVariable(var));\n \t\t\t\n \t\t\tDiscrete mvar = svar.getModelObject();\n \t\t\tassertSame(var, mvar);\n \t\t\tassertSame(solver, svar.getParentGraph());\n \t\t\t\n \t\t\t// Test do-nothing methods\n \t\t\tsvar.resetEdgeMessages(0);\n \t\t\tsvar.updateEdge(0);\n \t\t\tsvar.moveMessages(null, 0, 1);\n \t\t\tassertNull(svar.getInputMsg(0));\n \t\t\tassertNull(svar.getOutputMsg(0));\n \t\t\tassertNull(svar.createMessages(null));\n \t\t\tassertNull(svar.resetInputMessage(null));\n \t\t\t\n \t\t\tint lpVar = svar.getLPVarIndex();\n \t\t\tint nValidAssignments = svar.getNumberOfValidAssignments();\n \t\t\t\n \t\t\tif (var.hasFixedValue())\n \t\t\t{\n \t\t\t\t// Currently the converse is not true because model variables\n \t\t\t\t// do not currently check to see if there is only one non-zero input weight.\n \t\t\t\tassertTrue(svar.hasFixedValue());\n \t\t\t}\n \t\t\tif (svar.hasFixedValue())\n \t\t\t{\n \t\t\t\tassertFalse(svar.hasLPVariable());\n \t\t\t}\n \t\t\tif (svar.hasLPVariable())\n \t\t\t{\n \t\t\t\tassertTrue(lpVar >= 0);\n \t\t\t\tassertTrue(nValidAssignments > 1);\n \t\t\t\t++nVarsUsed;\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\tassertEquals(-1, lpVar);\n \t\t\t\tassertTrue(nValidAssignments <= 1);\n \t\t\t}\n \t\t\t\n \t\t\tdouble[] weights = mvar.getInput();\n \t\t\tdouble totalWeight = 0.0;\n \t\t\tfor (double w : weights)\n \t\t\t{\n \t\t\t\ttotalWeight += w;\n \t\t\t}\n \t\t\t\n \t\t\tfor (int i = 0, end = svar.getModelObject().getDomain().size(); i < end; ++i)\n \t\t\t{\n \t\t\t\tdouble w = mvar.getInput()[i];\n \t\t\t\tint lpVarForValue = svar.domainIndexToLPVar(i);\n \t\t\t\tint i2 = svar.lpVarToDomainIndex(lpVarForValue);\n \t\t\t\tif (lpVarForValue >= 0)\n \t\t\t\t{\n \t\t\t\t\tassertEquals(i, i2);\n\t\t\t\t\tassertEquals(Math.log(w), objective[lpVarForValue], 1e-6);\n \t\t\t\t}\n \t\t\t\tif (!svar.hasLPVariable() || mvar.getInput()[i] == 0.0)\n \t\t\t\t{\n \t\t\t\t\tassertEquals(-1, lpVarForValue);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \t\tfor (Factor factor : model.getFactors())\n \t\t{\n \t\t\tSTableFactor sfactor = solver.getSolverFactor(factor);\n \t\t\tassertSame(sfactor, solver.createFactor(factor));\n \t\t\tassertSame(factor, sfactor.getModelObject());\n \t\t\tassertSame(solver, sfactor.getParentGraph());\n \t\t\t\n \t\t\t// Test do nothing methods\n \t\t\tsfactor.createMessages();\n \t\t\tsfactor.updateEdge(0);\n \t\t\tsfactor.resetEdgeMessages(0);\n \t\t\tsfactor.moveMessages(null, 0 , 1);\n \t\t\tassertNull(sfactor.getInputMsg(0));\n \t\t\tassertNull(sfactor.getOutputMsg(0));\n \t\t}\n \t\t\n \t\tfinal List<IntegerEquation> constraints = solver.getConstraints();\n \t\tassertNotNull(constraints);\n \n \t\tint nConstraints = solver.getNumberOfConstraints();\n \t\tint nVarConstraints = solver.getNumberOfVariableConstraints();\n \t\tint nMarginalConstraints = solver.getNumberOfMarginalConstraints();\n \t\tassertEquals(nConstraints, constraints.size());\n \t\tassertEquals(nConstraints, nVarConstraints + nMarginalConstraints);\n \t\tassertEquals(nVarsUsed, nVarConstraints);\n \t\t\n \t\t{\n \t\t\tMatlabConstraintTermIterator termIter = solver.getMatlabSparseConstraints();\n \t\t\tList<Integer> constraintTerms = new ArrayList<Integer>(termIter.size() * 3);\n \t\t\t\n \t\t\tIterator<IntegerEquation> constraintIter = constraints.iterator();\n \t\t\tfor (int row = 1; constraintIter.hasNext(); ++ row)\n \t\t\t{\n \t\t\t\tIntegerEquation constraint = constraintIter.next();\n \t\t\t\t\n \t\t\t\tint nExpectedTerms = -1;\n \t\t\t\tint lpVar = -1;\n \t\t\t\t\n \t\t\t\tif (row <= nVarConstraints)\n \t\t\t\t{\n \t\t\t\t\tLPVariableConstraint varConstraint = constraint.asVariableConstraint();\n \t\t\t\t\tassertNotNull(varConstraint);\n \t\t\t\t\tassertNull(constraint.asFactorConstraint());\n \t\t\t\t\t\n \t\t\t\t\tSVariable svar = varConstraint.getSolverVariable();\n \t\t\t\t\tassertTrue(svar.hasLPVariable());\n \t\t\t\t\t\n \t\t\t\t\tassertEquals(1, varConstraint.getRHS());\n \t\t\t\t\tnExpectedTerms = svar.getNumberOfValidAssignments();\n \t\t\t\t\t\n \t\t\t\t\tlpVar = svar.getLPVarIndex();\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tLPFactorMarginalConstraint factorConstraint = constraint.asFactorConstraint();\n \t\t\t\t\tassertNotNull(factorConstraint);\n \t\t\t\t\tassertNull(constraint.asVariableConstraint());\n \t\t\t\t\t\n \t\t\t\t\tSTableFactor sfactor = factorConstraint.getSolverFactor();\n \t\t\t\t\tlpVar = sfactor.getLPVarIndex();\n \t\t\t\t\t\n \t\t\t\t\tassertEquals(0, factorConstraint.getRHS());\n \t\t\t\t\tnExpectedTerms = sfactor.getNumberOfValidAssignments();\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tint[] lpvars = constraint.getVariables();\n \t\t\t\tassertEquals(constraint.size(), lpvars.length);\n \t\t\t\tassertEquals(0, constraint.getCoefficient(-1));\n \t\t\t\tassertEquals(0, constraint.getCoefficient(lpVar + nExpectedTerms));\n \t\t\t\tassertFalse(constraint.hasCoefficient(-1));\n \t\t\t\t\n \t\t\t\tassertTrue(lpVar >= 0);\n \n \t\t\t\tIntegerEquation.TermIterator constraintTermIter = constraint.getTerms();\n \t\t\t\tfor (int i = 0; constraintTermIter.advance(); ++i)\n \t\t\t\t{\n \t\t\t\t\tassertEquals(lpvars[i], constraintTermIter.getVariable());\n \t\t\t\t\tassertEquals(constraintTermIter.getCoefficient(), constraint.getCoefficient(lpvars[i]));\n \t\t\t\t\tassertTrue(constraint.hasCoefficient(lpvars[i]));\n \t\t\t\t\tconstraintTerms.add(row);\n \t\t\t\t\tconstraintTerms.add(constraintTermIter.getVariable());\n \t\t\t\t\tconstraintTerms.add(constraintTermIter.getCoefficient());\n \t\t\t\t}\n \t\t\t\tassertFalse(constraintTermIter.advance());\n \t\t\t}\n \t\t\t\n \t\t\tfor (int i = 0; termIter.advance(); i += 3)\n \t\t\t{\n \t\t\t\tassertEquals((int)constraintTerms.get(i), termIter.getRow());\n \t\t\t\tassertEquals(constraintTerms.get(i+1) + 1, termIter.getVariable());\n \t\t\t\tassertEquals((int)constraintTerms.get(i+2), termIter.getCoefficient());\n \t\t\t}\n \t\t\tassertFalse(termIter.advance());\n \t\t}\n \t\t\n \t\t\n \t\tif (expectedConstraints != null)\n \t\t{\n \t\t\tIterator<IntegerEquation> constraintIter = constraints.iterator();\n \t\t\tassertEquals(expectedConstraints.length, solver.getNumberOfConstraints());\n \t\t\tfor (int i = 0, end = expectedConstraints.length; i < end; ++i)\n \t\t\t{\n \t\t\t\tByteArrayOutputStream out = new ByteArrayOutputStream();\n \t\t\t\tIntegerEquation constraint = constraintIter.next();\n \t\t\t\tconstraint.print(new PrintStream(out));\n \t\t\t\tString actual = out.toString().trim();\n \n \t\t\t\tString expected = expectedConstraints[i].trim();\n \n \t\t\t\tif (!expected.equals(actual))\n \t\t\t\t{\n \t\t\t\t\tSystem.out.format(\"Constraint %d mismatch:\\n\", i);\n \t\t\t\t\tSystem.out.format(\"Expected: %s\\n\", expected);\n \t\t\t\t\tSystem.out.format(\" Actual: %s\\n\", actual);\n \t\t\t\t}\n \t\t\t\tassertEquals(expected, actual);\n \t\t\t}\n \t\t}\n \t\t\n \t\t// Test setting solution. A real solution will only use ones and zeros,\n \t\t// but we will use random values to make sure they are assigned correctly.\n \t\tdouble[] solution = new double[nLPVars];\n \t\tRandom rand = new Random();\n \t\tfor (int i = solution.length; --i>=0;)\n \t\t{\n \t\t\tsolution[i] = rand.nextDouble();\n \t\t}\n \t\tsolver.setSolution(solution);\n \t\tfor (VariableBase var : model.getVariables())\n \t\t{\n \t\t\tSVariable svar = solver.getSolverVariable(var);\n \t\t\tdouble[] belief = svar.getBelief();\n \t\t\tif (svar.hasFixedValue())\n \t\t\t{\n \t\t\t\tint vali = svar.getValueIndex();\n \t\t\t\tfor (int i = belief.length; --i>=0;)\n \t\t\t\t{\n \t\t\t\t\tif (i == vali)\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(1.0, belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t\telse\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(0.0, belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\tfor (int i = svar.getModelObject().getDomain().size(); --i>=0;)\n \t\t\t\t{\n \t\t\t\t\tint lpVar = svar.domainIndexToLPVar(i);\n \t\t\t\t\tif (lpVar < 0)\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(0, belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t\telse\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(solution[lpVar], belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \t\tsolver.clearLPState();\n \t\tassertInitialState();\n \t}", "public void boundsLex(int [] a , IntDomainVar [] x , int [] b,int j) throws ContradictionException{\n\n int i =0;\n\n\n while( i< n && a[i]==b[i]){\n\n\n if((x[i].getInf()==a[i] || x[i].updateInf(a[i], this, false)) &&\n (x[i].getSup()==b[i] || x[i].updateSup(b[i], this, false))){\n i++;\n }else{\n this.fail();\n }\n\n }\n\n\n if(i<n )\n if ((x[i].getInf()==a[i] || x[i].updateInf(a[i], this, false)) &&\n (x[i].getSup()==b[i] || x[i].updateSup(b[i], this, false))){\n }else{\n this.fail();\n }\n\n\n if(i==n || x[i].getNextDomainValue(a[i])<b[i]){\n return ;\n }\n\n i+=1;\n\n while(i<n && (b[i]+1 <= a[i]-1) && x[i].getInf()==b[i] && x[i].getSup()==a[i]){\n if(x[i].removeInterval(b[i]+1,a[i]-1, this, false)){\n i++;\n }else{\n this.fail();\n\n }\n }\n\n if(i<n) {\n if (b[i] + 1 <= a[i] - 1 && x[i].getInf() <= b[i] &&\n b[i] <= x[i].getSup() && x[i].getSup() >= a[i] && a[i] >= x[i].getInf()) {\n if (!x[i].removeInterval(b[i] + 1, a[i] - 1, this, false)) {\n this.fail();\n }\n }\n }\n\n }", "private double lbranch(double x) {\n\t\r\n\t\tdouble w = approx(x, g, a);\r\n\t\tint i=0;\r\n\t\tdouble err=w+2;\r\n\t\tdouble arg=0,da=0,df=0;\r\n\t\twhile (i<niter && abs(err-w)>tol ) {\r\n\t\t\terr=w;\r\n\r\n\t\t\targ=(w-a)/g-log(g);\r\n\t\t\tda=-lw_minus.eval(arg);\t\r\n\t\t\tdf=iq_minus.eval(w);\r\n\t\t\t//System.out.println(w+\" \"+arg+\" \"+da+\" \"+df);\r\n\t\t\tif (Double.isNaN(df) || Double.isNaN(da)) {\r\n\t\t\t\t//System.out.println(\"df \"+df+ \" da \"+da+\" w \"+w);\r\n\t\t\t\treturn Double.NaN;\r\n\t\t\t}\r\n\t\t\tw+=w*(da+1.0)*(df-g*x);\r\n\t\t\tif (w<=0) return err;\r\n\t\t\ti++;\r\n\t\t} \r\n\t\taiter=i-1;\r\n\t//\tSystem.out.println(\" niter \" +aiter +\" err \"+abs(err));\r\n\r\n\t\treturn w;\r\n\t}", "public int objective() {\n\t\tint value = 0;\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tvalue += v[i] * x[i];\n\t\treturn value;\n\t}", "@Override\n\tpublic Solution<TTPVariable> run(SingleObjectiveThiefProblem thief, IEvaluator evaluator, MyRandom rand) {\n\t\tTTPVariable var = TTPVariable.create(new TourOptimalFactory(thief).next(rand), Pack.empty());\n\t\tSolution<TTPVariable> currentBest = thief.evaluate(var);\n\t\t\n\n\t\twhile (evaluator.hasNext()) {\n\n\t\t\t// now take the tour and optimize packing plan\n\t\t\tSolution<Pack> nextPack = optPack(thief, evaluator, rand, currentBest.getVariable().getTour(), currentBest.getVariable().getPack());\n\t\t\t\n\t\t\tSolution<Tour> nextTour = optTour(thief, evaluator, rand, currentBest.getVariable().getTour(), nextPack.getVariable());\n\t\t\t\n\t\t\tTTPVariable next = TTPVariable.create(nextTour.getVariable(), nextPack.getVariable());\n\t\t\tSolution<TTPVariable> s = thief.evaluate(next);\n\t\t\t\n\t\t\t//System.out.println(nextPack);\n\t\t\t//System.out.println(currentBest);\n\t\t\t//System.out.println(\"----------------\");\n\t\t\t\n\t\t\t// update the best found solution\n\t\t\tif (SolutionDominator.isDominating(s, currentBest)) {\n\t\t\t\tcurrentBest = s;\n\t\t\t\t//System.out.println(\"YES\");\n\t\t\t}\n\t\t\tevaluator.notify(currentBest);\n\n\t\t}\n\n\t\treturn currentBest;\n\t}", "private void branch01(Node parent) {\n final GeneralLP lp0 = parent.lp;\n final int v = intVars[parent.level];\n Maths.CnF cf = new Maths.CnF(lp0.x[v - 1]);\n\n double[][] a2 = Arrays.copyOf(lp0.a, lp0.m);\n double[] bLeft = lp0.b; // left branch\n double[] bRight = Arrays.copyOf(lp0.b, lp0.m); // right branch\n double[] c2 = Arrays.copyOf(lp0.c, lp0.n);\n double c0Right = lp0.c0 + lp0.c[v - 1]; // c0Left unchanged\n branch01Arguments(c2, a2, bRight, lp0, v);\n\n // LP1: left branch (=0)\n LOG.debug(parent, \"left branch x(\", v, \") =\", 0);\n GeneralLP lp1 = new GeneralLP(lp0.objectiveType, lp0.c0, c2, a2, lp0.signs, bLeft, lp0.freeVars);\n Node child1 = new Node(lp1, parent, Node.LEFT).binary(v);\n nodes.addLast(child1);\n\n // LP2: right branch (=1)\n LOG.debug(parent, \"right branch x(\", v, \") =\", 1);\n GeneralLP lp2 = new GeneralLP(lp0.objectiveType, c0Right, c2, a2, lp0.signs, bRight, lp0.freeVars);\n Node child2 = new Node(lp2, parent, Node.RIGHT).binary(v);\n nodes.addLast(child2);\n\n parent.lp = null; // release memory\n }", "public Collection<Stmt> targetBranches() {\n if(targetBranches_computed) {\n return targetBranches_value;\n }\n ASTNode$State state = state();\n int num = state.boundariesCrossed;\n boolean isFinal = this.is$Final();\n targetBranches_value = targetBranches_compute();\n if (isFinal && num == state().boundariesCrossed) {\n targetBranches_computed = true;\n } else {\n }\n\n return targetBranches_value;\n }", "private int getLowerBound(Object problem, int upperbound)\n {\n Graph tsp = (Graph)problem;\n if (weight == null)\n weight = new double[tsp.size()];\n hki = new HeldKarpIterative( tsp, included, includedT, excluded, excludedT, iterations, weight, upperbound);\n hki.compute();\n tour = hki.isTour();\n bound = hki.getBound();\n hasRun = true;\n// System.out.println(hki.debugDump());\n return bound;\n }", "public boolean runSolver()\n {\n Variable current = getUnassignedVar();\n\n if (current == null)\n {\n return true;\n }\n\n for (int i = 0; i < current.getDomain().size(); i++)\n {\n List<Integer> oldDomain = current.getDomain();\n int newval = oldDomain.get(i);\n current.setValue(newval);\n current.setDomain(i);\n\n if (constraintsSatisfied(constraintsWithAnyVals()))\n {\n if (runSolver())\n {\n return true;\n }\n }\n\n current.setDomain(oldDomain);\n current.setValue(current.getPrevious()); \n }\n return false;\n }", "public Object eval(Individual ind)\r\n {\r\n BinaryIndividual bi = (BinaryIndividual)ind;\r\n int partialFitness = 0;\r\n int distance = 0;\r\n double fitness = 0.0;\r\n\r\n\t for (int i=0; i<100; i++){\r\n\r\n\t distance = 0;\r\n\r\n\t for (int j=0; j<100; j++){\r\n\t if (!((BinaryIndividual)target[i]).getBooleanAllele(j)^bi.getBooleanAllele(j)) { \r\n\t\t distance++;\r\n\t }\r\n \r\n\t if (distance > partialFitness) {\r\n\t partialFitness = distance;\r\n\t }\r\n\t }\r\n }\r\n\r\n fitness = (double)partialFitness/100.0;\r\n return new Double(fitness);\r\n \r\n\r\n }", "public void solution() {\n\t\t\n\t}", "@Override\n \tpublic Solution solve() {\n \t\tfor (int i = 0; i < n; i++) {\n \t\t\tnest[i] = generator.getSolution();\n \t\t}\n \n \t\tfor (int t = 0; t < maxGeneration; t++) { // While (t<MaxGeneration) or\n \t\t\t\t\t\t\t\t\t\t\t\t\t// (stop criterion)\n \t\t\t// Get a cuckoo randomly (say, i) and replace its solution by\n \t\t\t// performing random operations;\n \t\t\tint i = r.nextInt(n);\n \t\t\tSolution randomNest = nest[i];\n \t\t\t//FIXME: randomNest = solutionModifier.modify(nest[i]);\n \n \t\t\t// Evaluate its quality/fitness\n \t\t\tint fi = randomNest.f();\n \n \t\t\t// Choose a nest among n (say, j) randomly;\n \t\t\tint j = r.nextInt(n);\n \t\t\tint fj = f[j];\n \n \t\t\tif (fi > fj) {\n \t\t\t\tnest[i] = randomNest;\n \t\t\t\tf[i] = fi;\n \t\t\t}\n \n \t\t\tsort();\n \t\t\t// A fraction (pa) of the worse nests are abandoned and new ones are built;\n\t\t\tfor(i = n-toAbandon; i<n; i++) {\n \t\t\t\tnest[i] = generator.getSolution();\n \t\t\t}\n \t\t\t\n \t\t\t// Rank the solutions/nests and find the current best;\n \t\t\tsort();\n \t\t}\n \n \t\treturn nest[0];\n \t}", "public void setObjective(Variable v) {\r\n\t\tobjective = v;\r\n\t\tif (v != null) {\r\n\t\t\tadd(v);\r\n\t\t}\r\n\t}", "private int optimize() {\n\t\t// items: Items sorted by value-to-weight ratio for linear relaxation\n\t\t// t: the decision vector being tested at each node\n\t\t// ws, vs, is, bs: stacks of weight, value, item id, whether bring item\n\t\t// p: stack pointer; i, b, weight, value: loop caches; best: max search\n\t\t// ss: stack size: Always <=2 children on stack for <=n-1 parents\n\t\tItem[] items = new Item[n];\n\t\tint ss = 2 * n;\n\t\tint[] itemsSorted = new int[n], t = new int[n], ws = new int[ss],\n\t\t\tvs = new int[ss], is = new int[ss], bs = new int[ss];\n\t\tint i, b, weight, value, best = 0, p = 0;\n\n\t\tfor (int j = 0; j < n; j++)\n\t\t\titems[j] = new Item(j);\n\t\tArrays.sort(items);\n\t\tfor (int j = 0; j < n; j++)\n\t\t\titemsSorted[j] = items[j].i();\n\t\titems = null; // For garbage collection.\n\n\t\t// Push item 0 onto the stack with and without bringing it.\n\t\tws[p] = 0; vs[p] = 0; is[p] = 0; bs[p] = 1; p++;\n\t\tws[p] = 0; vs[p] = 0; is[p] = 0; bs[p] = 0; p++;\n\n\t\twhile (p > 0) {\n\t\t\tp--; // Pop the latest item off the stack\n\t\t\ti = is[p]; b = bs[p];\n\t\t\tweight = ws[p] + w[i] * b;\n\t\t\tif (weight > k)\n\t\t\t\tcontinue;\n\t\t\tvalue = vs[p] + v[i] * b;\n\t\t\tif (bound(i, weight, value, itemsSorted) < best)\n\t\t\t\tcontinue;\n\t\t\tbest = Math.max(value, best);\n\t\t\tt[i] = b;\n\t\t\tif (i < n - 1) { // Push children onto stack w/ & w/o bringing item\n\t\t\t\tws[p] = weight; vs[p] = value; is[p] = i + 1; bs[p] = 1; p++;\n\t\t\t\tws[p] = weight; vs[p] = value; is[p] = i + 1; bs[p] = 0; p++;\n\t\t\t}\n\t\t\telse if (value >= best)\n\t\t\t\tSystem.arraycopy(t, 0, x, 0, n);\n\t\t}\n\t\treturn best;\n\t}", "public Instruction[] branchpoints(Instruction next) {\n /*\n * Instruction[] bps= new Instruction[1]; bps[0] = next; return bps;\n */\n return null;\n }", "public Behaviour runObjective() {\n //System.out.println(\"Simulation runObjective(): running method\");\n final int iterations = config.getSimulationIterations();\n return objectiveSimulation(iterations);\n }", "@Test\n\tpublic void testGA() {\n\t\tGenetic ga = new Genetic(100, 500, 10, SelectionType.TOURNAMENT , 0.6, 0.1);\n\t\tOptimumSolution os = ga.run();\n\t\tSystem.out.println(os.getSolution());\n\t}", "@Override\n public void evaluate(Solution solution) throws JMException {\n\n int[] tour = new int[numberOfNodes + 1];\n int firstCity = ((Permutation) solution.getDecisionVariables()[0]).vector_[0];\n int lastCity = ((Permutation) solution.getDecisionVariables()[0]).vector_[numberOfNodes - 1];\n\n double fitness1_td = 0.0;\n\n // Calculate fitness 1 - total distance\n for (int i = 0; i < numberOfNodes - 1; i++) {\n int x = ((Permutation) solution.getDecisionVariables()[0]).vector_[i];\n int y = ((Permutation) solution.getDecisionVariables()[0]).vector_[i+1];\n\n tour[i] = x;\n tour[i+1] = y;\n\n fitness1_td += calDistances(x, y);\n }\n // generate tour with same start city and end city\n tour[numberOfNodes] = tour[0];\n\n fitness1_td += calDistances(firstCity, lastCity);\n\n\n // Correctness check: does the tour start and end in the same city\n if(tour[0] != tour[tour.length - 1]) {\n System.err.println(\"ERROR: The last city must be the same as the first city\");\n System.exit(1);\n }\n\n /*for (int i = 0; i < tour.length; i++) {\n System.out.print(tour[i] + \" \");\n }*/\n //System.out.println(\"\\n\" + tour.length);\n\n // Calculate fitness 2 - objective value of a given tour\n ArrayInt z = (ArrayInt) solution.getDecisionVariables()[1];\n //System.out.println(z.getLength());\n\n double fitness2_ob;\n double wc = 0.0;\n double ft = 0.0;\n double fp = 0.0;\n\n //the following is used for a different interpretation of \"packingPlan\"\n int itemsPerCity = z.getLength() / (tour.length - 2);\n //System.out.println(itemsPerCity);\n\n for (int i = 0; i < tour.length - 1; i++) {\n\n int currentCityTEMP = tour[i];\n // what's the current city? --> but the items start at city 2 in the TTP file, so I have to take another 1 off!\n int currentCity = currentCityTEMP - 1;\n\n if (i > 0) {\n\n if (currentCity == -1) {\n // No items in city 1\n wc += 0.0;\n fp += 0.0;\n\n } else {\n\n for (int itemNumber = 0; itemNumber < itemsPerCity; itemNumber++) {\n\n int indexOfPackingPlan = (i-1) * itemsPerCity + itemNumber;\n // what is the next item's index in items-array?\n int itemIndex = currentCity + itemNumber * (numberOfNodes - 1);\n //System.out.println(\"i: \" + i);\n\n if (z.getValue(indexOfPackingPlan) == 1) {\n // pack item\n //System.out.println(itemIndex);\n int currentWC = items[itemIndex][2];\n wc += currentWC;\n\n int currentFP = items[itemIndex][1];\n fp += currentFP;\n }\n }\n\n }\n\n int h = (i+1) % (tour.length-1); //h: next tour city index\n //System.out.println(\"h: \" + h);\n long distance = calDistances(i, h);\n // compute the adjusted (effective) distance\n ft += (distance / (1 - wc * (maxSpeed - minSpeed) / capacityOfKnapsack));\n }\n }\n\n wendUsed = wc;\n wend = capacityOfKnapsack - wc;\n fitness2_ob = fp - ft * rentingRatio;\n\n solution.setObjective(0, fitness1_td);\n solution.setObjective(1, -fitness2_ob); // Convert from maximum objective value to minimum objective value\n }", "public interface Heuristic\r\n{\r\n\r\n double calcStartToGoalCost(State currentState, State goalState);\r\n}", "@Test\n\tpublic void test() {\n\t\tRandomVariableDefinition RV_DEF_X = new RandomVariableDefinition(\"DEF_X\", Arrays.asList(\"x0\", \"x1\", \"x2\"));\n\t\tRandomVariableDefinition RV_DEF_Y = new RandomVariableDefinition(\"DEF_Y\", Arrays.asList(\"y0\", \"y1\"));\n\t\tRandomVariableDefinition RV_DEF_Z = new RandomVariableDefinition(\"DEF_Y\", Arrays.asList(\"z0\", \"z1\"));\n\n\t\t///////////////////////////////////\n\t\t// define the local probability models\n\t\tLocalProbabilityModel X = new LocalProbabilityModel(\"X\");\n\t\tLocalProbabilityModel Y = new LocalProbabilityModel(\"Y\");\n\t\tLocalProbabilityModel Z = new LocalProbabilityModel(\"Z\");\n\t\tLocalProbabilityModel X1 = new LocalProbabilityModel(\"X1\");\n\t\tLocalProbabilityModel X2 = new LocalProbabilityModel(\"X2\");\n\t\tLocalProbabilityModel X3 = new LocalProbabilityModel(\"X3\");\n\t\tLocalProbabilityModel X7 = new LocalProbabilityModel(\"X7\");\n\t\t\n\t\t////////////////////////////////\n\t\t// specify target variable type, and dependencies\n\t\t\n\t\t// two a-priori variables - target only, no dependencies\n\t\tX.setTargetAndDependencies(RV_DEF_X, null);\n\t\tY.setTargetAndDependencies(RV_DEF_Y, null);\n\t\t\n\t\t// a LPM conditionally dependent on two variables\n\t\tZ.setTargetAndDependencies(RV_DEF_Z, Arrays.asList(X, Y));\n\n\t\t// a LPM conditionally dependent on several variables of the same type\n\t\tX3.setTargetAndDependencies(RV_DEF_X, Arrays.asList(X1, X2));\n\n\t\t// a LPM conditionally dependent on itself (i.e. a state variable)\n\t\tX7.setTargetAndDependencies(RV_DEF_X, Arrays.asList(X7));\n\n\t\n\t\t// the first has no dependencies just values\n\t\tX.setValue(\"x0\", 0.6);\n\t\tX.setValue(\"x1\", 0.1);\n\t\tX.setValue(\"x2\", 0.1);\n\n\t\t// the second has dependencies\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x0\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x0\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x1\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x1\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x2\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x2\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x0\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x0\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x1\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x1\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x2\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x2\"), Y.event(\"y1\")), 0.3);\n\n\t\t// the third has a recurrent dependency\n\t\tX1.setValue(\"x0\", Arrays.asList(X1.event(\"x0\")), 0.1);\n\t\tX1.setValue(\"x0\", Arrays.asList(X1.event(\"x1\")), 0.1);\n\t\tX1.setValue(\"x1\", Arrays.asList(X1.event(\"x0\")), 0.1);\n\t\tX1.setValue(\"x1\", Arrays.asList(X1.event(\"x1\")), 0.1);\n\t\t\n\t\t\n\t\t\n\t\t/* NOTE - should we enforce that a conditional probability should always be 'set' with requirement that the conditioning variables should all be identified ? */\n\t\t// this would be Z.setValue(\n\t//\tZ.setValue(Arrays.asList(X.event(\"x0\"), Y.event(\"y0\")),\n\t//\t\t\tArrays.asList(\n\t//\t\t\t\t\t\"z0\", 0.5,\n\t//\t\t\t\t\t\"z1\", 0.3,\n\t//\t\t\t\t\t\"z2\", 0.7));\n\n\n\n\t\tString s = Z.toString();\n\t\tSystem.out.println(\"==============\\n\" + s);\n\n\t\tSystem.out.println(\"done\");\n\n\n\t}", "@Override\n public final void solve() {\n this.flag1 = this.neo.getPosition().equals(this.goal);\n \n }", "private double bound(int iter, Solution next) {\n return Math.exp((-1.0 * (next.getValue() - bestSol.getValue())) / denominator(iter));\n }", "@Override\n\tpublic Condition getGoal()\n\t{\n\t\treturn explicitGoal;\n\t}", "public VariableUnit solve() {\n LinkedList<VariableUnit> processor = new LinkedList<VariableUnit>();\n\n VariableUnit vu1 = new VariableUnit(250.0, 'x');\n VariableUnit vu2 = new VariableUnit('+');\n VariableUnit vu3 = new VariableUnit(250.0, 'x');\n VariableUnit vu4 = new VariableUnit(501.0, 'x');\n VariableUnit vu5 = new VariableUnit('y');\n VariableUnit vu6 = new VariableUnit('-');\n alpha_arr.get(('x' - 'a')).addLast(vu1);\n alpha_arr.get(('x' - 'a')).addLast(vu2);\n alpha_arr.get(('x' - 'a')).addLast(vu3);\n op_order.add(vu1); op_order.add(vu2); op_order.add(vu3); op_order.add(vu6);\n op_order.add(vu4); op_order.add(vu6); op_order.add(vu5);\n assignValue(2.0, 'x');\n \n System.out.print(vu1); System.out.print(vu2); System.out.print(vu3);\n System.out.print(vu6); System.out.print(vu4); System.out.print(vu6);\n System.out.print(vu5);\n System.out.println();\n System.out.println(\"------------------------------\");\n \n VariableUnit temp, temp1;\n for (int i = 0; i < op_order.size(); i++) {\n \ttemp = op_order.pollFirst();\n \t\n \t\tswitch (temp.getVariable()) {\n \tcase '+':\n \t\t//if processor.isEmpty(): throw an exception\n \t\ttemp1 = processor.pop().add(op_order.pollFirst());\n \t\tprocessor.push(temp1);\n \t\tbreak;\n \tcase '-':\n \t\t//if processor.isEmpty(): throw an exception\n \t\ttemp1 = processor.pop().subtract(op_order.pollFirst());\n \t\tprocessor.push(temp1);\n \t\tbreak;\n \tdefault:\n \t\tprocessor.push(temp);\n \t\t}\n }\n\n /*\n * System.out.println(\"This equation is currently unsolvable.\");\n \tSystem.out.println(\"Try assigning values to some of the variables.\");\n */\n while (!processor.isEmpty()) {\n \top_order.addFirst(processor.pop());\n }\n \n ListIterator<VariableUnit> iter = op_order.listIterator();\n \n while ( iter.hasNext() ) {\n \tVariableUnit iter_temp = iter.next();\n \t//System.out.print(iter_temp.hasValue());\n \tif (iter_temp.hasValue()) {\n \t\tSystem.out.print( Double.toString(iter_temp.subValue()) );\n \t}\n \telse {\n \t\tSystem.out.print(iter_temp);\n \t}\n };\n System.out.println();\n \n return new VariableUnit(Double.NaN, ' ');\n }", "protected void doDeduction() {\n\n boolean narrowed= false;\n\n unit=false;\n isInconclusive=false;\n\n int newXL;\n int newYU;\n\n Variable x = null;\n Variable y = null;\n\n for(Variable var : csp.getVars()){\n if(var.getPosition() == unitSB.getX().getPosition()){\n x = var;\n } else if(var.getPosition() == unitSB.getY().getPosition()){\n y = var;\n }\n }\n\n int xU = x.getUpperDomainBound();\n int yL = y.getLowerDomainBound();\n\n newXL = yL + unitSB.getCright();\n newYU = xU - unitSB.getCright();\n\n if(newXL>x.getLowerDomainBound()){\n Variable newX = new Variable(newXL, xU);\n newX.setPosition(x.getPosition());\n changeVariable(newX);\n narrowed= true;\n }\n if (newYU< y.getUpperDomainBound()){\n Variable newY = new Variable(yL, newYU);\n newY.setPosition(y.getPosition());\n changeVariable(newY);\n narrowed =true;\n }\n\n if(narrowed){\n doAlgorithmA1();\n }else {\n doAlgorithmA3();\n }\n\n }", "public void solveGame4() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\t\t\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t}\n\n\t\t// Handle the pending states\n\t\twhile (!losing.isEmpty()) {\n\t\t\tS state = losing.poll();\n\n\t\t\t\n\t\t\tlosingStates.add(state);\n\n\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\tfor (S pred : predecessors) {\n\t\t\t\tif(losing.contains(pred) || losingStates.contains(pred))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t//if(i == -1)\n\t\t\t\t\t//continue;\n\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}else{\n\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "public SolutionSet execute() throws JMException, ClassNotFoundException {\n int maxEvaluations ;\n int evaluations ;\n\n SolutionSet population ;\n SolutionSet offspringPopulation ;\n\n Solution betterIndividual ;\n\n Operator mutationOperator ;\n Comparator comparator ;\n Operator localSearchOperator ;\n\n\n comparator = new ObjectiveComparator(0) ; // Single objective comparator\n\n // Read the params\n maxEvaluations = ((Integer)this.getInputParameter(\"maxEvaluations\")).intValue();\n\n // Initialize the variables\n population = new SolutionSet(mu_) ;\n offspringPopulation = new SolutionSet(lambda_) ;\n\n evaluations = 0;\n\n // Read the operators\n mutationOperator = this.operators_.get(\"mutation\");\n localSearchOperator = (LocalSearch) operators_.get(\"improvement\");\n\n System.out.println(\"(\" + mu_ + \" + \" + lambda_+\")ES\") ;\n\n // Create 1-parent population of mu solutions\n Solution newIndividual;\n newIndividual = new Solution(problem_);\n problem_.evaluate(newIndividual);\n evaluations++;\n betterIndividual = new Solution(newIndividual);\n population.add(betterIndividual);\n\n // Main loop\n while (evaluations < maxEvaluations) {\n // STEP 1. Generate the offspring\n Solution offspring = new Solution(population.get(0)) ;\n mutationOperator.execute(offspring);\n /*Solution mutated_solution = (Solution) mutationOperator.execute(offspring);\n if(offspring.getObjective(0) < mutated_solution.getObjective(0))\n offspring = mutated_solution;*/\n problem_.evaluate(offspring);\n Solution local_offspring = (Solution) localSearchOperator.execute(offspring);\n offspring.setObjective(0, local_offspring.getObjective(0));\n offspringPopulation.add(offspring);\n evaluations++;\n\n if(comparator.compare(betterIndividual, offspringPopulation.get(0)) > 0) {\n betterIndividual = new Solution(offspringPopulation.get(0));\n population.clear();\n // STEP 4. Create the new mu population\n population.add(betterIndividual);\n }\n\n System.out.println(population.get(0).getObjective(0)) ;\n\n // STEP 6. Delete the offspring population\n offspringPopulation.clear() ;\n } // while\n\n // Return a population with the best individual\n SolutionSet resultPopulation = new SolutionSet(1) ;\n resultPopulation.add(population.get(0)) ;\n\n return resultPopulation ;\n }", "@Override\n\tpublic direction[] Solve(nPuzzle aPuzzle) {\n\t\taddToFrontier(aPuzzle.StartState);\n\t\t\n\t\t// While the open list is not empty:\n\t\twhile(Frontier.size() > 0) {\n\t\t\t// Find the frontier with the lowest F value.\n\t\t\tPuzzleState q = popFrontier();\n\t\t\t\n\t\t\tArrayList<PuzzleState> newStates = q.explore();\n\t\t\t\n\t\t\tfor(PuzzleState n : newStates) {\n\t\t\t\t// If goal state return path to state.\n\t\t\t\tif(n.equals(aPuzzle.GoalState))\n\t\t\t\t\treturn n.GetPathToState();\n\t\t\t\t// Else add state to open list.\n\t\t\t\telse {\n\t\t\t\t\tn.HeuristicValue = HeuristicValue(n, aPuzzle.GoalState);\n\t\t\t\t\tn.setEvaluationFunction(n.HeuristicValue + n.Cost);\n\t\t\t\t\taddToFrontier(n);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "@Override\n public void updateIndividualObjectivesAndConstraints(\n OptimizationProblem problem,\n Individual individual) {\n double[] x = individual.real;\n // Number of design variables\n int n = x.length;\n // number of objectives\n int m = problem.objectives.length;\n // (g) calculations\n double summation = 0;\n for (int i = m - 1; i < n; i++) {\n summation += Math.pow(x[i] - 0.5, 2);\n }\n double g = summation;\n // Create objective functions\n for (int i = 0; i < m; i++) {\n double objValue = 1 + g;\n for (int j = 0; j < m - i - 1; j++) {\n objValue *= Math.cos(Math.pow(x[j], ALPHA) * Math.PI / 2);\n }\n if (i != 0) {\n objValue *= Math.sin(Math.pow(x[m - i - 1], ALPHA)\n * Math.PI / 2);\n }\n individual.setObjective(i, objValue);\n }\n // Announce that objective function values are valid\n individual.validObjectiveFunctionsValues = true;\n // Update constraint violations if constraints exist\n if (problem.constraints != null) {\n // In C3-DTLZ4, the number of constraints is equal to the number of\n // objectives\n double[] constraints = new double[problem.objectives.length];\n for (int j = 0; j < constraints.length; j++) {\n constraints[j] = Math.pow(individual.getObjective(j), 2)\n / 4 - 1;\n for (int i = 0; i < problem.objectives.length; i++) {\n if (i != j) {\n constraints[j]\n += Math.pow(individual.getObjective(i), 2);\n }\n }\n }\n // Set constraints vilations\n for (int i = 0; i < constraints.length; i++) {\n if (constraints[i] < 0) {\n individual.setConstraintViolation(i, constraints[i]);\n } else {\n individual.setConstraintViolation(i, 0);\n }\n }\n // Announce that objective function values are valid\n individual.validConstraintsViolationValues = true;\n }\n // Increase Evaluations Count by One (counted per individual)\n funEvaCount++;\n }", "public void buildInitialBand()\r\n\t{\n\t\r\n\tint bl = boundary.size();\r\n\tfor(int i=0; i<bl; i++) \r\n\t\t{\r\n\t\tInt2d bCur = boundary.get(i);\r\n\t\t//System.out.println(bCur.x + \", \" + bCur.y + \": size = \" + heap.size());\r\n\t\t\r\n\t\ttestPointsAround(bCur.x,bCur.y);\r\n\t\t}\r\n\t\r\n\t}", "public interface Strategy {\n\n StrategySolution solve(List<Item> items, int weight);\n}", "@Override\npublic boolean restrictNeighborhood(Solution solution)\n{\n\n\tSolver solver = solution.getSolver();\n\tint nbTotalVars = solver.getNbIntVars() - 1;\n\n\tint n = nbTotalVars - nbRelaxedVars;\n\tboolean b = false;\n\tIntVar var;\n\tselected.clear();\n\twhile (n > 0) {\n\t\tint index = random.nextInt(nbTotalVars);\n\t\tvar = solver.getIntVarQuick(index);\n\t\tif (var != solver.getObjective() && !selected.contains(index)) {\n\t\t\tif (solution.getIntValue(index) != Solution.NULL) {\n\t\t\t\tsolver.LOGGER.info(\"fix \" + var);\n\t\t\t\tsolver.post(solver.eq(var, solution.getIntValue(index)));\n\t\t\t\tb = true;\n\t\t\t}\n\t\t\tselected.add(index);\n\t\t\tn--;\n\t\t}\n\t}\n\treturn b;\n}", "public void backwardChain(String goalVarName)\r\n {\r\n\r\n RuleVariable goalVar = (RuleVariable)variableList.get(goalVarName);\r\n Enumeration<Clause> goalClauses = goalVar.clauseRefs.elements() ;\r\n\r\n while (goalClauses.hasMoreElements()) {\r\n Clause goalClause = (Clause)goalClauses.nextElement() ;\r\n if (goalClause.consequent.booleanValue() == false) continue ;\r\n\r\n goalClauseStack.push(goalClause) ;\r\n\r\n Rule goalRule = goalClause.getRule();\r\n Boolean ruleTruth = goalRule.backChain() ; // find rule truth value\r\n if (ruleTruth == null) {\r\n textArea1.appendText(\"\\nRule \" + goalRule.name + \" is null, can't determine truth value.\");\r\n } else if (ruleTruth.booleanValue() == true) {\r\n // rule is OK, assign consequent value to variable\r\n goalVar.setValue(goalClause.rhs) ;\r\n goalVar.setRuleName(goalRule.name) ;\r\n goalClauseStack.pop() ; // clear item from subgoal stack\r\n textArea1.appendText(\"\\nRule \" + goalRule.name + \" is true, setting \" + goalVar.name + \": = \" + goalVar.value);\r\n if (goalClauseStack.empty() == true) {\r\n textArea1.appendText(\"\\n +++ Found Solution for goal: \" + goalVar.name);\r\n break ; // for now, only find first solution, then stop\r\n }\r\n } else {\r\n goalClauseStack.pop() ; // clear item from subgoal stack\r\n textArea1.appendText(\"\\nRule \" + goalRule.name + \" is false, can't set \" + goalVar.name);\r\n }\r\n\r\n // displayVariables(\"Backward Chaining\") ; // display variable bindings\r\n } // endwhile\r\n\r\n if (goalVar.value == null) {\r\n textArea1.appendText(\"\\n +++ Could Not Find Solution for goal: \" + goalVar.name);\r\n }\r\n }", "@Override\r\n\t//按权重大小排序\r\n\tpublic int compareTo(Domain o) {\n\t\treturn (o.weight-this.weight);\r\n\t}", "public double getBestSolutionEvaluation();", "double getSolutionCost();", "public void setComparedHeuristics (VariableSelector variableSelector, IntValueSelector valueOrder){\n\t\tIntValueSelector valueSelector = valueOrder;\n\t\t\n\t \n\t\tkb.getModelKB().getSolver().setSearch(Search.intVarSearch(\n \n\t\t\t\tvariableSelector,\n // selects the smallest domain value (lower bound)\n\t\t\t\t \n\t\t\t\tvalueSelector,\n \n // variables to branch on\n\t\t\t\tkb.getVars()\n\t\t));\n\t\t\n\t}", "@SubL(source = \"cycl/inference/harness/inference-balanced-tactician-motivation.lisp\", position = 24008) \n public static final SubLObject balanced_strategy_problem_is_the_rest_of_an_early_removalP(SubLObject problem, SubLObject strategy) {\n {\n SubLObject set_contents_var = inference_datastructures_problem.problem_dependent_links(problem);\n SubLObject basis_object = set_contents.do_set_contents_basis_object(set_contents_var);\n SubLObject state = NIL;\n for (state = set_contents.do_set_contents_initial_state(basis_object, set_contents_var); (NIL == set_contents.do_set_contents_doneP(basis_object, state)); state = set_contents.do_set_contents_update_state(state)) {\n {\n SubLObject restriction_link = set_contents.do_set_contents_next(basis_object, state);\n if ((NIL != set_contents.do_set_contents_element_validP(state, restriction_link))) {\n if ((NIL != inference_datastructures_problem_link.problem_link_has_typeP(restriction_link, $kw9$RESTRICTION))) {\n {\n SubLObject non_focal_problem = inference_datastructures_problem_link.problem_link_supported_problem(restriction_link);\n SubLObject set_contents_var_16 = inference_datastructures_problem.problem_dependent_links(non_focal_problem);\n SubLObject basis_object_17 = set_contents.do_set_contents_basis_object(set_contents_var_16);\n SubLObject state_18 = NIL;\n for (state_18 = set_contents.do_set_contents_initial_state(basis_object_17, set_contents_var_16); (NIL == set_contents.do_set_contents_doneP(basis_object_17, state_18)); state_18 = set_contents.do_set_contents_update_state(state_18)) {\n {\n SubLObject join_ordered_link = set_contents.do_set_contents_next(basis_object_17, state_18);\n if ((NIL != set_contents.do_set_contents_element_validP(state_18, join_ordered_link))) {\n if ((NIL != inference_datastructures_problem_link.problem_link_has_typeP(join_ordered_link, $kw12$JOIN_ORDERED))) {\n if ((NIL != inference_worker_join_ordered.join_ordered_link_restricted_non_focal_linkP(join_ordered_link, restriction_link))) {\n if ((non_focal_problem == inference_worker_join_ordered.join_ordered_link_non_focal_problem(join_ordered_link))) {\n if ((NIL != balanced_strategy_chooses_to_propagate_new_root_motivation_to_restricted_non_focal_problemP(strategy, problem, join_ordered_link))) {\n return T;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n return NIL;\n }", "@Test\n public void solveTest5() throws ContradictionException {\n\n Set<ConstraintInfo> constraints = new HashSet<>();\n Set<Position> vars = new HashSet<>();\n Position[] varArr = new Position[]{\n this.grid.getVariable(0, 6),\n this.grid.getVariable(1, 6),\n this.grid.getVariable(2, 6),\n this.grid.getVariable(3, 6),\n this.grid.getVariable(4, 6),\n this.grid.getVariable(5, 6),\n this.grid.getVariable(6, 6),\n this.grid.getVariable(7, 6),\n this.grid.getVariable(7, 5),\n this.grid.getVariable(7, 4),\n this.grid.getVariable(7, 3),\n this.grid.getVariable(7, 2),\n this.grid.getVariable(6, 2),\n this.grid.getVariable(5, 2),\n this.grid.getVariable(5, 1),\n this.grid.getVariable(5, 0)\n };\n vars.addAll(Arrays.asList(varArr));\n ArrayList<Set<Position>> cArr = new ArrayList<>();\n for (int i = 0; i < 14; i++) cArr.add(new HashSet<>());\n add(cArr.get(0), varArr[0], varArr[1]);\n add(cArr.get(1), varArr[0], varArr[1], varArr[2]);\n add(cArr.get(2), varArr[3], varArr[1], varArr[2]);\n add(cArr.get(3), varArr[3], varArr[4], varArr[2]);\n add(cArr.get(4), varArr[3], varArr[4], varArr[5]);\n add(cArr.get(5), varArr[6], varArr[4], varArr[5]);\n add(cArr.get(6), varArr[6], varArr[7], varArr[5], varArr[8], varArr[9]);\n add(cArr.get(7), varArr[8], varArr[9], varArr[10]);\n add(cArr.get(8), varArr[9], varArr[10], varArr[11], varArr[12], varArr[13]);\n add(cArr.get(9), varArr[12], varArr[13]);\n add(cArr.get(10), varArr[13]);\n add(cArr.get(11), varArr[13], varArr[14]);\n add(cArr.get(12), varArr[13], varArr[14], varArr[15]);\n add(cArr.get(13), varArr[14], varArr[15]);\n\n int[] cVal = new int[] { 1,2,2,1,1,1,2,1,2,1,1,2,3,2 };\n for (int i = 0; i < 14; i++) {\n constraints.add(new ConstraintInfo(cArr.get(i), cVal[i]));\n }\n\n MSModel model = new MSModel(constraints, vars);\n\n Set<Position> expectedBombs = new HashSet<>();\n expectedBombs.addAll(Arrays.asList(\n this.grid.getVariable(1, 6),\n this.grid.getVariable(2, 6),\n this.grid.getVariable(5, 6),\n this.grid.getVariable(5, 0),\n this.grid.getVariable(5, 1),\n this.grid.getVariable(5, 2)\n ));\n Set<Position> expectedNoBombs = new HashSet<>();\n expectedNoBombs.addAll(Arrays.asList(\n this.grid.getVariable(6,2),\n this.grid.getVariable(0,6),\n this.grid.getVariable(3,6),\n this.grid.getVariable(4,6),\n this.grid.getVariable(6,6)\n ));\n\n for (Position pos : vars) {\n if (expectedBombs.contains(pos)) {\n assertTrue(model.hasBomb(pos));\n } else {\n assertFalse(model.hasBomb(pos));\n }\n\n if (expectedNoBombs.contains(pos)) {\n assertTrue(model.hasNoBombs(pos));\n } else {\n assertFalse(model.hasNoBombs(pos));\n }\n }\n\n /*\n 00002x???\n 00003x???\n 00002xxx?\n 0000112x?\n 0000001x?\n 1221112x?\n xxxxxxxx?\n ?????????\n */\n }", "public void solveGame5() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "private void setObjective() throws IloException{\n\n IloLinearNumExpr expr = this.cplex.linearNumExpr();\n int i = 0;\n for(IloNumVar xi : x){\n expr.addTerm(xi, this.c[i]);\n i++;\n }\n this.objective = this.cplex.addMinimize(expr);\n }", "public abstract C b(DiscreteDomain<C> discreteDomain);", "public static void model1() {\n try {\n IloCplex cplex = new IloCplex();\n \n //variables\n IloNumVar x = cplex.numVar(0, Double.MAX_VALUE, \"x\"); //x >= 0\n IloNumVar y = cplex.numVar(0, Double.MAX_VALUE, \"y\"); //y >= 0\n \n //expressions\n IloLinearNumExpr objective = cplex.linearNumExpr();\n objective.addTerm(0.12, x);\n objective.addTerm(0.15, y);\n \n //define objective\n cplex.addMinimize(objective);\n \n //define constraints\n cplex.addGe(cplex.sum(cplex.prod(60, x), cplex.prod(60, y)), 300);\n cplex.addGe(cplex.sum(cplex.prod(12, x), cplex.prod(6, y)), 36);\n cplex.addGe(cplex.sum(cplex.prod(10, x), cplex.prod(30, y)), 90);\n \n //solve\n if (cplex.solve()) {\n System.out.println(\"Obj = \" + cplex.getObjValue());\n System.out.println(\"Obj = \" + cplex.getValue(objective));\n System.out.println(\"x = \" + cplex.getValue(x));\n System.out.println(\"y = \" + cplex.getValue(y));\n } else {\n System.out.println(\"Solution not found.\");\n }\n } catch (IloException ex) {\n ex.printStackTrace();\n }\n }", "public interface ObjectiveFunctionI {\n public void setData(chromosome chromosome1, int indexOfObjective);\n public void setOriginalSolution(chromosome originalChromosome);\n\n public void setFirstImplement(boolean firstImplement);\n public void calcObjective();\n public chromosome getchromosome();\n //public double[] getObjectiveValues(int index);\n //public double getMinObjectiveValue();\n //public double getMaxObjectiveValue();\n}", "public static int dynamic_p(int objects,int capacity){\r\n // Array to accommodate dynamic programming solutions\r\n int dp_array[][] = new int[objects+1][capacity+1];\r\n // filling the 2D array\r\n for(int i=0; i<= objects;i++){\r\n for(int j=0; j<= capacity;j++){\r\n if(i == 0)\r\n dp_array[i][j]=0; // base case(number of objects are zero)\r\n else if(j == 0)\r\n dp_array[i][j]=0; // base case(capacity is zero)\r\n else if(randvariables[i-1] <= j){ // checking if the wight of object is less than the current knapsack capacity\r\n int included = randvalues[i-1]+dp_array[i-1][j-randvariables[i-1]]; // object is included\r\n int not_included = dp_array[i-1][j]; // object is not included\r\n\r\n //taking the max of these two\r\n if(included > not_included)\r\n dp_array[i][j] = included;\r\n else\r\n dp_array[i][j]= not_included;\r\n }\r\n else // weight is more than capacity .. not including the object\r\n dp_array[i][j] = dp_array[i-1][j];\r\n }\r\n }\r\n\r\n //System.out.println(Arrays.deepToString(dp_array));\r\n int solution = dp_array[objects][capacity];\r\n boolean[] optimalset = solution_used(dp_array,objects,capacity);\r\n System.out.println(Arrays.toString(optimalset));\r\n dp_array = null;\r\n return solution; // return the final solution\r\n\r\n }", "public void solveGame() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\n\t\t\tif(!relaxAllControllables){\n\t\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\n\t\t\t\t\t\tcurrentSet.add(s);\n\t\t\t\t}\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "protected Move alphaBetaSearch() {\n\n\t\tdouble value = maxValue(this.parent, Double.NEGATIVE_INFINITY,\n\t\t\t\tDouble.POSITIVE_INFINITY);\n\t\tSystem.out.println(\"value-alpha-beta = \" + value);\n\t\t\n\t\tdouble maxVal = Double.NEGATIVE_INFINITY;\n\t\tMove idealMove = new Move();\n\t\tfor (Node tempNode : this.parent.children) {\n\t\t\tSystem.out.println(\"tempNode.getEvalValue() = \" \n\t\t+ tempNode.getEvalValue());\n\n\t\t\tif (tempNode.getEvalValue() >= maxVal) {\n\t\t\t\t\tidealMove = tempNode.getMove();\n\t\t\t\t\tmaxVal = tempNode.getEvalValue();\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tif(this.forcedMove != null)\n\t\t\treturn this.forcedMove;\n\t\treturn idealMove;\n\n\t}", "@Override\n\tpublic void run(){\n\t\tbranch(0, sol,0);\t\n\t\tSystem.out.println(\"####### \" + counter + \" #######\");\n\t}", "public static ObjectiveStrategy objective_dichotomic(IntVar OBJECTIVE){\n return new ObjectiveStrategy(OBJECTIVE, OptimizationPolicy.DICHOTOMIC);\n }", "public Comparable<?> b(DiscreteDomain<Comparable<?>> discreteDomain) {\n return discreteDomain.maxValue();\n }", "public void maximize()\n\t{\n\t\tint i,j,max=cost[0][0];\n\t\t\n\t\tfor(i=0;i<n;i++)\n\t\t{\n\t\t\tfor(j=0;j<n;j++)\n\t\t\t{\n\t\t\t\tif(cost[i][j]>max)\n\t\t\t\t{\n\t\t\t\t\tmax=cost[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(i=0;i<n;i++)\n\t\t{\n\t\t\tfor(j=0;j<n;j++)\n\t\t\t{\t\t\n\t\t\t\tcost[i][j]=max-cost[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t}", "private boolean feasible() {\n\t\tint weight = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tassert x[i] == 0 || x[i] == 1;\n\t\t\tweight += w[i] * x[i];\n\t\t}\n\t\treturn weight <= k;\n\t}", "public BnB(ObjectiveType objectiveType, double c0, double[] c, double[][] a, Sign[] signs, double[] b, int[] freeVars, int[] intVars) {\n this(objectiveType, c0, c, a, signs, b, freeVars, intVars, Maths.EMPTY_INT_ARRAY);\n }", "public SolutionType getBestSolution();", "public Solution solve(KnapsackData data);", "interface OptimizationStrategy<L, T extends Number> {\n\n /** Returns what the concrete strategy finds to be the shortest Hamiltonian Cycle.\n *\n * Note, this may differ from the actual best cycle.\n */\n Cycle getOptimalCycle(Graph<L, T> graph);\n}", "boolean checkGoal(Node solution);", "String branch();", "public boolean hasObjective(){ return this.hasParameter(1); }", "@Override\r\n public void visit(Goal n, Graph argu) {\r\n Graph graph = new Graph(\"MAIN\", 0);\r\n n.f1.accept(this, graph);\r\n graph.BuildControlFlow();\r\n graph.AllocateReg();\r\n graph.Kanga();\r\n n.f3.accept(this, null);\r\n }", "public void test4_b_parametric() { // Schedule found: (m + 1)i + j + (-m - 2)\n\t\t/* RelTrafo1: (i, j) - (i, j - 1) = (0, 1)\n\t\t * RelTrafo2: (i, j) - (i - 1, j + m) = (1, -m)\n\t\t * (m + 1) - m + (-m - 2) = -m - 1\n\t\t *//*\n\t\tGDGraph gdGraph = new GDGraph();\n\t\tGDGVertex gdVertex = gdGraph.addVertex();\n\t\tGDGEdge gdEdge1 = gdGraph.addEdge(gdVertex, gdVertex);\n\t\tGDGEdge gdEdge2 = gdGraph.addEdge(gdVertex, gdVertex);\n\n\t\tgdEdge1.dataDependence = convertIntTableToAffineTrafoRational(new int[][]{ // (i, j - 1) \n\t\t\t\t{ 1, 0, 0, 0},\n\t\t\t\t{ 0, 1, 0, -1},\n\t\t\t\t{ 0, 0, 0, 1}\n });\n\t\tgdEdge1.producedDomain = convertIntTableToPIPDRational(new int[][]{ // (0..+inf, 1..+inf)\n\t\t\t\t{ 1, 0, 0, 0},\n\t\t\t\t{ 0, 1, 0, -1}\n\t\t}, new int[][]{\n\t\t\t\t{ 1, 0}\n\t\t});\n\n\t\tgdEdge2.dataDependence = convertIntTableToAffineTrafoRational(new int[][]{ // (i - 1, j + m) \n\t\t\t\t{ 1, 0, 0, -1},\n\t\t\t\t{ 0, 1, 1, 0},\n\t\t\t\t{ 0, 0, 0, 1}\n });\t\t\n\t\tgdEdge2.producedDomain = convertIntTableToPIPDRational(new int[][]{ // (1..+inf, 0..+inf)\n\t\t\t\t{ 1, 0, 0, -1},\n\t\t\t\t{ 0, 1, 0, 0}\n\t\t}, new int[][]{\n\t\t\t\t{ 1, 0}\n\t\t});\n\n\t\tgdVertex.computationDomain = convertIntTableToPIPDRational(new int[][]{ // (1..+inf, 1..+inf)\n\t\t\t\t{ 1, 0, 0, -1},\n\t\t\t\t{ 0, 1, 0, -1}\n\t\t}, new int[][]{\n\t\t\t\t{ 1, 0}\n\t\t});\n\t\t\n\t\tgdGraph.calculateFeautrierSchedule(true, true);\n\t\n\t\tgdGraph.<Rational>codeGeneration(Rational.ZERO, Rational.ONE);\n\t*/}", "@SubL(source = \"cycl/inference/harness/inference-balanced-tactician-motivation.lisp\", position = 32456) \n public static final SubLObject balanced_strategy_activate_problem_wrt_transformation(SubLObject strategy, SubLObject problem) {\n checkType(strategy, $sym8$BALANCED_STRATEGY_P);\n checkType(problem, $sym22$PROBLEM_P);\n return Numbers.plusp(balanced_strategy_possibly_activate_strategems_wrt_transformation(strategy, problem));\n }", "protected IPlanningGoal selectGoal(){ \n List<IPlanningGoal> relevantGoals = representation.getRelevantGoals(body);\n \n //If we have failed to find plans for high priority goals and environment has not changed, lets try some \n //lower priority ones\n if(numFailuresSinceLastImportantEnvChange < relevantGoals.size()){\n return relevantGoals.get(numFailuresSinceLastImportantEnvChange);\n } else {\n //tried all relevant goals but all failed, lets try it once more\n representation.setMarker(body);\n numFailuresSinceLastImportantEnvChange = 0;\n return relevantGoals.get(0);\n }\n }", "public abstract double getHeuristic(State state);", "public abstract double getConstraintFitness();", "public Decision planBest(Context context, Decision defaultDecision);", "public void solve() {\n// BruteForceSolver bfs = new BruteForceSolver(pointList);\n// bfs.solve(); // prints the best polygon, its area, and time needed\n// System.out.println(\"-------------\");\n\n// StarshapedSolver ss = new StarshapedSolver(pointList);\n// foundPolygons = ss.solve();\n// System.out.println(\"-------------\");\n\n// RandomAddPointHeuristic ra = new RandomAddPointHeuristic(pointList);\n// foundPolygons = ra.solve(750);\n// System.out.println(\"-------------\");\n\n// GreedyAddPointHeuristic ga = new GreedyAddPointHeuristic(pointList,false);\n// foundPolygons = ga.solve(750);\n// System.out.println(\"-------------\");\n\n// long time = 4000;\n// GreedyAddPointHeuristic gaInit = new GreedyAddPointHeuristic(pointList,false);\n// Polygon2D initSolution = gaInit.solve(time*1/4).get(0);\n// System.out.println(initSolution.area);\n// System.out.println(initSolution);\n//\n// SimulatedAnnealing sa = new SimulatedAnnealing(pointList,initSolution,3);\n// foundPolygons.addAll(sa.solve(time-gaInit.timeInit,2,0.005,0.95));\n// System.out.println(sa.maxPolygon);\n// System.out.println(\"-------------\");\n\n// foundPolygons.addAll(findMultiplePolygonsStarshaped(8,0.6));\n\n }", "public void model() \n\t{\n\t\t\n\t\ttry \n\t\t{\n\t\t GRBEnv env = new GRBEnv();\n\t\t GRBModel model = new GRBModel(env, \"resources/students.lp\");\n\n\t\t model.optimize();\n\n\t\t int optimstatus = model.get(GRB.IntAttr.Status);\n\n\t\t if (optimstatus == GRB.Status.INF_OR_UNBD) {\n\t\t model.getEnv().set(GRB.IntParam.Presolve, 0);\n\t\t model.optimize();\n\t\t optimstatus = model.get(GRB.IntAttr.Status);\n\t\t }\n\n\t\t if (optimstatus == GRB.Status.OPTIMAL) {\n\t\t double objval = model.get(GRB.DoubleAttr.ObjVal);\n\t\t System.out.println(\"Optimal objective: \" + objval);\n\t\t } else if (optimstatus == GRB.Status.INFEASIBLE) {\n\t\t System.out.println(\"Model is infeasible\");\n\n\t\t // Compute and write out IIS\n\t\t model.computeIIS();\n\t\t model.write(\"model.ilp\");\n\t\t } else if (optimstatus == GRB.Status.UNBOUNDED) {\n\t\t System.out.println(\"Model is unbounded\");\n\t\t } else {\n\t\t System.out.println(\"Optimization was stopped with status = \"\n\t\t + optimstatus);\n\t\t }\n\n\t\t // Dispose of model and environment\n\t\t model.write(\"resources/model.sol\");\n\t\t model.dispose();\n\t\t env.dispose();\n\n\t\t } catch (GRBException e) {\n\t\t System.out.println(\"Error code: \" + e.getErrorCode() + \". \" +\n\t\t e.getMessage());\n\t\t }\n\t\t\n\t}", "Node findBaseCases(Dfg dfg, ProcessTree tree, DfgMinerState minerState);", "public interface OrderBookBalancingLogic {\n boolean balancingByPercentage();\n}", "static int dynamicProgramming(int problem) {\r\n\t\tint items = problems.get(problem).size();\r\n\t\tint cap = capacities.get(problem);\r\n\r\n\t\tint x = 0;\r\n\t\tfor(int i = 1; i < items + 1; i++, x++) {\r\n\t\t\tweights[i] = problems.get(problem).get(x).weight;\r\n\t\t\tprofits[i] = problems.get(problem).get(x).profit;\r\n\t\t}\r\n\r\n\t\tint[][] P = new int[items + 1][cap + 1];\r\n\r\n\t\tfor(int i = 0; i < items + 1; i++) {\r\n\t\t\tfor(int j = 0; j < cap + 1; j++) {\r\n\t\t\t\tP[i][j] = -1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor(int c = 0; c < cap + 1; c++) {\r\n\t\t\tP[0][c] = 0;\r\n\t\t}\r\n\r\n\t\tfor(int i = 1; i < items + 1; i++) {\r\n\t\t\tP[i][0] = 0;\r\n\t\t\tfor(int c = 1; c < cap + 1; c++) {\r\n\t\t\t\tif(i >= 2 && c >= 2) {\r\n\t\t\t\t\tP[i-2][c-2] = -1;\r\n\t\t\t\t}\r\n\t\t\t\tif(weights[i] <= c && P[i-1][c-weights[i]] + profits[i] > P[i-1][c]) {\r\n\t\t\t\t\tP[i][c] = P[i-1][c-weights[i]] + profits[i];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tP[i][c] = P[i-1][c];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn P[items][cap];\r\n\t}", "private void setupAssociatedBranchesAType(Map<Integer, Double> inputBranchWithJ)\r\n\t{\r\n\t\tgetOppositeParityEnergies(currentK);\r\n\t\tArrayList<Map<Integer, Double>> branches = new ArrayList<Map<Integer, Double>>();\r\n\t\tint jOffset = 0;\r\n\r\n\t\tif (IS_EVEN_SELECTION_RULES) {\r\n\t\t\tif (INPUT_BRANCH_TYPE.equals(\"Q\")) {\r\n\t\t\t\tcalculateUpperEnergiesLevelsWithJ(inputBranchWithJ, jOffset);\r\n\t\t\t\t\r\n\t\t\t\tif (currentK >= 0) {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedR, -1, 1, 0, -1, true, false);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedP, 1, -1, 1, 0, false, true);\r\n\t\t\t\t\tbranches.add(associatedP);\r\n\t\t\t\t\tbranches.add(associatedR);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"P-<-\", \"R-<-\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedR, -1, 1, 0, -1, false, true);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedP, 1, -1, 1, 0, true, false);\r\n\t\t\t\t\tbranches.add(associatedP);\r\n\t\t\t\t\tbranches.add(associatedR);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"P+<+\", \"R+<+\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (INPUT_BRANCH_TYPE.equals(\"R\")) {\r\n\t\t\t\tjOffset = 1;\r\n\t\t\t\tcalculateUpperEnergiesLevelsWithJ(inputBranchWithJ, jOffset);\r\n\r\n\t\t\t\tif (currentK >= 0) {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedQ, 1, -1, 1, 0, false, true);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedP, 2, -1, 2, 0, true, true);\r\n\t\t\t\t\tbranches.add(associatedQ);\r\n\t\t\t\t\tbranches.add(associatedP);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"Q+<-\", \"P+<+\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedQ, 1, -1, 1, 0, true, false);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedP, 2, -1, 2, 0, false, false);\r\n\t\t\t\t\tbranches.add(associatedQ);\r\n\t\t\t\t\tbranches.add(associatedP);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"Q-<+\", \"P-<-\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (INPUT_BRANCH_TYPE.equals(\"P\")) {\r\n\t\t\t\tjOffset = -1;\r\n\t\t\t\tcalculateUpperEnergiesLevelsWithJ(inputBranchWithJ, jOffset);\r\n\r\n\t\t\t\tif (currentK >= 0) {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedQ, -1, 1, 0, -1, true, false);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedR, -2, 1, 0, -2, true, true);\r\n\t\t\t\t\tbranches.add(associatedQ);\r\n\t\t\t\t\tbranches.add(associatedR);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"Q+<-\", \"R+<+\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedQ, -1, 1, 0, -1, false, true);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedR, -2, 1, 0, -2, false, false);\r\n\t\t\t\t\tbranches.add(associatedQ);\r\n\t\t\t\t\tbranches.add(associatedR);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"Q-<+\", \"R-<-\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\telse {\r\n\t\t\tif (INPUT_BRANCH_TYPE.equals(\"Q\")) {\r\n\t\t\t\tcalculateUpperEnergiesLevelsWithJ(inputBranchWithJ, jOffset);\r\n\t\t\t\t\r\n\t\t\t\tif (currentK >= 0) {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedR, -1, 1, 0, -1, true, false);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedP, 1, -1, 1, 0, false, true);\r\n\t\t\t\t\tbranches.add(associatedP);\r\n\t\t\t\t\tbranches.add(associatedR);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"P+<-\", \"R+<-\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedR, -1, 1, 0, -1, false, true);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedP, 1, -1, 1, 0, true, false);\r\n\t\t\t\t\tbranches.add(associatedP);\r\n\t\t\t\t\tbranches.add(associatedR);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"P-<+\", \"R-<+\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (INPUT_BRANCH_TYPE.equals(\"R\")) {\r\n\t\t\t\tjOffset = 1;\r\n\t\t\t\tcalculateUpperEnergiesLevelsWithJ(inputBranchWithJ, jOffset);\r\n\r\n\t\t\t\tif (currentK >= 0) {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedQ, 1, -1, 1, 0, false, true);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedP, 2, -1, 2, 0, true, true);\r\n\t\t\t\t\tbranches.add(associatedQ);\r\n\t\t\t\t\tbranches.add(associatedP);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"Q-<-\", \"P-<+\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedQ, 1, -1, 1, 0, true, false);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedP, 2, -1, 2, 0, false, false);\r\n\t\t\t\t\tbranches.add(associatedQ);\r\n\t\t\t\t\tbranches.add(associatedP);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"Q+<+\", \"P+<-\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (INPUT_BRANCH_TYPE.equals(\"P\")) {\r\n\t\t\t\tjOffset = -1;\r\n\t\t\t\tcalculateUpperEnergiesLevelsWithJ(inputBranchWithJ, jOffset);\r\n\t\t\t\t\r\n\t\t\t\tif (currentK >= 0) {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedQ, -1, 1, 0, -1, true, false);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedR, -2, 1, 0, -2, true, true);\r\n\t\t\t\t\tbranches.add(associatedQ);\r\n\t\t\t\t\tbranches.add(associatedR);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"Q-<-\", \"R-<+\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedQ, -1, 1, 0, -1, false, true);\r\n\t\t\t\t\tcalculateAssociatedATypeBranches(associatedR, -2, 1, 0, -2, false, false);\r\n\t\t\t\t\tbranches.add(associatedQ);\r\n\t\t\t\t\tbranches.add(associatedR);\r\n\t\t\t\t\tfindLineMatchesFromPredictions(branches, \"Q+<+\", \"R+<-\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (TRANSITION_TYPE.equals(\"b-type\")) {\r\n\t\t\t//The 2 and -2 represent \"get lower energies with K +2 / -2 offset from the current K value, if it exists\"\r\n\t\t\tsetupTriangularTypes(2);\r\n\t\t\tsetupTriangularTypes(-2);\r\n\t\t}\r\n\t}", "public abstract double[] getMinimumValues(List<AbstractObjective> objectives, List<? extends Solution<?>> solutions) ;", "@SubL(source = \"cycl/inference/harness/inference-balanced-tactician-motivation.lisp\", position = 23525) \n public static final SubLObject balanced_strategy_problem_is_the_rest_of_a_removalP(SubLObject problem, SubLObject strategy) {\n {\n SubLObject set_contents_var = inference_datastructures_problem.problem_dependent_links(problem);\n SubLObject basis_object = set_contents.do_set_contents_basis_object(set_contents_var);\n SubLObject state = NIL;\n for (state = set_contents.do_set_contents_initial_state(basis_object, set_contents_var); (NIL == set_contents.do_set_contents_doneP(basis_object, state)); state = set_contents.do_set_contents_update_state(state)) {\n {\n SubLObject restriction_link = set_contents.do_set_contents_next(basis_object, state);\n if ((NIL != set_contents.do_set_contents_element_validP(state, restriction_link))) {\n if ((NIL != inference_datastructures_problem_link.problem_link_has_typeP(restriction_link, $kw9$RESTRICTION))) {\n {\n SubLObject non_focal_problem = inference_datastructures_problem_link.problem_link_supported_problem(restriction_link);\n SubLObject set_contents_var_13 = inference_datastructures_problem.problem_dependent_links(non_focal_problem);\n SubLObject basis_object_14 = set_contents.do_set_contents_basis_object(set_contents_var_13);\n SubLObject state_15 = NIL;\n for (state_15 = set_contents.do_set_contents_initial_state(basis_object_14, set_contents_var_13); (NIL == set_contents.do_set_contents_doneP(basis_object_14, state_15)); state_15 = set_contents.do_set_contents_update_state(state_15)) {\n {\n SubLObject join_ordered_link = set_contents.do_set_contents_next(basis_object_14, state_15);\n if ((NIL != set_contents.do_set_contents_element_validP(state_15, join_ordered_link))) {\n if ((NIL != inference_datastructures_problem_link.problem_link_has_typeP(join_ordered_link, $kw12$JOIN_ORDERED))) {\n if ((NIL != inference_worker_join_ordered.join_ordered_link_restricted_non_focal_linkP(join_ordered_link, restriction_link))) {\n if ((non_focal_problem == inference_worker_join_ordered.join_ordered_link_non_focal_problem(join_ordered_link))) {\n if (((NIL != inference_datastructures_problem_link.problem_link_openP(join_ordered_link))\n && (NIL != balanced_strategy_link_motivates_lookahead_problemP(strategy, join_ordered_link, $kw14$REMOVAL)))) {\n return T;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n return NIL;\n }", "public MarkovDecisionProcess(int totalWorkloadLevel, int totalGreenEnergyLevel, int totalBatteryLevel, double prob[][][][], int maxTimeInterval) {\r\n\t\tthis.totalWorkloadLevel = totalWorkloadLevel;\r\n\t\tthis.totalGreenEnergyLevel = totalGreenEnergyLevel;\r\n\t\tthis.totalBatteryLevel = totalBatteryLevel;\r\n\t\tthis.prob = prob;\r\n\t\tthis.maxTimeInterval = maxTimeInterval;\r\n\t\t\r\n\t\t//Initial State, we set it at [0,0,0]\r\n\t\tinitialState = new State(0, 0, 0, 1, -999, -1);\r\n\t\tinitialState.setPath(initialState.toString());\r\n\t\t\r\n\t\tgrid = new State[maxTimeInterval][totalWorkloadLevel][totalGreenEnergyLevel][totalBatteryLevel]; \r\n\t\t\r\n\t\t//initialize the reward matix as all 0\r\n\t\trewardMatrix = new double[maxTimeInterval][totalWorkloadLevel*totalGreenEnergyLevel][totalWorkloadLevel*totalGreenEnergyLevel];\r\n\t\tbatteryLevelMatrix = new int[maxTimeInterval][totalWorkloadLevel*totalGreenEnergyLevel][totalWorkloadLevel*totalGreenEnergyLevel];\r\n\t\tactionMatrix = new String[maxTimeInterval][totalWorkloadLevel*totalGreenEnergyLevel][totalWorkloadLevel*totalGreenEnergyLevel];\r\n\t\tfor(int i = 0; i < maxTimeInterval; i++) {\r\n\t\t\tfor(int j = 0; j < totalWorkloadLevel*totalGreenEnergyLevel; j++) {\r\n\t\t\t\tfor(int k = 0; k < totalWorkloadLevel*totalGreenEnergyLevel; k++) {\r\n\t\t\t\t\trewardMatrix[i][j][k] = 0.0;\r\n\t\t\t\t\tbatteryLevelMatrix[i][j][k] = 0;\r\n\t\t\t\t\tactionMatrix[i][j][k] = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\r\n\t\t//Initialize actions space, \r\n\t\tnumActions = totalWorkloadLevel * totalBatteryLevel;\r\n\t\t\r\n\t\tfor(int t =0; t < maxTimeInterval; t++) {\r\n\t\tfor(int i = 0; i < totalWorkloadLevel; i++) {\r\n\t\t\tfor(int j = 0; j < totalGreenEnergyLevel; j++) {\r\n\t\t\t\tfor(int k = 0; k < totalBatteryLevel; k++) {\r\n\t\t\t\t\tgrid[t][i][j][k] = new State(i ,j, k, prob[t][i][j][k], 0.0, t);\r\n\t\t\t\t\tif( t == maxTimeInterval - 1) {\r\n\t\t\t\t\t\tgrid[t][i][j][k].setTerminate();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t}\t\r\n\t\treachableStates = new Vector(totalWorkloadLevel*totalGreenEnergyLevel*totalBatteryLevel);\r\n\t\t\t\r\n\t}", "private void BC_bend(Grid gr){\r\n int i, j;\r\n double theta, rate, um, vm, pi=Math.PI;\r\n NSmax=(int)(30.0/dt); repL=0.1;\r\n\t\r\n // boundary conditions of lower side of computational domain\r\n for(i = 0; i<mx; i++) BClow[i]=\"wall\"; \r\n // boundary conditions on upper side \r\n for(i = 0; i<mx; i++) BCupp[i]=\"wall\";\r\n // boundary conditions on left side\r\n for(j = 0; j<my; j++) BClef[j]=\"in\";\r\n // boundary conditions of right side\r\n for(j = 0; j<my; j++) BCrig[j]=\"out\";\r\n\t\t\r\n // initial conditions; all those on other sides are zero. \r\n rate=0.5*pi/(double)(gr.mxRout-gr.mxRin); \r\n for(i = 0; i <= gr.mxRout; i++){ \r\n if(i <= gr.mxRin){ \r\n for(j = 1; j < mym; j++) \t u[i][j]=Umean;\r\n // u[i][j]=2.0*Umean*(1.0-4.0*(gr.y[1][j]+1.0)*(gr.y[1][j]+1.0)); \r\n }else{\r\n theta=rate*(double)(i-gr.mxRin);\r\n for(j = 1; j< mym; j++) u[i][j]=u[0][j]*Math.cos(theta);\r\n }\r\n }\r\n\t\t\r\n for(i = gr.mxRin+1; i < mx; i++){ \r\n if(i <= gr.mxRout){\r\n theta=rate*(double)(i-gr.mxRin);\r\n for(j = 1; j < mym; j++) v[i][j]=u[0][j]*Math.sin(theta);\r\n }else{\r\n for(j = 1; j < mym; j++) v[i][j]=u[0][j];\r\n }\r\n }\r\n }", "public C b(DiscreteDomain<C> discreteDomain) {\n return discreteDomain.previous(this.a);\n }", "void Step(){\n if(G().rn.nextDouble()<GetBirthProbability()){\n Divide();\n }\n }", "private void findSmallestCost() {\n int best = 0;\n fx = funFitness[0];\n for (int i = 1; i < population; i++) {\n if (funFitness[i] < fx) {\n fx = funFitness[i];\n best = i;\n }\n }\n //System.arraycopy(currentPopulation[best], 0, bestSolution, 0, dimension);\n copy(bestSolution, currentPopulation[best]);\n }", "@Override\r\n\tpublic double getObjectiveFunctionValue(SolutionRepresentationInterface oSolution) {\r\n\t\t\r\n\t\tint[] solutionArr = oSolution.getSolutionRepresentation();\t\r\n\t\tdouble cost = 0;\r\n\t\r\n\t\tfor(int i = 0; i < solutionArr.length - 1; i++) {\r\n\t\t\tcost += getCost(solutionArr[i], solutionArr[i + 1]);\r\n\t\t}\r\n\t\t\r\n\t\t// add the trips between the postal office and worker’s home locations with the start and end points\r\n\t\tcost += getCostBetweenDepotAnd(solutionArr[0]) + getCostBetweenHomeAnd(solutionArr[solutionArr.length - 1]);\r\n\t\t\r\n\t\treturn cost;\r\n\t}", "private List<VariableCoefficientTuple> getVariablesUsedForBranchingInThisRectangle(Rectangle rect){\r\n List<VariableCoefficientTuple> variablesUsedForBranchingInThisRectangle = new ArrayList<VariableCoefficientTuple> ();\r\n \r\n for (String var : rect.zeroFixedVariables) {\r\n if (!treeNode_zeroFixedVariables.contains(var) ) \r\n variablesUsedForBranchingInThisRectangle.add(new VariableCoefficientTuple(var, ZERO) );\r\n }\r\n for (String var : rect.oneFixedVariables){ \r\n if ( !treeNode_oneFixedVariables.contains(var)) {\r\n variablesUsedForBranchingInThisRectangle.add(new VariableCoefficientTuple(var, ONE));\r\n } \r\n }\r\n \r\n return variablesUsedForBranchingInThisRectangle;\r\n }", "public void testVariableBindingFromFirstPathPropagatesAccrossConjunction() throws Exception\n {\n resolveAndAssertSolutions(\"[[g(x), h(x), (f(X) :- g(X), h(X))], (?- f(Y)), [[Y <-- x]]]\");\n }", "void breach();", "public void WorkloadBasedOnlineCostOptimizationWithDoubleCopy() {\n\t\t\n\t \tinitialParameters();\n\t\tint inputObjectsNumber=0;\n\t\tint indexJ=0;\n\t\t\n\t\tint keepTime=0;// This variable indicates how long an object is stayed in the hot-tier\n\t\tint currentTime=0; // This variable indicates the passing time in the simulation\n\t\t\n\t for (int slot = 0; slot < workloadGenerator.numberObjectsPerSlot.length; slot++) {\n\t\tinputObjectsNumber=inputObjectsNumber+workloadGenerator.numberObjectsPerSlot[slot];\n\t\t\n\t\tfor (int j = indexJ; j < inputObjectsNumber; j++) {\n\t\t\t\n\t\t\tfor (int t=0; t<T; t++ ){\n\t\t\t\t\n\t\t\t\tcurrentTime=t;\n\t\t\t\tif(existRequest(j, t)){\n\t\t\t\t\tbreakPointEvaluation(j, t);\n\t\t\t\t\talphaCalculation();\n\t\t\t\t\t\n\t\t\t\t\tif(finalLocation[j][t]==1){\n\t\t\t\t\t\n\t\t\t\t\t for (keepTime = currentTime; keepTime < currentTime+alpha*(breakPoint); keepTime++) {\n\t\t\t\t\t\t finalLocation[j][t]=1;\n\t\t\t\t\t }\n\t\t\t\t\t}else if(residentialLatencyCost(j, t, 0).compareTo(residentialLatencyCost(j, t,1).add(totalCostCalculation.btotalMigrationCost[t][j][0][1]))==1){\n\t\t\t\t\t\tfinalLocation[j][t]=1;\n\t\t\t\t\t}\n\t\t\t\t}// FIRST IF\n\t\t\t} \t\n\t\t}//For t\n\t\tindexJ=inputObjectsNumber;\n\t }//slot\n\t \n\t /*\n\t for (int obj = 0; obj < finalLocation.length; obj++) {\n\t\t for (int time = 0; time < finalLocation[obj].length; time++) {\n\t\t System.out.print(finalLocation[obj][time]+\" \");\n\t\t \n\t\t \n\t\t }\n\t }\n\t */\n\t \n}" ]
[ "0.6532016", "0.6333603", "0.601618", "0.5930575", "0.57526636", "0.55287653", "0.54776955", "0.54425335", "0.5397903", "0.5322019", "0.53130996", "0.52919954", "0.5252964", "0.5232906", "0.52197635", "0.5217513", "0.5203705", "0.51882565", "0.5183038", "0.5136579", "0.51219684", "0.5120972", "0.51026094", "0.5093219", "0.5092678", "0.5080732", "0.50634575", "0.50488555", "0.5026087", "0.5015988", "0.4992211", "0.4973378", "0.49717322", "0.49691004", "0.4966094", "0.49438035", "0.49336722", "0.49173242", "0.49118814", "0.48936042", "0.48889956", "0.48758385", "0.48539606", "0.48451835", "0.4836542", "0.4828009", "0.48138446", "0.4809041", "0.4788921", "0.47868434", "0.47858328", "0.47767127", "0.47744215", "0.47610354", "0.4757048", "0.4753801", "0.47527683", "0.4734919", "0.47331434", "0.47310138", "0.47292706", "0.47244605", "0.47239965", "0.4715069", "0.47139344", "0.4710438", "0.4702503", "0.4701401", "0.4698598", "0.46967947", "0.4689585", "0.46848696", "0.46825522", "0.4675082", "0.4668545", "0.4663707", "0.46582842", "0.46538365", "0.46493906", "0.46345297", "0.46294293", "0.462557", "0.46228737", "0.46220165", "0.46081004", "0.46032807", "0.46024072", "0.4601211", "0.4592937", "0.45924178", "0.45914108", "0.45901537", "0.45865452", "0.4586208", "0.45835364", "0.45789185", "0.45784554", "0.4576077", "0.45640695", "0.45567152" ]
0.5204975
16
A branching strategy over the objective variable. It is activated on the first solution, and iterates over the domain in increasing order (lower bound first).
public static ObjectiveStrategy objective_dichotomic(IntVar OBJECTIVE){ return new ObjectiveStrategy(OBJECTIVE, OptimizationPolicy.DICHOTOMIC); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean solveBranchingModel(BranchingConstraintSet targetSet) {\n for (BranchingConstraint branching : targetSet.branchingConstraints) {\n Map<String, Double> terms = new HashMap<>();\n terms.put(branching.branchingVarName, 1.0);\n\n if (branching.branchingType == ConstraintType.LEQL)\n origin.addConstraint(branching.name, terms, branching.branchingType, -Double.MAX_VALUE, branching.bound);\n else\n origin.addConstraint(branching.name, terms, branching.branchingType, branching.bound, Double.MAX_VALUE);\n\n }\n\n origin.solveLP();\n\n for (BranchingConstraint branching : targetSet.branchingConstraints) {\n origin.removeConstraint(branching.name);\n }\n\n if (origin.getStatus() == Model.Status.OPTIMAL) {\n// System.out.println(\"Objective: \" + origin.getOptimum()); /* Get objective value */\n if (integerSolution()) {\n if (origin.getOptimum() < ub)\n ub = origin.getOptimum();\n return false;\n } else {\n if (origin.getOptimum() > lb)\n lb = origin.getOptimum();\n return true;\n }\n } else {\n System.out.println(\"Current branch is infeasible!\");\n return false;\n }\n }", "@Override\n protected void doAlgorithmA1() {\n int xP = 0;\n int yP = 0;\n\n\n //Taking the variable out of the list that are in the bounds\n //Testing that the bound has variables\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n xP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX().getPosition();\n }\n int xU = 0;\n int xL = 0;\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n yP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY().getPosition();\n }\n int yU = 0;\n int yL = 0;\n int cright = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCright();\n int cleft = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCleft();\n\n\n\n for (Variable variable : csp.getVars()) {\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n if (variable.getPosition() == xP) {\n xU = variable.getUpperDomainBound();\n xL = variable.getLowerDomainBound();\n }\n }\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n if (variable.getPosition() == yP) {\n yU = variable.getUpperDomainBound();\n yL = variable.getLowerDomainBound();\n }\n }\n }\n\n boolean first = false;\n boolean second = false;\n\n //Testing if the bound is true, false or inconclusive\n\n if (xL + cleft >= yU + cright) {\n first = true;\n }\n if (xU + cleft < yL + cright) {\n second = true;\n }\n\n //are first and second not equal is the bound not inconclusive\n if (first != second) {\n if (first) { //a true Simple Bound was found\n //checks if it was the last constraint in a csp\n //If so the csp is true\n //else check the next constraint and do this method again\n if (csp.getSimpleConstraints().size() - 1 == cIndex) {\n System.out.println(\"P is satisfiable\");\n System.out.println(System.nanoTime()-startTime);\n return;\n } else {\n bIndex = 0;\n cIndex++;\n unit=false;\n doAlgorithmA1();\n }\n } else if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) { //a false Simple Bound was found\n //\n bIndex = 0;\n cIndex = 0;\n if (isInconclusive) {\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n doAlgorithmA2();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n } else {//an inconclusive Simple Bound was found\n //checks if the bound wasn't already inconclusive\n if(!isInconclusive){\n unit=true;\n unitSB = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex);\n }else {\n unit=false;\n }\n isInconclusive = true;\n\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) {\n cIndex = 0;\n bIndex = 0;\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n }\n }", "@Override\n public Solution solve(ISearchable domain) {\n if(domain==null)\n return null;\n Solution s2=domain.checkIfIsSmall();\n if(s2!=null){\n domain.isClear();\n return s2;\n }\n Solution sol = new Solution();\n temp.add(domain.getStartState());\n numOfNude++;\n domain.isVisit(domain.getStartState());\n ArrayList<AState> neighbors=new ArrayList<AState>();\n while(!temp.isEmpty()){\n AState curr=temp.poll();\n if(domain.isEqual(domain.getGoalState(),curr)){\n numOfNude++;\n sol =solutionPath(curr,sol);\n\n break;\n }\n neighbors=domain.getAllPossibleState(curr);\n for(int i=0;i<neighbors.size();i++){\n if(domain.isEqual(domain.getGoalState(),neighbors.get(i))){\n neighbors.get(i).pervState=curr;\n neighbors.get(i).setPrice(neighbors.get(i).getPrice()+curr.getPrice());\n numOfNude++;\n sol =solutionPath(neighbors.get(i),sol);\n break;\n }\n neighbors.get(i).pervState=curr;\n neighbors.get(i).setPrice(neighbors.get(i).getPrice()+curr.getPrice());\n temp.add(neighbors.get(i));\n numOfNude++;\n }\n }\n\n domain.isClear();\n return sol;\n }", "double getBranchProbability();", "public void calcObjective() {\n double obj;\n double objectives[];\n\n for (int i = 0; i < population.getPopulationSize(); i++) { //300\n objectives = population.getObjectiveValues(i);\n obj = evaluateAll(population.getSingleChromosome(i)); //evaluateAll(chromosome chromosome1)\n objectives[indexOfObjective] = obj;\n population.setObjectiveValue(i, objectives);\n }\n }", "public VariableCoefficientTuple suggestBranchingVariable (TwoIntegerTuple childRectCounts ) {\r\n \r\n VariableCoefficientTuple result= new VariableCoefficientTuple(null, ZERO) ;\r\n \r\n //first get the best lp rects\r\n List<Rectangle> rectanglesToConsiderForBranchingVarCalculation = this.getRectanglesToConsiderForBranchingVarCalculation( );\r\n \r\n //collect 0 direction refcounts into this map\r\n Map<String, Integer> zeroVar_RefCountMap = new HashMap<String, Integer> () ;\r\n //and one diirection refconts into this map\r\n Map<String, Integer> oneVar_RefCountMap = new HashMap<String, Integer> () ;\r\n \r\n List<VariableCoefficientTuple> variablesUsedForBranchingInThisRectangle =null;\r\n for (Rectangle rect: rectanglesToConsiderForBranchingVarCalculation){\r\n variablesUsedForBranchingInThisRectangle = getVariablesUsedForBranchingInThisRectangle (rect);\r\n if (variablesUsedForBranchingInThisRectangle.size()>ZERO) {\r\n this.updateVariableRefCounts(zeroVar_RefCountMap, oneVar_RefCountMap, variablesUsedForBranchingInThisRectangle) ;\r\n }else {\r\n System.err.print(\"trying to branch a node which should have been marked infeasible\" );\r\n exit(ONE);\r\n }\r\n }\r\n \r\n \r\n //now find the highest refcount var, no matter its direction\r\n int highZeroFreq = zeroVar_RefCountMap.isEmpty()?ZERO:Collections.max( zeroVar_RefCountMap.values());\r\n int highOneFreq = oneVar_RefCountMap.isEmpty()? ZERO: Collections.max(oneVar_RefCountMap.values()) ;\r\n \r\n //we need to find the selected var's refcount on the other side\r\n int selectedVarRefCountOnOtherSide = ZERO;\r\n \r\n int totalRects = getNumberOfRects(this.myInfeasibleRectanglesList) ;\r\n \r\n if (highZeroFreq>highOneFreq) {\r\n result.varName=getHighestFreqVar (zeroVar_RefCountMap,highZeroFreq ) ;\r\n result.coeff=highZeroFreq;\r\n selectedVarRefCountOnOtherSide= oneVar_RefCountMap.get( result.varName)==null? ZERO : oneVar_RefCountMap.get( result.varName);\r\n //this is how many rects will survive on either side\r\n childRectCounts.zeroSideCount = totalRects - selectedVarRefCountOnOtherSide;\r\n childRectCounts.oneSideCount=totalRects -highZeroFreq ;\r\n \r\n } else {\r\n result.varName=getHighestFreqVar (oneVar_RefCountMap,highOneFreq ) ;\r\n result.coeff=highOneFreq;\r\n selectedVarRefCountOnOtherSide= zeroVar_RefCountMap.get( result.varName)==null? ZERO : zeroVar_RefCountMap.get( result.varName);\r\n \r\n childRectCounts.zeroSideCount = totalRects - highOneFreq;\r\n childRectCounts.oneSideCount=totalRects - selectedVarRefCountOnOtherSide;\r\n }\r\n \r\n return result;\r\n }", "public Variable getObjective() {\r\n\t\treturn objective;\r\n\t}", "public Solution solve(ISearchable domain) {\n if (domain == null)\n return null;\n ArrayList<AState> neighbors;\n Solution solution;\n domain.ResetVisit();\n pathSteps.add(domain.getStartState());\n domain.changeVisitTrue(domain.getStartState());\n numberOfNodes++;\n while (pathSteps.size() > 0) {\n AState temp = pathSteps.poll();\n if (domain.getGoalState().equals(temp)) {\n domain.setGoalState(temp);\n solution = finalSolution(temp);\n return solution;\n }\n neighbors = domain.getAllPossibleStates(temp);\n for (int i=0;i<neighbors.size();i++) {\n if (domain.isVisited(neighbors.get(i))==false) {\n numberOfNodes++;\n domain.changeVisitTrue(neighbors.get(i));\n neighbors.get(i).predecessor = temp;\n pathSteps.add(neighbors.get(i));\n }\n if (neighbors.get(i).equals(domain.getGoalState())) {\n neighbors.get(i).predecessor = temp;\n solution = finalSolution(neighbors.get(i));\n return solution;\n }\n }\n }\n return null;\n }", "public boolean label(IntVar[] vars) {\r\n\r\n\r\n //System.out.println(\"ct \" + vars.length);\r\n count++;\r\n if (trace) {\r\n for (int i = 0; i < vars.length; i++)\r\n System.out.print (vars[i] + \" \");\r\n System.out.println ();\r\n }\r\n\r\n ChoicePoint choice = null;\r\n boolean consistent;\r\n\r\n // Instead of imposing constraint just restrict bounds\r\n // -1 since costValue is the cost of last solution\r\n if (costVariable != null) {\r\n try {\r\n if (costVariable.min() <= costValue - 1)\r\n costVariable.domain.in(store.level, costVariable, costVariable.min(), costValue - 1);\r\n else\r\n return false;\r\n } catch (FailException f) {\r\n return false;\r\n }\r\n }\r\n\r\n consistent = store.consistency();\r\n\r\n if (!consistent) {\r\n // Failed leaf of the search tree\r\n return false;\r\n } else { // consistent\r\n\r\n if (vars.length == 0) {\r\n // solution found; no more variables to label\r\n\r\n // update cost if minimization\r\n if (costVariable != null)\r\n costValue = costVariable.min();\r\n\r\n reportSolution();\r\n\r\n return costVariable == null; // true is satisfiability search and false if minimization\r\n }\r\n\r\n choice = new ChoicePoint(vars);\r\n\r\n levelUp();\r\n\r\n store.impose(choice.getConstraint());\r\n\r\n // choice point imposed.\r\n\r\n consistent = label(choice.getSearchVariables());\r\n\r\n if (consistent) {\r\n levelDown();\r\n return true;\r\n } else {\r\n\r\n restoreLevel();\r\n store.impose(new Not(choice.getConstraint()));\r\n\r\n\r\n\r\n // negated choice point imposed.\r\n\r\n consistent = label(vars);\r\n\r\n levelDown();\r\n\r\n if (consistent) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n }\r\n }", "private double lbranch(double x) {\n\t\r\n\t\tdouble w = approx(x, g, a);\r\n\t\tint i=0;\r\n\t\tdouble err=w+2;\r\n\t\tdouble arg=0,da=0,df=0;\r\n\t\twhile (i<niter && abs(err-w)>tol ) {\r\n\t\t\terr=w;\r\n\r\n\t\t\targ=(w-a)/g-log(g);\r\n\t\t\tda=-lw_minus.eval(arg);\t\r\n\t\t\tdf=iq_minus.eval(w);\r\n\t\t\t//System.out.println(w+\" \"+arg+\" \"+da+\" \"+df);\r\n\t\t\tif (Double.isNaN(df) || Double.isNaN(da)) {\r\n\t\t\t\t//System.out.println(\"df \"+df+ \" da \"+da+\" w \"+w);\r\n\t\t\t\treturn Double.NaN;\r\n\t\t\t}\r\n\t\t\tw+=w*(da+1.0)*(df-g*x);\r\n\t\t\tif (w<=0) return err;\r\n\t\t\ti++;\r\n\t\t} \r\n\t\taiter=i-1;\r\n\t//\tSystem.out.println(\" niter \" +aiter +\" err \"+abs(err));\r\n\r\n\t\treturn w;\r\n\t}", "public void testLPState()\n \t{\n \t\tsolver.buildLPState();\n \t\tassertTrue(solver.hasLPState());\n \t\t\n \t\tfinal int nLPVars = solver.getNumberOfLPVariables();\n \t\tassertTrue(nLPVars >= 0);\n \t\t\n \t\tfinal double[] objective = solver.getObjectiveFunction();\n \t\tassertEquals(nLPVars, objective.length);\n \t\t\n \t\tint nVarsUsed = 0;\n \t\t\n \t\tfor (VariableBase var : model.getVariables())\n \t\t{\n \t\t\tSVariable svar = solver.getSolverVariable(var);\n \t\t\tassertSame(svar, solver.createVariable(var));\n \t\t\t\n \t\t\tDiscrete mvar = svar.getModelObject();\n \t\t\tassertSame(var, mvar);\n \t\t\tassertSame(solver, svar.getParentGraph());\n \t\t\t\n \t\t\t// Test do-nothing methods\n \t\t\tsvar.resetEdgeMessages(0);\n \t\t\tsvar.updateEdge(0);\n \t\t\tsvar.moveMessages(null, 0, 1);\n \t\t\tassertNull(svar.getInputMsg(0));\n \t\t\tassertNull(svar.getOutputMsg(0));\n \t\t\tassertNull(svar.createMessages(null));\n \t\t\tassertNull(svar.resetInputMessage(null));\n \t\t\t\n \t\t\tint lpVar = svar.getLPVarIndex();\n \t\t\tint nValidAssignments = svar.getNumberOfValidAssignments();\n \t\t\t\n \t\t\tif (var.hasFixedValue())\n \t\t\t{\n \t\t\t\t// Currently the converse is not true because model variables\n \t\t\t\t// do not currently check to see if there is only one non-zero input weight.\n \t\t\t\tassertTrue(svar.hasFixedValue());\n \t\t\t}\n \t\t\tif (svar.hasFixedValue())\n \t\t\t{\n \t\t\t\tassertFalse(svar.hasLPVariable());\n \t\t\t}\n \t\t\tif (svar.hasLPVariable())\n \t\t\t{\n \t\t\t\tassertTrue(lpVar >= 0);\n \t\t\t\tassertTrue(nValidAssignments > 1);\n \t\t\t\t++nVarsUsed;\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\tassertEquals(-1, lpVar);\n \t\t\t\tassertTrue(nValidAssignments <= 1);\n \t\t\t}\n \t\t\t\n \t\t\tdouble[] weights = mvar.getInput();\n \t\t\tdouble totalWeight = 0.0;\n \t\t\tfor (double w : weights)\n \t\t\t{\n \t\t\t\ttotalWeight += w;\n \t\t\t}\n \t\t\t\n \t\t\tfor (int i = 0, end = svar.getModelObject().getDomain().size(); i < end; ++i)\n \t\t\t{\n \t\t\t\tdouble w = mvar.getInput()[i];\n \t\t\t\tint lpVarForValue = svar.domainIndexToLPVar(i);\n \t\t\t\tint i2 = svar.lpVarToDomainIndex(lpVarForValue);\n \t\t\t\tif (lpVarForValue >= 0)\n \t\t\t\t{\n \t\t\t\t\tassertEquals(i, i2);\n\t\t\t\t\tassertEquals(Math.log(w), objective[lpVarForValue], 1e-6);\n \t\t\t\t}\n \t\t\t\tif (!svar.hasLPVariable() || mvar.getInput()[i] == 0.0)\n \t\t\t\t{\n \t\t\t\t\tassertEquals(-1, lpVarForValue);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \t\tfor (Factor factor : model.getFactors())\n \t\t{\n \t\t\tSTableFactor sfactor = solver.getSolverFactor(factor);\n \t\t\tassertSame(sfactor, solver.createFactor(factor));\n \t\t\tassertSame(factor, sfactor.getModelObject());\n \t\t\tassertSame(solver, sfactor.getParentGraph());\n \t\t\t\n \t\t\t// Test do nothing methods\n \t\t\tsfactor.createMessages();\n \t\t\tsfactor.updateEdge(0);\n \t\t\tsfactor.resetEdgeMessages(0);\n \t\t\tsfactor.moveMessages(null, 0 , 1);\n \t\t\tassertNull(sfactor.getInputMsg(0));\n \t\t\tassertNull(sfactor.getOutputMsg(0));\n \t\t}\n \t\t\n \t\tfinal List<IntegerEquation> constraints = solver.getConstraints();\n \t\tassertNotNull(constraints);\n \n \t\tint nConstraints = solver.getNumberOfConstraints();\n \t\tint nVarConstraints = solver.getNumberOfVariableConstraints();\n \t\tint nMarginalConstraints = solver.getNumberOfMarginalConstraints();\n \t\tassertEquals(nConstraints, constraints.size());\n \t\tassertEquals(nConstraints, nVarConstraints + nMarginalConstraints);\n \t\tassertEquals(nVarsUsed, nVarConstraints);\n \t\t\n \t\t{\n \t\t\tMatlabConstraintTermIterator termIter = solver.getMatlabSparseConstraints();\n \t\t\tList<Integer> constraintTerms = new ArrayList<Integer>(termIter.size() * 3);\n \t\t\t\n \t\t\tIterator<IntegerEquation> constraintIter = constraints.iterator();\n \t\t\tfor (int row = 1; constraintIter.hasNext(); ++ row)\n \t\t\t{\n \t\t\t\tIntegerEquation constraint = constraintIter.next();\n \t\t\t\t\n \t\t\t\tint nExpectedTerms = -1;\n \t\t\t\tint lpVar = -1;\n \t\t\t\t\n \t\t\t\tif (row <= nVarConstraints)\n \t\t\t\t{\n \t\t\t\t\tLPVariableConstraint varConstraint = constraint.asVariableConstraint();\n \t\t\t\t\tassertNotNull(varConstraint);\n \t\t\t\t\tassertNull(constraint.asFactorConstraint());\n \t\t\t\t\t\n \t\t\t\t\tSVariable svar = varConstraint.getSolverVariable();\n \t\t\t\t\tassertTrue(svar.hasLPVariable());\n \t\t\t\t\t\n \t\t\t\t\tassertEquals(1, varConstraint.getRHS());\n \t\t\t\t\tnExpectedTerms = svar.getNumberOfValidAssignments();\n \t\t\t\t\t\n \t\t\t\t\tlpVar = svar.getLPVarIndex();\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tLPFactorMarginalConstraint factorConstraint = constraint.asFactorConstraint();\n \t\t\t\t\tassertNotNull(factorConstraint);\n \t\t\t\t\tassertNull(constraint.asVariableConstraint());\n \t\t\t\t\t\n \t\t\t\t\tSTableFactor sfactor = factorConstraint.getSolverFactor();\n \t\t\t\t\tlpVar = sfactor.getLPVarIndex();\n \t\t\t\t\t\n \t\t\t\t\tassertEquals(0, factorConstraint.getRHS());\n \t\t\t\t\tnExpectedTerms = sfactor.getNumberOfValidAssignments();\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tint[] lpvars = constraint.getVariables();\n \t\t\t\tassertEquals(constraint.size(), lpvars.length);\n \t\t\t\tassertEquals(0, constraint.getCoefficient(-1));\n \t\t\t\tassertEquals(0, constraint.getCoefficient(lpVar + nExpectedTerms));\n \t\t\t\tassertFalse(constraint.hasCoefficient(-1));\n \t\t\t\t\n \t\t\t\tassertTrue(lpVar >= 0);\n \n \t\t\t\tIntegerEquation.TermIterator constraintTermIter = constraint.getTerms();\n \t\t\t\tfor (int i = 0; constraintTermIter.advance(); ++i)\n \t\t\t\t{\n \t\t\t\t\tassertEquals(lpvars[i], constraintTermIter.getVariable());\n \t\t\t\t\tassertEquals(constraintTermIter.getCoefficient(), constraint.getCoefficient(lpvars[i]));\n \t\t\t\t\tassertTrue(constraint.hasCoefficient(lpvars[i]));\n \t\t\t\t\tconstraintTerms.add(row);\n \t\t\t\t\tconstraintTerms.add(constraintTermIter.getVariable());\n \t\t\t\t\tconstraintTerms.add(constraintTermIter.getCoefficient());\n \t\t\t\t}\n \t\t\t\tassertFalse(constraintTermIter.advance());\n \t\t\t}\n \t\t\t\n \t\t\tfor (int i = 0; termIter.advance(); i += 3)\n \t\t\t{\n \t\t\t\tassertEquals((int)constraintTerms.get(i), termIter.getRow());\n \t\t\t\tassertEquals(constraintTerms.get(i+1) + 1, termIter.getVariable());\n \t\t\t\tassertEquals((int)constraintTerms.get(i+2), termIter.getCoefficient());\n \t\t\t}\n \t\t\tassertFalse(termIter.advance());\n \t\t}\n \t\t\n \t\t\n \t\tif (expectedConstraints != null)\n \t\t{\n \t\t\tIterator<IntegerEquation> constraintIter = constraints.iterator();\n \t\t\tassertEquals(expectedConstraints.length, solver.getNumberOfConstraints());\n \t\t\tfor (int i = 0, end = expectedConstraints.length; i < end; ++i)\n \t\t\t{\n \t\t\t\tByteArrayOutputStream out = new ByteArrayOutputStream();\n \t\t\t\tIntegerEquation constraint = constraintIter.next();\n \t\t\t\tconstraint.print(new PrintStream(out));\n \t\t\t\tString actual = out.toString().trim();\n \n \t\t\t\tString expected = expectedConstraints[i].trim();\n \n \t\t\t\tif (!expected.equals(actual))\n \t\t\t\t{\n \t\t\t\t\tSystem.out.format(\"Constraint %d mismatch:\\n\", i);\n \t\t\t\t\tSystem.out.format(\"Expected: %s\\n\", expected);\n \t\t\t\t\tSystem.out.format(\" Actual: %s\\n\", actual);\n \t\t\t\t}\n \t\t\t\tassertEquals(expected, actual);\n \t\t\t}\n \t\t}\n \t\t\n \t\t// Test setting solution. A real solution will only use ones and zeros,\n \t\t// but we will use random values to make sure they are assigned correctly.\n \t\tdouble[] solution = new double[nLPVars];\n \t\tRandom rand = new Random();\n \t\tfor (int i = solution.length; --i>=0;)\n \t\t{\n \t\t\tsolution[i] = rand.nextDouble();\n \t\t}\n \t\tsolver.setSolution(solution);\n \t\tfor (VariableBase var : model.getVariables())\n \t\t{\n \t\t\tSVariable svar = solver.getSolverVariable(var);\n \t\t\tdouble[] belief = svar.getBelief();\n \t\t\tif (svar.hasFixedValue())\n \t\t\t{\n \t\t\t\tint vali = svar.getValueIndex();\n \t\t\t\tfor (int i = belief.length; --i>=0;)\n \t\t\t\t{\n \t\t\t\t\tif (i == vali)\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(1.0, belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t\telse\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(0.0, belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\tfor (int i = svar.getModelObject().getDomain().size(); --i>=0;)\n \t\t\t\t{\n \t\t\t\t\tint lpVar = svar.domainIndexToLPVar(i);\n \t\t\t\t\tif (lpVar < 0)\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(0, belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t\telse\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(solution[lpVar], belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \t\tsolver.clearLPState();\n \t\tassertInitialState();\n \t}", "public Collection<Stmt> branches() {\n if(branches_computed) {\n return branches_value;\n }\n ASTNode$State state = state();\n int num = state.boundariesCrossed;\n boolean isFinal = this.is$Final();\n branches_value = branches_compute();\n if (isFinal && num == state().boundariesCrossed) {\n branches_computed = true;\n } else {\n }\n\n return branches_value;\n }", "private int getLowerBound(Object problem, int upperbound)\n {\n Graph tsp = (Graph)problem;\n if (weight == null)\n weight = new double[tsp.size()];\n hki = new HeldKarpIterative( tsp, included, includedT, excluded, excludedT, iterations, weight, upperbound);\n hki.compute();\n tour = hki.isTour();\n bound = hki.getBound();\n hasRun = true;\n// System.out.println(hki.debugDump());\n return bound;\n }", "private void branch01(Node parent) {\n final GeneralLP lp0 = parent.lp;\n final int v = intVars[parent.level];\n Maths.CnF cf = new Maths.CnF(lp0.x[v - 1]);\n\n double[][] a2 = Arrays.copyOf(lp0.a, lp0.m);\n double[] bLeft = lp0.b; // left branch\n double[] bRight = Arrays.copyOf(lp0.b, lp0.m); // right branch\n double[] c2 = Arrays.copyOf(lp0.c, lp0.n);\n double c0Right = lp0.c0 + lp0.c[v - 1]; // c0Left unchanged\n branch01Arguments(c2, a2, bRight, lp0, v);\n\n // LP1: left branch (=0)\n LOG.debug(parent, \"left branch x(\", v, \") =\", 0);\n GeneralLP lp1 = new GeneralLP(lp0.objectiveType, lp0.c0, c2, a2, lp0.signs, bLeft, lp0.freeVars);\n Node child1 = new Node(lp1, parent, Node.LEFT).binary(v);\n nodes.addLast(child1);\n\n // LP2: right branch (=1)\n LOG.debug(parent, \"right branch x(\", v, \") =\", 1);\n GeneralLP lp2 = new GeneralLP(lp0.objectiveType, c0Right, c2, a2, lp0.signs, bRight, lp0.freeVars);\n Node child2 = new Node(lp2, parent, Node.RIGHT).binary(v);\n nodes.addLast(child2);\n\n parent.lp = null; // release memory\n }", "public LSMOP9(String solutionType, Integer numberOfVariables,\r\n\t\t\tInteger numberOfObjectives) {\r\n\t\tsuper(solutionType, numberOfVariables, numberOfObjectives);\r\n\t\tnumberOfVariables_ = numberOfVariables;\r\n\t\tnumberOfObjectives_ = numberOfObjectives;\r\n\t\tnumberOfConstraints_ = 0;\r\n\t\tproblemName_ = \"LSMOP9\";\r\n\r\n\t\tnk = 5;\r\n\t\tc = new double[numberOfObjectives_];\r\n\t\tc[0] = 3.8*0.1*(1.0-0.1);\r\n\t\tdouble sumC = c[0];\r\n\t\tfor(int i = 1; i < numberOfObjectives_; i++){\r\n\t\t\tc[i] = 3.8*c[i-1]*(1.0-c[i-1]);\r\n\t\t\tsumC += c[i];\r\n\t\t}\r\n\t\tsublen = new int[numberOfObjectives_];\r\n\t\tfor(int i = 0; i < numberOfObjectives_; i++){\r\n\t\t\t//sublen[i] = (int)Math.ceil(Math.round(numberOfVariables_*c[i]/sumC)/nk);\r\n\t\t\t//sublen[i] = (int)Math.floor(numberOfVariables_*c[i]/sumC/nk);\r\n\t\t\tsublen[i] = (int)Math.floor((numberOfVariables_-numberOfObjectives_+1)*c[i]/sumC/nk);\r\n\t\t}\r\n\t\tlen = new int[numberOfObjectives_+1]; \r\n\t\tlen[0] = 0;\r\n\t\tfor(int i = 0; i < numberOfObjectives_; i++){\r\n\t\t\tlen[i+1] = len[i] + nk*sublen[i];\r\n\t\t}\r\n\t\tlowerLimit_ = new double[numberOfVariables_];\r\n\t\tupperLimit_ = new double[numberOfVariables_];\r\n\t\tfor (int var = 0; var < numberOfObjectives_ - 1; var++) {\r\n\t\t\tlowerLimit_[var] = 0.0;\r\n\t\t\tupperLimit_[var] = 1.0;\r\n\t\t} // for\r\n\t\t\r\n\t\tfor (int var = numberOfObjectives_ - 1; var < numberOfVariables_; var++) {\r\n\t\t\tlowerLimit_[var] = 0.0;\r\n\t\t\tupperLimit_[var] = 10.0;\r\n\t\t} // for\r\n\r\n\t\tif (solutionType.compareTo(\"BinaryReal\") == 0)\r\n\t\t\tsolutionType_ = new BinaryRealSolutionType(this);\r\n\t\telse if (solutionType.compareTo(\"Real\") == 0)\r\n\t\t\tsolutionType_ = new RealSolutionType(this);\r\n\t\telse {\r\n\t\t\tSystem.out.println(\"Error: solution type \" + solutionType\r\n\t\t\t\t\t+ \" invalid\");\r\n\t\t\tSystem.exit(-1);\r\n\t\t}\r\n\t}", "private List<Rectangle> getRectanglesToConsiderForBranchingVarCalculation () {\r\n \r\n List<Rectangle> rectanglesToConsider = new ArrayList<Rectangle> ();\r\n \r\n //for every constraint, see if it has rects at the best lp\r\n \r\n for (Map <Double, List<Rectangle>> rectMap: myInfeasibleRectanglesList) {\r\n for (List<Rectangle> rectList : rectMap.values()) { \r\n \r\n rectanglesToConsider.addAll(rectList );\r\n \r\n } \r\n }\r\n \r\n return rectanglesToConsider;\r\n }", "public abstract OptimisationSolution getBestSolution();", "public void boundsLex(int [] a , IntDomainVar [] x , int [] b,int j) throws ContradictionException{\n\n int i =0;\n\n\n while( i< n && a[i]==b[i]){\n\n\n if((x[i].getInf()==a[i] || x[i].updateInf(a[i], this, false)) &&\n (x[i].getSup()==b[i] || x[i].updateSup(b[i], this, false))){\n i++;\n }else{\n this.fail();\n }\n\n }\n\n\n if(i<n )\n if ((x[i].getInf()==a[i] || x[i].updateInf(a[i], this, false)) &&\n (x[i].getSup()==b[i] || x[i].updateSup(b[i], this, false))){\n }else{\n this.fail();\n }\n\n\n if(i==n || x[i].getNextDomainValue(a[i])<b[i]){\n return ;\n }\n\n i+=1;\n\n while(i<n && (b[i]+1 <= a[i]-1) && x[i].getInf()==b[i] && x[i].getSup()==a[i]){\n if(x[i].removeInterval(b[i]+1,a[i]-1, this, false)){\n i++;\n }else{\n this.fail();\n\n }\n }\n\n if(i<n) {\n if (b[i] + 1 <= a[i] - 1 && x[i].getInf() <= b[i] &&\n b[i] <= x[i].getSup() && x[i].getSup() >= a[i] && a[i] >= x[i].getInf()) {\n if (!x[i].removeInterval(b[i] + 1, a[i] - 1, this, false)) {\n this.fail();\n }\n }\n }\n\n }", "public boolean runSolver()\n {\n Variable current = getUnassignedVar();\n\n if (current == null)\n {\n return true;\n }\n\n for (int i = 0; i < current.getDomain().size(); i++)\n {\n List<Integer> oldDomain = current.getDomain();\n int newval = oldDomain.get(i);\n current.setValue(newval);\n current.setDomain(i);\n\n if (constraintsSatisfied(constraintsWithAnyVals()))\n {\n if (runSolver())\n {\n return true;\n }\n }\n\n current.setDomain(oldDomain);\n current.setValue(current.getPrevious()); \n }\n return false;\n }", "public void setObjective(Variable v) {\r\n\t\tobjective = v;\r\n\t\tif (v != null) {\r\n\t\t\tadd(v);\r\n\t\t}\r\n\t}", "public int objective() {\n\t\tint value = 0;\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tvalue += v[i] * x[i];\n\t\treturn value;\n\t}", "private void setObjective() throws IloException{\n\n IloLinearNumExpr expr = this.cplex.linearNumExpr();\n int i = 0;\n for(IloNumVar xi : x){\n expr.addTerm(xi, this.c[i]);\n i++;\n }\n this.objective = this.cplex.addMinimize(expr);\n }", "R visitBoundVariable(Formula f, int deBruijnIdx);", "public Behaviour runObjective() {\n //System.out.println(\"Simulation runObjective(): running method\");\n final int iterations = config.getSimulationIterations();\n return objectiveSimulation(iterations);\n }", "public static ObjectiveStrategy objective_top_bottom(IntVar OBJECTIVE){\n return new ObjectiveStrategy(OBJECTIVE, OptimizationPolicy.TOP_DOWN);\n }", "@Override\n public Variable useHeuristic(Deque<Variable> deque) {\n Variable highDomain = deque.getFirst();\n for (Variable var : deque){\n if (var.getDomain().size() > highDomain.getDomain().size()){\n highDomain = var;\n }\n }\n return highDomain;\n }", "public Object eval(Individual ind)\r\n {\r\n BinaryIndividual bi = (BinaryIndividual)ind;\r\n int partialFitness = 0;\r\n int distance = 0;\r\n double fitness = 0.0;\r\n\r\n\t for (int i=0; i<100; i++){\r\n\r\n\t distance = 0;\r\n\r\n\t for (int j=0; j<100; j++){\r\n\t if (!((BinaryIndividual)target[i]).getBooleanAllele(j)^bi.getBooleanAllele(j)) { \r\n\t\t distance++;\r\n\t }\r\n \r\n\t if (distance > partialFitness) {\r\n\t partialFitness = distance;\r\n\t }\r\n\t }\r\n }\r\n\r\n fitness = (double)partialFitness/100.0;\r\n return new Double(fitness);\r\n \r\n\r\n }", "@Override\n\tpublic Solution<TTPVariable> run(SingleObjectiveThiefProblem thief, IEvaluator evaluator, MyRandom rand) {\n\t\tTTPVariable var = TTPVariable.create(new TourOptimalFactory(thief).next(rand), Pack.empty());\n\t\tSolution<TTPVariable> currentBest = thief.evaluate(var);\n\t\t\n\n\t\twhile (evaluator.hasNext()) {\n\n\t\t\t// now take the tour and optimize packing plan\n\t\t\tSolution<Pack> nextPack = optPack(thief, evaluator, rand, currentBest.getVariable().getTour(), currentBest.getVariable().getPack());\n\t\t\t\n\t\t\tSolution<Tour> nextTour = optTour(thief, evaluator, rand, currentBest.getVariable().getTour(), nextPack.getVariable());\n\t\t\t\n\t\t\tTTPVariable next = TTPVariable.create(nextTour.getVariable(), nextPack.getVariable());\n\t\t\tSolution<TTPVariable> s = thief.evaluate(next);\n\t\t\t\n\t\t\t//System.out.println(nextPack);\n\t\t\t//System.out.println(currentBest);\n\t\t\t//System.out.println(\"----------------\");\n\t\t\t\n\t\t\t// update the best found solution\n\t\t\tif (SolutionDominator.isDominating(s, currentBest)) {\n\t\t\t\tcurrentBest = s;\n\t\t\t\t//System.out.println(\"YES\");\n\t\t\t}\n\t\t\tevaluator.notify(currentBest);\n\n\t\t}\n\n\t\treturn currentBest;\n\t}", "private double bound(int iter, Solution next) {\n return Math.exp((-1.0 * (next.getValue() - bestSol.getValue())) / denominator(iter));\n }", "public void solution() {\n\t\t\n\t}", "@Test\n\tpublic void testGA() {\n\t\tGenetic ga = new Genetic(100, 500, 10, SelectionType.TOURNAMENT , 0.6, 0.1);\n\t\tOptimumSolution os = ga.run();\n\t\tSystem.out.println(os.getSolution());\n\t}", "@Override\n public final void solve() {\n this.flag1 = this.neo.getPosition().equals(this.goal);\n \n }", "@Test\n\tpublic void test() {\n\t\tRandomVariableDefinition RV_DEF_X = new RandomVariableDefinition(\"DEF_X\", Arrays.asList(\"x0\", \"x1\", \"x2\"));\n\t\tRandomVariableDefinition RV_DEF_Y = new RandomVariableDefinition(\"DEF_Y\", Arrays.asList(\"y0\", \"y1\"));\n\t\tRandomVariableDefinition RV_DEF_Z = new RandomVariableDefinition(\"DEF_Y\", Arrays.asList(\"z0\", \"z1\"));\n\n\t\t///////////////////////////////////\n\t\t// define the local probability models\n\t\tLocalProbabilityModel X = new LocalProbabilityModel(\"X\");\n\t\tLocalProbabilityModel Y = new LocalProbabilityModel(\"Y\");\n\t\tLocalProbabilityModel Z = new LocalProbabilityModel(\"Z\");\n\t\tLocalProbabilityModel X1 = new LocalProbabilityModel(\"X1\");\n\t\tLocalProbabilityModel X2 = new LocalProbabilityModel(\"X2\");\n\t\tLocalProbabilityModel X3 = new LocalProbabilityModel(\"X3\");\n\t\tLocalProbabilityModel X7 = new LocalProbabilityModel(\"X7\");\n\t\t\n\t\t////////////////////////////////\n\t\t// specify target variable type, and dependencies\n\t\t\n\t\t// two a-priori variables - target only, no dependencies\n\t\tX.setTargetAndDependencies(RV_DEF_X, null);\n\t\tY.setTargetAndDependencies(RV_DEF_Y, null);\n\t\t\n\t\t// a LPM conditionally dependent on two variables\n\t\tZ.setTargetAndDependencies(RV_DEF_Z, Arrays.asList(X, Y));\n\n\t\t// a LPM conditionally dependent on several variables of the same type\n\t\tX3.setTargetAndDependencies(RV_DEF_X, Arrays.asList(X1, X2));\n\n\t\t// a LPM conditionally dependent on itself (i.e. a state variable)\n\t\tX7.setTargetAndDependencies(RV_DEF_X, Arrays.asList(X7));\n\n\t\n\t\t// the first has no dependencies just values\n\t\tX.setValue(\"x0\", 0.6);\n\t\tX.setValue(\"x1\", 0.1);\n\t\tX.setValue(\"x2\", 0.1);\n\n\t\t// the second has dependencies\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x0\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x0\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x1\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x1\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x2\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z0\", Arrays.asList(X.event(\"x2\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x0\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x0\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x1\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x1\"), Y.event(\"y1\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x2\"), Y.event(\"y0\")), 0.3);\n\t\tZ.setValue(\"z1\", Arrays.asList(X.event(\"x2\"), Y.event(\"y1\")), 0.3);\n\n\t\t// the third has a recurrent dependency\n\t\tX1.setValue(\"x0\", Arrays.asList(X1.event(\"x0\")), 0.1);\n\t\tX1.setValue(\"x0\", Arrays.asList(X1.event(\"x1\")), 0.1);\n\t\tX1.setValue(\"x1\", Arrays.asList(X1.event(\"x0\")), 0.1);\n\t\tX1.setValue(\"x1\", Arrays.asList(X1.event(\"x1\")), 0.1);\n\t\t\n\t\t\n\t\t\n\t\t/* NOTE - should we enforce that a conditional probability should always be 'set' with requirement that the conditioning variables should all be identified ? */\n\t\t// this would be Z.setValue(\n\t//\tZ.setValue(Arrays.asList(X.event(\"x0\"), Y.event(\"y0\")),\n\t//\t\t\tArrays.asList(\n\t//\t\t\t\t\t\"z0\", 0.5,\n\t//\t\t\t\t\t\"z1\", 0.3,\n\t//\t\t\t\t\t\"z2\", 0.7));\n\n\n\n\t\tString s = Z.toString();\n\t\tSystem.out.println(\"==============\\n\" + s);\n\n\t\tSystem.out.println(\"done\");\n\n\n\t}", "public static void model1() {\n try {\n IloCplex cplex = new IloCplex();\n \n //variables\n IloNumVar x = cplex.numVar(0, Double.MAX_VALUE, \"x\"); //x >= 0\n IloNumVar y = cplex.numVar(0, Double.MAX_VALUE, \"y\"); //y >= 0\n \n //expressions\n IloLinearNumExpr objective = cplex.linearNumExpr();\n objective.addTerm(0.12, x);\n objective.addTerm(0.15, y);\n \n //define objective\n cplex.addMinimize(objective);\n \n //define constraints\n cplex.addGe(cplex.sum(cplex.prod(60, x), cplex.prod(60, y)), 300);\n cplex.addGe(cplex.sum(cplex.prod(12, x), cplex.prod(6, y)), 36);\n cplex.addGe(cplex.sum(cplex.prod(10, x), cplex.prod(30, y)), 90);\n \n //solve\n if (cplex.solve()) {\n System.out.println(\"Obj = \" + cplex.getObjValue());\n System.out.println(\"Obj = \" + cplex.getValue(objective));\n System.out.println(\"x = \" + cplex.getValue(x));\n System.out.println(\"y = \" + cplex.getValue(y));\n } else {\n System.out.println(\"Solution not found.\");\n }\n } catch (IloException ex) {\n ex.printStackTrace();\n }\n }", "@Override\n \tpublic Solution solve() {\n \t\tfor (int i = 0; i < n; i++) {\n \t\t\tnest[i] = generator.getSolution();\n \t\t}\n \n \t\tfor (int t = 0; t < maxGeneration; t++) { // While (t<MaxGeneration) or\n \t\t\t\t\t\t\t\t\t\t\t\t\t// (stop criterion)\n \t\t\t// Get a cuckoo randomly (say, i) and replace its solution by\n \t\t\t// performing random operations;\n \t\t\tint i = r.nextInt(n);\n \t\t\tSolution randomNest = nest[i];\n \t\t\t//FIXME: randomNest = solutionModifier.modify(nest[i]);\n \n \t\t\t// Evaluate its quality/fitness\n \t\t\tint fi = randomNest.f();\n \n \t\t\t// Choose a nest among n (say, j) randomly;\n \t\t\tint j = r.nextInt(n);\n \t\t\tint fj = f[j];\n \n \t\t\tif (fi > fj) {\n \t\t\t\tnest[i] = randomNest;\n \t\t\t\tf[i] = fi;\n \t\t\t}\n \n \t\t\tsort();\n \t\t\t// A fraction (pa) of the worse nests are abandoned and new ones are built;\n\t\t\tfor(i = n-toAbandon; i<n; i++) {\n \t\t\t\tnest[i] = generator.getSolution();\n \t\t\t}\n \t\t\t\n \t\t\t// Rank the solutions/nests and find the current best;\n \t\t\tsort();\n \t\t}\n \n \t\treturn nest[0];\n \t}", "@Override\n public void updateIndividualObjectivesAndConstraints(\n OptimizationProblem problem,\n Individual individual) {\n double[] x = individual.real;\n // Number of design variables\n int n = x.length;\n // number of objectives\n int m = problem.objectives.length;\n // (g) calculations\n double summation = 0;\n for (int i = m - 1; i < n; i++) {\n summation += Math.pow(x[i] - 0.5, 2);\n }\n double g = summation;\n // Create objective functions\n for (int i = 0; i < m; i++) {\n double objValue = 1 + g;\n for (int j = 0; j < m - i - 1; j++) {\n objValue *= Math.cos(Math.pow(x[j], ALPHA) * Math.PI / 2);\n }\n if (i != 0) {\n objValue *= Math.sin(Math.pow(x[m - i - 1], ALPHA)\n * Math.PI / 2);\n }\n individual.setObjective(i, objValue);\n }\n // Announce that objective function values are valid\n individual.validObjectiveFunctionsValues = true;\n // Update constraint violations if constraints exist\n if (problem.constraints != null) {\n // In C3-DTLZ4, the number of constraints is equal to the number of\n // objectives\n double[] constraints = new double[problem.objectives.length];\n for (int j = 0; j < constraints.length; j++) {\n constraints[j] = Math.pow(individual.getObjective(j), 2)\n / 4 - 1;\n for (int i = 0; i < problem.objectives.length; i++) {\n if (i != j) {\n constraints[j]\n += Math.pow(individual.getObjective(i), 2);\n }\n }\n }\n // Set constraints vilations\n for (int i = 0; i < constraints.length; i++) {\n if (constraints[i] < 0) {\n individual.setConstraintViolation(i, constraints[i]);\n } else {\n individual.setConstraintViolation(i, 0);\n }\n }\n // Announce that objective function values are valid\n individual.validConstraintsViolationValues = true;\n }\n // Increase Evaluations Count by One (counted per individual)\n funEvaCount++;\n }", "public interface Heuristic\r\n{\r\n\r\n double calcStartToGoalCost(State currentState, State goalState);\r\n}", "private int optimize() {\n\t\t// items: Items sorted by value-to-weight ratio for linear relaxation\n\t\t// t: the decision vector being tested at each node\n\t\t// ws, vs, is, bs: stacks of weight, value, item id, whether bring item\n\t\t// p: stack pointer; i, b, weight, value: loop caches; best: max search\n\t\t// ss: stack size: Always <=2 children on stack for <=n-1 parents\n\t\tItem[] items = new Item[n];\n\t\tint ss = 2 * n;\n\t\tint[] itemsSorted = new int[n], t = new int[n], ws = new int[ss],\n\t\t\tvs = new int[ss], is = new int[ss], bs = new int[ss];\n\t\tint i, b, weight, value, best = 0, p = 0;\n\n\t\tfor (int j = 0; j < n; j++)\n\t\t\titems[j] = new Item(j);\n\t\tArrays.sort(items);\n\t\tfor (int j = 0; j < n; j++)\n\t\t\titemsSorted[j] = items[j].i();\n\t\titems = null; // For garbage collection.\n\n\t\t// Push item 0 onto the stack with and without bringing it.\n\t\tws[p] = 0; vs[p] = 0; is[p] = 0; bs[p] = 1; p++;\n\t\tws[p] = 0; vs[p] = 0; is[p] = 0; bs[p] = 0; p++;\n\n\t\twhile (p > 0) {\n\t\t\tp--; // Pop the latest item off the stack\n\t\t\ti = is[p]; b = bs[p];\n\t\t\tweight = ws[p] + w[i] * b;\n\t\t\tif (weight > k)\n\t\t\t\tcontinue;\n\t\t\tvalue = vs[p] + v[i] * b;\n\t\t\tif (bound(i, weight, value, itemsSorted) < best)\n\t\t\t\tcontinue;\n\t\t\tbest = Math.max(value, best);\n\t\t\tt[i] = b;\n\t\t\tif (i < n - 1) { // Push children onto stack w/ & w/o bringing item\n\t\t\t\tws[p] = weight; vs[p] = value; is[p] = i + 1; bs[p] = 1; p++;\n\t\t\t\tws[p] = weight; vs[p] = value; is[p] = i + 1; bs[p] = 0; p++;\n\t\t\t}\n\t\t\telse if (value >= best)\n\t\t\t\tSystem.arraycopy(t, 0, x, 0, n);\n\t\t}\n\t\treturn best;\n\t}", "public void buildInitialBand()\r\n\t{\n\t\r\n\tint bl = boundary.size();\r\n\tfor(int i=0; i<bl; i++) \r\n\t\t{\r\n\t\tInt2d bCur = boundary.get(i);\r\n\t\t//System.out.println(bCur.x + \", \" + bCur.y + \": size = \" + heap.size());\r\n\t\t\r\n\t\ttestPointsAround(bCur.x,bCur.y);\r\n\t\t}\r\n\t\r\n\t}", "public void setComparedHeuristics (VariableSelector variableSelector, IntValueSelector valueOrder){\n\t\tIntValueSelector valueSelector = valueOrder;\n\t\t\n\t \n\t\tkb.getModelKB().getSolver().setSearch(Search.intVarSearch(\n \n\t\t\t\tvariableSelector,\n // selects the smallest domain value (lower bound)\n\t\t\t\t \n\t\t\t\tvalueSelector,\n \n // variables to branch on\n\t\t\t\tkb.getVars()\n\t\t));\n\t\t\n\t}", "@Override\npublic boolean restrictNeighborhood(Solution solution)\n{\n\n\tSolver solver = solution.getSolver();\n\tint nbTotalVars = solver.getNbIntVars() - 1;\n\n\tint n = nbTotalVars - nbRelaxedVars;\n\tboolean b = false;\n\tIntVar var;\n\tselected.clear();\n\twhile (n > 0) {\n\t\tint index = random.nextInt(nbTotalVars);\n\t\tvar = solver.getIntVarQuick(index);\n\t\tif (var != solver.getObjective() && !selected.contains(index)) {\n\t\t\tif (solution.getIntValue(index) != Solution.NULL) {\n\t\t\t\tsolver.LOGGER.info(\"fix \" + var);\n\t\t\t\tsolver.post(solver.eq(var, solution.getIntValue(index)));\n\t\t\t\tb = true;\n\t\t\t}\n\t\t\tselected.add(index);\n\t\t\tn--;\n\t\t}\n\t}\n\treturn b;\n}", "public Instruction[] branchpoints(Instruction next) {\n /*\n * Instruction[] bps= new Instruction[1]; bps[0] = next; return bps;\n */\n return null;\n }", "public Collection<Stmt> targetBranches() {\n if(targetBranches_computed) {\n return targetBranches_value;\n }\n ASTNode$State state = state();\n int num = state.boundariesCrossed;\n boolean isFinal = this.is$Final();\n targetBranches_value = targetBranches_compute();\n if (isFinal && num == state().boundariesCrossed) {\n targetBranches_computed = true;\n } else {\n }\n\n return targetBranches_value;\n }", "@Override\n\tpublic Condition getGoal()\n\t{\n\t\treturn explicitGoal;\n\t}", "public abstract double[] getMinimumValues(List<AbstractObjective> objectives, List<? extends Solution<?>> solutions) ;", "@Override\n\tpublic direction[] Solve(nPuzzle aPuzzle) {\n\t\taddToFrontier(aPuzzle.StartState);\n\t\t\n\t\t// While the open list is not empty:\n\t\twhile(Frontier.size() > 0) {\n\t\t\t// Find the frontier with the lowest F value.\n\t\t\tPuzzleState q = popFrontier();\n\t\t\t\n\t\t\tArrayList<PuzzleState> newStates = q.explore();\n\t\t\t\n\t\t\tfor(PuzzleState n : newStates) {\n\t\t\t\t// If goal state return path to state.\n\t\t\t\tif(n.equals(aPuzzle.GoalState))\n\t\t\t\t\treturn n.GetPathToState();\n\t\t\t\t// Else add state to open list.\n\t\t\t\telse {\n\t\t\t\t\tn.HeuristicValue = HeuristicValue(n, aPuzzle.GoalState);\n\t\t\t\t\tn.setEvaluationFunction(n.HeuristicValue + n.Cost);\n\t\t\t\t\taddToFrontier(n);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "public static ObjectiveStrategy objective_bottom_up(IntVar OBJECTIVE){\n return new ObjectiveStrategy(OBJECTIVE, OptimizationPolicy.BOTTOM_UP);\n }", "public interface ObjectiveFunctionI {\n public void setData(chromosome chromosome1, int indexOfObjective);\n public void setOriginalSolution(chromosome originalChromosome);\n\n public void setFirstImplement(boolean firstImplement);\n public void calcObjective();\n public chromosome getchromosome();\n //public double[] getObjectiveValues(int index);\n //public double getMinObjectiveValue();\n //public double getMaxObjectiveValue();\n}", "public void testVariableBindingFromFirstPathPropagatesAccrossConjunction() throws Exception\n {\n resolveAndAssertSolutions(\"[[g(x), h(x), (f(X) :- g(X), h(X))], (?- f(Y)), [[Y <-- x]]]\");\n }", "public VariableUnit solve() {\n LinkedList<VariableUnit> processor = new LinkedList<VariableUnit>();\n\n VariableUnit vu1 = new VariableUnit(250.0, 'x');\n VariableUnit vu2 = new VariableUnit('+');\n VariableUnit vu3 = new VariableUnit(250.0, 'x');\n VariableUnit vu4 = new VariableUnit(501.0, 'x');\n VariableUnit vu5 = new VariableUnit('y');\n VariableUnit vu6 = new VariableUnit('-');\n alpha_arr.get(('x' - 'a')).addLast(vu1);\n alpha_arr.get(('x' - 'a')).addLast(vu2);\n alpha_arr.get(('x' - 'a')).addLast(vu3);\n op_order.add(vu1); op_order.add(vu2); op_order.add(vu3); op_order.add(vu6);\n op_order.add(vu4); op_order.add(vu6); op_order.add(vu5);\n assignValue(2.0, 'x');\n \n System.out.print(vu1); System.out.print(vu2); System.out.print(vu3);\n System.out.print(vu6); System.out.print(vu4); System.out.print(vu6);\n System.out.print(vu5);\n System.out.println();\n System.out.println(\"------------------------------\");\n \n VariableUnit temp, temp1;\n for (int i = 0; i < op_order.size(); i++) {\n \ttemp = op_order.pollFirst();\n \t\n \t\tswitch (temp.getVariable()) {\n \tcase '+':\n \t\t//if processor.isEmpty(): throw an exception\n \t\ttemp1 = processor.pop().add(op_order.pollFirst());\n \t\tprocessor.push(temp1);\n \t\tbreak;\n \tcase '-':\n \t\t//if processor.isEmpty(): throw an exception\n \t\ttemp1 = processor.pop().subtract(op_order.pollFirst());\n \t\tprocessor.push(temp1);\n \t\tbreak;\n \tdefault:\n \t\tprocessor.push(temp);\n \t\t}\n }\n\n /*\n * System.out.println(\"This equation is currently unsolvable.\");\n \tSystem.out.println(\"Try assigning values to some of the variables.\");\n */\n while (!processor.isEmpty()) {\n \top_order.addFirst(processor.pop());\n }\n \n ListIterator<VariableUnit> iter = op_order.listIterator();\n \n while ( iter.hasNext() ) {\n \tVariableUnit iter_temp = iter.next();\n \t//System.out.print(iter_temp.hasValue());\n \tif (iter_temp.hasValue()) {\n \t\tSystem.out.print( Double.toString(iter_temp.subValue()) );\n \t}\n \telse {\n \t\tSystem.out.print(iter_temp);\n \t}\n };\n System.out.println();\n \n return new VariableUnit(Double.NaN, ' ');\n }", "public interface Strategy {\n\n StrategySolution solve(List<Item> items, int weight);\n}", "@Override\n public void evaluate(Solution solution) throws JMException {\n\n int[] tour = new int[numberOfNodes + 1];\n int firstCity = ((Permutation) solution.getDecisionVariables()[0]).vector_[0];\n int lastCity = ((Permutation) solution.getDecisionVariables()[0]).vector_[numberOfNodes - 1];\n\n double fitness1_td = 0.0;\n\n // Calculate fitness 1 - total distance\n for (int i = 0; i < numberOfNodes - 1; i++) {\n int x = ((Permutation) solution.getDecisionVariables()[0]).vector_[i];\n int y = ((Permutation) solution.getDecisionVariables()[0]).vector_[i+1];\n\n tour[i] = x;\n tour[i+1] = y;\n\n fitness1_td += calDistances(x, y);\n }\n // generate tour with same start city and end city\n tour[numberOfNodes] = tour[0];\n\n fitness1_td += calDistances(firstCity, lastCity);\n\n\n // Correctness check: does the tour start and end in the same city\n if(tour[0] != tour[tour.length - 1]) {\n System.err.println(\"ERROR: The last city must be the same as the first city\");\n System.exit(1);\n }\n\n /*for (int i = 0; i < tour.length; i++) {\n System.out.print(tour[i] + \" \");\n }*/\n //System.out.println(\"\\n\" + tour.length);\n\n // Calculate fitness 2 - objective value of a given tour\n ArrayInt z = (ArrayInt) solution.getDecisionVariables()[1];\n //System.out.println(z.getLength());\n\n double fitness2_ob;\n double wc = 0.0;\n double ft = 0.0;\n double fp = 0.0;\n\n //the following is used for a different interpretation of \"packingPlan\"\n int itemsPerCity = z.getLength() / (tour.length - 2);\n //System.out.println(itemsPerCity);\n\n for (int i = 0; i < tour.length - 1; i++) {\n\n int currentCityTEMP = tour[i];\n // what's the current city? --> but the items start at city 2 in the TTP file, so I have to take another 1 off!\n int currentCity = currentCityTEMP - 1;\n\n if (i > 0) {\n\n if (currentCity == -1) {\n // No items in city 1\n wc += 0.0;\n fp += 0.0;\n\n } else {\n\n for (int itemNumber = 0; itemNumber < itemsPerCity; itemNumber++) {\n\n int indexOfPackingPlan = (i-1) * itemsPerCity + itemNumber;\n // what is the next item's index in items-array?\n int itemIndex = currentCity + itemNumber * (numberOfNodes - 1);\n //System.out.println(\"i: \" + i);\n\n if (z.getValue(indexOfPackingPlan) == 1) {\n // pack item\n //System.out.println(itemIndex);\n int currentWC = items[itemIndex][2];\n wc += currentWC;\n\n int currentFP = items[itemIndex][1];\n fp += currentFP;\n }\n }\n\n }\n\n int h = (i+1) % (tour.length-1); //h: next tour city index\n //System.out.println(\"h: \" + h);\n long distance = calDistances(i, h);\n // compute the adjusted (effective) distance\n ft += (distance / (1 - wc * (maxSpeed - minSpeed) / capacityOfKnapsack));\n }\n }\n\n wendUsed = wc;\n wend = capacityOfKnapsack - wc;\n fitness2_ob = fp - ft * rentingRatio;\n\n solution.setObjective(0, fitness1_td);\n solution.setObjective(1, -fitness2_ob); // Convert from maximum objective value to minimum objective value\n }", "protected void addObjective() throws IloException {\n IloLinearNumExpr objective = model.linearNumExpr();\n\n for (int i = 0; i < m; ++i) {\n for (int j = 0; j < n; j++) {\n objective.addTerm(x[i][j], costs[i][j]);\n\n }\n }\n\n IloObjective Obj = model.addObjective(IloObjectiveSense.Minimize, objective);\n }", "public void solveGame4() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\t\t\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t}\n\n\t\t// Handle the pending states\n\t\twhile (!losing.isEmpty()) {\n\t\t\tS state = losing.poll();\n\n\t\t\t\n\t\t\tlosingStates.add(state);\n\n\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\tfor (S pred : predecessors) {\n\t\t\t\tif(losing.contains(pred) || losingStates.contains(pred))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t//if(i == -1)\n\t\t\t\t\t//continue;\n\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}else{\n\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "@Override\r\n\t//按权重大小排序\r\n\tpublic int compareTo(Domain o) {\n\t\treturn (o.weight-this.weight);\r\n\t}", "protected void doDeduction() {\n\n boolean narrowed= false;\n\n unit=false;\n isInconclusive=false;\n\n int newXL;\n int newYU;\n\n Variable x = null;\n Variable y = null;\n\n for(Variable var : csp.getVars()){\n if(var.getPosition() == unitSB.getX().getPosition()){\n x = var;\n } else if(var.getPosition() == unitSB.getY().getPosition()){\n y = var;\n }\n }\n\n int xU = x.getUpperDomainBound();\n int yL = y.getLowerDomainBound();\n\n newXL = yL + unitSB.getCright();\n newYU = xU - unitSB.getCright();\n\n if(newXL>x.getLowerDomainBound()){\n Variable newX = new Variable(newXL, xU);\n newX.setPosition(x.getPosition());\n changeVariable(newX);\n narrowed= true;\n }\n if (newYU< y.getUpperDomainBound()){\n Variable newY = new Variable(yL, newYU);\n newY.setPosition(y.getPosition());\n changeVariable(newY);\n narrowed =true;\n }\n\n if(narrowed){\n doAlgorithmA1();\n }else {\n doAlgorithmA3();\n }\n\n }", "private boolean feasible() {\n\t\tint weight = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tassert x[i] == 0 || x[i] == 1;\n\t\t\tweight += w[i] * x[i];\n\t\t}\n\t\treturn weight <= k;\n\t}", "public SolutionSet execute() throws JMException, ClassNotFoundException {\n int maxEvaluations ;\n int evaluations ;\n\n SolutionSet population ;\n SolutionSet offspringPopulation ;\n\n Solution betterIndividual ;\n\n Operator mutationOperator ;\n Comparator comparator ;\n Operator localSearchOperator ;\n\n\n comparator = new ObjectiveComparator(0) ; // Single objective comparator\n\n // Read the params\n maxEvaluations = ((Integer)this.getInputParameter(\"maxEvaluations\")).intValue();\n\n // Initialize the variables\n population = new SolutionSet(mu_) ;\n offspringPopulation = new SolutionSet(lambda_) ;\n\n evaluations = 0;\n\n // Read the operators\n mutationOperator = this.operators_.get(\"mutation\");\n localSearchOperator = (LocalSearch) operators_.get(\"improvement\");\n\n System.out.println(\"(\" + mu_ + \" + \" + lambda_+\")ES\") ;\n\n // Create 1-parent population of mu solutions\n Solution newIndividual;\n newIndividual = new Solution(problem_);\n problem_.evaluate(newIndividual);\n evaluations++;\n betterIndividual = new Solution(newIndividual);\n population.add(betterIndividual);\n\n // Main loop\n while (evaluations < maxEvaluations) {\n // STEP 1. Generate the offspring\n Solution offspring = new Solution(population.get(0)) ;\n mutationOperator.execute(offspring);\n /*Solution mutated_solution = (Solution) mutationOperator.execute(offspring);\n if(offspring.getObjective(0) < mutated_solution.getObjective(0))\n offspring = mutated_solution;*/\n problem_.evaluate(offspring);\n Solution local_offspring = (Solution) localSearchOperator.execute(offspring);\n offspring.setObjective(0, local_offspring.getObjective(0));\n offspringPopulation.add(offspring);\n evaluations++;\n\n if(comparator.compare(betterIndividual, offspringPopulation.get(0)) > 0) {\n betterIndividual = new Solution(offspringPopulation.get(0));\n population.clear();\n // STEP 4. Create the new mu population\n population.add(betterIndividual);\n }\n\n System.out.println(population.get(0).getObjective(0)) ;\n\n // STEP 6. Delete the offspring population\n offspringPopulation.clear() ;\n } // while\n\n // Return a population with the best individual\n SolutionSet resultPopulation = new SolutionSet(1) ;\n resultPopulation.add(population.get(0)) ;\n\n return resultPopulation ;\n }", "private void createOptimizationFunction() {\n \t\tobjective = \"min:\"; //$NON-NLS-1$\n \t\tSet s = slice.entrySet();\n \t\tfor (Iterator iterator = s.iterator(); iterator.hasNext();) {\n \t\t\tMap.Entry entry = (Map.Entry) iterator.next();\n \t\t\tHashMap conflictingEntries = (HashMap) entry.getValue();\n \t\t\tif (conflictingEntries.size() <= 1) {\n \t\t\t\tobjective += \" 1 \" + getVariable((IInstallableUnit) conflictingEntries.values().iterator().next()); //$NON-NLS-1$\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\tList toSort = new ArrayList(conflictingEntries.values());\n \t\t\tCollections.sort(toSort);\n \t\t\tint weight = toSort.size();\n \t\t\tfor (Iterator iterator2 = toSort.iterator(); iterator2.hasNext();) {\n \t\t\t\tobjective += \" \" + weight-- + \" \" + getVariable((IInstallableUnit) iterator2.next()); //$NON-NLS-1$//$NON-NLS-2$\n \t\t\t}\n \t\t}\n \t\tobjective += \" ;\"; //$NON-NLS-1$\n \t}", "public void WorkloadBasedOnlineCostOptimizationWithDoubleCopy() {\n\t\t\n\t \tinitialParameters();\n\t\tint inputObjectsNumber=0;\n\t\tint indexJ=0;\n\t\t\n\t\tint keepTime=0;// This variable indicates how long an object is stayed in the hot-tier\n\t\tint currentTime=0; // This variable indicates the passing time in the simulation\n\t\t\n\t for (int slot = 0; slot < workloadGenerator.numberObjectsPerSlot.length; slot++) {\n\t\tinputObjectsNumber=inputObjectsNumber+workloadGenerator.numberObjectsPerSlot[slot];\n\t\t\n\t\tfor (int j = indexJ; j < inputObjectsNumber; j++) {\n\t\t\t\n\t\t\tfor (int t=0; t<T; t++ ){\n\t\t\t\t\n\t\t\t\tcurrentTime=t;\n\t\t\t\tif(existRequest(j, t)){\n\t\t\t\t\tbreakPointEvaluation(j, t);\n\t\t\t\t\talphaCalculation();\n\t\t\t\t\t\n\t\t\t\t\tif(finalLocation[j][t]==1){\n\t\t\t\t\t\n\t\t\t\t\t for (keepTime = currentTime; keepTime < currentTime+alpha*(breakPoint); keepTime++) {\n\t\t\t\t\t\t finalLocation[j][t]=1;\n\t\t\t\t\t }\n\t\t\t\t\t}else if(residentialLatencyCost(j, t, 0).compareTo(residentialLatencyCost(j, t,1).add(totalCostCalculation.btotalMigrationCost[t][j][0][1]))==1){\n\t\t\t\t\t\tfinalLocation[j][t]=1;\n\t\t\t\t\t}\n\t\t\t\t}// FIRST IF\n\t\t\t} \t\n\t\t}//For t\n\t\tindexJ=inputObjectsNumber;\n\t }//slot\n\t \n\t /*\n\t for (int obj = 0; obj < finalLocation.length; obj++) {\n\t\t for (int time = 0; time < finalLocation[obj].length; time++) {\n\t\t System.out.print(finalLocation[obj][time]+\" \");\n\t\t \n\t\t \n\t\t }\n\t }\n\t */\n\t \n}", "interface OptimizationStrategy<L, T extends Number> {\n\n /** Returns what the concrete strategy finds to be the shortest Hamiltonian Cycle.\n *\n * Note, this may differ from the actual best cycle.\n */\n Cycle getOptimalCycle(Graph<L, T> graph);\n}", "@Test\n public static void tinyLBTest() {\n final double[] answers = {0.0, 0.004592032688529923, 0.04725537386564205,\n 0.1396230607626959, 0.2735831034867167, 0.4692424353373485};\n final double kappa = 2.0;\n assertTrue( 0.0 == approximateLowerBoundOnP(0, 0, kappa) );\n final long n = 5;\n for (long k = 0; k <= n; k++) {\n final double lb = approximateLowerBoundOnP(n, k, kappa);\n final double est = estimateUnknownP(n, k);\n assertTrue(lb <= est);\n assertTrue(Math.abs(lb - answers[(int) k]) < 1e-14);\n // System.out.printf (\"LB\\t%d\\t%d\\t%.1f\\t%.16g%n\", n, k, kappa, lb);\n }\n }", "public abstract DoublePredicate lowerPredicate(double lowerBound);", "private void findSmallestCost() {\n int best = 0;\n fx = funFitness[0];\n for (int i = 1; i < population; i++) {\n if (funFitness[i] < fx) {\n fx = funFitness[i];\n best = i;\n }\n }\n //System.arraycopy(currentPopulation[best], 0, bestSolution, 0, dimension);\n copy(bestSolution, currentPopulation[best]);\n }", "public boolean hasObjective(){ return this.hasParameter(1); }", "public Solver(WorldState initial) {\n solution = new ArrayList<>();\n\n // create a priority queue of search nodes\n MinPQ<SNode> pq = new MinPQ<>();\n\n // insert an “initial search node” into the priority queue\n SNode start = new SNode(initial, 0, null);\n pq.insert(start);\n\n // If the search node with minimum priority is the goal node, then we’re done.\n while (!pq.min().ws.isGoal()) {\n\n // Remove the search node with minimum priority.\n SNode X = pq.delMin();\n\n // for each neighbor of X’s world state, create a new search node and\n // insert it into the priority queue.\n for (WorldState nb: X.ws.neighbors()) {\n\n // critical optimization\n if (X.prev == null || !(nb.equals(X.prev.ws))) {\n SNode nbNode = new SNode(nb, X.numberOfMove + 1, X);\n pq.insert(nbNode);\n }\n }\n }\n\n // generate the solution\n SNode goal = pq.min();\n while (goal != null) {\n solution.add(0, goal.ws);\n goal = goal.prev;\n }\n }", "double getSolutionCost();", "@Override\n\tpublic void run(){\n\t\tbranch(0, sol,0);\t\n\t\tSystem.out.println(\"####### \" + counter + \" #######\");\n\t}", "public V getLowerBound();", "@SubL(source = \"cycl/inference/harness/inference-balanced-tactician-motivation.lisp\", position = 32456) \n public static final SubLObject balanced_strategy_activate_problem_wrt_transformation(SubLObject strategy, SubLObject problem) {\n checkType(strategy, $sym8$BALANCED_STRATEGY_P);\n checkType(problem, $sym22$PROBLEM_P);\n return Numbers.plusp(balanced_strategy_possibly_activate_strategems_wrt_transformation(strategy, problem));\n }", "@Test\n public void solveTest5() throws ContradictionException {\n\n Set<ConstraintInfo> constraints = new HashSet<>();\n Set<Position> vars = new HashSet<>();\n Position[] varArr = new Position[]{\n this.grid.getVariable(0, 6),\n this.grid.getVariable(1, 6),\n this.grid.getVariable(2, 6),\n this.grid.getVariable(3, 6),\n this.grid.getVariable(4, 6),\n this.grid.getVariable(5, 6),\n this.grid.getVariable(6, 6),\n this.grid.getVariable(7, 6),\n this.grid.getVariable(7, 5),\n this.grid.getVariable(7, 4),\n this.grid.getVariable(7, 3),\n this.grid.getVariable(7, 2),\n this.grid.getVariable(6, 2),\n this.grid.getVariable(5, 2),\n this.grid.getVariable(5, 1),\n this.grid.getVariable(5, 0)\n };\n vars.addAll(Arrays.asList(varArr));\n ArrayList<Set<Position>> cArr = new ArrayList<>();\n for (int i = 0; i < 14; i++) cArr.add(new HashSet<>());\n add(cArr.get(0), varArr[0], varArr[1]);\n add(cArr.get(1), varArr[0], varArr[1], varArr[2]);\n add(cArr.get(2), varArr[3], varArr[1], varArr[2]);\n add(cArr.get(3), varArr[3], varArr[4], varArr[2]);\n add(cArr.get(4), varArr[3], varArr[4], varArr[5]);\n add(cArr.get(5), varArr[6], varArr[4], varArr[5]);\n add(cArr.get(6), varArr[6], varArr[7], varArr[5], varArr[8], varArr[9]);\n add(cArr.get(7), varArr[8], varArr[9], varArr[10]);\n add(cArr.get(8), varArr[9], varArr[10], varArr[11], varArr[12], varArr[13]);\n add(cArr.get(9), varArr[12], varArr[13]);\n add(cArr.get(10), varArr[13]);\n add(cArr.get(11), varArr[13], varArr[14]);\n add(cArr.get(12), varArr[13], varArr[14], varArr[15]);\n add(cArr.get(13), varArr[14], varArr[15]);\n\n int[] cVal = new int[] { 1,2,2,1,1,1,2,1,2,1,1,2,3,2 };\n for (int i = 0; i < 14; i++) {\n constraints.add(new ConstraintInfo(cArr.get(i), cVal[i]));\n }\n\n MSModel model = new MSModel(constraints, vars);\n\n Set<Position> expectedBombs = new HashSet<>();\n expectedBombs.addAll(Arrays.asList(\n this.grid.getVariable(1, 6),\n this.grid.getVariable(2, 6),\n this.grid.getVariable(5, 6),\n this.grid.getVariable(5, 0),\n this.grid.getVariable(5, 1),\n this.grid.getVariable(5, 2)\n ));\n Set<Position> expectedNoBombs = new HashSet<>();\n expectedNoBombs.addAll(Arrays.asList(\n this.grid.getVariable(6,2),\n this.grid.getVariable(0,6),\n this.grid.getVariable(3,6),\n this.grid.getVariable(4,6),\n this.grid.getVariable(6,6)\n ));\n\n for (Position pos : vars) {\n if (expectedBombs.contains(pos)) {\n assertTrue(model.hasBomb(pos));\n } else {\n assertFalse(model.hasBomb(pos));\n }\n\n if (expectedNoBombs.contains(pos)) {\n assertTrue(model.hasNoBombs(pos));\n } else {\n assertFalse(model.hasNoBombs(pos));\n }\n }\n\n /*\n 00002x???\n 00003x???\n 00002xxx?\n 0000112x?\n 0000001x?\n 1221112x?\n xxxxxxxx?\n ?????????\n */\n }", "public BnB(ObjectiveType objectiveType, double c0, double[] c, double[][] a, Sign[] signs, double[] b, int[] freeVars, int[] intVars) {\n this(objectiveType, c0, c, a, signs, b, freeVars, intVars, Maths.EMPTY_INT_ARRAY);\n }", "public static void main(String[] args) {\n\t\tint[] values = {1,3,1,4,1,5};\r\n\t\tDynamicSolution1039 s = new DynamicSolution1039();\r\n\t\tSystem.out.println(s.minScoreTriangulation(values));\r\n\t}", "public static int Branch(Game game1, Player player, Intersection pointInt,\n\t\t\tIntersection fromInt, Road carrying, ArrayList<Integer> idArray,\n\t\t\tint currdist, HashMap<Intersection, Integer> distancesMap, HashMap<Intersection, ArrayList<Integer>> visitorsMap,\n\t\t\tString sector, HashMap<Intersection, String> sectorMap) {\n\t\tif (sector != null) {\n\t\t\t\n\t\t\t//this only needs to trigger once to let the program know that a crossover has occured\n\t\t\t//this gets the first branch to come across this place's sector id\n\t\t\tString thisSector = (String) sectorMap.get(pointInt);\n\t\t\t\n\t\t\t//if null we are the first and add ourselves\n\t\t\tif (thisSector == null) {\n\t\t\t\tsectorMap.put(pointInt, sector);\n\t\t\t} \n\t\t\t\n\t\t\t//otherwise if it a different sector, we have a loop!\n\t\t\telse if (!thisSector.equals(sector)) {\n\t\t\t\tloop = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// some testing code!\n\t\tfor (int p = 1; p < currdist; p++) {\n\t\t\tSystem.out.print(\" \");\n\t\t}\n\t\t\n\t\tSystem.out.print(\"branching to \" + pointInt.getCoordinate().getX()\n\t\t\t\t+ \",\" + pointInt.getCoordinate().getY() + \" from \"\n\t\t\t\t+ fromInt.getCoordinate().getX() + \",\"\n\t\t\t\t+ fromInt.getCoordinate().getY() + \"\\n\");\n\t\t//end of testing code!\n\t\t\n\t\tint thisId = ++id;\n\t\t\n\t\t//adds a new id to the idarray carried with this branch head\n\t\tidArray.add(thisId);\n\t\t\n\t\t//this is an iterator over the id array so we can see who has visited the point\n\t\tIterator<Integer> it = idArray.iterator();\n\t\tboolean visited = false;\n\t\t\n\t\t//this gets the integer array stored in the visitorsMap hashMap for the point in question\n\t\tArrayList<Integer> visitors = (ArrayList<Integer>) visitorsMap.get(pointInt);\n\t\t\n\t\t//if this is the first time this has been visited, all is well. \n\t\t//but we must add our id to a new idarraay for this place\n\t\tif (visitors == null) {\n\t\t\t\n\t\t\tArrayList<Integer> newVisitors = new ArrayList<Integer>();\n\t\t\tnewVisitors.add(new Integer(thisId));\n\t\t\tvisitorsMap.put(pointInt, newVisitors);\n\t\t} \n\t\telse {\n\t\t\t\n\t\t\t//we must check every id that this head has ever been against every id that has ever visited the node\n\t\t\twhile (it.hasNext()) {\n\t\t\t\t\n\t\t\t\tint myId = ((Integer) it.next()).intValue();\n\t\t\t\tIterator<Integer> vIt = visitors.iterator();\n\t\t\t\t\n\t\t\t\twhile (vIt.hasNext()) {\n\t\t\t\t\t\n\t\t\t\t\tInteger Vnext = (Integer) vIt.next();\n\t\t\t\t\t\n\t\t\t\t\t//all obvious except !(loop&& (Vnext.intValue()!=-1)) which is there \n\t\t\t\t\t//because if there is a loop we no longer count the original road as a part!\n\t\t\t\t\tif (myId == (Vnext).intValue()) {\n\t\t\t\t\t\tvisited = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (visited == true) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//we cannot go over the same spot twice so we return now\n\t\t//THIS MIGHT NEED TO CHANGE AS WE MAY WELL BE ABLE TO AS LONG AS WE CAN FIND SOMEWHERE UNVISITED TO GO NEXT!\n\t\t//ACTUALLY IT WONT BECAUSE EVERY NODE HAS ONLY 3 BRANCHES, and any other visitor must have exited with one!\n\t\tif (visited) {\n\t\t\t\n\t\t\tSystem.out.println(\"returning due to loop: \"+currdist);\n\t\t\treturn currdist;\n\t\t}\n\t\t\n\t\tInteger hMapDist = (Integer) distancesMap.get(pointInt);\n\t\t\n\t\tif (hMapDist == null) {\n\t\t\t\n\t\t\tdistancesMap.put(pointInt, new Integer(currdist));\n\t\t\thMapDist = -1;\n\t\t}\n\t\t\n\t\tif (hMapDist > currdist) {\n\t\t\treturn currdist;\n\t\t}\n\t\t\n\t\tRoad option1 = getRoadFromInt(game1, pointInt, player, fromInt, null);\n\t\t\n\t\tif (option1 == null) {\n\t\t\treturn currdist;\n\t\t}\n\t\t\n\t\tRoad option2 = getRoadFromInt(game1, pointInt, player, fromInt,\n\t\t\t\tgetOtherInt(game1.getBoard(), option1, pointInt));\n\t\t\n\t\t// add branch!!!\n\t\tint option1Result = Branch(game1, player, \n\t\t\t\tgetOtherInt(game1.getBoard(), option1, pointInt), pointInt,\n\t\t\t\toption1, (ArrayList<Integer>) idArray.clone(), currdist + 1,\n\t\t\t\tdistancesMap, visitorsMap, sector, sectorMap);\n\t\t\n\t\tif (option2 == null) {\n\t\t\treturn option1Result;\n\t\t}\n\t\t\n\t\tint option2Result = Branch(game1, player,\n\t\t\t\tgetOtherInt(game1.getBoard(), option2, pointInt), pointInt,\n\t\t\t\toption2, (ArrayList<Integer>) idArray.clone(), currdist + 1,\n\t\t\t\tdistancesMap, visitorsMap, sector, sectorMap);\n\t\t\n\t\tif (option1Result > option2Result) {\n\t\t\treturn option1Result;\n\t\t}\n\t\t\n\t\treturn option2Result;\n\t}", "public abstract C b(DiscreteDomain<C> discreteDomain);", "public void model() \n\t{\n\t\t\n\t\ttry \n\t\t{\n\t\t GRBEnv env = new GRBEnv();\n\t\t GRBModel model = new GRBModel(env, \"resources/students.lp\");\n\n\t\t model.optimize();\n\n\t\t int optimstatus = model.get(GRB.IntAttr.Status);\n\n\t\t if (optimstatus == GRB.Status.INF_OR_UNBD) {\n\t\t model.getEnv().set(GRB.IntParam.Presolve, 0);\n\t\t model.optimize();\n\t\t optimstatus = model.get(GRB.IntAttr.Status);\n\t\t }\n\n\t\t if (optimstatus == GRB.Status.OPTIMAL) {\n\t\t double objval = model.get(GRB.DoubleAttr.ObjVal);\n\t\t System.out.println(\"Optimal objective: \" + objval);\n\t\t } else if (optimstatus == GRB.Status.INFEASIBLE) {\n\t\t System.out.println(\"Model is infeasible\");\n\n\t\t // Compute and write out IIS\n\t\t model.computeIIS();\n\t\t model.write(\"model.ilp\");\n\t\t } else if (optimstatus == GRB.Status.UNBOUNDED) {\n\t\t System.out.println(\"Model is unbounded\");\n\t\t } else {\n\t\t System.out.println(\"Optimization was stopped with status = \"\n\t\t + optimstatus);\n\t\t }\n\n\t\t // Dispose of model and environment\n\t\t model.write(\"resources/model.sol\");\n\t\t model.dispose();\n\t\t env.dispose();\n\n\t\t } catch (GRBException e) {\n\t\t System.out.println(\"Error code: \" + e.getErrorCode() + \". \" +\n\t\t e.getMessage());\n\t\t }\n\t\t\n\t}", "public double getBestSolutionEvaluation();", "@Override\r\n\tpublic double getObjectiveFunctionValue(SolutionRepresentationInterface oSolution) {\r\n\t\t\r\n\t\tint[] solutionArr = oSolution.getSolutionRepresentation();\t\r\n\t\tdouble cost = 0;\r\n\t\r\n\t\tfor(int i = 0; i < solutionArr.length - 1; i++) {\r\n\t\t\tcost += getCost(solutionArr[i], solutionArr[i + 1]);\r\n\t\t}\r\n\t\t\r\n\t\t// add the trips between the postal office and worker’s home locations with the start and end points\r\n\t\tcost += getCostBetweenDepotAnd(solutionArr[0]) + getCostBetweenHomeAnd(solutionArr[solutionArr.length - 1]);\r\n\t\t\r\n\t\treturn cost;\r\n\t}", "void Step(){\n if(G().rn.nextDouble()<GetBirthProbability()){\n Divide();\n }\n }", "public void solve() {\n// BruteForceSolver bfs = new BruteForceSolver(pointList);\n// bfs.solve(); // prints the best polygon, its area, and time needed\n// System.out.println(\"-------------\");\n\n// StarshapedSolver ss = new StarshapedSolver(pointList);\n// foundPolygons = ss.solve();\n// System.out.println(\"-------------\");\n\n// RandomAddPointHeuristic ra = new RandomAddPointHeuristic(pointList);\n// foundPolygons = ra.solve(750);\n// System.out.println(\"-------------\");\n\n// GreedyAddPointHeuristic ga = new GreedyAddPointHeuristic(pointList,false);\n// foundPolygons = ga.solve(750);\n// System.out.println(\"-------------\");\n\n// long time = 4000;\n// GreedyAddPointHeuristic gaInit = new GreedyAddPointHeuristic(pointList,false);\n// Polygon2D initSolution = gaInit.solve(time*1/4).get(0);\n// System.out.println(initSolution.area);\n// System.out.println(initSolution);\n//\n// SimulatedAnnealing sa = new SimulatedAnnealing(pointList,initSolution,3);\n// foundPolygons.addAll(sa.solve(time-gaInit.timeInit,2,0.005,0.95));\n// System.out.println(sa.maxPolygon);\n// System.out.println(\"-------------\");\n\n// foundPolygons.addAll(findMultiplePolygonsStarshaped(8,0.6));\n\n }", "boolean checkGoal(Node solution);", "public Solver(Board initial) {\r\n if (initial == null) throw new IllegalArgumentException();\r\n\r\n\r\n SearchNode initialAdjacent = new SearchNode(initial.twin(), null, 0);\r\n MinPQ<SearchNode> adjacentPriorityQueue = new MinPQ<>(1);\r\n adjacentPriorityQueue.insert(initialAdjacent);\r\n\r\n\r\n SearchNode initialNode = new SearchNode(initial, null, 0);\r\n MinPQ<SearchNode> priorityQueue = new MinPQ<>(1);\r\n priorityQueue.insert(initialNode);\r\n\r\n if (initial.isGoal()) {\r\n goal = initialNode;\r\n isSolvable = true;\r\n return;\r\n } else if (initialAdjacent.board.isGoal()) {\r\n isSolvable = false;\r\n }\r\n\r\n\r\n SearchNode currentAdjacent = initialAdjacent;\r\n SearchNode currentBoard = initialNode;\r\n\r\n while (!currentAdjacent.board.isGoal() && !currentBoard.board.isGoal()) {\r\n\r\n currentAdjacent = adjacentPriorityQueue.delMin();\r\n currentBoard = priorityQueue.delMin();\r\n\r\n for (Board adjacentNeighbor : currentAdjacent.board.neighbors()) {\r\n SearchNode toBeInserted = new SearchNode(adjacentNeighbor, currentAdjacent, currentAdjacent.previousMoves + 1);\r\n if (currentAdjacent.previousSearchNode == null || !toBeInserted.board.equals(currentAdjacent.previousSearchNode.board)) {\r\n adjacentPriorityQueue.insert(toBeInserted);\r\n }\r\n }\r\n\r\n\r\n for (Board neighbor : currentBoard.board.neighbors()) {\r\n SearchNode toBeInserted = new SearchNode(neighbor, currentBoard, currentBoard.previousMoves + 1);\r\n if (currentBoard.previousSearchNode == null || !toBeInserted.board.equals(currentBoard.previousSearchNode.board)) {\r\n\r\n priorityQueue.insert(toBeInserted);\r\n }\r\n }\r\n }\r\n if (currentAdjacent.board.isGoal()) {\r\n isSolvable = false;\r\n goal = initialNode;\r\n } else {\r\n goal = currentBoard;\r\n isSolvable = true;\r\n }\r\n\r\n }", "@Override\r\n public void visit(Goal n, Graph argu) {\r\n Graph graph = new Graph(\"MAIN\", 0);\r\n n.f1.accept(this, graph);\r\n graph.BuildControlFlow();\r\n graph.AllocateReg();\r\n graph.Kanga();\r\n n.f3.accept(this, null);\r\n }", "public abstract double getConstraintFitness();", "public Solution solve(KnapsackData data);", "public void test4_b_parametric() { // Schedule found: (m + 1)i + j + (-m - 2)\n\t\t/* RelTrafo1: (i, j) - (i, j - 1) = (0, 1)\n\t\t * RelTrafo2: (i, j) - (i - 1, j + m) = (1, -m)\n\t\t * (m + 1) - m + (-m - 2) = -m - 1\n\t\t *//*\n\t\tGDGraph gdGraph = new GDGraph();\n\t\tGDGVertex gdVertex = gdGraph.addVertex();\n\t\tGDGEdge gdEdge1 = gdGraph.addEdge(gdVertex, gdVertex);\n\t\tGDGEdge gdEdge2 = gdGraph.addEdge(gdVertex, gdVertex);\n\n\t\tgdEdge1.dataDependence = convertIntTableToAffineTrafoRational(new int[][]{ // (i, j - 1) \n\t\t\t\t{ 1, 0, 0, 0},\n\t\t\t\t{ 0, 1, 0, -1},\n\t\t\t\t{ 0, 0, 0, 1}\n });\n\t\tgdEdge1.producedDomain = convertIntTableToPIPDRational(new int[][]{ // (0..+inf, 1..+inf)\n\t\t\t\t{ 1, 0, 0, 0},\n\t\t\t\t{ 0, 1, 0, -1}\n\t\t}, new int[][]{\n\t\t\t\t{ 1, 0}\n\t\t});\n\n\t\tgdEdge2.dataDependence = convertIntTableToAffineTrafoRational(new int[][]{ // (i - 1, j + m) \n\t\t\t\t{ 1, 0, 0, -1},\n\t\t\t\t{ 0, 1, 1, 0},\n\t\t\t\t{ 0, 0, 0, 1}\n });\t\t\n\t\tgdEdge2.producedDomain = convertIntTableToPIPDRational(new int[][]{ // (1..+inf, 0..+inf)\n\t\t\t\t{ 1, 0, 0, -1},\n\t\t\t\t{ 0, 1, 0, 0}\n\t\t}, new int[][]{\n\t\t\t\t{ 1, 0}\n\t\t});\n\n\t\tgdVertex.computationDomain = convertIntTableToPIPDRational(new int[][]{ // (1..+inf, 1..+inf)\n\t\t\t\t{ 1, 0, 0, -1},\n\t\t\t\t{ 0, 1, 0, -1}\n\t\t}, new int[][]{\n\t\t\t\t{ 1, 0}\n\t\t});\n\t\t\n\t\tgdGraph.calculateFeautrierSchedule(true, true);\n\t\n\t\tgdGraph.<Rational>codeGeneration(Rational.ZERO, Rational.ONE);\n\t*/}", "private boolean isFeasible(Set active) throws ParallelException {\r\n if (_k==2) {\r\n\t\t\t_g.makeNNbors(); // re-establish nnbors\r\n\t final int gsz = _g.getNumNodes();\r\n\t\t for (int i=0; i<gsz; i++) {\r\n\t\t\t Node nn = _g.getNode(i);\r\n\t\t\t\tSet nnbors = nn.getNbors(); // Set<Node>\r\n\t int count=0;\r\n\t\t if (active.contains(nn)) count=1;\r\n\t\t\t Iterator it2 = active.iterator();\r\n\t\t\t\twhile (it2.hasNext()) {\r\n\t\t\t\t\tNode n2 = (Node) it2.next();\r\n\t if (nnbors.contains(n2)) {\r\n\t\t ++count;\r\n\t\t\t if (count>1) return false;\r\n\t\t\t\t }\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse { // _k==1\r\n\t\t\t// _g.makeNbors(true); // no need to re-establish nbors: never modified\r\n\t\t\tIterator it = active.iterator();\r\n\t\t\twhile (it.hasNext()) {\r\n\t\t\t\tNode n1 = (Node) it.next();\r\n\t\t\t\tSet n1bors = n1.getNborsUnsynchronized();\r\n\t\t\t\tIterator it2 = n1bors.iterator();\r\n\t\t\t\twhile (it2.hasNext()) {\r\n\t\t\t\t\tNode n1nbor = (Node) it2.next();\r\n\t\t\t\t\tif (active.contains(n1nbor)) return false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n }", "public BranchAndBound() {\n this.timeFi = Long.parseLong(\"2000000000000\");;\n this.numSoluciones = 0;\n }", "@Test\n public void shouldEvaluateWorkProperlyCase2() throws FileNotFoundException {\n DoubleProblem problem = new MockDoubleProblem(2) ;\n\n List<DoubleSolution> frontToEvaluate = new ArrayList<>() ;\n\n DoubleSolution solution = problem.createSolution() ;\n solution.setObjective(0, 0.25);\n solution.setObjective(1, 0.75);\n frontToEvaluate.add(solution) ;\n\n solution = problem.createSolution() ;\n solution.setObjective(0, 0.75);\n solution.setObjective(1, 0.25);\n frontToEvaluate.add(solution) ;\n\n solution = problem.createSolution() ;\n solution.setObjective(0, 0.5);\n solution.setObjective(1, 0.5);\n frontToEvaluate.add(solution) ;\n\n WFGHypervolume<DoubleSolution> hypervolume = new WFGHypervolume<>() ;\n double result = hypervolume.computeHypervolume(frontToEvaluate, new ArrayPoint(new double[]{1.0, 1.0})) ;\n\n assertEquals(0.25*0.75 + 0.25*0.5 + 0.25*0.25, result, 0.0001) ;\n }", "public void solveGame() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\n\t\t\tif(!relaxAllControllables){\n\t\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\n\t\t\t\t\t\tcurrentSet.add(s);\n\t\t\t\t}\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "public abstract double[] getLowerBound();", "@Override\n\tpublic void run() {\n\t\tMap<Integer, Integer> roots = new TreeMap<Integer, Integer>();\n\t\t\n\t\tEdge[] edges = new Edge[this.edges.length];\n\t\tint n, weight, relevantEdges, root, lowerBound = 0;\n\t\n\t\t// Sort edges by weight.\n\t\tquickSort(0, this.edges.length - 1);\n\t\n\t\t// Compute initial lower bound (best k - 1 edges).\n\t\t// Choosing the cheapest k - 1 edges is not very intelligent. There is no guarantee\n\t\t// that this subset of edges even induces a subgraph over the initial graph.\n\t\t// TODO: Find a better initial lower bound.\n\t\tfor (int i = 0; i < solution.length; i++) {\n\t\t\tlowerBound += this.edges[i].weight;\n\t\t}\n\t\n\t\t// Iterate over all nodes in the graph and run Prim's algorithm\n\t\t// until k - 1 edges are fixed.\n\t\t// As all induced subgraphs have k nodes and are connected according to Prim, they\n\t\t// are candidate solutions and thus submitted.\n\t\tfor (root = 0; root < taken.length; root++) {\n\t\t\ttaken = new boolean[taken.length];\n\t\t\tSystem.arraycopy(this.edges, 0, edges, 0, this.edges.length);\n\n\t\t\ttaken[root] = true;\n\t\t\tn = 0;\n\t\t\tweight = 0;\n\t\t\trelevantEdges = this.edges.length;\n\n\t\t\twhile (n < solution.length) { \n\t\t\t\tfor (int i = 0; i < relevantEdges; i++) {\n\t\t\t\t\t// XOR to check if connected and no circle.\n\t\t\t\t\tif (taken[edges[i].node1] ^ taken[edges[i].node2]) {\n\t\t\t\t\t\ttaken[taken[edges[i].node1] ? edges[i].node2 : edges[i].node1] = true;\n\t\t\t\t\t\tsolution[n++] = edges[i];\n\t\t\t\t\t\tweight += edges[i].weight;\n\t\t\t\t\t\tSystem.arraycopy(edges, i + 1, edges, i, --relevantEdges - i);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t// Check for circle.\n\t\t\t\t\telse if (taken[edges[i].node1]) {\n\t\t\t\t\t\tSystem.arraycopy(edges, i + 1, edges, i, --relevantEdges - i);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Sum up what we've just collected and submit this\n\t\t\t// solution to the framework.\n\t\t\tHashSet<Edge> set = new HashSet<Edge>(solution.length);\n\t\t\tfor (int i = 0; i < solution.length; i++) {\n\t\t\t\tset.add(solution[i]);\n\t\t\t}\n\t\t\tsetSolution(weight, set);\n\t\t\troots.put(weight, root);\n\t\t}\n\n\t\t// Now for the real business, let's do some Branch-and-Bound. Roots of \"k Prim Spanning Trees\"\n\t\t// are enumerated by weight to increase our chances to obtain the kMST earlier.\n\t\tfor (int item : roots.values()) {\n\t\t\ttaken = new boolean[taken.length];\n\t\t\tSystem.arraycopy(this.edges, 0, edges, 0, this.edges.length);\n\t\t\ttaken[item] = true;\n\t\t\tbranchAndBound(edges, solution.length, 0, lowerBound);\n\t\t}\n\t}", "public static int dynamic_p(int objects,int capacity){\r\n // Array to accommodate dynamic programming solutions\r\n int dp_array[][] = new int[objects+1][capacity+1];\r\n // filling the 2D array\r\n for(int i=0; i<= objects;i++){\r\n for(int j=0; j<= capacity;j++){\r\n if(i == 0)\r\n dp_array[i][j]=0; // base case(number of objects are zero)\r\n else if(j == 0)\r\n dp_array[i][j]=0; // base case(capacity is zero)\r\n else if(randvariables[i-1] <= j){ // checking if the wight of object is less than the current knapsack capacity\r\n int included = randvalues[i-1]+dp_array[i-1][j-randvariables[i-1]]; // object is included\r\n int not_included = dp_array[i-1][j]; // object is not included\r\n\r\n //taking the max of these two\r\n if(included > not_included)\r\n dp_array[i][j] = included;\r\n else\r\n dp_array[i][j]= not_included;\r\n }\r\n else // weight is more than capacity .. not including the object\r\n dp_array[i][j] = dp_array[i-1][j];\r\n }\r\n }\r\n\r\n //System.out.println(Arrays.deepToString(dp_array));\r\n int solution = dp_array[objects][capacity];\r\n boolean[] optimalset = solution_used(dp_array,objects,capacity);\r\n System.out.println(Arrays.toString(optimalset));\r\n dp_array = null;\r\n return solution; // return the final solution\r\n\r\n }", "Node findBaseCases(Dfg dfg, ProcessTree tree, DfgMinerState minerState);", "@Override\n public PDEResults1D solve(final ConvectionDiffusionPDEDataBundle pdeData, final PDEGrid1D grid, final BoundaryCondition lowerBoundary, final BoundaryCondition upperBoundary,\n final Surface<Double, Double, Double> freeBoundary) { PDEGrid1D doubleTimeStep = new PDEGrid1D(grid., null)\n // res1 = _bas\n //\n return null;\n }", "public interface OrderBookBalancingLogic {\n boolean balancingByPercentage();\n}", "@Override\n\tprotected void notifyNewBest(LinkedList<City> goodSolution, double length) {\n\t}", "public int getLowerBound ();", "public T caseContinuous(Continuous object) {\n\t\treturn null;\n\t}", "public void solveGame5() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}" ]
[ "0.63835996", "0.63371944", "0.59438556", "0.57977563", "0.55225116", "0.54932874", "0.5455123", "0.54264396", "0.5381514", "0.52528524", "0.5244702", "0.5241957", "0.5231297", "0.52132004", "0.5212568", "0.52029264", "0.5181315", "0.51636714", "0.5123564", "0.511486", "0.5099171", "0.5031938", "0.5019665", "0.49807256", "0.49627423", "0.49566773", "0.4944665", "0.4939354", "0.4924813", "0.49205834", "0.49154004", "0.49127245", "0.49055535", "0.49016964", "0.48977607", "0.4867303", "0.48653173", "0.48568118", "0.48560926", "0.48431844", "0.48374513", "0.48353046", "0.48284638", "0.482621", "0.48186314", "0.48114574", "0.4804573", "0.47972068", "0.47807664", "0.477876", "0.4767489", "0.47541857", "0.47518757", "0.47334713", "0.47152886", "0.47118995", "0.46961752", "0.46913338", "0.46893153", "0.46765634", "0.4674265", "0.46734273", "0.46664456", "0.4663881", "0.4657342", "0.465434", "0.4648081", "0.46384466", "0.46351063", "0.4633384", "0.46327806", "0.46316558", "0.46292865", "0.46192494", "0.46166784", "0.459616", "0.45898092", "0.4588539", "0.45840707", "0.45833728", "0.45750558", "0.45698085", "0.45556614", "0.45420298", "0.45359105", "0.45331588", "0.45300943", "0.45222682", "0.4521583", "0.45210913", "0.45201257", "0.45182338", "0.45173073", "0.45169252", "0.45130932", "0.4508229", "0.45051", "0.45021006", "0.44999808", "0.44989634" ]
0.46900728
58
A branching strategy over the objective variable. It is activated on the first solution, and splits the domain into two parts, and evaluates first the lower part in case of minimization and the upper part in case of maximization.
public static ObjectiveStrategy objective_top_bottom(IntVar OBJECTIVE){ return new ObjectiveStrategy(OBJECTIVE, OptimizationPolicy.TOP_DOWN); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean solveBranchingModel(BranchingConstraintSet targetSet) {\n for (BranchingConstraint branching : targetSet.branchingConstraints) {\n Map<String, Double> terms = new HashMap<>();\n terms.put(branching.branchingVarName, 1.0);\n\n if (branching.branchingType == ConstraintType.LEQL)\n origin.addConstraint(branching.name, terms, branching.branchingType, -Double.MAX_VALUE, branching.bound);\n else\n origin.addConstraint(branching.name, terms, branching.branchingType, branching.bound, Double.MAX_VALUE);\n\n }\n\n origin.solveLP();\n\n for (BranchingConstraint branching : targetSet.branchingConstraints) {\n origin.removeConstraint(branching.name);\n }\n\n if (origin.getStatus() == Model.Status.OPTIMAL) {\n// System.out.println(\"Objective: \" + origin.getOptimum()); /* Get objective value */\n if (integerSolution()) {\n if (origin.getOptimum() < ub)\n ub = origin.getOptimum();\n return false;\n } else {\n if (origin.getOptimum() > lb)\n lb = origin.getOptimum();\n return true;\n }\n } else {\n System.out.println(\"Current branch is infeasible!\");\n return false;\n }\n }", "@Override\n protected void doAlgorithmA1() {\n int xP = 0;\n int yP = 0;\n\n\n //Taking the variable out of the list that are in the bounds\n //Testing that the bound has variables\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n xP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX().getPosition();\n }\n int xU = 0;\n int xL = 0;\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n yP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY().getPosition();\n }\n int yU = 0;\n int yL = 0;\n int cright = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCright();\n int cleft = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCleft();\n\n\n\n for (Variable variable : csp.getVars()) {\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n if (variable.getPosition() == xP) {\n xU = variable.getUpperDomainBound();\n xL = variable.getLowerDomainBound();\n }\n }\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n if (variable.getPosition() == yP) {\n yU = variable.getUpperDomainBound();\n yL = variable.getLowerDomainBound();\n }\n }\n }\n\n boolean first = false;\n boolean second = false;\n\n //Testing if the bound is true, false or inconclusive\n\n if (xL + cleft >= yU + cright) {\n first = true;\n }\n if (xU + cleft < yL + cright) {\n second = true;\n }\n\n //are first and second not equal is the bound not inconclusive\n if (first != second) {\n if (first) { //a true Simple Bound was found\n //checks if it was the last constraint in a csp\n //If so the csp is true\n //else check the next constraint and do this method again\n if (csp.getSimpleConstraints().size() - 1 == cIndex) {\n System.out.println(\"P is satisfiable\");\n System.out.println(System.nanoTime()-startTime);\n return;\n } else {\n bIndex = 0;\n cIndex++;\n unit=false;\n doAlgorithmA1();\n }\n } else if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) { //a false Simple Bound was found\n //\n bIndex = 0;\n cIndex = 0;\n if (isInconclusive) {\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n doAlgorithmA2();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n } else {//an inconclusive Simple Bound was found\n //checks if the bound wasn't already inconclusive\n if(!isInconclusive){\n unit=true;\n unitSB = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex);\n }else {\n unit=false;\n }\n isInconclusive = true;\n\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) {\n cIndex = 0;\n bIndex = 0;\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n }\n }", "public abstract OptimisationSolution getBestSolution();", "@Override\n public Solution solve(ISearchable domain) {\n if(domain==null)\n return null;\n Solution s2=domain.checkIfIsSmall();\n if(s2!=null){\n domain.isClear();\n return s2;\n }\n Solution sol = new Solution();\n temp.add(domain.getStartState());\n numOfNude++;\n domain.isVisit(domain.getStartState());\n ArrayList<AState> neighbors=new ArrayList<AState>();\n while(!temp.isEmpty()){\n AState curr=temp.poll();\n if(domain.isEqual(domain.getGoalState(),curr)){\n numOfNude++;\n sol =solutionPath(curr,sol);\n\n break;\n }\n neighbors=domain.getAllPossibleState(curr);\n for(int i=0;i<neighbors.size();i++){\n if(domain.isEqual(domain.getGoalState(),neighbors.get(i))){\n neighbors.get(i).pervState=curr;\n neighbors.get(i).setPrice(neighbors.get(i).getPrice()+curr.getPrice());\n numOfNude++;\n sol =solutionPath(neighbors.get(i),sol);\n break;\n }\n neighbors.get(i).pervState=curr;\n neighbors.get(i).setPrice(neighbors.get(i).getPrice()+curr.getPrice());\n temp.add(neighbors.get(i));\n numOfNude++;\n }\n }\n\n domain.isClear();\n return sol;\n }", "public VariableCoefficientTuple suggestBranchingVariable (TwoIntegerTuple childRectCounts ) {\r\n \r\n VariableCoefficientTuple result= new VariableCoefficientTuple(null, ZERO) ;\r\n \r\n //first get the best lp rects\r\n List<Rectangle> rectanglesToConsiderForBranchingVarCalculation = this.getRectanglesToConsiderForBranchingVarCalculation( );\r\n \r\n //collect 0 direction refcounts into this map\r\n Map<String, Integer> zeroVar_RefCountMap = new HashMap<String, Integer> () ;\r\n //and one diirection refconts into this map\r\n Map<String, Integer> oneVar_RefCountMap = new HashMap<String, Integer> () ;\r\n \r\n List<VariableCoefficientTuple> variablesUsedForBranchingInThisRectangle =null;\r\n for (Rectangle rect: rectanglesToConsiderForBranchingVarCalculation){\r\n variablesUsedForBranchingInThisRectangle = getVariablesUsedForBranchingInThisRectangle (rect);\r\n if (variablesUsedForBranchingInThisRectangle.size()>ZERO) {\r\n this.updateVariableRefCounts(zeroVar_RefCountMap, oneVar_RefCountMap, variablesUsedForBranchingInThisRectangle) ;\r\n }else {\r\n System.err.print(\"trying to branch a node which should have been marked infeasible\" );\r\n exit(ONE);\r\n }\r\n }\r\n \r\n \r\n //now find the highest refcount var, no matter its direction\r\n int highZeroFreq = zeroVar_RefCountMap.isEmpty()?ZERO:Collections.max( zeroVar_RefCountMap.values());\r\n int highOneFreq = oneVar_RefCountMap.isEmpty()? ZERO: Collections.max(oneVar_RefCountMap.values()) ;\r\n \r\n //we need to find the selected var's refcount on the other side\r\n int selectedVarRefCountOnOtherSide = ZERO;\r\n \r\n int totalRects = getNumberOfRects(this.myInfeasibleRectanglesList) ;\r\n \r\n if (highZeroFreq>highOneFreq) {\r\n result.varName=getHighestFreqVar (zeroVar_RefCountMap,highZeroFreq ) ;\r\n result.coeff=highZeroFreq;\r\n selectedVarRefCountOnOtherSide= oneVar_RefCountMap.get( result.varName)==null? ZERO : oneVar_RefCountMap.get( result.varName);\r\n //this is how many rects will survive on either side\r\n childRectCounts.zeroSideCount = totalRects - selectedVarRefCountOnOtherSide;\r\n childRectCounts.oneSideCount=totalRects -highZeroFreq ;\r\n \r\n } else {\r\n result.varName=getHighestFreqVar (oneVar_RefCountMap,highOneFreq ) ;\r\n result.coeff=highOneFreq;\r\n selectedVarRefCountOnOtherSide= zeroVar_RefCountMap.get( result.varName)==null? ZERO : zeroVar_RefCountMap.get( result.varName);\r\n \r\n childRectCounts.zeroSideCount = totalRects - highOneFreq;\r\n childRectCounts.oneSideCount=totalRects - selectedVarRefCountOnOtherSide;\r\n }\r\n \r\n return result;\r\n }", "private List<Rectangle> getRectanglesToConsiderForBranchingVarCalculation () {\r\n \r\n List<Rectangle> rectanglesToConsider = new ArrayList<Rectangle> ();\r\n \r\n //for every constraint, see if it has rects at the best lp\r\n \r\n for (Map <Double, List<Rectangle>> rectMap: myInfeasibleRectanglesList) {\r\n for (List<Rectangle> rectList : rectMap.values()) { \r\n \r\n rectanglesToConsider.addAll(rectList );\r\n \r\n } \r\n }\r\n \r\n return rectanglesToConsider;\r\n }", "public LSMOP9(String solutionType, Integer numberOfVariables,\r\n\t\t\tInteger numberOfObjectives) {\r\n\t\tsuper(solutionType, numberOfVariables, numberOfObjectives);\r\n\t\tnumberOfVariables_ = numberOfVariables;\r\n\t\tnumberOfObjectives_ = numberOfObjectives;\r\n\t\tnumberOfConstraints_ = 0;\r\n\t\tproblemName_ = \"LSMOP9\";\r\n\r\n\t\tnk = 5;\r\n\t\tc = new double[numberOfObjectives_];\r\n\t\tc[0] = 3.8*0.1*(1.0-0.1);\r\n\t\tdouble sumC = c[0];\r\n\t\tfor(int i = 1; i < numberOfObjectives_; i++){\r\n\t\t\tc[i] = 3.8*c[i-1]*(1.0-c[i-1]);\r\n\t\t\tsumC += c[i];\r\n\t\t}\r\n\t\tsublen = new int[numberOfObjectives_];\r\n\t\tfor(int i = 0; i < numberOfObjectives_; i++){\r\n\t\t\t//sublen[i] = (int)Math.ceil(Math.round(numberOfVariables_*c[i]/sumC)/nk);\r\n\t\t\t//sublen[i] = (int)Math.floor(numberOfVariables_*c[i]/sumC/nk);\r\n\t\t\tsublen[i] = (int)Math.floor((numberOfVariables_-numberOfObjectives_+1)*c[i]/sumC/nk);\r\n\t\t}\r\n\t\tlen = new int[numberOfObjectives_+1]; \r\n\t\tlen[0] = 0;\r\n\t\tfor(int i = 0; i < numberOfObjectives_; i++){\r\n\t\t\tlen[i+1] = len[i] + nk*sublen[i];\r\n\t\t}\r\n\t\tlowerLimit_ = new double[numberOfVariables_];\r\n\t\tupperLimit_ = new double[numberOfVariables_];\r\n\t\tfor (int var = 0; var < numberOfObjectives_ - 1; var++) {\r\n\t\t\tlowerLimit_[var] = 0.0;\r\n\t\t\tupperLimit_[var] = 1.0;\r\n\t\t} // for\r\n\t\t\r\n\t\tfor (int var = numberOfObjectives_ - 1; var < numberOfVariables_; var++) {\r\n\t\t\tlowerLimit_[var] = 0.0;\r\n\t\t\tupperLimit_[var] = 10.0;\r\n\t\t} // for\r\n\r\n\t\tif (solutionType.compareTo(\"BinaryReal\") == 0)\r\n\t\t\tsolutionType_ = new BinaryRealSolutionType(this);\r\n\t\telse if (solutionType.compareTo(\"Real\") == 0)\r\n\t\t\tsolutionType_ = new RealSolutionType(this);\r\n\t\telse {\r\n\t\t\tSystem.out.println(\"Error: solution type \" + solutionType\r\n\t\t\t\t\t+ \" invalid\");\r\n\t\t\tSystem.exit(-1);\r\n\t\t}\r\n\t}", "public void boundsLex(int [] a , IntDomainVar [] x , int [] b,int j) throws ContradictionException{\n\n int i =0;\n\n\n while( i< n && a[i]==b[i]){\n\n\n if((x[i].getInf()==a[i] || x[i].updateInf(a[i], this, false)) &&\n (x[i].getSup()==b[i] || x[i].updateSup(b[i], this, false))){\n i++;\n }else{\n this.fail();\n }\n\n }\n\n\n if(i<n )\n if ((x[i].getInf()==a[i] || x[i].updateInf(a[i], this, false)) &&\n (x[i].getSup()==b[i] || x[i].updateSup(b[i], this, false))){\n }else{\n this.fail();\n }\n\n\n if(i==n || x[i].getNextDomainValue(a[i])<b[i]){\n return ;\n }\n\n i+=1;\n\n while(i<n && (b[i]+1 <= a[i]-1) && x[i].getInf()==b[i] && x[i].getSup()==a[i]){\n if(x[i].removeInterval(b[i]+1,a[i]-1, this, false)){\n i++;\n }else{\n this.fail();\n\n }\n }\n\n if(i<n) {\n if (b[i] + 1 <= a[i] - 1 && x[i].getInf() <= b[i] &&\n b[i] <= x[i].getSup() && x[i].getSup() >= a[i] && a[i] >= x[i].getInf()) {\n if (!x[i].removeInterval(b[i] + 1, a[i] - 1, this, false)) {\n this.fail();\n }\n }\n }\n\n }", "public double getBestSolutionEvaluation();", "private void createOptimizationFunction() {\n \t\tobjective = \"min:\"; //$NON-NLS-1$\n \t\tSet s = slice.entrySet();\n \t\tfor (Iterator iterator = s.iterator(); iterator.hasNext();) {\n \t\t\tMap.Entry entry = (Map.Entry) iterator.next();\n \t\t\tHashMap conflictingEntries = (HashMap) entry.getValue();\n \t\t\tif (conflictingEntries.size() <= 1) {\n \t\t\t\tobjective += \" 1 \" + getVariable((IInstallableUnit) conflictingEntries.values().iterator().next()); //$NON-NLS-1$\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\tList toSort = new ArrayList(conflictingEntries.values());\n \t\t\tCollections.sort(toSort);\n \t\t\tint weight = toSort.size();\n \t\t\tfor (Iterator iterator2 = toSort.iterator(); iterator2.hasNext();) {\n \t\t\t\tobjective += \" \" + weight-- + \" \" + getVariable((IInstallableUnit) iterator2.next()); //$NON-NLS-1$//$NON-NLS-2$\n \t\t\t}\n \t\t}\n \t\tobjective += \" ;\"; //$NON-NLS-1$\n \t}", "public Variable getObjective() {\r\n\t\treturn objective;\r\n\t}", "public static void model1() {\n try {\n IloCplex cplex = new IloCplex();\n \n //variables\n IloNumVar x = cplex.numVar(0, Double.MAX_VALUE, \"x\"); //x >= 0\n IloNumVar y = cplex.numVar(0, Double.MAX_VALUE, \"y\"); //y >= 0\n \n //expressions\n IloLinearNumExpr objective = cplex.linearNumExpr();\n objective.addTerm(0.12, x);\n objective.addTerm(0.15, y);\n \n //define objective\n cplex.addMinimize(objective);\n \n //define constraints\n cplex.addGe(cplex.sum(cplex.prod(60, x), cplex.prod(60, y)), 300);\n cplex.addGe(cplex.sum(cplex.prod(12, x), cplex.prod(6, y)), 36);\n cplex.addGe(cplex.sum(cplex.prod(10, x), cplex.prod(30, y)), 90);\n \n //solve\n if (cplex.solve()) {\n System.out.println(\"Obj = \" + cplex.getObjValue());\n System.out.println(\"Obj = \" + cplex.getValue(objective));\n System.out.println(\"x = \" + cplex.getValue(x));\n System.out.println(\"y = \" + cplex.getValue(y));\n } else {\n System.out.println(\"Solution not found.\");\n }\n } catch (IloException ex) {\n ex.printStackTrace();\n }\n }", "public void calcObjective() {\n double obj;\n double objectives[];\n\n for (int i = 0; i < population.getPopulationSize(); i++) { //300\n objectives = population.getObjectiveValues(i);\n obj = evaluateAll(population.getSingleChromosome(i)); //evaluateAll(chromosome chromosome1)\n objectives[indexOfObjective] = obj;\n population.setObjectiveValue(i, objectives);\n }\n }", "public SolutionSet execute() throws JMException, ClassNotFoundException {\n int maxEvaluations ;\n int evaluations ;\n\n SolutionSet population ;\n SolutionSet offspringPopulation ;\n\n Solution betterIndividual ;\n\n Operator mutationOperator ;\n Comparator comparator ;\n Operator localSearchOperator ;\n\n\n comparator = new ObjectiveComparator(0) ; // Single objective comparator\n\n // Read the params\n maxEvaluations = ((Integer)this.getInputParameter(\"maxEvaluations\")).intValue();\n\n // Initialize the variables\n population = new SolutionSet(mu_) ;\n offspringPopulation = new SolutionSet(lambda_) ;\n\n evaluations = 0;\n\n // Read the operators\n mutationOperator = this.operators_.get(\"mutation\");\n localSearchOperator = (LocalSearch) operators_.get(\"improvement\");\n\n System.out.println(\"(\" + mu_ + \" + \" + lambda_+\")ES\") ;\n\n // Create 1-parent population of mu solutions\n Solution newIndividual;\n newIndividual = new Solution(problem_);\n problem_.evaluate(newIndividual);\n evaluations++;\n betterIndividual = new Solution(newIndividual);\n population.add(betterIndividual);\n\n // Main loop\n while (evaluations < maxEvaluations) {\n // STEP 1. Generate the offspring\n Solution offspring = new Solution(population.get(0)) ;\n mutationOperator.execute(offspring);\n /*Solution mutated_solution = (Solution) mutationOperator.execute(offspring);\n if(offspring.getObjective(0) < mutated_solution.getObjective(0))\n offspring = mutated_solution;*/\n problem_.evaluate(offspring);\n Solution local_offspring = (Solution) localSearchOperator.execute(offspring);\n offspring.setObjective(0, local_offspring.getObjective(0));\n offspringPopulation.add(offspring);\n evaluations++;\n\n if(comparator.compare(betterIndividual, offspringPopulation.get(0)) > 0) {\n betterIndividual = new Solution(offspringPopulation.get(0));\n population.clear();\n // STEP 4. Create the new mu population\n population.add(betterIndividual);\n }\n\n System.out.println(population.get(0).getObjective(0)) ;\n\n // STEP 6. Delete the offspring population\n offspringPopulation.clear() ;\n } // while\n\n // Return a population with the best individual\n SolutionSet resultPopulation = new SolutionSet(1) ;\n resultPopulation.add(population.get(0)) ;\n\n return resultPopulation ;\n }", "public void maximize()\n\t{\n\t\tint i,j,max=cost[0][0];\n\t\t\n\t\tfor(i=0;i<n;i++)\n\t\t{\n\t\t\tfor(j=0;j<n;j++)\n\t\t\t{\n\t\t\t\tif(cost[i][j]>max)\n\t\t\t\t{\n\t\t\t\t\tmax=cost[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(i=0;i<n;i++)\n\t\t{\n\t\t\tfor(j=0;j<n;j++)\n\t\t\t{\t\t\n\t\t\t\tcost[i][j]=max-cost[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t}", "double getBranchProbability();", "public int objective() {\n\t\tint value = 0;\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tvalue += v[i] * x[i];\n\t\treturn value;\n\t}", "private double lbranch(double x) {\n\t\r\n\t\tdouble w = approx(x, g, a);\r\n\t\tint i=0;\r\n\t\tdouble err=w+2;\r\n\t\tdouble arg=0,da=0,df=0;\r\n\t\twhile (i<niter && abs(err-w)>tol ) {\r\n\t\t\terr=w;\r\n\r\n\t\t\targ=(w-a)/g-log(g);\r\n\t\t\tda=-lw_minus.eval(arg);\t\r\n\t\t\tdf=iq_minus.eval(w);\r\n\t\t\t//System.out.println(w+\" \"+arg+\" \"+da+\" \"+df);\r\n\t\t\tif (Double.isNaN(df) || Double.isNaN(da)) {\r\n\t\t\t\t//System.out.println(\"df \"+df+ \" da \"+da+\" w \"+w);\r\n\t\t\t\treturn Double.NaN;\r\n\t\t\t}\r\n\t\t\tw+=w*(da+1.0)*(df-g*x);\r\n\t\t\tif (w<=0) return err;\r\n\t\t\ti++;\r\n\t\t} \r\n\t\taiter=i-1;\r\n\t//\tSystem.out.println(\" niter \" +aiter +\" err \"+abs(err));\r\n\r\n\t\treturn w;\r\n\t}", "public Solution solve(ISearchable domain) {\n if (domain == null)\n return null;\n ArrayList<AState> neighbors;\n Solution solution;\n domain.ResetVisit();\n pathSteps.add(domain.getStartState());\n domain.changeVisitTrue(domain.getStartState());\n numberOfNodes++;\n while (pathSteps.size() > 0) {\n AState temp = pathSteps.poll();\n if (domain.getGoalState().equals(temp)) {\n domain.setGoalState(temp);\n solution = finalSolution(temp);\n return solution;\n }\n neighbors = domain.getAllPossibleStates(temp);\n for (int i=0;i<neighbors.size();i++) {\n if (domain.isVisited(neighbors.get(i))==false) {\n numberOfNodes++;\n domain.changeVisitTrue(neighbors.get(i));\n neighbors.get(i).predecessor = temp;\n pathSteps.add(neighbors.get(i));\n }\n if (neighbors.get(i).equals(domain.getGoalState())) {\n neighbors.get(i).predecessor = temp;\n solution = finalSolution(neighbors.get(i));\n return solution;\n }\n }\n }\n return null;\n }", "@Override\n public void evaluate(Solution solution) throws JMException {\n\n int[] tour = new int[numberOfNodes + 1];\n int firstCity = ((Permutation) solution.getDecisionVariables()[0]).vector_[0];\n int lastCity = ((Permutation) solution.getDecisionVariables()[0]).vector_[numberOfNodes - 1];\n\n double fitness1_td = 0.0;\n\n // Calculate fitness 1 - total distance\n for (int i = 0; i < numberOfNodes - 1; i++) {\n int x = ((Permutation) solution.getDecisionVariables()[0]).vector_[i];\n int y = ((Permutation) solution.getDecisionVariables()[0]).vector_[i+1];\n\n tour[i] = x;\n tour[i+1] = y;\n\n fitness1_td += calDistances(x, y);\n }\n // generate tour with same start city and end city\n tour[numberOfNodes] = tour[0];\n\n fitness1_td += calDistances(firstCity, lastCity);\n\n\n // Correctness check: does the tour start and end in the same city\n if(tour[0] != tour[tour.length - 1]) {\n System.err.println(\"ERROR: The last city must be the same as the first city\");\n System.exit(1);\n }\n\n /*for (int i = 0; i < tour.length; i++) {\n System.out.print(tour[i] + \" \");\n }*/\n //System.out.println(\"\\n\" + tour.length);\n\n // Calculate fitness 2 - objective value of a given tour\n ArrayInt z = (ArrayInt) solution.getDecisionVariables()[1];\n //System.out.println(z.getLength());\n\n double fitness2_ob;\n double wc = 0.0;\n double ft = 0.0;\n double fp = 0.0;\n\n //the following is used for a different interpretation of \"packingPlan\"\n int itemsPerCity = z.getLength() / (tour.length - 2);\n //System.out.println(itemsPerCity);\n\n for (int i = 0; i < tour.length - 1; i++) {\n\n int currentCityTEMP = tour[i];\n // what's the current city? --> but the items start at city 2 in the TTP file, so I have to take another 1 off!\n int currentCity = currentCityTEMP - 1;\n\n if (i > 0) {\n\n if (currentCity == -1) {\n // No items in city 1\n wc += 0.0;\n fp += 0.0;\n\n } else {\n\n for (int itemNumber = 0; itemNumber < itemsPerCity; itemNumber++) {\n\n int indexOfPackingPlan = (i-1) * itemsPerCity + itemNumber;\n // what is the next item's index in items-array?\n int itemIndex = currentCity + itemNumber * (numberOfNodes - 1);\n //System.out.println(\"i: \" + i);\n\n if (z.getValue(indexOfPackingPlan) == 1) {\n // pack item\n //System.out.println(itemIndex);\n int currentWC = items[itemIndex][2];\n wc += currentWC;\n\n int currentFP = items[itemIndex][1];\n fp += currentFP;\n }\n }\n\n }\n\n int h = (i+1) % (tour.length-1); //h: next tour city index\n //System.out.println(\"h: \" + h);\n long distance = calDistances(i, h);\n // compute the adjusted (effective) distance\n ft += (distance / (1 - wc * (maxSpeed - minSpeed) / capacityOfKnapsack));\n }\n }\n\n wendUsed = wc;\n wend = capacityOfKnapsack - wc;\n fitness2_ob = fp - ft * rentingRatio;\n\n solution.setObjective(0, fitness1_td);\n solution.setObjective(1, -fitness2_ob); // Convert from maximum objective value to minimum objective value\n }", "public void setComparedHeuristics (VariableSelector variableSelector, IntValueSelector valueOrder){\n\t\tIntValueSelector valueSelector = valueOrder;\n\t\t\n\t \n\t\tkb.getModelKB().getSolver().setSearch(Search.intVarSearch(\n \n\t\t\t\tvariableSelector,\n // selects the smallest domain value (lower bound)\n\t\t\t\t \n\t\t\t\tvalueSelector,\n \n // variables to branch on\n\t\t\t\tkb.getVars()\n\t\t));\n\t\t\n\t}", "private MoveEvaluation minimax (int ply, IComparator comp, \n\t\t\tIPlayer player, IPlayer opponent) {\n\n\t\t// Try to improve on this lower-bound (based on selector). Reflects no move possible.\n\t\tMoveEvaluation best = new MoveEvaluation (comp.initialValue());\n\n\t\t// get all moves for this player and generate the boards that result\n\t\t// from making these moves. Select maximum of children if we are MAX\n\t\t// and minimum of children if we are MIN\n\t\tIterator<IGameMove> it = player.validMoves(state).iterator(); \n\t\twhile (it.hasNext()) {\n\t\t\tIGameMove move = it.next();\n\t\t\t\n\t\t\tmove.execute(state);\n\t\t\tnumComputationalStates++;\n\t\t\t\n\t\t\t// debugging output along the way...\n\t\t\tif (numComputationalStates % 100 == 0) {\n\t\t\t\tSystem.out.println (numComputationalStates);\n\t\t\t}\n\t\t\t\n\t\t\tMoveEvaluation pathMove = alreadyDetermined(state);\n\t\t\t\n\t\t\tif (pathMove == null) {\n\t\t\t\tint trial;\n\t\t\t\tif (ply <= 0) {\n\t\t\t\t\ttrial = original.eval(state);\n\t\t\t\t} else {\n\t\t\t\t\t// Recursively evaluate position. Compute MiniMax and swap\n\t\t\t\t\t// player and opponent, synchronously with MIN and MAX. If no move is\n\t\t\t\t\t// associated, then evaluate the generated board from original player\n\t\t\t\t\tMoveEvaluation me = minimax (ply-1, comp.opposite(), opponent, player);\n\t\t\t\t\tif (me.move == null) {\n\t\t\t\t\t\ttrial = original.eval(state);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttrial = me.score;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tpathMove = new MoveEvaluation (move, trial);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tmove.undo(state);\n\t\t\t\n\t\t\t// If we are selected as the better move, then update accordingly\n\t\t\tif (comp.compare(best.score, pathMove.score) < 0) {\n\t\t\t\tbest = new MoveEvaluation (move, pathMove.score); \n\t\t\t}\n\t\t}\n\t\t\n\t\t// this move was selected for the gameState. record it. If it is null, then the game has\n\t\t// already been won or this is a draw; in either case, we will let recursive parent take\n\t\t// care of the scoring. Even add when no move, so we can keep track of the WON games.\n\t\taddToList(state, best);\n\t\t\n\t\treturn best;\n\t}", "@Override\n\tpublic void buildBVH() {\n\t\tif(this.bvhObjList.size()<=4) {\n\t\t}else {\n\t\t BVH nebt1 = new BVH(this.bvHi);\n\t\t BVH nebt2 = new BVH(this.bvHi);\n\t\tint tmp = this.calculateSplitDimension(this.bvhBox.getMax().sub(this.bvhBox.getMin()));\n\t\tfloat splitpos;\n\t\tif(tmp==0) {\n\t\t\tsplitpos = this.calculateMinMax().b.avg(this.calculateMinMax().a).x();\n\t\t}else if(tmp==1) {\n\t\t\tsplitpos = this.calculateMinMax().b.avg(this.calculateMinMax().a).y();\n\t\t}else {\n\t\t\tsplitpos = this.calculateMinMax().b.avg(this.calculateMinMax().a).z();\n\t\t\t\n\t\t}\n\t\tthis.distributeObjects(nebt1, nebt2, tmp, splitpos);\n\t\tthis.bvHi.add(nebt1);\n\t\tthis.neb1 = bvHi.indexOf(nebt1);\n\t\tthis.bvHi.add(nebt2);\n\t\tthis.neb2 = bvHi.indexOf(nebt2);\n\t\tnebt2.buildBVH();\n\t\tnebt1.buildBVH();\n\n\t\t}\n\t}", "protected void doDeduction() {\n\n boolean narrowed= false;\n\n unit=false;\n isInconclusive=false;\n\n int newXL;\n int newYU;\n\n Variable x = null;\n Variable y = null;\n\n for(Variable var : csp.getVars()){\n if(var.getPosition() == unitSB.getX().getPosition()){\n x = var;\n } else if(var.getPosition() == unitSB.getY().getPosition()){\n y = var;\n }\n }\n\n int xU = x.getUpperDomainBound();\n int yL = y.getLowerDomainBound();\n\n newXL = yL + unitSB.getCright();\n newYU = xU - unitSB.getCright();\n\n if(newXL>x.getLowerDomainBound()){\n Variable newX = new Variable(newXL, xU);\n newX.setPosition(x.getPosition());\n changeVariable(newX);\n narrowed= true;\n }\n if (newYU< y.getUpperDomainBound()){\n Variable newY = new Variable(yL, newYU);\n newY.setPosition(y.getPosition());\n changeVariable(newY);\n narrowed =true;\n }\n\n if(narrowed){\n doAlgorithmA1();\n }else {\n doAlgorithmA3();\n }\n\n }", "@Override\n public PDEResults1D solve(final ConvectionDiffusionPDEDataBundle pdeData, final PDEGrid1D grid, final BoundaryCondition lowerBoundary, final BoundaryCondition upperBoundary,\n final Surface<Double, Double, Double> freeBoundary) { PDEGrid1D doubleTimeStep = new PDEGrid1D(grid., null)\n // res1 = _bas\n //\n return null;\n }", "public interface Heuristic\r\n{\r\n\r\n double calcStartToGoalCost(State currentState, State goalState);\r\n}", "public void testLPState()\n \t{\n \t\tsolver.buildLPState();\n \t\tassertTrue(solver.hasLPState());\n \t\t\n \t\tfinal int nLPVars = solver.getNumberOfLPVariables();\n \t\tassertTrue(nLPVars >= 0);\n \t\t\n \t\tfinal double[] objective = solver.getObjectiveFunction();\n \t\tassertEquals(nLPVars, objective.length);\n \t\t\n \t\tint nVarsUsed = 0;\n \t\t\n \t\tfor (VariableBase var : model.getVariables())\n \t\t{\n \t\t\tSVariable svar = solver.getSolverVariable(var);\n \t\t\tassertSame(svar, solver.createVariable(var));\n \t\t\t\n \t\t\tDiscrete mvar = svar.getModelObject();\n \t\t\tassertSame(var, mvar);\n \t\t\tassertSame(solver, svar.getParentGraph());\n \t\t\t\n \t\t\t// Test do-nothing methods\n \t\t\tsvar.resetEdgeMessages(0);\n \t\t\tsvar.updateEdge(0);\n \t\t\tsvar.moveMessages(null, 0, 1);\n \t\t\tassertNull(svar.getInputMsg(0));\n \t\t\tassertNull(svar.getOutputMsg(0));\n \t\t\tassertNull(svar.createMessages(null));\n \t\t\tassertNull(svar.resetInputMessage(null));\n \t\t\t\n \t\t\tint lpVar = svar.getLPVarIndex();\n \t\t\tint nValidAssignments = svar.getNumberOfValidAssignments();\n \t\t\t\n \t\t\tif (var.hasFixedValue())\n \t\t\t{\n \t\t\t\t// Currently the converse is not true because model variables\n \t\t\t\t// do not currently check to see if there is only one non-zero input weight.\n \t\t\t\tassertTrue(svar.hasFixedValue());\n \t\t\t}\n \t\t\tif (svar.hasFixedValue())\n \t\t\t{\n \t\t\t\tassertFalse(svar.hasLPVariable());\n \t\t\t}\n \t\t\tif (svar.hasLPVariable())\n \t\t\t{\n \t\t\t\tassertTrue(lpVar >= 0);\n \t\t\t\tassertTrue(nValidAssignments > 1);\n \t\t\t\t++nVarsUsed;\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\tassertEquals(-1, lpVar);\n \t\t\t\tassertTrue(nValidAssignments <= 1);\n \t\t\t}\n \t\t\t\n \t\t\tdouble[] weights = mvar.getInput();\n \t\t\tdouble totalWeight = 0.0;\n \t\t\tfor (double w : weights)\n \t\t\t{\n \t\t\t\ttotalWeight += w;\n \t\t\t}\n \t\t\t\n \t\t\tfor (int i = 0, end = svar.getModelObject().getDomain().size(); i < end; ++i)\n \t\t\t{\n \t\t\t\tdouble w = mvar.getInput()[i];\n \t\t\t\tint lpVarForValue = svar.domainIndexToLPVar(i);\n \t\t\t\tint i2 = svar.lpVarToDomainIndex(lpVarForValue);\n \t\t\t\tif (lpVarForValue >= 0)\n \t\t\t\t{\n \t\t\t\t\tassertEquals(i, i2);\n\t\t\t\t\tassertEquals(Math.log(w), objective[lpVarForValue], 1e-6);\n \t\t\t\t}\n \t\t\t\tif (!svar.hasLPVariable() || mvar.getInput()[i] == 0.0)\n \t\t\t\t{\n \t\t\t\t\tassertEquals(-1, lpVarForValue);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \t\tfor (Factor factor : model.getFactors())\n \t\t{\n \t\t\tSTableFactor sfactor = solver.getSolverFactor(factor);\n \t\t\tassertSame(sfactor, solver.createFactor(factor));\n \t\t\tassertSame(factor, sfactor.getModelObject());\n \t\t\tassertSame(solver, sfactor.getParentGraph());\n \t\t\t\n \t\t\t// Test do nothing methods\n \t\t\tsfactor.createMessages();\n \t\t\tsfactor.updateEdge(0);\n \t\t\tsfactor.resetEdgeMessages(0);\n \t\t\tsfactor.moveMessages(null, 0 , 1);\n \t\t\tassertNull(sfactor.getInputMsg(0));\n \t\t\tassertNull(sfactor.getOutputMsg(0));\n \t\t}\n \t\t\n \t\tfinal List<IntegerEquation> constraints = solver.getConstraints();\n \t\tassertNotNull(constraints);\n \n \t\tint nConstraints = solver.getNumberOfConstraints();\n \t\tint nVarConstraints = solver.getNumberOfVariableConstraints();\n \t\tint nMarginalConstraints = solver.getNumberOfMarginalConstraints();\n \t\tassertEquals(nConstraints, constraints.size());\n \t\tassertEquals(nConstraints, nVarConstraints + nMarginalConstraints);\n \t\tassertEquals(nVarsUsed, nVarConstraints);\n \t\t\n \t\t{\n \t\t\tMatlabConstraintTermIterator termIter = solver.getMatlabSparseConstraints();\n \t\t\tList<Integer> constraintTerms = new ArrayList<Integer>(termIter.size() * 3);\n \t\t\t\n \t\t\tIterator<IntegerEquation> constraintIter = constraints.iterator();\n \t\t\tfor (int row = 1; constraintIter.hasNext(); ++ row)\n \t\t\t{\n \t\t\t\tIntegerEquation constraint = constraintIter.next();\n \t\t\t\t\n \t\t\t\tint nExpectedTerms = -1;\n \t\t\t\tint lpVar = -1;\n \t\t\t\t\n \t\t\t\tif (row <= nVarConstraints)\n \t\t\t\t{\n \t\t\t\t\tLPVariableConstraint varConstraint = constraint.asVariableConstraint();\n \t\t\t\t\tassertNotNull(varConstraint);\n \t\t\t\t\tassertNull(constraint.asFactorConstraint());\n \t\t\t\t\t\n \t\t\t\t\tSVariable svar = varConstraint.getSolverVariable();\n \t\t\t\t\tassertTrue(svar.hasLPVariable());\n \t\t\t\t\t\n \t\t\t\t\tassertEquals(1, varConstraint.getRHS());\n \t\t\t\t\tnExpectedTerms = svar.getNumberOfValidAssignments();\n \t\t\t\t\t\n \t\t\t\t\tlpVar = svar.getLPVarIndex();\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tLPFactorMarginalConstraint factorConstraint = constraint.asFactorConstraint();\n \t\t\t\t\tassertNotNull(factorConstraint);\n \t\t\t\t\tassertNull(constraint.asVariableConstraint());\n \t\t\t\t\t\n \t\t\t\t\tSTableFactor sfactor = factorConstraint.getSolverFactor();\n \t\t\t\t\tlpVar = sfactor.getLPVarIndex();\n \t\t\t\t\t\n \t\t\t\t\tassertEquals(0, factorConstraint.getRHS());\n \t\t\t\t\tnExpectedTerms = sfactor.getNumberOfValidAssignments();\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tint[] lpvars = constraint.getVariables();\n \t\t\t\tassertEquals(constraint.size(), lpvars.length);\n \t\t\t\tassertEquals(0, constraint.getCoefficient(-1));\n \t\t\t\tassertEquals(0, constraint.getCoefficient(lpVar + nExpectedTerms));\n \t\t\t\tassertFalse(constraint.hasCoefficient(-1));\n \t\t\t\t\n \t\t\t\tassertTrue(lpVar >= 0);\n \n \t\t\t\tIntegerEquation.TermIterator constraintTermIter = constraint.getTerms();\n \t\t\t\tfor (int i = 0; constraintTermIter.advance(); ++i)\n \t\t\t\t{\n \t\t\t\t\tassertEquals(lpvars[i], constraintTermIter.getVariable());\n \t\t\t\t\tassertEquals(constraintTermIter.getCoefficient(), constraint.getCoefficient(lpvars[i]));\n \t\t\t\t\tassertTrue(constraint.hasCoefficient(lpvars[i]));\n \t\t\t\t\tconstraintTerms.add(row);\n \t\t\t\t\tconstraintTerms.add(constraintTermIter.getVariable());\n \t\t\t\t\tconstraintTerms.add(constraintTermIter.getCoefficient());\n \t\t\t\t}\n \t\t\t\tassertFalse(constraintTermIter.advance());\n \t\t\t}\n \t\t\t\n \t\t\tfor (int i = 0; termIter.advance(); i += 3)\n \t\t\t{\n \t\t\t\tassertEquals((int)constraintTerms.get(i), termIter.getRow());\n \t\t\t\tassertEquals(constraintTerms.get(i+1) + 1, termIter.getVariable());\n \t\t\t\tassertEquals((int)constraintTerms.get(i+2), termIter.getCoefficient());\n \t\t\t}\n \t\t\tassertFalse(termIter.advance());\n \t\t}\n \t\t\n \t\t\n \t\tif (expectedConstraints != null)\n \t\t{\n \t\t\tIterator<IntegerEquation> constraintIter = constraints.iterator();\n \t\t\tassertEquals(expectedConstraints.length, solver.getNumberOfConstraints());\n \t\t\tfor (int i = 0, end = expectedConstraints.length; i < end; ++i)\n \t\t\t{\n \t\t\t\tByteArrayOutputStream out = new ByteArrayOutputStream();\n \t\t\t\tIntegerEquation constraint = constraintIter.next();\n \t\t\t\tconstraint.print(new PrintStream(out));\n \t\t\t\tString actual = out.toString().trim();\n \n \t\t\t\tString expected = expectedConstraints[i].trim();\n \n \t\t\t\tif (!expected.equals(actual))\n \t\t\t\t{\n \t\t\t\t\tSystem.out.format(\"Constraint %d mismatch:\\n\", i);\n \t\t\t\t\tSystem.out.format(\"Expected: %s\\n\", expected);\n \t\t\t\t\tSystem.out.format(\" Actual: %s\\n\", actual);\n \t\t\t\t}\n \t\t\t\tassertEquals(expected, actual);\n \t\t\t}\n \t\t}\n \t\t\n \t\t// Test setting solution. A real solution will only use ones and zeros,\n \t\t// but we will use random values to make sure they are assigned correctly.\n \t\tdouble[] solution = new double[nLPVars];\n \t\tRandom rand = new Random();\n \t\tfor (int i = solution.length; --i>=0;)\n \t\t{\n \t\t\tsolution[i] = rand.nextDouble();\n \t\t}\n \t\tsolver.setSolution(solution);\n \t\tfor (VariableBase var : model.getVariables())\n \t\t{\n \t\t\tSVariable svar = solver.getSolverVariable(var);\n \t\t\tdouble[] belief = svar.getBelief();\n \t\t\tif (svar.hasFixedValue())\n \t\t\t{\n \t\t\t\tint vali = svar.getValueIndex();\n \t\t\t\tfor (int i = belief.length; --i>=0;)\n \t\t\t\t{\n \t\t\t\t\tif (i == vali)\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(1.0, belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t\telse\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(0.0, belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\tfor (int i = svar.getModelObject().getDomain().size(); --i>=0;)\n \t\t\t\t{\n \t\t\t\t\tint lpVar = svar.domainIndexToLPVar(i);\n \t\t\t\t\tif (lpVar < 0)\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(0, belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t\telse\n \t\t\t\t\t{\n \t\t\t\t\t\tassertEquals(solution[lpVar], belief[i], 1e-6);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \t\tsolver.clearLPState();\n \t\tassertInitialState();\n \t}", "public VariableUnit solve() {\n LinkedList<VariableUnit> processor = new LinkedList<VariableUnit>();\n\n VariableUnit vu1 = new VariableUnit(250.0, 'x');\n VariableUnit vu2 = new VariableUnit('+');\n VariableUnit vu3 = new VariableUnit(250.0, 'x');\n VariableUnit vu4 = new VariableUnit(501.0, 'x');\n VariableUnit vu5 = new VariableUnit('y');\n VariableUnit vu6 = new VariableUnit('-');\n alpha_arr.get(('x' - 'a')).addLast(vu1);\n alpha_arr.get(('x' - 'a')).addLast(vu2);\n alpha_arr.get(('x' - 'a')).addLast(vu3);\n op_order.add(vu1); op_order.add(vu2); op_order.add(vu3); op_order.add(vu6);\n op_order.add(vu4); op_order.add(vu6); op_order.add(vu5);\n assignValue(2.0, 'x');\n \n System.out.print(vu1); System.out.print(vu2); System.out.print(vu3);\n System.out.print(vu6); System.out.print(vu4); System.out.print(vu6);\n System.out.print(vu5);\n System.out.println();\n System.out.println(\"------------------------------\");\n \n VariableUnit temp, temp1;\n for (int i = 0; i < op_order.size(); i++) {\n \ttemp = op_order.pollFirst();\n \t\n \t\tswitch (temp.getVariable()) {\n \tcase '+':\n \t\t//if processor.isEmpty(): throw an exception\n \t\ttemp1 = processor.pop().add(op_order.pollFirst());\n \t\tprocessor.push(temp1);\n \t\tbreak;\n \tcase '-':\n \t\t//if processor.isEmpty(): throw an exception\n \t\ttemp1 = processor.pop().subtract(op_order.pollFirst());\n \t\tprocessor.push(temp1);\n \t\tbreak;\n \tdefault:\n \t\tprocessor.push(temp);\n \t\t}\n }\n\n /*\n * System.out.println(\"This equation is currently unsolvable.\");\n \tSystem.out.println(\"Try assigning values to some of the variables.\");\n */\n while (!processor.isEmpty()) {\n \top_order.addFirst(processor.pop());\n }\n \n ListIterator<VariableUnit> iter = op_order.listIterator();\n \n while ( iter.hasNext() ) {\n \tVariableUnit iter_temp = iter.next();\n \t//System.out.print(iter_temp.hasValue());\n \tif (iter_temp.hasValue()) {\n \t\tSystem.out.print( Double.toString(iter_temp.subValue()) );\n \t}\n \telse {\n \t\tSystem.out.print(iter_temp);\n \t}\n };\n System.out.println();\n \n return new VariableUnit(Double.NaN, ' ');\n }", "public void model() \n\t{\n\t\t\n\t\ttry \n\t\t{\n\t\t GRBEnv env = new GRBEnv();\n\t\t GRBModel model = new GRBModel(env, \"resources/students.lp\");\n\n\t\t model.optimize();\n\n\t\t int optimstatus = model.get(GRB.IntAttr.Status);\n\n\t\t if (optimstatus == GRB.Status.INF_OR_UNBD) {\n\t\t model.getEnv().set(GRB.IntParam.Presolve, 0);\n\t\t model.optimize();\n\t\t optimstatus = model.get(GRB.IntAttr.Status);\n\t\t }\n\n\t\t if (optimstatus == GRB.Status.OPTIMAL) {\n\t\t double objval = model.get(GRB.DoubleAttr.ObjVal);\n\t\t System.out.println(\"Optimal objective: \" + objval);\n\t\t } else if (optimstatus == GRB.Status.INFEASIBLE) {\n\t\t System.out.println(\"Model is infeasible\");\n\n\t\t // Compute and write out IIS\n\t\t model.computeIIS();\n\t\t model.write(\"model.ilp\");\n\t\t } else if (optimstatus == GRB.Status.UNBOUNDED) {\n\t\t System.out.println(\"Model is unbounded\");\n\t\t } else {\n\t\t System.out.println(\"Optimization was stopped with status = \"\n\t\t + optimstatus);\n\t\t }\n\n\t\t // Dispose of model and environment\n\t\t model.write(\"resources/model.sol\");\n\t\t model.dispose();\n\t\t env.dispose();\n\n\t\t } catch (GRBException e) {\n\t\t System.out.println(\"Error code: \" + e.getErrorCode() + \". \" +\n\t\t e.getMessage());\n\t\t }\n\t\t\n\t}", "public MoveWrapper minimax(GameBoardState gameState, int depth, MoveWrapper alpha, MoveWrapper beta,\n\t\t\tboolean maximizingPlayer) {\n\n\t\tMoveWrapper maxEval = new MoveWrapper(gameState.getLeadingMove(), Integer.MIN_VALUE); // -infinity\n\n\t\tif (gameState.isTerminal() || AgentController.getAvailableMoves(gameState, playerTurn).isEmpty() || depth == 0) {\n\t\t\tnodesExamined++;\n\t\t\tmaxEval.setMoveReward((int) AgentController.getGameEvaluation(gameState, playerTurn));\n//\t\t\tSystem.out.println(\"in terminal statement \" + maxEval.getMoveReward());\n\t\t\treturn maxEval;\n\t\t}\n\n\t\tif (maximizingPlayer) {\n\n\t\t\tfor (ObjectiveWrapper move : AgentController.getAvailableMoves(gameState, playerTurn)) {\n\t\t\t\tMoveWrapper eval = minimax(AgentController.getNewState(gameState, move), depth - 1, alpha, beta, false);\n\n\t\t\t\tif (eval.getMoveReward() > maxEval.getMoveReward()) { \n\t\t\t\t\tmaxEval.setObjectiveInformation(move);\n\t\t\t\t\tmaxEval.setMoveReward(eval.getMoveReward());\n//\t\t\t\t\tSystem.out.println(\"Player: \" + playerTurn + \"Maximizing - Depth: \" + depth + \", eval value: \" + eval.getMoveReward() + \", maxEval value: \" + maxEval.getMoveReward());\n\t\t\t\t}\n\n\t\t\t\t// alpha beta pruning\n\t\t\t\t if (eval != null && alpha.compareTo(eval) < 0) {\n\t\t\t\t alpha = eval;\n\t\t\t\t }\n\t\t\t\t\n\t\t\t\t if (beta.compareTo(alpha) <= 0) {\n\t\t\t\t prunedCounter++;\n\t\t\t\t break;\n\t\t\t\t }\n\t\t\t}\n\t\t\treturn maxEval;\n\n\t\t} else {\n\t\t\tMoveWrapper minEval = new MoveWrapper(gameState.getLeadingMove(), Integer.MAX_VALUE); // +infinity\n\n\t\t\tfor (ObjectiveWrapper move : AgentController.getAvailableMoves(gameState, GameTreeUtility.getCounterPlayer(playerTurn))) {\n\t\t\t\tMoveWrapper eval = minimax(AgentController.getNewState(gameState, move), depth - 1, alpha, beta, true);\n\n\t\t\t\tif (eval.getMoveReward() < minEval.getMoveReward()) { \n\t\t\t\t\tminEval.setObjectiveInformation(move);\n\t\t\t\t\tminEval.setMoveReward(eval.getMoveReward());\n//\t\t\t\t\tSystem.out.println(\"Player: \" + playerTurn + \"Minimizing - Depth: \" + depth + \", eval value: \" + eval.getMoveReward() + \", minEval value: \" + minEval.getMoveReward());\n\t\t\t\t}\n\n\t\t\t\t// alpha beta pruning\n\t\t\t\t if (eval != null && beta.compareTo(eval) > 0) {\n\t\t\t\t beta = eval;\n\t\t\t\t }\n\t\t\t\t if (beta.compareTo(alpha) <= 0) {\n\t\t\t\t prunedCounter++;\n\t\t\t\t break;\n\t\t\t\t }\n\t\t\t}\n\t\t\treturn minEval;\n\t\t}\n\n\t}", "@Override\n\tpublic Solution<TTPVariable> run(SingleObjectiveThiefProblem thief, IEvaluator evaluator, MyRandom rand) {\n\t\tTTPVariable var = TTPVariable.create(new TourOptimalFactory(thief).next(rand), Pack.empty());\n\t\tSolution<TTPVariable> currentBest = thief.evaluate(var);\n\t\t\n\n\t\twhile (evaluator.hasNext()) {\n\n\t\t\t// now take the tour and optimize packing plan\n\t\t\tSolution<Pack> nextPack = optPack(thief, evaluator, rand, currentBest.getVariable().getTour(), currentBest.getVariable().getPack());\n\t\t\t\n\t\t\tSolution<Tour> nextTour = optTour(thief, evaluator, rand, currentBest.getVariable().getTour(), nextPack.getVariable());\n\t\t\t\n\t\t\tTTPVariable next = TTPVariable.create(nextTour.getVariable(), nextPack.getVariable());\n\t\t\tSolution<TTPVariable> s = thief.evaluate(next);\n\t\t\t\n\t\t\t//System.out.println(nextPack);\n\t\t\t//System.out.println(currentBest);\n\t\t\t//System.out.println(\"----------------\");\n\t\t\t\n\t\t\t// update the best found solution\n\t\t\tif (SolutionDominator.isDominating(s, currentBest)) {\n\t\t\t\tcurrentBest = s;\n\t\t\t\t//System.out.println(\"YES\");\n\t\t\t}\n\t\t\tevaluator.notify(currentBest);\n\n\t\t}\n\n\t\treturn currentBest;\n\t}", "public void buildInitialBand()\r\n\t{\n\t\r\n\tint bl = boundary.size();\r\n\tfor(int i=0; i<bl; i++) \r\n\t\t{\r\n\t\tInt2d bCur = boundary.get(i);\r\n\t\t//System.out.println(bCur.x + \", \" + bCur.y + \": size = \" + heap.size());\r\n\t\t\r\n\t\ttestPointsAround(bCur.x,bCur.y);\r\n\t\t}\r\n\t\r\n\t}", "@Override\n public void updateIndividualObjectivesAndConstraints(\n OptimizationProblem problem,\n Individual individual) {\n double[] x = individual.real;\n // Number of design variables\n int n = x.length;\n // number of objectives\n int m = problem.objectives.length;\n // (g) calculations\n double summation = 0;\n for (int i = m - 1; i < n; i++) {\n summation += Math.pow(x[i] - 0.5, 2);\n }\n double g = summation;\n // Create objective functions\n for (int i = 0; i < m; i++) {\n double objValue = 1 + g;\n for (int j = 0; j < m - i - 1; j++) {\n objValue *= Math.cos(Math.pow(x[j], ALPHA) * Math.PI / 2);\n }\n if (i != 0) {\n objValue *= Math.sin(Math.pow(x[m - i - 1], ALPHA)\n * Math.PI / 2);\n }\n individual.setObjective(i, objValue);\n }\n // Announce that objective function values are valid\n individual.validObjectiveFunctionsValues = true;\n // Update constraint violations if constraints exist\n if (problem.constraints != null) {\n // In C3-DTLZ4, the number of constraints is equal to the number of\n // objectives\n double[] constraints = new double[problem.objectives.length];\n for (int j = 0; j < constraints.length; j++) {\n constraints[j] = Math.pow(individual.getObjective(j), 2)\n / 4 - 1;\n for (int i = 0; i < problem.objectives.length; i++) {\n if (i != j) {\n constraints[j]\n += Math.pow(individual.getObjective(i), 2);\n }\n }\n }\n // Set constraints vilations\n for (int i = 0; i < constraints.length; i++) {\n if (constraints[i] < 0) {\n individual.setConstraintViolation(i, constraints[i]);\n } else {\n individual.setConstraintViolation(i, 0);\n }\n }\n // Announce that objective function values are valid\n individual.validConstraintsViolationValues = true;\n }\n // Increase Evaluations Count by One (counted per individual)\n funEvaCount++;\n }", "private int optimize() {\n\t\t// items: Items sorted by value-to-weight ratio for linear relaxation\n\t\t// t: the decision vector being tested at each node\n\t\t// ws, vs, is, bs: stacks of weight, value, item id, whether bring item\n\t\t// p: stack pointer; i, b, weight, value: loop caches; best: max search\n\t\t// ss: stack size: Always <=2 children on stack for <=n-1 parents\n\t\tItem[] items = new Item[n];\n\t\tint ss = 2 * n;\n\t\tint[] itemsSorted = new int[n], t = new int[n], ws = new int[ss],\n\t\t\tvs = new int[ss], is = new int[ss], bs = new int[ss];\n\t\tint i, b, weight, value, best = 0, p = 0;\n\n\t\tfor (int j = 0; j < n; j++)\n\t\t\titems[j] = new Item(j);\n\t\tArrays.sort(items);\n\t\tfor (int j = 0; j < n; j++)\n\t\t\titemsSorted[j] = items[j].i();\n\t\titems = null; // For garbage collection.\n\n\t\t// Push item 0 onto the stack with and without bringing it.\n\t\tws[p] = 0; vs[p] = 0; is[p] = 0; bs[p] = 1; p++;\n\t\tws[p] = 0; vs[p] = 0; is[p] = 0; bs[p] = 0; p++;\n\n\t\twhile (p > 0) {\n\t\t\tp--; // Pop the latest item off the stack\n\t\t\ti = is[p]; b = bs[p];\n\t\t\tweight = ws[p] + w[i] * b;\n\t\t\tif (weight > k)\n\t\t\t\tcontinue;\n\t\t\tvalue = vs[p] + v[i] * b;\n\t\t\tif (bound(i, weight, value, itemsSorted) < best)\n\t\t\t\tcontinue;\n\t\t\tbest = Math.max(value, best);\n\t\t\tt[i] = b;\n\t\t\tif (i < n - 1) { // Push children onto stack w/ & w/o bringing item\n\t\t\t\tws[p] = weight; vs[p] = value; is[p] = i + 1; bs[p] = 1; p++;\n\t\t\t\tws[p] = weight; vs[p] = value; is[p] = i + 1; bs[p] = 0; p++;\n\t\t\t}\n\t\t\telse if (value >= best)\n\t\t\t\tSystem.arraycopy(t, 0, x, 0, n);\n\t\t}\n\t\treturn best;\n\t}", "private int getLowerBound(Object problem, int upperbound)\n {\n Graph tsp = (Graph)problem;\n if (weight == null)\n weight = new double[tsp.size()];\n hki = new HeldKarpIterative( tsp, included, includedT, excluded, excludedT, iterations, weight, upperbound);\n hki.compute();\n tour = hki.isTour();\n bound = hki.getBound();\n hasRun = true;\n// System.out.println(hki.debugDump());\n return bound;\n }", "public Collection<Stmt> branches() {\n if(branches_computed) {\n return branches_value;\n }\n ASTNode$State state = state();\n int num = state.boundariesCrossed;\n boolean isFinal = this.is$Final();\n branches_value = branches_compute();\n if (isFinal && num == state().boundariesCrossed) {\n branches_computed = true;\n } else {\n }\n\n return branches_value;\n }", "public boolean label(IntVar[] vars) {\r\n\r\n\r\n //System.out.println(\"ct \" + vars.length);\r\n count++;\r\n if (trace) {\r\n for (int i = 0; i < vars.length; i++)\r\n System.out.print (vars[i] + \" \");\r\n System.out.println ();\r\n }\r\n\r\n ChoicePoint choice = null;\r\n boolean consistent;\r\n\r\n // Instead of imposing constraint just restrict bounds\r\n // -1 since costValue is the cost of last solution\r\n if (costVariable != null) {\r\n try {\r\n if (costVariable.min() <= costValue - 1)\r\n costVariable.domain.in(store.level, costVariable, costVariable.min(), costValue - 1);\r\n else\r\n return false;\r\n } catch (FailException f) {\r\n return false;\r\n }\r\n }\r\n\r\n consistent = store.consistency();\r\n\r\n if (!consistent) {\r\n // Failed leaf of the search tree\r\n return false;\r\n } else { // consistent\r\n\r\n if (vars.length == 0) {\r\n // solution found; no more variables to label\r\n\r\n // update cost if minimization\r\n if (costVariable != null)\r\n costValue = costVariable.min();\r\n\r\n reportSolution();\r\n\r\n return costVariable == null; // true is satisfiability search and false if minimization\r\n }\r\n\r\n choice = new ChoicePoint(vars);\r\n\r\n levelUp();\r\n\r\n store.impose(choice.getConstraint());\r\n\r\n // choice point imposed.\r\n\r\n consistent = label(choice.getSearchVariables());\r\n\r\n if (consistent) {\r\n levelDown();\r\n return true;\r\n } else {\r\n\r\n restoreLevel();\r\n store.impose(new Not(choice.getConstraint()));\r\n\r\n\r\n\r\n // negated choice point imposed.\r\n\r\n consistent = label(vars);\r\n\r\n levelDown();\r\n\r\n if (consistent) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n }\r\n }", "public SolutionType getBestSolution();", "R visitBoundVariable(Formula f, int deBruijnIdx);", "public abstract double[] getMinimumValues(List<AbstractObjective> objectives, List<? extends Solution<?>> solutions) ;", "@Test\n\tpublic void testGA() {\n\t\tGenetic ga = new Genetic(100, 500, 10, SelectionType.TOURNAMENT , 0.6, 0.1);\n\t\tOptimumSolution os = ga.run();\n\t\tSystem.out.println(os.getSolution());\n\t}", "private void findSmallestCost() {\n int best = 0;\n fx = funFitness[0];\n for (int i = 1; i < population; i++) {\n if (funFitness[i] < fx) {\n fx = funFitness[i];\n best = i;\n }\n }\n //System.arraycopy(currentPopulation[best], 0, bestSolution, 0, dimension);\n copy(bestSolution, currentPopulation[best]);\n }", "public <V extends DataType<V>> int argmin(\r\n \t\tCostFunction<V> costFunction,\t\tPlanCostFunction<V> localCostFunction,\r\n\t\t\tList<Plan<V>> choices, \t\t\t\tV constant, \r\n\t\t\tdouble alpha,\t\t\t\t\t\tdouble beta,\r\n\t\t\tdouble discomfortSumConstant,\t\tdouble discomfortSumSqrConstant,\t\r\n\t\t\tint numAgents, \t\t\t\t\t\tMultiObjectiveIEPOSAgent agent) {\r\n\r\n\t\tdouble[] costs = new double[choices.size()];\r\n\t\tdouble[] discomfortSums = new double[choices.size()];\r\n\t\tdouble[] discomfortSumSqrs = new double[choices.size()];\r\n\r\n\t\tIntStream.range(0, choices.size()).forEach(i -> {\r\n\t\t\tV combined;\r\n\t\t\tif(constant != null) {\r\n\t\t\t\tcombined = constant.cloneThis();\r\n\t\t\t\tcombined.add(choices.get(i).getValue());\r\n\t\t\t} else {\r\n\t\t\t\tcombined = choices.get(i).getValue();\r\n\t\t\t}\r\n\t\t\tdouble cost = costFunction.calcCost(combined);\r\n\r\n\t\t\tcosts[i] = cost;\r\n\t\t\tdouble score = localCostFunction.calcCost(choices.get(i));\r\n\t\t\tdiscomfortSums[i] = discomfortSumConstant + score;\r\n\t\t\tdiscomfortSumSqrs[i] = discomfortSumSqrConstant + score*score;\r\n\t\t\t//System.out.print(\"agent: \" + agent.getPeer().getIndexNumber() + \", SumConst = \" + discomfortSumConstant + \", Sum2const = \" + discomfortSumSqrConstant);\r\n\t\t\t//System.out.println(\"Sum is \" + discomfortSums[i] + \", sum^2 is \" + discomfortSumSqrs[i] + \", num agents = \" + numAgents);\r\n\t\t});\r\n\r\n\t\treturn this.extendedOptimization(costs, alpha, beta, discomfortSums, discomfortSumSqrs, numAgents);\r\n\r\n }", "public Binh2Penalty() {\n setNumberOfVariables(2);\n setNumberOfObjectives(2);\n setNumberOfConstraints(2);\n setName(\"Binh2Penalty\");\n alpha = 2.0;\n lamda = 0.1;\n lamdaM = 1/getNumberOfConstraints();\n\n List<Double> lowerLimit = Arrays.asList(0.0, 0.0) ;\n List<Double> upperLimit = Arrays.asList(5.0, 3.0) ;\n\n setLowerLimit(lowerLimit);\n setUpperLimit(upperLimit);\n\n overallConstraintViolationDegree = new OverallConstraintViolation<DoubleSolution>() ;\n numberOfViolatedConstraints = new NumberOfViolatedConstraints<DoubleSolution>() ;\n }", "public boolean runSolver()\n {\n Variable current = getUnassignedVar();\n\n if (current == null)\n {\n return true;\n }\n\n for (int i = 0; i < current.getDomain().size(); i++)\n {\n List<Integer> oldDomain = current.getDomain();\n int newval = oldDomain.get(i);\n current.setValue(newval);\n current.setDomain(i);\n\n if (constraintsSatisfied(constraintsWithAnyVals()))\n {\n if (runSolver())\n {\n return true;\n }\n }\n\n current.setDomain(oldDomain);\n current.setValue(current.getPrevious()); \n }\n return false;\n }", "public Solver(Board initial) {\r\n if (initial == null) throw new IllegalArgumentException();\r\n\r\n\r\n SearchNode initialAdjacent = new SearchNode(initial.twin(), null, 0);\r\n MinPQ<SearchNode> adjacentPriorityQueue = new MinPQ<>(1);\r\n adjacentPriorityQueue.insert(initialAdjacent);\r\n\r\n\r\n SearchNode initialNode = new SearchNode(initial, null, 0);\r\n MinPQ<SearchNode> priorityQueue = new MinPQ<>(1);\r\n priorityQueue.insert(initialNode);\r\n\r\n if (initial.isGoal()) {\r\n goal = initialNode;\r\n isSolvable = true;\r\n return;\r\n } else if (initialAdjacent.board.isGoal()) {\r\n isSolvable = false;\r\n }\r\n\r\n\r\n SearchNode currentAdjacent = initialAdjacent;\r\n SearchNode currentBoard = initialNode;\r\n\r\n while (!currentAdjacent.board.isGoal() && !currentBoard.board.isGoal()) {\r\n\r\n currentAdjacent = adjacentPriorityQueue.delMin();\r\n currentBoard = priorityQueue.delMin();\r\n\r\n for (Board adjacentNeighbor : currentAdjacent.board.neighbors()) {\r\n SearchNode toBeInserted = new SearchNode(adjacentNeighbor, currentAdjacent, currentAdjacent.previousMoves + 1);\r\n if (currentAdjacent.previousSearchNode == null || !toBeInserted.board.equals(currentAdjacent.previousSearchNode.board)) {\r\n adjacentPriorityQueue.insert(toBeInserted);\r\n }\r\n }\r\n\r\n\r\n for (Board neighbor : currentBoard.board.neighbors()) {\r\n SearchNode toBeInserted = new SearchNode(neighbor, currentBoard, currentBoard.previousMoves + 1);\r\n if (currentBoard.previousSearchNode == null || !toBeInserted.board.equals(currentBoard.previousSearchNode.board)) {\r\n\r\n priorityQueue.insert(toBeInserted);\r\n }\r\n }\r\n }\r\n if (currentAdjacent.board.isGoal()) {\r\n isSolvable = false;\r\n goal = initialNode;\r\n } else {\r\n goal = currentBoard;\r\n isSolvable = true;\r\n }\r\n\r\n }", "public interface ObjectiveFunctionI {\n public void setData(chromosome chromosome1, int indexOfObjective);\n public void setOriginalSolution(chromosome originalChromosome);\n\n public void setFirstImplement(boolean firstImplement);\n public void calcObjective();\n public chromosome getchromosome();\n //public double[] getObjectiveValues(int index);\n //public double getMinObjectiveValue();\n //public double getMaxObjectiveValue();\n}", "double getSolutionCost();", "@Override\n public Variable useHeuristic(Deque<Variable> deque) {\n Variable highDomain = deque.getFirst();\n for (Variable var : deque){\n if (var.getDomain().size() > highDomain.getDomain().size()){\n highDomain = var;\n }\n }\n return highDomain;\n }", "public void test4_b_parametric() { // Schedule found: (m + 1)i + j + (-m - 2)\n\t\t/* RelTrafo1: (i, j) - (i, j - 1) = (0, 1)\n\t\t * RelTrafo2: (i, j) - (i - 1, j + m) = (1, -m)\n\t\t * (m + 1) - m + (-m - 2) = -m - 1\n\t\t *//*\n\t\tGDGraph gdGraph = new GDGraph();\n\t\tGDGVertex gdVertex = gdGraph.addVertex();\n\t\tGDGEdge gdEdge1 = gdGraph.addEdge(gdVertex, gdVertex);\n\t\tGDGEdge gdEdge2 = gdGraph.addEdge(gdVertex, gdVertex);\n\n\t\tgdEdge1.dataDependence = convertIntTableToAffineTrafoRational(new int[][]{ // (i, j - 1) \n\t\t\t\t{ 1, 0, 0, 0},\n\t\t\t\t{ 0, 1, 0, -1},\n\t\t\t\t{ 0, 0, 0, 1}\n });\n\t\tgdEdge1.producedDomain = convertIntTableToPIPDRational(new int[][]{ // (0..+inf, 1..+inf)\n\t\t\t\t{ 1, 0, 0, 0},\n\t\t\t\t{ 0, 1, 0, -1}\n\t\t}, new int[][]{\n\t\t\t\t{ 1, 0}\n\t\t});\n\n\t\tgdEdge2.dataDependence = convertIntTableToAffineTrafoRational(new int[][]{ // (i - 1, j + m) \n\t\t\t\t{ 1, 0, 0, -1},\n\t\t\t\t{ 0, 1, 1, 0},\n\t\t\t\t{ 0, 0, 0, 1}\n });\t\t\n\t\tgdEdge2.producedDomain = convertIntTableToPIPDRational(new int[][]{ // (1..+inf, 0..+inf)\n\t\t\t\t{ 1, 0, 0, -1},\n\t\t\t\t{ 0, 1, 0, 0}\n\t\t}, new int[][]{\n\t\t\t\t{ 1, 0}\n\t\t});\n\n\t\tgdVertex.computationDomain = convertIntTableToPIPDRational(new int[][]{ // (1..+inf, 1..+inf)\n\t\t\t\t{ 1, 0, 0, -1},\n\t\t\t\t{ 0, 1, 0, -1}\n\t\t}, new int[][]{\n\t\t\t\t{ 1, 0}\n\t\t});\n\t\t\n\t\tgdGraph.calculateFeautrierSchedule(true, true);\n\t\n\t\tgdGraph.<Rational>codeGeneration(Rational.ZERO, Rational.ONE);\n\t*/}", "public abstract double getConstraintFitness();", "public Decision planBest(Context context, Decision defaultDecision);", "public double constrainDemand(double slope, double trialprice)\r\n/* */ {\r\n\t\t\t\tlogger.info(count++ + \" About to constrainDemand : \" + \"Agent\");\r\n/* 175 */ if (this.demand > 0.0D) {\r\n/* 176 */ if (this.demand * trialprice > this.cash - this.mincash)\r\n/* */ {\r\n/* 178 */ if (this.cash - this.mincash > 0.0D) {\r\n/* 179 */ this.demand = ((this.cash - this.mincash) / trialprice);\r\n/* 180 */ slope = -this.demand / trialprice;\r\n/* */ }\r\n/* */ else\r\n/* */ {\r\n/* 184 */ this.demand = 0.0D;\r\n/* 185 */ slope = 0.0D;\r\n/* */ }\r\n/* */ \r\n/* */ }\r\n/* */ \r\n/* */ \r\n/* */ }\r\n/* 192 */ else if ((this.demand < 0.0D) && (this.demand + this.position < this.minholding))\r\n/* */ {\r\n/* */ \r\n/* 195 */ this.demand = (this.minholding - this.position);\r\n/* 196 */ slope = 0.0D;\r\n/* */ }\r\n/* */ \r\n/* */ \r\n/* 200 */ return this.demand;\r\n/* */ }", "@Test\n public void solveTest5() throws ContradictionException {\n\n Set<ConstraintInfo> constraints = new HashSet<>();\n Set<Position> vars = new HashSet<>();\n Position[] varArr = new Position[]{\n this.grid.getVariable(0, 6),\n this.grid.getVariable(1, 6),\n this.grid.getVariable(2, 6),\n this.grid.getVariable(3, 6),\n this.grid.getVariable(4, 6),\n this.grid.getVariable(5, 6),\n this.grid.getVariable(6, 6),\n this.grid.getVariable(7, 6),\n this.grid.getVariable(7, 5),\n this.grid.getVariable(7, 4),\n this.grid.getVariable(7, 3),\n this.grid.getVariable(7, 2),\n this.grid.getVariable(6, 2),\n this.grid.getVariable(5, 2),\n this.grid.getVariable(5, 1),\n this.grid.getVariable(5, 0)\n };\n vars.addAll(Arrays.asList(varArr));\n ArrayList<Set<Position>> cArr = new ArrayList<>();\n for (int i = 0; i < 14; i++) cArr.add(new HashSet<>());\n add(cArr.get(0), varArr[0], varArr[1]);\n add(cArr.get(1), varArr[0], varArr[1], varArr[2]);\n add(cArr.get(2), varArr[3], varArr[1], varArr[2]);\n add(cArr.get(3), varArr[3], varArr[4], varArr[2]);\n add(cArr.get(4), varArr[3], varArr[4], varArr[5]);\n add(cArr.get(5), varArr[6], varArr[4], varArr[5]);\n add(cArr.get(6), varArr[6], varArr[7], varArr[5], varArr[8], varArr[9]);\n add(cArr.get(7), varArr[8], varArr[9], varArr[10]);\n add(cArr.get(8), varArr[9], varArr[10], varArr[11], varArr[12], varArr[13]);\n add(cArr.get(9), varArr[12], varArr[13]);\n add(cArr.get(10), varArr[13]);\n add(cArr.get(11), varArr[13], varArr[14]);\n add(cArr.get(12), varArr[13], varArr[14], varArr[15]);\n add(cArr.get(13), varArr[14], varArr[15]);\n\n int[] cVal = new int[] { 1,2,2,1,1,1,2,1,2,1,1,2,3,2 };\n for (int i = 0; i < 14; i++) {\n constraints.add(new ConstraintInfo(cArr.get(i), cVal[i]));\n }\n\n MSModel model = new MSModel(constraints, vars);\n\n Set<Position> expectedBombs = new HashSet<>();\n expectedBombs.addAll(Arrays.asList(\n this.grid.getVariable(1, 6),\n this.grid.getVariable(2, 6),\n this.grid.getVariable(5, 6),\n this.grid.getVariable(5, 0),\n this.grid.getVariable(5, 1),\n this.grid.getVariable(5, 2)\n ));\n Set<Position> expectedNoBombs = new HashSet<>();\n expectedNoBombs.addAll(Arrays.asList(\n this.grid.getVariable(6,2),\n this.grid.getVariable(0,6),\n this.grid.getVariable(3,6),\n this.grid.getVariable(4,6),\n this.grid.getVariable(6,6)\n ));\n\n for (Position pos : vars) {\n if (expectedBombs.contains(pos)) {\n assertTrue(model.hasBomb(pos));\n } else {\n assertFalse(model.hasBomb(pos));\n }\n\n if (expectedNoBombs.contains(pos)) {\n assertTrue(model.hasNoBombs(pos));\n } else {\n assertFalse(model.hasNoBombs(pos));\n }\n }\n\n /*\n 00002x???\n 00003x???\n 00002xxx?\n 0000112x?\n 0000001x?\n 1221112x?\n xxxxxxxx?\n ?????????\n */\n }", "public Solver(final Board initial) {\n\n Node solutionNodeTwin; // Solution node twin\n MinPQ<Node> thePQ; // Minimum priority queue\n MinPQ<Node> thePQTwin; // Minimum priority queue for the twin\n boolean initialSolvableTwin = false; // is initial twin board solvable\n\n solutionNode = new Node();\n solutionNodeTwin = new Node();\n\n solutionNode.theBoard = initial;\n solutionNodeTwin.theBoard = initial.twin();\n\n solutionNode.previousNode = null;\n solutionNodeTwin.previousNode = null;\n\n thePQ = new MinPQ<>(boardOrder());\n thePQTwin = new MinPQ<>(boardOrder());\n\n thePQ.insert(solutionNode);\n thePQTwin.insert(solutionNodeTwin);\n solutionBoards = new Queue<>();\n\n int count = 0;\n while (!solutionNode.theBoard.isGoal()\n || !solutionNodeTwin.theBoard.isGoal()) {\n\n solutionNode = thePQ.delMin();\n solutionBoards.enqueue(solutionNode.theBoard);\n\n if (solutionNode.theBoard.isGoal()) {\n initialSolvable = true;\n break;\n } else {\n solutionNode.numberOfMovesMade++;\n Iterable<Board> neighborBoards = solutionNode.theBoard.neighbors();\n Iterator<Board> itr = neighborBoards.iterator();\n while (itr.hasNext()) {\n Node neighborNode = new Node();\n neighborNode.theBoard = itr.next();\n neighborNode.numberOfMovesMade = solutionNode.numberOfMovesMade;\n neighborNode.previousNode = solutionNode;\n if (count == 0) {\n thePQ.insert((neighborNode));\n } else if (!neighborNode.theBoard.equals(solutionNode\n .previousNode.theBoard)) {\n thePQ.insert(neighborNode);\n }\n }\n }\n\n solutionNodeTwin = thePQTwin.delMin();\n if (solutionNodeTwin.theBoard.isGoal()) {\n initialSolvableTwin = true;\n break;\n } else {\n solutionNodeTwin.numberOfMovesMade++;\n Iterable<Board> neighborBoardsTwin = solutionNodeTwin.theBoard.neighbors();\n Iterator<Board> itr2 = neighborBoardsTwin.iterator();\n while (itr2.hasNext()) {\n Node neighborNodeTwin = new Node();\n neighborNodeTwin.theBoard = itr2.next();\n neighborNodeTwin.numberOfMovesMade = solutionNodeTwin.numberOfMovesMade;\n neighborNodeTwin.previousNode = solutionNodeTwin;\n if (count == 0) {\n thePQTwin.insert(neighborNodeTwin);\n } else if (!neighborNodeTwin.theBoard.equals(solutionNodeTwin.previousNode.theBoard)) {\n thePQTwin.insert(neighborNodeTwin);\n }\n }\n }\n count++;\n }\n }", "public void changeConstraintsToMoreThan() throws IloException {\n /*\n IloRange notes:\n for expr == rhs, set lb = ub = rhs\n for expr <= rhs, set lb = -infinity and ub = rhs\n for expr >= rhs, set lb = rhs and ub = infinity\n */\n for (int i = 0; i < matrix.getNrows(); i++) {\n IloRange rangedExpression = matrix.getRange(i);\n if (rangedExpression.getLB() <= Double.NEGATIVE_INFINITY) {\n rangedExpression.setBounds(-rangedExpression.getLB(), Double.POSITIVE_INFINITY);\n for (int j = 0; j < matrix.getNrows(); j++) {\n matrix.setNZ(i, j, -matrix.getNZ(i, j));\n }\n }\n }\n }", "Model minimize(Model model);", "private Pair<Double, String> alphaBeta(Othello o, double alpha, double beta, int depth, \n\t\t\tboolean maximisingPlayer) {\n\t \n\t // End if depth is 0 or no more moves\n\t if (depth == 0 || o.getState() != State.NONE) {\n\t return new Pair<Double, String>(eval(o), null);\n\t }\n\t \n\t String bestMove = null;\n\t Pair<String[], Othello[]> children = getChildren(o);\n\t \n\t // Max player\n\t if (maximisingPlayer) {\n\t \tdouble v = -Double.MAX_VALUE;\n\t for (int i = 0; i < children.first.length; i++) {\n\t double childValue = alphaBeta(children.second[i], alpha, beta, depth-1, false).first;\n\t if (v < childValue || (v == childValue && bestMove == null)) {\n\t \tv = childValue;\n\t \tbestMove = children.first[i];\n\t }\n\t alpha = Math.max(alpha, v);\n\t if (beta <= alpha) {\n\t break;\n\t }\n\t }\n\t return new Pair<Double, String>(v, bestMove);\n\t }\n\t \n\t // Min player\n\t else {\n\t \tdouble v = Double.MAX_VALUE;\n\t for (int i = 0; i < children.first.length; i++) {\n\t double childValue = alphaBeta(children.second[i], alpha, beta, depth-1, true).first;\n\t if (v > childValue || (v == childValue && bestMove == null)) {\n\t \tv = childValue;\n\t \tbestMove = children.first[i];\n\t }\n\t beta = Math.min(beta, v);\n\t if (beta <= alpha) {\n\t break;\n\t }\n\t }\n\t return new Pair<Double, String>(v, bestMove);\n\t }\n\t}", "public Solution solve(KnapsackData data);", "public MarkovDecisionProcess(int totalWorkloadLevel, int totalGreenEnergyLevel, int totalBatteryLevel, double prob[][][][], int maxTimeInterval) {\r\n\t\tthis.totalWorkloadLevel = totalWorkloadLevel;\r\n\t\tthis.totalGreenEnergyLevel = totalGreenEnergyLevel;\r\n\t\tthis.totalBatteryLevel = totalBatteryLevel;\r\n\t\tthis.prob = prob;\r\n\t\tthis.maxTimeInterval = maxTimeInterval;\r\n\t\t\r\n\t\t//Initial State, we set it at [0,0,0]\r\n\t\tinitialState = new State(0, 0, 0, 1, -999, -1);\r\n\t\tinitialState.setPath(initialState.toString());\r\n\t\t\r\n\t\tgrid = new State[maxTimeInterval][totalWorkloadLevel][totalGreenEnergyLevel][totalBatteryLevel]; \r\n\t\t\r\n\t\t//initialize the reward matix as all 0\r\n\t\trewardMatrix = new double[maxTimeInterval][totalWorkloadLevel*totalGreenEnergyLevel][totalWorkloadLevel*totalGreenEnergyLevel];\r\n\t\tbatteryLevelMatrix = new int[maxTimeInterval][totalWorkloadLevel*totalGreenEnergyLevel][totalWorkloadLevel*totalGreenEnergyLevel];\r\n\t\tactionMatrix = new String[maxTimeInterval][totalWorkloadLevel*totalGreenEnergyLevel][totalWorkloadLevel*totalGreenEnergyLevel];\r\n\t\tfor(int i = 0; i < maxTimeInterval; i++) {\r\n\t\t\tfor(int j = 0; j < totalWorkloadLevel*totalGreenEnergyLevel; j++) {\r\n\t\t\t\tfor(int k = 0; k < totalWorkloadLevel*totalGreenEnergyLevel; k++) {\r\n\t\t\t\t\trewardMatrix[i][j][k] = 0.0;\r\n\t\t\t\t\tbatteryLevelMatrix[i][j][k] = 0;\r\n\t\t\t\t\tactionMatrix[i][j][k] = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\r\n\t\t//Initialize actions space, \r\n\t\tnumActions = totalWorkloadLevel * totalBatteryLevel;\r\n\t\t\r\n\t\tfor(int t =0; t < maxTimeInterval; t++) {\r\n\t\tfor(int i = 0; i < totalWorkloadLevel; i++) {\r\n\t\t\tfor(int j = 0; j < totalGreenEnergyLevel; j++) {\r\n\t\t\t\tfor(int k = 0; k < totalBatteryLevel; k++) {\r\n\t\t\t\t\tgrid[t][i][j][k] = new State(i ,j, k, prob[t][i][j][k], 0.0, t);\r\n\t\t\t\t\tif( t == maxTimeInterval - 1) {\r\n\t\t\t\t\t\tgrid[t][i][j][k].setTerminate();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t}\t\r\n\t\treachableStates = new Vector(totalWorkloadLevel*totalGreenEnergyLevel*totalBatteryLevel);\r\n\t\t\t\r\n\t}", "private int minValue(Node state, int alpha, int beta) {\n\t\t\n\t\tthis.nodesExplored++;\n\t\tthis.nodesExploredThisTurn++;\n\t\t\n\t\tif (this.cutoffTest(state)) {\n\t\t\treturn state.eval(this.player);\n\t\t}\n\t\t\n\t\t\n\t\tArrayList<Move> legalMoves = state.getGame().getLegalMoves();\n\t\t\n\t\tif (this.moveOrdering) {\n\t\t\tthis.quickSort(state, legalMoves, 0, legalMoves.size() - 1, true);\n\t\t}\n\t\t\n\t\tint v = Integer.MAX_VALUE;\n\t\tMove bestMove = null;\n\t\tfor (Move move : legalMoves) {\n\n\t\t\tif (System.currentTimeMillis() - startMili > this.maxTime * 1000)\n\t\t\t\treturn 0;\n\t\t\t\n\t\t\tint value = this.maxValue(state.result(move), alpha, beta);\n\t\t\tif (v > value) { //\n\t\t\t\tv = value;\n\t\t\t\tbestMove = move;\n\t\t\t}\n\n\t\t\tif (v <= alpha) {\n\t\t\t\tstate.setBestMove(bestMove);\n\t\t\t\treturn v;\n\t\t\t}\n\t\t\tbeta = Math.min(v, beta);\n\t\t}\n\t\tstate.setBestMove(bestMove);\n\t\treturn v;\n\t}", "public Solver(WorldState initial) {\n solution = new ArrayList<>();\n\n // create a priority queue of search nodes\n MinPQ<SNode> pq = new MinPQ<>();\n\n // insert an “initial search node” into the priority queue\n SNode start = new SNode(initial, 0, null);\n pq.insert(start);\n\n // If the search node with minimum priority is the goal node, then we’re done.\n while (!pq.min().ws.isGoal()) {\n\n // Remove the search node with minimum priority.\n SNode X = pq.delMin();\n\n // for each neighbor of X’s world state, create a new search node and\n // insert it into the priority queue.\n for (WorldState nb: X.ws.neighbors()) {\n\n // critical optimization\n if (X.prev == null || !(nb.equals(X.prev.ws))) {\n SNode nbNode = new SNode(nb, X.numberOfMove + 1, X);\n pq.insert(nbNode);\n }\n }\n }\n\n // generate the solution\n SNode goal = pq.min();\n while (goal != null) {\n solution.add(0, goal.ws);\n goal = goal.prev;\n }\n }", "public abstract double getHeuristic(State state);", "private double bound(int iter, Solution next) {\n return Math.exp((-1.0 * (next.getValue() - bestSol.getValue())) / denominator(iter));\n }", "abstract AbstractTree<T> maximize();", "private void setObjective() throws IloException{\n\n IloLinearNumExpr expr = this.cplex.linearNumExpr();\n int i = 0;\n for(IloNumVar xi : x){\n expr.addTerm(xi, this.c[i]);\n i++;\n }\n this.objective = this.cplex.addMinimize(expr);\n }", "public interface Solver {\n void solve(Grid grid);\n}", "public void solve() {\n// BruteForceSolver bfs = new BruteForceSolver(pointList);\n// bfs.solve(); // prints the best polygon, its area, and time needed\n// System.out.println(\"-------------\");\n\n// StarshapedSolver ss = new StarshapedSolver(pointList);\n// foundPolygons = ss.solve();\n// System.out.println(\"-------------\");\n\n// RandomAddPointHeuristic ra = new RandomAddPointHeuristic(pointList);\n// foundPolygons = ra.solve(750);\n// System.out.println(\"-------------\");\n\n// GreedyAddPointHeuristic ga = new GreedyAddPointHeuristic(pointList,false);\n// foundPolygons = ga.solve(750);\n// System.out.println(\"-------------\");\n\n// long time = 4000;\n// GreedyAddPointHeuristic gaInit = new GreedyAddPointHeuristic(pointList,false);\n// Polygon2D initSolution = gaInit.solve(time*1/4).get(0);\n// System.out.println(initSolution.area);\n// System.out.println(initSolution);\n//\n// SimulatedAnnealing sa = new SimulatedAnnealing(pointList,initSolution,3);\n// foundPolygons.addAll(sa.solve(time-gaInit.timeInit,2,0.005,0.95));\n// System.out.println(sa.maxPolygon);\n// System.out.println(\"-------------\");\n\n// foundPolygons.addAll(findMultiplePolygonsStarshaped(8,0.6));\n\n }", "public Solver(Board initial) {\n \tsolutionNode = null;\n \tpq = new MinPQ<>();\n \tpq.insert(new SearchNode(initial, null, 0));\n\n \twhile (true) {\n \t\tSearchNode currNode = pq.delMin();\n\t \tBoard currBoard = currNode.getBoard();\n\n\t \tif (currBoard.isGoal()) {\n\t \t\tisSolvable = true;\n\t \t\tsolutionNode = currNode;\n\t \t\tbreak;\n\t \t}\n\n\t \tif (currBoard.hamming() == 2 && currBoard.twin().isGoal()) {\n\t \t\tisSolvable = false;\n\t \t\tbreak;\n\t \t}\n\n\t \tint moves = currNode.getMoves();\n\t \tBoard prevBoard = moves > 0 ? currNode.prev().getBoard() : null;\n\t \tfor (Board nextBoard : currBoard.neighbors()) {\n\t \t\tif (nextBoard != null && nextBoard.equals(prevBoard)) {\n\t \t\t\tcontinue;\n\t \t\t}\n\t \t\tpq.insert(new SearchNode(nextBoard, currNode, moves + 1));\n\t \t}\n \t}\n \t\n }", "private void branch01(Node parent) {\n final GeneralLP lp0 = parent.lp;\n final int v = intVars[parent.level];\n Maths.CnF cf = new Maths.CnF(lp0.x[v - 1]);\n\n double[][] a2 = Arrays.copyOf(lp0.a, lp0.m);\n double[] bLeft = lp0.b; // left branch\n double[] bRight = Arrays.copyOf(lp0.b, lp0.m); // right branch\n double[] c2 = Arrays.copyOf(lp0.c, lp0.n);\n double c0Right = lp0.c0 + lp0.c[v - 1]; // c0Left unchanged\n branch01Arguments(c2, a2, bRight, lp0, v);\n\n // LP1: left branch (=0)\n LOG.debug(parent, \"left branch x(\", v, \") =\", 0);\n GeneralLP lp1 = new GeneralLP(lp0.objectiveType, lp0.c0, c2, a2, lp0.signs, bLeft, lp0.freeVars);\n Node child1 = new Node(lp1, parent, Node.LEFT).binary(v);\n nodes.addLast(child1);\n\n // LP2: right branch (=1)\n LOG.debug(parent, \"right branch x(\", v, \") =\", 1);\n GeneralLP lp2 = new GeneralLP(lp0.objectiveType, c0Right, c2, a2, lp0.signs, bRight, lp0.freeVars);\n Node child2 = new Node(lp2, parent, Node.RIGHT).binary(v);\n nodes.addLast(child2);\n\n parent.lp = null; // release memory\n }", "public Object eval(Individual ind)\r\n {\r\n BinaryIndividual bi = (BinaryIndividual)ind;\r\n int partialFitness = 0;\r\n int distance = 0;\r\n double fitness = 0.0;\r\n\r\n\t for (int i=0; i<100; i++){\r\n\r\n\t distance = 0;\r\n\r\n\t for (int j=0; j<100; j++){\r\n\t if (!((BinaryIndividual)target[i]).getBooleanAllele(j)^bi.getBooleanAllele(j)) { \r\n\t\t distance++;\r\n\t }\r\n \r\n\t if (distance > partialFitness) {\r\n\t partialFitness = distance;\r\n\t }\r\n\t }\r\n }\r\n\r\n fitness = (double)partialFitness/100.0;\r\n return new Double(fitness);\r\n \r\n\r\n }", "public BranchAndBound() {\n this.timeFi = Long.parseLong(\"2000000000000\");;\n this.numSoluciones = 0;\n }", "public void solution() {\n\t\t\n\t}", "public abstract double evaluer(SolutionPartielle s);", "public final void setObjectiveOptimal(boolean objectiveOptimal) {\n this.objectiveOptimal = objectiveOptimal;\n }", "@Override\n\tpublic List<Component> caseExprBinary(ExprBinary expr) {\n\t\tint sizeInBits = assignTarget.getVariable().getType().getSizeInBits();\n\t\t// Get the Variables\n\t\tVar e1 = ((ExprVar) expr.getE1()).getUse().getVariable();\n\t\tVar e2 = ((ExprVar) expr.getE2()).getUse().getVariable();\n\t\tList<Var> inVars = new ArrayList<Var>();\n\t\tinVars.add(e1);\n\t\tinVars.add(e2);\n\t\t// Component component = null;\n\t\tif (expr.getOp() == OpBinary.BITAND) {\n\t\t\tcurrentComponent = new AndOp();\n\t\t} else if (expr.getOp() == OpBinary.BITOR) {\n\t\t\tcurrentComponent = new OrOp();\n\t\t} else if (expr.getOp() == OpBinary.BITXOR) {\n\t\t\tcurrentComponent = new XorOp();\n\t\t} else if (expr.getOp() == OpBinary.DIV) {\n\t\t\tcurrentComponent = new DivideOp(sizeInBits);\n\t\t} else if (expr.getOp() == OpBinary.DIV_INT) {\n\t\t\tcurrentComponent = new DivideOp(sizeInBits);\n\t\t} else if (expr.getOp() == OpBinary.EQ) {\n\t\t\tcurrentComponent = new EqualsOp();\n\t\t} else if (expr.getOp() == OpBinary.GE) {\n\t\t\tcurrentComponent = new GreaterThanEqualToOp();\n\t\t} else if (expr.getOp() == OpBinary.GT) {\n\t\t\tcurrentComponent = new GreaterThanOp();\n\t\t} else if (expr.getOp() == OpBinary.LE) {\n\t\t\tcurrentComponent = new LessThanEqualToOp();\n\t\t} else if (expr.getOp() == OpBinary.LOGIC_AND) {\n\t\t\tcurrentComponent = new And(2);\n\t\t} else if (expr.getOp() == OpBinary.LOGIC_OR) {\n\t\t\tcurrentComponent = new Or(2);\n\t\t} else if (expr.getOp() == OpBinary.LT) {\n\t\t\tcurrentComponent = new LessThanOp();\n\t\t} else if (expr.getOp() == OpBinary.MINUS) {\n\t\t\tcurrentComponent = new SubtractOp();\n\t\t} else if (expr.getOp() == OpBinary.MOD) {\n\t\t\tcurrentComponent = new ModuloOp();\n\t\t} else if (expr.getOp() == OpBinary.NE) {\n\t\t\tcurrentComponent = new NotEqualsOp();\n\t\t} else if (expr.getOp() == OpBinary.PLUS) {\n\t\t\tcurrentComponent = new AddOp();\n\t\t} else if (expr.getOp() == OpBinary.SHIFT_LEFT) {\n\t\t\tint log2N = MathStuff.log2(sizeInBits);\n\t\t\tcurrentComponent = new LeftShiftOp(log2N);\n\t\t} else if (expr.getOp() == OpBinary.SHIFT_RIGHT) {\n\t\t\tint log2N = MathStuff.log2(sizeInBits);\n\t\t\tcurrentComponent = new RightShiftOp(log2N);\n\t\t} else if (expr.getOp() == OpBinary.TIMES) {\n\t\t\tcurrentComponent = new MultiplyOp(expr.getType().getSizeInBits());\n\t\t}\n\t\t// currentComponent.setNonRemovable();\n\t\tPortUtil.mapInDataPorts(currentComponent, inVars, portDependency,\n\t\t\t\tportGroupDependency);\n\t\treturn null;\n\t}", "public void setObjective(Variable v) {\r\n\t\tobjective = v;\r\n\t\tif (v != null) {\r\n\t\t\tadd(v);\r\n\t\t}\r\n\t}", "public Solver(Board initial) {\r\n this.board = initial;\r\n\r\n final Comparator<SearchNode> solverComparator = new Comparator<SearchNode>() {\r\n @Override\r\n public int compare(SearchNode o1, SearchNode o2) {\r\n return o1.weight() - o2.weight();\r\n }\r\n };\r\n MinPQ<SearchNode> pq = new MinPQ<SearchNode>(solverComparator);\r\n MinPQ<SearchNode> twinPq = new MinPQ<SearchNode>(solverComparator);\r\n\r\n pq.insert(new SearchNode(board, null, 0));\r\n twinPq.insert(new SearchNode(board.twin(), null, 0));\r\n do {\r\n SearchNode current = pq.delMin();\r\n SearchNode twin = twinPq.delMin();\r\n\r\n //solution.enqueue(current.getBoard());\r\n if (!current.getBoard().isGoal()) {\r\n for (Board neighbour : current.getBoard().neighbors()) {\r\n if (current.getParent() == null || current.getParent() != null && !neighbour.equals(current.getParent().getBoard())) {\r\n pq.insert(new SearchNode(neighbour, current, current.moves() + 1));\r\n }\r\n }\r\n } else {\r\n solution = new LinkedStack<Board>();\r\n SearchNode node = current;\r\n while (node != null) {\r\n solution.push(node.getBoard());\r\n node = node.getParent();\r\n }\r\n break;\r\n }\r\n\r\n if (!twin.getBoard().isGoal()) {\r\n for (Board neighbour : twin.getBoard().neighbors()) {\r\n if (twin.getParent() == null || twin.getParent() != null && !neighbour.equals(twin.getParent().getBoard())) {\r\n twinPq.insert(new SearchNode(neighbour, twin, twin.moves() + 1));\r\n }\r\n }\r\n } else {\r\n break;\r\n }\r\n } while (!pq.isEmpty() || !twinPq.isEmpty());\r\n }", "public void solveSA() {\r\n initState();\r\n for (int ab = 0; ab < Config.NumberOfMetropolisResets; ab++) {\r\n LogTool.print(\"==================== INACTIVE: START CALC FOR OUTER ROUND \" + ab + \"=========================\",\"notification\");\r\n\r\n if (Config.SAverboselvl>1) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\");\r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n }\r\n setCur_cost(costCURsuperfinal()); //One of four possible costNEX variants\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"CUR COST SUPER FINAL \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n /* [Newstate] with random dwelltimes */\r\n New_state = newstater(); \r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"NEW STATE \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n// newstater();\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"SolveSA: New State before Metropolis: A)\" + New_state[0] + \" B) \" + New_state[1] + \" C) \" + New_state[2],\"notification\");\r\n }\r\n \r\n setNew_cost(costNEXsuperfinal()); //One of four possible costNEX variants\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"NEW COST SUPER FINAL \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"SolveSA: New Cost : \" + New_cost,\"notification\");\r\n }\r\n\r\n /**\r\n * MetropolisLoop\r\n * @param Config.NumberOfMetropolisRounds\r\n */\r\n\r\n for(int x=0;x<Config.NumberOfMetropolisRounds;x++) { \r\n LogTool.print(\"SolveSA Iteration \" + x + \" Curcost \" + Cur_cost + \" Newcost \" + New_cost,\"notification\");\r\n if ((Cur_cost - New_cost)>0) { // ? die Kosten\r\n \r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 1 START\",\"notification\");\r\n }\r\n \r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: (Fall 1) Metropolis NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1) Metropolis CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA Cost delta \" + (Cur_cost - New_cost) + \" \",\"notification\");\r\n //</editor-fold>\r\n }\r\n Cur_state = New_state;\r\n Cur_cost = New_cost;\r\n if (Config.SAverboselvl>1) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: (Fall 1 nach set) Metropolis NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set) Metropolis CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set): NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set): CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n New_state = newstater();\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C1 after generate: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 1 STOP \",\"notification\");\r\n }\r\n } else if (Math.exp(-(New_cost - Cur_cost)/temperature)> RandGenerator.randDouble(0.01, 0.99)) {\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 2 START: Zufallsgenerierter Zustand traegt hoehere Kosten als vorhergehender Zustand. Iteration: \" + x,\"notification\");\r\n }\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 before set: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n Cur_state = New_state;\r\n Cur_cost = New_cost;\r\n \r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 after set: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after set: CurCost : \" + this.getCur_cost(),\"notification\");\r\n //</editor-fold>\r\n }\r\n New_state = newstater();\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 after generate: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 2 STOP: Zufallsgenerierter Zustand traegt hoehere Kosten als vorhergehender Zustand. Iteration: \" + x,\"notification\");\r\n }\r\n } else {\r\n New_state = newstater();\r\n }\r\n temperature = temperature-1;\r\n if (temperature==0) {\r\n break;\r\n }\r\n \r\n setNew_cost(costNEXsuperfinal());\r\n LogTool.print(\"NEW COST SUPER FINAL \",\"notification\");\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n//</editor-fold>\r\n if ((x==58)&(ab==0)) {\r\n LogTool.print(\"Last internal Iteration Checkpoint\",\"notification\");\r\n if ((Cur_cost - New_cost)>0) {\r\n Cur_state = New_state;\r\n Cur_cost = New_cost; \r\n }\r\n }\r\n if ((x>58)&(ab==0)) {\r\n LogTool.print(\"Last internal Iteration Checkpoint\",\"notification\");\r\n }\r\n }\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"Auskommentierter GLowestState Object Class\">\r\n// if (ab==9) {\r\n// double diff=0;\r\n// }\r\n \r\n // Hier wird kontrolliert, ob das minimalergebnis des aktuellen\r\n // Metropolisloops kleiner ist als das bsiher kleinste\r\n \r\n// if (Cur_cost<Global_lowest_cost) {\r\n// this.setGlobal_lowest_cost(Cur_cost);\r\n// GlobalState GLowestState = new GlobalState(this.Cur_state);\r\n// String rGLSOvalue = GLowestState.getGlobal_Lowest_state_string();\r\n// LogTool.print(\"GLS DEDICATED OBJECT STATE OUTPUT -- \" + GLowestState.getGlobal_Lowest_state_string(),\"notification\");\r\n// this.setGlobal_Lowest_state(GLowestState.getDwelltimes());\r\n // LogTool.print(\"READ FROM OBJECT OUTPUT -- \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n// LogTool.print(\"DEBUG: CurCost direct : \" + this.getCur_cost(),\"notification\"); \r\n// LogTool.print(\"Debug: Cur<global CurState get : \" + this.getCur_state_string(),\"notification\");\r\n// LogTool.print(\"Debug: Cur<global GLS get : \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n// this.setGlobal_Lowest_state(this.getCur_state(Cur_state));\r\n// LogTool.print(\"Debug: Cur<global GLS get after set : \" + this.getGlobal_Lowest_state_string(),\"notification\"); \r\n// }\r\n //</editor-fold>\r\n LogTool.print(\"SolveSA: Outer Iteration : \" + ab,\"notification\");\r\n LogTool.print(\"SolveSA: Last Calculated New State/Possible state inner loop (i.e. 99) : \" + this.getNew_state_string(),\"notification\");\r\n// LogTool.print(\"SolveSA: Best Solution : \" + this.getCur_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: GLS after all loops: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: LastNewCost, unchecked : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: CurCost : \" + this.getCur_cost() + \"i.e. lowest State of this round\",\"notification\"); \r\n }\r\n // return GLowestState;\r\n }", "public CollisionArea_SingleCirc getOptimalCollisionArea();", "public Solver(Board initial) {\n\t\tgoal = null;\n\t\tminpq = new MinPQ<Solver.SearchNode>();\n\t\tminpqTwin = new MinPQ<SearchNode>();\n\t\tcheck = new HashMap<String, Integer>();\n\t\tcheckTwin = new HashMap<String, Integer>();\n\t\t\n\t\tminpq.insert(new SearchNode(initial, null));\n\t\tminpqTwin.insert(new SearchNode(initial.twin(), null));\n\t\t\n\t\tcheck.put(initial.toString(), 1);\n\t\tcheckTwin.put(initial.twin().toString(), 1);\n\t\t\n\t\t//StdOut.println(\"Hamming =\" + initial.hamming());\n\t\t//StdOut.println(\"Manhattan =\" + initial.manhattan());\n\t\t//StdOut.println(\"Original:\\n\" + initial.toString());\n\t\t//StdOut.println(\"Twin:\\n\" + initial.twin().toString());\n\t\t\n\t\tSearchNode minNode = minpq.delMin();\n\t\tSearchNode minNodeTwin = minpqTwin.delMin();\n\t\t\n\t\twhile (true) {\n\t\t\t\n\t\t\tif (minNode.getBoard().isGoal()) {\n\t\t\t\tgoal = minNode;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (minNodeTwin.getBoard().isGoal()) {\n\t\t\t\tgoal = null;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tpushNodes(minNode, minpq, check);\n\t\t\tpushNodes(minNodeTwin, minpqTwin, checkTwin);\n\t\t\t\n\t\t\tminNode = minpq.delMin();\n\t\t\tminNodeTwin = minpqTwin.delMin();\n\t\t}\n\t}", "public interface MiniMaxState extends State {\r\n\t/**\r\n\t * Determine if this state is a state in which MAX acts (we, as opposed to\r\n\t * the opponent that we have no control over).\r\n\t * \r\n\t * @return true if MAX acts, false if opponent acts\r\n\t */\r\n\tpublic boolean isMaxState();\r\n\r\n\t/**\r\n\t * Determine the \"utility\" of the state, is usually called when a\r\n\t * terminating state is visited. Should be a positive value (not exceeding\r\n\t * +9999999) if we're doing well, a negative value (not below -9999999) if\r\n\t * we're doing badly.\r\n\t * \r\n\t * @return the utility of the state\r\n\t */\r\n\tpublic double utility();\r\n\r\n}", "static void testAProblem(Problem aProblem,Problem optimisedSortProblem){\n\t\t\t\tIndividual originalIndividual = new Individual(aProblem);\n\t\t\t\t//Individual.initialise(originalIndividual.ourProblem.getStrings());\n\t\t\t\toriginalIndividual.gpMaterial.printAll();\n\t\t\t\tIndividualEvaluator indEval = new ByteCodeIndividualEvaluator();\n\t\t\t\tindEval.evaluateIndNoTimeLimit(originalIndividual); // This is our reference individual\n\t\t\t\toriginalIndividual.ourProblem.setBaselineRuntimeAvg(originalIndividual.getRuntimeAvg());\n\t\t\t\t\n\t\t\t\t// create a variant to compare against\n\t\t\t\t//Problem optimisedSortProblem = new Sort1Optimised();\n\t\t\t\tIndividual sortVariant = new Individual(originalIndividual, optimisedSortProblem,null);\n\t\t\t\tindEval.evaluateIndNoTimeLimit(sortVariant);\n\t\t\t\tSystem.out.println(\"Variant \"+sortVariant +\" \"+ sortVariant.getFunctionalityErrorCount()+\" \"+ sortVariant.getRuntimeAvg());\n\t\t\t\tSystem.out.println(\"timeratio: \" + sortVariant.getTimeFitnessRatio()+ \" correctness \"+ sortVariant.getCorrectness());\n\t\t\t\tSystem.out.println(\"Fitness \" + sortVariant.getFitness()+\"\\n\");\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t *\t9 May 2014 (commented out 15 Jan 2015)\n\t\t\t\t * Added to test multithreaded evaluation,\n\t\t\t\t * create a generation of individuals, then evaluate the lot. \n\t\t\t\t * (not needed, bug found in multi-threaded eval, due to programs accessing static methods when collecting results\n\t\t\t\t */\n\t\t\t\t/*for ( int i = 1 ; i < 100 ; i++){\n\t\t\t\t\toptimisedSortProblem = new Sort1Optimised();\n\t\t\t\t\tsortVariant = new Individual(originalIndividual, optimisedSortProblem,null);\n\t\t\t\t\tindEval.evaluateIndNoTimeLimit(sortVariant);\n\t\t\t\t\tSystem.out.println(\"Variant \"+sortVariant +\" \"+ sortVariant.getFunctionalityScore()+\" \"+ sortVariant.getRuntimeAvg());\n\t\t\t\t\tSystem.out.println(\"timeratio: \" + sortVariant.getTimeFitnessRatio()+ \" correctness \"+ sortVariant.getCorrectness());\n\t\t\t\t\tSystem.out.println(\"Fitness \" + sortVariant.getFitness()+\"\\n\");\n\t\t\t\t}*/\n\t}", "public Behaviour runObjective() {\n //System.out.println(\"Simulation runObjective(): running method\");\n final int iterations = config.getSimulationIterations();\n return objectiveSimulation(iterations);\n }", "public interface Strategy {\n\n StrategySolution solve(List<Item> items, int weight);\n}", "@Override\n\tpublic AbstractValue greatestLowerBound(AbstractValue d) {\n\t\tif ( !(d instanceof Interval) )\n\t\t\tthrow new IllegalArgumentException(\"v should be of type Interval\");\n\t\tInterval i = (Interval) d;\n\n\t\tif (i.isBottom())\n\t\t\treturn i;\n\t\telse if (i.equals(top))\n\t\t\treturn this;\n\n\t\tString newLow = \"-Inf\", newHigh = \"+Inf\";\n\n\t\t//Calcolare limite inferiore\n\n\t\tif ( this.getLow().equals(\"-Inf\")){\n\t\t\tif( !i.getLow().equals(\"-Inf\"))\n\t\t\t\tif(Integer.parseInt(this.getHigh()) > Integer.parseInt(i.getLow()))\n\t\t\t\t\tnewLow = String.valueOf(Integer.max(Integer.parseInt(this.getLow()), Integer.parseInt(i.getLow())));\n\t\t\t\telse\n\t\t\t\t\treturn BottomAV.getInstance();\n\t\t}else if ( i.getLow().equals(\"-Inf\")){\n\t\t\tif( !this.getLow().equals(\"-Inf\"))\n\t\t\t\tif(Integer.parseInt(i.getHigh()) > Integer.parseInt(this.getLow()))\n\t\t\t\t\tnewLow = String.valueOf(Integer.max(Integer.parseInt(i.getLow()), Integer.parseInt(this.getLow())));\n\t\t\t\telse\n\t\t\t\t\treturn BottomAV.getInstance();\n\t\t}else if(!this.getLow().equals(\"-Inf\") && !i.getLow().equals(\"-Inf\")){\n\t\t\tnewLow = String.valueOf(Integer.max(Integer.parseInt(this.getLow()), Integer.parseInt(i.getLow())));\n\t\t}\n\n\t\t// Calcolare limite superiore\n\n\t\tif ( this.getHigh().equals(\"+Inf\")) {\n\t\t\tif (!i.getHigh().equals(\"+Inf\"))\n\t\t\t\tnewHigh = i.getHigh();\n\t\t}else if ( i.getHigh().equals(\"+Inf\")) {\n\t\t\tif (!this.getHigh().equals(\"+Inf\"))\n\t\t\t\tnewHigh = this.getHigh();\n\t\t}else if(!this.getHigh().equals(\"+Inf\") && !i.getHigh().equals(\"+Inf\")){\n\t\t\tnewHigh = String.valueOf(Integer.min(Integer.parseInt(this.getHigh()), Integer.parseInt(i.getHigh())));\n\t\t}\n\n\t\tInterval res = new Interval(newLow, newHigh);\n\n\t\t// Checks whether low > high\n\t\tif ((!newLow.equals(\"-Inf\") && (!newHigh.equals(\"+Inf\")) && Integer.parseInt(newLow) > Integer.parseInt(newHigh)))\n\t\t\treturn BottomAV.getInstance();\n\n\t\treturn amItop() ? top : res;\n\t}", "@Test\r\n\tpublic void calculLostPointsByOneRuleBetweenMaxMinTest() {\r\n\t\tAssert.assertEquals(UtilCalculGrade.calculLostPointsByOneRule(new ModelValue(1f, 0.5f, 4f), new Integer(3)),\r\n\t\t\t\tnew Float(1.5));\r\n\t}", "private int alphaBetaMinimax (GameTreeNode node, int alpha, int beta, boolean isMax, Map<GameTreeNode, Integer> visited) {\n\n if(node.remaining == 0) {\n //System.out.println(\"Terminal State: Up : Score \" + node.score);\n return node.score;\n }\n if(visited.containsKey(node)) {\n //System.out.println(\"Memoized State: Up : Score \" + visited.get(node));\n return visited.get(node);\n }\n \n \n if(isMax) {\n int minimaxScore = Integer.MIN_VALUE;\n for(int i = 0; i < MAX_REMOVAL; i++) {\n \n GameTreeNode expandingChild = node.generateChild(1 + i);\n \n if(expandingChild == null) {\n break;\n }\n \n //System.out.println(\"Remaining \" + node.remaining + \" Down\");\n //\n minimaxScore = Math.max(minimaxScore, alphaBetaMinimax(expandingChild, alpha, beta, false, visited));\n alpha = Math.max(alpha, minimaxScore);\n //\n //System.out.println(\"Remaining \" + node.remaining + \" Up : Score: \" + minimaxScore);\n //\n if(beta <= alpha) {\n //System.out.println(\"Pruning: \" + node.remaining + \" child index \" + i+1);\n break;\n }\n }\n visited.put(node, minimaxScore);\n node.score = minimaxScore;\n return minimaxScore;\n }\n else {\n int minimaxScore = Integer.MAX_VALUE;\n for(int i = 0; i < MAX_REMOVAL; i++) {\n \n GameTreeNode expandingChild = node.generateChild(1 + i);\n if(expandingChild == null) {\n break;\n }\n //\n \n //\n //System.out.println(\"Remaining \" + node.remaining + \" Down\");\n //\n minimaxScore = Math.min(minimaxScore, alphaBetaMinimax(expandingChild, alpha, beta, true, visited));\n beta = Math.min(beta, minimaxScore);\n //\n //System.out.println(\"Remaining \" + node.remaining + \" Up : Score: \" + minimaxScore);\n //\n if(beta <= alpha) {\n //System.out.println(\"Pruning: \" + node.remaining + \" child index \" + i+1);\n break;\n }\n }\n visited.put(node, minimaxScore);\n node.score = minimaxScore;\n return minimaxScore;\n }\n }", "@Override\n \tpublic Solution solve() {\n \t\tfor (int i = 0; i < n; i++) {\n \t\t\tnest[i] = generator.getSolution();\n \t\t}\n \n \t\tfor (int t = 0; t < maxGeneration; t++) { // While (t<MaxGeneration) or\n \t\t\t\t\t\t\t\t\t\t\t\t\t// (stop criterion)\n \t\t\t// Get a cuckoo randomly (say, i) and replace its solution by\n \t\t\t// performing random operations;\n \t\t\tint i = r.nextInt(n);\n \t\t\tSolution randomNest = nest[i];\n \t\t\t//FIXME: randomNest = solutionModifier.modify(nest[i]);\n \n \t\t\t// Evaluate its quality/fitness\n \t\t\tint fi = randomNest.f();\n \n \t\t\t// Choose a nest among n (say, j) randomly;\n \t\t\tint j = r.nextInt(n);\n \t\t\tint fj = f[j];\n \n \t\t\tif (fi > fj) {\n \t\t\t\tnest[i] = randomNest;\n \t\t\t\tf[i] = fi;\n \t\t\t}\n \n \t\t\tsort();\n \t\t\t// A fraction (pa) of the worse nests are abandoned and new ones are built;\n\t\t\tfor(i = n-toAbandon; i<n; i++) {\n \t\t\t\tnest[i] = generator.getSolution();\n \t\t\t}\n \t\t\t\n \t\t\t// Rank the solutions/nests and find the current best;\n \t\t\tsort();\n \t\t}\n \n \t\treturn nest[0];\n \t}", "public interface Solver {\n public ArrayList<ArrayList<Double>> solve(double step, List<Pair<Double, Double>> init, int numberOfIterations);\n public ArrayList<ArrayList<Double>> solve(double step, List<Pair<Double, Double>> init, double max);\n}", "public Solver(Board initial) {\n if (initial == null) {\n throw new IllegalArgumentException();\n }\n\n boolean solvable = false;\n int moves = -1;\n\n MinPQ<Node> queue = new MinPQ<Node>(new NodeComparator());\n queue.insert(new Node(initial, null));\n\n MinPQ<Node> queueTwin = new MinPQ<Node>(new NodeComparator());\n queueTwin.insert(new Node(initial.twin(), null));\n\n while (true) {\n Node node = queue.delMin();\n if (node._board.isGoal()) {\n moves = node._moves;\n solvable = true;\n _node = node;\n break;\n }\n\n Node nodeTwin = queueTwin.delMin();\n if (nodeTwin._board.isGoal()) {\n _node = null;\n break;\n }\n\n insert(node, queue);\n insert(nodeTwin, queueTwin);\n }\n\n _moves = moves;\n _solvable = solvable;\n if (_solvable) {\n _solution = new Board[_moves + 1];\n Node node = _node;\n for (int i = 0; i < _moves + 1; i++) {\n _solution[i] = node._board;\n node = node._prev;\n }\n }\n else {\n _solution = null;\n }\n }", "public Solver(Board initial) {\n MinPQ<Node> minPQ = new MinPQ<>();\n\n if (initial == null) {\n throw new java.lang.IllegalArgumentException(\"Null content is not allowed.\");\n }\n //minNode = new Node(initial, null);\n inNode = new Node(initial, null);\n Node inNodetwin = new Node(initial.twin(), null);\n minPQ.insert(inNode);\n minPQ.insert(inNodetwin);\n\n minNode = minPQ.delMin();\n while (!minNode.getBoard().isGoal()) {\n for (Board board : minNode.getBoard().neighbors()) {\n if (minNode.getPrevious() == null) {\n minPQ.insert(new Node(board, minNode));\n } else if (!minNode.getPrevious().getBoard().equals(board)) {\n minPQ.insert(new Node(board, minNode));\n }\n\n }\n\n minNode = minPQ.delMin();\n }\n\n }", "List<Model> minimize(Model model, int nMinima);", "public abstract double evaluateSolution(Solution solution) throws JMException, SimulationException;", "public void affichageSolution() {\n\t\t//On commence par retirer toutes les traces pré-existantes du labyrinthe\n\t\tfor (int i = 0 ; i < this.laby.getHauteur() ; i++) {\n\t\t\tfor (int j = 0 ; j < this.laby.getLargeur() ; j++) {\n\t\t\t\tif (this.laby.getLabyrinthe()[i][j] instanceof Trace) {\n\t\t\t\t\tthis.laby.getLabyrinthe()[i][j] = new Case();\n\t\t\t\t\t((JLabel)grille.getComponents()[i*this.laby.getLargeur()+j]).setIcon(this.laby.getLabyrinthe()[i][j].imageCase(themeJeu));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//On parcourt toutes les cases du labyrinthe. Si on trouve un filon non extrait dont le chemin qui le sépare au mineur est plus petit que shortestPath, on enregistre la longueur du chemin ainsi que les coordonnees de ledit filon\n\t\tint shortestPath = Integer.MAX_VALUE;\n\t\tint[] coordsNearestFilon = {-1,-1};\n\t\tfor (int i=0 ; i < this.laby.getHauteur() ; i++) {\n\t\t\tfor (int j=0 ; j < this.laby.getLargeur() ; j++) {\n\t\t\t\tif (this.laby.getLabyrinthe()[i][j] instanceof Filon && ((Filon)this.laby.getLabyrinthe()[i][j]).getExtrait() == false) {\n\t\t\t\t\tif (this.laby.solve(j,i) != null) {\n\t\t\t\t\t\tint pathSize = this.laby.solve(j,i).size();\n\t\t\t\t\t\tif (pathSize < shortestPath) {\n\t\t\t\t\t\t\tshortestPath = pathSize;\n\t\t\t\t\t\t\tcoordsNearestFilon[0] = j;\n\t\t\t\t\t\t\tcoordsNearestFilon[1] = i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//Si il n'y a plus de filon non extrait atteignable, on cherche les coordonnes de la clef\n\t\tif (coordsNearestFilon[0] == -1) {\n\t\t\tcoordsNearestFilon = this.laby.getCoordsClef();\n\t\t\t//Si il n'y a plus de filon non extrait atteignable et que la clef a deja ouvert la porte, on cherche les coordonnes de la sortie\n\t\t\tif (coordsNearestFilon == null)\tcoordsNearestFilon = this.laby.getCoordsSortie();\n\t\t}\n\n\t\t//On cree une pile qui contient des couples de coordonnees qui correspondent a la solution, puis on depile car le dernier element est l'objectif vise\n\t\tStack<Integer[]> solution = this.laby.solve(coordsNearestFilon[0], coordsNearestFilon[1]);\n\t\tsolution.pop();\n\n\t\t//Tant que l'on n'arrive pas au premier element de la pile (cad la case ou se trouve le mineur), on depile tout en gardant l'element depile, qui contient les coordonnees d'une trace que l'on dessine en suivant dans la fenetre\n\t\twhile (solution.size() != 1) {\n\t\t\tInteger[] coordsTmp = solution.pop();\n\t\t\tTrace traceTmp = new Trace();\n\t\t\tthis.laby.getLabyrinthe()[coordsTmp[1]][coordsTmp[0]] = new Trace();\n\t\t\t((JLabel)grille.getComponents()[coordsTmp[1]*this.laby.getLargeur()+coordsTmp[0]]).setIcon(traceTmp.imageCase());\n\t\t}\n\t\tSystem.out.println(\"\\n========================================== SOLUTION =====================================\\n\");\n\t\tthis.affichageLabyrinthe();\n\t}", "@Override\n public final void solve() {\n this.flag1 = this.neo.getPosition().equals(this.goal);\n \n }", "public boolean regress (ArrayList<Integer> x, ArrayList<Long> y) { \n \tclear();\n \t\n \t// If empty or in different dimension, infeasible\n if (x == null || y == null || x.size() != y.size()) {\n \tsucc = false;\n \treturn false;\n }\n int n = x.size();\n\n // first pass: read in data, compute xbar and ybar\n double sumx = 0.0, sumy = 0.0, sumx2 = 0.0;\n for (int i = 0; i < n; i++) {\n sumx += x.get(i);\n sumx2 += x.get(i) * x.get(i);\n sumy += y.get(i);\n }\n double xbar = sumx / n;\n double ybar = sumy / n;\n\n // second pass: compute summary statistics\n double xxbar = 0.0, yybar = 0.0, xybar = 0.0;\n for (int i = 0; i < n; i++) {\n xxbar += (x.get(i) - xbar) * (x.get(i) - xbar);\n yybar += (y.get(i) - ybar) * (y.get(i) - ybar);\n xybar += (x.get(i) - xbar) * (y.get(i) - ybar);\n }\n double beta1 = xybar / xxbar;\n double beta0 = ybar - beta1 * xbar;\n\n // print results\n System.out.println(\"y = \" + beta1 + \" * x + \" + beta0);\n coef0 = beta0;\n coef1 = beta1;\n\n // analyze results\n int df = n - 2;\n double rss = 0.0; // residual sum of squares\n double ssr = 0.0; // regression sum of squares\n for (int i = 0; i < n; i++) {\n double fit = beta1*x.get(i) + beta0;\n rss += (fit - y.get(i)) * (fit - y.get(i));\n ssr += (fit - ybar) * (fit - ybar);\n }\n double R2 = ssr / yybar;\n double svar = rss / df;\n double svar1 = svar / xxbar;\n double svar0 = svar/n + xbar*xbar*svar1;\n// r2 = R2; System.out.println(\"R^2 = \" + R2);\n// System.out.println(\"std error of beta_1 = \" + Math.sqrt(svar1));\n// System.out.println(\"std error of beta_0 = \" + Math.sqrt(svar0));\n// svar0 = svar * sumx2 / (n * xxbar);\n// System.out.println(\"std error of beta_0 = \" + Math.sqrt(svar0));\n//\n// ssto = yybar; System.out.println(\"SSTO = \" + yybar);\n// sse = rss; System.out.println(\"SSE = \" + rss);\n// ssr = ssr; System.out.println(\"SSR = \" + ssr);\n \n succ = true;\n return true;\n }", "public abstract double calculatePenalty(int[] dimSpecMin, int[] dimSpecMax,\n\t\t\t\t\t\t\t\t\t\t\tBucket b);", "private void BC_bend(Grid gr){\r\n int i, j;\r\n double theta, rate, um, vm, pi=Math.PI;\r\n NSmax=(int)(30.0/dt); repL=0.1;\r\n\t\r\n // boundary conditions of lower side of computational domain\r\n for(i = 0; i<mx; i++) BClow[i]=\"wall\"; \r\n // boundary conditions on upper side \r\n for(i = 0; i<mx; i++) BCupp[i]=\"wall\";\r\n // boundary conditions on left side\r\n for(j = 0; j<my; j++) BClef[j]=\"in\";\r\n // boundary conditions of right side\r\n for(j = 0; j<my; j++) BCrig[j]=\"out\";\r\n\t\t\r\n // initial conditions; all those on other sides are zero. \r\n rate=0.5*pi/(double)(gr.mxRout-gr.mxRin); \r\n for(i = 0; i <= gr.mxRout; i++){ \r\n if(i <= gr.mxRin){ \r\n for(j = 1; j < mym; j++) \t u[i][j]=Umean;\r\n // u[i][j]=2.0*Umean*(1.0-4.0*(gr.y[1][j]+1.0)*(gr.y[1][j]+1.0)); \r\n }else{\r\n theta=rate*(double)(i-gr.mxRin);\r\n for(j = 1; j< mym; j++) u[i][j]=u[0][j]*Math.cos(theta);\r\n }\r\n }\r\n\t\t\r\n for(i = gr.mxRin+1; i < mx; i++){ \r\n if(i <= gr.mxRout){\r\n theta=rate*(double)(i-gr.mxRin);\r\n for(j = 1; j < mym; j++) v[i][j]=u[0][j]*Math.sin(theta);\r\n }else{\r\n for(j = 1; j < mym; j++) v[i][j]=u[0][j];\r\n }\r\n }\r\n }", "public static int applyMinMax(int d, BoardModel model, boolean maximizingTeam, int alpha, int beta, boolean whiteTeam, int startDepth) {\n //base case, figure out determinaion of game over\n\n // printMap(model);\n // System.out.println(\"Depth: \"+d);\n \n\n //allPossibleMoves moveTree = new allPossibleMoves();\n int[] currentQueen;\n ArrayList<int[]> whiteQueens = new ArrayList<>();\n ArrayList<int[]> blackQueens = new ArrayList<>();\n ArrayList<int[]> myQueens = new ArrayList<>();\n // possibleMove bestestMove = null;\n\n// for (int count = 0; count < model.queenPositions.size(); count++) {\n// if (model.getTile(model.queenPositions.get(count)).equals(POS_MARKED_BLACK)) {\n// blackQueens.add(model.queenPositions.get(count));\n// // System.out.println(\"Black: \"+model.getTile(model.queenPositions.get(count)));\n// } else {\n// whiteQueens.add(model.queenPositions.get(count));\n// // System.out.println(\"White: \"+model.getTile(model.queenPositions.get(count)));\n// }\n// }\n//set black and white queens \n for (int jam = 0; jam < 10; jam++) {\n for (int pb = 0; pb < 10; pb++) {\n if (model.getTile(new int[]{jam, pb}).equals(POS_MARKED_WHITE)) {\n whiteQueens.add(new int[]{jam, pb});\n }\n if (model.getTile(new int[]{jam, pb}).equals(POS_MARKED_BLACK)) {\n blackQueens.add(new int[]{jam, pb});\n }\n }\n }\n if (maximizingTeam){\n if (whiteTeam){\n myQueens = whiteQueens;\n }\n else{\n myQueens = blackQueens;\n }\n }\n if (!maximizingTeam){\n if (whiteTeam){\n myQueens = blackQueens;\n }\n else{\n myQueens = whiteQueens;\n }\n }\n \n if (d == 0 || findAllMoves(model,myQueens).isEmpty() ) {\n return baseCase(model, whiteTeam);\n }\n\n // System.out.println(\"White Queens identified as: \" + whiteQueens.get(0)[0] + \"\" + whiteQueens.get(0)[1] + \" \" + whiteQueens.get(1)[0] + whiteQueens.get(1)[1] + \" \" + whiteQueens.get(2)[0] + whiteQueens.get(2)[1] + \" \" + whiteQueens.get(3)[0] + whiteQueens.get(3)[1]);\n //if (whiteTeam) {\n // myQueens = whiteQueens;\n //} else {\n // myQueens = blackQueens;\n // }\n // perform a check to see which side we are on. \n // System.out.println(\"Status: \"+maximizingTeam);\n if (maximizingTeam) {\n // System.out.println(\"Maximizing turn\");\n if (whiteTeam) {\n myQueens = whiteQueens;\n } else {\n myQueens = blackQueens;\n }\n\n int maxEval = -1000000;\n // considering this move was played. \n\n // printMap(model);\n // System.out.println();\n //find all children from this state\n ArrayList<ArrayList<int[]>> children = findAllMoves(model, myQueens);\n if (children.size() == 0){\n return baseCase(model, whiteTeam);\n }\n if(children.size()==0 && d == startDepth){\n System.out.println(\"We Lost :( \");\n }\n // printMap(model);\n // System.out.println();\n for (int i = 0; i < children.size(); i++) {\n\n String m1 = stringMap(model);\n\n BoardModel recursionModel = new BoardModel(10);\n\n for (int jam = 0; jam < 10; jam++) {\n for (int pb = 0; pb < 10; pb++) {\n recursionModel.setTile(new int[]{jam, pb}, model.getTile(new int[]{jam, pb}));\n }\n }\n recursionModel.queenPositions = new ArrayList<>();\n for (int x = 0; x < model.queenPositions.size(); x++) {\n recursionModel.queenPositions.add(model.queenPositions.get(x));\n }\n\n // printMap(recursionModel);\n recursionModel.moveQueen(children.get(i).get(0), children.get(i).get(1));\n recursionModel.setTile(children.get(i).get(2), POS_MARKED_ARROW);\n // System.out.println(\"max recursive call\");\n int childVal = applyMinMax(d - 1, recursionModel, false, alpha, beta, whiteTeam, startDepth);\n recursionModel.moveQueen(children.get(i).get(1), children.get(i).get(0));\n recursionModel.setTile(children.get(i).get(2), POS_AVAILABLE);\n\n String m2 = stringMap(model);\n // System.out.println(\"Check board Validity Max: \"+m1.equals(m2));\n\n maxEval = max(maxEval, childVal);\n if (d == startDepth) {\n ArrayList<int[]> blah = new ArrayList<int[]>();\n blah.add(children.get(i).get(0));\n blah.add(children.get(i).get(1));\n blah.add(children.get(i).get(2));\n blah.add(new int[]{childVal});\n maxMinMoves.add(blah);\n }\n alpha = max(maxEval, alpha);\n // System.out.println(\"A: \"+alpha);\n if (alpha >= beta) {\n break;\n }\n }\n return maxEval;\n\n } else {\n // System.out.println(\"Minimizing turn\");\n if (!whiteTeam) {\n myQueens = whiteQueens;\n } else {\n myQueens = blackQueens;\n }\n\n int maxEval = 1000000;\n // considering this move was played. \n\n // printMap(model);\n // System.out.println();\n //find all children from this state\n ArrayList<ArrayList<int[]>> children = findAllMoves(model, myQueens);\n if (children.size() == 0){\n return baseCase(model, whiteTeam);\n }\n if(children.size()==0 && d == startDepth){\n System.out.println(\"We Lost :( \");\n }\n // printMap(model);\n // System.out.println();\n for (int i = 0; i < children.size(); i++) {\n\n String m1 = stringMap(model);\n\n BoardModel recursionModel = new BoardModel(10);\n\n for (int jam = 0; jam < 10; jam++) {\n for (int pb = 0; pb < 10; pb++) {\n recursionModel.setTile(new int[]{jam, pb}, model.getTile(new int[]{jam, pb}));\n }\n }\n recursionModel.queenPositions = new ArrayList<>();\n for (int x = 0; x < model.queenPositions.size(); x++) {\n recursionModel.queenPositions.add(model.queenPositions.get(x));\n }\n\n // printMap(recursionModel);\n recursionModel.moveQueen(children.get(i).get(0), children.get(i).get(1));\n recursionModel.setTile(children.get(i).get(2), POS_MARKED_ARROW);\n // System.out.println(\"min recursive call\");\n int childVal = applyMinMax(d - 1, recursionModel, true, alpha, beta, whiteTeam, startDepth);\n recursionModel.moveQueen(children.get(i).get(1), children.get(i).get(0));\n recursionModel.setTile(children.get(i).get(2), POS_AVAILABLE);\n\n String m2 = stringMap(model);\n // System.out.println(\"Check board Validity Max: \"+m1.equals(m2));\n\n maxEval = min(maxEval, childVal);\n if (d == startDepth) {\n ArrayList<int[]> blah = new ArrayList<int[]>();\n blah.add(children.get(i).get(0));\n blah.add(children.get(i).get(1));\n blah.add(children.get(i).get(2));\n blah.add(new int[]{childVal});\n maxMinMoves.add(blah);\n }\n beta = min(maxEval, alpha);\n // System.out.println(\"A: \"+alpha);\n if (alpha >= beta) {\n break;\n }\n }\n return maxEval;\n }\n\n }" ]
[ "0.6501858", "0.6393468", "0.5674571", "0.55683774", "0.55303216", "0.53782505", "0.52537394", "0.51536113", "0.5127492", "0.5117436", "0.5063634", "0.50391483", "0.5037537", "0.5014491", "0.5000715", "0.49896395", "0.4988179", "0.49822438", "0.49528265", "0.49511242", "0.49432632", "0.49431872", "0.4935811", "0.49338698", "0.49330837", "0.49325398", "0.49166086", "0.49076363", "0.49020258", "0.49000627", "0.48897013", "0.4884508", "0.48767075", "0.487046", "0.48659867", "0.4864608", "0.48558742", "0.48361295", "0.48294556", "0.48270828", "0.48237234", "0.4820239", "0.48175472", "0.47947353", "0.47796485", "0.4748824", "0.47445163", "0.47352216", "0.47334686", "0.47319335", "0.471684", "0.47079313", "0.47061914", "0.4704876", "0.47040078", "0.4700493", "0.46959266", "0.46869165", "0.46847308", "0.4682202", "0.46777546", "0.466864", "0.4667302", "0.46669874", "0.46665013", "0.46632624", "0.4659515", "0.4659178", "0.46383613", "0.46346506", "0.46345913", "0.46314037", "0.46245044", "0.4608819", "0.46082112", "0.46072614", "0.46070886", "0.46004048", "0.4598125", "0.45950758", "0.45940942", "0.4593326", "0.45931062", "0.4589069", "0.45690396", "0.45674077", "0.45632854", "0.45624182", "0.45598596", "0.45586342", "0.4547484", "0.4546793", "0.4543032", "0.45391467", "0.45356107", "0.45328054", "0.4529971", "0.45236883", "0.4521722", "0.45216328" ]
0.47076163
52
Randomly selects a variable and assigns it to a value randomly taken in the domain. This is dedicated to enumerated domains. In case some variables have bounded domains, please use random_valueOrBound instead
public static IntStrategy random_value(IntVar[] VARS, long SEED) { for (IntVar v : VARS) { if (!v.hasEnumeratedDomain()) { throw new UnsupportedOperationException("Some variables have bounded domains, " + "please use random heuristic instead"); } } return custom(random_var_selector(SEED), random_value_selector(SEED), VARS); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static VariableSelector<IntVar> random_var_selector(long SEED) {\n return new Random<>(SEED);\n }", "public static IntValueSelector random_value_selector(long SEED) {\n return new IntDomainRandom(SEED);\n }", "public static IntStrategy random_value(IntVar[] VARS) {\n return random_value(VARS, 0);\n }", "public void generateRandomVaraibles() {\r\n\r\n\t\tfor (DataVariable var : dataTestModel) {\r\n\t\t\tif (!var.getType().equals(\"LOCAL_DATA\") && !var.getType().equals(\"OUTPUT_DATA\")) {\r\n\t\t\t\tif (var.getType().equals(\"boolean\") || var.getType().equals(\"Boolean\")) {\r\n\t\t\t\t\tvar.setValue(String.valueOf(getRandomBoolean()));\r\n\r\n\t\t\t\t} else if (var.getType().equals(\"int\")) {\r\n\t\t\t\t\tif (var.getMinimumValue() != null && var.getMinimumValue().length() > 0\r\n\t\t\t\t\t\t\t&& var.getMaximumValue() != null && var.getMaximumValue().length() > 0) {\r\n\t\t\t\t\t\tvar.setValue(String.valueOf(randomInt(Integer.parseInt(var.getMinimumValue()),\r\n\t\t\t\t\t\t\t\tInteger.parseInt(var.getMaximumValue()))));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar.setValue(String.valueOf(randomInt(0, 100)));\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (var.getType().equals(\"double\")) {\r\n\t\t\t\t\tif (var.getMinimumValue() != null && var.getMinimumValue().length() > 0\r\n\t\t\t\t\t\t\t&& var.getMaximumValue() != null && var.getMaximumValue().length() > 0) {\r\n\t\t\t\t\t\tvar.setValue(String.valueOf(randomDouple(Double.parseDouble(var.getMinimumValue()),\r\n\t\t\t\t\t\t\t\tDouble.parseDouble(var.getMaximumValue()))));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar.setValue(String.valueOf(randomDouple(0.0, 100.0)));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected Random get_rand_value()\n {\n return rand;\n }", "public RandomVaries(String name, int probability, float minUnits, float maxUnits){\n super(name);\n this.probability=probability;\n if(minUnits<0)generator=true;\n this.minUnits=Math.abs(minUnits);\n this.maxUnits=Math.abs(maxUnits);\n }", "T getRandomAllowedValue();", "public int getRandom(int bound) {\n return ThreadLocalRandom.current().nextInt(bound);\n }", "protected void randInitialize(Variable variable) {\n if (variable instanceof Combining) {\n Combining comb = (Combining) variable;\n comb.setValue(pprng.nextInt(comb.getNumberOfAlternatives()));\n } else if (variable instanceof Assigning) {\n //this covers initialization for both assigning and connecting\n Assigning assign = (Assigning) variable;\n for (int i = 0; i < assign.getNumberOfLHS(); i++) {\n for (int j = 0; j < assign.getNumberOfRHS(); j++) {\n if(pprng.nextBoolean())\n assign.connect(i,j);\n }\n }\n// assign.connect(0,0);\n// assign.connect(6,0);\n// assign.connect(7,0);\n// assign.connect(11,0);\n// assign.connect(1,1);\n// assign.connect(6,1);\n// assign.connect(10,1);\n// assign.connect(5,2);\n// assign.connect(6,2);\n// assign.connect(4,3);\n// assign.connect(5,3);\n// assign.connect(11,3);\n// assign.connect(5,4);\n// assign.connect(7,4);\n// assign.connect(8,4);\n// assign.connect(9,4);\n// assign.connect(10,4);\n \n } else {\n System.err.println(\"can not initialize unknown type\");\n }\n }", "private void setRand(){\n rand = generator.nextInt(9) + 1;\n }", "private void getRandomNumber() {\n\t\tRandom generator = new Random();\n\t\trandomNumber = generator.nextInt(POSSIBLE_CHOICE.length);\n\t}", "private int randomValue() {\r\n\t\tRandom rand = new Random();\r\n\t\tint val = rand.nextInt(10);\r\n\t\tif(val == 9)\r\n\t\t\treturn 4;\r\n\t\telse\r\n\t\t\treturn 2;\r\n\t}", "public void generateRandomAllVaraibles() {\r\n\r\n\t\tfor (DataVariable var : dataTestModel) {\r\n\t\t\tif (!var.getType().equals(\"INPUT_DATA\")) {\r\n\t\t\t\tif (var.getType().equals(\"boolean\") || var.getType().equals(\"Boolean\")) {\r\n\t\t\t\t\tvar.setValue(String.valueOf(getRandomBoolean()));\r\n\r\n\t\t\t\t} else if (var.getType().equals(\"int\")) {\r\n\t\t\t\t\tif (var.getMinimumValue() != null && var.getMinimumValue().length() > 0\r\n\t\t\t\t\t\t\t&& var.getMaximumValue() != null && var.getMaximumValue().length() > 0) {\r\n\t\t\t\t\t\tvar.setValue(String.valueOf(randomInt(Integer.parseInt(var.getMinimumValue()),\r\n\t\t\t\t\t\t\t\tInteger.parseInt(var.getMaximumValue()))));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar.setValue(String.valueOf(randomInt(0, 100)));\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (var.getType().equals(\"double\")) {\r\n\t\t\t\t\tif (var.getMinimumValue() != null && var.getMinimumValue().length() > 0\r\n\t\t\t\t\t\t\t&& var.getMaximumValue() != null && var.getMaximumValue().length() > 0) {\r\n\t\t\t\t\t\tvar.setValue(String.valueOf(randomDouple(Double.parseDouble(var.getMinimumValue()),\r\n\t\t\t\t\t\t\t\tDouble.parseDouble(var.getMaximumValue()))));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar.setValue(String.valueOf(randomDouple(0.0, 100.0)));\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (var.getType().equals(\"Enum\")) {\r\n\t\t\t\t\tvar.setValue(var.getValue());\r\n\t\t\t\t\t// System.out.println(\"Enum: var.getValue() = \" +\r\n\t\t\t\t\t// var.getValue());\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private static Option pickRandom() {\n\t\treturn Option.values()[rand.nextInt(3)];\n\t}", "public int getRandom() {\n // get a random integer from [0, n) where n is the size of the value list\n return values.get(random.nextInt(values.size()));\n }", "private void assuerNN_random() {\n //Check, if the variable is null..\n if (this.random == null) {\n //..and now create it.\n this.random = new Random(10);\n }\n }", "public void setRandomValues(float avg, float distr) {\n\t\tfor(int i = 0; i < size; i++)\n\t\t\tvector[i] = avg+MathUtils.randomTriangular()*distr;\n\t}", "public int a(Random var1)\r\n {\r\n return 0;\r\n }", "private int choose(){\n\t\tdouble temp = 10 * Math.random();\n\t\tint i = (int)temp;\n\t\treturn i;\n\t}", "private void initializeStateWithRandomValues(Assignment x, List<RandomVariable> Z){\n for (RandomVariable Zi: Z){\n Object randomValue = Zi.getDomain().get(new Random().nextInt(Zi.getDomain().size()));\n x.set(Zi, randomValue);\n\n }\n }", "public void setRandom(Random r) {\n this.r = r;\n }", "public int getRandom() {\n int index = rnd.nextInt(list.size());\n return list.get(index).val;\n }", "@Test\n public void testVar() {\n System.out.println(\"var\");\n NegativeBinomialDistribution instance = new NegativeBinomialDistribution(3, 0.3);\n instance.rand();\n assertEquals(7/0.3, instance.var(), 1E-7);\n }", "public void randomize() {\n\t\tx = ThreadLocalRandom.current().nextInt(0, 499 + 1);\n\t\ty = ThreadLocalRandom.current().nextInt(0, 499 + 1);\n\t}", "@Override\r\n\tpublic void setComputerValue() {\n\t\trps.setCom((int) (Math.random() * 3 + 1));\r\n\t}", "public void randomize() {\r\n\t\tif(randomizzatoreVariazione > 0.5)\r\n\t\t\tandamentoCurva.setVariazione(\r\n\t\t\t\t\tandamentoCurva.getVariazione() * randomizzatoreVariazione\r\n\t\t\t\t\t+ andamentoCurva.getMIN_VARIAZIONE()\r\n\t\t\t\t\t+ Math.random() * (andamentoCurva.getMAX_VARIAZIONE() - andamentoCurva.getMIN_VARIAZIONE())\r\n\t\t\t);\r\n\t\telse if(randomizzatoreVariazione < 0.5)\r\n\t\t\tandamentoCurva.setVariazione(\r\n\t\t\t\t\tandamentoCurva.getVariazione()\r\n\t\t\t\t\t- andamentoCurva.getMIN_VARIAZIONE()\r\n\t\t\t\t\t+ Math.random() * (andamentoCurva.getMAX_VARIAZIONE() - andamentoCurva.getMIN_VARIAZIONE() * randomizzatoreVariazione)\r\n\t\t\t);\r\n\t}", "public static int getRandom() \n\t{\n\t\treturn rGenerator.nextInt();\n\t}", "public void rollRandom() {\n\t\tthis.strength = randomWithRange();\r\n\t\tthis.wisdom = randomWithRange();\r\n\t\tthis.dexterity = randomWithRange();\r\n\t\tthis.constitution = randomWithRange();\r\n\t\tthis.intelligence = randomWithRange();\r\n\t\tthis.charisma = randomWithRange();\r\n\t}", "private double getRandomNumber(){\n double rand = Math.random();//produce a number between 0 and 1\n rand = rand - 0.5;\n return rand;\n }", "public double getRandom(){\n\t\treturn random.nextDouble();\n\t}", "public int getRandom() {\n return lst.get(rand.nextInt(lst.size()));\n }", "public abstract int getRandomDamage();", "private int RandomResourceValue(int playerNumber) {\n\t\tArrayList<Integer> excludedNumbers = new ArrayList<>();\n\t\tfor (int i = 0; i < CurrentPlayer.resources.length; i++) {\n\t\t\tif (robberPlayers.get(playerNumber).resources[i] == 0)\n\t\t\t\texcludedNumbers.add(i);\n\t\t}\n\t\tRandom r = new Random();\n\t\tint randomVariable = 0;\n\t\trandomVariable = r.nextInt(5 - 0) + 0;\n\n\t\tif (excludedNumbers.size() < 5) {\n\t\t\twhile (excludedNumbers.contains(randomVariable)) {\n\t\t\t\trandomVariable = r.nextInt(5 - 0) + 0;\n\t\t\t}\n\t\t}\n\t\treturn randomVariable;\n\t}", "public int getRandom() {\n return sub.get(rand.nextInt(sub.size()));\n }", "public int getRandom() {\n int randomIdx = random.nextInt(valueList.size());\n return valueList.get(randomIdx);\n }", "public float randomQual() {\n\t\treturn((float) getRandomInteger(30,250));\n\t}", "public int getRandom() {\n return nums.get(rand.nextInt(nums.size()));\n }", "public void set_random_choice()\r\n\t{\r\n\t\tfor (int i=0 ; i<size ; i++)\r\n\t\t{\r\n\t\t\tnumbers.add(get_not_selected_random_digit());\r\n\t\t}\r\n\t}", "@Override\n\tpublic void setToRandomValue(RandomGenerator a_numberGenerator) {\n\n\t}", "public int getRandom() {\n return nums.get(random.nextInt(nums.size()));\n }", "@Override\n public Proposal propose(Random rand)\n {\n \n savedValue = variable.getIntegerValue();\n double [] incrementIdx = Multinomial.generate(rand, 1, \n uniformDiscreteProbs(NUM_STATES));\n double [] stepsVector = steps(NUM_STATES);\n \n int increment = 0; \n \n for(int i = 0; i < (2 * NUM_STATES); i++)\n increment += (int) incrementIdx[i] * stepsVector[i];\n \n final int newValue = savedValue + increment;\n variable.setValue(newValue);\n return new ProposalRealization();\n }", "public final void rand() {\n\t\tpush(randomNumberGenerator.nextDouble());\n\t}", "public int getRandom() {\n return nums.get(random.nextInt(nums.size()));\n }", "public void setToRandomValue(RandomGenerator a_numberGenerator) {\n // maps the randomly determined value to the current bounds.\n // ---------------------------------------------------------\n setAllele(new Float( (m_upperBound - m_lowerBound) *\n a_numberGenerator.nextFloat() + m_lowerBound));\n }", "public abstract void randomize();", "Randomizer getRandomizer();", "public static Double[] mutate(Double[] genotype) {\n\t\tRandom random = new Random();\n\t\tint position = random.nextInt(variableNum);\n\t\tgenotype[position]+=((Math.random()-0.5)*mutateVal);\n\t\tif(genotype[position] > maxValue) genotype[position] = maxValue;\n\t\tif(genotype[position] < minValue) genotype[position] = minValue;\n\t\treturn genotype;\n\t}", "public Random getRandom() {\n\t\treturn (rand);\n\t}", "public int selectRandom(int x) {\n count++; // increment count of numbers seen so far\n\n // If this is the first element from stream, return it\n if (count == 1)\n res = x;\n else {\n // Generate a random number from 0 to count - 1\n Random r = new Random();\n int i = r.nextInt(count);\n\n // Replace the prev random number with new number with 1/count probability\n if (i == count - 1)\n res = x;\n }\n return res;\n }", "int randInt(int n) {\r\n return _randomSource.nextInt(n);\r\n }", "@Override\r\n public Double getValue() {\r\n return Math.random()*Integer.MAX_VALUE;\r\n \r\n }", "public static double random() {\r\n return uniform();\r\n }", "public void setRandomX(int x) {\r\n\t\tthis.x1 = (int) (Math.random()*1000);\r\n\t}", "private double getRandom() {\n return 2*Math.random() - 1;\n }", "public int getRandom() {\n \n return this.nums.get(this.rand.nextInt(this.nums.size()));\n \n }", "public int getRandom() {\r\n var list = new ArrayList<>(set);\r\n return list.get(new Random().nextInt(set.size()));\r\n }", "@Override\n public int attack(){\n //create an int list to store the numbers\n int[] arr = {zero, six, ten};\n //get a random index of the list\n int index = getRandom().nextInt(arr.length);\n //return the number on that random index\n int damageVal = arr[index];\n return damageVal;\n }", "public static Position getRandomPosition() {\n\t\tRandom rand = new Random();\n\t\treturn values()[rand.nextInt(values().length)];\n\t}", "public synchronized TimedVariable sampleAt( int idx )\n\t{\n\t\tif (idx >= 0 && idx < vars.size())\n\t\t\treturn vars.get(idx);\n\t\treturn null;\n\t}", "public T next(final Random random) {\n return elements[selection.applyAsInt(random)];\n }", "RandomizedRarestFirstSelector(Random random) {\n this.random = random;\n }", "public int getRandom() {\n return _list.get( rand.nextInt(_list.size()) );\n }", "private static int get() { \r\n Random r = new Random();\r\n return (r.nextInt(9));\r\n }", "private int generateRandomNumber() {\n\t\treturn new SplittableRandom().nextInt(0, 3);\n\t}", "public interface Random {\n /**\n * @return positive random value below q\n */\n BigInteger nextRandom(BigInteger q);\n }", "Point getRandomPoint() {\n\t\t\t\t\tdouble val = Math.random() * 3;\n\t\t\t\t\tif (val >=0.0 && val <1.0)\n\t\t\t\t\t\treturn p1;\n\t\t\t\t\telse if (val >=1.0 && val <2.0)\n\t\t\t\t\t\t\treturn p2;\n\t\t\t\t\telse\n\t\t\t\t\t\t\treturn p3;\n\t\t\t\t\t}", "int randInt(int n) {\n return _randomSource.nextInt(n);\n }", "protected NNode getRandomNode() {\n\t\tArrayList<NNode> nodearr = new ArrayList<NNode>();\n\t\tnodearr.addAll(nodes.values());\n\t\treturn nodearr.get(Braincraft.randomInteger(nodearr.size()));\n\t}", "private void random() {\n\n\t}", "public static int getRandom(int n){\n\t\treturn rg.nextInt(n); \n\t}", "public int getRandom() {\n int idx;\n Random rand;\n \n rand = new Random();\n idx = rand.nextInt(set.size());\n return set.get(idx);\n }", "public int getRandom() {\n ListNode pick = null;\n ListNode p = head;\n int count = 1;\n while (p != null) {\n if (rand.nextInt(count) == 0) {\n pick = p;\n }\n p = p.next;\n count++;\n }\n return pick.val;\n }", "public static Object getRandomValue(final Class type) {\n\n /*\n * String and Character types\n */\n if (type.equals(String.class)) {\n return RandomStringUtils.randomAlphabetic(10);\n }\n if (type.equals(Character.TYPE) || type.equals(Character.class)) {\n return RandomStringUtils.randomAlphabetic(1).charAt(0);\n }\n\n /*\n * Boolean type\n */\n if (type.equals(Boolean.TYPE) || type.equals(Boolean.class)) {\n return RANDOM.nextBoolean();\n }\n\n /*\n * Numeric types\n */\n if (type.equals(Byte.TYPE) || type.equals(Byte.class)) {\n return (byte) (RANDOM.nextInt());\n }\n if (type.equals(Short.TYPE) || type.equals(Short.class)) {\n return (short) (RANDOM.nextInt());\n }\n if (type.equals(Integer.TYPE) || type.equals(Integer.class)) {\n return RANDOM.nextInt();\n }\n if (type.equals(Long.TYPE) || type.equals(Long.class)) {\n return RANDOM.nextLong();\n }\n if (type.equals(Double.TYPE) || type.equals(Double.class)) {\n return RANDOM.nextDouble();\n }\n if (type.equals(Float.TYPE) || type.equals(Float.class)) {\n return RANDOM.nextFloat();\n }\n if (type.equals(BigInteger.class)) {\n return new BigInteger(Math.abs(RANDOM.nextInt(100)), RANDOM);\n }\n if (type.equals(BigDecimal.class)) {\n return new BigDecimal(RANDOM.nextDouble());\n }\n if (type.equals(AtomicLong.class)) {\n return new AtomicLong(RANDOM.nextLong());\n }\n if (type.equals(AtomicInteger.class)) {\n return new AtomicInteger(RANDOM.nextInt());\n }\n\n /*\n * Date and time types\n */\n if (type.equals(java.util.Date.class)) {\n return new java.util.Date(RANDOM.nextLong());\n }\n if (type.equals(java.sql.Date.class)) {\n return new java.sql.Date(RANDOM.nextLong());\n }\n if (type.equals(java.sql.Time.class)) {\n return new java.sql.Time(RANDOM.nextLong());\n }\n if (type.equals(java.sql.Timestamp.class)) {\n return new java.sql.Timestamp(RANDOM.nextLong());\n }\n if (type.equals(Calendar.class)) {\n return Calendar.getInstance();\n }\n\n /*\n * Enum type\n */\n if (type.isEnum() && type.getEnumConstants().length > 0) {\n Object[] enumConstants = type.getEnumConstants();\n return enumConstants[RANDOM.nextInt(enumConstants.length)];\n }\n\n /*\n * Return null for any unsupported type\n */\n return null;\n\n }", "public int getRandom() {\n Random rand = new Random();\n int idx = rand.nextInt(validLength);\n return set.get(idx);\n }", "public int getRandom() {\n return A.get(r.nextInt(A.size()));\n }", "public static int getRandomAmount(){\n return rand.nextInt(1000);\n }", "protected String random(String value) {\n \t\treturn value + new Random().nextInt(100);\n \t}", "default void setRandomModifier(double value, int duration){\n Random random = new Random();\n Modifier.ModifierType[] modifierTypes = Modifier.ModifierType.values();\n Modifier.ModifierType randomType = modifierTypes[random.nextInt(modifierTypes.length)];\n Modifier randomModifier = new Modifier(randomType, value, duration);\n this.setModifier(randomModifier);\n }", "public double randomValue(){\n\t\treturn _randomValue() + _randomValue() + _randomValue();\n\t}", "private static <T> T randomValue(T[] values) {\n return (values != null && values.length > 0) ?\n values[RandomUtils.nextInt(0, values.length)] :\n null;\n }", "public int getRandom() {\n int x=rand.nextInt(li.size());\n return li.get(x);\n }", "static public Long randomval() {\n Random rand = new Random();\n Long val = rand.nextLong() % p;\n return val;\n }", "public int getRandom() {\n return nums.get((int) (Math.random() * nums.size()));\n }", "public int monsterAttack(){\n Random ran = new Random();\n return ran.nextInt(4);\n }", "public double setRandomPrice() {\n\t\tdouble price = dishPrices.get(roll.nextInt(dishPrices.size()));\n\t\treturn price;\n\t}", "private int rand(int lower, int higher) {\n\t\treturn lower + (int) ((higher - lower + 1) * Math.random());\n\t\t\n\t}", "public static int randomNext() { return 0; }", "public int dmg(){\r\n dmg = rand.nextInt(att);\r\n if(att == 1)\r\n dmg = 1;\r\n return dmg;\r\n }", "public static int RandomNum(){\n\n Random random = new Random();\n int ItemPicker = random.nextInt(16);\n return(ItemPicker);\n }", "public static EnumCardNumber pickRandom() {\r\n\t\treturn values()[Tools.Numbers.randomInt(0, values().length - 1)];\r\n\t}", "protected static int getVariable(String variableKey) {\r\n\t\t\r\n\t\tString valueFromPropertyFile = Settings.getProperty(variableKey);\r\n\t\t\r\n\t\tif (valueFromPropertyFile.charAt(0) == 'R') { // random value requested\r\n\t\t\t\r\n\t\t\treturn random.nextInt(getUpperBound(valueFromPropertyFile) + 1);\r\n\t\t\t\r\n\t\t} else { // absolute value specified\r\n\t\t\t\r\n\t\t\treturn new Integer(valueFromPropertyFile);\r\n\t\t}\r\n\t\t\r\n\t}", "public int getRandom() {\n Random random = new Random();\n int val = list.get( random.nextInt(list.size()));\n return val;\n }", "public double getRandomX() {\r\n\t\treturn x1;\r\n\t}", "public int randomDP() {\n\t\treturn(getRandomInteger(10,250));\n\t}", "public Hazard selectRandom() {\r\n\t\tRandom gen = new Random();\r\n\t\treturn hazards.get(gen.nextInt(hazards.size()));\r\n\t}", "public Position sampleRandomUniformPosition();", "public City randomlyAssignCity()\n {\n int cityReferenceNumber = (int)(Math.random()*(getContainerSize() - 1)) + 1;\n City randomCity = cityContainer.get(cityReferenceNumber);\n \n return randomCity;\n }", "private Vec3 calculateRandomValues(){\n\n Random rand1 = new Random();\n float randX = (rand1.nextInt(2000) - 1000) / 2000f;\n float randZ = (rand1.nextInt(2000) - 1000) / 2000f;\n float randY = rand1.nextInt(1000) / 1000f;\n\n return new Vec3(randX, randY, randZ).normalize();\n }", "private String getRandomName(){\n return rndString.nextString();\n }", "private Random rand()\n\t{\n\t\treturn new Random();\n\t}" ]
[ "0.67254245", "0.60778046", "0.6073251", "0.59034437", "0.58460224", "0.57522106", "0.573453", "0.5711045", "0.56790596", "0.5651266", "0.56435764", "0.5638646", "0.5584586", "0.55803186", "0.5576803", "0.5575311", "0.5563564", "0.55625933", "0.55356985", "0.5530434", "0.5522764", "0.55007595", "0.54932535", "0.54666626", "0.5464146", "0.5444382", "0.541735", "0.54045945", "0.5403066", "0.53969574", "0.53706884", "0.5363143", "0.5360817", "0.5355577", "0.53550154", "0.5337647", "0.5326813", "0.53264517", "0.53186375", "0.5306023", "0.52951866", "0.52784", "0.52669364", "0.5251392", "0.52476376", "0.5236021", "0.5223019", "0.52204704", "0.521866", "0.52138364", "0.5211236", "0.5203333", "0.520315", "0.51925105", "0.51916283", "0.5187775", "0.5182493", "0.51803005", "0.51766706", "0.51755595", "0.5166278", "0.5161889", "0.51568186", "0.51490796", "0.51431346", "0.51381516", "0.51332253", "0.5117922", "0.5114499", "0.51085997", "0.51075286", "0.5102543", "0.5096507", "0.50959927", "0.5083579", "0.50814164", "0.5072022", "0.5071921", "0.5071459", "0.50670844", "0.5063007", "0.5061389", "0.50589776", "0.505818", "0.50564295", "0.50556064", "0.50480586", "0.5047362", "0.50401515", "0.50359607", "0.50347894", "0.5026331", "0.5024813", "0.5019868", "0.5019207", "0.5007725", "0.5003928", "0.50038135", "0.4998982", "0.49982908" ]
0.7006382
0
Randomly selects a variable and assigns it to a value randomly taken in [LB,UB] Uses fixed seed 0 by default
public static IntStrategy random_value(IntVar[] VARS) { return random_value(VARS, 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setRand(){\n rand = generator.nextInt(9) + 1;\n }", "public static VariableSelector<IntVar> random_var_selector(long SEED) {\n return new Random<>(SEED);\n }", "private void assuerNN_random() {\n //Check, if the variable is null..\n if (this.random == null) {\n //..and now create it.\n this.random = new Random(10);\n }\n }", "protected void randInitialize(Variable variable) {\n if (variable instanceof Combining) {\n Combining comb = (Combining) variable;\n comb.setValue(pprng.nextInt(comb.getNumberOfAlternatives()));\n } else if (variable instanceof Assigning) {\n //this covers initialization for both assigning and connecting\n Assigning assign = (Assigning) variable;\n for (int i = 0; i < assign.getNumberOfLHS(); i++) {\n for (int j = 0; j < assign.getNumberOfRHS(); j++) {\n if(pprng.nextBoolean())\n assign.connect(i,j);\n }\n }\n// assign.connect(0,0);\n// assign.connect(6,0);\n// assign.connect(7,0);\n// assign.connect(11,0);\n// assign.connect(1,1);\n// assign.connect(6,1);\n// assign.connect(10,1);\n// assign.connect(5,2);\n// assign.connect(6,2);\n// assign.connect(4,3);\n// assign.connect(5,3);\n// assign.connect(11,3);\n// assign.connect(5,4);\n// assign.connect(7,4);\n// assign.connect(8,4);\n// assign.connect(9,4);\n// assign.connect(10,4);\n \n } else {\n System.err.println(\"can not initialize unknown type\");\n }\n }", "public void setRNG(long seed);", "protected Random get_rand_value()\n {\n return rand;\n }", "public final void rand() {\n\t\tpush(randomNumberGenerator.nextDouble());\n\t}", "public static IntStrategy random_value(IntVar[] VARS, long SEED) {\n for (IntVar v : VARS) {\n if (!v.hasEnumeratedDomain()) {\n throw new UnsupportedOperationException(\"Some variables have bounded domains, \" +\n \"please use random heuristic instead\");\n }\n }\n return custom(random_var_selector(SEED), random_value_selector(SEED), VARS);\n }", "public static void randomInit(int r) { }", "public static int randomNext() { return 0; }", "public void generateRandomVaraibles() {\r\n\r\n\t\tfor (DataVariable var : dataTestModel) {\r\n\t\t\tif (!var.getType().equals(\"LOCAL_DATA\") && !var.getType().equals(\"OUTPUT_DATA\")) {\r\n\t\t\t\tif (var.getType().equals(\"boolean\") || var.getType().equals(\"Boolean\")) {\r\n\t\t\t\t\tvar.setValue(String.valueOf(getRandomBoolean()));\r\n\r\n\t\t\t\t} else if (var.getType().equals(\"int\")) {\r\n\t\t\t\t\tif (var.getMinimumValue() != null && var.getMinimumValue().length() > 0\r\n\t\t\t\t\t\t\t&& var.getMaximumValue() != null && var.getMaximumValue().length() > 0) {\r\n\t\t\t\t\t\tvar.setValue(String.valueOf(randomInt(Integer.parseInt(var.getMinimumValue()),\r\n\t\t\t\t\t\t\t\tInteger.parseInt(var.getMaximumValue()))));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar.setValue(String.valueOf(randomInt(0, 100)));\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (var.getType().equals(\"double\")) {\r\n\t\t\t\t\tif (var.getMinimumValue() != null && var.getMinimumValue().length() > 0\r\n\t\t\t\t\t\t\t&& var.getMaximumValue() != null && var.getMaximumValue().length() > 0) {\r\n\t\t\t\t\t\tvar.setValue(String.valueOf(randomDouple(Double.parseDouble(var.getMinimumValue()),\r\n\t\t\t\t\t\t\t\tDouble.parseDouble(var.getMaximumValue()))));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar.setValue(String.valueOf(randomDouple(0.0, 100.0)));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void getRandomNumber() {\n\t\tRandom generator = new Random();\n\t\trandomNumber = generator.nextInt(POSSIBLE_CHOICE.length);\n\t}", "private double getRandomNumber(){\n double rand = Math.random();//produce a number between 0 and 1\n rand = rand - 0.5;\n return rand;\n }", "private void random() {\n\n\t}", "private double getRandom() {\n return 2*Math.random() - 1;\n }", "private int generateRandomNumber() {\n\t\treturn new SplittableRandom().nextInt(0, 3);\n\t}", "public void setRandom(Random r) {\n this.r = r;\n }", "static public Long randomval() {\n Random rand = new Random();\n Long val = rand.nextLong() % p;\n return val;\n }", "public void randomize() {\n\t\tx = ThreadLocalRandom.current().nextInt(0, 499 + 1);\n\t\ty = ThreadLocalRandom.current().nextInt(0, 499 + 1);\n\t}", "private void loadRandomState() {\n patternName = \"Random\";\n\n for (int i = 0; i < NUMCELLS; i++)\n currentState[i] = (rand.nextInt() > 0x40000000) ? (byte)1 : (byte)0;\n\n generations = 0;\n }", "private int choose(){\n\t\tdouble temp = 10 * Math.random();\n\t\tint i = (int)temp;\n\t\treturn i;\n\t}", "public void rollRandom() {\n\t\tthis.strength = randomWithRange();\r\n\t\tthis.wisdom = randomWithRange();\r\n\t\tthis.dexterity = randomWithRange();\r\n\t\tthis.constitution = randomWithRange();\r\n\t\tthis.intelligence = randomWithRange();\r\n\t\tthis.charisma = randomWithRange();\r\n\t}", "private void initializeStateWithRandomValues(Assignment x, List<RandomVariable> Z){\n for (RandomVariable Zi: Z){\n Object randomValue = Zi.getDomain().get(new Random().nextInt(Zi.getDomain().size()));\n x.set(Zi, randomValue);\n\n }\n }", "public static double random() {\r\n return uniform();\r\n }", "Randomizer getRandomizer();", "private static int get() { \r\n Random r = new Random();\r\n return (r.nextInt(9));\r\n }", "public static int getRandom() \n\t{\n\t\treturn rGenerator.nextInt();\n\t}", "public void set_random_choice()\r\n\t{\r\n\t\tfor (int i=0 ; i<size ; i++)\r\n\t\t{\r\n\t\t\tnumbers.add(get_not_selected_random_digit());\r\n\t\t}\r\n\t}", "private int randomValue() {\r\n\t\tRandom rand = new Random();\r\n\t\tint val = rand.nextInt(10);\r\n\t\tif(val == 9)\r\n\t\t\treturn 4;\r\n\t\telse\r\n\t\t\treturn 2;\r\n\t}", "private int randomWeight()\n {\n return dice.nextInt(1000000);\n }", "public int a(Random var1)\r\n {\r\n return 0;\r\n }", "private static void InitRandBag()\n {\n int k=(int)Math.floor(Math.random()*50);\n R[0]=k;\n\n //Generate the rest of the numbers\n for(int i=1;i<950;i++)\n {\n k=k+(int)Math.floor(Math.random()*50);\n R[i]=k;\n }\n\n //Shuffle the list\n for(int i=0;i<950;i++)\n {\n int temp = R[i];\n k = (int)Math.floor(Math.random()*950);\n R[i]=R[k];\n R[k]=temp;\n }\n }", "public RandomNeighborhoodOperator(int nbRelaxedVars, long seed)\n{\n\trandom = new Random(seed);\n\tthis.nbRelaxedVars = nbRelaxedVars;\n\tselected = new TIntHashSet();\n}", "public static int getRandomBalance(){\n return rand.nextInt(1000000);\n }", "int RandomGeneratorZeroToThree (){\n\t\t int randomInt = 0;\n\t\t Random randomGenerator = new Random();\n\t\t for (int idx = 1; idx <= 10; ++idx) {\n\t\t\t randomInt = randomGenerator.nextInt(4);\n\n\t\t }\n\t\t return randomInt;\n\t }", "public double getRandom(){\n\t\treturn random.nextDouble();\n\t}", "private Random rand()\n\t{\n\t\treturn new Random();\n\t}", "public static int randomGet() { return 0; }", "public void setSeed(int seed){\n\t\tmyRandom = new Random(seed);\n\t}", "private static Option pickRandom() {\n\t\treturn Option.values()[rand.nextInt(3)];\n\t}", "public S getRandomState();", "public static int getRandomAmount(){\n return rand.nextInt(1000);\n }", "void setSeed(long seed);", "public int getRandom() {\n return lst.get(rand.nextInt(lst.size()));\n }", "public static void Random() {\n\t\tRandom ran =new Random();\r\n\t\trandom=ran.nextInt(6)+1;\r\n\t\t//random=1;\r\n\t\twho=A1063307_GUI.who2;\r\n\t\tif((ch[who].status)>0) {\r\n\t\t\tch[who].location=(ch[who].location)+random;\r\n\t\t\tch[who].status=(ch[who].status)-1;\r\n\t\t\t\r\n\t\t}else {\r\n\t\t\t\treturn;\r\n\t\t\t}\t\t\r\n\t}", "public Rng(long seed) {\n\t\tr = new Random(seed);\n\t}", "void setRandomNo() {\n\t\tno = 10000000 + (int) (Math.random() * 90000000);\n\t}", "public void SetRandom(boolean random);", "public void generateRandomAllVaraibles() {\r\n\r\n\t\tfor (DataVariable var : dataTestModel) {\r\n\t\t\tif (!var.getType().equals(\"INPUT_DATA\")) {\r\n\t\t\t\tif (var.getType().equals(\"boolean\") || var.getType().equals(\"Boolean\")) {\r\n\t\t\t\t\tvar.setValue(String.valueOf(getRandomBoolean()));\r\n\r\n\t\t\t\t} else if (var.getType().equals(\"int\")) {\r\n\t\t\t\t\tif (var.getMinimumValue() != null && var.getMinimumValue().length() > 0\r\n\t\t\t\t\t\t\t&& var.getMaximumValue() != null && var.getMaximumValue().length() > 0) {\r\n\t\t\t\t\t\tvar.setValue(String.valueOf(randomInt(Integer.parseInt(var.getMinimumValue()),\r\n\t\t\t\t\t\t\t\tInteger.parseInt(var.getMaximumValue()))));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar.setValue(String.valueOf(randomInt(0, 100)));\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (var.getType().equals(\"double\")) {\r\n\t\t\t\t\tif (var.getMinimumValue() != null && var.getMinimumValue().length() > 0\r\n\t\t\t\t\t\t\t&& var.getMaximumValue() != null && var.getMaximumValue().length() > 0) {\r\n\t\t\t\t\t\tvar.setValue(String.valueOf(randomDouple(Double.parseDouble(var.getMinimumValue()),\r\n\t\t\t\t\t\t\t\tDouble.parseDouble(var.getMaximumValue()))));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar.setValue(String.valueOf(randomDouple(0.0, 100.0)));\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (var.getType().equals(\"Enum\")) {\r\n\t\t\t\t\tvar.setValue(var.getValue());\r\n\t\t\t\t\t// System.out.println(\"Enum: var.getValue() = \" +\r\n\t\t\t\t\t// var.getValue());\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public int getRandom() {\n ListNode pick = null;\n ListNode p = head;\n int count = 1;\n while (p != null) {\n if (rand.nextInt(count) == 0) {\n pick = p;\n }\n p = p.next;\n count++;\n }\n return pick.val;\n }", "public final void randomSeed(long what){\n\t\tsetSeed(what);\n\t\trandom();\n\t}", "public int getRandom() {\n int index = rnd.nextInt(list.size());\n return list.get(index).val;\n }", "public static double uniform() {\r\n return random.nextDouble();\r\n }", "public void seed(long seed) {\n }", "@Override\n public Proposal propose(Random rand)\n {\n \n savedValue = variable.getIntegerValue();\n double [] incrementIdx = Multinomial.generate(rand, 1, \n uniformDiscreteProbs(NUM_STATES));\n double [] stepsVector = steps(NUM_STATES);\n \n int increment = 0; \n \n for(int i = 0; i < (2 * NUM_STATES); i++)\n increment += (int) incrementIdx[i] * stepsVector[i];\n \n final int newValue = savedValue + increment;\n variable.setValue(newValue);\n return new ProposalRealization();\n }", "public float randomize() {\n return nextFloat(this.min, this.max);\n }", "@Override\r\n\tpublic int computeNextVal(boolean prediction) {\n\t\treturn (int) (Math.random()*10)%3;\r\n\t}", "void setSeed(final long seed);", "public int getRandom() {\n return sub.get(rand.nextInt(sub.size()));\n }", "public static void main(String[] args) {\n//\t\tSystem.out.println(random.nextInt(10));\n\t\t\n\t\tRandom randoma = new Random();\n\t\tRandom randomb = new Random();\n//\t\tSystem.out.println(randoma.nextInt(10));\n//\t\tSystem.out.println(randomb.nextInt(10));\n\t\t\n\t\tThreadLocal<Integer> t = new ThreadLocal<Integer>();\n\t\tThreadLocal<Integer> t2 = new ThreadLocal<Integer>();\n\t\t\n\t\tt.set(randoma.nextInt(10));\n\t\tt2.set(randomb.nextInt(10));\n\t\tSystem.out.println(t.get());\n\t\tSystem.out.println(t2.get());\n\t}", "public RandomVaries(String name, int probability, float minUnits, float maxUnits){\n super(name);\n this.probability=probability;\n if(minUnits<0)generator=true;\n this.minUnits=Math.abs(minUnits);\n this.maxUnits=Math.abs(maxUnits);\n }", "public void randomize() {\r\n\t\tif(randomizzatoreVariazione > 0.5)\r\n\t\t\tandamentoCurva.setVariazione(\r\n\t\t\t\t\tandamentoCurva.getVariazione() * randomizzatoreVariazione\r\n\t\t\t\t\t+ andamentoCurva.getMIN_VARIAZIONE()\r\n\t\t\t\t\t+ Math.random() * (andamentoCurva.getMAX_VARIAZIONE() - andamentoCurva.getMIN_VARIAZIONE())\r\n\t\t\t);\r\n\t\telse if(randomizzatoreVariazione < 0.5)\r\n\t\t\tandamentoCurva.setVariazione(\r\n\t\t\t\t\tandamentoCurva.getVariazione()\r\n\t\t\t\t\t- andamentoCurva.getMIN_VARIAZIONE()\r\n\t\t\t\t\t+ Math.random() * (andamentoCurva.getMAX_VARIAZIONE() - andamentoCurva.getMIN_VARIAZIONE() * randomizzatoreVariazione)\r\n\t\t\t);\r\n\t}", "public void setRnd (java.lang.String rnd) {\r\n\t\tthis.rnd = rnd;\r\n\t}", "public int getRandom(int bound) {\n return ThreadLocalRandom.current().nextInt(bound);\n }", "public abstract void randomize();", "private int randomGen(int upperBound) {\n\t\tRandom r = new Random();\n\t\treturn r.nextInt(upperBound);\n\t}", "@Test\n public void randomSeedNumTest()\n {\n int x = _city.getRandomNum(5);\n int y = _city.getRandomNum(5);\n assertEquals(x, y);\n }", "public interface RandomSeed {\n\n\t/**\n\t * @return Uma semente randomica entre 0 e 1 inclusive.\n\t */\n\tpublic double getSeed();\n}", "public Element setToRandom() {\n this.value = Math.abs(ThreadSecureRandom.get().nextLong()) % field.order;\n\n return mod();\n }", "public static double uniform() {\n return random.nextDouble();\n }", "public int randomDP() {\n\t\treturn(getRandomInteger(10,250));\n\t}", "public int getRandomPositiveInt(){\r\n long gen = (a*seed+c)%m;\r\n seed = gen;\r\n return (int)gen;\r\n }", "public static IntValueSelector random_value_selector(long SEED) {\n return new IntDomainRandom(SEED);\n }", "private int randomNum() {\r\n\t return((int)(Math.random() * 100));\r\n\t }", "private int rand() {\n return (int)(Math.random()*(RAND_MAX + 1));\n }", "private int rand(int lower, int upper) {\n return lower + (int)(Math.random() * ((upper - lower) + 1));\n }", "public float randomQual() {\n\t\treturn((float) getRandomInteger(30,250));\n\t}", "public void setRandomX(int x) {\r\n\t\tthis.x1 = (int) (Math.random()*1000);\r\n\t}", "@Override\r\n\tpublic void setComputerValue() {\n\t\trps.setCom((int) (Math.random() * 3 + 1));\r\n\t}", "private Vec3 calculateRandomValues(){\n\n Random rand1 = new Random();\n float randX = (rand1.nextInt(2000) - 1000) / 2000f;\n float randZ = (rand1.nextInt(2000) - 1000) / 2000f;\n float randY = rand1.nextInt(1000) / 1000f;\n\n return new Vec3(randX, randY, randZ).normalize();\n }", "public static Lieferart getRandomLieferart() {\n\t\treturn VALUES[RANDOM.nextInt(SIZE)];\n\t}", "private String getRandomName(){\n return rndString.nextString();\n }", "public int getRandom382() {\n int count = 0, chosenValue = 0;\n ListNode curr = this.head;\n while (curr != null) {\n count += 1;\n // decide whether to include the element in reservoir\n if (rand.nextInt(count) == 0) chosenValue = curr.val;\n // move on to the next node\n curr = curr.next;\n }\n return chosenValue;\n }", "void new_seed( Seed seed );", "public void roll(){\n currentValue = rand.nextInt(6)+1;\n }", "private int randomNumber(int high, int low){\n \t\t Random r = new Random();\n \t\t return (r.nextInt(high-low) + low);\n \t }", "public static void main(String[] args) {\n\r\n\t\tRandom rr=new Random();\r\n\t\t\r\n\t\tSystem.out.println(Math.random());//[0,1)\r\n\t\t \r\n\t\t// 第一种情况 int(强转之后最终的值一定是0)\r\n\t\t// 第二种情况 int(强转之后将小数点舍去 1-5)\r\n\t\tSystem.out.println((int)Math.random()*5);//0.99*5永远到不了5\r\n\t\tSystem.out.println((int)(Math.random()*5+1));//[1,5.)\r\n\t\t\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\t\r\n\t\tfor(int i=0;i<=20;i++){\r\n\t\t\tSystem.out.print(i%7+\"-\");\r\n\t\t\t\r\n\t\t}\r\n\t\t//1-M的随机产生\r\n\t\t//(int)(Math.random()*M+1)\r\n\t\t\r\n\t\t\r\n\t\t//产生0 1的概率不同 Math.random()<p?0:1\r\n\t\tSystem.out.println(\"----\"+rr.rand01p());\r\n\t\tSystem.out.println(\"----\"+rr.rand01());\r\n\t\tfor(int i=0;i<=11;i++){\r\n\t\t\tSystem.out.print(i%6+\"-\");\r\n\t\t \t\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(rr.rand106());\r\n\t}", "public int eDmg(){\r\n eDmg = rand.nextInt(13);\r\n return eDmg;\r\n }", "public void setSeed(int seed){\n this.seed = seed; \n }", "public Random getRandom() {\n\t\treturn (rand);\n\t}", "public static double random()\n {\n return _prng2.nextDouble();\n }", "public int getRandom() {\n return nums.get(rand.nextInt(nums.size()));\n }", "public double getRandom() {\n return 20*Math.random() - 10;\n }", "int randomPoint() { return 1 + (int)Math.round((Math.random()*20) % (size - 2)); }", "public void doSomeRandomization() {\n\t\tlbOp.setSelectedKey(\"+\");\n\t\tRandom random = new Random(System.currentTimeMillis());\n\t\tinpValue1.setNumber((double)random.nextInt(1000));\n\t\tinpValue2.setNumber((double)random.nextInt(1000));\n\t\tcalculate();\n\t}", "@Test\n public void testVar() {\n System.out.println(\"var\");\n NegativeBinomialDistribution instance = new NegativeBinomialDistribution(3, 0.3);\n instance.rand();\n assertEquals(7/0.3, instance.var(), 1E-7);\n }", "public void setToRandomValue(RandomGenerator a_numberGenerator) {\n // maps the randomly determined value to the current bounds.\n // ---------------------------------------------------------\n setAllele(new Float( (m_upperBound - m_lowerBound) *\n a_numberGenerator.nextFloat() + m_lowerBound));\n }", "public void randomizeState() {\n\t\t//System.out.print(\"Randomizing State: \");\n\t\tArrayList<Integer> lst = new ArrayList<Integer>();\n\t\tfor(int i = 0; i<9; i++)// adds 0-8 to list\n\t\t\tlst.add(i);\n\t\tCollections.shuffle(lst);//randomizes list\n\t\tString str=\"\";\n\t\tfor(Integer i : lst)\n\t\t\tstr += String.valueOf(i);\n\t\t//System.out.println(str);\n\t\tcurrent = new PuzzleState(str,current.getString(current.getGoalState()));\n\t\t//pathCost++;\n\t}", "private double randn(){\r\n\t\t//* http://www.mathworks.com/access/helpdesk/help/techdoc/matlab.html\r\n\t\t//RandomNumber rnd = new RandomNumber(System.currentTimeMillis());\r\n\t\t//return rnd.normal();\r\n\t\treturn rnd.nextGaussian();\r\n\t\t//return 0;\r\n\t}", "Chromosome getRandom();" ]
[ "0.69449776", "0.6926617", "0.6477849", "0.6454419", "0.64329934", "0.63625187", "0.6350151", "0.6341969", "0.6325854", "0.6322893", "0.63221467", "0.6273126", "0.624961", "0.62266773", "0.6225272", "0.6220012", "0.6212924", "0.6204961", "0.61750424", "0.6170502", "0.6168174", "0.6156407", "0.61165345", "0.61163753", "0.6071003", "0.60510737", "0.6043347", "0.6031752", "0.60190064", "0.6007274", "0.60053706", "0.6001631", "0.5997036", "0.59724283", "0.5961183", "0.5954245", "0.5939952", "0.59258133", "0.5911883", "0.591154", "0.589379", "0.587276", "0.5866294", "0.58540416", "0.58460855", "0.5843059", "0.5835607", "0.58346367", "0.58313644", "0.5829486", "0.58243287", "0.58183306", "0.5810157", "0.58072203", "0.5800589", "0.5794238", "0.5791498", "0.57825756", "0.57808006", "0.5774659", "0.5771553", "0.5770873", "0.57660806", "0.5752971", "0.5750147", "0.5748448", "0.574702", "0.57444096", "0.5743341", "0.5730065", "0.57298994", "0.57218635", "0.5719373", "0.5718623", "0.5718362", "0.5714838", "0.5713979", "0.5709693", "0.57090086", "0.5705178", "0.57039285", "0.57034177", "0.56955755", "0.56938404", "0.5679316", "0.5676147", "0.56720686", "0.56674844", "0.5664683", "0.5661193", "0.5659878", "0.56559885", "0.5641796", "0.56331575", "0.5632301", "0.56298274", "0.5626062", "0.5626", "0.5617116", "0.5594252" ]
0.6542965
2
Build a sequence of AbstractStrategy. The first strategy in parameter is first called to compute a decision, if possible. Otherwise, the second strategy is called, ... And so on, until the last one.
public static AbstractStrategy sequencer(AbstractStrategy... strategies) { return new StrategiesSequencer(strategies); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Strategy<S, Integer> buildStrategy() {\n\t\tStrategy<S, Integer> result = new Strategy<S, Integer>();\n\n\t\tSet<S> winningStates = this.getWinningStates();\n\n\t\tfor (S state : losingStates) {\n\t\t\tStrategyState<S, Integer> source = new StrategyState<S, Integer>(\n\t\t\t\t\tstate, DUMMY_GOAL);\n\t\t\tSet<StrategyState<S, Integer>> successors = new HashSet<StrategyState<S, Integer>>();\n\t\t\t// if its uncontrollable and winning it must have winning succesors\n\t\t\tfor (S succ : this.game.getSuccessors(state)) {\n\t\t\t\tif (!winningStates.contains(succ)) {\n\t\t\t\t\tStrategyState<S, Integer> target = new StrategyState<S, Integer>(\n\t\t\t\t\t\t\tsucc, DUMMY_GOAL);\n\t\t\t\t\tsuccessors.add(target);\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult.addSuccessors(source, successors);\n\t\t}\n\t\treturn result;\n\t}", "Strategy createStrategy();", "public IStrategy parse() {\n this.state = ProcessState.INIT;\n int count = 0;\n while (count < this.result.size()) {\n switch (this.state) {\n case INIT:\n count = processInit(count);\n break;\n case WAIT_STRATEGY_NAME:\n count = processStrategyName(count);\n break;\n case WAIT_STOCK_LIST:\n count = processStockList(count);\n break;\n case WAIT_STOCK:\n count = processStock(count);\n break;\n case WAIT_SYMBOL:\n count = processStockSymbol(count);\n break;\n case WAIT_WEIGHT:\n count = processStockWeight(count);\n break;\n case WAIT_BEGIN_DATE:\n count = processBeginDate(count);\n break;\n case WAIT_END_DATE:\n count = processEndDate(count);\n break;\n case WAIT_AMOUNT:\n count = processAmount(count);\n break;\n case WAIT_DAY:\n count = processDay(count);\n break;\n case END:\n count = processEnd(count);\n break;\n default:\n break;\n }\n }\n return this.strategy;\n }", "public void makeFirstRound() {\n Strategy tactics = null;\n ArrayList<Producer> auxProducerList = new ArrayList<>(listOfProducers.getList());\n for (Distributor dst : listOfDistributors.getList()) {\n if (dst.getSubscribedproducers().isEmpty()) {\n int auxNeededPower = dst.getEnergyNeededKW();\n if (dst.getProducerStrategy().equals(\"GREEN\")) {\n tactics = new GreenStrategy();\n } else if (dst.getProducerStrategy().equals(\"PRICE\")) {\n tactics = new PriceStrategy();\n } else if (dst.getProducerStrategy().equals(\"QUANTITY\")) {\n tactics = new QuantityStrategy();\n }\n tactics.sorter(auxProducerList);\n for (Producer p : auxProducerList) {\n if (!(p.getMaxDistributors() == p.getCurrDistributors())) {\n dst.addSubscribedproducer(p);\n p.addDistIDs(dst.getId());\n p.addObserver(dst);\n p.setCurrDistributors(p.getCurrDistributors() + 1);\n auxNeededPower -= p.getEnergyPerDistributor();\n if (auxNeededPower < 0) {\n break;\n }\n }\n }\n }\n }\n\n Distributor bestDist = listOfDistributors.getBestDistinRound();\n\n for (Consumer auxcons : listOfConsumers.getList()) {\n auxcons.setBudget(auxcons.getInitialBudget() + auxcons.getMonthlyIncome());\n auxcons.setIdofDist(bestDist.getId());\n auxcons.setMonthstoPay(bestDist.getContractLength());\n auxcons.setToPay(bestDist.getContractPrice());\n bestDist.addSubscribedconsumer(auxcons);\n if (auxcons.getBudget() >= auxcons.getToPay()) {\n auxcons.addtoBudget(-auxcons.getToPay());\n auxcons.reduceMonths();\n bestDist.addBudget(auxcons.getToPay());\n } else {\n auxcons.setDuepayment(auxcons.getToPay());\n auxcons.reduceMonths();\n }\n if (auxcons.getMonthstoPay() == 0) {\n auxcons.setIdofDist(-1);\n }\n }\n\n for (Distributor d : listOfDistributors.getList()) {\n if (d.isBankrupt()) {\n continue;\n }\n d.reduceBudget();\n if (d.getBudget() < 0) {\n d.setBankrupt(true);\n }\n }\n }", "public interface Strategy {\n\n StrategySolution solve(List<Item> items, int weight);\n}", "public static List<StrategyAgent> createAgents() {\n\t\tdouble ratioAlt = parameters.getRatioAltruistic();\n\t\tint numberAlt = (int)Math.floor(parameters.getNAgents() * ratioAlt);\n\t\t\n\t\tList<StrategyAgent> agents = new ArrayList<StrategyAgent>();\n\t\tfor (int i = 0; i < numberAlt; i++) {\n\t\t\tStrategyAgent agent = new StrategyAgent(lastID, 0, parameters.getEtaN(), parameters.getEtaS(),\n\t\t\t\t\tparameters.getFeatures(), parameters.getNNoLearning(), parameters.getAlphabetSize(),\n\t\t\t\t\tStrategyType.ALTRUISTIC, parameters.getMemorySize());\n\t\t\tagent.architecture.ontology = Utils.getSingletonOntology();\n\t\t\tagents.add(agent);\n\t\t\tlastID++;\n\t\t}\n\t\tfor (int i = numberAlt; i < parameters.getNAgents(); i++){\n\t\t\tStrategyAgent agent = new StrategyAgent(lastID, 0, parameters.getEtaN(), parameters.getEtaS(),\n\t\t\t\t\tparameters.getFeatures(), parameters.getNNoLearning(), parameters.getAlphabetSize(),\n\t\t\t\t\tStrategyType.MUTUALISTIC, parameters.getMemorySize());\n\t\t\tagent.architecture.ontology = Utils.getSingletonOntology();\n\t\t\tagents.add(agent);\n\t\t\tlastID++;\n\t\t}\n\t\tCollections.shuffle(agents);\n\t\treturn agents;\n\t}", "public interface SelectStrategy {\n\n /**\n * Indicates a blocking select should follow.\n */\n int SELECT = -1;\n /**\n * Indicates the IO loop should be retried, no blocking select to follow directly.\n */\n int CONTINUE = -2;\n /**\n * Indicates the IO loop to poll for new events without blocking.\n */\n int BUSY_WAIT = -3;\n\n /**\n * The {@link SelectStrategy} can be used to steer the outcome of a potential select\n * call.\n *\n * @param selectSupplier The supplier with the result of a select result.\n * @param hasTasks true if tasks are waiting to be processed.\n * @return {@link #SELECT} if the next step should be blocking select {@link #CONTINUE} if\n * the next step should be to not select but rather jump back to the IO loop and try\n * again. Any value >= 0 is treated as an indicator that work needs to be done.\n */\n int calculateStrategy(IntSupplier selectSupplier, boolean hasTasks) throws Exception;\n}", "public interface Strategy {\n\n\n\tpublic void operation();\n\n}", "public static void calculateFitness(StrategyPool sp)\r\n\t{\r\n\t\tfor(int i = 0; i<sp.pool.size() ; i++)\r\n\t\t{\r\n\t\t\tfor(int j = 0; j <sp.pool.size() ; j++)\r\n\t\t\t{\r\n\t\t\t\tif(i == j)\r\n\t\t\t\t\t; //do nothing\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n//\t\t\t\t\tSystem.out.println(\"Playing Strategy \" +i +\" against \" +j );\r\n\t\t\t\t\tStrategy p1 = sp.pool.get(i);\r\n\t\t\t\t\tStrategy p2 = sp.pool.get(j);\r\n\t\t\t\t\tint winner = 0;\r\n\t\t\t\t\tfor(int k = 0; k<1000 ; k++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\twinner = new Game().play(p1,p2);\r\n\t\t\t\t\t\t\tif(winner == 0)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tp1.addDrawCount();\r\n\t\t\t\t\t\t\t\tp2.addDrawCount();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if(winner == 1)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tp1.addWinCount();\r\n\t\t\t\t\t\t\t\tp2.addLostCount();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if(winner ==2)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tp1.addLostCount();\r\n\t\t\t\t\t\t\t\tp2.addWinCount();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//switch positions\r\n\t\t\t\t\tp2 = sp.pool.get(i);\r\n\t\t\t\t\tp1 = sp.pool.get(j);\r\n\r\n//\t\t\t\t\tSystem.out.println(\"Playing Strategy \" +j +\" against \" +i );\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor(int k = 0; k<1000 ; k++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\twinner = new Game().play(p1,p2);\r\n\t\t\t\t\t\tif(winner == 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tp1.addDrawCount();\r\n\t\t\t\t\t\t\tp2.addDrawCount();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if(winner == 1)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tp1.addWinCount();\r\n\t\t\t\t\t\t\tp2.addLostCount();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if(winner ==2)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tp1.addLostCount();\r\n\t\t\t\t\t\t\tp2.addWinCount();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public interface IStrategy {\n\n\t\t\n\t\t\t\n\t/** \n\t * calculate the next position of the pacman. Gets the curent position and returns the new position.\n\t */\n\tpublic abstract Point move(Point position);\n\t\t\t\n\t\t\n\n}", "Algorithm createAlgorithm();", "private void setNextStrategy() {\n setCurrentStrategy(getCurrentStrategy().next(_feedId,\n _start,\n _first,\n _last));\n }", "public interface BuildStrategy {\n\n public void execute(GameSession session, int village) throws InterruptedException;\n\n}", "protected interface Strategy {\r\n\t\tpublic Map<Role<R2R>,Element> next();\r\n\t\tpublic boolean hasNext();\r\n\t}", "private Strategy getStrategyInstance() {\n if (strategyInstances.containsKey(strategy)) {\n return strategyInstances.get(strategy);\n } else {\n try {\n Strategy strategyInstance = strategy.getConstructor(Board.class).newInstance(board);\n strategyInstances.put(strategy, strategyInstance);\n return strategyInstance;\n } catch (Exception e) {\n System.err.println(\"Exception when intiating strategy with only board argument\");\n e.printStackTrace();\n return null;\n }\n }\n }", "private BDD build_T() {\n\t\tExecutorService executorService = Executors.newCachedThreadPool();\n\t\tList<Future<BDD>> tasks = new ArrayList<>(processors);\n\n\t\tint scheduler = processors;\n\t\tint work = endGenerations / processors;\n\t\tint half = work;\n\n\t\tif((endGenerations % processors) != 0)\n\t\t\tscheduler--;\n\n\t\tfor (int i = 0; i < scheduler; i++){\n\t\t\ttasks.add(executorService.submit(new AsyncTask(work - half, work)));\t\n\n\t\t\twork += half;\n\t\t}\n\n\t\tif((endGenerations % processors) != 0)\n\t\t\ttasks.add(executorService.submit(new AsyncTask(work - half, work+1)));\t\n\t\t\n\n\t\tBDD res = factory.makeZero();\n\t\tfor (int i = 0; i < processors; i++) {\n\t\t\ttry {\n\n\t\t\t\tres.orWith(tasks.get(i).get());\n\n\t\t\t} catch (InterruptedException | ExecutionException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\t\t\t\n\t\t}\n\n\t\texecutorService.shutdown();\n\n\t\treturn res;\n\t}", "@SafeVarargs\n public static <T> void apply(List<T> elements, IntStrategy<T>... strategies) {\n int processorsCount = strategies.length;\n Map<Integer, Integer> positions = new HashMap<>();\n BitSet bitSet = new BitSet();\n\n int lowestIndex = Integer.MAX_VALUE;\n for (T element : elements) {\n for (IntStrategy<T> strategy : strategies) {\n lowestIndex = Math.min(lowestIndex, strategy.getMapper().apply(element));\n }\n }\n final int offset = lowestIndex;\n int bound = elements.size();\n for (int elementIndex = 0; elementIndex < bound; ++elementIndex) {\n for (int processorIndex = 0; processorIndex < processorsCount; ++processorIndex) {\n int bitSetIndex = (strategies[processorIndex].getMapper()\n .apply(elements.get(elementIndex)) - offset) * processorsCount + processorIndex;\n bitSet.set(bitSetIndex);\n positions.put(bitSetIndex, positions.getOrDefault(bitSetIndex, 0) + 1);\n }\n }\n for (int bitSetIndex = bitSet.nextSetBit(0); bitSetIndex >= 0; bitSetIndex = bitSet.nextSetBit(bitSetIndex + 1)) {\n for (int occurrenceCounter = 0; occurrenceCounter < positions.get(bitSetIndex); ++occurrenceCounter) {\n strategies[bitSetIndex % processorsCount].getProcessor().accept(bitSetIndex / processorsCount + offset);\n }\n }\n }", "CompositeGradlePluginTestingStrategy composite(GradlePluginTestingStrategy firstStrategy, GradlePluginTestingStrategy secondStrategy, GradlePluginTestingStrategy... otherStrategies);", "public BorderedStrategy() {\n\t\tsuper();\n\t}", "@Test\n @Order(1)\n void algorithms() {\n \n Combination initialComb = new Combination();\n for (int i = 0; i < assignementProblem.getAssignmentData().getLength(); i++) {\n initialComb.add((long) i + 1);\n }\n assignementProblem.setInCombination(initialComb);\n executeAlgo(SearchTestUtil.ALGO.TABU);\n executeAlgo(SearchTestUtil.ALGO.RECUIT);\n }", "public abstract StandaloneAlgorithm createAlgorithm();", "public BasicStrategy() {\r\n if (pairTable == null) {\r\n createPairTable();\r\n }\r\n if (aceTable == null) {\r\n createAceTable();\r\n }\r\n if (totalTable == null) {\r\n createTotalTable();\r\n }\r\n }", "public static Goal[] createEverythingGoals() {\n\t\t// [ & ] <--- rootGoal1\n\t\t// / / \\ \\\n\t\t// P T E M\n\t\t//\n\t\tCompositeGoal rootGoal1 = new CompositeGoal(CompositeGoal.and);\n\t\trootGoal1.addChild(new PuzzleGoal());\n\t\trootGoal1.addChild(new TreasureGoal());\n\t\trootGoal1.addChild(new EnemiesGoal());\n\t\trootGoal1.addChild(new MazeGoal());\n\t\t\n\t\t\n\t\tCompositeGoal subGoal1 = new CompositeGoal(CompositeGoal.and);\n\t\tsubGoal1.addChild(new EnemiesGoal());\n\t\tsubGoal1.addChild(new TreasureGoal());\n\t\tsubGoal1.addChild(new MazeGoal());\n\t\t\n\t\tCompositeGoal subGoal2 = new CompositeGoal(CompositeGoal.and);\n\t\tsubGoal2.addChild(new PuzzleGoal());\n\t\tsubGoal2.addChild(new TreasureGoal());\n\t\tsubGoal2.addChild(subGoal1);\n\t\t\n\t\t// [ | ] <--- rootGoal2\n\t\t// / \\\n\t\t// I [ & ] <---- subGoal2\n\t\t// / | \\\n\t\t// P T [ & ] <---- subGoal1\n\t\t// /|\\\n\t\t// E T M\n\t\tCompositeGoal rootGoal2 = new CompositeGoal(CompositeGoal.or);\n\t\trootGoal2.addChild(new ImpossibleGoal());\n\t\trootGoal2.addChild(subGoal2);\n\n\t\t\n\t\tString goalString = \"\"\n\t\t\t+ \" { \\\"goal\\\": \\\"AND\\\", \\\"subgoals\\\":\\n\"\n\t\t\t+ \" [ { \\\"goal\\\": \\\"exit\\\" },\\n\"\n\t\t\t+ \" { \\\"goal\\\": \\\"AND\\\", \\\"subgoals\\\":\\n\"\n\t\t\t+ \" [ {\\\"goal\\\": \\\"treasure\\\" },\\n\"\n\t\t\t+ \" { \\\"goal\\\": \\\"AND\\\", \\\"subgoals\\\":\\n\"\n\t\t\t+ \" [ {\\\"goal\\\": \\\"enemies\\\" },\\n\"\n\t\t\t+ \" {\\\"goal\\\": \\\"boulders\\\" }\\n\"\n\t\t\t+ \" ]\\n\"\n\t\t\t+ \" }\\n\"\n\t\t\t+ \" ]\\n\"\n\t\t\t+ \" }\\n\"\n\t\t\t+ \" ]\\n\"\n\t\t\t+ \" }\\n\";\n\t\t\n\t\tJSONObject json = new JSONObject(new JSONTokener(goalString));\n\t\tGoal goal3 = Goal.createGoal(json);\n\t\t\n\t\treturn new Goal[]{ rootGoal1, rootGoal2, goal3 };\n\t}", "public scala.collection.Seq<org.apache.spark.sql.catalyst.planning.GenericStrategy<org.apache.spark.sql.execution.SparkPlan>> extraStrategies () { throw new RuntimeException(); }", "public void chooseAlgorithm() {\n boolean runloop = true;\n CustomArrayList<Integer>[] graph = null;\n graph = util.initializeCNF(statement);\n while (runloop) {\n io.println(\"Which algorithm do you want to use to solve this?\");\n io.println(\"1: Tarjan algorithm\\n2: Kosaraju algorithm\\n3: Brute force method\\n4: Print the truth distribution that solves the CNF\\n5: return\");\n String selection = io.nextLine();\n switch (selection) {\n case (\"1\"):\n tarjan = new TarjanAlgorithm(graph, numVariables);\n TarjanPrint();\n break;\n case (\"2\"):\n kosaraju = new KosarajuAlgorithm(graph, numVariables);\n KosarajuPrint();\n break;\n case (\"3\"):\n io.println(\"Warning! Brute force method has an exponential time complexity. Using this with CNF with more than 20 variables will take a really long time. \");\n io.println(\"Continue? y/n\");\n String affirmate = io.nextLine();\n switch (affirmate) {\n case (\"y\"):\n bruteForcePrint();\n break;\n case (\"n\"):\n break;\n }\n break;\n case (\"4\"):\n tarjan = new TarjanAlgorithm(graph, numVariables);\n if (tarjan.checkSatisfiability()) {\n printTruthAssesment();\n } else {\n io.println(\"Not satisfiable\");\n }\n break;\n case (\"5\"):\n io.println(\"Returning to main menu...\");\n runloop = false;\n break;\n }\n }\n }", "public Abstraction abstractToPattern(Set<Integer> pattern)\n\t{\n\t\tassert (initialState != null);\n\n\t\t// Abstract goal condition.\n\t\tCondition abstractGoal = explicitGoal.abstractToPattern(pattern);\n\n\t\t// Abstract operators.\n\t\tSet<Operator> abstractedOperators = new LinkedHashSet<Operator>(\n\t\t\t\tgetOperators().size());\n\t\tfor (Operator op : getOperators())\n\t\t{\n\t\t\tOperator absOp = op.abstractToPattern(pattern);\n\t\t\tif (absOp != null)\n\t\t\t{\n\t\t\t\tassert absOp.isAbstracted;\n\t\t\t\tabstractedOperators.add(absOp);\n\t\t\t}\n\t\t}\n\t\tassert Operator.assertNoDuplicateInNames(abstractedOperators);\n\t\tif (DEBUG)\n\t\t{\n\t\t\tSystem.out.println(\"Abstracted ops:\");\n\t\t\tfor (Operator op : abstractedOperators)\n\t\t\t{\n\t\t\t\t((ExplicitOperator) op).dump();\n\t\t\t}\n\t\t}\n\n\t\t// An axiom is either completely conserved or completely removed in an\n\t\t// abstraction.\n\t\tSet<OperatorRule> abstractedAxioms = new LinkedHashSet<ExplicitOperator.OperatorRule>(\n\t\t\t\taxioms.size());\n\t\tfor (OperatorRule axiom : axioms)\n\t\t{\n\t\t\tif (pattern.contains(axiom.head.first))\n\t\t\t{\n\t\t\t\tfor (Pair<Integer, Integer> fact : axiom.body)\n\t\t\t\t{\n\t\t\t\t\tassert pattern.contains(fact.first);\n\t\t\t\t}\n\t\t\t\tabstractedAxioms.add(axiom);\n\t\t\t}\n\t\t}\n\n\t\t// Abstract and set initial state.\n\t\tSortedSet<Integer> sortedPattern = new TreeSet<Integer>(pattern);\n\t\tAbstraction abstraction = new Abstraction(sortedPattern, abstractGoal,\n\t\t\t\tabstractedOperators, abstractedAxioms);\n\t\tabstraction.setInitialState(Arrays.asList(initialState\n\t\t\t\t.abstractToPattern(abstraction)));\n\t\treturn abstraction;\n\t}", "IntStrategyFactory() {\n }", "public interface IInteractStrategy {\n\n\t/**\n\t * Performs a directed interaction between the context ball and the target Ball from the perspective of the context Ball.\n\t * @param context The Ball from whose perspective the interaction processing takes place.\n\t * @param target The Ball that is the \"other ball\" in the perspective of this processing.\n\t * @param disp The Dispatcher that is to be used if desired.\n\t * @param interactFirst A boolean denoting whether this is the first in a series (usually two) of interactions.\n\t */\n\tpublic void interact(Ball context, Ball target, IDispatcher<IBallCmd> disp, Boolean interactFirst);\n\n\t/**\n\t * Null strategy with no-op behavior. \n\t * NOTE: We can use a lambda here instead of an anonymous inner class because IInteractStrategy is a functional interface (only has one\n\t * abstract method).\n\t */\n\tpublic static final IInteractStrategy NULL = (context, target, disp, isSource) -> {};\n\t\n}", "static HintStrategyTable createHintStrategies(HintStrategyTable.Builder builder) {\n return builder\n .hintStrategy(\"no_hash_join\", HintPredicates.JOIN)\n .hintStrategy(\"time_zone\", HintPredicates.SET_VAR)\n .hintStrategy(\"REPARTITION\", HintPredicates.SET_VAR)\n .hintStrategy(\"index\", HintPredicates.TABLE_SCAN)\n .hintStrategy(\"properties\", HintPredicates.TABLE_SCAN)\n .hintStrategy(\n \"resource\", HintPredicates.or(\n HintPredicates.PROJECT, HintPredicates.AGGREGATE,\n HintPredicates.CALC, HintPredicates.VALUES,\n HintPredicates.FILTER, HintPredicates.TABLE_FUNCTION_SCAN))\n .hintStrategy(\"AGG_STRATEGY\",\n HintStrategy.builder(HintPredicates.AGGREGATE)\n .optionChecker(\n (hint, errorHandler) -> errorHandler.check(\n hint.listOptions.size() == 1\n && (hint.listOptions.get(0).equalsIgnoreCase(\"ONE_PHASE\")\n || hint.listOptions.get(0).equalsIgnoreCase(\"TWO_PHASE\")),\n \"Hint {} only allows single option, \"\n + \"allowed options: [ONE_PHASE, TWO_PHASE]\",\n hint.hintName)).build())\n .hintStrategy(\"use_hash_join\",\n HintPredicates.or(\n HintPredicates.and(HintPredicates.CORRELATE, temporalJoinWithFixedTableName()),\n HintPredicates.and(HintPredicates.JOIN, joinWithFixedTableName())))\n .hintStrategy(\"breakable\", HintPredicates.SETOP)\n .hintStrategy(\"async_merge\", HintPredicates.SORT)\n .hintStrategy(\"mini_batch\",\n HintPredicates.and(HintPredicates.WINDOW, HintPredicates.PROJECT))\n .hintStrategy(\"fast_snapshot\", HintPredicates.SNAPSHOT)\n .hintStrategy(\"use_merge_join\",\n HintStrategy.builder(\n HintPredicates.and(HintPredicates.JOIN, joinWithFixedTableName()))\n .excludedRules(EnumerableRules.ENUMERABLE_JOIN_RULE).build())\n .hintStrategy(\n \"preserved_project\", HintStrategy.builder(\n HintPredicates.PROJECT).excludedRules(CoreRules.FILTER_PROJECT_TRANSPOSE).build())\n .build();\n }", "public interface ConnectionSelectStrategy {\n /**\n * select strategy\n * \n * @param conns\n * @return\n */\n Connection select(List<Connection> conns);\n}", "boolean supportsStrategy(String strategy);", "public interface IAlgorithm {\n void go();\n}", "protected Strategy getStrategy(){\n return Strategy.P2P_STAR;\n }", "public interface BoardMoveStrategy {\n\n /**\n * Function that checks if there are any moves possible.\n *\n * <p>Iterates through all gems and looks for pairs or two or\n * constructions like \"xox\" where another x could fill in.\n * For each case a different function is called which checks for\n * a valid move.</p>\n *\n * @return returns two jewels in a list to swap if move is possible.\n */\n List<Jewel> getValidMovePair();\n}", "public CrawlerReportStrategy getStrategy(String inputURL, String strategyKey) {\n\n CrawlerReportStrategy strategy = null;\n\n if (\"S\".equals(strategyKey) && inputURL != null) {\n strategy = specificURLStrategy;\n ((SpecificURLStrategy) specificURLStrategy).setInputURL(inputURL);\n } else if (\"C\".equals(strategyKey)) {\n strategy = topComplexityCountStrategy;\n } else {\n strategy = allURLStrategy;\n }\n\n return strategy;\n }", "public Decision(final DecisionStrategy strategy, final String name, final Collection<Choice> choices) {\n this.strategy = strategy;\n this.name = name;\n this.choices = new ArrayList<Choice>(choices);\n }", "public static interface PredictorSelectionStrategy {\n /**\n * Injects kernel to kernel-MA according to predictor internal data.\n */\n public void injectKernel(final Predictor predictor);\n\n /**\n * Maximum size of kernels\n */\n public int kernelSize();\n\n /**\n * Creates a brand new predictor.\n */\n public PredictorListener buildPredictor();\n }", "public synchronized Procedure getNext() {\n\t\tif (!this.hasNext())\n\t\t\treturn null;\n\n\t\tif(!firstOrderCandidates.isEmpty()) {\n\t\t\tProcedure procId = selectProcedureAndRemove(/*firstOrderCandidates*/);\n\n\t\t\tModuleStat stat = getModuleStat(procId.getModuleId());\n\t\t\tapplyCandidate(procId, stat, true);\n\t\t\treturn procId;\n\t\t}\n\t\t\n\t\t//if(order.hasNext() && candidates.size()<max_candidates_size) {\n\t\t//\tcandidates.addAll(order.getNexts(max_candidates_size-candidates.size()));\n\t\t//}\n\t\t\t\n\t\twhile(order.hasNext() && candidatesSize<max_candidates_size) {\n\t\t\tProcedure next = order.getAnyNext();\n\t\t\taddCandidate(next);\n\t\t}\n\t\t\n\t\tModule bestModule = getBestModuleId(modules.keySet());\n\t\t//IRModuleId bestModule = getBestModuleId(candidates.keySet());\n\t\t\n\t\t//if(bestModule==null) {\n\t\t//\tbestModule = candidates.keySet().iterator().next();\n\t\t//}\n\t\t\n\t\tif(bestModule!=null) {\n\t\t\tIterator<Procedure> it = order.getNextOfModule(bestModule);\n\t\t\twhile(it.hasNext()) {\n\t\t\t\tProcedure next = it.next();\n\t\t\t\taddCandidate(next);\n\t\t\t}\t\n\t\t}\n\t\t\n\t\tSet<Procedure> procedures = bestModule==null?\n\t\t\t\tCollections.<Procedure>emptySet() : candidates.get(bestModule);\n\t\t\n\t\tif(procedures.isEmpty()){\n\t\t\tbestModule = getBestModuleId(candidates.keySet());\n\t\t\t\n\t\t\tif(bestModule==null) {\n\t\t\t\tbestModule = candidates.keySet().iterator().next();\n\t\t\t}\n\t\t\t\n\t\t\t{\n\t\t\t\tIterator<Procedure> it = order.getNextOfModule(bestModule);\n\t\t\t\twhile(it.hasNext()) {\n\t\t\t\t\tProcedure next = it.next();\n\t\t\t\t\taddCandidate(next);\n\t\t\t\t}\t\n\t\t\t}\n\t\t\t\n\t\t\tprocedures = candidates.get(bestModule);\n\t\t}\n\t\t\n\t\tIterator<Procedure> it = procedures.iterator();\n\t\tassert(it.hasNext());\n\t\t\n\t\tProcedure nextProc = it.next();\n\t\t\n\t\tModuleStat stat = getModuleStat(bestModule);\n\t\t\n\t\tapplyCandidate(nextProc, stat, false);\n\t\t\n\t\tif(!stat.waitLoading()) {\n\t\t\twhile(it.hasNext()) {\n\t\t\t\tProcedure procId = it.next();\n\t\t\t\taddCandidate(procId);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn nextProc;\n\t}", "@SuppressWarnings(\"unchecked\")\n public static void prepareStrategy(final int nFolds, final String splitPath, final String recPath, final String outPath) {\n for (int i = 0; i < nFolds; i++) {\n File trainingFile = new File(splitPath + \"train_\" + i + \".csv\");\n File testFile = new File(splitPath + \"test_\" + i + \".csv\");\n File recFile = new File(recPath + \"recs_\" + i + \".csv\");\n DataModelIF<Long, Long> trainingModel;\n DataModelIF<Long, Long> testModel;\n DataModelIF<Long, Long> recModel;\n try {\n trainingModel = new SimpleParser().parseData(trainingFile);\n testModel = new SimpleParser().parseData(testFile);\n recModel = new SimpleParser().parseData(recFile);\n } catch (IOException e) {\n e.printStackTrace();\n return;\n }\n\n Double threshold = REL_TH;\n String strategyClassName = \"net.recommenders.rival.evaluation.strategy.UserTest\";\n EvaluationStrategy<Long, Long> strategy = null;\n try {\n strategy = (EvaluationStrategy<Long, Long>) (Class.forName(strategyClassName)).getConstructor(DataModelIF.class, DataModelIF.class, double.class).\n newInstance(trainingModel, testModel, threshold);\n } catch (InstantiationException | IllegalAccessException | NoSuchMethodException | ClassNotFoundException | InvocationTargetException e) {\n e.printStackTrace();\n }\n\n DataModelIF<Long, Long> modelToEval = DataModelFactory.getDefaultModel();\n for (Long user : recModel.getUsers()) {\n assert strategy != null;\n for (Long item : strategy.getCandidateItemsToRank(user)) {\n if (!Double.isNaN(recModel.getUserItemPreference(user, item))) {\n modelToEval.addPreference(user, item, recModel.getUserItemPreference(user, item));\n }\n }\n }\n try {\n DataModelUtils.saveDataModel(modelToEval, outPath + \"strategymodel_\" + i + \".csv\", true, \"\\t\");\n } catch (FileNotFoundException | UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n }\n }", "public static SelectiveSearchSegmentationStrategyMultiple createSelectiveSearchSegmentationStrategyMultiple(SelectiveSearchSegmentationStrategy s1)\r\n {\r\n \r\n SelectiveSearchSegmentationStrategyMultiple retVal = SelectiveSearchSegmentationStrategyMultiple.__fromPtr__(createSelectiveSearchSegmentationStrategyMultiple_3(s1.getNativeObjAddr()));\r\n \r\n return retVal;\r\n }", "private static PrimeStrategyThread primeStrategiesThreadSwitch(String name, Integer from, Integer to, PrimeStrategyEnum primeStrategyEnum){\n switch (primeStrategyEnum){\n case STRATEGY_1: return new Strategy1Thread(name, from, to);\n case STRATEGY_2: return new Strategy2Thread(name, from, to);\n case STRATEGY_3: return new Strategy3Thread(name, from, to);\n }\n return null;\n }", "public interface TravelStrategy {\r\n\t/**\r\n\t * Returns the floor number of the passenger's current destination, so that other strategies can base their\r\n\t * decisions on where the passenger is trying to get to.\r\n\t */\r\n\tint getDestination();\r\n\t\r\n\t/**\r\n\t * Called when it is time to schedule a PassengerNextDestinationEvent according to the rules of this travel strategy.\r\n\t * Typically this occurs when the passenger departs the elevator on the correct floor, but that is not guaranteed.\r\n\t * @param currentFloor the floor that the passenger got off.\r\n\t */\r\n\tvoid scheduleNextDestination(Passenger passenger, Floor currentFloor);\r\n}", "interface OptimizationStrategy<L, T extends Number> {\n\n /** Returns what the concrete strategy finds to be the shortest Hamiltonian Cycle.\n *\n * Note, this may differ from the actual best cycle.\n */\n Cycle getOptimalCycle(Graph<L, T> graph);\n}", "private void computeStrategy(int player) {\n strategy = new MixedStrategy(nActs[player], 0d);\n double[] stratPayoffs = SolverUtils.computePureStrategyPayoffs(eGame, player, predictedOutcome, false);\n strategy.setBestResponse(stratPayoffs);\n }", "public interface PaymentStrategy {\n\tpublic void pay(int amount);\n}", "@Override\n\tprotected boolean rulesGeneration() {\n\t\tGlobal.logger.finer(\"--------------------- S101 rulesGeneration() ----------------- \");\n\t\t//Global.logger.finer(this.toString());\t\t\n\t\tif(activationGuards()){\n\t\t\ttry {\n\t\t\t\tthis.categories.beforeFirst();\n\t\t\t\t\n\t\t\t\twhile (!this.categories.isClosed() && this.categories.next()) {\n\t\t\t\t\tgroupName = this.categories.getString(\"name\");\n\t\t\t\t\tGlobal.logger.fine(\"Creating new S102 [\" + groupName + \", \" + 1 +\"] \");\n\t\t\t\t\tcreateRule(new S102(course_ID, groupName, 1));\n\t\t\t\t\t\n\t\t\t\t\tGlobal.logger.fine(\"Creating new S103 [\" + groupName + \", study ]\");\n\t\t\t\t\tcreateRule(new S103(course_ID, groupName, \"study\"));\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\telse \n\t\t\treturn false;\n\t\treturn true;\n\t}", "public ConstantStrategy(Shape...shapes){\n\n\t\tthis.shapes = shapes;\n\t\tthis.index = 0;\n\t}", "public interface IPlayerStrategy {\n\tIOrder createOrder() throws Exception;\n\n\tIPlayerStrategy cloneStrategy(IPlayerModel p_player) throws Exception;\n}", "private interface DPResultFactory\n {\n\n DecisionResult getInstance(ExtendedDecision combiningAlgResult, EvaluationContext individualDecisionEvaluationContext, Optional<EvaluationContext> mdpContext, UpdatableList<PepAction> basePepActions,\n ImmutableList<PrimaryPolicyMetadata> applicablePolicies);\n\n }", "@Override\n public DRFLPSolution algorithm(DRFLPInstance instance) {\n try {\n List<Future<DRFLPSolution>> futures = new ArrayList<>();\n RandomManager.reinitialize(RandomType.LEGACY, 0, this.n);\n for (int i = 0; i < n; i++) {\n int _i = i;\n futures.add(executor.submit(() -> {\n RandomManager.reset(_i);\n return alg.algorithm(instance);\n }));\n }\n var results = ConcurrencyUtil.awaitAll(futures);\n DRFLPSolution best = null;\n for(var solution: results){\n if(solution.isBetterThan(best)){\n best = solution;\n }\n }\n return best;\n } finally {\n executor.shutdown();\n }\n }", "public int getStrategy() {\n\t\t \n\t\t return strategyInt;\n\t}", "private CompositeStrategyInterface getStrategyFromClass (String class_name) throws ClassNotFoundException, NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException {\n\t\t\n\t \t\n \t// Reflection load of the class\n \tClass<?> c = Class.forName(\"es.um.dis.umutextstats.compositestrategies.\" + class_name);\n \t\n \t\n \t// Create the dimension\n \tCompositeStrategyInterface o = (CompositeStrategyInterface) c.getConstructor().newInstance();\n \t\n \treturn o;\n\t \t\n\t}", "public void main()\n {\n ContextImplementation context = new ContextImplementation(new StrategyAImplementation());\n context.doSomething();\n\n context.setStrategy(new StrategyBImplementation());\n context.doSomething();\n\n // Define a one-to-many dependency between objects so that when the object change states,\n // all it dependents are notified and updated automatically.\n SubjectImplementation subject = new SubjectImplementation();\n\n ObserverInterface saori = new ObserverImplementation(\"Saori\");\n subject.attach(new ObserverImplementation(\"Horatio\"));\n subject.attach(new ObserverImplementation(\"Harper\"));\n subject.attach(saori);\n\n subject.notifyObservers(\"Leon departed for work\");\n\n subject.detach(saori);\n subject.notifyObservers(\"Leon arrived back from work\");\n\n // Attach additional responsibilities to an object dynamically.\n // Decorators provide a flexible alternative to subclassing in order to extend features/functions.\n // Also know as a wrapper.\n Component component = new ComponentImplementation();\n component.doSomething();\n\n Component decoratorA = new DecoratorAImplementation(component);\n decoratorA.doSomething();\n\n Component decoratorB = new DecoratorBImplementation(component);\n decoratorB.doSomething();\n\n Component decoratorC = new DecoratorBImplementation(decoratorA);\n decoratorC.doSomething();\n\n // Define a skeleton of an algorithm in an operation deferring steps to the subclasses.\n // Template method design pattern lets subclasses redefine certain steps on an algorithm without changing the structure of the algorithm.\n new TemplateMethodAImplementation().templateMethod();\n\n new TemplateMethodBImplementation().templateMethod();\n\n // Defines a higher-level interface that makes the subsystems easier to use.\n // Client of the facade don't have to access the sub system objects directly.\n new Facade().doSomething();\n\n // Converts the interface of a class into another interface clients expect.\n // Adapter lets classes work together that couldn't otherwise because of incompatible interfaces.\n // Target defines the interface that a client uses, Adaptee defines and existing interface that needs to be adapted, and Adapter adapts the interface of Adaptee to the Target interface.\n Target adapter = new Adapter();\n adapter.request();\n\n // Ensure a class only has one instance, and provide a global point of access to it.\n // The class itself is responsible for keeping track of it sole instance.\n // The class can ensure that no other instances can be created (by intercepting requests to create new objects), and provide a way to access to access to single instances.\n Singleton singleton = Singleton.getInstance();\n singleton.doSomething();\n\n // Defines an object that encapsulates how a set of objects interact.\n // Mediator promotes loose coupling by keeping objects from referring to each other explicitly, and lets you vary their interaction independently.\n Mediator mediator = new MediatorImplementation(); // Defines the mediator interface enabling a community of colleague objects to interact.\n Colleague a = new ColleagueAImplementation(mediator); // Each colleague knows its mediator objects.\n // The colleague classes are decoupled, adding a new colleague does not impact mediation.\n Colleague b = new ColleagueBImplementation(mediator);\n\n // Each colleague communicates with its mediator whenever it would have otherwise communicated with another colleague directly.\n a.sendMessage(\"Hi Horatio\");\n b.receiveMessage();\n\n // Reduces communication channels between colleagues since a colleague only has to communicate with the mediator.\n b.sendMessage(\"Hi Harper\");\n a.receiveMessage();\n\n // Decouples an abstraction from it implementation so that the two can vary independently.\n // Divides the abstraction and the implementation into separate class hierarchies.\n // Changes in the implementation of an abstraction should not have an impact on clients.\n Implementor impA = new ImplementorA();\n Implementor impB = new ImplementorB();\n\n // Implementation of an abstraction can be configured at runtime.\n Client clientA = new Client(new AbtractionImplementation(impA));\n clientA.doSomething();\n\n Client clientB = new Client(new AbtractionImplementation(impB));\n clientB.doSomething();\n\n // Command pattern decouples the object that invokes the operation from the one that knows how to perform it.\n Receiver receiver = new Receiver();\n // Client create a command implementation and specifies a receiver.\n Command command = new CommandImplementation(receiver);\n Invoker invoker = new Invoker();\n // Invoker stores the command object.\n invoker.setCommand(command);\n // Invoker issues a request by calling Execute on the command.\n invoker.execute();\n\n }", "public static AbstractStrategy<IntVar> activity(IntVar[] VARS, double GAMMA, double DELTA, int ALPHA,\n int FORCE_SAMPLING, long SEED) {\n return new ActivityBased(VARS[0].getSolver(), VARS, GAMMA, DELTA, ALPHA, FORCE_SAMPLING, SEED);\n }", "public abstract void runAlgorithm();", "public IDetectionAlgorithm createInstance();", "public AbstractRecombinator() \r\n\t{\r\n\t\tsuper();\r\n\t\tsetPpl();\r\n\t\tsetSpl();\t\t\r\n\t}", "@Override\n protected Move makeDecision() {\n myTurn = index();\n /* block the nearest + most effective player (as in, people who arent blocked) */\n ArrayList<Move> pathMoves = new ArrayList<>();\n ArrayList<Move> playMoves = new ArrayList<>();\n ArrayList<Move> discardMoves = new ArrayList<>();\n Map<Integer, Card> destroyCards = new HashMap<Integer, Card>();\n Map<Integer, Card> repairCards = new HashMap<Integer, Card>();\n Map<Integer, Card> blockCards = new HashMap<Integer, Card>();\n Map<Integer, Card> pathCards = new HashMap<Integer, Card>();\n Set<Position> reachable = game().board().getReachable();\n canSee=false;\n canMove=false;\n canBlock=false;\n canRockfall=false;\n canRepair=false;\n int len = hand().size();\n for (int i = 0; i < len; ++i) {\n Card c = hand().get(i);\n if (c instanceof PathCard && !isSabotaged()) {\n pathCards.put(i,c);\n// pathMoves.addAll(generatePossiblePaths(i, (PathCard) c));\n canMove = true;\n }\n if (c instanceof PlayerActionCard) {\n// playMoves.addAll(generatePossiblePlayerActions(i, (PlayerActionCard) c));\n if(c.type()== Card.Type.BLOCK) {\n blockCards.put(i, c);\n canBlock=true;\n }\n else if(c.type()== Card.Type.REPAIR) {\n repairCards.put(i, c);\n canRepair=true;\n }\n }\n if (c.type() == Card.Type.MAP) {\n// playMoves.addAll(generatePossibleMap(i));\n mapIndex = i;\n canSee = true;\n }\n if (c.type() == Card.Type.ROCKFALL) {\n destroyCards.put(i,c);\n// playMoves.addAll(generatePossibleRockfall(i));\n canRockfall = true;\n }\n discardMoves.add(Move.NewDiscardMove(index(), i));\n }\n\n if(canSee) {\n //sum of all heuristics\n double sumGoal[] = new double[3];\n for (Position h : reachable) {\n sumGoal[0]+=(9-(8-h.x)+ 5-(4-h.y));\n sumGoal[1]+=(9-(8-h.x)+ 5-(2-h.y));\n sumGoal[2]+=(9-(8-h.x)+ 5-(-h.y));\n }\n //update goldProb\n for(int i=0; i<3; i++) {\n int seenSum=0;\n for(int j=0; j<numPlayers; j++) {\n if(j!=myTurn) {\n if(haveSeen.get(j)[i]==1) seenSum++;\n }\n }\n goldProb[i] = (i==1?0.5:1)*(1-haveSeen.get(myTurn)[i])*(mapRate*(seenSum/numPlayers)+(sumGoal[i]/10));\n }\n }\n\n// System.out.println(hand());\n// System.out.println(pathMoves);\n\n\n if (role() == Role.GOLD_MINER) {\n //Path\n if(canSee && !goldFound) {\n int selection=0;\n double maxProb=goldProb[0];\n for(int i=0; i<3; i++) {\n if(goldProb[i]>maxProb) {\n maxProb = goldProb[i];\n selection=i;\n }\n }\n Move look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.TOP);\n switch(selection) {\n case 0:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.TOP);\n break;\n case 1:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.MIDDLE);\n break;\n case 2:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.BOTTOM);\n break;\n }\n return look;\n }\n if(canMove) {\n int globalIndex = 0;\n double maxH = 0;\n double oldH;\n Position bp = new Position(0,0);\n boolean rotate = false;\n //Find best path to place;\n Board board = game().board().copy();\n oldH = getClosest(board);\n// System.out.print(getClosest(board)+\" : \");\n for( Map.Entry<Integer, Card> p : pathCards.entrySet()) {\n int index = p.getKey();\n Card path = p.getValue();\n ((PathCard)path).setRotated(false);\n Set<Position> placeable = game().board().getPlaceable((PathCard)path);\n for (Position h : placeable) {\n Board simulated = board.simulatePlaceCardAt((PathCard)path, h.x, h.y);\n// System.out.println(path.type());\n double cH = getClosest(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n maxH = cH;\n rotate=false;\n }\n }\n ((PathCard) path).setRotated(true);\n placeable = game().board().getPlaceable((PathCard)path);\n for (Position h : placeable) {\n Board simulated = board.simulatePlaceCardAt((PathCard)path, h.x, h.y);\n// System.out.println(simulated);\n double cH = getClosest(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n rotate=true;\n maxH = cH;\n }\n }\n }\n// System.out.println(oldH+\": \"+maxH+\" (\"+abs(maxH-oldH)+\")\");\n oldBoard = game().board().copy();\n if(maxH>0 && abs(maxH-oldH)>0.01)\n return Move.NewPathMove(index(), globalIndex, bp.x, bp.y, rotate);\n }\n //Unblock\n if(canRepair) {\n double blockMore = 0.0;\n int targetPlayer = -1;\n int cardIndex = 0;\n for(int i=0; i<numPlayers; i++) {\n //heal self\n if(i == myTurn) {\n for(Map.Entry<Integer, Card> r : repairCards.entrySet()) {\n int index = r.getKey();\n// System.out.println(Arrays.toString(game().playerAt(index()).sabotaged()));\n PlayerActionCard repair = (PlayerActionCard) r.getValue();\n if (game().playerAt(index()).isRepairable(repair.effects())) {\n return Move.NewPlayerActionMove(index(),index, index());\n }\n }\n }\n else if(i!=myTurn) {\n for(Map.Entry<Integer, Card> r : repairCards.entrySet()) {\n int index = r.getKey();\n PlayerActionCard repair = (PlayerActionCard) r.getValue();\n// System.out.println(Arrays.toString(game().playerAt(i).sabotaged()));\n if (game().playerAt(i).isRepairable(repair.effects())) {\n //calculate the should i repair? function\n double shouldIBlockMore = Probability[i]+(0.03*(numPlayers-i));\n if(blockMore<shouldIBlockMore) {\n blockMore = shouldIBlockMore;\n targetPlayer = i;\n cardIndex = index;\n }\n }\n }\n }\n }\n if(blockMore>0.75 && targetPlayer>=0)\n return Move.NewPlayerActionMove(index(), cardIndex, targetPlayer);\n }\n //Block Enemy\n if(canBlock) {\n double blockMore = 0.0;\n int targetPlayer = -1;\n int cardIndex = 0;\n for (int i = 0; i < numPlayers; i++) {\n if (i != myTurn) {\n for (Map.Entry<Integer, Card> b : blockCards.entrySet()) {\n int index = b.getKey();\n PlayerActionCard block = (PlayerActionCard) b.getValue();\n if (game().playerAt(i).isSabotageable(block.effects()[0])) {\n //calculate the should i repair? function\n double shouldIBlockMore = (1 - Probability[i]) * ((1 - Probability[i]) + 0.2 * (numPlayers - i));\n if (blockMore < shouldIBlockMore) {\n blockMore = shouldIBlockMore;\n targetPlayer = i;\n cardIndex = index;\n }\n }\n }\n }\n }\n if(blockMore>0.6 && targetPlayer>=0)\n return Move.NewPlayerActionMove(index(), cardIndex, targetPlayer);\n }\n //Fix (Rockfall)\n if(canRockfall) {\n int globalIndex = 0;\n double maxH = 0.0;\n Position bp = new Position(0,0);\n //Find best path to place;\n Board board = game().board().copy();\n for( Map.Entry<Integer, Card> d : destroyCards.entrySet()) {\n int index = d.getKey();\n Set<Position> destroyable = game().board().getDestroyable();\n for (Position h : destroyable) {\n Board simulated = board.simulateRemoveCardAt(h.x, h.y);\n// System.out.println(path.type());\n double cH = getClosest(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n maxH = cH;\n }\n }\n }\n oldBoard = game().board().copy();\n if(maxH>0)\n return Move.NewRockfallMove(index(), globalIndex, bp.x, bp.y);\n }\n //See map\n\n //Conserve (Find the best card to discard)\n\n //calculate the heuristics and adjust accordingly,\n //choose between playing a card or discarding.\n } else if (role() == Role.SABOTEUR) {\n //See map\n if(canSee && !goldFound) {\n int selection=0;\n //specific for saboteurs\n double maxProb=goldProb[0];\n for(int i=0; i<3; i++) {\n if(goldProb[i]>maxProb) {\n maxProb = goldProb[i];\n selection=i;\n }\n }\n Move look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.TOP);\n switch(selection) {\n case 0:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.TOP);\n break;\n case 1:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.MIDDLE);\n break;\n case 2:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.BOTTOM);\n break;\n }\n return look;\n }\n //Path\n if(canMove) {\n int globalIndex = 0;\n double maxH = 0.0;\n Position bp = new Position(0,0);\n boolean rotate = false;\n //Find best path to place;\n Board board = game().board().copy();\n double oldH = getClosestSabotage(board);\n for( Map.Entry<Integer, Card> p : pathCards.entrySet()) {\n int index = p.getKey();\n Card path = p.getValue();\n ((PathCard)path).setRotated(false);\n Set<Position> placeable = game().board().getPlaceable((PathCard)path);\n for (Position h : placeable) {\n Board simulated = board.simulatePlaceCardAt((PathCard)path, h.x, h.y);\n// System.out.println(path.type());\n double cH = getClosestSabotage(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n maxH = cH;\n rotate=false;\n }\n }\n ((PathCard) path).setRotated(true);\n placeable = game().board().getPlaceable((PathCard)path);\n for (Position h : placeable) {\n Board simulated = board.simulatePlaceCardAt((PathCard)path, h.x, h.y);\n// System.out.println(simulated);\n double cH = getClosestSabotage(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n rotate=true;\n maxH = cH;\n }\n }\n }\n oldBoard = game().board().copy();\n if(maxH>0 && abs(maxH-oldH)>0.01)\n return Move.NewPathMove(index(), globalIndex, bp.x, bp.y, rotate);\n }\n //Unblock Friend\n if(canRepair) {\n double blockMore = 0.0;\n int targetPlayer = -1;\n int cardIndex = 0;\n for(int i=0; i<numPlayers; i++) {\n if(i == myTurn) {\n for(Map.Entry<Integer, Card> r : repairCards.entrySet()) {\n int index = r.getKey();\n PlayerActionCard repair = (PlayerActionCard) r.getValue();\n if (game().playerAt(myTurn).isRepairable(repair.effects())) {\n return Move.NewPlayerActionMove(index(),index, index());\n }\n }\n }\n else if(i!=myTurn) {\n for(Map.Entry<Integer, Card> r : repairCards.entrySet()) {\n int index = r.getKey();\n PlayerActionCard repair = (PlayerActionCard) r.getValue();\n if (game().playerAt(i).isRepairable(repair.effects())) {\n //calculate the should i repair? function\n double shouldIBlockMore = (1-Probability[i])+(0.03*(numPlayers-i));\n if(blockMore<shouldIBlockMore) {\n blockMore = shouldIBlockMore;\n targetPlayer = i;\n cardIndex = index;\n }\n }\n }\n }\n }\n if(blockMore>0.75 && targetPlayer>=0)\n return Move.NewPlayerActionMove(index(), cardIndex, targetPlayer);\n }\n //Block Enemy\n if(canBlock) {\n double blockMore = 0.0;\n int targetPlayer = -1;\n int cardIndex = 0;\n for (int i = 0; i < numPlayers; i++) {\n if (i != myTurn) {\n for (Map.Entry<Integer, Card> b : blockCards.entrySet()) {\n int index = b.getKey();\n PlayerActionCard block = (PlayerActionCard) b.getValue();\n if (game().playerAt(i).isSabotageable(block.effects()[0])) {\n //calculate the should i repair? function\n double shouldIBlockMore = (Probability[i]) * ((Probability[i]) + 0.2 * (numPlayers - i));\n if (blockMore < shouldIBlockMore) {\n blockMore = shouldIBlockMore;\n targetPlayer = i;\n cardIndex = index;\n }\n }\n }\n }\n }\n if(blockMore>0.6 && targetPlayer>=0)\n return Move.NewPlayerActionMove(index(), cardIndex, targetPlayer);\n }\n //Sabotage (Rockfall)\n if(canRockfall) {\n int globalIndex = 0;\n double maxH = 0;\n Position bp = new Position(0,0);\n //Find best path to place;\n Board board = game().board().copy();\n for( Map.Entry<Integer, Card> d : destroyCards.entrySet()) {\n int index = d.getKey();\n Set<Position> destroyable = game().board().getDestroyable();\n for (Position h : destroyable) {\n Board simulated = board.simulateRemoveCardAt(h.x, h.y);\n// System.out.println(path.type());\n double cH = getClosestSabotage(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n maxH = cH;\n }\n }\n }\n oldBoard = game().board().copy();\n if(maxH>0)\n return Move.NewRockfallMove(index(), globalIndex, bp.x, bp.y);\n }\n //Conserve (Find the best card to discard\n\n //calculate the heuristics and adjust accordingly,\n //choose between playing a card or discarding.\n }\n return discardMoves.get(0);\n }", "public interface Strategy {\n /**\n * suggest next bid value according to current action status\n * @param auction - current auction status, must not be null\n * @return non-negative bid value according implementation less or equal than {@link Auction#getOwnCache()}\n */\n int nextBid(Auction auction);\n}", "private void initModelEntities(final Collection<String> strategiesElems_) {\n\t\tthis.strategies = new ArrayList<String>();\n\t\tfinal Iterator<String> iteStrategies = strategiesElems_.iterator();\n\t\twhile (iteStrategies.hasNext()) {\n\t\t\tfinal String strategyElement = iteStrategies.next();\n\t\t\tthis.strategies.add(strategyElement);\n\t\t}\n\t}", "public interface ChangeProducerStrategy {\n /**\n * For the register contents and change amount passed in computes the cash required to provide this change amount \n * with minimal amount of bills possible and returns it as a solution. If it is not possible to allocate cash for it - returns null.\n * \n * @param cashAvailable - cash available to produce the change amount requested.\n * @param changeAmount - change amount.\n * @return solution computed for the change or null if it is not possible to allocate cash for change.\n */\n Solution computeChange(Cash cashAvailable, int changeAmount);\n}", "public interface Strategy {\n\n void info();\n\n}", "@Override\n\tpublic CombatStrategy createStrategy(MapItem m) {\n\t\treturn null;\n\t}", "@SuppressWarnings(\"unchecked\")\n\tprivate void setRules() {\n\t\tthis.result = Result.START;\n\t\t// Create all initial rule executors, and shuffle them if needed.\n\t\tthis.rules = new LinkedList<>();\n\t\tModule module = getModule();\n\t\tfor (Rule rule : module.getRules()) {\n\t\t\tRuleStackExecutor executor = (RuleStackExecutor) getExecutor(rule, getSubstitution());\n\t\t\texecutor.setContext(module);\n\t\t\tthis.rules.add(executor);\n\t\t}\n\t\tif (getRuleOrder() == RuleEvaluationOrder.RANDOM || getRuleOrder() == RuleEvaluationOrder.RANDOMALL) {\n\t\t\tCollections.shuffle((List<RuleStackExecutor>) this.rules);\n\t\t}\n\t}", "public DefaultJobSelectionStrategy() {\n }", "public interface Strategy {\n public Integer pick_card( List<Card> hand, Suit trump, Suit round );\n}", "private static HintStrategyTable createHintStrategies() {\n return createHintStrategies(HintStrategyTable.builder());\n }", "public interface MigrationStrategy {\r\n\r\n\t/**\r\n\t * Create an array containing possible migration candidates for this population.\r\n\t * Migration candidates from (multiple) sub populations will be compared based\r\n\t * on their fitness and replace the worst n candidates of the target population.\r\n\t * \r\n\t * @param currentPopulation the current population sorted by fitness\r\n\t * @param migrationCount the number of candidates to create\r\n\t * @return the potential migration candidates\r\n\t */\r\n\tpublic Individual[] getMigrationCandidates(Individual[] currentPopulation, int migrationCount);\r\n\r\n\t/**\r\n\t * Return the number of individuals that will migrate from a population to\r\n\t * another.\r\n\t * \r\n\t * @return the number of individuals selected from this population.\r\n\t */\r\n\tpublic int getMigrationCount();\r\n\r\n}", "public Decision planBest(Context context, Decision defaultDecision);", "public interface EvaluationStrategy extends org.openrdf.query.algebra.evaluation.EvaluationStrategy\n{\n\n /**\n * Evaluates a @{link TupleExpr} under an iteration of @{link BindingSet}s.\n * @param tupleExpr the expression to evaluate\n * @param bIter a closable iteration of @{link BindingSet}s to be used as different BindingSets\n * on the variables of the {@code tupleExpr}\n * @return a closable iteration that contains @{link BindingSet}s on the variables\n * of the {@code tupleExpr}\n * @throws QueryEvaluationException when the evaluation fails\n */\n CloseableIteration<BindingSet,QueryEvaluationException>\n evaluate( TupleExpr tupleExpr, CloseableIteration<BindingSet, QueryEvaluationException> bIter )\n \t\tthrows QueryEvaluationException;\n\n}", "public interface TableChooseStrategy<R> {\n /**\n * choose table\n *\n * @param availableTables\n * @return the table or tables chosen\n */\n R choose(List<String> availableTables);\n}", "public interface SumStrategy {\n\n\tpublic double getSpecifiedValue(Property p);\n\t\n\tpublic String getStrategyType();\n\n}", "interface AgentTypeBehaviourFactory {\n\n /**\n * Forms OwnDesire WithAbstractIntention\n */\n OwnDesire.WithAbstractIntention formOwnDesireWithAbstractIntention(DesireKey desireKey);\n\n /**\n * Forms OwnDesire WithAbstractIntention with parent node\n */\n OwnDesire.WithAbstractIntention formOwnDesireWithAbstractIntention(DesireKey desireKey,\n DesireKey parentDesireKey,\n DesireParameters parentsDesireParameters);\n\n /**\n * Forms OwnDesire with reasoning command\n */\n OwnDesire.Reasoning formOwnDesireWithReasoningCommand(DesireKey desireKey);\n\n /**\n * Forms OwnDesire with reasoning command with parent node\n */\n OwnDesire.Reasoning formOwnDesireWithReasoningCommand(DesireKey desireKey,\n DesireKey parentDesireKey,\n DesireParameters parentsDesireParameters);\n\n /**\n * Forms OwnDesire with reasoning command\n */\n OwnDesire.Acting formOwnDesireWithActingCommand(DesireKey desireKey);\n\n /**\n * Forms OwnDesire with reasoning command with parent node\n */\n OwnDesire.Acting formOwnDesireWithActingCommand(DesireKey desireKey, DesireKey parentDesireKey,\n DesireParameters parentsDesireParameters);\n\n /**\n * Forms DesireForOthers\n */\n DesireForOthers formDesireForOthers(DesireKey desireKey);\n\n /**\n * Forms DesireForOthers with parent node\n */\n DesireForOthers formDesireForOthers(DesireKey desireKey, DesireKey parentDesireKey,\n DesireParameters parentsDesireParameters);\n\n /**\n * Forms DesireFromAnotherAgent WithAbstractIntention\n */\n Optional<DesireFromAnotherAgent.WithAbstractIntention> formDesireFromOtherAgentWithAbstractIntention(\n SharedDesireForAgents desireForAgents);\n\n /**\n * Forms DesireFromAnotherAgent WithAbstractIntention\n */\n Optional<DesireFromAnotherAgent.WithIntentionWithPlan> formDesireFromOtherAgentWithIntentionWithPlan(\n SharedDesireForAgents desireForAgents);\n\n}", "public interface PaymentStrategy {\n\n void pay(double amount);\n\n}", "public static ArrayList<Strategy> getTwoBestStrategies(StrategyPool sp)\r\n\t{\r\n\t\tArrayList <Strategy> twoBest = new ArrayList<Strategy>();\r\n\t\tStrategy best = null;\r\n\t\tStrategy secondBest = null;\r\n\t\t\r\n\t\tint minLost = Integer.MAX_VALUE;\r\n\t\tint minSecondLost = Integer.MAX_VALUE;\r\n\t\t\r\n\t\tfor(int i = 0; i<sp.pool.size(); i++)\r\n\t\t{\r\n\t\t\tStrategy temp = sp.pool.get(i);\r\n\t\t\tif(temp.lostCount < minLost)\r\n\t\t\t{\r\n\t\t\t\tminLost = temp.lostCount;\r\n\t\t\t\tbest = temp;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfor(int i = 0; i< sp.pool.size(); i++)\r\n\t\t{\r\n\t\t\tStrategy temp = sp.pool.get(i);\r\n\t\t\tif(temp.lostCount < minSecondLost && temp.lostCount > minLost)\r\n\t\t\t{\r\n\t\t\t\tminSecondLost = temp.lostCount;\r\n\t\t\t\tsecondBest = temp;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(best != null)\r\n\t\t{\r\n\t\t\ttwoBest.add(best);\r\n\t\t}\r\n\t\tif(best != null)\r\n\t\t{\r\n\t\t\ttwoBest.add(secondBest);\r\n\t\t}\r\n\t\t\r\n\t\treturn twoBest;\r\n\t}", "public void buildAllPossibleTrain() {\n while (depotOnThisLine.checkOnPossibilityCreatingTrain()) {\n try {\n trains.add(Factory.buildNewTrain(depotOnThisLine));\n } catch (DepotNotExistException e) {\n e.printStackTrace();\n }\n }\n }", "@Override\n public A makeDecision(S state) {\n metrics = new Metrics();\n StringBuffer logText = null;\n P player = game.getPlayer(state);\n List<A> results = orderActions(state, game.getActions(state), player, 0);\n timer.start();\n currDepthLimit = 0;\n do {\n incrementDepthLimit();\n if (logEnabled)\n logText = new StringBuffer(\"depth \" + currDepthLimit + \": \");\n heuristicEvaluationUsed = false;\n ActionStore<A> newResults = new ActionStore<>();\n for (A action : results) {\n double value = minValue(game.getResult(state, action), player, Double.NEGATIVE_INFINITY,\n Double.POSITIVE_INFINITY, 1);\n if (timer.timeOutOccurred())\n break; // exit from action loop\n newResults.add(action, value);\n if (logEnabled)\n logText.append(action).append(\"->\").append(value).append(\" \");\n }\n if (logEnabled)\n System.out.println(logText);\n if (newResults.size() > 0) {\n results = newResults.actions;\n if (!timer.timeOutOccurred()) {\n if (hasSafeWinner(newResults.utilValues.get(0)))\n break; // exit from iterative deepening loop\n else if (newResults.size() > 1\n && isSignificantlyBetter(newResults.utilValues.get(0), newResults.utilValues.get(1)))\n break; // exit from iterative deepening loop\n }\n }\n } while (!timer.timeOutOccurred() && heuristicEvaluationUsed);\n return results.get(0);\n }", "public AbstractCreatorStrategy(Integer priority) {\n\n this.priority = priority;\n }", "public Optional<TrafficStrategyRule> findMatchedStrategyRule(final LogicSQL logicSQL) {\n for (TrafficStrategyRule each : trafficStrategyRules) {\n TrafficAlgorithm trafficAlgorithm = trafficAlgorithms.get(each.getAlgorithmName());\n Preconditions.checkState(null != trafficAlgorithm, \"Traffic strategy rule configuration must match traffic algorithm.\");\n if (match(trafficAlgorithm, logicSQL.getSqlStatementContext())) {\n return Optional.of(each);\n }\n }\n return Optional.empty();\n }", "protected abstract void createInnerEstimatorsIfNeeded();", "public static int getStrategyChoice() {\r\n\t\tint strategy = -1;\r\n\t\tgetStrategyScanner = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Choose the strategy of your opponent:\" +\r\n\t\t\t\t\"\\n\\t(\" + RANDOM + \") - Random player\" +\r\n\t\t\t\t\"\\n\\t(\" + DEFENSIVE + \") - Defensive player\" +\r\n\t\t\t\t\"\\n\\t(\" + SIDES + \") - To-the-Sides player player\");\r\n\t\twhile (strategy != RANDOM & strategy != DEFENSIVE\r\n\t\t\t\t& strategy != SIDES) {\r\n\t\t\tstrategy=getStrategyScanner.nextInt();\r\n\t\t}\r\n\t\treturn strategy;\r\n\t}", "public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {\n switch ( lockMode ) {\n case PESSIMISTIC_FORCE_INCREMENT:\n return new PessimisticForceIncrementLockingStrategy( lockable, lockMode );\n case PESSIMISTIC_WRITE:\n return new PessimisticWriteSelectLockingStrategy( lockable, lockMode );\n case PESSIMISTIC_READ:\n return new PessimisticReadSelectLockingStrategy( lockable, lockMode );\n case OPTIMISTIC:\n return new OptimisticLockingStrategy( lockable, lockMode );\n case OPTIMISTIC_FORCE_INCREMENT:\n return new OptimisticForceIncrementLockingStrategy( lockable, lockMode );\n default:\n return new SelectLockingStrategy( lockable, lockMode );\n }\n \t}", "public interface IAlg<S extends Solution>{\n\n void Initialize();//初始化种群\n\n void Evolve();//一次迭代演化\n\n S SolveF();//指定最大函数估值次数求解问题(配置中读取)\n\n S Solve();//指定最大迭代次数求解问题(配置中读取)\n}", "private Candidate constructCandidate(final ActivationContext currentContext) {\n assert currentContext.getNumberOfClasses() == 3;\n // currentContext has a trace:\n // [C_0, s_0, C_1, s_1, C_2]\n // We now find possible \"piblings\", i.e. siblings of its parent.\n // For that, we invoke findExtensions on the prefix\n // [C_0]\n Map<Integer, ActivationContext> piblings = findExtensions(currentContext.getClass(0));\n\n // Also, we find possible siblings. For that, we invoke findExtensions\n // on the prefix\n // [C_0, s_0, C_1]\n Map<Integer, ActivationContext> siblings = findExtensions(currentContext.getClass(0),\n currentContext.getChildIndex(0), currentContext.getClass(1));\n\n // We now construct a super-instruction candidate, i.e.\n // a tree of height 2. The root of the tree is C_0 (its Java type is unknown).\n Candidate candidate = new Candidate(currentContext.getClass(0), \"?\");\n // Now, we add the children of C_0, i.e. the siblings of C_1 and C_1 itself.\n for (int piblingSlot : piblings.keySet()) {\n if (piblingSlot == currentContext.getChildIndex(0)) {\n // This is C_1. We add it to the candidate and proceed\n // with adding the siblings of C_2 and C_2 itself.\n Candidate.AstNode child =\n candidate.getRoot().setChild(piblingSlot, currentContext.getClass(1), \"?\");\n for (int siblingSlot : siblings.keySet()) {\n if (siblingSlot == currentContext.getChildIndex(1)) {\n // Add C_2\n child.setChild(siblingSlot,\n currentContext.getClass(2),\n currentContext.getJavaType());\n } else {\n // Add a sibling of C_2\n ActivationContext sibling = siblings.get(siblingSlot);\n child.setChild(siblingSlot,\n sibling.getClass(2),\n sibling.getJavaType());\n }\n }\n } else {\n ActivationContext pibling = piblings.get(piblingSlot);\n // Add a sibling of C_1.\n assert pibling.getNumberOfClasses() == 2;\n candidate.getRoot().setChild(piblingSlot,\n pibling.getClass(1),\n pibling.getJavaType());\n }\n }\n // The score of the super-instruction candidate corresponds to the number\n // of activations of the current context.\n candidate.setScore(contexts.get(currentContext));\n return candidate;\n }", "static ArrayList<OutputNode> buildOutputNodes(Boolean[][] winningRegions,\n Integer[][] strategy) {\n\n ArrayList<OutputNode> outputnodes = new ArrayList<>();\n for (int nodeIter = 0; nodeIter < winningRegions[0].length; ++nodeIter) {\n\n boolean wonByPlayer1;\n int strat;\n /**\n * if player 0 wins, mark wonByPlayer1 as false and check strategy[0]\n * for a valid strategy. Else, do this with strategy[1].\n */\n if (winningRegions[0][nodeIter]) {\n wonByPlayer1 = false;\n strat = strategy[0][nodeIter];\n } else {\n wonByPlayer1 = true;\n strat = strategy[1][nodeIter];\n }\n\n if (strat == -1) {\n OutputNode tempOutputNode = new OutputNode(nodeIter, wonByPlayer1);\n outputnodes.add(tempOutputNode);\n } else {\n OutputNode tempOutputNode = new OutputNode(nodeIter, wonByPlayer1,\n strat);\n outputnodes.add(tempOutputNode);\n }\n }\n\n return outputnodes;\n }", "public interface IStrategyInstance {\n void forceRefreshStrategy(String str);\n\n String getCNameByHost(String str);\n\n String getClientIp();\n\n List<IConnStrategy> getConnStrategyListByHost(String str);\n\n String getFormalizeUrl(String str);\n\n @Deprecated\n String getFormalizeUrl(String str, String str2);\n\n @Deprecated\n String getSchemeByHost(String str);\n\n String getSchemeByHost(String str, String str2);\n\n String getUnitPrefix(String str, String str2);\n\n void initialize(Context context);\n\n void notifyConnEvent(String str, IConnStrategy iConnStrategy, ConnEvent connEvent);\n\n void registerListener(IStrategyListener iStrategyListener);\n\n void saveData();\n\n void setUnitPrefix(String str, String str2, String str3);\n\n void switchEnv();\n\n void unregisterListener(IStrategyListener iStrategyListener);\n}", "public interface AwardStrategy\n{\n /**\n * Obtain a list of prizes, for a all existing strategies to retrieve awards. \n *\n * @return The list of prizes, required for a given strategy.\n */\n List<Prize> getPrizeList();\n}", "private ModelMethod createCallAutomata(JflowMethod cfm,Iterable<JflowMethod> itms)\n{\n ModelState st0 = ModelState.createSimpleState(cfm,0);\n ModelState st1 = ModelState.createSimpleState(cfm,0);\n st1.setFinal();\n int ctr = 0;\n\n for (JflowMethod fm : itms) {\n if (!empty_calls.contains(fm)) {\n\t ++ctr;\n\t ModelState st2 = ModelState.createCallState(cfm,0,fm,false,null);\n\t st0.addTransition(st2);\n\t if (model_master.doDebug()) System.err.println(\"Transition (Calla) \" + st0.getName() + \" -> \" + st2.getName());\n\t st2.addTransition(st1);\n\t if (model_master.doDebug()) System.err.println(\"Transition (Callb) \" + st2.getName() + \" -> \" + st1.getName());\n\t if (!complete_calls.containsKey(fm) && !methods_todo.contains(fm)) methods_todo.add(fm);\n }\n }\n\n if (ctr < CHET_BRANCH_SIZE) return null;\n\n return new ModelMethod(cfm,st0,st1);\n}", "private StrategyType getStrategyType(String type) throws Exception {\n switch (type) {\n case \"greedy\":\n return StrategyType.GREEDY;\n case \"careful\":\n return StrategyType.CAREFUL;\n case \"tactical\":\n return StrategyType.TACTICAL;\n default:\n throw new Exception(\"Not supported type: \" + type);\n }\n }", "public interface QComputablePlanner {\n\n public List<QValue> getQs(State s);\n\n public QValue getQ(State s, AbstractGroundedAction a);\n\n}", "public interface AsgStrategy {\n void apply(AsgQuery query, AsgStrategyContext context);\n}", "public interface Strategy {\n\n /**\n * This method is used to fetch the strategy percent for given two files\n * @return strategy percent for given two files\n */\n int calcPlagiarismPercent() throws ParserException;\n}", "public interface OptionsCollection {\n State getNextState(Commander commander);\n}", "public abstract void goNext();", "public void setSelectionStrategy( IAnswerSelectionStrategy iass );", "public interface LDABetaInitStrategy{\n\t/**\n\t * Given a model and the corpus initialise the model's sufficient statistics\n\t * @param model\n\t * @param corpus\n\t */\n\tpublic void initModel(LDAModel model, Corpus corpus);\n\t\n\t/**\n\t * initialises beta randomly s.t. each each topicWord >= 1 and < 2\n\t * @author Sina Samangooei ([email protected])\n\t *\n\t */\n\tpublic static class RandomBetaInit implements LDABetaInitStrategy{\n\t\tprivate MersenneTwister random;\n\t\t\n\t\t/**\n\t\t * unseeded random\n\t\t */\n\t\tpublic RandomBetaInit() {\n\t\t\trandom = new MersenneTwister();\n\t\t}\n\t\t\n\t\t/**\n\t\t * seeded random\n\t\t * @param seed\n\t\t */\n\t\tpublic RandomBetaInit(int seed) {\n\t\t\trandom = new MersenneTwister(seed);\n\t\t}\n\t\t@Override\n\t\tpublic void initModel(LDAModel model, Corpus corpus) {\n\t\t\tfor (int topicIndex = 0; topicIndex < model.ntopics; topicIndex++) {\n\t\t\t\tfor (int wordIndex = 0; wordIndex < corpus.vocabularySize(); wordIndex++) {\n\t\t\t\t\tdouble topicWord = 1 + random.nextDouble();\n\t\t\t\t\tmodel.incTopicWord(topicIndex,wordIndex,topicWord);\n\t\t\t\t\tmodel.incTopicTotal(topicIndex, topicWord);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "public interface AMDPModelLearner extends AMDPPolicyGenerator{\n\n\n public void updateModel(State s, Action a, List<Double> rewards, State sPrime, GroundedTask gt);\n\n\n}", "public interface Generator\n{\n /**\n * Returns a new Shape instance according to this generator's \n * strategy.\n * @param width\n * the width the game grid\n * @return \n * a new Shape \n */\n Shape getNext(int width);\n}", "public interface AlgorithmeAbstrait <E, A>\n{\n /**\n * Methode permettant de resoudre un probleme\n * a l'aide d'un algorithme de resolution \n * et une heuristique correspondante.\n * @param probleme celui sur lequel il faut executer l'algorithme\n * @param heuristique celle qu'il faut appliquer a l'algorithme, a condition qu'elle soit admissible\n * @return Une arraylist contenant la resolution du probleme\n */\n List<E> resoudre (\n ProblemeAbstrait <E, A> probleme, \n HeuristiqueAbstrait<E> heuristique\n );\n}", "public StrategyRandom() {\n name = \"Random\";\n }" ]
[ "0.6603482", "0.62123626", "0.6133704", "0.5684679", "0.55793077", "0.53002936", "0.5235674", "0.5092276", "0.5089059", "0.5088102", "0.50613475", "0.5017439", "0.49868894", "0.49702", "0.49668357", "0.49094096", "0.49091187", "0.48771828", "0.48695397", "0.4845127", "0.48382533", "0.48381352", "0.48235643", "0.48055103", "0.47961813", "0.47885984", "0.47779152", "0.47642827", "0.47591424", "0.47521088", "0.47320092", "0.47274095", "0.47168285", "0.46982294", "0.46945867", "0.46913236", "0.46878463", "0.46751785", "0.46652403", "0.46627143", "0.4662507", "0.46612906", "0.46479082", "0.46277723", "0.46101058", "0.46084288", "0.4606358", "0.46061116", "0.460392", "0.45932359", "0.4562546", "0.4562063", "0.4553924", "0.4549403", "0.4549223", "0.4544852", "0.45301387", "0.4523277", "0.45225802", "0.45212188", "0.4510252", "0.44996387", "0.4498686", "0.4497496", "0.4496951", "0.44949394", "0.44924825", "0.44912395", "0.44890568", "0.44810233", "0.44772762", "0.44663414", "0.44575432", "0.44553033", "0.44526005", "0.44513583", "0.44491854", "0.44423273", "0.44385552", "0.44356942", "0.44295928", "0.44287783", "0.44123447", "0.4406482", "0.44009152", "0.4383111", "0.4378323", "0.43726626", "0.43720147", "0.43702695", "0.43614748", "0.43594068", "0.43565193", "0.43556082", "0.43445358", "0.43429205", "0.43426803", "0.43334746", "0.43274015", "0.43260983" ]
0.62448126
1
BLACKBOX STRATEGIES Assignment strategy which selects a variable according to DomOverWDeg[1] and assign it to the selected value. [1]: F. Boussemart, F. Hemery, C. Lecoutre, and L. Sais, Boosting Systematic Search by Weighting Constraints, ECAI04.
public static AbstractStrategy<IntVar> domOverWDeg(IntVar[] VARS, long SEED, IntValueSelector VAL_SELECTOR) { return new DomOverWDeg(VARS, SEED, VAL_SELECTOR); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public VariableCoefficientTuple suggestBranchingVariable (TwoIntegerTuple childRectCounts ) {\r\n \r\n VariableCoefficientTuple result= new VariableCoefficientTuple(null, ZERO) ;\r\n \r\n //first get the best lp rects\r\n List<Rectangle> rectanglesToConsiderForBranchingVarCalculation = this.getRectanglesToConsiderForBranchingVarCalculation( );\r\n \r\n //collect 0 direction refcounts into this map\r\n Map<String, Integer> zeroVar_RefCountMap = new HashMap<String, Integer> () ;\r\n //and one diirection refconts into this map\r\n Map<String, Integer> oneVar_RefCountMap = new HashMap<String, Integer> () ;\r\n \r\n List<VariableCoefficientTuple> variablesUsedForBranchingInThisRectangle =null;\r\n for (Rectangle rect: rectanglesToConsiderForBranchingVarCalculation){\r\n variablesUsedForBranchingInThisRectangle = getVariablesUsedForBranchingInThisRectangle (rect);\r\n if (variablesUsedForBranchingInThisRectangle.size()>ZERO) {\r\n this.updateVariableRefCounts(zeroVar_RefCountMap, oneVar_RefCountMap, variablesUsedForBranchingInThisRectangle) ;\r\n }else {\r\n System.err.print(\"trying to branch a node which should have been marked infeasible\" );\r\n exit(ONE);\r\n }\r\n }\r\n \r\n \r\n //now find the highest refcount var, no matter its direction\r\n int highZeroFreq = zeroVar_RefCountMap.isEmpty()?ZERO:Collections.max( zeroVar_RefCountMap.values());\r\n int highOneFreq = oneVar_RefCountMap.isEmpty()? ZERO: Collections.max(oneVar_RefCountMap.values()) ;\r\n \r\n //we need to find the selected var's refcount on the other side\r\n int selectedVarRefCountOnOtherSide = ZERO;\r\n \r\n int totalRects = getNumberOfRects(this.myInfeasibleRectanglesList) ;\r\n \r\n if (highZeroFreq>highOneFreq) {\r\n result.varName=getHighestFreqVar (zeroVar_RefCountMap,highZeroFreq ) ;\r\n result.coeff=highZeroFreq;\r\n selectedVarRefCountOnOtherSide= oneVar_RefCountMap.get( result.varName)==null? ZERO : oneVar_RefCountMap.get( result.varName);\r\n //this is how many rects will survive on either side\r\n childRectCounts.zeroSideCount = totalRects - selectedVarRefCountOnOtherSide;\r\n childRectCounts.oneSideCount=totalRects -highZeroFreq ;\r\n \r\n } else {\r\n result.varName=getHighestFreqVar (oneVar_RefCountMap,highOneFreq ) ;\r\n result.coeff=highOneFreq;\r\n selectedVarRefCountOnOtherSide= zeroVar_RefCountMap.get( result.varName)==null? ZERO : zeroVar_RefCountMap.get( result.varName);\r\n \r\n childRectCounts.zeroSideCount = totalRects - highOneFreq;\r\n childRectCounts.oneSideCount=totalRects - selectedVarRefCountOnOtherSide;\r\n }\r\n \r\n return result;\r\n }", "public void SelectCAN(TableVar Variables) {\r\n float perf;\r\n int i, j, k, best, posicion[];\r\n\r\n posicion = new int[long_poblacion];\r\n for (i=0;i<long_poblacion;i++) {\r\n posicion[i] = 0;\r\n }\r\n \r\n // Compute the ranking of each individual of the population: element 0 is the better\r\n for (i=0;i<long_poblacion;i++) {\r\n // Find better individual of the rest\r\n best=-1; \r\n perf=0;\r\n for (j=0;j<long_poblacion;j++) {\r\n if (posicion[j]==0 && (best==-1 || Utils.BETTER(poblac.getIndivFitness(j), perf))) {\r\n // If the individual is better\r\n perf = poblac.getIndivFitness(j);\r\n best = j;\r\n }\r\n }\r\n // Mark the individual with the ranking\r\n posicion[best] = i; \r\n }\r\n \r\n // The intermediary population is the ordered copy\r\n for (i=0;i<long_poblacion;i++) {\r\n k = posicion[i];\r\n for (j=0;j<Variables.getNVars();j++)\r\n Inter.setCromElem(k,j, poblac.getCromElem(i,j));\r\n Inter.setIndivFitness(k, poblac.getIndivFitness(i));\r\n Inter.setIndivEvaluated(k,true);\r\n }\r\n \r\n }", "private void Deciderank() {\n\n\t\tfor(int i=0;i<banknode;i++){\n\t\t\tif(i<banknode*a1) {Bank.get(i).CAR=megaCAR;Bank.get(i).forcelev=megaCAR;}\n\t\t\tif(banknode*a1<=i&&i<=banknode*a2) {Bank.get(i).CAR=mediumCAR;Bank.get(i).forcelev=mediumCAR;}\n\t\t\tif(banknode*a2<i) {Bank.get(i).CAR=smallCAR;Bank.get(i).forcelev=smallCAR;}\n\t\t\t}\n\t\t}", "public void useNormalVarimax(){\n this. varimaxOption = true;\n }", "public void baiscSetting(){\n generations_ = 0;\n maxGenerations_ = ((Integer) this.getInputParameter(\"maxGenerations\")).intValue();\n populationSize_ = ((Integer) this.getInputParameter(\"populationSize\")).intValue();\n mutation_ = operators_.get(\"mutation\");\n crossover_ = operators_.get(\"crossover\");\n selection_ = operators_.get(\"selection\");\n learning_ = operators_.get(\"learning\");\n\n }", "private List<VariableCoefficientTuple> getVariablesUsedForBranchingInThisRectangle(Rectangle rect){\r\n List<VariableCoefficientTuple> variablesUsedForBranchingInThisRectangle = new ArrayList<VariableCoefficientTuple> ();\r\n \r\n for (String var : rect.zeroFixedVariables) {\r\n if (!treeNode_zeroFixedVariables.contains(var) ) \r\n variablesUsedForBranchingInThisRectangle.add(new VariableCoefficientTuple(var, ZERO) );\r\n }\r\n for (String var : rect.oneFixedVariables){ \r\n if ( !treeNode_oneFixedVariables.contains(var)) {\r\n variablesUsedForBranchingInThisRectangle.add(new VariableCoefficientTuple(var, ONE));\r\n } \r\n }\r\n \r\n return variablesUsedForBranchingInThisRectangle;\r\n }", "@Override\n protected void doAlgorithmA1() {\n int xP = 0;\n int yP = 0;\n\n\n //Taking the variable out of the list that are in the bounds\n //Testing that the bound has variables\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n xP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX().getPosition();\n }\n int xU = 0;\n int xL = 0;\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n yP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY().getPosition();\n }\n int yU = 0;\n int yL = 0;\n int cright = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCright();\n int cleft = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCleft();\n\n\n\n for (Variable variable : csp.getVars()) {\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n if (variable.getPosition() == xP) {\n xU = variable.getUpperDomainBound();\n xL = variable.getLowerDomainBound();\n }\n }\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n if (variable.getPosition() == yP) {\n yU = variable.getUpperDomainBound();\n yL = variable.getLowerDomainBound();\n }\n }\n }\n\n boolean first = false;\n boolean second = false;\n\n //Testing if the bound is true, false or inconclusive\n\n if (xL + cleft >= yU + cright) {\n first = true;\n }\n if (xU + cleft < yL + cright) {\n second = true;\n }\n\n //are first and second not equal is the bound not inconclusive\n if (first != second) {\n if (first) { //a true Simple Bound was found\n //checks if it was the last constraint in a csp\n //If so the csp is true\n //else check the next constraint and do this method again\n if (csp.getSimpleConstraints().size() - 1 == cIndex) {\n System.out.println(\"P is satisfiable\");\n System.out.println(System.nanoTime()-startTime);\n return;\n } else {\n bIndex = 0;\n cIndex++;\n unit=false;\n doAlgorithmA1();\n }\n } else if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) { //a false Simple Bound was found\n //\n bIndex = 0;\n cIndex = 0;\n if (isInconclusive) {\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n doAlgorithmA2();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n } else {//an inconclusive Simple Bound was found\n //checks if the bound wasn't already inconclusive\n if(!isInconclusive){\n unit=true;\n unitSB = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex);\n }else {\n unit=false;\n }\n isInconclusive = true;\n\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) {\n cIndex = 0;\n bIndex = 0;\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n }\n }", "public void selectAlgorithm2(){\n\n if(nifty.getCurrentScreen().findElementById(\"sliderPanel1\")!=null){\n \n nifty.removeElement(nifty.getCurrentScreen(),nifty.getCurrentScreen().findElementById(\"sliderPanel1\"));\n nifty.removeElement(nifty.getCurrentScreen(),nifty.getCurrentScreen().findElementById(\"sliderPanel2\"));\n nifty.removeElement(nifty.getCurrentScreen(),nifty.getCurrentScreen().findElementById(\"sliderPanel3\"));\n nifty.removeElement(nifty.getCurrentScreen(),nifty.getCurrentScreen().findElementById(\"sliderPanel4\"));\n nifty.removeElement(nifty.getCurrentScreen(),nifty.getCurrentScreen().findElementById(\"sliderPanel5\"));\n/*\n \n nifty.removeElement(nifty.getCurrentScreen(), numIslands);\n nifty.removeElement(nifty.getCurrentScreen(), islandRadius);\n nifty.removeElement(nifty.getCurrentScreen(), iterations);\n nifty.removeElement(nifty.getCurrentScreen(), displacement);\n nifty.removeElement(nifty.getCurrentScreen(), smoothing);\n \n nifty.removeElement(nifty.getCurrentScreen(), numIslandsLabel);\n nifty.removeElement(nifty.getCurrentScreen(), islandRadiusLabel);\n nifty.removeElement(nifty.getCurrentScreen(), iterationsLabel);\n nifty.removeElement(nifty.getCurrentScreen(), displacementLabel);\n nifty.removeElement(nifty.getCurrentScreen(), smoothingLabel);\n */\n }\n \n\n Screen screen = nifty.getCurrentScreen();\n Element layer = screen.findElementById(\"sliderPanel\");\n Element layer2;\n PanelBuilder panelBuilder = new PanelBuilder();\n SliderBuilder sliderBuilder = new SliderBuilder(false);\n LabelBuilder labelBuilder = new LabelBuilder();\n panelBuilder.childLayoutHorizontal();\n \n \n panelBuilder.id(\"sliderPanel6\");\n panelBuilder.build(nifty, screen, layer);\n layer2 = screen.findElementById(\"sliderPanel6\");\n labelBuilder.text(\"Amplitude: \");\n labelBuilder.build(nifty, screen, layer2);\n sliderBuilder.id(\"amplitude\");\n sliderBuilder.min(1);\n sliderBuilder.max(25);\n sliderBuilder.stepSize(5);\n sliderBuilder.initial(10.0f);\n sliderBuilder.build(nifty, screen, layer2);\n \n \n panelBuilder.id(\"sliderPanel7\");\n panelBuilder.build(nifty, screen, layer);\n layer2 = screen.findElementById(\"sliderPanel7\");\n labelBuilder.text(\"X_scale: \");\n labelBuilder.build(nifty, screen, layer2);\n sliderBuilder.id(\"x_scale\");\n sliderBuilder.min(1);\n sliderBuilder.max(100);\n sliderBuilder.stepSize(10);\n sliderBuilder.initial(100.0f);\n sliderBuilder.build(nifty, screen, layer2);\n \n panelBuilder.id(\"sliderPanel8\");\n panelBuilder.build(nifty, screen, layer);\n layer2 = screen.findElementById(\"sliderPanel8\");\n labelBuilder.text(\"Y_scale: \");\n labelBuilder.build(nifty, screen, layer2);\n sliderBuilder.id(\"y_scale\");\n sliderBuilder.min(1);\n sliderBuilder.max(100);\n sliderBuilder.stepSize(10);\n sliderBuilder.initial(100.0f);\n sliderBuilder.build(nifty, screen, layer2);\n \n panelBuilder.id(\"sliderPanel9\");\n panelBuilder.build(nifty, screen, layer);\n layer2 = screen.findElementById(\"sliderPanel9\");\n labelBuilder.text(\"Z_scale: \");\n labelBuilder.build(nifty, screen, layer2);\n sliderBuilder.id(\"z_scale\");\n sliderBuilder.min(1);\n sliderBuilder.max(100);\n sliderBuilder.stepSize(10);\n sliderBuilder.initial(100.0f);\n sliderBuilder.build(nifty, screen, layer2);\n \n \n\n }", "public void set_AllSpreadIndexToOne(){\r\n\t//test to see if the fuel moistures are greater than 33 percent.\r\n\t//if they are, set their index value to 1\r\n\tif ((FFM>33)){ // fine fuel greater than 33?\r\n\t\tGRASS=0; \r\n\t\tTIMBER=0;\r\n\t}else{\r\n\t\tTIMBER=1;\r\n\t}\r\n}", "protected void doDeduction() {\n\n boolean narrowed= false;\n\n unit=false;\n isInconclusive=false;\n\n int newXL;\n int newYU;\n\n Variable x = null;\n Variable y = null;\n\n for(Variable var : csp.getVars()){\n if(var.getPosition() == unitSB.getX().getPosition()){\n x = var;\n } else if(var.getPosition() == unitSB.getY().getPosition()){\n y = var;\n }\n }\n\n int xU = x.getUpperDomainBound();\n int yL = y.getLowerDomainBound();\n\n newXL = yL + unitSB.getCright();\n newYU = xU - unitSB.getCright();\n\n if(newXL>x.getLowerDomainBound()){\n Variable newX = new Variable(newXL, xU);\n newX.setPosition(x.getPosition());\n changeVariable(newX);\n narrowed= true;\n }\n if (newYU< y.getUpperDomainBound()){\n Variable newY = new Variable(yL, newYU);\n newY.setPosition(y.getPosition());\n changeVariable(newY);\n narrowed =true;\n }\n\n if(narrowed){\n doAlgorithmA1();\n }else {\n doAlgorithmA3();\n }\n\n }", "private void applySensoryInputToBrain() {\n\t\tArrayList<MNeuron> neurons = mnetwork.getNeurons();\n\n\t\t/* Temporarily hardcode id's of neurons of interest. */\n\t\tint numVSegs = Agent.configNumSegments;\n\t\tint firstVFoodNid = 3;\n\t\tint lastVFoodNid = firstVFoodNid + numVSegs - 1;\n\t\tint firstVWallNid = lastVFoodNid + 1;\n\t\tint lastVWallNid = firstVWallNid + numVSegs - 1;\n\t\tint firstVEnemyNid = lastVWallNid + 1;\n\t\tint lastVEnemyNid = firstVEnemyNid + numVSegs - 1;\n\n\t\t/*\n\t\t Provide input current the network using the sensory\n\t\t components of the interface.\n\t\t */\n\t\tfor (MNeuron n : neurons) {\n\t\t\tdouble current;\n\t\t\tint index;\n\t\t\tint id = n.getID();\n\n\t\t\t/* If the neuron is a food visual neuron. */\n\t\t\tif (id >= firstVFoodNid && id <= lastVFoodNid) {\n\t\t\t\tindex = id - 3;\n\t\t\t\tcurrent = ninterface.affectors.vFood[index];\n\t\t\t\tn.addCurrent(60.0*current);\n\t\t\t} /* If the neuron is a wall visual neuron. */ else if (id >= firstVWallNid && id <= lastVWallNid) {\n\t\t\t\tindex = id - numVSegs - 3;\n\t\t\t\tcurrent = ninterface.affectors.vWall[index];\n\t\t\t\tn.addCurrent(60.0*current);\n\t\t\t} /* If the neuron is an enemy visual neuron. */ else if (id >= firstVEnemyNid && id <= lastVEnemyNid) {\n\t\t\t\tindex = id - 2 * numVSegs - 3;\n\t\t\t\tcurrent = ninterface.affectors.vEnemy[index];\n\t\t\t\tn.addCurrent(60.0*current);\n\t\t\t}\n\t\t}\n\t}", "private void intervalsToPTreeCredalSet(PotentialInterval intervalSet,ProbabilityTree probTree,\n Configuration conf,int nvar){\n Vector vars=intervalSet.getVariables();\n \n if(nvar<vars.size()){ // make the top part of the tree with variables in X_I\n FiniteStates currentVar=(FiniteStates)vars.elementAt(nvar);\n int ncases=currentVar.getNumStates();\n probTree.assignVar(currentVar);\n conf.insert(currentVar, 0);\n for(int i=0;i<ncases;i++){\n conf.putValue(currentVar,i);\n intervalsToPTreeCredalSet(intervalSet,probTree.getChild(i),conf,nvar+1);\n }\n } // end if\n else{\n FiniteStates conditionalVar=(FiniteStates)(intervalSet.getVariables().elementAt(0));\n PotentialInterval intervalSetRestricted = (PotentialInterval)intervalSet.restrictVariable(conf);\n Vector extremePoints=intervalSetRestricted.getListExtrems();\n int nExtrems=extremePoints.size();\n FiniteStates transp=appendTransparentVariable(nExtrems);\n int ncases=conditionalVar.getNumStates();\n \n probTree.assignVar(transp);\n for(int i=0;i<nExtrems;i++){\n double array[]=(double [])(extremePoints.elementAt(i));\n probTree.getChild(i).assignVar(conditionalVar);\n for(int j=0;j<ncases;j++){\n probTree.getChild(i).getChild(j).assignProb(array[j]);\n }\n }\n } // end else\n }", "public abstract void assign(ParameterVector pv) throws SolverException;", "public void SelectDNF(TableVar Variables) {\r\n float perf;\r\n int i, j, k, m, best, posicion[];\r\n\r\n posicion = new int[long_poblacion];\r\n for (i=0;i<long_poblacion;i++) {\r\n posicion[i] = 0;\r\n }\r\n\r\n // Compute the ranking of each individual of the population: element 0 is the better\r\n for (i=0;i<long_poblacion;i++) {\r\n // Find better individual of the rest\r\n best=-1;\r\n perf=0;\r\n for (j=0;j<long_poblacion;j++) {\r\n if (posicion[j]==0 && (best==-1 || Utils.BETTER(poblac.getIndivFitness(j), perf))) {\r\n // If the individual is better\r\n perf = poblac.getIndivFitness(j);\r\n best = j;\r\n }\r\n }\r\n // Mark the individual with the ranking\r\n posicion[best] = i;\r\n }\r\n\r\n // The intermediary population is the ordered copy\r\n for (i=0;i<long_poblacion;i++) {\r\n k = posicion[i];\r\n for (j=0;j<Variables.getNVars();j++)\r\n for (m=0; m<=Variables.getNLabelVar(j); m++)\r\n Inter.setCromElemGene(k,j, m, poblac.getCromElemGene(i,j,m));\r\n Inter.setIndivFitness(k, poblac.getIndivFitness(i));\r\n Inter.setIndivEvaluated(k,true);\r\n }\r\n\r\n }", "public abstract IDecisionVariable getVariable();", "void mo12504a(brw brw, C0719a aVar);", "public void WhiteBalance(int choose)\n {\n Log.i(\"former WhiteBalance\",\"\"+params.getWhiteBalance());\n params.setWhiteBalance(effect_WhiteBalance[choose]);\n Log.i(\"later WhiteBalance\",\"\"+params.getWhiteBalance());\n }", "void setBestScore(double bestScore);", "public abstract Object getDecisionValue();", "public void chooseBiasValue() {\r\n \r\n if (biasMode.charAt(0) == 't')\r\n {\r\n for (int i=0; i < hiddenLayerContainer.getHiddenLayerContainer().size(); i++){\r\n hiddenLayerContainer.getHiddenLayerContainer().get(i).setBiasActive(true);\r\n }\r\n outputLayer.setBiasActive(true);\r\n }\r\n }", "private void BScreate() {\n\n\t\tint sum=0;//全枝数のカウント\n\t\tfor(int i=0;i<banknode;i++) sum+=Bank.get(i).deg;\n\n\t\t//e,d,nの決定\n\t\tif(NW==\"BA\"){\n\t\tfor(int i=0;i<banknode;i++) {\n\t\t\tBank.get(i).totalassets=E*((double)Bank.get(i).deg/(double)sum);\n\t\t\tBank.get(i).n=Bank.get(i).totalassets*Bank.get(i).CAR;\n\t\t\tBank.get(i).d=Bank.get(i).totalassets-Bank.get(i).n;\n\t\t\tBank.get(i).buffer=Bank.get(i).totalassets;\n\t\t}\n\t\t}\n\n\t\tif(NW==\"CM\"){\n\t\t\tfor(int i=0;i<banknode;i++){\n\t\t\t\tBank.get(i).totalassets=E/banknode;\n\t\t\t\tBank.get(i).n=Bank.get(i).totalassets*asyCAR;\n\t\t\t\tBank.get(i).forcelev=megaCAR;\n\t\t\t\tBank.get(i).d=Bank.get(i).totalassets-Bank.get(i).n;\n\t\t\t\tBank.get(i).buffer=Bank.get(i).totalassets;\n\t\t\t}\n\n\t\t}\n\n\t}", "@AbstractCustomGlobal.GlobalMethod(menuText=\"Set Threshold Probability\")\n public void setThreshold() {\n if(Tools.getGlobalTime()!=0){\n JOptionPane.showMessageDialog(null, \"You can change this probability only when the simulation start\",\"Alert\", JOptionPane.INFORMATION_MESSAGE);\n return;\n }\n String answer = JOptionPane.showInputDialog(null, \"Set the probability that a node can be selected to run.\");\n // Show an information message\n try{\n double k = Double.parseDouble(answer);\n Iterator<Node> it = Tools.getNodeList().iterator();\n while(it.hasNext()){\n Node n = it.next();\n if(n.getClass() == MSNode.class){\n MSNode n1 = (MSNode)n;\n n1.setThresholdProbability(k);\n }\n if(n.getClass() == MS2Node.class){\n MS2Node n1 = (MS2Node)n;\n n1.setThresholdProbability(k);\n }\n }\n JOptionPane.showMessageDialog(null, \"Well done you have set this value:\"+k,\"Notice\", JOptionPane.INFORMATION_MESSAGE);\n }catch(NumberFormatException e){\n JOptionPane.showMessageDialog(null, \"You must insert a valid double \", \"Alert\", JOptionPane.INFORMATION_MESSAGE);\n }\n }", "public static void gbpusdDEbest(String dir) {\n \n /**\n * Settings of the evolutionary algorithm - Differential Evolution\n */\n \n Algorithm de;\n int dimension = dim; //Length of an individual - when using functions in GFS with maximum number of required arguments max_arg = 2, 2/3 are designated for program, 1/3 for constant values - for 60 it is 40 and 20\n int NP = 75; //Size of the population - number of competitive solutions\n int generations = gen; //Stopping criterion - number of generations in evolution\n int MAXFES = generations * NP; //Number of fitness function evaluations\n double f = 0.5, cr = 0.8; //Scaling factor f and crossover rate cr\n AP.util.random.Random generator = new AP.util.random.UniformRandom(); //Random number generator\n \n /**\n * Symbolic regression part\n * \n * Settings of the dataset which is regressed\n * Example: Sextic problem\n */\n \n // 50 points from range <-1, 1>, another type of data providing is possible\n double[][] dataset_points = dataset;\n ArrayList<AP_object> GFS = new ArrayList<>();\n GFS.add(new AP_Plus()); //Addition\n GFS.add(new AP_Sub()); //Subtraction\n GFS.add(new AP_Multiply()); //Mulitplication\n GFS.add(new AP_Div()); //Divison\n GFS.add(new AP_Abs());\n GFS.add(new AP_Cos());\n GFS.add(new AP_Cubic());\n GFS.add(new AP_Exp());\n GFS.add(new AP_Ln());\n GFS.add(new AP_Log10());\n GFS.add(new AP_Mod());\n GFS.add(new AP_Quad());\n GFS.add(new AP_Sin());\n GFS.add(new AP_Sigmoid());\n GFS.add(new AP_Sqrt());\n GFS.add(new AP_Tan());\n GFS.add(new AP_aTOb());\n GFS.add(new AP_x1()); //Independent variable x1\n// GFS.add(new AP_Const_static()); //Constant object - value is evolved in the extension of the individuals\n //More functions and terminals for GFS can be found or added to model.ap.objects\n \n double const_min = -10; //Minimum value of constants\n double const_max = 10; //Maximum value of constants\n \n APtf tf = new APdataset(dataset_points, GFS, const_min, const_max); //Dataset constructor\n\n /**\n * Additional variables\n */\n \n int runs = run_count; //Number of runs of the regression\n \n double min; //Helping variable for best individual in terms of fitness function value\n double[] bestArray = new double[runs]; //Array for statistics\n int i, best; //Additional helping variables\n\n /**\n * Runs of the algorithm with statistical analysis\n */\n for (int k = 0; k < runs; k++) {\n\n best = 0;\n i = 0;\n min = Double.MAX_VALUE;\n \n de = new AP_DEbest(dimension, NP, MAXFES, tf, generator, f, cr, null);\n\n de.run();\n\n PrintWriter writer;\n\n try {\n writer = new PrintWriter(dir + tf.name() + \"-DEbest\" + k + \".txt\", \"UTF-8\");\n\n writer.print(\"{\");\n \n for (int ii = 0; ii < ((AP_DEbest)de).getBestHistory().size(); ii++) {\n\n writer.print(String.format(Locale.US, \"%.10f\", ((AP_DEbest)de).getBestHistory().get(ii).fitness));\n\n if (ii != ((AP_DEbest)de).getBestHistory().size() - 1) {\n writer.print(\",\");\n }\n\n }\n\n writer.print(\"}\");\n\n writer.close();\n\n } catch (FileNotFoundException | UnsupportedEncodingException ex) {\n Logger.getLogger(AP_LSHADE.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n bestArray[k] = de.getBest().fitness - tf.optimum();\n\n /**\n * AP best result value and equation.\n */\n\n System.out.println(\"=================================\");\n System.out.println(\"Best obtained fitness function value: \\n\" + (de.getBest().fitness - tf.optimum()));\n System.out.println(\"Equation: \\n\" + ((AP_Individual) de.getBest()).equation);\n System.out.println(\"Vector: \\n\" + Arrays.toString(((AP_Individual) de.getBest()).vector));\n System.out.println(\"=================================\");\n \n for(AP_Individual ind : ((AP_DEbest)de).getBestHistory()){\n i++;\n if(ind.fitness < min){\n min = ind.fitness;\n best = i;\n }\n if(ind.fitness == 0){\n System.out.println(\"Solution found in \" + i + \" CFE\");\n break;\n }\n }\n System.out.println(\"Best solution found in \" + best + \" CFE\");\n \n System.out.println(\"\\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\\n\");\n \n \n }\n\n System.out.println(\"=================================\");\n System.out.println(\"Min: \" + DoubleStream.of(bestArray).min().getAsDouble());\n System.out.println(\"Max: \" + DoubleStream.of(bestArray).max().getAsDouble());\n System.out.println(\"Mean: \" + new Mean().evaluate(bestArray));\n System.out.println(\"Median: \" + new Median().evaluate(bestArray));\n System.out.println(\"Std. Dev.: \" + new StandardDeviation().evaluate(bestArray));\n System.out.println(\"=================================\");\n \n }", "void setGensNoImprovement(int gensNoImprovement);", "@Override\n public void autoSetInternal() {\n // stupid irregular table... grr.\n switch ((int) weight) {\n // H, CT,TSO,ARM,LEG\n case 10:\n setInternal(3, 4, 3, 1, 2);\n break;\n case 15:\n setInternal(3, 5, 4, 2, 3);\n break;\n case 20:\n setInternal(3, 6, 5, 3, 4);\n break;\n case 25:\n setInternal(3, 8, 6, 4, 6);\n break;\n case 30:\n setInternal(3, 10, 7, 5, 7);\n break;\n case 35:\n setInternal(3, 11, 8, 6, 8);\n break;\n case 40:\n setInternal(3, 12, 10, 6, 10);\n break;\n case 45:\n setInternal(3, 14, 11, 7, 11);\n break;\n case 50:\n setInternal(3, 16, 12, 8, 12);\n break;\n case 55:\n setInternal(3, 18, 13, 9, 13);\n break;\n case 60:\n setInternal(3, 20, 14, 10, 14);\n break;\n case 65:\n setInternal(3, 21, 15, 10, 15);\n break;\n case 70:\n setInternal(3, 22, 15, 11, 15);\n break;\n case 75:\n setInternal(3, 23, 16, 12, 16);\n break;\n case 80:\n setInternal(3, 25, 17, 13, 17);\n break;\n case 85:\n setInternal(3, 27, 18, 14, 18);\n break;\n case 90:\n setInternal(3, 29, 19, 15, 19);\n break;\n case 95:\n setInternal(3, 30, 20, 16, 20);\n break;\n case 100:\n setInternal(3, 31, 21, 17, 21);\n break;\n case 105:\n setInternal(4, 32, 22, 17, 22);\n break;\n case 110:\n setInternal(4, 33, 23, 18, 23);\n break;\n case 115:\n setInternal(4, 35, 24, 19, 24);\n break;\n case 120:\n setInternal(4, 36, 25, 20, 25);\n break;\n case 125:\n setInternal(4, 38, 26, 21, 26);\n break;\n case 130:\n setInternal(4, 39, 27, 21, 27);\n break;\n case 135:\n setInternal(4, 41, 28, 22, 28);\n break;\n case 140:\n setInternal(4, 42, 29, 23, 29);\n break;\n case 145:\n setInternal(4, 44, 31, 24, 31);\n break;\n case 150:\n setInternal(4, 45, 32, 25, 32);\n break;\n case 155:\n setInternal(4, 47, 33, 26, 33);\n break;\n case 160:\n setInternal(4, 48, 34, 26, 34);\n break;\n case 165:\n setInternal(4, 50, 35, 27, 35);\n break;\n case 170:\n setInternal(4, 51, 36, 28, 36);\n break;\n case 175:\n setInternal(4, 53, 37, 29, 37);\n break;\n case 180:\n setInternal(4, 54, 38, 30, 38);\n break;\n case 185:\n setInternal(4, 56, 39, 31, 39);\n break;\n case 190:\n setInternal(4, 57, 40, 31, 40);\n break;\n case 195:\n setInternal(4, 59, 41, 32, 41);\n break;\n case 200:\n setInternal(4, 60, 42, 33, 42);\n break;\n }\n }", "public RandomNeighborhoodOperator(int nbRelaxedVars, long seed)\n{\n\trandom = new Random(seed);\n\tthis.nbRelaxedVars = nbRelaxedVars;\n\tselected = new TIntHashSet();\n}", "private void CreatingBeautyContentTopK() {\n\t\t\tConstraintsPlacement objConstraints= new ConstraintsPlacement(this);\r\n\t\t\t//Creating array with states\r\n\t\t\tArrayList<BlockNode> states = new ArrayList<BlockNode>();\r\n\t\t\t//Building the graph in a deph way\r\n\t \tGraphBuilder objGrapB= new GraphBuilder(1);\r\n\t \tint numElements=objElem.getNumberObjects();\r\n\t \tint numEnemies=objElem.getNumberObjectsEnemies();\r\n\t \tint globalControlSearch=0;\r\n\t \t//Beststates=objGrapB.basicDepthSearch(mediumStraight,height,numElements,numElements,states,objConstraints, objElem.getFinalList(),objElem);\r\n\t \tbestBranches=objGrapB.relativePositionDepthSearchTopK(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,-mediumStraight+1,mediumStraight-1,floorTileHeight,0,0,maxScreens,numEnemies,random,globalControlSearch);\r\n\t \t//Beststates=objGrapB.relativeTransPositionDepthSearch(mediumStraight,height,numElements,numElements,states,objConstraints, objElem.getFinalList(),objElem,-mediumStraight+1,mediumStraight-1,floorTileHeight,0,0,currentState,hTable);\r\n\t \r\n\t \tBranch objBranch=new Branch();\r\n\t \t//bestBranches=objBranch.sortBranches(bestBranches);\r\n\t \t\r\n\t \t//System.out.print( \"CounterStates\"+objGrapB.getCounterIDs() );\r\n\t \r\n\t //imprimiendo los estados visitados\r\n\t /*\r\n\t Iterator<BlockNode> nombreIterator = states.iterator();\r\n\t while(nombreIterator.hasNext()){\r\n\t \tBlockNode elemento = nombreIterator.next();\r\n\t \tSystem.out.print(elemento.getID()+\" / \");\r\n\t }*/\r\n\t \r\n\t //here we are painting as the best branches foundeded\r\n\t \r\n\t Iterator<Branch> nombreIterator = bestBranches.iterator();\r\n\t while(nombreIterator.hasNext()){\r\n\t \tBranch elemento = nombreIterator.next();\r\n\t \t//System.out.print(elemento.getHeuristicValue()+ \" / \");\r\n\t }\r\n\t \r\n\t \r\n\t //Here we will put the elements on the tile\r\n\t \t//Just here to implement the n screens!\r\n\t for(int i=0;i<maxScreens;i++)\r\n\t {//block from Lelis and Reis (>class GeradorDeFasses)\r\n/*\t \ttry {\r\n\t \t\tLevel levelScreen=PaintElements(((Branch)bestBranches.get(i)).getStates(),this.clone());\t\t\t\t\t\r\n\t\t\t\t\tScreen objScreen=new Screen();\r\n\t\t\t\t\tobjScreen.SaveScreen(levelScreen,odds,objElem);\r\n\t \t\tInformacoesTelas info = new InformacoesTelas();\r\n\t\t\t CopiaArquivos copiador = new CopiaArquivos();\r\n\t\t\t \r\n\t\t\t info = info.carregaInfoTela(\"infoTela\");\r\n\t\t\t\t\tinfo.setOutrasVariaveis(0, 0); // Salva outras informacoes da Tela\r\n\t\t\t\t\tinfo.salvaInfoTela(\"infoTela\", info);\t\t\t\t\t\r\n\t\t\t\t\tcopiador.copy(\"\" + i, \"Screens/\");\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (CloneNotSupportedException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t} catch (ClassNotFoundException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}*/\r\n\t }\r\n\t \r\n\t\t\t\r\n\t\t}", "float getBoost();", "@Override\n protected void calculateCategoryRates(Node node) {\n\n double propVariable = 1.0;\n int cat = 0;\n\n //if (/*invarParameter != null && */invarParameter.getValue() > 0 ) {\n //System.out.println(\"----------------\");\n double pr;\n if(invPrLogit){\n pr = 1.0/(1.0 + Math.exp(-invarParameter.getValue()));\n //System.out.println(pr);\n }else{\n pr = invarParameter.getValue();\n }\n\n if (hasPropInvariantCategory) {\n categoryRates[0] = 0.0;\n //System.out.println(getCurrModel()+\" \"+INVAR_INDEX);\n categoryProportions[0] = pr*INDICATORS[getCurrModel()][INVAR_INDEX];\n //System.out.println(invarParameter.getValue()+\" \"+INDICATORS[getCurrModel()][INVAR_INDEX]);\n //System.out.println(\"categoryProportions[0]: \"+categoryProportions[0]);\n }\n\n //System.out.println(invarParameter.getID()+\" \" +invarParameter.getValue()+\" \"+pr);\n propVariable = 1.0 - pr*INDICATORS[getCurrModel()][INVAR_INDEX];\n if (hasPropInvariantCategory) {\n cat = 1;\n }\n //}\n\n //System.out.println(\"categoryProportions[0]: \"+categoryProportions[0]);\n\n if (INDICATORS[getCurrModel()][SHAPE_INDEX] == PRESENT) {\n\n final double a = shapeParameter.getValue();\n double mean = 0.0;\n final int gammaCatCount = categoryCount - cat;\n //System.out.println(\"a: \"+a);\n final GammaDistribution g = new GammaDistributionImpl(a, 1.0 / a);\n //System.out.println(\"gammaCatCount:\"+gammaCatCount);\n //if(gammaCatCount == 3){\n //throw new RuntimeException(\"\");\n //}\n for (int i = 0; i < gammaCatCount; i++) {\n try {\n // RRB: alternative implementation that seems equally good in\n // the first 5 significant digits, but uses a standard distribution object\n if(a < 1e-3){\n\n categoryRates[i + cat] = Double.NEGATIVE_INFINITY;\n }else if(a > 1e10){\n categoryRates[i + cat] = 1.0;\n }else if (useBeast1StyleGamma) {\n categoryRates[i + cat] = GammaDistributionQuantile((2.0 * i + 1.0) / (2.0 * gammaCatCount), a, 1.0 / a);\n \t} else {\n \t\tcategoryRates[i + cat] = g.inverseCumulativeProbability((2.0 * i + 1.0) / (2.0 * gammaCatCount));\n \t}\n\n } catch (Exception e) {\n e.printStackTrace();\n System.err.println(\"Something went wrong with the gamma distribution calculation\");\n System.exit(-1);\n }\n mean += categoryRates[i + cat];\n\n categoryProportions[i + cat] = propVariable / gammaCatCount;\n }\n\n if(a >= 1e-3 ){\n\n mean = (propVariable * mean) / gammaCatCount;\n\n for (int i = 0; i < gammaCatCount; i++) {\n\n categoryRates[i + cat] /= mean;\n\n }\n }\n } else {\n\n int gammaCatCount = categoryCount - cat;\n //System.out.println(\"Hi!\");\n for(int i = cat; i < categoryRates.length;i++){\n categoryRates[i] = 1.0 / propVariable/gammaCatCount;\n\n categoryProportions[i] = propVariable/gammaCatCount;\n }\n }\n /*System.out.println(\"-------------------------------\");\n System.out.println(\"ID: \"+getID());\n System.out.println(modelChoice);\n System.out.print (invarParameter.getValue()*INDICATORS[getCurrModel()][INVAR_INDEX]+\" \");\n System.out.println(getID());\n System.out.println(\"alpha: \"+shapeParameter.getValue());\n System.out.println(\"invPr: \"+invarParameter.getValue());\n System.out.println(\"siteModel: \"+modelChoice.getValue());\n System.out.println(\"rate: \"+muParameter.getValue());\n for(int i = 0; i < categoryRates.length;i++){\n System.out.print(categoryRates[i]+\" \");\n }\n System.out.println();\n\n System.out.println(invarParameter.getValue());\n for(int i = 0; i < categoryProportions.length;i++){\n\n System.out.print(categoryProportions[i]+\" \");\n }\n System.out.println();\n System.out.println(\"----------------\"); */\n\n\n ratesKnown = true;\n }", "public void updateScoreboard() {\n\t\tif(obj != null) {\t\t\t\r\n\t\t\tobj.unregister();\r\n\t\t}\r\n\t\tobj = scoreboard.registerNewObjective(\"gui\", \"dummy\");\r\n\t\tobj.setDisplaySlot(DisplaySlot.SIDEBAR);\r\n\t\tobj.setDisplayName(\"§c§lVitality\");\r\n\t\tScore currentRank = obj.getScore(\"§e§lRank\");\r\n\t\tcurrentRank.setScore(40);\r\n\t\tScore currentRankVal = obj.getScore(\"§f\" + getRank().getName());\r\n\t\tcurrentRankVal.setScore(39);\r\n\t\tScore spacer1 = obj.getScore(\" \");\r\n\t\tspacer1.setScore(38);\r\n\t\tPrisonRank next = PrisonRank.getNextRank(rank);\r\n\t\tif(next != null) {\r\n\t\t\tScore nextRank = obj.getScore(\"§b§lProgress to \" + next.getName());\r\n\t\t\tnextRank.setScore(37);\r\n\t\t\tdouble percent = (Prison.getEco().getBalance(this) / next.getValue()) * 100;\r\n\t\t\tif(percent > 100) {\r\n\t\t\t\tpercent = 100;\r\n\t\t\t}\r\n\t\t\tScore nextRankVal = obj.getScore(\"§f\" + ((int)percent + \"%\"));\r\n\t\t\tnextRankVal.setScore(36);\r\n\t\t} else {\r\n\t\t\tScore nextRank = obj.getScore(\"§b§lNext Rank\");\r\n\t\t\tnextRank.setScore(37);\r\n\t\t\tScore nextRankVal = obj.getScore(\"§fNone\");\r\n\t\t\tnextRankVal.setScore(36);\r\n\t\t}\r\n\t\tScore spacer2 = obj.getScore(\" \");\r\n\t\tspacer2.setScore(35);\r\n\t\tScore money = obj.getScore(\"§a§lBalance\");\r\n\t\tmoney.setScore(34);\r\n\t\tScore moneyVal = obj.getScore(\"§f$\" + moneyFormat.format(Prison.getEco().getBalance(this)));\r\n\t\tmoneyVal.setScore(33);\r\n\t\tScore spacer3 = obj.getScore(\" \");\r\n\t\tspacer3.setScore(32);\r\n\t\t\r\n\t\tScore mult = obj.getScore(\"§6§lMultiplier\");\r\n\t\tmult.setScore(31);\r\n\t\t\r\n\t\tif(Multiplier.getMultiplier() > 1.0) {\r\n\t\t\tScore multVal = obj.getScore(\"§f\" + Multiplier.getMultiplier() + \"x\");\r\n\t\t\tmultVal.setScore(30);\r\n\t\t} else {\r\n\t\t\tScore multVal = obj.getScore(\"§fNone\");\r\n\t\t\tmultVal.setScore(30);\r\n\t\t}\r\n\t\tScore spacer4 = obj.getScore(\" \");\r\n\t\tspacer4.setScore(29);\r\n\t\tScore onlineStaff = obj.getScore(\"§c§lOnline Staff\");\r\n\t\tonlineStaff.setScore(28);\r\n\t\tScore onlineStaffVal = obj.getScore(\"§f\" + Prison.getStaffOnline().getCurrent());\r\n\t\tonlineStaffVal.setScore(27);\r\n\t}", "private void setWinningTuples() {\n\t\tWINS = new ArrayList<Set<CMNMove>>();\n\t\tSet<CMNMove> winSet = new TreeSet<CMNMove>();\n\t\tfor (int i = MM; i > 0; i--) {\n\t\t\tknapsack(winSet, CC, i, NN);\n\t\t}// end for\n\n\t}", "public void\nsetShininessElt(float value )\n\n{\n this.coinstate.shininess = value;\n}", "private void sharplyChange(){\r\n\t\t\tgovernmentLegitimacy -= 0.3;\r\n\t\t}", "public VariableUnit solve() {\n LinkedList<VariableUnit> processor = new LinkedList<VariableUnit>();\n\n VariableUnit vu1 = new VariableUnit(250.0, 'x');\n VariableUnit vu2 = new VariableUnit('+');\n VariableUnit vu3 = new VariableUnit(250.0, 'x');\n VariableUnit vu4 = new VariableUnit(501.0, 'x');\n VariableUnit vu5 = new VariableUnit('y');\n VariableUnit vu6 = new VariableUnit('-');\n alpha_arr.get(('x' - 'a')).addLast(vu1);\n alpha_arr.get(('x' - 'a')).addLast(vu2);\n alpha_arr.get(('x' - 'a')).addLast(vu3);\n op_order.add(vu1); op_order.add(vu2); op_order.add(vu3); op_order.add(vu6);\n op_order.add(vu4); op_order.add(vu6); op_order.add(vu5);\n assignValue(2.0, 'x');\n \n System.out.print(vu1); System.out.print(vu2); System.out.print(vu3);\n System.out.print(vu6); System.out.print(vu4); System.out.print(vu6);\n System.out.print(vu5);\n System.out.println();\n System.out.println(\"------------------------------\");\n \n VariableUnit temp, temp1;\n for (int i = 0; i < op_order.size(); i++) {\n \ttemp = op_order.pollFirst();\n \t\n \t\tswitch (temp.getVariable()) {\n \tcase '+':\n \t\t//if processor.isEmpty(): throw an exception\n \t\ttemp1 = processor.pop().add(op_order.pollFirst());\n \t\tprocessor.push(temp1);\n \t\tbreak;\n \tcase '-':\n \t\t//if processor.isEmpty(): throw an exception\n \t\ttemp1 = processor.pop().subtract(op_order.pollFirst());\n \t\tprocessor.push(temp1);\n \t\tbreak;\n \tdefault:\n \t\tprocessor.push(temp);\n \t\t}\n }\n\n /*\n * System.out.println(\"This equation is currently unsolvable.\");\n \tSystem.out.println(\"Try assigning values to some of the variables.\");\n */\n while (!processor.isEmpty()) {\n \top_order.addFirst(processor.pop());\n }\n \n ListIterator<VariableUnit> iter = op_order.listIterator();\n \n while ( iter.hasNext() ) {\n \tVariableUnit iter_temp = iter.next();\n \t//System.out.print(iter_temp.hasValue());\n \tif (iter_temp.hasValue()) {\n \t\tSystem.out.print( Double.toString(iter_temp.subValue()) );\n \t}\n \telse {\n \t\tSystem.out.print(iter_temp);\n \t}\n };\n System.out.println();\n \n return new VariableUnit(Double.NaN, ' ');\n }", "@Test\n public void testNaya() throws Exception {\n ICFG mCFG = null;\n\n // Why A,W ?\n // A -> start node\n // W -> end node\n ICFGBasicBlockNode A = new CFGBasicBlockNode(\"A\",null);\n ICFGBasicBlockNode W = new CFGBasicBlockNode(\"W\",null);\n // This constructor initializes mCFG with start & end node\n mCFG = new CFG(A, W);\n\n ConcreteConstant CONSTANT_TWO = new ConcreteConstant(2,mCFG);\n ConcreteConstant CONSTANT_FIVE = new ConcreteConstant(5,mCFG);\n ConcreteConstant CONSTANT_TWENTY = new ConcreteConstant(20,mCFG);\n ConcreteConstant CONSTANT_THIRTY = new ConcreteConstant(30,mCFG);\n\n\n // variables x & y\n Variable x = new Variable(\"x\", mCFG);\n Variable y = new Variable(\"y\", mCFG);\n Variable p = new Variable(\"p\", mCFG);\n Variable q = new Variable(\"q\", mCFG);\n\n True trueExpr = new True(mCFG);\n ICFGDecisionNode B = new CFGDecisionNode(mCFG,trueExpr);\n mCFG.addDecisionNode(B);\n\n ICFGBasicBlockNode C = new CFGBasicBlockNode(\"C\", mCFG);\n Input i1 = new Input(mCFG);\n Statement stmt1 = new Statement(mCFG, x, i1);\n C.setStatement(stmt1);\n mCFG.addBasicBlockNode(C);\n\n ICFGBasicBlockNode D = new CFGBasicBlockNode(\"D\", mCFG);\n Input i2 = new Input(mCFG);\n Statement stmt2 = new Statement(mCFG, y, i2);\n D.setStatement(stmt2);\n mCFG.addBasicBlockNode(D);\n\n LesserThanExpression expr3 = new LesserThanExpression(mCFG, x, y);\n ICFGDecisionNode E = new CFGDecisionNode(mCFG,expr3);\n mCFG.addDecisionNode(E);\n\n ICFGBasicBlockNode F = new CFGBasicBlockNode(\"F\", mCFG);\n AddExpression addExpr1 = new AddExpression(mCFG,x,y);\n Statement stmt3 = new Statement(mCFG, p, addExpr1);\n F.setStatement(stmt3);\n mCFG.addBasicBlockNode(F);\n\n ICFGBasicBlockNode G = new CFGBasicBlockNode(\"G\", mCFG);\n SubExpression subExpr1 = new SubExpression(mCFG,x,y);\n Statement stmt4 = new Statement(mCFG, p, subExpr1);\n G.setStatement(stmt4);\n mCFG.addBasicBlockNode(G);\n//\n//\n// //edges\n ICFEdge AB = new CFEdge(\"AB\", mCFG, A, B);\n ICFEdge BC = new CFEdge(\"BC\", mCFG, B, C);\n ICFEdge CD = new CFEdge(\"CD\", mCFG, C, D);\n ICFEdge DE = new CFEdge(\"DE\", mCFG, D, E);\n ICFEdge EF = new CFEdge(\"EF\", mCFG, E, F);\n ICFEdge EG = new CFEdge(\"EG\", mCFG, E, G);\n ICFEdge FB = new CFEdge(\"FB\", mCFG, F, B);\n ICFEdge GB = new CFEdge(\"GB\", mCFG, G, B);\n ICFEdge BW = new CFEdge(\"BW\", mCFG, B, W);\n\n B.setThenEdge(BC);\n B.setElseEdge(BW);\n\n E.setThenEdge(EF);\n E.setElseEdge(EG);\n\n System.out.println(mCFG.getEdgeSet());\n\n// System.out.println(mCFG.getNodeSet());\n// System.out.println(mCFG.getEdgeSet());\n\n SEENew2 seeNew2 = new SEENew2(mCFG);\n\n SETNode setNode6 = seeNew2.allPathSE(mCFG,10);\n//\n// System.out.println(seeNew2.getSET().getStartNode().getIncomingEdge());\n// System.out.println(seeNew2.getSET().getStartNode().getCFGNode());\n//\n// Set<SETEdge> edgeSet = seeNew2.getSET().getEdgeSet();\n// for (SETEdge setEdge:edgeSet){\n// System.out.println(\"Edge:\"+setEdge);\n// System.out.println(\"Head:\"+setEdge.getHead());\n// System.out.println(\"Tail:\"+setEdge.getTail().getIncomingEdge());\n// System.out.println(\"Tail:\"+setEdge.getTail().getCFGNode());\n// }\n\n// Set<SETNode> nodeSet = seeNew2.getSET().getNodeSet();\n// for (SETNode setNode:nodeSet){\n// System.out.println(\"Node:\"+setNode);\n// System.out.println(\"CFGNode:\"+setNode.getCFGNode());\n//// System.out.println(\"Head:\"+setEdge.getHead());\n//// System.out.println(\"Tail:\"+setEdge.getTail());\n// }\n\n// // passing empty environment & startNode\n// SETBasicBlockNode startNode = new SETBasicBlockNode(seeNew2.getSET(),A);\n//\n// SETNode setNode = seeNew2.singleStep(B,startNode);\n// System.out.println(setNode.getLatestValue(x));\n//\n// SETNode setNode2 = seeNew2.singleStep(C,setNode);\n// System.out.println(setNode2.getLatestValue(y));\n//\n// SETNode setNode3 = seeNew2.singleStep(D,setNode2);\n// System.out.println(\"PathPredicate:\"+((SETDecisionNode)setNode3).getCondition());\n//\n// SETNode setNode4 = seeNew2.singleStep(E,setNode3);\n// System.out.println(setNode4.getLatestValue(x));\n//\n// SETNode setNode5 = seeNew2.singleStep(F,setNode4);\n// System.out.println(setNode5.getLatestValue(x));\n\n// SETNode setNode6 = seeNew2.allPathSE(mCFG,5);\n// System.out.println(setNode6.getSET());\n\n// System.out.println(seeNew2.getSET().getNodeSet());\n\n// System.out.println(seeNew2.getSET().getNumberOfDecisionNodes());\n\n// SETNode setNode6 = seeNew2.allPathSE(mCFG,5);\n// System.out.println(setNode6);\n\n\n\n\n\n }", "U2(){\r\n setCurrentWeight(0);\r\n setMaxWeight(29*1000);\r\n setCost(120*1000000);\r\n }", "public void setComparedHeuristics (VariableSelector variableSelector, IntValueSelector valueOrder){\n\t\tIntValueSelector valueSelector = valueOrder;\n\t\t\n\t \n\t\tkb.getModelKB().getSolver().setSearch(Search.intVarSearch(\n \n\t\t\t\tvariableSelector,\n // selects the smallest domain value (lower bound)\n\t\t\t\t \n\t\t\t\tvalueSelector,\n \n // variables to branch on\n\t\t\t\tkb.getVars()\n\t\t));\n\t\t\n\t}", "public void setGov(int value);", "private void generateVariablesAndConstraints() {\n\t\tVariable norwegian=new Variable(generateDomain(), \"norwegian\");\n\t\tVariable english=new Variable(generateDomain(), \"english\");\n\t\tVariable dane=new Variable(generateDomain(), \"dane\");\n\t\tVariable german=new Variable(generateDomain(), \"german\");\n\t\tVariable swede=new Variable(generateDomain(), \"swede\");\n\t\t//colors: \"red\", \"green\", \"white\", \"yellow\", \"blue\"\n\t\tVariable red=new Variable(generateDomain(), \"red\");\n\t\tVariable green=new Variable(generateDomain(), \"green\");\n\t\tVariable white=new Variable(generateDomain(), \"white\");\n\t\tVariable yellow=new Variable(generateDomain(), \"yellow\");\n\t\tVariable blue=new Variable(generateDomain(), \"blue\");\n\t\t//tobaccos: \"light\", \"cigar\", \"pipe\", \"unfiltered\", \"menthol\"\n\t\tVariable light=new Variable(generateDomain(), \"light\");\n\t\tVariable cigar=new Variable(generateDomain(), \"cigar\");\n\t\tVariable pipe=new Variable(generateDomain(), \"pipe\");\n\t\tVariable unfiltered=new Variable(generateDomain(), \"unfiltered\");\n\t\tVariable menthol=new Variable(generateDomain(), \"menthol\");\n\t\t//drinks: \"tea\", \"milk\", \"water\", \"beer\", \"coffee\"\n\t\tVariable tea=new Variable(generateDomain(), \"tea\");\n\t\tVariable milk=new Variable(generateDomain(), \"milk\");\n\t\tVariable water=new Variable(generateDomain(), \"water\");\n\t\tVariable beer=new Variable(generateDomain(), \"beer\");\n\t\tVariable coffee=new Variable(generateDomain(), \"coffee\");\n\t\t//pets: \"fish\", \"cat\", \"bird\", \"dog\", \"horse\"\n\t\tVariable fish=new Variable(generateDomain(), \"fish\");\n\t\tVariable cat=new Variable(generateDomain(), \"cat\");\n\t\tVariable bird=new Variable(generateDomain(), \"bird\");\n\t\tVariable dog=new Variable(generateDomain(), \"dog\");\n\t\tVariable horse=new Variable(generateDomain(), \"horse\");\n\t\t\n\t\tvariables= new ArrayList<Variable>(Arrays.asList(norwegian, english, dane, german, swede,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tred, green, white, yellow, blue,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlight, cigar, pipe, unfiltered, menthol,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttea, milk, water, beer, coffee,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfish, cat, bird, dog, horse));\n\t\t\n\t\tconstraints=new ArrayList<Constraint>();\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(norwegian, english, dane, german, swede))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(red, green, white, yellow, blue))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(light, cigar, pipe, unfiltered, menthol))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(tea, milk, water, beer, coffee))).toneq()));\n\t\tconstraints.addAll((new allDifferent(new ArrayList<Variable>(Arrays.asList(fish, cat, bird, dog, horse))).toneq()));\n\t\tconstraints.add(new equnary(norwegian, 1)); //Norweg zamieszkuje pierwszy dom\n\t\tconstraints.add(new eq(english, red));//Anglik mieszka w czerwonym domu.\n\t\tconstraints.add(new lt(green, white));//Zielony dom znajduje się bezpośrednio po lewej stronie domu białego.\n\t\tconstraints.add(new eq(dane, tea));//Duńczyk pija herbatkę.\n\t\tconstraints.add(new nextto(light, cat));//Palacz papierosów light mieszka obok hodowcy kotów.\n\t\tconstraints.add(new eq(yellow, cigar));//Mieszkaniec żółtego domu pali cygara.\n\t\tconstraints.add(new eq(german, pipe));//Niemiec pali fajkę.\n\t\tconstraints.add(new equnary(milk, 3));//Mieszkaniec środkowego domu pija mleko.\n\t\tconstraints.add(new nextto(light, water));//Palacz papierosów light ma sąsiada, który pija wodę.\n\t\tconstraints.add(new eq(unfiltered, bird));//Palacz papierosów bez filtra hoduje ptaki.\n\t\tconstraints.add(new eq(swede, dog));//Szwed hoduje psy.\n\t\tconstraints.add(new nextto(norwegian, blue));//Norweg mieszka obok niebieskiego domu.\n\t\tconstraints.add(new nextto(horse, yellow));//Hodowca koni mieszka obok żółtego domu.\n\t\tconstraints.add(new eq(menthol, beer));//Palacz mentolowych pija piwo.\n\t\tconstraints.add(new eq(green, coffee));//W zielonym domu pija się kawę\n\t}", "public void increase_BUIBYDryingFactor(){\r\n\tBUO=BUO+DF;\r\n}", "@Override\r\n public void doEdit ()\r\n throws DoEditException\r\n {\n List<StringWithProperties> criteria = probNet.getDecisionCriteria ();\r\n StringWithProperties criterion = null;\r\n switch (stateAction)\r\n {\r\n case ADD :\r\n if (criteria == null)\r\n {\r\n // agents = new StringsWithProperties();\r\n criteria = new ArrayList<StringWithProperties> ();\r\n }\r\n criterion = new StringWithProperties (criterionName);\r\n // agents.put(agentName);\r\n criteria.add (criterion);\r\n probNet.setDecisionCriteria2 (criteria);\r\n break;\r\n case REMOVE :\r\n for (StringWithProperties criterio : criteria)\r\n {\r\n if (criterio.getString ().equals (criterionName))\r\n {\r\n criterion = criterio;\r\n }\r\n }\r\n criteria.remove (criterion);\r\n // TODO assign criteria to node\r\n // it is also necessary to delete this criteria from the node it\r\n // was assigned to\r\n /*\r\n * if (criteria != null) { for (ProbNode node :\r\n * probNet.getProbNodes()) { if\r\n * (node.getVariable().getDecisionCriteria\r\n * ().getString().equals(criteriaName)) {\r\n * node.getVariable().setDecisionCriteria(null); } } }\r\n */\r\n if (criteria.size () == 0)\r\n {\r\n criteria = null;\r\n }\r\n probNet.setDecisionCriteria2 (criteria);\r\n break;\r\n case DOWN :\r\n // StringsWithProperties newAgentsDown = new\r\n // StringsWithProperties();\r\n ArrayList<StringWithProperties> newCriteriasDown = new ArrayList<StringWithProperties> ();\r\n for (int i = 0; i < dataTable.length; i++)\r\n {\r\n // newAgentsDown.put((String)dataTable[i][0]);\r\n newCriteriasDown.add (new StringWithProperties ((String) dataTable[i][0]));\r\n }\r\n probNet.setDecisionCriteria2 (newCriteriasDown);\r\n break;\r\n case UP :\r\n // StringsWithProperties newAgentsUp = new\r\n // StringsWithProperties();\r\n ArrayList<StringWithProperties> newCriteriasUp = new ArrayList<StringWithProperties> ();\r\n for (int i = 0; i < dataTable.length; i++)\r\n {\r\n // newAgentsUp.put((String)dataTable[i][0]);\r\n newCriteriasUp.add (new StringWithProperties ((String) dataTable[i][0]));\r\n }\r\n probNet.setDecisionCriteria2 (newCriteriasUp);\r\n break;\r\n case RENAME :\r\n // agents.rename(agentName, newName);\r\n // StringsWithProperties newAgentsRename = new\r\n // StringsWithProperties();\r\n ArrayList<StringWithProperties> newCriteriasRename = new ArrayList<StringWithProperties> ();\r\n for (int i = 0; i < dataTable.length; i++)\r\n {\r\n // newAgentsRename.put((String)dataTable[i][0]);\r\n newCriteriasRename.add (new StringWithProperties ((String) dataTable[i][0]));\r\n }\r\n probNet.setDecisionCriteria2 (newCriteriasRename);\r\n break;\r\n }\r\n }", "void setStation(double station);", "public void action() {\n\t\tsuppressed = false;\r\n\t\tpilot.setLinearSpeed(8);\r\n\t\tpilot.setLinearAcceleration(4);\r\n\t\tColorThread.updatePos = false;\r\n\t\tColorThread.updateCritical = false;\r\n\t\t//create a array to save the map information\r\n\t\tfor (int a = 0; a < 8; a++) {\r\n\t\t\tfor (int b = 0; b < 8; b++) {\r\n\t\t\t\trobot.probability[a][b] = -1;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (int a = 0; a < 8; a++) {\r\n\t\t\tfor (int b = 0; b < 8; b++) {\r\n\t\t\t\tif (a == 0 || a == 7 || b == 0 || b == 7) {\r\n\t\t\t\t\trobot.probability[a][b] = 100;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (int a = 0; a < 6; a++) {\r\n\t\t\tfor (int b = 0; b < 6; b++) {\r\n\t\t\t\tif (robot.map[a][b].getOccupied() == 1) {\r\n\t\t\t\t\trobot.probability[a + 1][b + 1] = 100;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Step1: use ArrayList to save all of the probability situation.\r\n\t\tfloat front, left, right, back;\r\n\t\tfront = USThread.disSample[0];\r\n\t\trobot.setmotorM(90);\r\n\t\tDelay.msDelay(1000);\r\n\t\tleft = USThread.disSample[0];\r\n\t\trobot.setmotorM(-180);\r\n\t\tDelay.msDelay(1000);\r\n\t\tright = USThread.disSample[0];\r\n\t\trobot.setmotorM(90);\r\n\t\tDelay.msDelay(1000);\r\n\t\trobot.correctHeading(180);\r\n\t\tDelay.msDelay(1000);\r\n\t\tback = USThread.disSample[0];\r\n\t\trobot.correctHeading(180);\r\n\t\tfor (int a = 1; a < 7; a++) {\r\n\t\t\tfor (int b = 1; b < 7; b++) {\r\n\t\t\t\tif (robot.probability[a][b] == -1) {\r\n\t\t\t\t\tif (((robot.probability[a][b + 1] == 100 && front < 0.25)\r\n\t\t\t\t\t\t\t|| (robot.probability[a][b + 1] == -1 && front > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a + 1][b] == 100 && right < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a + 1][b] == -1 && right > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a][b - 1] == 100 && back < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a][b - 1] == -1 && back > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a - 1][b] == 100 && left < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a - 1][b] == -1 && left > 0.25))) {\r\n\t\t\t\t\t\t//direction is north\r\n\t\t\t\t\t\trobot.listOfPro.add(new ProPoint(0, 0, a, b));\r\n\t\t\t\t\t\t//System.out.println(\"0 \"+a+\" \"+b);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (((robot.probability[a + 1][b] == 100 && front < 0.25)\r\n\t\t\t\t\t\t\t|| (robot.probability[a + 1][b] == -1 && front > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a][b - 1] == 100 && right < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a][b - 1] == -1 && right > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a - 1][b] == 100 && back < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a - 1][b] == -1 && back > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a][b + 1] == 100 && left < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a][b + 1] == -1 && left > 0.25))) {\r\n\t\t\t\t\t\t// direction is east\r\n\t\t\t\t\t\trobot.listOfPro.add(new ProPoint(1, 0, a, b));\r\n\t\t\t\t\t\t//System.out.println(\"1 \"+a+\" \"+b);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (((robot.probability[a][b - 1] == 100 && front < 0.25)\r\n\t\t\t\t\t\t\t|| (robot.probability[a][b - 1] == -1 && front > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a - 1][b] == 100 && right < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a - 1][b] == -1 && right > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a][b + 1] == 100 && back < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a][b + 1] == -1 && back > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a + 1][b] == 100 && left < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a + 1][b] == -1 && left > 0.25))) {\r\n\t\t\t\t\t\t// direction is sourth\r\n\t\t\t\t\t\trobot.listOfPro.add(new ProPoint(2, 0, a, b));\r\n\t\t\t\t\t\t//System.out.println(\"2 \"+a+\" \"+b);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (((robot.probability[a - 1][b] == 100 && front < 0.25)\r\n\t\t\t\t\t\t\t|| (robot.probability[a - 1][b] == -1 && front > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a][b + 1] == 100 && right < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a][b + 1] == -1 && right > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a + 1][b] == 100 && back < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a + 1][b] == -1 && back > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a][b - 1] == 100 && left < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a][b - 1] == -1 && left > 0.25))) {\r\n\t\t\t\t\t\t// direction is west\r\n\t\t\t\t\t\trobot.listOfPro.add(new ProPoint(3, 0, a, b));\r\n\t\t\t\t\t\t//System.out.println(\"3 \"+a+\" \"+b);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Step 2: use loop to take control of robot walk and check the location correction\r\n\t\tboolean needLoop = true;\r\n\t\tint loopRound = 0;\r\n\t\twhile (needLoop) {\r\n\t\t\t// One of way to leave the loop is at the hospital\r\n\t\t\tif ((ColorThread.leftColSample[0] >= 0.2 && ColorThread.leftColSample[1] < 0.2\r\n\t\t\t\t\t&& ColorThread.leftColSample[1] >= 0.14 && ColorThread.leftColSample[2] <= 0.8)\r\n\t\t\t\t\t&& (ColorThread.rightColSample[0] >= 0.2 && ColorThread.rightColSample[1] < 0.2\r\n\t\t\t\t\t\t\t&& ColorThread.rightColSample[1] >= 0.11 && ColorThread.rightColSample[2] <= 0.08)) {\r\n\t\t\t\trobot.updatePosition(0, 0);\r\n\t\t\t\tint numOfAtYellow = 0;\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif (robot.listOfPro.get(i).getNowX() == 1 && robot.listOfPro.get(i).getNowY() == 1) {\r\n\t\t\t\t\t\tnumOfAtYellow++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(numOfAtYellow == 1) {\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif (robot.listOfPro.get(i).getNowX() == 1 && robot.listOfPro.get(i).getNowY() == 1) {\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\trobot.setDirection(false);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 3) {\r\n\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// do not to set the heading, because the default value is 0.\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t}else {\r\n\t\t\t\t\t//have two way to go to the yellow part\r\n\t\t\t\t\tfront = USThread.disSample[0];\r\n\t\t\t\t\trobot.setmotorM(90);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tleft = USThread.disSample[0];\r\n\t\t\t\t\trobot.setmotorM(-180);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tright = USThread.disSample[0];\r\n\t\t\t\t\trobot.setmotorM(90);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\trobot.correctHeading(180);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tback = USThread.disSample[0];\r\n\t\t\t\t\trobot.correctHeading(180);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tif(front<0.25 && right<0.25 && left>0.25 && back>0.25) {\r\n\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t}else if(front<0.25 && right>0.25 && back>0.25 && left<0.25) {\r\n\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t}else if(front>0.25 && right>0.25 && back<0.25 && left<0.25) {\r\n\t\t\t\t\t\t// do not to set the heading, because the default value is 0.\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trobot.setDirection(false);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tneedLoop = false;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t//Another way to leave the loop is the robot arrive the green cell.\r\n\t\t\tif ((ColorThread.leftColSample[0] <= 0.09 && ColorThread.leftColSample[1] >= 0.17\r\n\t\t\t\t\t&& ColorThread.leftColSample[2] <= 0.09)\r\n\t\t\t\t\t&& (ColorThread.rightColSample[0] <= 0.09 && ColorThread.rightColSample[1] >= 0.014\r\n\t\t\t\t\t\t\t&& ColorThread.rightColSample[2] <= 0.11)) {\r\n\t\t\t\trobot.updatePosition(5, 0);\r\n\t\t\t\tint numOfAtGreen = 0;\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif (robot.listOfPro.get(i).getNowX() == 6 && robot.listOfPro.get(i).getNowY() == 1) {\r\n\t\t\t\t\t\tnumOfAtGreen++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(numOfAtGreen==1) {\r\n\t\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowX() == 6 && robot.listOfPro.get(i).getNowY() == 1) {\r\n\t\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\t\trobot.setDirection(false);\r\n\t\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 3) {\r\n\t\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// do not to set the heading, because the default value is 0.\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else {\r\n\t\t\t\t\tfront = USThread.disSample[0];\r\n\t\t\t\t\trobot.setmotorM(90);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tleft = USThread.disSample[0];\r\n\t\t\t\t\trobot.setmotorM(-180);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tright = USThread.disSample[0];\r\n\t\t\t\t\trobot.setmotorM(90);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\trobot.correctHeading(180);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tback = USThread.disSample[0];\r\n\t\t\t\t\trobot.correctHeading(180);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tif(front<0.25 && right<0.25 && left>0.25 && back>0.25) {\r\n\t\t\t\t\t\trobot.setDirection(false);\r\n\t\t\t\t\t}else if(front<0.25 && right>0.25 && back>0.25 && left<0.25) {\r\n\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t}else if(front>0.25 && right>0.25 && back<0.25 && left<0.25) {\r\n\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t// do not to set the heading, because the default value is 0.\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tneedLoop = false;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t//The third way of leave the loop is the robot have already know his position and direction.\r\n\t\t\tint maxStepNumber = 0;\r\n\t\t\tint numberOfMaxSteps = 0;\r\n\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\tif (robot.listOfPro.get(i).getSteps() > maxStepNumber) {\r\n\t\t\t\t\tmaxStepNumber = robot.listOfPro.get(i).getSteps();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\tif (robot.listOfPro.get(i).getSteps() == maxStepNumber) {\r\n\t\t\t\t\tnumberOfMaxSteps++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (numberOfMaxSteps == 1) {\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif (robot.listOfPro.get(i).getSteps() == maxStepNumber) {\r\n\t\t\t\t\t\trobot.updatePosition(robot.listOfPro.get(i).getNowX() - 1,\r\n\t\t\t\t\t\t\t\trobot.listOfPro.get(i).getNowY() - 1);\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\trobot.setDirection(false);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 3) {\r\n\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// do not to set the heading, because the default value is 0.\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tneedLoop = false;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t//The below part are the loops.\r\n\t\t\tfront = USThread.disSample[0];\r\n\t\t\trobot.setmotorM(90);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tleft = USThread.disSample[0];\r\n\t\t\trobot.setmotorM(-180);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tright = USThread.disSample[0];\r\n\t\t\trobot.setmotorM(90);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\trobot.correctHeading(180);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tback = USThread.disSample[0];\r\n\t\t\trobot.correctHeading(180);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\t// move\r\n\t\t\t\r\n\t\t\tif (front > 0.25) {\r\n\t\t\t\trobot.getPilot().travel(25);\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif(robot.listOfPro.get(i).getSteps()==loopRound) {\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 0) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() + 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() + 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() - 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() - 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (left > 0.25) {\r\n\t\t\t\trobot.correctHeading(-90);\r\n\t\t\t\trobot.getPilot().travel(25);\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif(robot.listOfPro.get(i).getSteps()==loopRound) {\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 0) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(3);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() - 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(0);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() + 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(1);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() + 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(2);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() - 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (right > 0.25) {\r\n\t\t\t\trobot.correctHeading(90);\r\n\t\t\t\trobot.getPilot().travel(25);\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif(robot.listOfPro.get(i).getSteps()==loopRound) {\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 0) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(1);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() + 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(2);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() - 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(3);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() - 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(0);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() + 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\trobot.correctHeading(180);\r\n\t\t\t\trobot.getPilot().travel(25);\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif(robot.listOfPro.get(i).getSteps()==loopRound) {\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 0) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(2);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() - 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(3);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() - 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(0);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() + 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(1);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() + 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// It time to check the around situation\r\n\t\t\tfront = USThread.disSample[0];\r\n\t\t\trobot.setmotorM(90);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tleft = USThread.disSample[0];\r\n\t\t\trobot.setmotorM(-180);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tright = USThread.disSample[0];\r\n\t\t\trobot.setmotorM(90);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\trobot.correctHeading(180);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tback = USThread.disSample[0];\r\n\t\t\trobot.correctHeading(180);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t//System.out.println(robot.listOfPro.get(i).getSteps());\r\n\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 0) {\r\n\t\t\t\t\t\tif (((front < 0.25\r\n\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro.get(i).getNowY()\r\n\t\t\t\t\t\t\t\t\t\t+ 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (front > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() + 1] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((left < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t- 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (left > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() - 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((right < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (right > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() + 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((back < 0.25 && robot.probability[robot.listOfPro.get(i)\r\n\t\t\t\t\t\t\t\t\t\t\t\t.getNowX()][robot.listOfPro.get(i).getNowY() - 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (back > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() - 1] == -1))) {\r\n\t\t\t\t\t\t\t//It is correct when the robot have the same data information with estimate information\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setSteps(robot.listOfPro.get(i).getSteps() + 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\tif (((left < 0.25\r\n\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro.get(i).getNowY()\r\n\t\t\t\t\t\t\t\t\t\t+ 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (left > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() + 1] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((back < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t- 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (back > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() - 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((front < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (front > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() + 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((right < 0.25 && robot.probability[robot.listOfPro.get(i)\r\n\t\t\t\t\t\t\t\t\t\t\t\t.getNowX()][robot.listOfPro.get(i).getNowY() - 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (right > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() - 1] == -1))) {\r\n\t\t\t\t\t\t\t//It is correct when the robot have the same data information with estimate information\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setSteps(robot.listOfPro.get(i).getSteps() + 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\tif (((back < 0.25\r\n\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro.get(i).getNowY()\r\n\t\t\t\t\t\t\t\t\t\t+ 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (back > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() + 1] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((right < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t- 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (right > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() - 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((left < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (left > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() + 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((front < 0.25 && robot.probability[robot.listOfPro.get(i)\r\n\t\t\t\t\t\t\t\t\t\t\t\t.getNowX()][robot.listOfPro.get(i).getNowY() - 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (front > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() - 1] == -1))) {\r\n\t\t\t\t\t\t\t//It is correct when the robot have the same data information with estimate information\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setSteps(robot.listOfPro.get(i).getSteps() + 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (((right < 0.25\r\n\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro.get(i).getNowY()\r\n\t\t\t\t\t\t\t\t\t\t+ 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (right > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() + 1] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((front < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t- 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (front > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() - 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((back < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (back > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() + 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((left < 0.25 && robot.probability[robot.listOfPro.get(i)\r\n\t\t\t\t\t\t\t\t\t\t\t\t.getNowX()][robot.listOfPro.get(i).getNowY() - 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (left > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() - 1] == -1))) {\r\n\t\t\t\t\t\t\t//It is correct when the robot have the same data information with estimate information\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setSteps(robot.listOfPro.get(i).getSteps() + 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tloopRound++;\r\n\t\t}\r\n\t\t// if is out the while loop, it will find the heading and the position of robot right now.\r\n\t\t//Step 3: It is time to use wavefront to come back to the hospital\r\n\t\trobot.restoreDefault();\r\n\t\trobot.RunMode = 1;\r\n\t\tColorThread.updatePos = true;\r\n\t\tColorThread.updateCritical = true;\r\n\t}", "public Field.Fieldelements placeShotComputer() {\r\n int sizeX = this.fieldUser.getSizeX();\r\n int sizeY = this.fieldUser.getSizeY();\r\n \r\n // probability that a field contains a ship (not in percent, 1000 is best)\r\n double[][] probability = new double[sizeX][sizeY];\r\n double sumProbability = 0;\r\n \r\n for (int posX = 0; posX < sizeX; posX++) {\r\n for (int posY = 0; posY < sizeY; posY++) {\r\n // set probability for each field to 1\r\n probability[sizeX][sizeY] = 1.;\r\n \r\n // check neighbouring fields for hits and set probability to 1000\r\n if (Field.Fieldelements.HIT == fieldUser.getFieldStatus(posX, posY - 1) ||\r\n Field.Fieldelements.HIT == fieldUser.getFieldStatus(posX, posY + 1) ||\r\n Field.Fieldelements.HIT == fieldUser.getFieldStatus(posX - 1, posY) ||\r\n Field.Fieldelements.HIT == fieldUser.getFieldStatus(posX + 1, posY)) {\r\n probability[posX][posY] = 1000;\r\n }\r\n \r\n // 0 points if all fields above and below are SUNK or SHOT\r\n if ((Field.Fieldelements.SUNK == fieldUser.getFieldStatus(posX, posY - 1) || Field.Fieldelements.WATER == fieldUser.getFieldStatus(posX, posY - 1)) &&\r\n (Field.Fieldelements.SUNK == fieldUser.getFieldStatus(posX, posY + 1) || Field.Fieldelements.WATER == fieldUser.getFieldStatus(posX, posY + 1)) &&\r\n (Field.Fieldelements.SUNK == fieldUser.getFieldStatus(posX - 1, posY) || Field.Fieldelements.WATER == fieldUser.getFieldStatus(posX - 1, posY)) &&\r\n (Field.Fieldelements.SUNK == fieldUser.getFieldStatus(posX + 1, posY) || Field.Fieldelements.WATER == fieldUser.getFieldStatus(posX + 1, posY))\r\n ) {\r\n probability[posX][posY] = 0;\r\n }\r\n \r\n // 0 points if a neighbouring field is SUNK\r\n if (Field.Fieldelements.SUNK == fieldUser.getFieldStatus(posX - 1, posY - 1) ||\r\n Field.Fieldelements.SUNK == fieldUser.getFieldStatus(posX - 1, posY) ||\r\n Field.Fieldelements.SUNK == fieldUser.getFieldStatus(posX - 1, posY + 1) ||\r\n Field.Fieldelements.SUNK == fieldUser.getFieldStatus(posX, posY - 1) ||\r\n Field.Fieldelements.SUNK == fieldUser.getFieldStatus(posX, posY + 1) ||\r\n Field.Fieldelements.SUNK == fieldUser.getFieldStatus(posX + 1, posY - 1) ||\r\n Field.Fieldelements.SUNK == fieldUser.getFieldStatus(posX + 1, posY) ||\r\n Field.Fieldelements.SUNK == fieldUser.getFieldStatus(posX + 1, posY + 1)\r\n ) {\r\n probability[posX][posY] = 0;\r\n }\r\n \r\n // 0 points if top right, top left, bottom right or bottom left is HIT\r\n if (Field.Fieldelements.HIT == fieldUser.getFieldStatus(posX - 1, posY - 1) ||\r\n Field.Fieldelements.HIT == fieldUser.getFieldStatus(posX - 1, posY + 1) ||\r\n Field.Fieldelements.HIT == fieldUser.getFieldStatus(posX + 1, posY - 1) ||\r\n Field.Fieldelements.HIT == fieldUser.getFieldStatus(posX + 1, posY + 1)\r\n ) {\r\n probability[posX][posY] = 0;\r\n }\r\n \r\n // 0 points if a shot has already been placed\r\n if (Field.Fieldelements.WATER != fieldUser.getFieldStatus(posX, posY) &&\r\n Field.Fieldelements.SHIP != fieldUser.getFieldStatus(posX, posY)) {\r\n probability[posX][posY] = 0;\r\n }\r\n }\r\n }\r\n \r\n // calculate sum of all points\r\n // TODO check if probability must be smaller numbers\r\n for (int posX = 0; posX < sizeX; sizeX++) {\r\n for (int posY = 0; posY < sizeY; posY++) {\r\n sumProbability += probability[posX][posY];\r\n }\r\n }\r\n \r\n // random element\r\n Random random = new Random();\r\n sumProbability = random.nextInt((int) --sumProbability);\r\n sumProbability++; // must at least be 1\r\n int posY = -1;\r\n int posX = -1;\r\n while (posY < sizeY - 1 && sumProbability >= 0) {\r\n posY++;\r\n posX = -1;\r\n while (posX < sizeX && sumProbability >= 0) {\r\n posX++;\r\n sumProbability = sumProbability - probability[posX][posY];\r\n }\r\n }\r\n return fieldUser.shoot(posX, posY);\r\n }", "public void setGBInterval_accession(java.lang.String param){\n \n this.localGBInterval_accession=param;\n \n\n }", "public void solveSA() {\r\n initState();\r\n for (int ab = 0; ab < Config.NumberOfMetropolisResets; ab++) {\r\n LogTool.print(\"==================== INACTIVE: START CALC FOR OUTER ROUND \" + ab + \"=========================\",\"notification\");\r\n\r\n if (Config.SAverboselvl>1) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\");\r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n }\r\n setCur_cost(costCURsuperfinal()); //One of four possible costNEX variants\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"CUR COST SUPER FINAL \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n /* [Newstate] with random dwelltimes */\r\n New_state = newstater(); \r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"NEW STATE \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n// newstater();\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"SolveSA: New State before Metropolis: A)\" + New_state[0] + \" B) \" + New_state[1] + \" C) \" + New_state[2],\"notification\");\r\n }\r\n \r\n setNew_cost(costNEXsuperfinal()); //One of four possible costNEX variants\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"NEW COST SUPER FINAL \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"SolveSA: New Cost : \" + New_cost,\"notification\");\r\n }\r\n\r\n /**\r\n * MetropolisLoop\r\n * @param Config.NumberOfMetropolisRounds\r\n */\r\n\r\n for(int x=0;x<Config.NumberOfMetropolisRounds;x++) { \r\n LogTool.print(\"SolveSA Iteration \" + x + \" Curcost \" + Cur_cost + \" Newcost \" + New_cost,\"notification\");\r\n if ((Cur_cost - New_cost)>0) { // ? die Kosten\r\n \r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 1 START\",\"notification\");\r\n }\r\n \r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: (Fall 1) Metropolis NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1) Metropolis CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA Cost delta \" + (Cur_cost - New_cost) + \" \",\"notification\");\r\n //</editor-fold>\r\n }\r\n Cur_state = New_state;\r\n Cur_cost = New_cost;\r\n if (Config.SAverboselvl>1) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: (Fall 1 nach set) Metropolis NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set) Metropolis CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set): NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set): CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n New_state = newstater();\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C1 after generate: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 1 STOP \",\"notification\");\r\n }\r\n } else if (Math.exp(-(New_cost - Cur_cost)/temperature)> RandGenerator.randDouble(0.01, 0.99)) {\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 2 START: Zufallsgenerierter Zustand traegt hoehere Kosten als vorhergehender Zustand. Iteration: \" + x,\"notification\");\r\n }\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 before set: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n Cur_state = New_state;\r\n Cur_cost = New_cost;\r\n \r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 after set: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after set: CurCost : \" + this.getCur_cost(),\"notification\");\r\n //</editor-fold>\r\n }\r\n New_state = newstater();\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 after generate: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 2 STOP: Zufallsgenerierter Zustand traegt hoehere Kosten als vorhergehender Zustand. Iteration: \" + x,\"notification\");\r\n }\r\n } else {\r\n New_state = newstater();\r\n }\r\n temperature = temperature-1;\r\n if (temperature==0) {\r\n break;\r\n }\r\n \r\n setNew_cost(costNEXsuperfinal());\r\n LogTool.print(\"NEW COST SUPER FINAL \",\"notification\");\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n//</editor-fold>\r\n if ((x==58)&(ab==0)) {\r\n LogTool.print(\"Last internal Iteration Checkpoint\",\"notification\");\r\n if ((Cur_cost - New_cost)>0) {\r\n Cur_state = New_state;\r\n Cur_cost = New_cost; \r\n }\r\n }\r\n if ((x>58)&(ab==0)) {\r\n LogTool.print(\"Last internal Iteration Checkpoint\",\"notification\");\r\n }\r\n }\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"Auskommentierter GLowestState Object Class\">\r\n// if (ab==9) {\r\n// double diff=0;\r\n// }\r\n \r\n // Hier wird kontrolliert, ob das minimalergebnis des aktuellen\r\n // Metropolisloops kleiner ist als das bsiher kleinste\r\n \r\n// if (Cur_cost<Global_lowest_cost) {\r\n// this.setGlobal_lowest_cost(Cur_cost);\r\n// GlobalState GLowestState = new GlobalState(this.Cur_state);\r\n// String rGLSOvalue = GLowestState.getGlobal_Lowest_state_string();\r\n// LogTool.print(\"GLS DEDICATED OBJECT STATE OUTPUT -- \" + GLowestState.getGlobal_Lowest_state_string(),\"notification\");\r\n// this.setGlobal_Lowest_state(GLowestState.getDwelltimes());\r\n // LogTool.print(\"READ FROM OBJECT OUTPUT -- \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n// LogTool.print(\"DEBUG: CurCost direct : \" + this.getCur_cost(),\"notification\"); \r\n// LogTool.print(\"Debug: Cur<global CurState get : \" + this.getCur_state_string(),\"notification\");\r\n// LogTool.print(\"Debug: Cur<global GLS get : \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n// this.setGlobal_Lowest_state(this.getCur_state(Cur_state));\r\n// LogTool.print(\"Debug: Cur<global GLS get after set : \" + this.getGlobal_Lowest_state_string(),\"notification\"); \r\n// }\r\n //</editor-fold>\r\n LogTool.print(\"SolveSA: Outer Iteration : \" + ab,\"notification\");\r\n LogTool.print(\"SolveSA: Last Calculated New State/Possible state inner loop (i.e. 99) : \" + this.getNew_state_string(),\"notification\");\r\n// LogTool.print(\"SolveSA: Best Solution : \" + this.getCur_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: GLS after all loops: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: LastNewCost, unchecked : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: CurCost : \" + this.getCur_cost() + \"i.e. lowest State of this round\",\"notification\"); \r\n }\r\n // return GLowestState;\r\n }", "protected Element evalAssurance(Assurance ass){\n\t\tRecord r1 = ass.getLeftRecord();\n\t\tRecord r2 = ass.getRightRecord();\n\t\tOperator op = ass.getOperator();\n\t\tElement an = el(\"bpws:assign\");\n\t\tif (r1.getType() == RecordType.FORMULAR)\n\t\t\tan.appendChild(setExpr(r1.getFormular(), \"nswomoxsd:leftValue\"));\n\t\tif (r2.getType() == RecordType.FORMULAR)\n\t\t\tan.appendChild(setExpr(r2.getFormular(), \"nswomoxsd:rightValue\"));\n\t\tan.appendChild(\n\t\t\tsetExpr(\n\t\t\t\tgetMyVarPath(\"/nswomoxsd:leftValue\") + \n\t\t\t\top.value() +\n\t\t\t\tgetMyVarPath(\"nswomoxsd:rightValue\"),\n\t\t\t\t\"nswomoxsd:value\"\n\t\t\t)\n\t\t);\n\t\treturn an;\n\t}", "public void set_constant(double cutoff)\r\n\t{\r\n\t\tthis.switchValue = (int)cutoff;\t\r\n\t}", "static double addHeuristic1(GameState c, boolean isMaxNode) {\n\t\t// Value returned will be absolute. If its max node, this config is good\n\t\t// then value will be positive. If its min node,\n\t\t// and this config is good for min, then value will be negative\n\n\t\tint i, j, vacant_spaces;\n\t\t// Compute : Feasible Moves for self\n\t\tint self_feasible_moves = 0;\n\t\tint self_remaining_moves = 0;\n\t\tint opponent_feasible_moves = 0;\n\t\tint opponent_remaining_moves = 0;\n\n\t\t// Go through the board and figure out vacant spots\n\t\tvacant_spaces = 0;\n\t\tfor (i = -GameState.HALF_BOARD; i <= GameState.HALF_BOARD; i = i + 1) {\n\t\t\tif (c.getWeight(i) == 0) {\n\t\t\t\tvacant_spaces++;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 1; i <= GameState.MAX_WEIGHT; i = i + 1) {\n\t\t\t// Check if self have the weight\n\t\t\tif (c.IHaveWeight(i)) {\n\t\t\t\tself_remaining_moves++;\n\t\t\t\t// Go through all the possible positions\n\t\t\t\tfor (j = -GameState.HALF_BOARD; j < GameState.HALF_BOARD; j++) {\n\t\t\t\t\tif (c.getWeight(j) == 0) {\n\t\t\t\t\t\t// Place it and see if you tip\n\t\t\t\t\t\tc.makeMove(i, j, PlayerName.none);\n\t\t\t\t\t\tif (!c.isTipping_old()) {\n\t\t\t\t\t\t\tself_feasible_moves++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Now remove the weight\n\t\t\t\t\t\tc.removeMove(j);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check if opponent has this weight\n\t\t\tif (c.opponentHasWeight(i)) {\n\t\t\t\topponent_remaining_moves++;\n\t\t\t\t// Go through all the possible positions\n\t\t\t\tfor (j = -GameState.HALF_BOARD; j < GameState.HALF_BOARD; j++) {\n\t\t\t\t\t// Place the weight and see if you tip\n\t\t\t\t\tif (c.getWeight(j) == 0) {\n\t\t\t\t\t\tc.makeMove(i, j, PlayerName.none);\n\t\t\t\t\t\tif (!c.isTipping_old()) {\n\t\t\t\t\t\t\topponent_feasible_moves++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Now remove the weight\n\t\t\t\t\t\tc.removeMove(j);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Need to take the max because one of the players may have played one\n\t\t// chance less\n\t\tif (self_remaining_moves == 0 && opponent_remaining_moves == 0) {\n\t\t\treturn 0.0;\n\t\t} else if (self_remaining_moves > opponent_remaining_moves)\n\t\t\treturn (double) (self_feasible_moves - opponent_feasible_moves)\n\t\t\t\t\t/ (double) (self_remaining_moves * vacant_spaces);\n\t\telse\n\t\t\treturn (double) (self_feasible_moves - opponent_feasible_moves)\n\t\t\t\t\t/ (double) (opponent_remaining_moves * vacant_spaces);\n\t}", "public void setNetworth(int value);", "@Override\n\tpublic void makeDecision() {\n\t\tint powerMax = (int)(initPower) / 100;\n\t\tint powerMin = (int)(initPower * 0.3) / 100;\n\n\t\t// The value is calculated randomly from 0 to 10% of the initial power\n\t\tRandom rand = new Random();\n\t\tint actualPower = rand.nextInt((powerMax - powerMin) + 1) + powerMin;\n\t\tanswer.setConsumption(actualPower);\n\t}", "private EstimatingTechnique(int value, String name, String literal) {\r\n\t\tthis.value = value;\r\n\t\tthis.name = name;\r\n\t\tthis.literal = literal;\r\n\t}", "private void setGBest(Particle p) {\n\t\tadjustGBest(p);\n\t\tgBest = p.copy();\n\t}", "private void initializeStatisticVariables(){\r\n\t\taverageFront9Score = 0;\r\n\t\taverageFront9PlusMinus = 0;\r\n\t\taverageBack9Score = 0;\r\n\t\taverageBack9PlusMinus = 0;\r\n fairways = 0;\r\n girs = 0;\r\n putts = 0;\r\n chips = 0;\r\n penalties = 0;\r\n\t\tnumberOfHoles = 0;\r\n\t\tnumberOfPar3Holes = 0;\r\n\t\tnumberOfPar4Holes = 0;\r\n\t\tnumberOfPar5Holes = 0;\r\n\t\talbatrossCount = 0;\r\n\t\teagleCount = 0;\r\n\t\tbirdieCount = 0;\r\n\t\tparCount = 0;\r\n\t\tbogeyCount = 0;\r\n\t\tdoubleBogeyCount = 0;\r\n\t\ttripleBogeyCount = 0;\r\n\t\tquadBogeyPlusCount = 0;\r\n par3Fairways = 0;\r\n par3Girs = 0;\r\n par3Putts = 0;\r\n par3Chips = 0;\r\n par3Penalties = 0;\r\n\t\tpar3EagleCount = 0;\r\n\t\tpar3BirdieCount = 0;\r\n\t\tpar3ParCount = 0;\r\n\t\tpar3BogeyCount = 0;\r\n\t\tpar3DoubleBogeyCount = 0;\r\n\t\tpar3TripleBogeyCount = 0;\r\n\t\tpar3QuadBogeyPlusCount = 0;\r\n par4Fairways = 0;\r\n par4Girs = 0;\r\n par4Putts = 0;\r\n par4Chips = 0;\r\n par4Penalties = 0;\r\n\t\tpar4AlbatrossCount = 0;\r\n\t\tpar4EagleCount = 0;\r\n\t\tpar4BirdieCount = 0;\r\n\t\tpar4ParCount = 0;\r\n\t\tpar4BogeyCount = 0;\r\n\t\tpar4DoubleBogeyCount = 0;\r\n\t\tpar4TripleBogeyCount = 0;\r\n\t\tpar4QuadBogeyPlusCount = 0;\r\n par5Fairways = 0;\r\n par5Girs = 0;\r\n par5Putts = 0;\r\n par5Chips = 0;\r\n par5Penalties = 0;\r\n\t\tpar5AlbatrossCount = 0;\r\n\t\tpar5EagleCount = 0;\r\n\t\tpar5BirdieCount = 0;\r\n\t\tpar5ParCount = 0;\r\n\t\tpar5BogeyCount = 0;\r\n\t\tpar5DoubleBogeyCount = 0;\r\n\t\tpar5TripleBogeyCount = 0;\r\n\t\tpar5QuadBogeyPlusCount = 0;\r\n clubs.clear();\r\n\t}", "private void setPairs() {\r\n\t\tif (this.gragraNames.getSelectedValue() != null) {\r\n\t\t\tString nameStr = (String) this.gragraNames.getSelectedValue();\r\n\t\t\tboolean found = false;\r\n\t\t\tfor (int i = 0; i < this.treeView.getGraGras().size() && !found; i++) {\r\n\t\t\t\tEdGraGra gragra = this.treeView.getGraGras().elementAt(i);\r\n\t\t\t\tString name = nameStr;\r\n\t\t\t\tint indx = nameStr.indexOf(\"(\");\r\n\t\t\t\tif (indx != -1)\r\n\t\t\t\t\tname = nameStr.substring(0, indx);\r\n\t\t\t\t// System.out.println(nameStr+\" \"+name);\r\n\t\t\t\tif (name.equals(gragra.getName())) {\r\n\t\t\t\t\tthis.criticalPairGraGra = gragra;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (this.criticalPairGraGra == null && this.stopGraph != null)\r\n\t\t\t\tthis.criticalPairGraGra = this.stopGraph;\r\n\t\t} else if (this.stopGraph != null) {\r\n\t\t\tthis.criticalPairGraGra = this.stopGraph;\r\n\t\t}\r\n\t}", "public void setBeta(double aBeta);", "public static void setGsSearchLosDiscard(double val) {\n gsSearchLosDiscard = val;\n }", "public static void main(String[] args) {\n\n\n\n\n\n ModelInterface model = new GameField(6, 7);\n Token blue = Token.BLUE;\n Token red = Token.RED;\n\n// model.setFieldStatus(0, red);\n// model.setFieldStatus(0, red);\n// model.setFieldStatus(0, red);\n\n model.setFieldStatus(0, red);\n model.setFieldStatus(1, blue);\n model.setFieldStatus(2, red);\n\n model.setFieldStatus(0, red);\n model.setFieldStatus(1, red);\n model.setFieldStatus(2, red);\n\n// model.setFieldStatus(2, blue);\n// model.setFieldStatus(2, blue);\n// model.setFieldStatus(2, blue);\n \n List<IRatingMechanism> ratingMechanisms = new ArrayList<IRatingMechanism>();\n ratingMechanisms.add(new MWin());\n ratingMechanisms.add(new MWinNot());\n// ratingMechanisms.add(new MGeneralPosition());\n// ratingMechanisms.add(new MTwoStonesWithSpaceChecking());\n// ratingMechanisms.add(new MCatch22());\n\n Tree tree = new Tree(model, ratingMechanisms, blue);\n System.out.println(tree.toString());\n\n MiniMaxAlgorithm instance = new MiniMaxAlgorithm();\n int result = instance.getBestMove(model, ratingMechanisms, blue);\n System.out.println(\"\" + result);\n\n\n\n\n\n }", "public void Grasshopper(){\n this.hops = 2;\n this.hopLim = 3;\n }", "public PollutedVarsPointsToAnalysis(DirectedGraph<Unit> graph) {\n super(graph);\n emptyMap = new HashMap<>();\n initialMap = new HashMap<>();\n\n }", "public void silverDropPoint()\r\n {\r\n System.out.println(\"silverDropPoint\");\r\n if (isCollectionPlane)\r\n {\r\n savePreviousPosition();\r\n setIsCollectionPlane(false);\r\n }\r\n if (motorJ1.getCurrentPosition() > SILVER_DROP_J1)\r\n {\r\n j1Power = -J1_POWER;\r\n }\r\n else if (motorJ1.getCurrentPosition() < SILVER_DROP_J1)\r\n {\r\n j1Power = J1_POWER;\r\n }\r\n\r\n if (motorJ2.getCurrentPosition() > SILVER_DROP_J2)\r\n {\r\n j2Power = -J2_POWER;\r\n }\r\n else if (motorJ2.getCurrentPosition() < SILVER_DROP_J2)\r\n {\r\n j2Power = J2_POWER;\r\n }\r\n\r\n if (motorJ3.getCurrentPosition() > SILVER_DROP_J3)\r\n {\r\n j3Power = -UP_POWER_J3;\r\n }\r\n else if (motorJ3.getCurrentPosition() < SILVER_DROP_J3)\r\n {\r\n j3Power = UP_POWER_J3;\r\n }\r\n toPosition(j1Power, j2Power, j3Power, SILVER_DROP_J1, SILVER_DROP_J2, SILVER_DROP_J3);\r\n j1Power = 0;\r\n j2Power = 0;\r\n j3Power = 0;\r\n }", "private List<Rectangle> getRectanglesToConsiderForBranchingVarCalculation () {\r\n \r\n List<Rectangle> rectanglesToConsider = new ArrayList<Rectangle> ();\r\n \r\n //for every constraint, see if it has rects at the best lp\r\n \r\n for (Map <Double, List<Rectangle>> rectMap: myInfeasibleRectanglesList) {\r\n for (List<Rectangle> rectList : rectMap.values()) { \r\n \r\n rectanglesToConsider.addAll(rectList );\r\n \r\n } \r\n }\r\n \r\n return rectanglesToConsider;\r\n }", "private void CreatingBeautyContent(int count,int typeSymmetry, int methodSearch) {\n\t\t\tConstraintsPlacement objConstraints= new ConstraintsPlacement(this);\r\n\t\t\t//Creating array with states\r\n\t\t\tArrayList<BlockNode> states = new ArrayList<BlockNode>();\r\n\t\t\t//Building the graph in a deph way\r\n\t \tGraphBuilder objGrapB= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB2= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB3= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB3a= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB4= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB5= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB6= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB7= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB8= new GraphBuilder(1);\r\n\t \t\r\n\t \tobjGrapB.setWparamether(wParamether);\r\n\t \tobjGrapB2.setWparamether(wParamether);\r\n\t \tobjGrapB3.setWparamether(wParamether);\r\n\t \tobjGrapB3a.setWparamether(wParamether);\r\n\t \tobjGrapB4.setWparamether(wParamether);\r\n\t \tobjGrapB5.setWparamether(wParamether);\r\n\t \tobjGrapB6.setWparamether(wParamether);\r\n\t \tobjGrapB7.setWparamether(wParamether);\r\n\t \tobjGrapB8.setWparamether(wParamether);\r\n\t \t\r\n\t \tint numElements=objElem.getNumberObjects();\r\n\t \tint numEnemies=objElem.getNumberObjectsEnemies();\r\n\t \tint globalControlSearch=0;\r\n\t \t\r\n\t \tdouble time6=0;\r\n\t \tdouble time7=0;\r\n\t \tdouble time3=0;\r\n\t \tdouble time4=0;\r\n\t \tdouble time5=0;\r\n\t \tdouble time8=0;\r\n\t \t\r\n\t \tdouble startTime=0;\r\n\t \tdouble stopTime=0;\r\n\t \t\r\n\t \tdouble sum3=0;\r\n\t \tdouble sum4=0;\r\n\t \tdouble sum5=0;\r\n\t \tdouble sum6=0;\r\n\t \tdouble sum7=0;\r\n\t \tdouble sum8=0;\r\n\r\n\t \t\r\n\t \t//Beststates=objGrapB.basicDepthSearch(mediumStraight,height,numElements,numElements,states,objConstraints, objElem.getFinalList(),objElem);\r\n\t \t//Beststates=objGrapB.relativePositionDepthSearch(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,-mediumStraight+2,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch);\r\n\t \t//Beststates=objGrapB.relativeTransPositionDepthSearch(mediumStraight,height,numElements,numElements,states,objConstraints, objElem.getFinalList(),objElem,-mediumStraight+1,mediumStraight-1,floorTileHeight,0,0,currentState,hTable);\r\n\t \t//Beststates=objGrapB.DepthSearchCenterFrame(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,1,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch);\r\n\t \t//Beststates=objGrapB.DepthSearchPruningAlt(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,1,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch);\r\n\t \t\r\n\t \r\n\r\n\t \r\n\t //3.3) Brute-force search\r\n\t //objElem.setFinalList(objElem.getFinalListNoOrder());\r\n\t \tfor(int i=0;i<1;i++)\r\n\t \t{\r\n\t \t\tstartTime = System.currentTimeMillis();\r\n\t \t\tBeststates3=objGrapB3.DepthSearchCenterFrameNoPruningNoRegionsNoObjects(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,0,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch,8,typeSymmetry);\r\n\t \t\tstopTime = System.currentTimeMillis();\r\n\t \t\ttime3 = stopTime - startTime;\r\n//\t \t\tround(time3,2);\r\n//\t \t\tdouble nodes3=round((double)objGrapB3.getCounterIDs(),2);\r\n//\t \t\tSystem.out.println(objGrapB3.bestSymmetryV+\" \"+time3+\" \"+((objGrapB3.getCounterIDs())));\r\n\t \t\tsum3=sum3+time3;\r\n\t \t}\r\n\t \ttime3=sum3/1;\r\n\t \ttime3=round(time3,2);\r\n\t //System.out.println(\"Time Brute-force search \"+elapsedTime);\r\n\t \t\r\n\t \r\n\t \r\n\t //3.7) B&B+heuristic\r\n\t //objElem.setFinalList(objElem.getFinalListNoOrder());\r\n\t \tfor(int i=0;i<1;i++)\r\n\t \t{\r\n\t \t\tstartTime = System.currentTimeMillis();\r\n\t \t\tBeststates7=objGrapB7.depthSearchBBHeuristic(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,0,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch,8,typeSymmetry);\r\n\t \t\tstopTime = System.currentTimeMillis();\r\n\t \t\ttime7 = stopTime - startTime;\r\n//\t \t\tround(time7,2);\r\n//\t \t\tdouble nodes7=round((double)objGrapB3.getCounterIDs(),2);\r\n//\t \t\tSystem.out.println(objGrapB6.bestSymmetryV+\" \"+time6+\" \"+((objGrapB6.getCounterIDs())));\r\n\t \t\tsum7=sum7+time7;\r\n\t \t}\r\n\t \ttime7=sum7/1;\r\n\t \ttime7=round(time7,2);\r\n\t //System.out.println(\"Time B&B+heuristic + region ordering \"+elapsedTime);\r\n\t \t\r\n\t \t\r\n\t \t\r\n//\t \tif(objGrapB3.bestSymmetryV<objGrapB5.bestSymmetryV)\r\n//\t \t{\r\n//\t \t\tdouble bestSYmmetry=objGrapB3.bestSymmetryV;\r\n//\t \t\t//System.out.println(\"bestSym \"+bestSYmmetry);\r\n//\t \t\tBestGlobalstates=Beststates3;\r\n//\t \t\t\r\n//\t \t}\r\n//\t \telse\r\n//\t \t{\r\n//\t \t\tdouble bestSYmmetry=objGrapB5.bestSymmetryV;\r\n//\t \t\t//System.out.println(\"bestSym \"+bestSYmmetry);\r\n//\t \t\tBestGlobalstates=Beststates5;\r\n//\t \t}\r\n\t \t\r\n\t \tBestGlobalstates=Beststates7;\r\n\t \r\n\t \r\n\t \t//**System.out.println(\"Simetry 0-> Brute-force search order \"+objGrapB3a.bestSymmetryV);\t\r\n\t \t//System.out.println(\"Simetry 1-> Brute-force search \"+objGrapB3.bestSymmetryV);\t \t\r\n\t \t//System.out.println(\"Simetry 2-> B&B+oldheuristic \"+objGrapB4.bestSymmetryV);\r\n\t \t//**System.out.println(\"Simetry 3-> B&B+heuristic + object ordering \"+objGrapB2.bestSymmetryV);\t \t\r\n\t \t//System.out.println(\"Simetry 4-> B&B+ region + leviheuristic\"+objGrapB5.bestSymmetryV);\r\n\t \t//**System.out.println(\"Simetry 5-> B&B+heuristic + region ordering + object ordering \"+objGrapB.bestSymmetryV);\r\n\t \t//System.out.println(\"Simetry 6-> B&B+heuristic + leviheuristic \"+objGrapB6.bestSymmetryV);\r\n\t \t//System.out.println(\"Simetry 7-> B&B+oldoldheuristic \"+objGrapB7.bestSymmetryV);\r\n\t \t\r\n\t \t//**System.out.println( \"States 0 \"+objGrapB3a.getCounterIDs() );\r\n\t \t//System.out.println( \"States 1 \"+objGrapB3.getCounterIDs() );\r\n\t \t//System.out.println( \"States 2 \"+objGrapB4.getCounterIDs() );\r\n\t \t//**System.out.println( \"States 3 \"+objGrapB2.getCounterIDs() );\t \t\t \t\r\n\t \t//System.out.println( \"States 4 \"+objGrapB5.getCounterIDs() );\r\n\t \t//**System.out.println( \"States 5 \"+objGrapB.getCounterIDs() );\r\n\t \t//System.out.println( \"States 6 \"+objGrapB6.getCounterIDs() );\r\n\t \t//System.out.println( \"States 7 \"+objGrapB7.getCounterIDs() );\r\n\t \t\r\n\t \tdouble TimeRate7=time3/time7;\r\n\t \tdouble TimeRate6=time3/time6;\r\n\t \tdouble TimeRate5=time3/time5;\r\n\t \t\r\n\t \tTimeRate7=round(TimeRate7,2);\r\n\t \tTimeRate6=round(TimeRate6,2);\r\n\t \tTimeRate5=round(TimeRate5,2);\r\n\t \t\r\n\t \tdouble NodesRate7=(double)objGrapB3.getCounterIDs()/(double)objGrapB7.getCounterIDs();\r\n\t \tdouble NodesRate6=(double)objGrapB3.getCounterIDs()/(double)objGrapB6.getCounterIDs();\r\n\t \tdouble NodesRate5=(double)objGrapB3.getCounterIDs()/(double)objGrapB5.getCounterIDs();\r\n\t \t\r\n\t \tNodesRate7=round(NodesRate7,2);\r\n\t \tNodesRate6=round(NodesRate6,2);\r\n\t \tNodesRate5=round(NodesRate5,2);\r\n\r\n\t \t\r\n\t \t\r\n\r\n\t //imprimiendo los estados visitados\r\n\t /*\r\n\t Iterator<BlockNode> nombreIterator = states.iterator();\r\n\t while(nombreIterator.hasNext()){\r\n\t \tBlockNode elemento = nombreIterator.next();\r\n\t \tSystem.out.print(elemento.getID()+\" / \");\r\n\t }*/\r\n\t \r\n\t //here we are painting as the best branch founded\r\n\t \r\n\t //System.out.println(\"nene \"+BestGlobalstates.size());\r\n\t Iterator<BlockNode> nombreIterator = BestGlobalstates.iterator();\r\n\t while(nombreIterator.hasNext()){\r\n\t \tBlockNode elemento = nombreIterator.next();\r\n\t \t//System.out.print(elemento.getID()+\"(\"+elemento.getX()+\" \"+elemento.getY()+\" ) - \"+elemento.getType()+\" \"+elemento.getIdElement()+ \" / \");\r\n\t }\r\n\t \r\n\t \r\n\t //Here we will put the elements on the tile\r\n\t try {\r\n\t Level levelScreen=PaintElements(BestGlobalstates,this);\r\n\t Screen objScreen=new Screen();\r\n\t\t\tobjScreen.SaveScreen(levelScreen,odds,objElem);\r\n \t\tInformacoesTelas info = new InformacoesTelas();\r\n\t CopiaArquivos copiador = new CopiaArquivos();\r\n\t \r\n\t info = info.carregaInfoTela(\"infoTela\");\r\n\t\t\tinfo.setOutrasVariaveis(0, 0); // Salva outras informacoes da Tela\r\n\t\t\tinfo.salvaInfoTela(\"infoTela\", info);\t\t\t\t\t\r\n\t\t\tcopiador.copy(\"\" + count, \"Screens/\");\r\n\t\t\t\r\n\t } catch (ClassNotFoundException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}", "public void setIntelligence(float intelligence)\n {\n this.intelligence = intelligence;\n }", "public void alg_REQAlg(){\r\nswitch (productIndex.value){\r\ncase 0:\r\r\n\tprice.value=10;\r\r\ncase 1:\t\r\r\n\tprice.value=20;\r\r\ncase 2:\r\r\n\tprice.value=30;\r\r\ndefault:\r\n\tprice.value=1;\r\r\n}\r\n}", "public double getParameterValue (Assignment input) ;", "public PTreeCredalSet(PotentialTable pot) {\n //super(pot.getVariables());\n super(pot.getListNonTransparents());\n Vector vTrans;\n Configuration confTrans;\n int nextremes;\n PotentialTable potrestricted;\n PotentialTree newpot;\n ProbabilityTree probTree=null;\n\n vTrans = pot.getListTransparents();\n confTrans = new Configuration(vTrans);\n nextremes = confTrans.possibleValues();\n\n if (nextremes > 1) {\n FiniteStates newTrans;\n \n probTree = new ProbabilityTree();\n newTrans = appendTransparentVariable(nextremes);\n probTree.assignVar(newTrans);\n for (int i = 0; i < nextremes; i++) {\n potrestricted = (PotentialTable) pot.restrictVariable(confTrans);\n newpot = potrestricted.toTree();\n probTree.replaceChild(newpot.getTree(), i);\n confTrans.nextConfiguration();\n }\n addVariable(newTrans);\n \n }\n else if(nextremes==1){\n potrestricted = (PotentialTable) pot.restrictVariable(confTrans);\n newpot = potrestricted.toTree();\n probTree=newpot.getTree();\n }\n setTree(probTree);\n\n }", "public void setVariablesFromValue() {\n\t\tif (this.value < .05) {\n\t\t\tthis.diameter = 10;\n\t\t\t// White\n\t\t\tthis.r = 255;\n\t\t\tthis.g= 255;\n\t\t\tthis.b = 255;\n\t\t} else if (this.value < .2) {\n\t\t\tthis.diameter = 20;\n\t\t\t// Gold\n\t\t\tthis.r = 245;\n\t\t\tthis.g = 171;\n\t\t\tthis.b = 53;\n\t\t} else if (this.value < 1) {\n\t\t\tthis.diameter = 40;\n\t\t\t// Turquoise\n\t\t\tthis.r = 3;\n\t\t\tthis.g= 201;\n\t\t\tthis.b = 169;\n\t\t} else if (this.value < 2) {\n\t\t\tthis.diameter = 80;\n\t\t\t// Burgundy\n\t\t\tthis.r = 192;\n\t\t\tthis.g= 57;\n\t\t\tthis.b = 43;\n\t\t}else if (this.value < 5) {\n\t\t\tthis.diameter = 100;\n\t\t\t// Purple\n\t\t\tthis.r = 155;\n\t\t\tthis.g= 89;\n\t\t\tthis.b = 182;\n\t\t}else if (this.value < 20) {\n\t\t\tthis.diameter = 150;\n\t\t\t// Steel Blue\n\t\t\tthis.r = 75;\n\t\t\tthis.g= 119;\n\t\t\tthis.b = 190;\n\t\t}else {\n\t\t\tthis.diameter = 200;\n\t\t\t// Pink\n\t\t\tthis.r = 210;\n\t\t\tthis.g= 82;\n\t\t\tthis.b = 127;\n\t\t}\n\t}", "public static void getValuationSlot() {\n float locX = M.evaluateLoc.x;\n float locY = M.evaluateLoc.y;\n M.lastZoneValuation = M.evaluateLoc.distanceTo(M.finalMove) * M.moveVectorStr; //Desire to move towards our main goal\n float test1;\n float test2;\n switch (angledRectangleCount) {\n default:\n case 20:\n if (M.evaluateLoc.isWithinDistance(Z20_center, Z20_maxdist)) {\n test1 = Float.sum(locX * Z20_p21x, locY * Z20_p21y);\n if (test1 >= Z20_dotsection2 && test1 <= Z20_p21MagSquared) {\n test2 = Float.sum(locX * Z20_p41x, locY * Z20_p41y);\n if (test2 >= Z20_dotsection4 && test2 <= Z20_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z20_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 19:\n if (M.evaluateLoc.isWithinDistance(Z19_center, Z19_maxdist)) {\n test1 = Float.sum(locX * Z19_p21x, locY * Z19_p21y);\n if (test1 >= Z19_dotsection2 && test1 <= Z19_p21MagSquared) {\n test2 = Float.sum(locX * Z19_p41x, locY * Z19_p41y);\n if (test2 >= Z19_dotsection4 && test2 <= Z19_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z19_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 18:\n if (M.evaluateLoc.isWithinDistance(Z18_center, Z18_maxdist)) {\n test1 = Float.sum(locX * Z18_p21x, locY * Z18_p21y);\n if (test1 >= Z18_dotsection2 && test1 <= Z18_p21MagSquared) {\n test2 = Float.sum(locX * Z18_p41x, locY * Z18_p41y);\n if (test2 >= Z18_dotsection4 && test2 <= Z18_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z18_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 17:\n if (M.evaluateLoc.isWithinDistance(Z17_center, Z17_maxdist)) {\n test1 = Float.sum(locX * Z17_p21x, locY * Z17_p21y);\n if (test1 >= Z17_dotsection2 && test1 <= Z17_p21MagSquared) {\n test2 = Float.sum(locX * Z17_p41x, locY * Z17_p41y);\n if (test2 >= Z17_dotsection4 && test2 <= Z17_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z17_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 16:\n if (M.evaluateLoc.isWithinDistance(Z16_center, Z16_maxdist)) {\n test1 = Float.sum(locX * Z16_p21x, locY * Z16_p21y);\n if (test1 >= Z16_dotsection2 && test1 <= Z16_p21MagSquared) {\n test2 = Float.sum(locX * Z16_p41x, locY * Z16_p41y);\n if (test2 >= Z16_dotsection4 && test2 <= Z16_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z16_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 15:\n if (M.evaluateLoc.isWithinDistance(Z15_center, Z15_maxdist)) {\n test1 = Float.sum(locX * Z15_p21x, locY * Z15_p21y);\n if (test1 >= Z15_dotsection2 && test1 <= Z15_p21MagSquared) {\n test2 = Float.sum(locX * Z15_p41x, locY * Z15_p41y);\n if (test2 >= Z15_dotsection4 && test2 <= Z15_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z15_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 14:\n if (M.evaluateLoc.isWithinDistance(Z14_center, Z14_maxdist)) {\n test1 = Float.sum(locX * Z14_p21x, locY * Z14_p21y);\n if (test1 >= Z14_dotsection2 && test1 <= Z14_p21MagSquared) {\n test2 = Float.sum(locX * Z14_p41x, locY * Z14_p41y);\n if (test2 >= Z14_dotsection4 && test2 <= Z14_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z14_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 13:\n if (M.evaluateLoc.isWithinDistance(Z13_center, Z13_maxdist)) {\n test1 = Float.sum(locX * Z13_p21x, locY * Z13_p21y);\n if (test1 >= Z13_dotsection2 && test1 <= Z13_p21MagSquared) {\n test2 = Float.sum(locX * Z13_p41x, locY * Z13_p41y);\n if (test2 >= Z13_dotsection4 && test2 <= Z13_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z13_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 12:\n if (M.evaluateLoc.isWithinDistance(Z12_center, Z12_maxdist)) {\n test1 = Float.sum(locX * Z12_p21x, locY * Z12_p21y);\n if (test1 >= Z12_dotsection2 && test1 <= Z12_p21MagSquared) {\n test2 = Float.sum(locX * Z12_p41x, locY * Z12_p41y);\n if (test2 >= Z12_dotsection4 && test2 <= Z12_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z12_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 11:\n if (M.evaluateLoc.isWithinDistance(Z11_center, Z11_maxdist)) {\n test1 = Float.sum(locX * Z11_p21x, locY * Z11_p21y);\n if (test1 >= Z11_dotsection2 && test1 <= Z11_p21MagSquared) {\n test2 = Float.sum(locX * Z11_p41x, locY * Z11_p41y);\n if (test2 >= Z11_dotsection4 && test2 <= Z11_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z11_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 10:\n if (M.evaluateLoc.isWithinDistance(Z10_center, Z10_maxdist)) {\n test1 = Float.sum(locX * Z10_p21x, locY * Z10_p21y);\n if (test1 >= Z10_dotsection2 && test1 <= Z10_p21MagSquared) {\n test2 = Float.sum(locX * Z10_p41x, locY * Z10_p41y);\n if (test2 >= Z10_dotsection4 && test2 <= Z10_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z10_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 9:\n if (M.evaluateLoc.isWithinDistance(Z9_center, Z9_maxdist)) {\n test1 = Float.sum(locX * Z9_p21x, locY * Z9_p21y);\n if (test1 >= Z9_dotsection2 && test1 <= Z9_p21MagSquared) {\n test2 = Float.sum(locX * Z9_p41x, locY * Z9_p41y);\n if (test2 >= Z9_dotsection4 && test2 <= Z9_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z9_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 8:\n if (M.evaluateLoc.isWithinDistance(Z8_center, Z8_maxdist)) {\n test1 = Float.sum(locX * Z8_p21x, locY * Z8_p21y);\n if (test1 >= Z8_dotsection2 && test1 <= Z8_p21MagSquared) {\n test2 = Float.sum(locX * Z8_p41x, locY * Z8_p41y);\n if (test2 >= Z8_dotsection4 && test2 <= Z8_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z8_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 7:\n if (M.evaluateLoc.isWithinDistance(Z7_center, Z7_maxdist)) {\n test1 = Float.sum(locX * Z7_p21x, locY * Z7_p21y);\n if (test1 >= Z7_dotsection2 && test1 <= Z7_p21MagSquared) {\n test2 = Float.sum(locX * Z7_p41x, locY * Z7_p41y);\n if (test2 >= Z7_dotsection4 && test2 <= Z7_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z7_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 6:\n if (M.evaluateLoc.isWithinDistance(Z6_center, Z6_maxdist)) {\n test1 = Float.sum(locX * Z6_p21x, locY * Z6_p21y);\n if (test1 >= Z6_dotsection2 && test1 <= Z6_p21MagSquared) {\n test2 = Float.sum(locX * Z6_p41x, locY * Z6_p41y);\n if (test2 >= Z6_dotsection4 && test2 <= Z6_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z6_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 5:\n if (M.evaluateLoc.isWithinDistance(Z5_center, Z5_maxdist)) {\n test1 = Float.sum(locX * Z5_p21x, locY * Z5_p21y);\n if (test1 >= Z5_dotsection2 && test1 <= Z5_p21MagSquared) {\n test2 = Float.sum(locX * Z5_p41x, locY * Z5_p41y);\n if (test2 >= Z5_dotsection4 && test2 <= Z5_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z5_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 4:\n if (M.evaluateLoc.isWithinDistance(Z4_center, Z4_maxdist)) {\n test1 = Float.sum(locX * Z4_p21x, locY * Z4_p21y);\n if (test1 >= Z4_dotsection2 && test1 <= Z4_p21MagSquared) {\n test2 = Float.sum(locX * Z4_p41x, locY * Z4_p41y);\n if (test2 >= Z4_dotsection4 && test2 <= Z4_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z4_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 3:\n if (M.evaluateLoc.isWithinDistance(Z3_center, Z3_maxdist)) {\n test1 = Float.sum(locX * Z3_p21x, locY * Z3_p21y);\n if (test1 >= Z3_dotsection2 && test1 <= Z3_p21MagSquared) {\n test2 = Float.sum(locX * Z3_p41x, locY * Z3_p41y);\n if (test2 >= Z3_dotsection4 && test2 <= Z3_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z3_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 2:\n if (M.evaluateLoc.isWithinDistance(Z2_center, Z2_maxdist)) {\n test1 = Float.sum(locX * Z2_p21x, locY * Z2_p21y);\n if (test1 >= Z2_dotsection2 && test1 <= Z2_p21MagSquared) {\n test2 = Float.sum(locX * Z2_p41x, locY * Z2_p41y);\n if (test2 >= Z2_dotsection4 && test2 <= Z2_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z2_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 1:\n if (M.evaluateLoc.isWithinDistance(Z1_center, Z1_maxdist)) {\n test1 = Float.sum(locX * Z1_p21x, locY * Z1_p21y);\n if (test1 >= Z1_dotsection2 && test1 <= Z1_p21MagSquared) {\n test2 = Float.sum(locX * Z1_p41x, locY * Z1_p41y);\n if (test2 >= Z1_dotsection4 && test2 <= Z1_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z1_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 0:\n }\n switch (circleCount) {\n case 20:\n if (M.evaluateLoc.isWithinDistance(Z20c_center, Z20c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z20c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 19:\n if (M.evaluateLoc.isWithinDistance(Z19c_center, Z19c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z19c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 18:\n if (M.evaluateLoc.isWithinDistance(Z18c_center, Z18c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z18c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 17:\n if (M.evaluateLoc.isWithinDistance(Z17c_center, Z17c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z17c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 16:\n if (M.evaluateLoc.isWithinDistance(Z16c_center, Z16c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z16c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 15:\n if (M.evaluateLoc.isWithinDistance(Z15c_center, Z15c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z15c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 14:\n if (M.evaluateLoc.isWithinDistance(Z14c_center, Z14c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z14c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 13:\n if (M.evaluateLoc.isWithinDistance(Z13c_center, Z13c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z13c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 12:\n if (M.evaluateLoc.isWithinDistance(Z12c_center, Z12c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z12c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 11:\n if (M.evaluateLoc.isWithinDistance(Z11c_center, Z11c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z11c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 10:\n if (M.evaluateLoc.isWithinDistance(Z10c_center, Z10c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z10c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 9:\n if (M.evaluateLoc.isWithinDistance(Z9c_center, Z9c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z9c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 8:\n if (M.evaluateLoc.isWithinDistance(Z8c_center, Z8c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z8c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 7:\n if (M.evaluateLoc.isWithinDistance(Z7c_center, Z7c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z7c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 6:\n if (M.evaluateLoc.isWithinDistance(Z6c_center, Z6c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z6c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 5:\n if (M.evaluateLoc.isWithinDistance(Z5c_center, Z5c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z5c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 4:\n if (M.evaluateLoc.isWithinDistance(Z4c_center, Z4c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z4c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 3:\n if (M.evaluateLoc.isWithinDistance(Z3c_center, Z3c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z3c_desire);\n }\n case 2:\n if (M.evaluateLoc.isWithinDistance(Z2c_center, Z2c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z2c_desire);\n }\n case 1:\n if (M.evaluateLoc.isWithinDistance(Z1c_center, Z1c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z1c_desire);\n }\n case 0:\n }\n switch (vectorCircleCount) {\n case 20:\n if (M.evaluateLoc.isWithinDistance(Z20vc_center, Z20vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z20vc_baseDesire, M.evaluateLoc.distanceTo(Z20vc_center) * Z20vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 19:\n if (M.evaluateLoc.isWithinDistance(Z19vc_center, Z19vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z19vc_baseDesire, M.evaluateLoc.distanceTo(Z19vc_center) * Z19vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 18:\n if (M.evaluateLoc.isWithinDistance(Z18vc_center, Z18vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z18vc_baseDesire, M.evaluateLoc.distanceTo(Z18vc_center) * Z18vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 17:\n if (M.evaluateLoc.isWithinDistance(Z17vc_center, Z17vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z17vc_baseDesire, M.evaluateLoc.distanceTo(Z17vc_center) * Z17vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 16:\n if (M.evaluateLoc.isWithinDistance(Z16vc_center, Z16vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z16vc_baseDesire, M.evaluateLoc.distanceTo(Z16vc_center) * Z16vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 15:\n if (M.evaluateLoc.isWithinDistance(Z15vc_center, Z15vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z15vc_baseDesire, M.evaluateLoc.distanceTo(Z15vc_center) * Z15vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 14:\n if (M.evaluateLoc.isWithinDistance(Z14vc_center, Z14vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z14vc_baseDesire, M.evaluateLoc.distanceTo(Z14vc_center) * Z14vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 13:\n if (M.evaluateLoc.isWithinDistance(Z13vc_center, Z13vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z13vc_baseDesire, M.evaluateLoc.distanceTo(Z13vc_center) * Z13vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 12:\n if (M.evaluateLoc.isWithinDistance(Z12vc_center, Z12vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z12vc_baseDesire, M.evaluateLoc.distanceTo(Z12vc_center) * Z12vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 11:\n if (M.evaluateLoc.isWithinDistance(Z11vc_center, Z11vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z11vc_baseDesire, M.evaluateLoc.distanceTo(Z11vc_center) * Z11vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 10:\n if (M.evaluateLoc.isWithinDistance(Z10vc_center, Z10vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z10vc_baseDesire, M.evaluateLoc.distanceTo(Z10vc_center) * Z10vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 9:\n if (M.evaluateLoc.isWithinDistance(Z9vc_center, Z9vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z9vc_baseDesire, M.evaluateLoc.distanceTo(Z9vc_center) * Z9vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 8:\n if (M.evaluateLoc.isWithinDistance(Z8vc_center, Z8vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z8vc_baseDesire, M.evaluateLoc.distanceTo(Z8vc_center) * Z8vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 7:\n if (M.evaluateLoc.isWithinDistance(Z7vc_center, Z7vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z7vc_baseDesire, M.evaluateLoc.distanceTo(Z7vc_center) * Z7vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 6:\n if (M.evaluateLoc.isWithinDistance(Z6vc_center, Z6vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z6vc_baseDesire, M.evaluateLoc.distanceTo(Z6vc_center) * Z6vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 5:\n if (M.evaluateLoc.isWithinDistance(Z5vc_center, Z5vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z5vc_baseDesire, M.evaluateLoc.distanceTo(Z5vc_center) * Z5vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 4:\n if (M.evaluateLoc.isWithinDistance(Z4vc_center, Z4vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z4vc_baseDesire, M.evaluateLoc.distanceTo(Z4vc_center) * Z4vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 3:\n if (M.evaluateLoc.isWithinDistance(Z3vc_center, Z3vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z3vc_baseDesire, M.evaluateLoc.distanceTo(Z3vc_center) * Z3vc_distanceDesire));\n }\n case 2:\n if (M.evaluateLoc.isWithinDistance(Z2vc_center, Z2vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z2vc_baseDesire, M.evaluateLoc.distanceTo(Z2vc_center) * Z2vc_distanceDesire));\n }\n case 1:\n if (M.evaluateLoc.isWithinDistance(Z1vc_center, Z1vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z1vc_baseDesire, M.evaluateLoc.distanceTo(Z1vc_center) * Z1vc_distanceDesire));\n }\n case 0:\n }\n //Rarely used, should be optimized the same way if this becomes more common\n for (int i = M.squareIndexMinusOne; i >= 0; i--) {\n ZoneSquare zone = M.squares[i];\n if (zone.left < locX && locX < zone.right && locY < zone.top && locY > zone.bot) {\n M.lastZoneValuation += zone.desire;\n }\n }\n }", "public void setBraking(double braking) {\r\n this.braking = braking;\r\n }", "public void setFlete(double param){\n \n this.localFlete=param;\n \n\n }", "void updateVariableDiscount(int acc_no, Double discount_rate, String catalog_name);", "public void useRawVarimax(){\n this. varimaxOption = false;\n }", "void switchToDeterminate(int pUnits);", "public void goldDropPoint()\r\n {\r\n System.out.println(\"goldDropPoint\");\r\n setManual(false);\r\n if (isCollectionPlane)\r\n {\r\n savePreviousPosition();\r\n setIsCollectionPlane(false);\r\n }\r\n if (motorJ1.getCurrentPosition() > GOLD_DROP_J1)\r\n {\r\n j1Power = -J1_POWER;\r\n }\r\n else if (motorJ1.getCurrentPosition() < GOLD_DROP_J1)\r\n {\r\n j1Power = J1_POWER;\r\n }\r\n\r\n if (motorJ2.getCurrentPosition() > GOLD_DROP_J2)\r\n {\r\n j2Power = -J2_POWER;\r\n }\r\n else if (motorJ2.getCurrentPosition() < GOLD_DROP_J2)\r\n {\r\n j2Power = J2_POWER;\r\n }\r\n\r\n if (motorJ3.getCurrentPosition() > GOLD_DROP_J3)\r\n {\r\n j3Power = -UP_POWER_J3;\r\n }\r\n else if (motorJ3.getCurrentPosition() < GOLD_DROP_J3)\r\n {\r\n j3Power = UP_POWER_J3;\r\n }\r\n toPosition(j1Power, j2Power, j3Power, GOLD_DROP_J1, GOLD_DROP_J2, GOLD_DROP_J3);\r\n j1Power = 0;\r\n j2Power = 0;\r\n j3Power = 0;\r\n }", "@Test\n public void testDecisionRule2() throws IOException {\n \n Data data = getDataObject(\"./data/adult.csv\");\n DataHandle handle = data.getHandle();\n \n RiskModelPopulationUniqueness model = handle.getRiskEstimator(ARXPopulationModel.create(handle.getNumRows(), 0.1d)).getPopulationBasedUniquenessRisk();\n double sampleUniqueness = handle.getRiskEstimator(ARXPopulationModel.create(handle.getNumRows(), 0.1d)).getSampleBasedUniquenessRisk().getFractionOfUniqueRecords();\n double populationUniqueness = model.getFractionOfUniqueTuplesDankar();\n \n if (model.getPopulationUniquenessModel() == PopulationUniquenessModel.PITMAN) {\n assertTrue(populationUniqueness + \"/\" + sampleUniqueness, compareUniqueness(populationUniqueness, 0.27684993883653597) == 0);\n } else if (model.getPopulationUniquenessModel() == PopulationUniquenessModel.ZAYATZ) {\n assertTrue(populationUniqueness + \"/\" + sampleUniqueness, compareUniqueness(populationUniqueness, 0.3207402393466189) == 0);\n } else {\n fail(\"Unexpected convergence of SNB\");\n }\n assertTrue(populationUniqueness + \"/\" + sampleUniqueness, compareUniqueness(populationUniqueness, sampleUniqueness) <= 0);\n \n model = handle.getRiskEstimator(ARXPopulationModel.create(handle.getNumRows(), 0.2d)).getPopulationBasedUniquenessRisk();\n populationUniqueness = model.getFractionOfUniqueTuplesDankar();\n assertTrue(populationUniqueness + \"/\" + sampleUniqueness, compareUniqueness(populationUniqueness, 0.3577099234829125d) == 0);\n assertTrue(populationUniqueness + \"/\" + sampleUniqueness, compareUniqueness(populationUniqueness, sampleUniqueness) <= 0);\n \n model = handle.getRiskEstimator(ARXPopulationModel.create(handle.getNumRows(), 0.01d)).getPopulationBasedUniquenessRisk();\n populationUniqueness = model.getFractionOfUniqueTuplesDankar();\n assertTrue(populationUniqueness + \"/\" + sampleUniqueness, compareUniqueness(populationUniqueness, 0.1446083531167384) == 0);\n assertTrue(populationUniqueness + \"/\" + sampleUniqueness, compareUniqueness(populationUniqueness, sampleUniqueness) <= 0);\n \n model = handle.getRiskEstimator(ARXPopulationModel.create(handle.getNumRows(), 1d)).getPopulationBasedUniquenessRisk();\n populationUniqueness = model.getFractionOfUniqueTuplesDankar();\n assertTrue(populationUniqueness + \"/\" + sampleUniqueness, compareUniqueness(populationUniqueness, 0.5142895033485844) == 0);\n assertTrue(populationUniqueness + \"/\" + sampleUniqueness, compareUniqueness(populationUniqueness, sampleUniqueness) == 0);\n }", "private void populateRules() {\n BeerTemperatureLimitDTO beer1 = new BeerTemperatureLimitDTO();\n beer1.setMinimumThreshold(4.0);\n beer1.setMaximumThreshold(6.0);\n temperatureLimitsMap.put(\"Pilsner\", beer1);\n\n BeerTemperatureLimitDTO beer2 = new BeerTemperatureLimitDTO();\n beer2.setMinimumThreshold(5.0);\n beer2.setMaximumThreshold(6.0);\n temperatureLimitsMap.put(\"IPA\", beer2);\n\n BeerTemperatureLimitDTO beer3 = new BeerTemperatureLimitDTO();\n beer3.setMinimumThreshold(4.0);\n beer3.setMaximumThreshold(7.0);\n temperatureLimitsMap.put(\"Lager\", beer3);\n\n BeerTemperatureLimitDTO beer4 = new BeerTemperatureLimitDTO();\n beer4.setMinimumThreshold(6.0);\n beer4.setMaximumThreshold(8.0);\n temperatureLimitsMap.put(\"Stout\", beer4);\n\n BeerTemperatureLimitDTO beer5 = new BeerTemperatureLimitDTO();\n beer5.setMinimumThreshold(3.0);\n beer5.setMaximumThreshold(5.0);\n temperatureLimitsMap.put(\"Wheat beer\", beer5);\n\n\n BeerTemperatureLimitDTO beer6 = new BeerTemperatureLimitDTO();\n beer6.setMinimumThreshold(4.0);\n beer6.setMaximumThreshold(6.0);\n temperatureLimitsMap.put(\"Pale Ale\", beer6);\n }", "public NeighborhoodDistribution(int divisions) {this.divisions=divisions;}", "private void BC_duct(Grid gr){\r\n int i, j;\t\t\r\n NSmax=(int)(20/dt); repL=0.1;\r\n\t\t\r\n // boundary conditions of lower side of computational domain\r\n for(i = 0; i<mx; i++) BClow[i]=\"wall\"; \r\n // boundary conditions of upper side \r\n for(i = 0; i<mx; i++) BCupp[i]=\"wall\";\r\n // boundary conditions of left side\r\n for(j = 0; j<my; j++) BClef[j]=\"in\";\r\n // boundary conditions of right side\r\n for(j = 0; j<my; j++) BCrig[j]=\"out\";\r\n\t\r\n // initial conditions\r\n //for(j = 1; j <mym; j++){ \r\n // u[0][j]=Umean; //2.0*Umean*(1.0-4.0*(gr.y[0][j]-0.5)*(gr.y[0][j]-0.5));\r\n //}\r\n for(i = 0; i < mx; i++){ \r\n for(j = 1; j<mym; j++) u[i][j]=Umean;\r\n }\r\n // xmin=1.6; ymin=-3; xmax=8.6; ymax=3;\r\n }", "public void changeRob(int x, int y) {\n if (identifier == 1) {\n redY = y;\n redX = x;\n if (redY == goalY & redX == goalX & identifier == goalId) {\n if (bid.PlayerTurn == 1) {\n Scores.P1Scores = Scores.P1Scores + 1;\n }\n if (bid.PlayerTurn == 2) {\n Scores.P2Scores = Scores.P2Scores + 1;\n }\n if (bid.PlayerTurn == 3) {\n Scores.P3Scores = Scores.P3Scores + 1;\n }\n if (bid.PlayerTurn == 4) {\n Scores.P4Scores = Scores.P4Scores + 1;\n }\n bid.TooManyMoves();\n bid.BackToBidLayer();\n loadGoal();\n }\n }\n if (identifier == 2) {\n blueY = y;\n blueX = x;\n if (blueY == goalY & blueX == goalX & identifier == goalId) {\n if (bid.PlayerTurn == 1) {\n Scores.P1Scores = Scores.P1Scores + 1;\n }\n if (bid.PlayerTurn == 2) {\n Scores.P2Scores = Scores.P2Scores + 1;\n }\n if (bid.PlayerTurn == 3) {\n Scores.P3Scores = Scores.P3Scores + 1;\n }\n if (bid.PlayerTurn == 4) {\n Scores.P4Scores = Scores.P4Scores + 1;\n }\n bid.TooManyMoves();\n bid.BackToBidLayer();\n loadGoal();\n }\n }\n if (identifier == 3) {\n greenY = y;\n greenX = x;\n if (greenY == goalY & greenX == goalX & identifier == goalId) {\n if (bid.PlayerTurn == 1) {\n Scores.P1Scores = Scores.P1Scores + 1;\n }\n if (bid.PlayerTurn == 2) {\n Scores.P2Scores = Scores.P2Scores + 1;\n }\n if (bid.PlayerTurn == 3) {\n Scores.P3Scores = Scores.P3Scores + 1;\n }\n if (bid.PlayerTurn == 4) {\n Scores.P4Scores = Scores.P4Scores + 1;\n }\n bid.TooManyMoves();\n bid.BackToBidLayer();\n loadGoal();\n }\n }\n if (identifier == 4) {\n yellowY = y;\n yellowX = x;\n if (yellowY == goalY & yellowX == goalX & identifier == goalId) {\n if (bid.PlayerTurn == 1) {\n Scores.P1Scores = Scores.P1Scores + 1;\n }\n if (bid.PlayerTurn == 2) {\n Scores.P2Scores = Scores.P2Scores + 1;\n }\n if (bid.PlayerTurn == 3) {\n Scores.P3Scores = Scores.P3Scores + 1;\n }\n if (bid.PlayerTurn == 4) {\n Scores.P4Scores = Scores.P4Scores + 1;\n }\n bid.TooManyMoves();\n bid.BackToBidLayer();\n loadGoal();\n }\n }\n }", "public void setW1 (float value) {\r\n w1 = value;\r\n }", "public void set_constant( double cutoff ){\n\t\tswitchOff=cutoff;\n\t}", "public void setTestBoard() {\n\n /*game.setNode(new NodeImp(\"2,3\",\"P1\"));\n\n game.setNode(new NodeImp(\"2,5\",\"P1\"));\n\n game.setNode(new NodeImp(\"3,2\",\"P2\"));\n\n game.setNode(new NodeImp(\"3,3\",\"P2\"));\n\n game.setNode(new NodeImp(\"3,4\",\"P1\"));\n\n game.setNode(new NodeImp(\"3,5\",\"P1\"));\n\n game.setNode(new NodeImp(\"4,3\",\"P1\"));\n\n game.setNode(new NodeImp(\"4,4\",\"P2\"));\n\n game.setNode(new NodeImp(\"4,5\",\"P1\"));\n\n game.setNode(new NodeImp(\"5,5\",\"P2\"));\n\n game.setNode(new NodeImp(\"3,3\",\"P2\"));\n\n game.setNode(new NodeImp(\"3,4\",\"P1\"));\n\n game.setNode(new NodeImp(\"4,3\",\"P1\"));\n\n game.setNode(new NodeImp(\"4,4\",\"P2\"));*/\n\n }", "@Override\n public void evaluate(Solution solution) throws JMException {\n\n int[] tour = new int[numberOfNodes + 1];\n int firstCity = ((Permutation) solution.getDecisionVariables()[0]).vector_[0];\n int lastCity = ((Permutation) solution.getDecisionVariables()[0]).vector_[numberOfNodes - 1];\n\n double fitness1_td = 0.0;\n\n // Calculate fitness 1 - total distance\n for (int i = 0; i < numberOfNodes - 1; i++) {\n int x = ((Permutation) solution.getDecisionVariables()[0]).vector_[i];\n int y = ((Permutation) solution.getDecisionVariables()[0]).vector_[i+1];\n\n tour[i] = x;\n tour[i+1] = y;\n\n fitness1_td += calDistances(x, y);\n }\n // generate tour with same start city and end city\n tour[numberOfNodes] = tour[0];\n\n fitness1_td += calDistances(firstCity, lastCity);\n\n\n // Correctness check: does the tour start and end in the same city\n if(tour[0] != tour[tour.length - 1]) {\n System.err.println(\"ERROR: The last city must be the same as the first city\");\n System.exit(1);\n }\n\n /*for (int i = 0; i < tour.length; i++) {\n System.out.print(tour[i] + \" \");\n }*/\n //System.out.println(\"\\n\" + tour.length);\n\n // Calculate fitness 2 - objective value of a given tour\n ArrayInt z = (ArrayInt) solution.getDecisionVariables()[1];\n //System.out.println(z.getLength());\n\n double fitness2_ob;\n double wc = 0.0;\n double ft = 0.0;\n double fp = 0.0;\n\n //the following is used for a different interpretation of \"packingPlan\"\n int itemsPerCity = z.getLength() / (tour.length - 2);\n //System.out.println(itemsPerCity);\n\n for (int i = 0; i < tour.length - 1; i++) {\n\n int currentCityTEMP = tour[i];\n // what's the current city? --> but the items start at city 2 in the TTP file, so I have to take another 1 off!\n int currentCity = currentCityTEMP - 1;\n\n if (i > 0) {\n\n if (currentCity == -1) {\n // No items in city 1\n wc += 0.0;\n fp += 0.0;\n\n } else {\n\n for (int itemNumber = 0; itemNumber < itemsPerCity; itemNumber++) {\n\n int indexOfPackingPlan = (i-1) * itemsPerCity + itemNumber;\n // what is the next item's index in items-array?\n int itemIndex = currentCity + itemNumber * (numberOfNodes - 1);\n //System.out.println(\"i: \" + i);\n\n if (z.getValue(indexOfPackingPlan) == 1) {\n // pack item\n //System.out.println(itemIndex);\n int currentWC = items[itemIndex][2];\n wc += currentWC;\n\n int currentFP = items[itemIndex][1];\n fp += currentFP;\n }\n }\n\n }\n\n int h = (i+1) % (tour.length-1); //h: next tour city index\n //System.out.println(\"h: \" + h);\n long distance = calDistances(i, h);\n // compute the adjusted (effective) distance\n ft += (distance / (1 - wc * (maxSpeed - minSpeed) / capacityOfKnapsack));\n }\n }\n\n wendUsed = wc;\n wend = capacityOfKnapsack - wc;\n fitness2_ob = fp - ft * rentingRatio;\n\n solution.setObjective(0, fitness1_td);\n solution.setObjective(1, -fitness2_ob); // Convert from maximum objective value to minimum objective value\n }", "void setBalance(double value);", "public abstract void setLOD(int lod);", "protected Element initAssuranceToMyVar() {\n\t\tElement an = el(\"bpws:assign\", new Node[]{\n\t\t\t\tinitMyVar(new Node[]{\n\t\t\t\t\tel(\"nswomoxsd:type\", text(\"Assurance\")),\n\t\t\t\t\tel(\"nswomoxsd:leftValue\", text(\"0\")),\n\t\t\t\t\tel(\"nswomoxsd:rightValue\", text(\"0\")),\n\t\t\t\t\tel(\"nswomoxsd:value\", text(\"0\"))\n\t\t\t\t}),\n\t\t\t\tsetProcId()\n\t\t});\n\t\treturn an;\n\t}", "public LSMOP9(String solutionType, Integer numberOfVariables,\r\n\t\t\tInteger numberOfObjectives) {\r\n\t\tsuper(solutionType, numberOfVariables, numberOfObjectives);\r\n\t\tnumberOfVariables_ = numberOfVariables;\r\n\t\tnumberOfObjectives_ = numberOfObjectives;\r\n\t\tnumberOfConstraints_ = 0;\r\n\t\tproblemName_ = \"LSMOP9\";\r\n\r\n\t\tnk = 5;\r\n\t\tc = new double[numberOfObjectives_];\r\n\t\tc[0] = 3.8*0.1*(1.0-0.1);\r\n\t\tdouble sumC = c[0];\r\n\t\tfor(int i = 1; i < numberOfObjectives_; i++){\r\n\t\t\tc[i] = 3.8*c[i-1]*(1.0-c[i-1]);\r\n\t\t\tsumC += c[i];\r\n\t\t}\r\n\t\tsublen = new int[numberOfObjectives_];\r\n\t\tfor(int i = 0; i < numberOfObjectives_; i++){\r\n\t\t\t//sublen[i] = (int)Math.ceil(Math.round(numberOfVariables_*c[i]/sumC)/nk);\r\n\t\t\t//sublen[i] = (int)Math.floor(numberOfVariables_*c[i]/sumC/nk);\r\n\t\t\tsublen[i] = (int)Math.floor((numberOfVariables_-numberOfObjectives_+1)*c[i]/sumC/nk);\r\n\t\t}\r\n\t\tlen = new int[numberOfObjectives_+1]; \r\n\t\tlen[0] = 0;\r\n\t\tfor(int i = 0; i < numberOfObjectives_; i++){\r\n\t\t\tlen[i+1] = len[i] + nk*sublen[i];\r\n\t\t}\r\n\t\tlowerLimit_ = new double[numberOfVariables_];\r\n\t\tupperLimit_ = new double[numberOfVariables_];\r\n\t\tfor (int var = 0; var < numberOfObjectives_ - 1; var++) {\r\n\t\t\tlowerLimit_[var] = 0.0;\r\n\t\t\tupperLimit_[var] = 1.0;\r\n\t\t} // for\r\n\t\t\r\n\t\tfor (int var = numberOfObjectives_ - 1; var < numberOfVariables_; var++) {\r\n\t\t\tlowerLimit_[var] = 0.0;\r\n\t\t\tupperLimit_[var] = 10.0;\r\n\t\t} // for\r\n\r\n\t\tif (solutionType.compareTo(\"BinaryReal\") == 0)\r\n\t\t\tsolutionType_ = new BinaryRealSolutionType(this);\r\n\t\telse if (solutionType.compareTo(\"Real\") == 0)\r\n\t\t\tsolutionType_ = new RealSolutionType(this);\r\n\t\telse {\r\n\t\t\tSystem.out.println(\"Error: solution type \" + solutionType\r\n\t\t\t\t\t+ \" invalid\");\r\n\t\t\tSystem.exit(-1);\r\n\t\t}\r\n\t}", "public PresentValueHullWhiteMonteCarloCalculator() {\n _nbPath = DEFAULT_NB_PATH;\n }", "float getFixedHotwordGain();", "public int chooseVTD(){\n int min=0;\n //this loop is used to avoid a bug\n for(int i=0;i<heuristicArrayTD.length;i++){\n if(heuristicArrayTD[i]< heuristicArrayTD[min]){\n min=i;\n }\n }\n int max=min;\n //returns highest scoring and unused var\n for(int i=0;i<heuristicArrayTD.length;i++){\n if(heuristicArrayTD[i]>= heuristicArrayTD[max] && usageArray[i%variableLength]==0){\n max=i;\n }\n }\n return max%variableLength;\n }", "public void specialize(){\n\tdefense *= .6;\n\tattRating *= 1.4;\n\tif ( attRating > 2.0){\n\t attRating = 2.0;\n\t}\n }", "private void setUsedValueInBoxes() {\n \n setUsedValuesByBox(1,3,1,3);\n setUsedValuesByBox(1,3,4,6);\n setUsedValuesByBox(1,3,7,9);\n setUsedValuesByBox(4,6,1,3);\n setUsedValuesByBox(4,6,4,6);\n setUsedValuesByBox(4,6,7,9);\n setUsedValuesByBox(7,9,1,3);\n setUsedValuesByBox(7,9,4,6);\n setUsedValuesByBox(7,9,7,9);\n }", "private void setWeight() {\n \tthis.trainWeight = (this.trainCars*TRAIN_WEIGHT) + (this.crew + this.numPassengers) * AVE_PASSENGER_WEIGHT;\n }", "public void adaptProductVector() {\t\t\r\n\t\tHashMap<Integer, Integer> neighboursAdaption = new HashMap<Integer, Integer>();\r\n\t\t\r\n\t\tdouble threshold = Parameters.adaptationThreshold / 100.0;\r\n\t\tint neighbours = 0;\r\n\t\t\r\n\t\tfor (int i = 0; i < Parameters.vectorSpaceSize; i++) {\r\n\t\t\tneighboursAdaption.put(i, 0);\r\n\t\t}\r\n\t\t\r\n\t\tfor (Object o: network.getAdjacent(this)) {\t\t\r\n\t\t\tif (o instanceof Customer) {\r\n\t\t\t\tCustomer c = (Customer)o;\r\n\t\t\t\t\r\n\t\t\t\tfor (int i = 0; i < Parameters.vectorSpaceSize; i++) {\r\n\t\t\t\t\tint count = neighboursAdaption.get(i);\r\n\t\t\t\t\tif (c.getDemandVector()[i] == 1) {\r\n\t\t\t\t\t\tcount++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tneighboursAdaption.put(i, count);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tneighbours++;\r\n\t\t}\r\n\t\t\r\n\t\tfor (int i = 0; i < Parameters.vectorSpaceSize; i++) {\r\n\t\t\tif ((double)neighboursAdaption.get(i) / neighbours >= threshold ) {\r\n\t\t\t\tdemandVector[i] = 1;\r\n\t\t\t}\r\n\t\t}\t\t \r\n\t}", "private static Population getBestPossibleParettoOfAGS(){\n int numberOfRounds = 10;\n Population allFrontsMembers = new Population();\n\n NSGAII nsgaii = new NSGAII();\n SPEA2 spea2 = new SPEA2();\n AEMMT aemmt = new AEMMT();\n AEMMD aemmd = new AEMMD();\n MOEAD moead = new MOEAD();\n\n ProblemKnapsackFromFile problem = new ProblemKnapsackFromFile(macPathGetProblemFrom);\n progressBar = new ProgressBar((double) numberOfRounds);\n\n for (int i = 0; i < numberOfRounds; i++) {\n\n Parameters.NUMBER_OF_GENERATIONS = problem.items.size() < 100? 100 : 200;\n\n System.out.println(\"NSGAII\");\n nsgaii.runAlgorithm(problem);\n allFrontsMembers.population.addAll(nsgaii.paretto.membersAtThisFront);\n\n System.out.println(\"SPEA2\");\n spea2.runAlgorithm(problem);\n allFrontsMembers.population.addAll(spea2.paretto.membersAtThisFront);\n\n //moead.runAlgorithm(problem);\n //allFrontsMembers.population.addAll( moead.pareto.membersAtThisFront);\n\n Parameters.NUMBER_OF_GENERATIONS = 15000;\n System.out.println(\"AEMMT\");\n aemmt.runAlgorithm(problem);\n allFrontsMembers.population.addAll(aemmt.paretto.membersAtThisFront);\n\n System.out.println(\"AEMMD\");\n aemmd.runAlgorithm(problem);\n allFrontsMembers.population.addAll(aemmd.paretto.membersAtThisFront);\n\n progressBar.addJobDone();\n\n allFrontsMembers.fastNonDominatedSort();\n Problem.removeSimilar(allFrontsMembers.fronts.allFronts.get(0),problem);\n allFrontsMembers.population = allFrontsMembers.fronts.allFronts.get(0).membersAtThisFront;\n }\n\n problem.printResolutionMessage();\n //Printer.printBinaryMembers(allFrontsMembers);\n System.out.println(\"ALL FRONTS SIZE: \"+allFrontsMembers.population.size());\n\n return allFrontsMembers;\n }", "public ColumnColorVarietyStrategyBuilder(){\n super();\n ObjectiveCardStrategy ccvs = new ColumnColorVarietyStrategy();\n this.setStrategy(ccvs);\n this.setToBeCompared(\"ColumnColorVarietyStrategy\");\n }", "public void setWeight(double w){\n weight = w;\n }", "void setStation(String stationType, double band);", "double setCost(double cost);", "void kernel_load_parameters(double max_point_distance) {\n\t Matrix3 covariance_xyz = node.m_covariance;\n\t Matrix3 jacobian_normal = new Matrix3();\n Vector4d n = node.normal1.Normalized();\n // Jacobian Matrix calculation\n //double t=1.0;\n double EPS2 = 0.00001; //epsilon?\n Vector4d p = n.multiply(rho);\n double w = (p.x * p.x) + (p.y * p.y);\n double p2 = w + (p.z * p.z);\n double sqrtW = Math.sqrt(w);\n jacobian_normal.set(0,0, n.x);\n\t jacobian_normal.set(0,1, n.y);\n\t jacobian_normal.set(0,2, n.z);\n jacobian_normal.set(1,0, sqrtW<EPS2?(p.x * p.z)/EPS2:(p.x * p.z) / (sqrtW * p2)); \n\t jacobian_normal.set(1,1, sqrtW<EPS2?(p.y * p.z)/EPS2:(p.y * p.z) / (sqrtW * p2)); \n\t jacobian_normal.set(1,2, p2<EPS2?-sqrtW/EPS2:(-sqrtW / p2));\n jacobian_normal.set(2,0, (w<EPS2)?-p.y/EPS2:-p.y / w);\n\t jacobian_normal.set(2,1, (w<EPS2)?p.x/EPS2:p.x / w);\n\t jacobian_normal.set(2,2, 0.0);\n \n\t // Area importance (w_a) \n double w_a = 0.75;\n // Number-of-points importance (w_d)\n double w_d = 1- w_a;\n // w_a times node size over octree size plus w_d times samples in cluster over total samples in cloud\n node.representativeness = ( ((double)node.m_size/(double)node.m_root.m_size) * w_a ) + \n\t\t\t\t\t\t\t\t( ((double)node.m_indexes.size()/(double)node.m_root.m_points.size()) * w_d );\n\n // Uncertainty propagation\n\t Matrix3 jacobian_transposed_normal = Matrix3.transpose(jacobian_normal);\n\t // calculate covariance matrix\n\t // First order uncertainty propagation analysis generates variances and covariances in theta,phi,rho space \n\t // from euclidian space.\n covariance_rpt_normal = jacobian_normal.multiply(covariance_xyz).multiply(jacobian_transposed_normal);\n \n // Cluster representativeness\n covariance_rpt_normal.set(0,0, covariance_rpt_normal.get(0,0)+NONZERO);\n constant_normal = Math.sqrt(Math.abs(covariance_rpt_normal.determinant())*root22pi32);\n // if matrix is singular determinant is zero and constant_normal is 0\n // Supposedly adding epsilon averts this according to paper and in normal circumstances\n // a singular matrix would mean coplanar samples and voting should be done with bivariate kernel over theta,phi\n if( constant_normal == 0 ) {\n \t if( DEBUG ) {\n \t\t System.out.println(\"kernel_t kernel_load_parameters determinant is 0 for \"+this);\n \t }\n \t voting_limit = 0;\n \t return;\n }\n // if invert comes back null then the matrix is singular, which means the samples are coplanar\n covariance_rpt_inv_normal = covariance_rpt_normal.invert();\n if( covariance_rpt_inv_normal == null ) {\n \t if( DEBUG ) {\n \t\t System.out.println(\"kernel_t kernel_load_parameters covariance matrix is singular for \"+this);\n \t }\n \t voting_limit = 0;\n \t return;\n }\n\t EigenvalueDecomposition eigenvalue_decomp = new EigenvalueDecomposition(covariance_rpt_normal);\n\t double[] eigenvalues_vector = eigenvalue_decomp.getRealEigenvalues();\n\t Matrix3 eigenvectors_matrix = eigenvalue_decomp.getV();\n // Sort eigenvalues\n int min_index = 0;\n if (eigenvalues_vector[min_index] > eigenvalues_vector[1])\n min_index = 1;\n if (eigenvalues_vector[min_index] > eigenvalues_vector[2])\n min_index = 2;\n if( DEBUG )\n \t System.out.println(\"kernel_t kernel_load_parameters eigenvalues_vector=[\"+eigenvalues_vector[0]+\" \"+eigenvalues_vector[1]+\" \"+eigenvalues_vector[2]+\"] min_index=\"+min_index);\n // Voting limit calculation (g_min)\n double radius = Math.sqrt( eigenvalues_vector[min_index] ) * 2;\n voting_limit = trivariated_gaussian_dist_normal( eigenvectors_matrix.get(0, min_index) * radius, \n\t\t\t\t\t\t\t\t\t\t\t\t\t eigenvectors_matrix.get(1, min_index) * radius, \n\t\t\t\t\t\t\t\t\t\t\t\t\t eigenvectors_matrix.get(2, min_index) * radius);\n if(DEBUG)\n \t System.out.println(\"kernel_t kernel_load_parameters voting limit=\"+voting_limit);\n }" ]
[ "0.54541487", "0.54541165", "0.54268086", "0.5363662", "0.5139273", "0.51299816", "0.50211334", "0.49928814", "0.49697408", "0.49278936", "0.4913931", "0.48900968", "0.48634642", "0.48374373", "0.48354882", "0.48272762", "0.4821405", "0.48106626", "0.48092085", "0.4801111", "0.4782634", "0.47816893", "0.47752258", "0.4765174", "0.47511458", "0.47465125", "0.47394702", "0.47374007", "0.47287044", "0.4714633", "0.47131857", "0.471035", "0.4689484", "0.46807346", "0.46656653", "0.46582463", "0.46389997", "0.46389434", "0.4630111", "0.46245125", "0.46137598", "0.45905036", "0.4588717", "0.45858583", "0.4583351", "0.45826235", "0.45791203", "0.4577111", "0.45766196", "0.45736006", "0.45731363", "0.45673484", "0.45666564", "0.45620114", "0.45597824", "0.45587432", "0.4558371", "0.45507812", "0.45493278", "0.45429984", "0.4539556", "0.45394492", "0.4536058", "0.45300046", "0.4529122", "0.45166627", "0.45151687", "0.45149907", "0.45143634", "0.44996795", "0.44984192", "0.44915804", "0.44823346", "0.44791105", "0.4475031", "0.44725993", "0.4468218", "0.44657087", "0.44547135", "0.44395503", "0.44370323", "0.44356754", "0.44287267", "0.44266567", "0.44257158", "0.44247845", "0.44167164", "0.44158116", "0.44157925", "0.4414665", "0.441269", "0.44102824", "0.44081762", "0.44038084", "0.43990797", "0.43973416", "0.4397315", "0.4396836", "0.43894336", "0.43880722", "0.43867666" ]
0.0
-1
Assignment strategy which selects a variable according to DomOverWDeg and assign it to its lower bound
public static AbstractStrategy<IntVar> domOverWDeg(IntVar[] VARS, long SEED) { return domOverWDeg(VARS, SEED, min_value_selector()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void mapValueToWithinBounds() {\n if (getAllele() != null) {\n \tFloat d_value = ( (Float) getAllele());\n if (d_value.isInfinite()) {\n // Here we have to break to avoid a stack overflow.\n // ------------------------------------------------\n return;\n }\n // If the value exceeds either the upper or lower bounds, then\n // map the value to within the legal range. To do this, we basically\n // calculate the distance between the value and the float min,\n // then multiply it with a random number and then care that the lower\n // boundary is added.\n // ------------------------------------------------------------------\n if (d_value.floatValue() > m_upperBound ||\n d_value.floatValue() < m_lowerBound) {\n RandomGenerator rn;\n if (getConfiguration() != null) {\n rn = getConfiguration().getRandomGenerator();\n }\n else {\n rn = new StockRandomGenerator();\n }\n setAllele(new Float((rn.nextFloat()\n * ((m_upperBound - m_lowerBound))) + m_lowerBound));\n }\n }\n }", "public void setLowerBound (int lowerBound) throws ModelException;", "void assignRange() {\n rangeIndex = (int) Math.floor(value / step);\n }", "public abstract void assign(ParameterVector pv) throws SolverException;", "private void setMin(int min) { this.min = new SimplePosition(false,false,min); }", "abstract public RandomRange getPlunderRange(Unit attacker);", "public void setLow(double value){low = value;}", "public void useNormalVarimax(){\n this. varimaxOption = true;\n }", "protected abstract D getLower(R range);", "@Override\n\tprotected void setLowerBound() {\n\t\t\n\t}", "public static AbstractStrategy<IntVar> domOverWDeg(IntVar[] VARS, long SEED, IntValueSelector VAL_SELECTOR) {\n return new DomOverWDeg(VARS, SEED, VAL_SELECTOR);\n }", "private void setMinThreshold() {\n minThreshold = value + value * postBoundChange / 100;\n }", "@Override\n protected void doAlgorithmA1() {\n int xP = 0;\n int yP = 0;\n\n\n //Taking the variable out of the list that are in the bounds\n //Testing that the bound has variables\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n xP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX().getPosition();\n }\n int xU = 0;\n int xL = 0;\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n yP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY().getPosition();\n }\n int yU = 0;\n int yL = 0;\n int cright = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCright();\n int cleft = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCleft();\n\n\n\n for (Variable variable : csp.getVars()) {\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n if (variable.getPosition() == xP) {\n xU = variable.getUpperDomainBound();\n xL = variable.getLowerDomainBound();\n }\n }\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n if (variable.getPosition() == yP) {\n yU = variable.getUpperDomainBound();\n yL = variable.getLowerDomainBound();\n }\n }\n }\n\n boolean first = false;\n boolean second = false;\n\n //Testing if the bound is true, false or inconclusive\n\n if (xL + cleft >= yU + cright) {\n first = true;\n }\n if (xU + cleft < yL + cright) {\n second = true;\n }\n\n //are first and second not equal is the bound not inconclusive\n if (first != second) {\n if (first) { //a true Simple Bound was found\n //checks if it was the last constraint in a csp\n //If so the csp is true\n //else check the next constraint and do this method again\n if (csp.getSimpleConstraints().size() - 1 == cIndex) {\n System.out.println(\"P is satisfiable\");\n System.out.println(System.nanoTime()-startTime);\n return;\n } else {\n bIndex = 0;\n cIndex++;\n unit=false;\n doAlgorithmA1();\n }\n } else if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) { //a false Simple Bound was found\n //\n bIndex = 0;\n cIndex = 0;\n if (isInconclusive) {\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n doAlgorithmA2();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n } else {//an inconclusive Simple Bound was found\n //checks if the bound wasn't already inconclusive\n if(!isInconclusive){\n unit=true;\n unitSB = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex);\n }else {\n unit=false;\n }\n isInconclusive = true;\n\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) {\n cIndex = 0;\n bIndex = 0;\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n }\n }", "void setWagerMinimum(java.math.BigDecimal wagerMinimum);", "public abstract void setLOD(int lod);", "public void setLowerPoint(Point lower) {\n this.lower = lower;\n }", "public void setLowerBound(String lower) {\n lowerBound = lower;\n }", "public RandomVaries(String name, int probability, float minUnits, float maxUnits){\n super(name);\n this.probability=probability;\n if(minUnits<0)generator=true;\n this.minUnits=Math.abs(minUnits);\n this.maxUnits=Math.abs(maxUnits);\n }", "public double getParameterValue (Assignment input) ;", "public void setLowerBound(final int lowerBound) {\r\n this.lowerBound = lowerBound;\r\n }", "protected void doDeduction() {\n\n boolean narrowed= false;\n\n unit=false;\n isInconclusive=false;\n\n int newXL;\n int newYU;\n\n Variable x = null;\n Variable y = null;\n\n for(Variable var : csp.getVars()){\n if(var.getPosition() == unitSB.getX().getPosition()){\n x = var;\n } else if(var.getPosition() == unitSB.getY().getPosition()){\n y = var;\n }\n }\n\n int xU = x.getUpperDomainBound();\n int yL = y.getLowerDomainBound();\n\n newXL = yL + unitSB.getCright();\n newYU = xU - unitSB.getCright();\n\n if(newXL>x.getLowerDomainBound()){\n Variable newX = new Variable(newXL, xU);\n newX.setPosition(x.getPosition());\n changeVariable(newX);\n narrowed= true;\n }\n if (newYU< y.getUpperDomainBound()){\n Variable newY = new Variable(yL, newYU);\n newY.setPosition(y.getPosition());\n changeVariable(newY);\n narrowed =true;\n }\n\n if(narrowed){\n doAlgorithmA1();\n }else {\n doAlgorithmA3();\n }\n\n }", "public int getLowerBound ();", "public void setLimit_ang_y_lower(float limit_ang_y_lower) throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeFloat(__io__address + 64, limit_ang_y_lower);\n\t\t} else {\n\t\t\t__io__block.writeFloat(__io__address + 56, limit_ang_y_lower);\n\t\t}\n\t}", "public void setWage(double wagePerPiece){\r\n wage = ( wagePerPiece <= 0 ) ? 0.0 : wagePerPiece; \r\n }", "public void setRngBearing(double range, double bearing);", "protected final void setP(IntervalNode x) {\n\tthis.p = x;\n\n\t// recalc max and min\n\tsetMax();\n\tsetMin();\n }", "public void setMinimumWaterRequirement(double w) {\n this.Minimum_Water_Requirement = w;\n }", "public void setLimit_ang_x_lower(float limit_ang_x_lower) throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeFloat(__io__address + 56, limit_ang_x_lower);\n\t\t} else {\n\t\t\t__io__block.writeFloat(__io__address + 48, limit_ang_x_lower);\n\t\t}\n\t}", "double getLowerThreshold();", "public void setW1 (float value) {\r\n w1 = value;\r\n }", "@Override\n public void setSoftLowerLimit(double position)\n {\n final String funcName = \"setSoftLowerLimit\";\n\n if (debugEnabled)\n {\n dbgTrace.traceEnter(funcName, TrcDbgTrace.TraceLevel.API, \"position=%f\", position);\n dbgTrace.traceExit(funcName, TrcDbgTrace.TraceLevel.API);\n }\n\n softLowerLimit = position;\n }", "void enableHybrid(double minPressurePSI, double maxPressurePSI);", "public V getLowerBound();", "public void setPercepcion(double param){\n \n this.localPercepcion=param;\n \n\n }", "public void setW(double w) {\n this.w = w;\n }", "public static IntStrategy minDom_UB(IntVar... VARS) {\n return custom(minDomainSize_var_selector(), max_value_selector(), VARS);\n }", "private void assignSpacePerimeter()\n {\n\n }", "public static IntStrategy minDom_LB(IntVar... VARS) {\n return custom(minDomainSize_var_selector(), min_value_selector(), VARS);\n }", "public void set_AllSpreadIndexToOne(){\r\n\t//test to see if the fuel moistures are greater than 33 percent.\r\n\t//if they are, set their index value to 1\r\n\tif ((FFM>33)){ // fine fuel greater than 33?\r\n\t\tGRASS=0; \r\n\t\tTIMBER=0;\r\n\t}else{\r\n\t\tTIMBER=1;\r\n\t}\r\n}", "@Basic\n\t@Raw\n\t@Immutable\n\tpublic static double getVelocityLowerBound() {\n\t\treturn VELOCITYLOWERBOUND;\n\t}", "public void initMaxMin(){\n\t\tmax = dja.max();\n\t\tmin = dja.min();\n\t}", "@Override\n\tprotected double getLowerBound() {\n\t\treturn 0;\n\t}", "public abstract double[] getLowerBound();", "protected final void setMin() {\n\tint prevmin = this.min;\n\n\tint i1 = this.low;\n\tint i2 = left.min;\n\tint i3 = right.min;\n\n\tif (i2 == -1) \n\t i2 = i1;\n\tif (i3 == -1) \n\t i3 = i1;\n\n\tif ((i1 <= i2) && (i1 <= i3)) {\n\t this.min = i1;\n\t} else if ((i2 <= i1) && (i2 <= i3)) {\n\t this.min = i2;\n\t} else {\n\t this.min = i3;\n\t}\n\n\tif ((p != IntervalNode.nullIntervalNode) &&\n\t (prevmin != this.min)) {\n \t p.setMin();\n\t}\n }", "void xsetWagerMinimum(org.apache.xmlbeans.XmlDecimal wagerMinimum);", "void setMinActiveAltitude(double minActiveAltitude);", "int range(){\n return fuelcap*mpg;\n }", "public void setBounds(int var1, int var2, int var3, int var4) {\n if(var1 < 0) {\n var1 = 0;\n }\n\n if(var2 < 0) {\n var2 = 0;\n }\n\n if(var3 > this.field_723) {\n var3 = this.field_723;\n }\n\n if(var4 > this.field_724) {\n var4 = this.field_724;\n }\n\n this.field_745 = var1;\n this.field_743 = var2;\n this.field_746 = var3;\n this.field_744 = var4;\n }", "public void speedRange1()\n\t{\n\t\trange = (gen.nextInt(upper1 - lower1)+1) + lower1;\n\t\tspeedBalloonY1 = range;\n\t}", "public abstract DoublePredicate lowerPredicate(double lowerBound);", "protected Element evalAssurance(Assurance ass){\n\t\tRecord r1 = ass.getLeftRecord();\n\t\tRecord r2 = ass.getRightRecord();\n\t\tOperator op = ass.getOperator();\n\t\tElement an = el(\"bpws:assign\");\n\t\tif (r1.getType() == RecordType.FORMULAR)\n\t\t\tan.appendChild(setExpr(r1.getFormular(), \"nswomoxsd:leftValue\"));\n\t\tif (r2.getType() == RecordType.FORMULAR)\n\t\t\tan.appendChild(setExpr(r2.getFormular(), \"nswomoxsd:rightValue\"));\n\t\tan.appendChild(\n\t\t\tsetExpr(\n\t\t\t\tgetMyVarPath(\"/nswomoxsd:leftValue\") + \n\t\t\t\top.value() +\n\t\t\t\tgetMyVarPath(\"nswomoxsd:rightValue\"),\n\t\t\t\t\"nswomoxsd:value\"\n\t\t\t)\n\t\t);\n\t\treturn an;\n\t}", "public static IntStrategy minDom_MidValue(boolean floor, IntVar... VARS) {\n return custom(minDomainSize_var_selector(), mid_value_selector(floor), VARS);\n }", "private void adjustPower (TurnType dir,\n float p) {\n float adjust = Math.signum(p) * gyroSensor.adjustDirection();\n // with RUN_TO_POSITION sign of power is ignored\n // we have to clip so that (1 + adjust) and (1 - adjust) have the same sign\n adjust = Range.clip(adjust, -1, 1);\n // BNO055 positive for left turn\n float pwrl = p * (1 - adjust);\n float pwrr = p * (1 + adjust);\n\n float max = Math.max(Math.abs(pwrl), Math.abs(pwrr));\n if (max > 1f) {\n // scale to 1\n pwrl = pwrl / max;\n pwrr = pwrr / max;\n }\n setPower(pwrl,\n pwrr,\n dir);\n /*if (dir == TurnType.STRAFE) {\n long timeStamp = System.currentTimeMillis();\n if (timeStamp - logTimeStamp > 25) {\n RobotLog.i(\"Power left:\" + pwrl + \" right:\" + pwrr);\n logTimeStamp = timeStamp;\n }\n }*/\n }", "public void setX(Double x);", "void setNilWagerMinimum();", "private void assign(DefinitionStmt stmt) {\n \n soot.Value rightOp = stmt.getRightOp();\n Value result;\n \n if (rightOp instanceof Immediate) {\n Immediate immediate = (Immediate) rightOp;\n result = immediate(stmt, immediate);\n } else if (rightOp instanceof ThisRef) {\n result = function.getParameterRef(1);\n } else if (rightOp instanceof ParameterRef) {\n ParameterRef ref = (ParameterRef) rightOp;\n int index = (sootMethod.isStatic() ? 1 : 2) + ref.getIndex();\n Value p = new VariableRef(\"p\" + index, getType(ref.getType()));\n result = widenToI32Value(p, isUnsigned(ref.getType()));\n } else if (rightOp instanceof CaughtExceptionRef) {\n result = call(BC_EXCEPTION_CLEAR, env);\n } else if (rightOp instanceof ArrayRef) {\n ArrayRef ref = (ArrayRef) rightOp;\n VariableRef base = (VariableRef) immediate(stmt, (Immediate) ref.getBase());\n if (ref.getType() instanceof NullType) {\n // The base value is always null. Do a null check which will\n // always throw NPE.\n checkNull(stmt, base);\n return;\n } else {\n Value index = immediate(stmt, (Immediate) ref.getIndex());\n checkNull(stmt, base);\n checkBounds(stmt, base, index);\n result = call(getArrayLoad(ref.getType()), base, index);\n result = widenToI32Value(result, isUnsigned(ref.getType()));\n }\n } else if (rightOp instanceof InstanceFieldRef) {\n InstanceFieldRef ref = (InstanceFieldRef) rightOp;\n Value base = immediate(stmt, (Immediate) ref.getBase());\n checkNull(stmt, base);\n FunctionRef fn = null;\n if (canAccessDirectly(ref)) {\n fn = new FunctionRef(mangleField(ref.getFieldRef()) + \"_getter\", \n new FunctionType(getType(ref.getType()), ENV_PTR, OBJECT_PTR));\n } else {\n soot.Type runtimeType = ref.getBase().getType();\n String targetClassName = getInternalName(ref.getFieldRef().declaringClass());\n String runtimeClassName = runtimeType == NullType.v() ? targetClassName : getInternalName(runtimeType);\n Trampoline trampoline = new GetField(this.className, targetClassName, \n ref.getFieldRef().name(), getDescriptor(ref.getFieldRef().type()), runtimeClassName);\n trampolines.add(trampoline);\n fn = trampoline.getFunctionRef();\n }\n result = call(fn, env, base);\n result = widenToI32Value(result, isUnsigned(ref.getType()));\n } else if (rightOp instanceof StaticFieldRef) {\n StaticFieldRef ref = (StaticFieldRef) rightOp;\n FunctionRef fn = Intrinsics.getIntrinsic(sootMethod, stmt);\n if (fn == null) {\n if (canAccessDirectly(ref)) {\n fn = new FunctionRef(mangleField(ref.getFieldRef()) + \"_getter\", \n new FunctionType(getType(ref.getType()), ENV_PTR));\n } else {\n String targetClassName = getInternalName(ref.getFieldRef().declaringClass());\n Trampoline trampoline = new GetStatic(this.className, targetClassName, \n ref.getFieldRef().name(), getDescriptor(ref.getFieldRef().type()));\n trampolines.add(trampoline);\n fn = trampoline.getFunctionRef();\n }\n }\n result = call(fn, env);\n result = widenToI32Value(result, isUnsigned(ref.getType()));\n } else if (rightOp instanceof Expr) {\n if (rightOp instanceof BinopExpr) {\n BinopExpr expr = (BinopExpr) rightOp;\n Type rightType = getLocalType(expr.getType());\n Variable resultVar = function.newVariable(rightType);\n result = resultVar.ref();\n Value op1 = immediate(stmt, (Immediate) expr.getOp1());\n Value op2 = immediate(stmt, (Immediate) expr.getOp2());\n if (rightOp instanceof AddExpr) {\n if (rightType instanceof IntegerType) {\n function.add(new Add(resultVar, op1, op2));\n } else {\n function.add(new Fadd(resultVar, op1, op2));\n }\n } else if (rightOp instanceof AndExpr) {\n function.add(new And(resultVar, op1, op2));\n } else if (rightOp instanceof CmpExpr) {\n Variable t1 = function.newVariable(I1);\n Variable t2 = function.newVariable(I1);\n Variable t3 = function.newVariable(resultVar.getType());\n Variable t4 = function.newVariable(resultVar.getType());\n function.add(new Icmp(t1, Condition.slt, op1, op2));\n function.add(new Icmp(t2, Condition.sgt, op1, op2));\n function.add(new Zext(t3, new VariableRef(t1), resultVar.getType()));\n function.add(new Zext(t4, new VariableRef(t2), resultVar.getType()));\n function.add(new Sub(resultVar, new VariableRef(t4), new VariableRef(t3)));\n } else if (rightOp instanceof DivExpr) {\n if (rightType instanceof IntegerType) {\n FunctionRef f = rightType == I64 ? LDIV : IDIV;\n result = call(f, env, op1, op2);\n } else {\n // float or double\n function.add(new Fdiv(resultVar, op1, op2));\n }\n } else if (rightOp instanceof MulExpr) {\n if (rightType instanceof IntegerType) {\n function.add(new Mul(resultVar, op1, op2));\n } else {\n function.add(new Fmul(resultVar, op1, op2));\n }\n } else if (rightOp instanceof OrExpr) {\n function.add(new Or(resultVar, op1, op2));\n } else if (rightOp instanceof RemExpr) {\n if (rightType instanceof IntegerType) {\n FunctionRef f = rightType == I64 ? LREM : IREM;\n result = call(f, env, op1, op2);\n } else {\n FunctionRef f = rightType == DOUBLE ? DREM : FREM;\n result = call(f, env, op1, op2);\n }\n } else if (rightOp instanceof ShlExpr || rightOp instanceof ShrExpr || rightOp instanceof UshrExpr) {\n IntegerType type = (IntegerType) op1.getType();\n int bits = type.getBits();\n Variable t = function.newVariable(op2.getType());\n function.add(new And(t, op2, new IntegerConstant(bits - 1, (IntegerType) op2.getType())));\n Value shift = t.ref();\n if (((IntegerType) shift.getType()).getBits() < bits) {\n Variable tmp = function.newVariable(type);\n function.add(new Zext(tmp, shift, type));\n shift = tmp.ref();\n }\n if (rightOp instanceof ShlExpr) {\n function.add(new Shl(resultVar, op1, shift));\n } else if (rightOp instanceof ShrExpr) {\n function.add(new Ashr(resultVar, op1, shift));\n } else {\n function.add(new Lshr(resultVar, op1, shift));\n }\n } else if (rightOp instanceof SubExpr) {\n if (rightType instanceof IntegerType) {\n function.add(new Sub(resultVar, op1, op2));\n } else {\n function.add(new Fsub(resultVar, op1, op2));\n }\n } else if (rightOp instanceof XorExpr) {\n function.add(new Xor(resultVar, op1, op2));\n } else if (rightOp instanceof XorExpr) {\n function.add(new Xor(resultVar, op1, op2));\n } else if (rightOp instanceof CmplExpr) {\n FunctionRef f = op1.getType() == FLOAT ? FCMPL : DCMPL;\n function.add(new Call(resultVar, f, op1, op2));\n } else if (rightOp instanceof CmpgExpr) {\n FunctionRef f = op1.getType() == FLOAT ? FCMPG : DCMPG;\n function.add(new Call(resultVar, f, op1, op2));\n } else {\n throw new IllegalArgumentException(\"Unknown type for rightOp: \" + rightOp.getClass());\n }\n } else if (rightOp instanceof CastExpr) {\n Value op = immediate(stmt, (Immediate) ((CastExpr) rightOp).getOp());\n soot.Type sootTargetType = ((CastExpr) rightOp).getCastType();\n soot.Type sootSourceType = ((CastExpr) rightOp).getOp().getType();\n if (sootTargetType instanceof PrimType) {\n Type targetType = getType(sootTargetType);\n Type sourceType = getType(sootSourceType);\n if (targetType instanceof IntegerType && sourceType instanceof IntegerType) {\n // op is at least I32 and has already been widened if source type had fewer bits then I32\n IntegerType toType = (IntegerType) targetType;\n IntegerType fromType = (IntegerType) op.getType();\n Variable v = function.newVariable(toType);\n if (fromType.getBits() < toType.getBits()) {\n // Widening\n if (isUnsigned(sootSourceType)) {\n function.add(new Zext(v, op, toType));\n } else {\n function.add(new Sext(v, op, toType));\n }\n } else if (fromType.getBits() == toType.getBits()) {\n function.add(new Bitcast(v, op, toType));\n } else {\n // Narrow\n function.add(new Trunc(v, op, toType));\n }\n result = widenToI32Value(v.ref(), isUnsigned(sootTargetType));\n } else if (targetType instanceof FloatingPointType && sourceType instanceof IntegerType) {\n // we always to a signed conversion since if op is char it has already been zero extended to I32\n Variable v = function.newVariable(targetType);\n function.add(new Sitofp(v, op, targetType));\n result = v.ref();\n } else if (targetType instanceof FloatingPointType && sourceType instanceof FloatingPointType) {\n Variable v = function.newVariable(targetType);\n if (targetType == FLOAT && sourceType == DOUBLE) {\n function.add(new Fptrunc(v, op, targetType));\n } else if (targetType == DOUBLE && sourceType == FLOAT) {\n function.add(new Fpext(v, op, targetType));\n } else {\n function.add(new Bitcast(v, op, targetType));\n }\n result = v.ref();\n } else {\n // F2I, F2L, D2I, D2L\n FunctionRef f = null;\n if (targetType == I32 && sourceType == FLOAT) {\n f = F2I;\n } else if (targetType == I64 && sourceType == FLOAT) {\n f = F2L;\n } else if (targetType == I32 && sourceType == DOUBLE) {\n f = D2I;\n } else if (targetType == I64 && sourceType == DOUBLE) {\n f = D2L;\n } else {\n throw new IllegalArgumentException();\n }\n Variable v = function.newVariable(targetType);\n function.add(new Call(v, f, op));\n result = v.ref();\n }\n } else {\n if (sootTargetType instanceof soot.ArrayType \n && ((soot.ArrayType) sootTargetType).getElementType() instanceof PrimType) {\n soot.Type primType = ((soot.ArrayType) sootTargetType).getElementType();\n GlobalRef arrayClassPtr = new GlobalRef(\"array_\" + getDescriptor(primType), CLASS_PTR);\n Variable arrayClass = function.newVariable(CLASS_PTR);\n function.add(new Load(arrayClass, arrayClassPtr));\n result = call(CHECKCAST_PRIM_ARRAY, env, arrayClass.ref(), op);\n } else {\n String targetClassName = getInternalName(sootTargetType);\n Trampoline trampoline = new Checkcast(this.className, targetClassName);\n trampolines.add(trampoline);\n result = call(trampoline.getFunctionRef(), env, op);\n }\n }\n } else if (rightOp instanceof InstanceOfExpr) {\n Value op = immediate(stmt, (Immediate) ((InstanceOfExpr) rightOp).getOp());\n soot.Type checkType = ((InstanceOfExpr) rightOp).getCheckType();\n if (checkType instanceof soot.ArrayType \n && ((soot.ArrayType) checkType).getElementType() instanceof PrimType) {\n soot.Type primType = ((soot.ArrayType) checkType).getElementType();\n GlobalRef arrayClassPtr = new GlobalRef(\"array_\" + getDescriptor(primType), CLASS_PTR);\n Variable arrayClass = function.newVariable(CLASS_PTR);\n function.add(new Load(arrayClass, arrayClassPtr));\n result = call(INSTANCEOF_PRIM_ARRAY, env, arrayClass.ref(), op);\n } else {\n String targetClassName = getInternalName(checkType);\n Trampoline trampoline = new Instanceof(this.className, targetClassName);\n trampolines.add(trampoline);\n result = call(trampoline.getFunctionRef(), env, op);\n }\n } else if (rightOp instanceof NewExpr) {\n String targetClassName = getInternalName(((NewExpr) rightOp).getBaseType());\n FunctionRef fn = null;\n if (targetClassName.equals(this.className)) {\n fn = FunctionBuilder.allocator(sootMethod.getDeclaringClass()).ref();\n } else {\n Trampoline trampoline = new New(this.className, targetClassName);\n trampolines.add(trampoline);\n fn = trampoline.getFunctionRef();\n }\n result = call(fn, env);\n } else if (rightOp instanceof NewArrayExpr) {\n NewArrayExpr expr = (NewArrayExpr) rightOp;\n Value size = immediate(stmt, (Immediate) expr.getSize());\n if (expr.getBaseType() instanceof PrimType) {\n result = call(getNewArray(expr.getBaseType()), env, size);\n } else {\n String targetClassName = getInternalName(expr.getType());\n Trampoline trampoline = new Anewarray(this.className, targetClassName);\n trampolines.add(trampoline);\n result = call(trampoline.getFunctionRef(), env, size);\n }\n } else if (rightOp instanceof NewMultiArrayExpr) {\n NewMultiArrayExpr expr = (NewMultiArrayExpr) rightOp;\n if (expr.getBaseType().numDimensions == 1 && expr.getBaseType().getElementType() instanceof PrimType) {\n Value size = immediate(stmt, (Immediate) expr.getSize(0));\n result = call(getNewArray(expr.getBaseType().getElementType()), env, size);\n } else {\n for (int i = 0; i < expr.getSizeCount(); i++) {\n Value size = immediate(stmt, (Immediate) expr.getSize(i));\n Variable ptr = function.newVariable(new PointerType(I32));\n function.add(new Getelementptr(ptr, dims.ref(), 0, i));\n function.add(new Store(size, ptr.ref()));\n }\n Variable dimsI32 = function.newVariable(new PointerType(I32));\n function.add(new Bitcast(dimsI32, dims.ref(), dimsI32.getType()));\n String targetClassName = getInternalName(expr.getType());\n Trampoline trampoline = new Multianewarray(this.className, targetClassName);\n trampolines.add(trampoline);\n result = call(trampoline.getFunctionRef(), env, new IntegerConstant(expr.getSizeCount()), dimsI32.ref());\n }\n } else if (rightOp instanceof InvokeExpr) {\n result = invokeExpr(stmt, (InvokeExpr) rightOp);\n } else if (rightOp instanceof LengthExpr) {\n Value op = immediate(stmt, (Immediate) ((LengthExpr) rightOp).getOp());\n checkNull(stmt, op);\n Variable v = function.newVariable(I32);\n function.add(new Call(v, ARRAY_LENGTH, op));\n result = v.ref();\n } else if (rightOp instanceof NegExpr) {\n NegExpr expr = (NegExpr) rightOp;\n Value op = immediate(stmt, (Immediate) expr.getOp());\n Type rightType = op.getType();\n Variable v = function.newVariable(op.getType());\n if (rightType instanceof IntegerType) {\n function.add(new Sub(v, new IntegerConstant(0, (IntegerType) rightType), op));\n } else {\n function.add(new Fmul(v, new FloatingPointConstant(-1.0, (FloatingPointType) rightType), op));\n }\n result = v.ref();\n } else {\n throw new IllegalArgumentException(\"Unknown type for rightOp: \" + rightOp.getClass());\n }\n } else {\n throw new IllegalArgumentException(\"Unknown type for rightOp: \" + rightOp.getClass());\n }\n \n soot.Value leftOp = stmt.getLeftOp();\n \n if (leftOp instanceof Local) {\n Local local = (Local) leftOp;\n VariableRef v = new VariableRef(local.getName(), new PointerType(getLocalType(leftOp.getType())));\n function.add(new Store(result, v, !sootMethod.getActiveBody().getTraps().isEmpty()));\n } else {\n Type leftType = getType(leftOp.getType());\n Value narrowedResult = narrowFromI32Value(leftType, result);\n if (leftOp instanceof ArrayRef) {\n ArrayRef ref = (ArrayRef) leftOp;\n VariableRef base = (VariableRef) immediate(stmt, (Immediate) ref.getBase());\n Value index = immediate(stmt, (Immediate) ref.getIndex());\n checkNull(stmt, base);\n checkBounds(stmt, base, index);\n if (leftOp.getType() instanceof RefLikeType) {\n call(BC_SET_OBJECT_ARRAY_ELEMENT, env, base, index, narrowedResult);\n } else {\n call(getArrayStore(leftOp.getType()), base, index, narrowedResult);\n }\n } else if (leftOp instanceof InstanceFieldRef) {\n InstanceFieldRef ref = (InstanceFieldRef) leftOp;\n Value base = immediate(stmt, (Immediate) ref.getBase());\n checkNull(stmt, base);\n FunctionRef fn = null;\n if (canAccessDirectly(ref)) {\n fn = new FunctionRef(mangleField(ref.getFieldRef()) + \"_setter\", \n new FunctionType(VOID, ENV_PTR, OBJECT_PTR, getType(ref.getType())));\n } else {\n soot.Type runtimeType = ref.getBase().getType();\n String targetClassName = getInternalName(ref.getFieldRef().declaringClass());\n String runtimeClassName = runtimeType == NullType.v() ? targetClassName : getInternalName(runtimeType);\n Trampoline trampoline = new PutField(this.className, targetClassName, \n ref.getFieldRef().name(), getDescriptor(ref.getFieldRef().type()), runtimeClassName);\n trampolines.add(trampoline);\n fn = trampoline.getFunctionRef();\n }\n call(fn, env, base, narrowedResult);\n } else if (leftOp instanceof StaticFieldRef) {\n StaticFieldRef ref = (StaticFieldRef) leftOp;\n FunctionRef fn = null;\n if (canAccessDirectly(ref)) {\n fn = new FunctionRef(mangleField(ref.getFieldRef()) + \"_setter\", \n new FunctionType(VOID, ENV_PTR, getType(ref.getType())));\n } else {\n String targetClassName = getInternalName(ref.getFieldRef().declaringClass());\n Trampoline trampoline = new PutStatic(this.className, targetClassName, \n ref.getFieldRef().name(), getDescriptor(ref.getFieldRef().type()));\n trampolines.add(trampoline);\n fn = trampoline.getFunctionRef();\n }\n call(fn, env, narrowedResult);\n } else {\n throw new IllegalArgumentException(\"Unknown type for leftOp: \" + leftOp.getClass());\n }\n }\n }", "private double bound(int iter, Solution next) {\n return Math.exp((-1.0 * (next.getValue() - bestSol.getValue())) / denominator(iter));\n }", "public void setP(Double p);", "public void setLand(int value);", "private void intervalsToPTreeCredalSet(PotentialInterval intervalSet,ProbabilityTree probTree,\n Configuration conf,int nvar){\n Vector vars=intervalSet.getVariables();\n \n if(nvar<vars.size()){ // make the top part of the tree with variables in X_I\n FiniteStates currentVar=(FiniteStates)vars.elementAt(nvar);\n int ncases=currentVar.getNumStates();\n probTree.assignVar(currentVar);\n conf.insert(currentVar, 0);\n for(int i=0;i<ncases;i++){\n conf.putValue(currentVar,i);\n intervalsToPTreeCredalSet(intervalSet,probTree.getChild(i),conf,nvar+1);\n }\n } // end if\n else{\n FiniteStates conditionalVar=(FiniteStates)(intervalSet.getVariables().elementAt(0));\n PotentialInterval intervalSetRestricted = (PotentialInterval)intervalSet.restrictVariable(conf);\n Vector extremePoints=intervalSetRestricted.getListExtrems();\n int nExtrems=extremePoints.size();\n FiniteStates transp=appendTransparentVariable(nExtrems);\n int ncases=conditionalVar.getNumStates();\n \n probTree.assignVar(transp);\n for(int i=0;i<nExtrems;i++){\n double array[]=(double [])(extremePoints.elementAt(i));\n probTree.getChild(i).assignVar(conditionalVar);\n for(int j=0;j<ncases;j++){\n probTree.getChild(i).getChild(j).assignProb(array[j]);\n }\n }\n } // end else\n }", "public double constrainDemand(double slope, double trialprice)\r\n/* */ {\r\n\t\t\t\tlogger.info(count++ + \" About to constrainDemand : \" + \"Agent\");\r\n/* 175 */ if (this.demand > 0.0D) {\r\n/* 176 */ if (this.demand * trialprice > this.cash - this.mincash)\r\n/* */ {\r\n/* 178 */ if (this.cash - this.mincash > 0.0D) {\r\n/* 179 */ this.demand = ((this.cash - this.mincash) / trialprice);\r\n/* 180 */ slope = -this.demand / trialprice;\r\n/* */ }\r\n/* */ else\r\n/* */ {\r\n/* 184 */ this.demand = 0.0D;\r\n/* 185 */ slope = 0.0D;\r\n/* */ }\r\n/* */ \r\n/* */ }\r\n/* */ \r\n/* */ \r\n/* */ }\r\n/* 192 */ else if ((this.demand < 0.0D) && (this.demand + this.position < this.minholding))\r\n/* */ {\r\n/* */ \r\n/* 195 */ this.demand = (this.minholding - this.position);\r\n/* 196 */ slope = 0.0D;\r\n/* */ }\r\n/* */ \r\n/* */ \r\n/* 200 */ return this.demand;\r\n/* */ }", "boolean updatePolicy() {\n double maxUtilityVal = -Double.MAX_VALUE;\n //if(x==19&&y==0)\n // System.out.println(\"minVal: \"+maxUtilityVal);\n for (int i = 0; i < AbsoluteDirection.values().length; i++) {\n double proposedValue = calculateUtility(AbsoluteDirection.values()[i]);\n // if(x==19&&y==0) {\n // System.out.println(\"Proposed value at cell \" + x + \", \" + y + \" is\" + proposedValue);\n\n // }\n if (proposedValue > maxUtilityVal) {\n policyDirection = AbsoluteDirection.values()[i];\n nextUtilityValue = proposedValue; // update curValues to nextValues at the end of iteration\n maxUtilityVal = proposedValue;\n }\n }\n\n return true;\n }", "public void adjLocation(double l){this.PlayerLocation;}", "public int getLowerBound() {\r\n return lowerBound;\r\n }", "public void setFlete(double param){\n \n this.localFlete=param;\n \n\n }", "public abstract void setUncertaintyInterval(double dx);", "private void setMinWin(float minwin) \n\t{\n\t\tif (Math.abs(minwin) < 1.0f)\n\t\t{\n\t\t\tif (minwin < _maxwin)\n\t\t\t{\n\t\t\t\t_minwin = Math.abs(minwin);\t\n\t\t\t}\n\t\t}\n\t}", "public void setG(double aG);", "public void assign() {\n\t\tfinal RandomAccess<U> accessor = img.randomAccess();\n\t\tfinal V output = function.createOutput();\n\t\tINPUT input = null;\n\t\twhile (iter.hasNext()) {\n\t\t\tinput = iter.next(input);\n\t\t\tboolean proceed = (condition == null) || (condition.isTrue(input));\n\t\t\tif (proceed) {\n\t\t\t\tfunction.compute(input, output);\n\t\t\t\taccessor.setPosition(iter.getCurrentPoint());\n\t\t\t\taccessor.get().setReal(output.getRealDouble());\n\t\t\t\taccessor.get().setImaginary(output.getImaginaryDouble());\n\t\t\t\t// FIXME\n\t\t\t\t// Note - for real datasets this imaginary assignment may waste cpu\n\t\t\t\t// cycles. Perhaps it can get optimized away by the JIT. But maybe not\n\t\t\t\t// since the type is not really known because this class is really\n\t\t\t\t// constructed from a raw type. We'd need to test how the JIT handles\n\t\t\t\t// this situation. Note that in past incarnations this class used\n\t\t\t\t// assigner classes. The complex version set R & I but the real\n\t\t\t\t// version just set R. We could adopt that approach once again.\n\t\t\t}\n\t\t}\n\t}", "public Point getAlteredCoord(Point actualPoint) {\n //If breath rate is out of range, returns an altered coordinate according to the level of out of range and\n //the current game level (Easy, Medium, Hard). If breath is in range, return the same coord.\n Point alteratedPoint = actualPoint;\n\n Random randomNoise = new Random();\n\n //As USER_CURRENT_BREATH_RATE will be changing, we must do a \"snapshot\" at this time to work with proper measures.\n double userCurrentSnap = USER_CURRENT_BREATH_RATE;\n\n //Consider 6-8, MAX_IDEAL_BREATH_RATE (8) will be the max\n double referenceDistance = MAX_BREATH_RATE - MAX_IDEAL_BREATH_RATE;\n double myRateExcess = userCurrentSnap - MAX_IDEAL_BREATH_RATE;\n double relationPreferedActual = myRateExcess / referenceDistance;\n\n //How much far of the ideal is?, according to our limit of 20\n double percentOfExcess = relationPreferedActual * 100;\n\n /*\n EASY:\n Speed: 25%\n Range of speed change: (up to 15%)\n Maximum amount of noise: +/- 30% of the maximum number on coord x or y\n MEDIUM:\n Speed: 45%\n Range of speed change: (up to 15%)\n Maximum amount of noise: +/- 50% of the maximum number on coord x or y\n HARD:\n Speed: 80%\n Range of speed change: (up to 15%)\n Maximum amount of noise: +/- 80% of the maximum number on coord x or y\n */\n\n //Maximum increment of speed in 15% of MAX_SCALED_SPEED\n double mxSpdInc = MAX_SCALED_SPEED * .15;\n\n //NOTE: The formulas obtained were based on x^2\n /*\n *Solving y=ax^2 + b\n *Finding the variables a, and b. X represents the amount of excess and Y represents the speed for that amount\n */\n double a, b;\n double maxSpeed; //Max space in case of 100% of\n double easyNoise = .38, mediumNoise = .58, hardNoise = .75; //Percents\n\n //drive_control works acording to the size of the wheel. And as closer to the circumference as faster that will be.\n int maxX = this.wheel.getBounds().width(); //This represent the max X possible coord on the wheel\n int maxY = this.wheel.getBounds().height();\n\n if (percentOfExcess > 0) {\n switch (this.ACTUAL_DIFICULTY) {\n case EASY:\n\n //Alter speed. The speed will be changed\n maxSpeed = EASY_BASE_SPEED + mxSpdInc;\n b = EASY_BASE_SPEED; //Minimum\n a = (maxSpeed - b) / (100 * 100); //Maximum\n this.drive_control.setSpeedScale((float) getSpeedAccordingExcessPercent(a, b, percentOfExcess));\n\n alteratedPoint = getFinalPoint(maxX, maxY, easyNoise, percentOfExcess, actualPoint.x, actualPoint.y);\n\n break;\n case MEDIUM:\n maxSpeed = MEDIUM_BASE_SPEED + mxSpdInc;\n b = MEDIUM_BASE_SPEED; //Minimum\n a = (maxSpeed - b) / (100 * 100); //Maximum\n this.drive_control.setSpeedScale((float) getSpeedAccordingExcessPercent(a, b, percentOfExcess));\n alteratedPoint = getFinalPoint(maxX, maxY, mediumNoise, percentOfExcess, actualPoint.x, actualPoint.y);\n\n\n break;\n case HARD:\n maxSpeed = HARD_BASE_SPEED + mxSpdInc;\n b = HARD_BASE_SPEED; //Minimum\n a = (maxSpeed - b) / (100 * 100); //Maximum\n this.drive_control.setSpeedScale((float) getSpeedAccordingExcessPercent(a, b, percentOfExcess));\n alteratedPoint = getFinalPoint(maxX, maxY, hardNoise, percentOfExcess, actualPoint.x, actualPoint.y);\n\n\n break;\n }\n } else {//Else, the user's breath rate must be under 8 so it's ok.\n //In this case, we will ensure that the speed it's acording to the level.\n switch (this.ACTUAL_DIFICULTY) {\n case EASY:\n this.drive_control.setSpeedScale(this.EASY_BASE_SPEED);\n break;\n case MEDIUM:\n this.drive_control.setSpeedScale(this.MEDIUM_BASE_SPEED);\n break;\n case HARD:\n this.drive_control.setSpeedScale(this.HARD_BASE_SPEED);\n break;\n }\n }\n return alteratedPoint;\n }", "public void setWeight(final double pWeight){this.aWeight = pWeight;}", "public void setFloor(double input) {\r\n floor=input;\r\n }", "public void setValue(double val) {\r\n\t\tthis.worth = val;\r\n\t}", "public abstract void setMontant(Double unMontant);", "public synchronized int setDestinationFloor(){\n\t\tint randomFloor = random.nextInt((10-1)+1)+0;\n\t\twhile(this.arrivalFloor == randomFloor){\n\t\t\trandomFloor = random.nextInt((10-1)+1)+0;\n\t\t}\n\t\t\n\t\treturn randomFloor; \n\t}", "public void setWeight(double w){\n weight = w;\n }", "public void setLethalRange(double lethal_range)\n {\n this.lethal_range = lethal_range;\n }", "public void setPanning(float value) {\r\n\t\tleft.lvl.set(0.50f - value / 2);\r\n\t\tright.lvl.set(0.50f + value / 2);\r\n\t}", "public void lower() {\n fangSolenoid.set(DoubleSolenoid.Value.kForward);\n }", "public EstimateParameter(String name, String units, double min, double max) throws\n\tConstraintException {\n\t\tthis(name, units, min, max, null);\n\t}", "public Point getFinalPoint(int maxX, int maxY, double noise, double percentOfExcess, int x, int y) {\n Point alteredPoint = new Point();\n //Alter coords\n double maxXRange = maxX * noise; //Now we have the max number that could be added to the actual x coord. The range will be composed of 0 - maxRange\n double maxYRange = maxY * noise; //Getting the X and Y value according to the noise percent.\n\n //Lets get the formula for determine which value between 0 and RANGE would be added acording to the level\n //Cero for 0% of excess, maxRange for 100% of excess\n //Solve y=ax^2\n\n double a_x = maxXRange / (100 * 100);\n double a_y = maxYRange / (100 * 100);\n\n //Then, lets look for a random number with the help of the number that the formula throw in this kind of range: -6 form < form < + 6 form\n //By this way, we could ensure that the directions will probably not be the same in a short time\n\n\n double noiseX = getNoiseAccordingExcessPercent(a_x, percentOfExcess); //This noise is direclty proportional to the percentOfExcess on breathing rate\n double noiseY = getNoiseAccordingExcessPercent(a_y, percentOfExcess);\n\n //If you want to be more accurate, you can use different values for different levels\n int minimum = 10;//< If you want to change in what excess the user will note a bigger change in the robot control, change this.\n\n noiseX += minimum;\n noiseY += minimum; //By this way, we ensure that also in low levels, we will get a minimum noise of 25. for example at 1% of excess\n\n int adjust = 6;//For make the range\n\n alteredPoint.x = getAlteredPointOfCoord(x, (int) noiseX, adjust);\n alteredPoint.y = getAlteredPointOfCoord(y, (int) noiseY, adjust);\n\n //Just to stay in bounds\n if (alteredPoint.x >= maxX) { //Because if we reach the max, it's like start again\n alteredPoint.x = maxX - 1;\n } else if (alteredPoint.y >= maxY) {\n alteredPoint.y = maxY - 1;\n }\n return alteredPoint;\n }", "private void validateParameter(){\n\t\tif(hrNum > upperBound){\n\t\t\thrNum = upperBound;\n\t\t}\n\t\telse if(hrNum < lowerBound){\n\t\t\thrNum = lowerBound;\n\t\t}\n\t}", "@AbstractCustomGlobal.GlobalMethod(menuText=\"Set Threshold Probability\")\n public void setThreshold() {\n if(Tools.getGlobalTime()!=0){\n JOptionPane.showMessageDialog(null, \"You can change this probability only when the simulation start\",\"Alert\", JOptionPane.INFORMATION_MESSAGE);\n return;\n }\n String answer = JOptionPane.showInputDialog(null, \"Set the probability that a node can be selected to run.\");\n // Show an information message\n try{\n double k = Double.parseDouble(answer);\n Iterator<Node> it = Tools.getNodeList().iterator();\n while(it.hasNext()){\n Node n = it.next();\n if(n.getClass() == MSNode.class){\n MSNode n1 = (MSNode)n;\n n1.setThresholdProbability(k);\n }\n if(n.getClass() == MS2Node.class){\n MS2Node n1 = (MS2Node)n;\n n1.setThresholdProbability(k);\n }\n }\n JOptionPane.showMessageDialog(null, \"Well done you have set this value:\"+k,\"Notice\", JOptionPane.INFORMATION_MESSAGE);\n }catch(NumberFormatException e){\n JOptionPane.showMessageDialog(null, \"You must insert a valid double \", \"Alert\", JOptionPane.INFORMATION_MESSAGE);\n }\n }", "Double getMinimumValue();", "public float AssignFitness() {\n\t\t\n\t\tfitness = 0;\n\t\tif(sample_map.size() == 0) {\n\t\t\treturn fitness;\n\t\t}\n\t\t\n\t\tLinkSample ptr = k_closest;\n\t\twhile(ptr != null) {\n\t\t\tfitness += ptr.s.weight;\n\t\t\tptr = ptr.next_ptr;\n\t\t}\n\t\t\n\t\tfitness /= sample_map.size();\n\t\treturn fitness;\n\t}", "public void restrictVelocity() {\n\t\tif (velocity.x > MAX_VELOCITY.x)\r\n\t\t\tvelocity.x = MAX_VELOCITY.x;\r\n\t\tif (velocity.y > MAX_VELOCITY.y)\r\n\t\t\tvelocity.y = MAX_VELOCITY.y;\r\n\t\t\r\n\t\tif (velocity.x < -MAX_VELOCITY.x)\r\n\t\t\tvelocity.x = -MAX_VELOCITY.x;\r\n\t\tif (velocity.y < -MAX_VELOCITY.y)\r\n\t\t\tvelocity.y = -MAX_VELOCITY.y;\r\n\t}", "public static native void OpenMM_AmoebaWcaDispersionForce_setAwater(PointerByReference target, double inputValue);", "@Override\n\tpublic void makeDecision() {\n\t\tint powerMax = (int)(initPower) / 100;\n\t\tint powerMin = (int)(initPower * 0.3) / 100;\n\n\t\t// The value is calculated randomly from 0 to 10% of the initial power\n\t\tRandom rand = new Random();\n\t\tint actualPower = rand.nextInt((powerMax - powerMin) + 1) + powerMin;\n\t\tanswer.setConsumption(actualPower);\n\t}", "ReadOnlyDoubleProperty minimumProperty();", "public void setMin(Vect3d min) {\r\n this.min = min;\r\n }", "public PathDestination a(double var0, double var2, double var4) {\n/* 47 */ return new PathDestination(a(MathHelper.floor(var0), MathHelper.floor(var2 + 0.5D), MathHelper.floor(var4)));\n/* */ }", "public void setOanswr(Float oanswr) {\r\n this.oanswr = oanswr;\r\n }", "public void SetMinVal(int min_val);", "public void setSightRange(int n){\n\tsightRange = n;\n }", "public static native void OpenMM_AmoebaWcaDispersionForce_setRminh(PointerByReference target, double inputValue);", "public abstract double getConstraintFitness();", "double getMin();", "double getMin();", "protected Element initAssuranceToMyVar() {\n\t\tElement an = el(\"bpws:assign\", new Node[]{\n\t\t\t\tinitMyVar(new Node[]{\n\t\t\t\t\tel(\"nswomoxsd:type\", text(\"Assurance\")),\n\t\t\t\t\tel(\"nswomoxsd:leftValue\", text(\"0\")),\n\t\t\t\t\tel(\"nswomoxsd:rightValue\", text(\"0\")),\n\t\t\t\t\tel(\"nswomoxsd:value\", text(\"0\"))\n\t\t\t\t}),\n\t\t\t\tsetProcId()\n\t\t});\n\t\treturn an;\n\t}", "public void set_constant(double cutoff)\r\n\t{\r\n\t\tthis.switchValue = (int)cutoff;\t\r\n\t}" ]
[ "0.5821441", "0.5722975", "0.5494405", "0.54634297", "0.5317111", "0.53041244", "0.52647215", "0.5264227", "0.5213511", "0.5198714", "0.5195604", "0.51628375", "0.51413417", "0.5131053", "0.5123687", "0.5113732", "0.5035264", "0.50170094", "0.5015844", "0.5015413", "0.5006216", "0.5002369", "0.49959445", "0.49891904", "0.49852023", "0.49843618", "0.49829435", "0.49573544", "0.49572277", "0.4954354", "0.49431273", "0.49348092", "0.49283022", "0.49281546", "0.4907516", "0.4903036", "0.49028084", "0.48982432", "0.4897885", "0.48973647", "0.48911807", "0.48832014", "0.4878828", "0.48671225", "0.48641455", "0.48572475", "0.48462397", "0.48443338", "0.48437908", "0.4841486", "0.48375937", "0.48355994", "0.4832487", "0.48303315", "0.48109776", "0.4809729", "0.4807735", "0.48031852", "0.47780704", "0.47737774", "0.4773481", "0.47600183", "0.47597313", "0.4759669", "0.47572947", "0.4750451", "0.4748217", "0.47481886", "0.47479957", "0.47417042", "0.4741203", "0.47370836", "0.47364843", "0.47276378", "0.4722316", "0.47197014", "0.4709172", "0.47051692", "0.4702256", "0.46976498", "0.46953192", "0.46924004", "0.46857724", "0.46854797", "0.4684934", "0.4684418", "0.46834454", "0.46833596", "0.46761537", "0.4673634", "0.46712753", "0.4670131", "0.4663781", "0.46611986", "0.4659483", "0.46571243", "0.46549612", "0.46549612", "0.46548718", "0.46506852" ]
0.5446483
4
Create an Activity based search strategy. "ActivityBased Search for BlackBox Constraint Propagramming Solver", Laurent Michel and Pascal Van Hentenryck, CPAIOR12.
public static AbstractStrategy<IntVar> activity(IntVar[] VARS, double GAMMA, double DELTA, int ALPHA, int FORCE_SAMPLING, long SEED) { return new ActivityBased(VARS[0].getSolver(), VARS, GAMMA, DELTA, ALPHA, FORCE_SAMPLING, SEED); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void searchConstraintHit (Search search);", "public interface SearchAlgorithm {\n\t/**\n\t * Searches the state space for a solution.\n\t * @param root\n\t * The root state to begin search from.\n\t * @param expanded_list\n\t * The expanded list in order of expansion. Filled by function.\n\t * @param goal\n\t * The goal state representation used to test if we reached the goal state.\n\t * @return\n\t * The search results containing all needed information about the search and the results.\n\t */\n\tSearchResult search(State root, List<State> expanded_list, State goal);\n}", "Association findAssociation(World w, BlockPos pos, String strategy);", "public interface AsgStrategy {\n void apply(AsgQuery query, AsgStrategyContext context);\n}", "Algorithm createAlgorithm();", "public interface TraversalStrategy {\n\n public static final int SEARCH_FOCUS_UNKNOWN = 0;\n public static final int SEARCH_FOCUS_FORWARD = 1;\n public static final int SEARCH_FOCUS_BACKWARD = 2;\n public static final int SEARCH_FOCUS_LEFT = 3;\n public static final int SEARCH_FOCUS_RIGHT = 4;\n public static final int SEARCH_FOCUS_UP = 5;\n public static final int SEARCH_FOCUS_DOWN = 6;\n\n @IntDef({SEARCH_FOCUS_FORWARD, SEARCH_FOCUS_BACKWARD,\n SEARCH_FOCUS_LEFT, SEARCH_FOCUS_RIGHT, SEARCH_FOCUS_UP, SEARCH_FOCUS_DOWN})\n @Retention(RetentionPolicy.SOURCE)\n public @interface SearchDirection {}\n\n @IntDef({SEARCH_FOCUS_UNKNOWN,\n SEARCH_FOCUS_FORWARD, SEARCH_FOCUS_BACKWARD,\n SEARCH_FOCUS_LEFT, SEARCH_FOCUS_RIGHT, SEARCH_FOCUS_UP, SEARCH_FOCUS_DOWN})\n @Retention(RetentionPolicy.SOURCE)\n public @interface SearchDirectionOrUnknown {}\n\n /**\n * The method searches next node to be focused\n * @param startNode - pivot node the search is start from\n * @param direction - direction to find focus\n * @return {@link android.support.v4.view.accessibility.AccessibilityNodeInfoCompat} node\n * that has next focus\n */\n public AccessibilityNodeInfoCompat findFocus(AccessibilityNodeInfoCompat startNode,\n @SearchDirection int direction);\n\n /**\n * Finds the initial focusable accessibility node in hierarchy started from root node when\n * searching in the given direction.\n *\n * For example, if {@code direction} is {@link #SEARCH_FOCUS_FORWARD}, then the\n * method should return the first node in the traversal order. If {@code direction} is\n * {@link #SEARCH_FOCUS_BACKWARD} then the method should return the last node\n * in the traversal order.\n *\n * @param root - root node\n * @param direction - the direction to search from\n * @return returns the first node that could be focused\n */\n public AccessibilityNodeInfoCompat focusInitial(AccessibilityNodeInfoCompat root,\n @SearchDirection int direction);\n\n /**\n * Calculating if node is speaking node according to AccessibilityNodeInfoUtils.isSpeakingNode()\n * method is time consuming. Traversal strategy may use cache for already calculated values.\n * If traversal strategy does not need in such cache use it could return null.\n * @return speaking node cache map. Could be null if cache is not used by traversal strategy\n */\n public Map<AccessibilityNodeInfoCompat, Boolean> getSpeakingNodesCache();\n\n /**\n * When there is no need in traversal strategy object it must be recycled before\n * garbage collected\n */\n public void recycle();\n}", "public Algorithms.Search<State<E>,HeuristicNode<State<E>,Double>>.Result search(Signature<E> request){\n log.info(\"Initializing composition search problem...\");\n // Composition starts with the request:\n Stopwatch compositionWatch = Stopwatch.createStarted();\n // Build the initial match graph network (first pass)\n ServiceMatchNetwork<E, T> network = discoverer.search(request);\n // Apply optimizations\n Stopwatch optWatch = Stopwatch.createStarted();\n for(NetworkOptimizer<E,T> opt : optimizations){\n network = opt.optimize(network);\n }\n optWatch.stop();\n log.info(\"Graph optimizations done in {}\", optWatch);\n log.info(\"Starting search over a network with {} levels and {} operations\", network.numberOfLevels(), network.listOperations().size());\n // Run search over network\n Algorithms.Search<State<E>,HeuristicNode<State<E>,Double>>.Result searchResult = CompositSearch.create(network).search();\n log.info(\"Optimal composition search finished in {}\", searchResult.getStopwatch().toString());\n log.debug(\" Composition : {}\", searchResult.getOptimalPath());\n log.debug(\" Total iterations : {}\", searchResult.getIterations());\n log.info(\" Composition runpath : {}\", searchResult.getOptimalPath().size()-2);\n log.info(\" Composition services: {}\", searchResult.getGoalNode().getScore());\n log.info(\"Total composition time : {}\", compositionWatch.stop().toString());\n\n List<State<E>> states = searchResult.getOptimalPath();\n List<Set<Operation<E>>> ops = Lists.transform(states, new Function<State<E>, Set<Operation<E>>>() {\n @Override\n public Set<Operation<E>> apply(State<E> state) {\n return state.getStateOperations();\n }\n });\n return searchResult;\n }", "void create(SportActivity activity);", "public ServiceMatchNetwork<E, T> searchComposition(Signature<E> request){\n ServiceMatchNetwork<E, T> network = discoverer.search(request);\n // Apply optimizations\n for(NetworkOptimizer<E,T> opt : optimizations){\n network = opt.optimize(network);\n }\n Algorithms.Search<State<E>,HeuristicNode<State<E>,Double>>.Result searchResult = CompositSearch.create(network).search();\n // Take the service operations from the optimal state path. We reverse the list because\n // the search was done backwards.\n List<State<E>> states = Lists.reverse(searchResult.getOptimalPath());\n List<Set<Operation<E>>> optimalServiceOps = Lists.transform(states, new Function<State<E>, Set<Operation<E>>>() {\n @Override\n public Set<Operation<E>> apply(State<E> state) {\n return state.getStateOperations();\n }\n });\n // Generate a new ServiceMatchNetwork composition with the optimal services.\n // To build the composition, we use the information of the previous network to build the match relations\n // between services among the optimal services.\n ServiceMatchNetwork<E, T> composition = new DirectedAcyclicSMN<E, T>(new HashLeveledServices<E>(optimalServiceOps), network);\n return composition;\n }", "public ActivityExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public interface SearchSolver {\n\n /**\n * initializes the algorithm. This method has to be called before calling any other method\n * @param graph the graph of the map where the search takes place\n * @param targetStart the start position for the target (in our case the thief)\n * @param searchStart the start position for the searcher (in our case the police)\n * @param counter the counter object that counts the expanded nodes\n */\n void initialize(Graph graph, Node targetStart, Node searchStart, ExpandCounter counter);\n\n /**\n * gets the shortest path from search start to target\n * @return list of edges that describe the path\n * @throws NoPathFoundException if there is no path to the target\n */\n List<Edge> getPath() throws NoPathFoundException;\n}", "public abstract Solution<T> search(Searchable<T> s);", "Strategy createStrategy();", "public MagicSearch createMagicSearch();", "@Override\n\t\t\t\t\tpublic Iterator<Tuple2<FirstStageAresSolution, Tuple5<Integer,Double,Double,Double,Double>>> call(Tuple2<MobileApplication, MobileDataDistributionInfrastructure> inputValues)\n\t\t\t\t\t\t\tthrows Exception {\n\t\t\t\t\t\tArrayList<Tuple2<FirstStageAresSolution,Tuple5<Integer,Double,Double,Double,Double>>> output = \n\t\t\t\t\t\t\t\t\t\tnew ArrayList<Tuple2<FirstStageAresSolution,Tuple5<Integer,Double,Double,Double,Double>>>();\n\t\t\t\t\t\tOffloadScheduler singleSearch;\n\t\t\t\t\t\t\n\t\t\t\t\t\tArrayList<FirstStageAresSolution> solutions;\n\t\t\t\t\t\t/*switch(SimulationSetup.placementAlgorithm)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tcase \"RANDOM\":\n\t\t\t\t\t\t\tRandomEdgePlanner.setupEdgeNodes(infrastructure);\n\t\t\t\t\t\t\tDefaultNetworkPlanner.setupNetworkConnections(infrastructure);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"ALL\":\n\t\t\t\t\t\t\tEdgeAllCellPlanner.setupEdgeNodes(infrastructure);\n\t\t\t\t\t\t\tDefaultNetworkPlanner.setupNetworkConnections(infrastructure);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"ares\":\n\t\t\t\t\t\t\tFirstStageAresPlanner planner = new FirstStageAresPlanner(inputValues);\n\t\t\t\t\t\t\tplanner.setupEdgeNodes(infrastructure);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tFirstStageAresPlanner aresP = new FirstStageAresPlanner(inputValues);\n\t\t\t\t\t\t\taresP.setupEdgeNodes(infrastructure);\n\t\t\t\t\t\t}*/\n\t\t\t\t\t\t\n\t\t\t\t\t\tSystem.out.println(\"Executing planner\");\n\t\t\t\t\t\t//FirstStageAresPlanner aresP = new FirstStageAresPlanner();\n\t\t\t\t\t\tFirstStageAresPlanner aresP = new FirstStageAresPlanner();\n\t\t\t\t\t\tSystem.out.println(\"Retrieving solutions\");\n\t\t\t\t\t\t//solutions = (ArrayList<FirstStageAresSolution>) aresP.getSolutionList();\n\t\t\t\t\t\tsolutions = (ArrayList<FirstStageAresSolution>) aresP.getSolutionList();\n\t\t\t\t\t\tSystem.out.println(\"Solutions retrieved!\");\n\t\t\t\t\t\t/*switch(algoritmName){\n\t\t\t\t\t\tcase \"weighted\":\n\t\t\t\t\t\t\tsingleSearch = new HeftEchoResearch(inputValues._1(), infrastructure);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"heft\":\n\t\t\t\t\t\t\tsingleSearch = new HEFTResearch(inputValues._1(), infrastructure);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"hbatt\":\n\t\t\t\t\t\t\tsingleSearch = new HEFTBattery(inputValues._1(), infrastructure);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"hcost\":\n\t\t\t\t\t\t\tsingleSearch = new HEFTCostResearch(inputValues._1(), infrastructure);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"bforce-rt\":\n\t\t\t\t\t\t\tsingleSearch = new BruteForceRuntimeOffloader(inputValues._1(), infrastructure);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"nsgaIII\":\n\t\t\t\t\t\t\tsingleSearch = new NSGAIIIResearch(inputValues._1(), infrastructure);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}*/\n\t\t\t\t\t\t//ArrayList<FirstStageAresSolution> temp = new ArrayList<FirstStageAresSolution>();\n\t\t\t\t\t\t//for(FirstStageAresSolution solution : solutions) {\n\t\t\t\t\t\tArrayList<FirstStageAresSolution> temp = new ArrayList<FirstStageAresSolution>();\n\t\t\t\t\t\tfor(FirstStageAresSolution solution : solutions) {\n\t\t\t\t\t\t\t//aresP.applySolutionToInfrastructure(solution, infrastructure);\n\t\t\t\t\t\t\t//ArrayList<InfrastructureProvisioningPlan> offloads = (ArrayList<InfrastructureProvisioningPlan>) singleSearch.findScheduling();\n\t\t\t\t\t\t\t//if(offloads != null)\n\t\t\t\t\t\t\t\t//for(InfrastructureProvisioningPlan os : offloads) \n\t\t\t\t\t\t\t\t//{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//System.out.println(solution);\n\t\t\t\t\t\t\t\t\t//plan.setInfEnergyConsumption(solution.getEnergyConsumption());\n\t\t\t\t\t\t\t\t\t//plan.setRunTime(solution.getAverageDistance());\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/*if(!temp.contains(solution)) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttemp.add(solution);\n\t\t\t\t\t\t\t\toutput.add(\n\t\t\t\t\t\t\t\t\t\tnew Tuple2<FirstStageAresSolution,Tuple5<Integer,Double,Double,Double,Double>>\n\t\t\t\t\t\t\t\t\t\t(solution,\n\t\t\t\t\t\t\t\t\t\t\t\tnew Tuple5<Integer,Double,Double,Double,Double>(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsolution.getAverageDistance(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t0.0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsolution.getEnergyConsumption(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t0.0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)));\n\t\t\t\t\t\t\t}*/\n\t\t\t\t\t\t\tif(!temp.contains(solution)) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttemp.add(solution);\n\t\t\t\t\t\t\t\toutput.add(\n\t\t\t\t\t\t\t\t\t\tnew Tuple2<FirstStageAresSolution,Tuple5<Integer,Double,Double,Double,Double>>\n\t\t\t\t\t\t\t\t\t\t(solution,\n\t\t\t\t\t\t\t\t\t\t\t\tnew Tuple5<Integer,Double,Double,Double,Double>(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsolution.getAverageDistance(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t0.0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsolution.getEnergyConsumption(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t0.0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn output.iterator();\n\t\t\t\t\t}", "public void testSearchRules() throws Exception {\n Project project = new Project();\r\n \r\n DateFormatSymbols symbols = new DateFormatSymbols(Locale.US);\r\n \r\n for (int i = 0; i < 12; i++) {\r\n \r\n String month = symbols.getMonths()[i];\r\n String shortMonth = symbols.getShortMonths()[i];\r\n \r\n // Basic project info\r\n project.setId(i);\r\n project.setCategoryId(1);\r\n project.setAllowGuests(true);\r\n project.setMembershipRequired(false);\r\n project.setApproved(true);\r\n project.setClosed(false);\r\n project.setPortal(false);\r\n \r\n // Unique Title\r\n project.setTitle(month + \" test project\");\r\n project.setShortDescription(month + \" description word\");\r\n project.setKeywords(shortMonth);\r\n \r\n // Unique Location\r\n project.setCity(\"Virginia Beach\");\r\n project.setState(\"VA\");\r\n project.setPostalCode(\"234\" + String.valueOf(50 + i));\r\n \r\n // Random Rating for now\r\n project.setRatingCount(i + 1);\r\n project.setRatingValue(project.getRatingCount() * StringUtils.rand(1, 5));\r\n project.setRatingAverage(project.getRatingValue() / project.getRatingCount());\r\n \r\n // Index it\r\n ProjectIndexer indexer = new ProjectIndexer();\r\n indexer.add(snowballWriter, project, true);\r\n }\r\n \r\n QueryParser parser = new QueryParser(\"contents\", snowballAnalyzer);\r\n \r\n {\r\n // Make sure a single matching term yields a single hit\r\n SearchBean search = new SearchBean();\r\n search.setQuery(symbols.getMonths()[0]);\r\n search.setLocation(\"Virginia Beach\");\r\n assertNotNull(search.getQuery());\r\n assertNotNull(search.getLocation());\r\n search.parseQuery();\r\n assertTrue(search.isValid());\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n assertNotNull(queryString);\r\n \r\n // (approved:1)\r\n // AND (guests:1)\r\n // AND (closed:0)\r\n // AND (website:0)\r\n // AND (\"january\"^20 OR january^15 OR january*^4) AND (location:(\"virginia beach\"^30))\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == 1);\r\n }\r\n \r\n {\r\n // Make sure a single matching term stem yields a single hit\r\n SearchBean search = new SearchBean();\r\n search.setQuery(symbols.getMonths()[0] + \"'s\");\r\n search.setLocation(\"Virginia Beach\");\r\n assertNotNull(search.getQuery());\r\n assertNotNull(search.getLocation());\r\n search.parseQuery();\r\n assertTrue(search.isValid());\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n assertNotNull(queryString);\r\n \r\n // (approved:1)\r\n // AND (guests:1)\r\n // AND (closed:0)\r\n // AND (website:0)\r\n // AND (\"january's\"^20 OR january's^15 OR january's*^4) AND (location:(\"virginia beach\"^30))\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == 1);\r\n }\r\n \r\n {\r\n // Make sure multiple matching words yield two hits\r\n SearchBean search = new SearchBean();\r\n search.setQuery(symbols.getMonths()[0] + \" \" + symbols.getMonths()[1]);\r\n search.setLocation(\"Virginia Beach\");\r\n search.parseQuery();\r\n assertTrue(search.isValid());\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n assertNotNull(queryString);\r\n \r\n // (approved:1)\r\n // AND (guests:1)\r\n // AND (closed:0)\r\n // AND (website:0)\r\n // AND (\"january february\"^20 OR january^15 OR february^14 OR january*^4 OR february*^3) AND (location:(\"virginia beach\"^30))\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == 2);\r\n }\r\n \r\n {\r\n // Make sure wilcards yield multiple hits\r\n SearchBean search = new SearchBean();\r\n search.setQuery(\"j\");\r\n search.setLocation(\"Virginia Beach\");\r\n search.parseQuery();\r\n assertTrue(search.isValid());\r\n \r\n // Look for data with a \"j\" for comparison\r\n int jCount = 0;\r\n for (int i = 0; i < symbols.getMonths().length; i++) {\r\n if (symbols.getMonths()[i].toLowerCase().indexOf(\"j\") > -1 ||\r\n symbols.getShortMonths()[i].toLowerCase().indexOf(\"j\") > -1) {\r\n ++jCount;\r\n }\r\n }\r\n assertTrue(jCount > 0);\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n assertNotNull(queryString);\r\n \r\n // (approved:1)\r\n // AND (guests:1)\r\n // AND (closed:0)\r\n // AND (website:0)\r\n // AND (\"j\"^20 OR j^15 OR j*^4) AND (location:(\"virginia beach\"^30))\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == jCount);\r\n }\r\n \r\n {\r\n // Make sure alternate locations do not yield any hits\r\n SearchBean search = new SearchBean();\r\n search.setQuery(symbols.getMonths()[0]);\r\n search.setLocation(\"Norfolk\");\r\n search.parseQuery();\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == 0);\r\n }\r\n \r\n {\r\n // Make sure locations as query terms do not yield any hits\r\n SearchBean search = new SearchBean();\r\n search.setQuery(\"Virginia Beach\");\r\n search.setLocation(\"Virginia Beach\");\r\n search.parseQuery();\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == 0);\r\n }\r\n }", "abstract public void search();", "public interface ISearchable {\n\n\n AState getStartState () throws NullError;\n\n AState getGoalState () throws NullError;\n\n ArrayList<AState> getAllSuccessors (AState state) throws LowBoundInput, OutOfBoundMatrixInput, NullError;\n\n}", "@Override\n\tpublic boolean startSearch() {\n\t\tString str = \"\";\n\t\t\n\t\tDimension d = view.getInit();\n\t\tif (d == null) {\n\t\t\tstr = str + \"Falta la posicion de inicio.\\n\";\n\t\t} else {\n\t\t\ty0 = (int) d.getHeight();\n\t\t\tx0 = (int) d.getWidth();\n\t\t}\n\t\t\n\t\td = view.getGoal();\n\t\tif (d == null) {\n\t\t\tstr = str + \"Falta la posicion de meta.\\n\";\n\t\t} else {\n\t\t\tyf = (int) d.getHeight();\n\t\t\txf = (int) d.getWidth();\n\t\t}\n\t\t\n\t\tif (view.isBreadth()) {\n\t\t\tstrategy = new Breadth();\n\t\t} else if (view.isDepth()) {\n\t\t\tstrategy = new Depth();\n\t\t} else if (view.isAStar()) {\n\t\t\tstrategy = new AStar();\n\t\t\tif (view.isH0()) {\n\t\t\t\theuristic = Horse.H0;\n\t\t\t} else if (view.isH1()) {\n\t\t\t\theuristic = Horse.H1;\n\t\t\t} else if (view.isH2()) {\n\t\t\t\theuristic = Horse.H2;\n\t\t\t} else\n\t\t\t\tstr = str + \"Falta por escoger el tipo de heur’stica.\\n\";\n\t\t} else\n\t\t\tstr = str + \"Falta la estrategia de bœsqueda.\\n\";\n\t\t\n\t\tboard = view.getBoard();\n\t\t\n\t\tif (str.equals(\"\")) {\n\t\t\trootNode = new Node(new Horse(x0,y0,xf,yf, board, heuristic));\n\t\t}\n\t\t\n\t\tif (view.isTree()) {\n\t\t\tif (str.equals(\"\"))\n\t\t\t\tsearch = new Tree(rootNode, strategy);\n\t\t} else if (view.isGraph()) {\n\t\t\tif (str.equals(\"\"))\n\t\t\t\tsearch = new Graph(rootNode, strategy);\n\t\t} else \n\t\t\tstr = str + \"Falta el algoritmo de bœsqueda.\\n\";\n\t\t\n\t\tif (!str.equals(\"\")) {\n\t\t\tview.showError(str);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tgoSearch();\n\t\treturn true;\n\t}", "public Search(boolean screen, boolean beamer, int capacity, String building, int nuOfPlugs) {\n this.screen = screen;\n this.beamer = beamer;\n this.building = building;\n this.capacity = capacity;\n this.nuOfPlugs = nuOfPlugs;\n }", "void searchProbed (Search search);", "public static void activityExpand(List<String> activityList){\n List<SootClass> activityClassList = new ArrayList<>();\n for (String activityStr: activityList) {\n SootClass activityClass = Scene.v().getSootClass(activityStr);\n if (!activityClass.isPhantom())\n activityClassList.add(activityClass);\n }\n // Then generate a list of activity class expand sets\n Map<SootClass, Set<SootMethod>> activityMethodExpand = new HashMap<>();\n Map<SootClass, Set<SootClass>> activityClassExpand = new HashMap<>();\n\n for (SootClass activityClass : activityClassList) {\n if (Config.applicationClasses.contains(activityClass)) {\n System.out.println(activityClass.toString() + \" found\");\n // Generate call graph conservatively, using activity class as main class\n // add activity methods as entrypoints\n Scene.v().setEntryPoints(activityClass.getMethods());\n CHATransformer.v().transform();\n CallGraph cg = Scene.v().getCallGraph();\n // get method set\n ReachableMethods relMethods = Scene.v().getReachableMethods();\n Iterator<MethodOrMethodContext> relMethodsItr = relMethods.listener();\n\n activityMethodExpand.put(activityClass, new HashSet<SootMethod>());\n activityClassExpand.put(activityClass, new HashSet<SootClass>());\n HashSet<SootMethod> deltaRelMethods = new HashSet<>();\n\n while (relMethodsItr.hasNext()){\n SootMethod method = relMethodsItr.next().method();\n activityMethodExpand.get(activityClass).add(method);\n SootClass declaringClass = method.getDeclaringClass();\n activityClassExpand.get(activityClass).add(declaringClass);\n if (declaringClass.hasSuperclass()) {\n SootClass superClass = declaringClass.getSuperclass();\n if (superClass.getName().equals(\"android.os.AsyncTask\") ||\n superClass.getName().equals(\"java.lang.Thread\") ||\n superClass.getName().equals(\"java.util.concurrent.ForkJoinWorkerThread\") ||\n superClass.getName().equals(\"android.os.HandlerThread\") ||\n superClass.implementsInterface(\"Runnable\") ||\n superClass.getName().equals(\"java.util.concurrent.FutureTask\") ||\n superClass.implementsInterface(\"RunnableFuture\") ||\n superClass.implementsInterface(\"ScheduledFuture\") ||\n superClass.implementsInterface(\"RunnableScheduledFuture\") ||\n superClass.getName().equals(\"android.os.Handler\") ||\n superClass.getName().equals(\"android.content.AsyncQueryHandler\") ||\n superClass.getName().equals(\"android.content.AsyncQueryHandler.WorkerHandler\") ||\n superClass.getName().equals(\"android.webkit.HttpAuthHandler\") ||\n superClass.getName().equals(\"android.webkit.HttpAuthHandler\"))\n deltaRelMethods.addAll(declaringClass.getMethods());\n }\n }\n activityMethodExpand.get(activityClass).addAll(deltaRelMethods);\n Util.LOGGER.info(activityClass.toString() + \" finished\");\n }\n else\n System.out.println(activityClass.toString() + \" not found\");\n\n // extract text features\n try {\n File tempFile = new File(Config.outputDir + \"/\" + activityClass.getName() + \"_text_feature.txt\");\n BufferedWriter out = new BufferedWriter(new OutputStreamWriter(\n new FileOutputStream(tempFile), \"UTF8\"));\n\n JSONObject outInfo = new JSONObject();\n\n for (SootClass appClass: activityClassExpand.get(activityClass)){\n // class name\n outInfo.put(appClass.getName(), new JSONObject());\n // package name\n JSONObject appClassInfo = (JSONObject)outInfo.get(appClass.getName());\n appClassInfo.put(\"package_name\", appClass.getPackageName());\n // field names\n appClassInfo.put(\"fields\", new JSONArray());\n JSONArray appClassFields = (JSONArray)appClassInfo.get(\"fields\");\n for (SootField classField: appClass.getFields())\n appClassFields.put(classField.getDeclaration());\n // reserve method list\n appClassInfo.put(\"methods\", new JSONArray());\n }\n // class names, method names and field names\n for (SootMethod appMethod: activityMethodExpand.get(activityClass)) {\n JSONObject appClassInfo = (JSONObject)outInfo.get(appMethod.getDeclaringClass().getName());\n JSONArray methodList = (JSONArray)appClassInfo.get(\"methods\");\n methodList.put(appMethod.getDeclaration());\n }\n\n out.write(outInfo.toString());\n out.close();\n }\n catch (Exception e){\n System.out.println(\"Output failed\");\n }\n }\n }", "private void startFilterCriteria() {\n\n\t\tLog.i(TAG, \"startFilterCriteria()\");\n\n\t\tFindUtilsImpl utils = new FindUtilsImpl();\n\t\tSet<String> tSet = utils.getTypeSet((ArrayList<BELEvent>) eventsListFind);\n\t\tArrayList<String> tList = new ArrayList<String>(cleanSet(tSet));\n\n\t\tString str = \"start FilterCriteria.class\";\n\t\tLog.i(TAG, \"Search Activity: \" +str);\n\n\t\t\tIntent intent = new Intent(context, FilterCriteria.class);\n\t\t\tintent.putStringArrayListExtra(\"TypesKey\", tList);\n\t\t\t//TODO capture activity not found exception\n\t\t\t//\t((Activity) context).startActivityForResult(intent,Constants.FIND_REQ);\n\t\t\tstartActivityForResult(intent,Constants.FIND_REQ);\n\n\t\t\tstr = \"startActivity(intent,Constants.FIND_REQ)\";\n\t\t\t//\tstr = \"startActivityForResult(intent,Constants.FIND_REQ)\";\n\t\t\tLog.e(\"Search Dlg: \", str);\n\t\t}", "public static void main(String... args)\n {\n String path = Configuration.instance.dataDirectory + Configuration.instance.fileSeparator;\n String suffix = \"_default.xml\";\n String algorithm = \"\";\n boolean paramSeach = false;\n int maxGens = 10000;\n\n readItems();\n\n // Parsing CLI\n for (int i = 0; i < args.length; i++)\n {\n if (args[i].equals(\"-algorithm\"))\n {\n i++;\n algorithm = args[i];\n }\n\n if (args[i].equals(\"-configuration\"))\n {\n i++;\n if (args[i].equals(\"best\"))\n suffix = \"_best.xml\";\n }\n\n if (args[i].equals(\"-search_best_configuration\"))\n paramSeach = true;\n }\n\n if (paramSeach) suffix = \"_best.xml\";\n double[] hyperparameters = loadConfig(path + algorithm + suffix);\n System.out.println(\"Chosen algorithm: \" + algorithm);\n\n double time = System.currentTimeMillis();\n // Running correct algorithm according to CLI\n switch (algorithm)\n {\n case \"ga\":\n if (paramSeach)\n new GARecommender().recommend();\n else\n new Population(maxGens, hyperparameters).run();\n break;\n case \"sa\":\n case \"best-algorithm\":\n if (paramSeach)\n new SARecommender().recommend();\n else\n new Annealing(hyperparameters).run();\n break;\n case \"aco\":\n if (paramSeach)\n new ACORecommender().recommend();\n else\n new AntColony(maxGens, hyperparameters).run();\n break;\n case \"pso\":\n if (paramSeach)\n new PSORecommender().recommend();\n else\n new Swarm(maxGens * 10, hyperparameters).run(); // 10x max gens because PSO is does less per gen and is much faster\n break;\n default:\n System.out.println(\"Could not find algorithm with name \" + algorithm + \". Options are: ga, sa, aco, pso\");\n break;\n }\n System.out.println(\"Finished in: \" + ((System.currentTimeMillis() - time) / 1000) + \"s\");\n }", "private Page<ElasticCandidate> search(CandidateSearchModel model, Pageable pageable){\n Integer experienceDuration = model.getSkillPlaceholder()\n .getExperienceDuration();\n String title = model.getSkillPlaceholder()\n .getSkill()\n .getTitle();\n RangeModel<Integer> rangeExperience = model.getSkillExperienceRange();\n Integer experienceUpperLimit = rangeExperience.getUpperLimit();\n Integer experienceLowerLimit = rangeExperience.getLowerLimit();\n\n // Prepares location\n String location = model.getLocation();\n\n // Prepare hourly rate\n Integer hourlyRate = model.getHourlyRate();\n RangeModel<Integer> rangeHourlyRate = model.getHourlyRateRange();\n Integer hourlyRateUpperLimit = rangeHourlyRate.getUpperLimit();\n Integer hourlyRateLowerLimit = rangeHourlyRate.getLowerLimit();\n\n // Prepares certifications\n Set<String> certifications = model.getCertifications();\n if (certifications != null && certifications.size() != 0) {\n Iterator iterator = certifications.iterator();\n String[] certificationsArray = new String[certifications.size()];\n for (int i = 0; i < certificationsArray.length; i++) {\n certificationsArray[i] = (String) iterator.next();\n }\n }\n\n // Prepares Starting date postponed !!\n// Long startingDate = model.getStartingDate().getTime();\n// Long startingDateUpperLimit = model.getStartingDateUpperRange().getTime();\n\n // Prepares time period\n String timePeriod = model.getTimePeriod();\n // endregion\n\n // region Build query\n SearchQuery searchQuery;\n\n\n if (certifications != null && certifications.size() != 0)\n searchQuery = new NativeSearchQueryBuilder().withQuery(matchAllQuery())\n\n\n .withQuery(\n boolQuery()\n .must(queryForMustSkill(title))\n .should(queryForExactValueSkill(title, experienceDuration))\n .should(queryForExactValueHourlyRate(hourlyRate))\n .should(queryForFuzzyHourlyRate(hourlyRate))\n .should(queryForFuzzySkill(title, experienceDuration))\n .should(queryForRangeSkill(title, experienceLowerLimit, experienceUpperLimit))\n .should(queryForRangeHourlyRate(hourlyRateLowerLimit, hourlyRateUpperLimit))\n .must(queryForLocation(location))\n// .must(queryForStartingDay(startingDate, startingDateUpperLimit))\n .must(queryForTimePeriod(timePeriod))\n .must(queryForCertifications(certifications)))\n .withPageable(pageable)\n .withFilter(queryForMustSkill(title))\n .withFilter(queryForExactValueSkill(title, experienceDuration))\n .withFilter(queryForExactValueHourlyRate(hourlyRate))\n .withFilter(queryForFuzzyHourlyRate(hourlyRate))\n .withFilter(queryForFuzzySkill(title, experienceDuration))\n .withFilter(queryForRangeSkill(title, experienceLowerLimit, experienceUpperLimit))\n .withFilter(queryForRangeHourlyRate(hourlyRateLowerLimit, hourlyRateUpperLimit))\n .withFilter(queryForLocation(location))\n .withFilter(queryForTimePeriod(timePeriod))\n .withFilter(queryForCertifications(certifications))\n// .withSort(SortBuilders.fieldSort(\"hourlyRate\")\n// .order(SortOrder.ASC))\n .build();\n\n else\n\n\n searchQuery = new NativeSearchQueryBuilder().withQuery(matchAllQuery())\n\n\n .withQuery(\n boolQuery()\n .must(queryForMustSkill(title))\n .should(queryForExactValueSkill(title, experienceDuration))\n .should(queryForExactValueHourlyRate(hourlyRate))\n .should(queryForFuzzyHourlyRate(hourlyRate))\n .should(queryForFuzzySkill(title, experienceDuration))\n .should(queryForRangeSkill(title, experienceLowerLimit, experienceUpperLimit))\n .should(queryForRangeHourlyRate(hourlyRateLowerLimit, hourlyRateUpperLimit))\n .must(queryForLocation(location))\n// .must(queryForStartingDay(startingDate, startingDateUpperLimit))\n .must(queryForTimePeriod(timePeriod)))\n .withPageable(pageable)\n .withFilter(queryForMustSkill(title))\n .withFilter(queryForExactValueSkill(title, experienceDuration))\n .withFilter(queryForExactValueHourlyRate(hourlyRate))\n .withFilter(queryForFuzzyHourlyRate(hourlyRate))\n .withFilter(queryForFuzzySkill(title, experienceDuration))\n .withFilter(queryForRangeSkill(title, experienceLowerLimit, experienceUpperLimit))\n .withFilter(queryForRangeHourlyRate(hourlyRateLowerLimit, hourlyRateUpperLimit))\n .withFilter(queryForLocation(location))\n .withFilter(queryForTimePeriod(timePeriod))\n// .withSort(SortBuilders.fieldSort(\"hourlyRate\")\n// .order(SortOrder.ASC))\n .build();\n\n // endregion\n\n // region Test\n Page<ElasticCandidate> queryForExactValueSkill = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForExactValueSkill(title, experienceDuration))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForExactValueHourlyRate = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForExactValueHourlyRate(hourlyRate))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForFuzzySkill = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForFuzzySkill(title, experienceDuration))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForFuzzyHourlyRate = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForFuzzyHourlyRate(hourlyRate))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForRangeSkill = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForRangeSkill(title, experienceLowerLimit, experienceUpperLimit))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForRangeHourlyRate = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForRangeHourlyRate(hourlyRateLowerLimit, hourlyRateUpperLimit))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForLocation = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForLocation(location))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForTimePeriod = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForTimePeriod(timePeriod))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForCertifications = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForCertifications(certifications))\n .build(), ElasticCandidate.class);\n // endregion\n\n\n Page<ElasticCandidate> sampleEntities = elasticsearchTemplate.queryForPage(searchQuery,\n ElasticCandidate.class);\n return sampleEntities;\n }", "public abstract Intent constructResults();", "private void searchFunction() {\n\t\t\r\n\t}", "public interface SearchInterface {\n int ACTION_TYPE_AMBIGUOUS = 1;\n int ACTION_TYPE_SWITCH_CHANNEL = 2;\n int ACTION_TYPE_SWITCH_INPUT = 3;\n\n /**\n * Search channels, inputs, or programs.\n * This assumes that parental control settings will not be change while searching.\n *\n * @param action One of {@link #ACTION_TYPE_SWITCH_CHANNEL}, {@link #ACTION_TYPE_SWITCH_INPUT},\n * or {@link #ACTION_TYPE_AMBIGUOUS},\n */\n List<SearchResult> search(String query, int limit, int action);\n}", "public interface Strategy {\n\n StrategySolution solve(List<Item> items, int weight);\n}", "CampusSearchQuery generateQuery();", "public Solver(Board initial)\n {\n // validate input to Solver\n if (initial == null) throw new NullPointerException();\n if (!initial.isSolvable()) throw new IllegalArgumentException();\n \n // create first search node with pointer used for each iteration of A*\n step = new SearchNode();\n step.board = initial;\n \n // create new priority queue specifying the priority function\n MinPQ<SearchNode> pq = new MinPQ<SearchNode>(new HammingPriority());\n\n // run A-star search algorithm until goal board is dequeued\n while (!step.board.isGoal()) {\n // runs iterable of neighbors and adds non duplicates to pq\n Iterable<Board> neighbors = step.board.neighbors();\n for (Board b : neighbors) {\n // skips if possible board is duplicate of 2nd board back\n if (step.prev != null) // check not needed for first iteration\n if (b.equals(step.prev.board)) continue;\n \n // creates possible board's node and adds to pq\n SearchNode nextPossibleBoard = new SearchNode();\n nextPossibleBoard.board = b;\n nextPossibleBoard.prev = step;\n nextPossibleBoard.dist = step.dist + 1;\n pq.insert(nextPossibleBoard);\n }\n step = pq.delMin(); // dequeue next step toward goal board\n }\n \n moves = step.dist;\n goalNode = step;\n\n \n }", "public static void main(String[] args) throws IOException {\n int activeThreshold = 300;\n //Activity.selectActive(\"st\", 6, activeThreshold);\n //Activity.selectActive(\"ri\", 6, activeThreshold);\n //Activity.selectActive(\"dw\", 9, activeThreshold);\n\n //Interaction.analysis(\"st\", 6);\n //Interaction.analysis(\"ri\", 6);\n\n //BehaviourIndicators.analysis(\"st\", 6);\n //BehaviourIndicators.analysis(\"ri\", 6);\n //BehaviourIndicators.analysis(\"dw\", 9);\n\n Engagement.analysis(\"st\",6);\n Engagement.analysis(\"ri\",6);\n //todo the data files for DW have to be adjusted to the ones of the other two to be able to run it\n //Engagement.analysis(\"dw\",9);\n\n //Motivation.analysis(\"ri\", 6);\n //Motivation.analysis(\"st\", 6);\n }", "SearchResult<TimelineMeta> search(SearchParameter searchParameter);", "ActivityConcept createActivityConcept();", "public interface Solver {\n String MESSY_FOLIAGE_STRATEGY = \"find_messy_foliage\";\n\n /**\n * Play an association.\n */\n void playAssociation(LivingEntity ply, Association assos, State eventType);\n\n /**\n * Find an association for a player particular foot. This will fetch the player\n * angle and use it as a basis to find out what block is below their feet (or\n * which block is likely to be below their feet if the player is walking on the\n * edge of a block when walking over non-emitting blocks like air or water).<br>\n * <br>\n * Returns NOT_EMITTER if no blocks are valid emitting blocks.<br>\n * Returns a string that begins with \"_NO_ASSOCIATION\" if a matching block was\n * found, but has no association in the blockmap.\n */\n Association findAssociation(LivingEntity ply, double verticalOffsetAsMinus, boolean isRightFoot);\n\n /**\n * Find an association for a certain block assuming the player is standing on\n * it, using a custom strategy which strategies are defined by the solver.\n */\n Association findAssociation(World w, BlockPos pos, String strategy);\n}", "SearchResult<TimelineMeta> search(SearchQuery searchQuery);", "public List<Graph> search() {\n\n long start = System.currentTimeMillis();\n TetradLogger.getInstance().log(\"info\", \"Starting ION Search.\");\n logGraphs(\"\\nInitial Pags: \", this.input);\n TetradLogger.getInstance().log(\"info\", \"Transfering local information.\");\n long steps = System.currentTimeMillis();\n\n /*\n * Step 1 - Create the empty graph\n */\n List<Node> varNodes = new ArrayList<>();\n for (String varName : variables) {\n varNodes.add(new GraphNode(varName));\n }\n Graph graph = new EdgeListGraph(varNodes);\n\n /*\n * Step 2 - Transfer local information from the PAGs (adjacencies\n * and edge orientations)\n */\n // transfers edges from each graph and finds definite noncolliders\n transferLocal(graph);\n // adds edges for variables never jointly measured\n for (NodePair pair : nonIntersection(graph)) {\n graph.addEdge(new Edge(pair.getFirst(), pair.getSecond(), Endpoint.CIRCLE, Endpoint.CIRCLE));\n }\n TetradLogger.getInstance().log(\"info\", \"Steps 1-2: \" + (System.currentTimeMillis() - steps) / 1000. + \"s\");\n System.out.println(\"step2\");\n System.out.println(graph);\n\n /*\n * Step 3\n *\n * Branch and prune step that blocks problematic undirectedPaths, possibly d-connecting undirectedPaths\n */\n steps = System.currentTimeMillis();\n Queue<Graph> searchPags = new LinkedList<>();\n // place graph constructed in step 2 into the queue\n searchPags.offer(graph);\n // get d-separations and d-connections\n List<Set<IonIndependenceFacts>> sepAndAssoc = findSepAndAssoc(graph);\n this.separations = sepAndAssoc.get(0);\n this.associations = sepAndAssoc.get(1);\n Map<Collection<Node>, List<PossibleDConnectingPath>> paths;\n// Queue<Graph> step3PagsSet = new LinkedList<Graph>();\n HashSet<Graph> step3PagsSet = new HashSet<>();\n Set<Graph> reject = new HashSet<>();\n // if no d-separations, nothing left to search\n if (separations.isEmpty()) {\n // makes orientations preventing definite noncolliders from becoming colliders\n // do final orientations\n// doFinalOrientation(graph);\n step3PagsSet.add(graph);\n }\n // sets length to iterate once if search over path lengths not enabled, otherwise set to 2\n int numNodes = graph.getNumNodes();\n int pl = numNodes - 1;\n if (pathLengthSearch) {\n pl = 2;\n }\n // iterates over path length, then adjacencies\n for (int l = pl; l < numNodes; l++) {\n if (pathLengthSearch) {\n TetradLogger.getInstance().log(\"info\", \"Braching over path lengths: \" + l + \" of \" + (numNodes - 1));\n }\n int seps = separations.size();\n int currentSep = 1;\n int numAdjacencies = separations.size();\n for (IonIndependenceFacts fact : separations) {\n if (adjacencySearch) {\n TetradLogger.getInstance().log(\"info\", \"Braching over path nonadjacencies: \" + currentSep + \" of \" + numAdjacencies);\n }\n seps--;\n // uses two queues to keep up with which PAGs are being iterated and which have been\n // accepted to be iterated over in the next iteration of the above for loop\n searchPags.addAll(step3PagsSet);\n recGraphs.add(searchPags.size());\n step3PagsSet.clear();\n while (!searchPags.isEmpty()) {\n System.out.println(\"ION Step 3 size: \" + searchPags.size());\n double currentUsage = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();\n if (currentUsage > maxMemory) maxMemory = currentUsage;\n // deques first PAG from searchPags\n Graph pag = searchPags.poll();\n // Part 3.a - finds possibly d-connecting undirectedPaths between each pair of nodes\n // known to be d-separated\n List<PossibleDConnectingPath> dConnections = new ArrayList<>();\n // checks to see if looping over adjacencies\n if (adjacencySearch) {\n for (Collection<Node> conditions : fact.getZ()) {\n // checks to see if looping over path lengths\n if (pathLengthSearch) {\n dConnections.addAll(PossibleDConnectingPath.findDConnectingPathsOfLength\n (pag, fact.getX(), fact.getY(), conditions, l));\n } else {\n dConnections.addAll(PossibleDConnectingPath.findDConnectingPaths\n (pag, fact.getX(), fact.getY(), conditions));\n }\n }\n } else {\n for (IonIndependenceFacts allfact : separations) {\n for (Collection<Node> conditions : allfact.getZ()) {\n // checks to see if looping over path lengths\n if (pathLengthSearch) {\n dConnections.addAll(PossibleDConnectingPath.findDConnectingPathsOfLength\n (pag, allfact.getX(), allfact.getY(), conditions, l));\n } else {\n dConnections.addAll(PossibleDConnectingPath.findDConnectingPaths\n (pag, allfact.getX(), allfact.getY(), conditions));\n }\n }\n }\n }\n // accept PAG go to next PAG if no possibly d-connecting undirectedPaths\n if (dConnections.isEmpty()) {\n// doFinalOrientation(pag);\n// Graph p = screenForKnowledge(pag);\n// if (p != null) step3PagsSet.add(p);\n step3PagsSet.add(pag);\n continue;\n }\n // maps conditioning sets to list of possibly d-connecting undirectedPaths\n paths = new HashMap<>();\n for (PossibleDConnectingPath path : dConnections) {\n List<PossibleDConnectingPath> p = paths.get(path.getConditions());\n if (p == null) {\n p = new LinkedList<>();\n }\n p.add(path);\n paths.put(path.getConditions(), p);\n }\n // Part 3.b - finds minimal graphical changes to block possibly d-connecting undirectedPaths\n List<Set<GraphChange>> possibleChanges = new ArrayList<>();\n for (Set<GraphChange> changes : findChanges(paths)) {\n Set<GraphChange> newChanges = new HashSet<>();\n for (GraphChange gc : changes) {\n boolean okay = true;\n for (Triple collider : gc.getColliders()) {\n\n if (pag.isUnderlineTriple(collider.getX(), collider.getY(), collider.getZ())) {\n okay = false;\n break;\n }\n\n }\n if (!okay) {\n continue;\n }\n for (Triple collider : gc.getNoncolliders()) {\n if (pag.isDefCollider(collider.getX(), collider.getY(), collider.getZ())) {\n okay = false;\n break;\n }\n }\n if (okay) {\n newChanges.add(gc);\n }\n }\n if (!newChanges.isEmpty()) {\n possibleChanges.add(newChanges);\n } else {\n possibleChanges.clear();\n break;\n }\n }\n float starthitset = System.currentTimeMillis();\n Collection<GraphChange> hittingSets = IonHittingSet.findHittingSet(possibleChanges);\n recHitTimes.add((System.currentTimeMillis() - starthitset) / 1000.);\n // Part 3.c - checks the newly constructed graphs from 3.b and rejects those that\n // cycles or produce independencies known not to occur from the input PAGs or\n // include undirectedPaths from definite nonancestors\n for (GraphChange gc : hittingSets) {\n boolean badhittingset = false;\n for (Edge edge : gc.getRemoves()) {\n Node node1 = edge.getNode1();\n Node node2 = edge.getNode2();\n Set<Triple> triples = new HashSet<>();\n triples.addAll(gc.getColliders());\n triples.addAll(gc.getNoncolliders());\n if (triples.size() != (gc.getColliders().size() + gc.getNoncolliders().size())) {\n badhittingset = true;\n break;\n }\n for (Triple triple : triples) {\n if (node1.equals(triple.getY())) {\n if (node2.equals(triple.getX()) ||\n node2.equals(triple.getZ())) {\n badhittingset = true;\n break;\n }\n }\n if (node2.equals(triple.getY())) {\n if (node1.equals(triple.getX()) ||\n node1.equals(triple.getZ())) {\n badhittingset = true;\n break;\n }\n }\n }\n if (badhittingset) {\n break;\n }\n for (NodePair pair : gc.getOrients()) {\n if ((node1.equals(pair.getFirst()) && node2.equals(pair.getSecond())) ||\n (node2.equals(pair.getFirst()) && node1.equals(pair.getSecond()))) {\n badhittingset = true;\n break;\n }\n }\n if (badhittingset) {\n break;\n }\n }\n if (!badhittingset) {\n for (NodePair pair : gc.getOrients()) {\n for (Triple triple : gc.getNoncolliders()) {\n if (pair.getSecond().equals(triple.getY())) {\n if (pair.getFirst().equals(triple.getX()) &&\n pag.getEndpoint(triple.getZ(), triple.getY()).equals(Endpoint.ARROW)) {\n badhittingset = true;\n break;\n\n }\n if (pair.getFirst().equals(triple.getZ()) &&\n pag.getEndpoint(triple.getX(), triple.getY()).equals(Endpoint.ARROW)) {\n badhittingset = true;\n break;\n }\n }\n if (badhittingset) {\n break;\n }\n }\n if (badhittingset) {\n break;\n }\n }\n }\n if (badhittingset) {\n continue;\n }\n Graph changed = gc.applyTo(pag);\n // if graph change has already been rejected move on to next graph\n if (reject.contains(changed)) {\n continue;\n }\n // if graph change has already been accepted move on to next graph\n if (step3PagsSet.contains(changed)) {\n continue;\n }\n // reject if null, predicts false independencies or has cycle\n if (predictsFalseIndependence(associations, changed)\n || changed.existsDirectedCycle()) {\n reject.add(changed);\n }\n // makes orientations preventing definite noncolliders from becoming colliders\n // do final orientations\n// doFinalOrientation(changed);\n // now add graph to queue\n\n// Graph p = screenForKnowledge(changed);\n// if (p != null) step3PagsSet.add(p);\n step3PagsSet.add(changed);\n }\n }\n // exits loop if not looping over adjacencies\n if (!adjacencySearch) {\n break;\n }\n }\n }\n TetradLogger.getInstance().log(\"info\", \"Step 3: \" + (System.currentTimeMillis() - steps) / 1000. + \"s\");\n Queue<Graph> step3Pags = new LinkedList<>(step3PagsSet);\n\n /*\n * Step 4\n *\n * Finds redundant undirectedPaths and uses this information to expand the list\n * of possible graphs\n */\n steps = System.currentTimeMillis();\n Map<Edge, Boolean> necEdges;\n Set<Graph> outputPags = new HashSet<>();\n\n while (!step3Pags.isEmpty()) {\n Graph pag = step3Pags.poll();\n necEdges = new HashMap<>();\n // Step 4.a - if x and y are known to be unconditionally associated and there is\n // exactly one trek between them, mark each edge on that trek as necessary and\n // make the tiples on the trek definite noncolliders\n // initially mark each edge as not necessary\n for (Edge edge : pag.getEdges()) {\n necEdges.put(edge, false);\n }\n // look for unconditional associations\n for (IonIndependenceFacts fact : associations) {\n for (List<Node> nodes : fact.getZ()) {\n if (nodes.isEmpty()) {\n List<List<Node>> treks = treks(pag, fact.x, fact.y);\n if (treks.size() == 1) {\n List<Node> trek = treks.get(0);\n List<Triple> triples = new ArrayList<>();\n for (int i = 1; i < trek.size(); i++) {\n // marks each edge in trek as necessary\n necEdges.put(pag.getEdge(trek.get(i - 1), trek.get(i)), true);\n if (i == 1) {\n continue;\n }\n // makes each triple a noncollider\n pag.addUnderlineTriple(trek.get(i - 2), trek.get(i - 1), trek.get(i));\n }\n }\n // stop looping once the empty set is found\n break;\n }\n }\n }\n // Part 4.b - branches by generating graphs for every combination of removing\n // redundant undirectedPaths\n boolean elimTreks;\n // checks to see if removing redundant undirectedPaths eliminates every trek between\n // two variables known to be nconditionally assoicated\n List<Graph> possRemovePags = possRemove(pag, necEdges);\n double currentUsage = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();\n if (currentUsage > maxMemory) maxMemory = currentUsage;\n for (Graph newPag : possRemovePags) {\n elimTreks = false;\n // looks for unconditional associations\n for (IonIndependenceFacts fact : associations) {\n for (List<Node> nodes : fact.getZ()) {\n if (nodes.isEmpty()) {\n if (treks(newPag, fact.x, fact.y).isEmpty()) {\n elimTreks = true;\n }\n // stop looping once the empty set is found\n break;\n }\n }\n }\n // add new PAG to output unless a necessary trek has been eliminated\n if (!elimTreks) {\n outputPags.add(newPag);\n }\n }\n }\n outputPags = removeMoreSpecific(outputPags);\n// outputPags = applyKnowledge(outputPags);\n\n TetradLogger.getInstance().log(\"info\", \"Step 4: \" + (System.currentTimeMillis() - steps) / 1000. + \"s\");\n\n /*\n * Step 5\n *\n * Generate the Markov equivalence classes for graphs and accept only\n * those that do not predict false d-separations\n */\n steps = System.currentTimeMillis();\n Set<Graph> outputSet = new HashSet<>();\n for (Graph pag : outputPags) {\n Set<Triple> unshieldedPossibleColliders = new HashSet<>();\n for (Triple triple : getPossibleTriples(pag)) {\n if (!pag.isAdjacentTo(triple.getX(), triple.getZ())) {\n unshieldedPossibleColliders.add(triple);\n }\n }\n\n PowerSet<Triple> pset = new PowerSet<>(unshieldedPossibleColliders);\n for (Set<Triple> set : pset) {\n Graph newGraph = new EdgeListGraph(pag);\n for (Triple triple : set) {\n newGraph.setEndpoint(triple.getX(), triple.getY(), Endpoint.ARROW);\n newGraph.setEndpoint(triple.getZ(), triple.getY(), Endpoint.ARROW);\n }\n doFinalOrientation(newGraph);\n }\n for (Graph outputPag : finalResult) {\n if (!predictsFalseIndependence(associations, outputPag)) {\n Set<Triple> underlineTriples = new HashSet<>(outputPag.getUnderLines());\n for (Triple triple : underlineTriples) {\n outputPag.removeUnderlineTriple(triple.getX(), triple.getY(), triple.getZ());\n }\n outputSet.add(outputPag);\n }\n }\n }\n\n// outputSet = applyKnowledge(outputSet);\n outputSet = checkPaths(outputSet);\n\n output.addAll(outputSet);\n TetradLogger.getInstance().log(\"info\", \"Step 5: \" + (System.currentTimeMillis() - steps) / 1000. + \"s\");\n runtime = ((System.currentTimeMillis() - start) / 1000.);\n logGraphs(\"\\nReturning output (\" + output.size() + \" Graphs):\", output);\n double currentUsage = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();\n if (currentUsage > maxMemory) maxMemory = currentUsage;\n return output;\n }", "abstract public boolean performSearch();", "public void createActivity(Activity activity) {\n\t\t\n\t}", "private Search() {}", "public abstract Search create(String search, SearchBuilder builder);", "public static void main(String... args) {\n String handle = \"realDonaldTrump\", pattern = \"mexico\";\n System.out.println(\"Starting\");\n MatchBot bot = new MatchBot(handle, 2000);\n System.out.println(\"made bot\");\n // search all tweets for the pattern\n List<String> ansNaive = new DoublyLinkedList<>();\n System.out.println(\"naive start\");\n\n // test 1\n int compsNaive = bot.searchTweetsNaive(pattern, ansNaive); \n\n List<String> ansKMP = new DoublyLinkedList<>();\n System.out.println(\"kmp start\");\n int compsKMP = bot.searchTweetsKMP(pattern, ansKMP);\n\n List<String> ansBM = new DoublyLinkedList<>();\n System.out.println(\"Boyer - Moore start\");\n int compsBM = bot.searchTweetsBoyerMoore(pattern, ansBM);\n\n\n \n System.out.println(\"*** Donald test (normal size): ***naive comps = \" + compsNaive +\n \", KMP comps = \" + compsKMP + \", Boyer-Moore comps = \" + compsBM);\n\n /*for (int i = 0; i < ansKMP.size(); i++) {\n String tweet = ansKMP.get(i);\n assert tweet.equals(ansNaive.get(i));\n System.out.println(i++ + \". \" + tweet);\n System.out.println(pattern + \" appears at index \" + \n tweet.toLowerCase().indexOf(pattern.toLowerCase()));\n }*/\n\n // test 2\n handle = \"cnnbrk\";\n pattern = \"syria\";\n bot = new MatchBot(handle, 2000);\n compsNaive = bot.searchTweetsNaive(pattern, ansNaive);\n compsKMP = bot.searchTweetsKMP(pattern, ansKMP);\n compsBM = bot.searchTweetsBoyerMoore(pattern, ansBM);\n\n System.out.println(\"*** CNN breaking news (normal size): ***naive comps = \" + compsNaive +\n \", KMP comps = \" + compsKMP + \", Boyer-Moore comps = \" + compsBM);\n\n\n //test 3\n handle = \"realDonaldTrump\";\n pattern = \"mexico\";\n bot = new MatchBot(handle, 250);\n compsNaive = bot.searchTweetsNaive(pattern, ansNaive);\n compsKMP = bot.searchTweetsKMP(pattern, ansKMP);\n compsBM = bot.searchTweetsBoyerMoore(pattern, ansBM);\n\n System.out.println(\"*** Donald test (small size): **: ***naive comps = \" + compsNaive +\n \", KMP comps = \" + compsKMP + \", Boyer-Moore comps = \" + compsBM);\n\n\n // test 4\n handle = \"cnnbrk\";\n pattern = \"syria\";\n bot = new MatchBot(handle, 250);\n compsNaive = bot.searchTweetsNaive(pattern, ansNaive);\n compsKMP = bot.searchTweetsKMP(pattern, ansKMP);\n compsBM = bot.searchTweetsBoyerMoore(pattern, ansBM);\n\n System.out.println(\"*** CNN breaking news (small size): ***naive comps = \" + compsNaive +\n \", KMP comps = \" + compsKMP + \", Boyer-Moore comps = \" + compsBM);\n\n\n // test 5\n handle = \"cnnbrk\";\n pattern = \"syria\";\n bot = new MatchBot(handle, 4000);\n compsNaive = bot.searchTweetsNaive(pattern, ansNaive);\n compsKMP = bot.searchTweetsKMP(pattern, ansKMP);\n compsBM = bot.searchTweetsBoyerMoore(pattern, ansBM);\n\n System.out.println(\"*** CNN breaking news (large size): ***naive comps = \" + compsNaive +\n \", KMP comps = \" + compsKMP + \", Boyer-Moore comps = \" + compsBM);\n\n // test 6\n handle = \"realDonaldTrump\";\n pattern = \"mexico\";\n bot = new MatchBot(handle, 4000);\n compsNaive = bot.searchTweetsNaive(pattern, ansNaive);\n compsKMP = bot.searchTweetsKMP(pattern, ansKMP);\n compsBM = bot.searchTweetsBoyerMoore(pattern, ansBM);\n\n System.out.println(\"*** Donald test (large size): **: ***naive comps = \" + compsNaive +\n \", KMP comps = \" + compsKMP + \", Boyer-Moore comps = \" + compsBM);\n\n }", "public void search(int[] a, int x) {\r\n\t\tlang.setInteractionType(Language.INTERACTION_TYPE_AVINTERACTION);\r\n\t\t// Create Array: coordinates, data, name, display options,\r\n\t\t// default properties\r\n\t TextProperties headerProps = new TextProperties();\r\n\t headerProps.set(AnimationPropertiesKeys.FONT_PROPERTY, new Font(\r\n\t Font.SANS_SERIF, Font.BOLD, 24));\r\n\t\tText title = lang.newText(new Coordinates(20,30), \"Exponential Search\",\"titel\", null, headerProps);\r\n\t\t\r\n\t RectProperties rectProps = new RectProperties();\r\n\t rectProps.set(AnimationPropertiesKeys.FILLED_PROPERTY, true);\r\n\t rectProps.set(AnimationPropertiesKeys.FILL_PROPERTY, Color.CYAN);\r\n\t rectProps.set(AnimationPropertiesKeys.DEPTH_PROPERTY, 2);\r\n\t \r\n\t Rect hRect = lang.newRect(new Offset(-5, -5, \"titel\",\r\n\t AnimalScript.DIRECTION_NW), new Offset(5, 5, \"titel\", \"SE\"), \"hRect\",\r\n\t null, rectProps);\r\n//\t title.show();\r\n//\t hRect.show();\r\n\t\t\r\n\t\t//Rectangle header = lang.newRect(new Offset(-5, -5), lowerRight, name, display);\r\n\t\tText title_discr = lang.newText(new Coordinates(20, 80), \"Beschreibung des Algorithmus\",\"discr\", null);\r\n\t\tSourceCode discription = lang.newSourceCode(new Coordinates(20, 110),\"beschreibung\",null);\r\n\t\tdiscription.addCodeLine(\"Der Algorithmus in Worten:\", null, 0, null);\r\n\t\tdiscription.addCodeLine(\"\", null, 0, null);\r\n\t\tdiscription.addCodeLine(\"1. Finde den Bereich, in dem das Element vorhanden ist, indem man mit exponentialen Schritten durch das Array iteriert.\", null, 0, null);\r\n\t\tdiscription.addCodeLine(\"2. Führe eine binäre Suche in oben gefundenen Bereich durch.\", null, 0, null);\r\n\t\t\r\n//\t\tMultipleSelectionQuestionModel mulQuestion = new MultipleSelectionQuestionModel(\"1\");\r\n//\t\tmulQuestion.setPrompt(\"Welcher Algorithmus wird oder welche Algorithmen werden im ExponentialSearch verwendet?\");\r\n//\t\tmulQuestion.setNumberOfTries(1);\r\n//\t\tmulQuestion.addAnswer(\"Exponentialsearch\", 1, \"ist ein Bestandteil des Algorithmus\");\r\n//\t\tmulQuestion.addAnswer(\"FindNearestNeighbour\", 0, \"ist kein Bestandteil des Algorithmus\");\r\n//\t\tmulQuestion.addAnswer(\"Binarysearch\", 1, \"ist ein Bestandteil des Algorithmus\");\r\n//\t\tmulQuestion.addAnswer(\"Linearsearch\", 0, \"ist kein Bestandteil des Algorithmus\");\r\n//\t\tmulQuestion.addAnswer(\"Skipsearch\", 0, \"ist kein Bestandteil des Algorithmus\");\r\n//\t\tmulQuestion.addAnswer(\"BruteForce\", 0, \"ist kein Bestandteil des Algorithmus\");\r\n//\t\t\r\n//\t\tlang.addMSQuestion(mulQuestion);\r\n\t\t\r\n\t\tlang.nextStep(\"Einleitung\");\r\n\t\tTrueFalseQuestionModel trueFalseQ1 = new TrueFalseQuestionModel(\"1\", true, 1);\r\n\t\ttrueFalseQ1.setPrompt(\"Exponentialsearch Algorithmus benutzt den Binarysearch Algorithmus.\");\r\n\t\tlang.addTFQuestion(trueFalseQ1);\r\n\t\t\r\n\t\tTrueFalseQuestionModel trueFalseQ2 = new TrueFalseQuestionModel(\"1\", true, 1);\r\n\t\ttrueFalseQ2.setPrompt(\"Das Array muss sortiert sein.\");\r\n\t\tlang.addTFQuestion(trueFalseQ2);\r\n\r\n\t\ttitle_discr.hide();\r\n\t\tdiscription.hide();\r\n\t\t\r\n\t\tText t1 = lang.newText(new Coordinates(20, 80), \"Die zu suchende Zahl:\", \"suchende Zahl\", null);\r\n\t\tText t2 = lang.newText(new Coordinates(20, 100), \"x = \" + x, \"suchende Zahl\", null);\r\n\t\tText t3 = lang.newText(new Coordinates(20, 120), \"Das sortierte Array:\", \"sortierte Array\", null);\r\n\t\tText yellow = lang.newText(new Coordinates(180, 80), \"Gelb: von binären Suche geteilte Array\", \"yellow\", null);\r\n\t\t\r\n\t RectProperties rectProps2 = new RectProperties();\r\n\t rectProps2.set(AnimationPropertiesKeys.FILLED_PROPERTY, true);\r\n\t rectProps2.set(AnimationPropertiesKeys.FILL_PROPERTY, Color.YELLOW);\r\n\t rectProps2.set(AnimationPropertiesKeys.DEPTH_PROPERTY, 2);\r\n\t \r\n\t Rect hRect2 = lang.newRect(new Offset(-1, -1, \"yellow\",\r\n\t AnimalScript.DIRECTION_NW), new Offset(1, 1, \"yellow\", \"SE\"), \"hRect2\",\r\n\t null, rectProps2);\r\n\t\tText red = lang.newText(new Coordinates(180, 100), \"Rot: Element in Array[i]\", \"red\", null);\r\n\t\t\r\n\t RectProperties rectProps3 = new RectProperties();\r\n\t rectProps3.set(AnimationPropertiesKeys.FILLED_PROPERTY, true);\r\n\t rectProps3.set(AnimationPropertiesKeys.FILL_PROPERTY, Color.RED);\r\n\t rectProps3.set(AnimationPropertiesKeys.DEPTH_PROPERTY, 2);\r\n\t \r\n\t Rect hRect3 = lang.newRect(new Offset(-1, -1, \"red\",\r\n\t AnimalScript.DIRECTION_NW), new Offset(1, 1, \"red\", \"SE\"), \"hRect3\",\r\n\t null, rectProps3);\t \r\n\t \r\n\t \r\n\t\t// first, set the visual properties (somewhat similar to CSS)\r\n\t\tArrayProperties arrayProps = new ArrayProperties();\r\n\t\tarrayProps.set(AnimationPropertiesKeys.COLOR_PROPERTY, Color.BLACK);\r\n\t\tarrayProps.set(AnimationPropertiesKeys.FILL_PROPERTY, Color.WHITE);\r\n\t\tarrayProps.set(AnimationPropertiesKeys.FILLED_PROPERTY, Boolean.TRUE);\r\n\t\tarrayProps.set(AnimationPropertiesKeys.ELEMENTCOLOR_PROPERTY, Color.BLACK);\r\n\t\tarrayProps.set(AnimationPropertiesKeys.ELEMHIGHLIGHT_PROPERTY, Color.RED);\r\n\t\tarrayProps.set(AnimationPropertiesKeys.CELLHIGHLIGHT_PROPERTY, Color.YELLOW);\r\n\r\n\t\t// now, create the IntArray object, linked to the properties\r\n\t\tIntArray ia = lang.newIntArray(new Coordinates(20, 140), a, \"intArray\", null, arrayProps);\r\n\r\n\t\t\r\n\t\t\r\n//\t COUNTER\r\n\t String[] name = {\"Zuweisungen\",\"Zugriffe\"};\r\n\t\tTwoValueCounter counter = lang.newCounter(ia); // Zaehler anlegen\r\n\t CounterProperties cp = new CounterProperties(); // Zaehler-Properties anlegen\r\n\t cp.set(AnimationPropertiesKeys.FILLED_PROPERTY, true); // gefuellt...\r\n\t cp.set(AnimationPropertiesKeys.FILL_PROPERTY, Color.BLUE); // ...mit Blau\r\n\t // view anlegen, Parameter:\r\n\t // 1. Counter\r\n\t // 2. linke obere Ecke (kann auch Offset nutzen!)\r\n\t // 3. CounterProperties\r\n\t // 4. Anzeige Zaehlerwert als Zahl?\r\n\t // 5. Anzeige Zaehlerwert als Balken?\r\n\t // Alternativ: nur Angabe Counter, Koordinate und Properties\r\n\t TwoValueView view = lang.newCounterView(counter, new Coordinates(260, 30), cp, true, true, name);\r\n\t\t// start a new step after the array was created\r\n\t \r\n\t\tlang.nextStep(\"Initialisierung\");\r\n\t\t\r\n\r\n\t\t// Create SourceCode: coordinates, name, display options,\r\n\t\t// default properties\r\n\r\n\t\t// first, set the visual properties for the source code\r\n\t\tSourceCodeProperties scProps = new SourceCodeProperties();\r\n\t\tscProps.set(AnimationPropertiesKeys.CONTEXTCOLOR_PROPERTY, Color.BLUE);\r\n\t\tscProps.set(AnimationPropertiesKeys.FONT_PROPERTY, new Font(\"Monospaced\", Font.PLAIN, 12));\r\n\r\n\t\tscProps.set(AnimationPropertiesKeys.HIGHLIGHTCOLOR_PROPERTY, Color.RED);\r\n\t\tscProps.set(AnimationPropertiesKeys.COLOR_PROPERTY, Color.BLACK);\r\n\r\n\t\t// now, create the source code entity\r\n\t\tSourceCode sc = lang.newSourceCode(new Coordinates(40, 180), \"sourceCode\", null, scProps);\r\n\r\n\t\t// Add the lines to the SourceCode object.\r\n\t\t// Line, name, indentation, display dealy\r\n\t\tsc.addCodeLine(\"public int exponentialSearch(int[] arr, int n, int x) {\", null, 0, null); // 0\r\n\t\tsc.addCodeLine(\" \", null, 0, null); // 1\r\n\r\n\t\tsc.addCodeLine(\"if (arr[0] == x) \", null, 1, null); // 2\r\n\t\tsc.addCodeLine(\"return 0;\", null, 2, null); // 3\r\n\t\tsc.addCodeLine(\" \", null, 1, null); // 4\r\n\r\n\t\tsc.addCodeLine(\"int i = 1;\", null, 1, null); // 5\r\n\t\tsc.addCodeLine(\" \", null, 2, null); // 6\r\n\r\n\t\tsc.addCodeLine(\"while (i < n && arr[i] <= x) \", null, 1, null); // 7\r\n\t\tsc.addCodeLine(\"i = i*2;\", null, 2, null); // 8\r\n\t\tsc.addCodeLine(\" \", null, 4, null); // 9\r\n\r\n\t\tsc.addCodeLine(\"return Arrays.binarySearch(arr, i/2, Math.min(i, n), x); \", null, 1, null); // 10\r\n\t\tsc.addCodeLine(\"}\", null, 0, null); // 11\r\n\t\tsc.addCodeLine(\" \", null, 0, null); // 12\r\n\r\n\t\tsc.addCodeLine(\"public int binarySearch(int[] arr, int left, int right, int x) {\", null, 0, null); // 13\r\n\t\tsc.addCodeLine(\" \", null, 2, null); // 14\r\n\t\tsc.addCodeLine(\"if (right >= 1 && left <= right) {\", null, 1, null); // 15\r\n\t\tsc.addCodeLine(\"int mid = (left + right) / 2;\", null, 2, null); // 16\r\n\t\tsc.addCodeLine(\" \", null, 2, null); // 17\r\n\t\tsc.addCodeLine(\"if (arr[mid] == x)\", null, 2, null); // 18\r\n\t\tsc.addCodeLine(\"return mid;\", null, 3, null); // 19\r\n\t\tsc.addCodeLine(\" \", null, 2, null); // 20\r\n\t\tsc.addCodeLine(\"if (arr[mid] > x)\", null, 2, null); // 21\r\n\t\tsc.addCodeLine(\"return binarySearch(arr, left, mid-1, x);\", null, 3, null); // 22\r\n\t\tsc.addCodeLine(\" \", null, 2, null); // 23\r\n\t\tsc.addCodeLine(\"return binarySearch(arr, mid+1, right, x);\", null, 2, null); // 24\r\n\t\tsc.addCodeLine(\"}\", null, 1, null); // 25\r\n\t\tsc.addCodeLine(\"return -1;\", null, 1, null); // 26\r\n\t\tsc.addCodeLine(\"}\", null, 0, null); // 27\r\n\r\n\t\tlang.nextStep();\r\n\t\t// Highlight all cells\r\n\t\tia.highlightCell(0,ia.getLength()-1, null, null);\r\n\t\tint foundIndex = -1;\r\n\t\ttry {\r\n\t\t\t// Start Exp. Search\r\n\t\t\tfoundIndex = exponentialSearch(ia, sc, (ia.getLength() - 1), x);\r\n\t\t} catch (LineNotExistsException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tTextProperties textProp = new TextProperties();\r\n\t\t//textProp.set(AnimationPropertiesKeys.SIZE_PROPERTY, 40);\r\n\t\tText t4 = lang.newText(new Coordinates(400, 80), \"Die Zahl \"+ x + \" befindet sich in Index \" + foundIndex, \"Ende\", null, textProp);\r\n\t\tlang.nextStep();\r\n\t\tt1.hide();\r\n\t\tt2.hide();\r\n\t\tt3.hide();\r\n\t\tt4.hide();\r\n\t\tsc.hide();\r\n\t\tia.hide();\r\n\t\tyellow.hide();\r\n\t\tred.hide();\r\n\t\thRect2.hide();\r\n\t\thRect3.hide();\r\n\t\t\r\n\t\tText t5 = lang.newText(new Coordinates(20, 80), \"Zusammenfassung\", \"zusammenfassung\", null);\r\n\t\tSourceCode zsmf = lang.newSourceCode(new Coordinates(20, 110), \"zsmf\", null, scProps);\r\n\t\tzsmf.addCodeLine(\"1. Exponentielle Suche ist nützlich für die unbegrenzte Suche, wo die Größe vom Array gegen unendlich geht.\", null, 0, null);\r\n\t\tzsmf.addCodeLine(\"2. Die Performenz ist besser als die der en Suche für endlich große Arrays.\", null, 0, null);\r\n\t\t\r\n\t\tSourceCode zsmf2 = lang.newSourceCode(new Coordinates(20, 150), \"zsmf2\", null, scProps);\r\n\t\tzsmf2.addCodeLine(\"Komplexität in Abhängigkeit der Zeit:\", null, 0, null);\r\n\t\tzsmf2.addCodeLine(\"Worst-case - O(log i) + O(log i) = 2 O(log i)\", null, 1, null);\r\n\t\tzsmf2.addCodeLine(\"Best-case - O(1)\", null, 1, null);\r\n\t\tzsmf2.addCodeLine(\"Average-case - O(log i) + O(log i) = 2 O(log i)\", null, 1, null);\r\n\t\tzsmf2.addCodeLine(\"Hinweis: i steht für den Index des gesuchten Elements.\", null, 1, null);\r\n\t\tzsmf2.addCodeLine(\"Es werden jeweils die Komplexität des ersten und des zweiten Algorithmus zusammenaddiert\", null, 2, null);\r\n\t\tzsmf2.addCodeLine(\"Die Komplexität für den exponentiellen Teil ist log(i).\", null, 2, null);\r\n\t\tzsmf2.addCodeLine(\"Die Komplexität für den en Teil ist aufgrund der Begrenzung nicht mehr log(n), sondern log(i), da log(2^(log(i)-1)) = log(i)-1 = O(log(i))\", null, 2, null);\r\n\r\n\r\n\t\tTrueFalseQuestionModel trueFalseQ3 = new TrueFalseQuestionModel(\"3\", false, 1);\r\n\t\ttrueFalseQ3.setPrompt(\"Das Array darf keine doppelten Elemente enthalten\");\r\n\t\tlang.addTFQuestion(trueFalseQ3);\r\n\r\n\t\tlang.nextStep(\"Fazit\");\r\n\t\tlang.finalizeGeneration();\r\n\t}", "public void execFuzzySearchVariationFunc(){\n\n\n Map map = new HashMap();\n\n if(this.searchParam != null && this.searchParam.length()> 0 ){\n System.out.println(this.searchParam );\n if(this.searchParam.contains(\":\")==true || this.searchParam.startsWith(\"chr\") == true) {\n String chrom = \"\";\n int pstart = -1;\n int pend = -1;\n if (this.searchParam.indexOf(\":\") > -1) {\n int idex = this.searchParam.indexOf(\":\");\n chrom = this.searchParam.substring(0, idex );\n System.out.println(\"chrom=\" + chrom);\n map.put(\"chrom\", chrom);\n if (this.searchParam.indexOf(\"-\") > -1) {\n int idex1 = this.searchParam.indexOf(\"-\");\n pstart = Integer.parseInt(this.searchParam.substring(idex + 1, idex1 ));\n pend = Integer.parseInt(this.searchParam.substring(idex1 + 1, this.searchParam.length()));\n map.put(\"startpos\", pstart);\n map.put(\"endpos\", pend);\n } else {\n pstart = Integer.parseInt(this.searchParam.substring(idex + 1, this.searchParam.length()));\n map.put(\"startpos\", pstart);\n }\n\n } else if (this.searchParam.startsWith(\"chr\") == true) {\n map.put(\"chrom\", this.searchParam);\n }\n }\n\n map.put(\"searchParam\",this.searchParam);\n }\n\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"null\") ==false && this.searchSpecies.equals(\"all\") == false){\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"species\",this.searchSpecies);\n }\n\n if(this.searchTrait != null&& this.searchTrait.equals(\"null\") ==false && this.searchTrait.length()>0){\n\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"searchTrait\", this.searchTrait) ;\n }\n\n if(this.pvalue != null&& this.pvalue.equals(\"null\") ==false && this.pvalue.length()>0){\n\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"psitu\", this.psitu);\n map.put(\"pval\", this.pvalue) ;\n }\n\n\n //here, parse search param and get genotype information\n genotypeBeanList = (List<GenotypeBean>) baseService.findResultList(\"cn.big.gvk.dm.Genotype.selectGenotypeByPos\",map);\n if(genotypeBeanList != null && genotypeBeanList.size() > 0 ){\n for(GenotypeBean tbean :genotypeBeanList ){\n List genotypelist = new ArrayList();\n genotypelist.add(tbean.getGenotypeId()) ;\n\n Map t = new HashMap();\n t.put(\"genotypelist\",genotypelist);\n List<GenotypeAnnotateGeneView> annotateview = baseService.findResultList(\"cn.big.gvk.dm.Genotype.selectGenotypeByList\",t);\n if(annotateview != null && annotateview.size()>0 ){\n //here we need to filter the result\n Map filtermap = new HashMap();\n for(GenotypeAnnotateGeneView tview : annotateview){\n String fkey = tview.getMapGeneId()+\"_\"+tview.getConseqtype();\n if(filtermap.containsKey(fkey) == false){\n filtermap.put(fkey,tview);\n }\n }\n\n if(filtermap.size()>0){\n List<GenotypeAnnotateGeneView> alist = new ArrayList<GenotypeAnnotateGeneView>();\n Iterator it = filtermap.entrySet().iterator();\n while(it.hasNext()){\n Map.Entry entry = (Map.Entry) it.next();\n GenotypeAnnotateGeneView val = (GenotypeAnnotateGeneView) entry.getValue();\n alist.add(val);\n }\n\n tbean.setGenotypeAnnotateGeneView(alist);\n }\n\n\n }\n\n //find association count\n GwasAssociationBean gwas = (GwasAssociationBean) baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectAssociationCountByGenotypeid\",tbean.getGenotypeId());\n if(gwas != null){\n tbean.setTraitCount(gwas.getGwasCount());\n }\n\n //find studycount\n Map cmap = new HashMap();\n cmap.put(\"genotypeId\",tbean.getGenotypeId());\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"all\") == false){\n cmap.put(\"species\",this.searchSpecies);\n }\n\n\n GwasAssociationBean tg_bean1 = (GwasAssociationBean)baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectStudyCountByGenotypeid\",cmap);\n if(tg_bean1 != null ){\n tbean.setStudyCount(tg_bean1.getGwasCount());\n }\n\n }\n\n\n\n }\n\n StringBuffer sb = new StringBuffer() ;\n\n if(genotypeBeanList != null && genotypeBeanList.size()>0){\n for(GenotypeBean genotype: genotypeBeanList){\n sb.append(genotype.getVarId()).append(\"\\t\").append(genotype.getChrom()).append(\":\")\n .append(genotype.getStartPos()).append(\"\\t\").append(genotype.getTraitCount())\n .append(\"\\t\").append(genotype.getStudyCount()).append(\"\\n\");\n }\n }\n\n if(format == 1 ){ //export txt\n this.response.reset();\n this.response.setHeader(\"Content-Disposition\",\n \"attachment;filename=export.txt\");\n this.response.setContentType(\"application/ms-txt\");\n try {\n PrintWriter pr = this.response.getWriter();\n pr.print(sb.toString());\n pr.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n }", "SearchResult search(State root, List<State> expanded_list, State goal);", "public interface Searcher {\r\n\t\r\n\t/**\r\n\t * Performs a search.\r\n\t * \r\n\t * @param searchComp reference to the text search component\r\n\t * @param forward tells if search is to be performed forward\r\n\t * @param searchLastMatch tells if last search match must be searched/included\r\n\t */\r\n\tvoid performSearch( TextSearchComp searchComp, boolean forward, boolean searchLastMatch );\r\n\t\r\n}", "Boolean getSearchObjective();", "public interface IRealTimeSearchAlgorithm {\n\n /**\n * This function will calculate a prefix from the start node to the goal node path\n * @param start - The start node\n * @param goal - The goal node\n * @param numOfNodesToDevelop - The number of nodes to develop in the search\n * @param agent - The agent\n * @return - A prefix from the start node to the goal node path\n */\n public List<Node> calculatePrefix(Node start, Node goal, int numOfNodesToDevelop, Agent agent);\n}", "public List<OWLObject> search(OWLObject queryObj) {\n\t\tList<OWLObject> hits = new ArrayList<OWLObject>(maxHits);\n\t\tSystem.out.println(\"gettings atts for \"+queryObj+\" -- \"+simEngine.comparisonProperty);\n\t\tSet<OWLObject> atts = simEngine.getAttributeClosureFor(queryObj);\n\t\tSystem.out.println(\"all atts: \"+atts.size());\n\t\tif (atts.size() == 0)\n\t\t\treturn hits;\n\t\t\n\t\t// only compare using significant atts;\n\t\t// we don't do the same test on candidates as these will be removed by the\n\t\t// intersection operation. they will have a small effect on the score, as\n\t\t// we don't divide by the union, but instead the sum of sizes\n\t\tatts = filterNonSignificantAttributes(atts);\n\t\tSystem.out.println(\"filtered atts: \"+atts.size());\n\n\t\t//bloomFilter = new BloomFilter<OWLObject>(0.05, atts.size());\n\t\t//bloomFilter.addAll(atts);\n\t\t\t\t\n\t\tSortedMap<Integer,Set<OWLObject>> scoreCandidateMap = new TreeMap<Integer,Set<OWLObject>>();\n\t\t\n\t\tfor (OWLObject candidate : getCandidates()) {\n\t\t\tif (candidate.equals(queryObj))\n\t\t\t\tcontinue;\n\t\t\tSet<OWLObject> iAtts = simEngine.getAttributeClosureFor(candidate);\n\t\t\t//Set<OWLObject> iAtts = simEngine.getGraph().getAncestors(candidate);\n\n\t\t\tif (iAtts.size() == 0)\n\t\t\t\tcontinue;\n\t\t\tint cAttsSize = iAtts.size();\n\t\n\t\t\tiAtts.retainAll(atts);\n\t\t\t//Collection<OWLObject> iAtts = bloomFilter.intersection(cAtts);\n\t\t\t\n\t\t\t// simJ, one-sided, scaled by 1000\n\t\t\t// negate to ensure largest first\n\t\t\t//Integer score = - (iAtts.size() * 1000 / cAttsSize);\n\t\t\t\n\t\t\t// this biases us towards genes with large numbers of annotations,\n\t\t\t// but it is better at finding the models that share all features\n\t\t\tInteger score = - iAtts.size();\n\t\t\tif (!scoreCandidateMap.containsKey(score)) \n\t\t\t\tscoreCandidateMap.put(score, new HashSet<OWLObject>());\n\t\t\tscoreCandidateMap.get(score).add(candidate);\n\t\t\treporter.report(this,\"query_candidate_overlap_total\",queryObj,candidate,iAtts.size(),cAttsSize);\n\t\t}\n\t\t\n\t\tint n = 0;\n\t\tfor (Set<OWLObject> cs : scoreCandidateMap.values()) {\n\t\t\tn += cs.size();\n\t\t\thits.addAll(cs);\n\t\t}\n\t\t\n\t\tn = 0;\n\t\tfor (OWLObject hit : hits) {\n\t\t\tn++;\n\t\t\treporter.report(this,\"query_hit_rank_threshold\",queryObj,hit,n,maxHits);\n\t\t}\n\t\tif (hits.size() > maxHits)\n\t\t\thits = hits.subList(0, maxHits);\n\t\t\n\n\n\t\treturn hits;\n\t}", "void search();", "void search();", "SearchResult getBestResult(List<SearchResult> results, SearchQuery query);", "private void CreatingBeautyContent(int count,int typeSymmetry, int methodSearch) {\n\t\t\tConstraintsPlacement objConstraints= new ConstraintsPlacement(this);\r\n\t\t\t//Creating array with states\r\n\t\t\tArrayList<BlockNode> states = new ArrayList<BlockNode>();\r\n\t\t\t//Building the graph in a deph way\r\n\t \tGraphBuilder objGrapB= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB2= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB3= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB3a= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB4= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB5= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB6= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB7= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB8= new GraphBuilder(1);\r\n\t \t\r\n\t \tobjGrapB.setWparamether(wParamether);\r\n\t \tobjGrapB2.setWparamether(wParamether);\r\n\t \tobjGrapB3.setWparamether(wParamether);\r\n\t \tobjGrapB3a.setWparamether(wParamether);\r\n\t \tobjGrapB4.setWparamether(wParamether);\r\n\t \tobjGrapB5.setWparamether(wParamether);\r\n\t \tobjGrapB6.setWparamether(wParamether);\r\n\t \tobjGrapB7.setWparamether(wParamether);\r\n\t \tobjGrapB8.setWparamether(wParamether);\r\n\t \t\r\n\t \tint numElements=objElem.getNumberObjects();\r\n\t \tint numEnemies=objElem.getNumberObjectsEnemies();\r\n\t \tint globalControlSearch=0;\r\n\t \t\r\n\t \tdouble time6=0;\r\n\t \tdouble time7=0;\r\n\t \tdouble time3=0;\r\n\t \tdouble time4=0;\r\n\t \tdouble time5=0;\r\n\t \tdouble time8=0;\r\n\t \t\r\n\t \tdouble startTime=0;\r\n\t \tdouble stopTime=0;\r\n\t \t\r\n\t \tdouble sum3=0;\r\n\t \tdouble sum4=0;\r\n\t \tdouble sum5=0;\r\n\t \tdouble sum6=0;\r\n\t \tdouble sum7=0;\r\n\t \tdouble sum8=0;\r\n\r\n\t \t\r\n\t \t//Beststates=objGrapB.basicDepthSearch(mediumStraight,height,numElements,numElements,states,objConstraints, objElem.getFinalList(),objElem);\r\n\t \t//Beststates=objGrapB.relativePositionDepthSearch(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,-mediumStraight+2,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch);\r\n\t \t//Beststates=objGrapB.relativeTransPositionDepthSearch(mediumStraight,height,numElements,numElements,states,objConstraints, objElem.getFinalList(),objElem,-mediumStraight+1,mediumStraight-1,floorTileHeight,0,0,currentState,hTable);\r\n\t \t//Beststates=objGrapB.DepthSearchCenterFrame(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,1,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch);\r\n\t \t//Beststates=objGrapB.DepthSearchPruningAlt(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,1,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch);\r\n\t \t\r\n\t \r\n\r\n\t \r\n\t //3.3) Brute-force search\r\n\t //objElem.setFinalList(objElem.getFinalListNoOrder());\r\n\t \tfor(int i=0;i<1;i++)\r\n\t \t{\r\n\t \t\tstartTime = System.currentTimeMillis();\r\n\t \t\tBeststates3=objGrapB3.DepthSearchCenterFrameNoPruningNoRegionsNoObjects(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,0,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch,8,typeSymmetry);\r\n\t \t\tstopTime = System.currentTimeMillis();\r\n\t \t\ttime3 = stopTime - startTime;\r\n//\t \t\tround(time3,2);\r\n//\t \t\tdouble nodes3=round((double)objGrapB3.getCounterIDs(),2);\r\n//\t \t\tSystem.out.println(objGrapB3.bestSymmetryV+\" \"+time3+\" \"+((objGrapB3.getCounterIDs())));\r\n\t \t\tsum3=sum3+time3;\r\n\t \t}\r\n\t \ttime3=sum3/1;\r\n\t \ttime3=round(time3,2);\r\n\t //System.out.println(\"Time Brute-force search \"+elapsedTime);\r\n\t \t\r\n\t \r\n\t \r\n\t //3.7) B&B+heuristic\r\n\t //objElem.setFinalList(objElem.getFinalListNoOrder());\r\n\t \tfor(int i=0;i<1;i++)\r\n\t \t{\r\n\t \t\tstartTime = System.currentTimeMillis();\r\n\t \t\tBeststates7=objGrapB7.depthSearchBBHeuristic(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,0,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch,8,typeSymmetry);\r\n\t \t\tstopTime = System.currentTimeMillis();\r\n\t \t\ttime7 = stopTime - startTime;\r\n//\t \t\tround(time7,2);\r\n//\t \t\tdouble nodes7=round((double)objGrapB3.getCounterIDs(),2);\r\n//\t \t\tSystem.out.println(objGrapB6.bestSymmetryV+\" \"+time6+\" \"+((objGrapB6.getCounterIDs())));\r\n\t \t\tsum7=sum7+time7;\r\n\t \t}\r\n\t \ttime7=sum7/1;\r\n\t \ttime7=round(time7,2);\r\n\t //System.out.println(\"Time B&B+heuristic + region ordering \"+elapsedTime);\r\n\t \t\r\n\t \t\r\n\t \t\r\n//\t \tif(objGrapB3.bestSymmetryV<objGrapB5.bestSymmetryV)\r\n//\t \t{\r\n//\t \t\tdouble bestSYmmetry=objGrapB3.bestSymmetryV;\r\n//\t \t\t//System.out.println(\"bestSym \"+bestSYmmetry);\r\n//\t \t\tBestGlobalstates=Beststates3;\r\n//\t \t\t\r\n//\t \t}\r\n//\t \telse\r\n//\t \t{\r\n//\t \t\tdouble bestSYmmetry=objGrapB5.bestSymmetryV;\r\n//\t \t\t//System.out.println(\"bestSym \"+bestSYmmetry);\r\n//\t \t\tBestGlobalstates=Beststates5;\r\n//\t \t}\r\n\t \t\r\n\t \tBestGlobalstates=Beststates7;\r\n\t \r\n\t \r\n\t \t//**System.out.println(\"Simetry 0-> Brute-force search order \"+objGrapB3a.bestSymmetryV);\t\r\n\t \t//System.out.println(\"Simetry 1-> Brute-force search \"+objGrapB3.bestSymmetryV);\t \t\r\n\t \t//System.out.println(\"Simetry 2-> B&B+oldheuristic \"+objGrapB4.bestSymmetryV);\r\n\t \t//**System.out.println(\"Simetry 3-> B&B+heuristic + object ordering \"+objGrapB2.bestSymmetryV);\t \t\r\n\t \t//System.out.println(\"Simetry 4-> B&B+ region + leviheuristic\"+objGrapB5.bestSymmetryV);\r\n\t \t//**System.out.println(\"Simetry 5-> B&B+heuristic + region ordering + object ordering \"+objGrapB.bestSymmetryV);\r\n\t \t//System.out.println(\"Simetry 6-> B&B+heuristic + leviheuristic \"+objGrapB6.bestSymmetryV);\r\n\t \t//System.out.println(\"Simetry 7-> B&B+oldoldheuristic \"+objGrapB7.bestSymmetryV);\r\n\t \t\r\n\t \t//**System.out.println( \"States 0 \"+objGrapB3a.getCounterIDs() );\r\n\t \t//System.out.println( \"States 1 \"+objGrapB3.getCounterIDs() );\r\n\t \t//System.out.println( \"States 2 \"+objGrapB4.getCounterIDs() );\r\n\t \t//**System.out.println( \"States 3 \"+objGrapB2.getCounterIDs() );\t \t\t \t\r\n\t \t//System.out.println( \"States 4 \"+objGrapB5.getCounterIDs() );\r\n\t \t//**System.out.println( \"States 5 \"+objGrapB.getCounterIDs() );\r\n\t \t//System.out.println( \"States 6 \"+objGrapB6.getCounterIDs() );\r\n\t \t//System.out.println( \"States 7 \"+objGrapB7.getCounterIDs() );\r\n\t \t\r\n\t \tdouble TimeRate7=time3/time7;\r\n\t \tdouble TimeRate6=time3/time6;\r\n\t \tdouble TimeRate5=time3/time5;\r\n\t \t\r\n\t \tTimeRate7=round(TimeRate7,2);\r\n\t \tTimeRate6=round(TimeRate6,2);\r\n\t \tTimeRate5=round(TimeRate5,2);\r\n\t \t\r\n\t \tdouble NodesRate7=(double)objGrapB3.getCounterIDs()/(double)objGrapB7.getCounterIDs();\r\n\t \tdouble NodesRate6=(double)objGrapB3.getCounterIDs()/(double)objGrapB6.getCounterIDs();\r\n\t \tdouble NodesRate5=(double)objGrapB3.getCounterIDs()/(double)objGrapB5.getCounterIDs();\r\n\t \t\r\n\t \tNodesRate7=round(NodesRate7,2);\r\n\t \tNodesRate6=round(NodesRate6,2);\r\n\t \tNodesRate5=round(NodesRate5,2);\r\n\r\n\t \t\r\n\t \t\r\n\r\n\t //imprimiendo los estados visitados\r\n\t /*\r\n\t Iterator<BlockNode> nombreIterator = states.iterator();\r\n\t while(nombreIterator.hasNext()){\r\n\t \tBlockNode elemento = nombreIterator.next();\r\n\t \tSystem.out.print(elemento.getID()+\" / \");\r\n\t }*/\r\n\t \r\n\t //here we are painting as the best branch founded\r\n\t \r\n\t //System.out.println(\"nene \"+BestGlobalstates.size());\r\n\t Iterator<BlockNode> nombreIterator = BestGlobalstates.iterator();\r\n\t while(nombreIterator.hasNext()){\r\n\t \tBlockNode elemento = nombreIterator.next();\r\n\t \t//System.out.print(elemento.getID()+\"(\"+elemento.getX()+\" \"+elemento.getY()+\" ) - \"+elemento.getType()+\" \"+elemento.getIdElement()+ \" / \");\r\n\t }\r\n\t \r\n\t \r\n\t //Here we will put the elements on the tile\r\n\t try {\r\n\t Level levelScreen=PaintElements(BestGlobalstates,this);\r\n\t Screen objScreen=new Screen();\r\n\t\t\tobjScreen.SaveScreen(levelScreen,odds,objElem);\r\n \t\tInformacoesTelas info = new InformacoesTelas();\r\n\t CopiaArquivos copiador = new CopiaArquivos();\r\n\t \r\n\t info = info.carregaInfoTela(\"infoTela\");\r\n\t\t\tinfo.setOutrasVariaveis(0, 0); // Salva outras informacoes da Tela\r\n\t\t\tinfo.salvaInfoTela(\"infoTela\", info);\t\t\t\t\t\r\n\t\t\tcopiador.copy(\"\" + count, \"Screens/\");\r\n\t\t\t\r\n\t } catch (ClassNotFoundException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}", "Match createMatch();", "public interface SearchService {\n\n /**\n * Parameter that is appended to the generated links that contains the positive search terms and phrases of the\n * search expression. For several terms it occurs several times.\n */\n String PARAMETER_SEARCHTERM = \"search.term\";\n\n /**\n * Represents a result of the search consisting of a target page and one or more matching subresources. For use by\n * the search result renderer.\n */\n interface Result {\n\n /** The page which contains matches. */\n @NotNull\n Resource getTarget();\n\n /** The content child of the page which contains matches. */\n @NotNull\n Resource getTargetContent();\n\n /** A link that shows the target, including search terms with {@link #PARAMETER_SEARCHTERM} */\n @NotNull\n String getTargetUrl();\n\n /** The title of the search result. */\n @NotNull\n String getTitle();\n\n /** The score of the search result. */\n Float getScore();\n\n /**\n * One or more descendants of {@link #getTarget()} that potentially match the search expression. Mostly useful\n * for generating excerpts; can contain false positives in some search algorithms.\n */\n @NotNull\n List<Resource> getMatches();\n\n /** The fulltext search expression for which this result was found. */\n @NotNull\n String getSearchExpression();\n\n /**\n * A basic excerpt from the matches that demonstrates the occurrences of the terms from {@link\n * #getSearchExpression()} in this result. Might be empty if not applicable (e.g. if the search terms were found\n * in meta information). If there are several matches, we just give one excerpt. You might want to provide your\n * own implementation for that to accommodate for specific requirements.\n *\n * @return a text with the occurrences of the words marked with HTML tag em .\n */\n @NotNull\n String getExcerpt() throws SearchTermParseException;\n }\n\n /**\n * Fulltext search for resources. The resources are grouped if they are subresources of one target page, as\n * determined by the parameter targetResourceFilter.\n * <p>\n * Limitations: if the searchExpression consists of several search terms (implicitly combined with AND) this finds\n * only resources where a single property matches the whole search condition, i.e., all those terms. If several\n * resources of a page contain different subsets of those terms, the page is not found.\n *\n * @param context The context we use for the search.\n * @param selectors a selector string to determine the right search strategy, e.g. 'page'\n * @param root Optional parameter for the node below which we search.\n * @param searchExpression Mandatory parameter for the fulltext search expression to search for. For the syntax\n * see\n * {@link QueryConditionDsl.QueryConditionBuilder#contains(String)}\n * . It is advisable to avoid using AND and OR.\n * @param searchFilter an optional filter to drop resources to ignore.\n * @return possibly empty list of results\n * @see com.composum.sling.core.mapping.jcr.ResourceFilterMapping\n */\n @NotNull\n List<Result> search(@NotNull BeanContext context, @NotNull String selectors,\n @NotNull String root, @NotNull String searchExpression, @Nullable ResourceFilter searchFilter,\n int offset, @Nullable Integer limit)\n throws RepositoryException, SearchTermParseException;\n\n\n interface LimitedQuery {\n\n /**\n * Executes the query with the given limit; returns a pair of a boolean that is true when we are sure that all\n * results have been found in spite of the limit, and the results themselves.\n */\n Pair<Boolean, List<Result>> execQuery(int matchLimit);\n }\n\n /**\n * Execute the query with raising limit until the required number of results is met. We don't know in advance how\n * large we have to set the limit in the query to get all neccesary results, since each page can have an a priori\n * unknown number of matches. Thus, the query is executed with an estimated limit, and is reexecuted with tripled\n * limit if the number of results is not sufficient and there are more limits.\n *\n * @return up to limit elements of the result list with the offset first elements skipped.\n */\n @NotNull\n List<Result> executeQueryWithRaisingLimits(LimitedQuery limitedQuery, int offset, Integer limit);\n}", "public void testAStarSearch() {\n\t\ttry {\r\n\t\t\t// EightPuzzleBoard extreme = new EightPuzzleBoard(new int[]\r\n\t\t\t// {2,0,5,6,4,8,3,7,1});\r\n\t\t\t// EightPuzzleBoard extreme = new EightPuzzleBoard(new int[]\r\n\t\t\t// {0,8,7,6,5,4,3,2,1});\r\n\t\t\tEightPuzzleBoard board = new EightPuzzleBoard(new int[] { 7, 1, 8,\r\n\t\t\t\t\t0, 4, 6, 2, 3, 5 });\r\n\r\n\t\t\tProblem problem = new Problem(board,\r\n\t\t\t\t\tnew EightPuzzleSuccessorFunction(),\r\n\t\t\t\t\tnew EightPuzzleGoalTest(), new ManhattanHeuristicFunction());\r\n\t\t\tSearch search = new AStarSearch(new GraphSearch());\r\n\t\t\tSearchAgent agent = new SearchAgent(problem, search);\r\n\t\t\tassertEquals(23, agent.getActions().size());\r\n\t\t\tassertEquals(\"906\", agent.getInstrumentation().getProperty(\r\n\t\t\t\t\t\"nodesExpanded\"));\r\n\t\t\tassertEquals(\"914\", agent.getInstrumentation().getProperty(\r\n\t\t\t\t\t\"queueSize\"));\r\n\t\t\tassertEquals(\"920\", agent.getInstrumentation().getProperty(\r\n\t\t\t\t\t\"maxQueueSize\"));\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "private ExtList makeGraph(ExtList criteria, Object process, ExtList tuples, int aeth, ExtList result) {\n//\t\tSystem.out.println(\"propa\"+System.getProperty(\"java.library.path\"));\n\t\tLog.out(\"criteria \" + criteria);\n\t\tLog.out(\"process \" + process);\n\t\tLog.out(\"tuples \" + tuples);\n\t\tLog.out(\"aeth \" + aeth);\n\t\tLog.out(\"result \" + result);\n\t\t\n\t\tExtList buffer = new ExtList();\n\t\tExtList tuples_buffer = new ExtList();\n\t\tExtList tmp = new ExtList();\n\n\t\tExtList x;\n\t\tExtList y;\n\t\tboolean flag = true;\n\n\t\tString target_x;\n\t\tString target_y;\n\t\tString aeth_type = \"\";\n\n\n\n\t\tRengine engine;\n\n\t\tresult.clear();\n\n\t\tif (!Preprocessor.isR()) {\n\t\t\tengine = new Rengine(new String[]{\"--vanilla\"}, false, null);\n\t\t\tnew Preprocessor().setR();\n\n\t\t} else {\n\t\t\tengine = Rengine.getMainEngine();\n\t\t}\n\t\tengine.eval(\"setwd(\\\"\" + GlobalEnv.getOutputDirPath() + \"\\\")\");\n//\t\tengine.eval(\".libPaths(\\\"\" + path + \"/lib/site-library\\\")\");\n//\t\tengine.eval(\".libPaths(\\\"/Users/otawa/Documents/workspace/NewSSQL/lib/site-library\\\")\");\n//\t\tengine.eval(\".libPaths(\\\"/usr/local/lib/R/4.0/site-library\\\")\");\t\t\t//TODO_old -> おそらく無しでOK\n\t\tengine.eval(\"library(tidyverse)\");\n\t\tengine.eval(\"library(plotly)\");\n\t\tengine.eval(\"Sys.setlocale(\\\"LC_CTYPE\\\", \\\"ja_JP.UTF-8\\\")\");\n\n\t\ttarget_x = process.toString().split(\" \")[0];\n\t\ttarget_y = process.toString().split(\" \")[1];\n\t\tLog.info(\"process: \" + process.toString());\n\t\twhile (tuples.size() > 0) {\n\n\t\t\t/* find tuples with the same criteria */\n\n\t\t\tx = (ExtList)(tuples.get(0));\n\t\t\t//System.out.println(x+\" \"+x.size()+\" \"+tuples.size());\n//\t\t\tif (x.size()<2) {\n//\t\t\t\tbreak;\n//\t\t\t}\n\t\t\tfor (int i = 1; i < tuples.size(); i++) {\n\t\t\t\ty = (ExtList)(tuples.get(i));\n\t\t\t\t//Log.out(\"criteria: \" + criteria);\n\t\t\t\t//Log.out(\"criteria_size: \" + criteria.size());\n\t\t\t\t//Log.out(\"break x: \" + x + \" size: \" + x.size() + \" tuples.size\" + tuples.size());\n\t\t\t\t//Log.out(\"break y: \" + y + \" size: \" + y.size() + \" tuples.size\" + tuples.size());\n\t\t\t\t\n\t\t\t\tfor (int k = 0; k < criteria.size(); k++) {\n\t\t\t\t\t\n\t\t\t\t\tif (!(x.get(Integer.parseInt(criteria.get(k).toString())).equals\n\t\t\t\t\t (y.get(Integer.parseInt(criteria.get(k).toString()))))) {\n\t\t\t\t\t\tflag = false;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif (flag) {\n\t\t\t\t\tbuffer.add(y);\n\t\t\t\t\ttuples.remove(i--);\n\t\t\t\t} else {\n\t\t\t\t\tflag = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbuffer.add(x);\n//\t\t\tSystem.out.println(\"buffer:\"+buffer);\n\t\t\ttuples.remove(0);\n\n\n\t\t\tList<String> buffer_x = new ArrayList<String>();\n\t\t\tList<String> buffer_y = new ArrayList<String>();\n\t\t\tList<String> buffer_aeth = new ArrayList<String>();\n\n\t\t\tfor (int i = 0; i < buffer.size(); i++) {\n\t\t\t\t//Log.out(\"2.break i: \" + i + \" target_x: \" + target_x);\n\t\t\t\t//Log.out(\"2.break i: \" + i + \" target_y: \" + target_y);\n\t\t\t\t//Log.out(\"2.break size of buffer \" + buffer.size());\n\t\t\t\tbuffer_x.add(buffer.getExtListString(i, Integer.parseInt(target_x)));\n\t\t\t\tbuffer_y.add(buffer.getExtListString(i, Integer.parseInt(target_y)));\n\t\t\t\tif (aeth > 0)\n\t\t\t\t\tbuffer_aeth.add(buffer.getExtListString(i, aeth));\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tint result_x[] = new int[buffer_x.size()];\n\t\t\t\tfor (int i = 0; i < buffer_x.size(); i++) {\n\t\t\t\t\tresult_x[i] = Integer.parseInt(buffer_x.get(i));\n\t\t\t\t\tLog.out(\"result_x(int): \" + result_x);\n\t\t\t\t}\n\t\t\t\tengine.assign(\"result_x\", result_x);\n\t\t\t} catch(NumberFormatException e) {\n\t\t\t\ttry {\n\t\t\t\t\tdouble result_x[] = new double[buffer_x.size()];\n\t\t\t\t\tfor (int i = 0; i < buffer_x.size(); i++) {\n\t\t\t\t\t\tresult_x[i] = Double.parseDouble(buffer_x.get(i));\n\t\t\t\t\t\tLog.out(\"result_x(double): \" + result_x);\n\t\t\t\t\t}\n\t\t\t\t\tengine.assign(\"result_x\", result_x);\n\t\t\t\t} catch (NumberFormatException e1) {\n\t\t\t\t\tString result_x[] = new String[buffer_x.size()];\n\t\t\t\t\t\n\t\t\t\t\tfor (int i = 0; i < buffer_x.size(); i++) {\n\t\t\t\t\t\tresult_x[i] = buffer_x.get(i);\n\t\t\t\t\t}\n\t\t\t\t\t//Log.out(\"result_x(string): \" + Arrays.toString(result_x));\n\t\t\t\t\t//added by li to check date\n\t\t\t\t\ttry {\n\t\t\t\t\t\tSimpleDateFormat sdFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\t\t\t\t\tfor (int i = 0; i < buffer_x.size(); i++) {\n\t\t\t\t\t\t\tresult_x[i] = buffer_x.get(i);\n\t\t\t\t\t\t\tDate date = sdFormat.parse(result_x[i]);\n\t\t\t\t\t\t\tLog.out(\"Is Date :\" + date);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tengine.assign(\"result_x\", result_x);\n\t\t\t\t\t\t//added by li\n\t\t\t\t\t\tengine.eval(\"result_x <- as.Date(result_x)\");\n\t\t\t\t\t} catch(ParseException e2) {\n\t\t\t\t\t\t//Log.out(\"Result_x is not a date.\");\n\t\t\t\t\t\tengine.assign(\"result_x\", result_x);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tint result_y[] = new int[buffer_y.size()];\n\t\t\t\tfor (int i = 0; i < buffer_y.size(); i++) {\n\t\t\t\t\tresult_y[i] = Integer.parseInt(buffer_y.get(i));\n\t\t\t\t}\n\t\t\t\tengine.assign(\"result_y\", result_y);\n\t\t\t\t//Log.out(\"result_y: \" + result_y);\n\t\t\t} catch(NumberFormatException e) {\n\t\t\t\ttry {\n\t\t\t\t\tdouble result_y[] = new double[buffer_y.size()];\n\t\t\t\t\tfor (int i = 0; i < buffer_y.size(); i++) {\n\t\t\t\t\t\tresult_y[i] = Double.parseDouble(buffer_y.get(i));\n\t\t\t\t\t}\n\t\t\t\t\tengine.assign(\"result_y\", result_y);\n\t\t\t\t\t\n\t\t\t\t} catch (NumberFormatException e1) {\n\t\t\t\t\tString result_y[] = new String[buffer_y.size()];\n\t\t\t\t\tfor (int i = 0; i < buffer_y.size(); i++) {\n\t\t\t\t\t\tresult_y[i] = buffer_y.get(i);\n\t\t\t\t\t}\n\t\t\t\t\t//added by li to check date\n\t\t\t\t\ttry {\n\t\t\t\t\t\tSimpleDateFormat sdFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\t\t\t\t\tfor (int i = 0; i < buffer_x.size(); i++) {\n\t\t\t\t\t\t\tresult_y[i] = buffer_x.get(i);\n\t\t\t\t\t\t\tDate date = sdFormat.parse(result_y[i]);\n\t\t\t\t\t\t\tLog.out(\"Is Date :\" + date);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tengine.assign(\"result_y\", result_y);\n\t\t\t\t\t\t//added by li\n\t\t\t\t\t\tengine.eval(\"result_y <- as.Date(result_y)\");\n\t\t\t\t\t} catch(ParseException e2) {\n\t\t\t\t\t\tLog.out(\"Error!Result_y is not a date.\");\n\t\t\t\t\t\tengine.assign(\"result_y\", result_y);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (aeth > 0) {\n\t\t\t\ttry {\n\t\t\t\t\tint result_aeth[] = new int[buffer_aeth.size()];\n\t\t\t\t\tfor (int i = 0; i < buffer_aeth.size(); i++) {\n\t\t\t\t\t\tresult_aeth[i] = Integer.parseInt(buffer_aeth.get(i));\n\t\t\t\t\t}\n\t\t\t\t\tengine.assign(\"result_aeth\", result_aeth);\n\t\t\t\t} catch(NumberFormatException e) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tdouble result_aeth[] = new double[buffer_aeth.size()];\n\t\t\t\t\t\tfor (int i = 0; i < buffer_aeth.size(); i++) {\n\t\t\t\t\t\t\tresult_aeth[i] = Double.parseDouble(buffer_aeth.get(i));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tengine.assign(\"result_aeth\", result_aeth);\n\t\t\t\t\t} catch (NumberFormatException e1) {\n\t\t\t\t\t\tString result_aeth[] = new String[buffer_aeth.size()];\n\t\t\t\t\t\tfor (int i = 0; i < buffer_aeth.size(); i++) {\n\t\t\t\t\t\t\tresult_aeth[i] = buffer_aeth.get(i);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tengine.assign(\"result_aeth\", result_aeth);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tString r_html_filename = GlobalEnv.getfilename3()+\"_graph\";\n\t\t\ttry {\n\t\t\t\tr_html_filename += \"_\" + buffer.getExtListString(0, Integer.parseInt(criteria.getExtListString(0)));\n\t\t\t\tfor (int i = 1; i < criteria.size(); i++) {\n\t\t\t\t\tr_html_filename += \"_\" + buffer.getExtListString(0, Integer.parseInt(criteria.getExtListString(i)));\n\t\t\t\t}\n\t\t\t} catch (Exception e) { }\n\n\n//\t\t\tSystem.out.println(process);\n\t\t\tint n = process.toString().split(\":\").length;\n\n\n\n\t\t\tif (aeth > 0) {\n\t\t\t\tengine.eval(\"frame <- data.frame(X=result_x, Y=result_y, AETH=result_aeth)\");\n\t\t\t\tfor (int i = 1; i < n; i++) {\n\t\t\t\t\tif (process.toString().split(\":\")[i].contains(\"color\") && !process.toString().split(\":\")[i].contains(\"\\\"\") ) {\n\t\t\t\t\t\taeth_type = process.toString().split(\":\")[i].substring(0, process.toString().split(\":\")[i].indexOf(\"=\") + 1);\n\t\t\t\t\t}\n\t\t\t\t\tif (process.toString().split(\":\")[i].contains(\"fill\") && !process.toString().split(\":\")[i].contains(\"\\\"\") ) {\n\t\t\t\t\t\taeth_type = process.toString().split(\":\")[i].substring(0, process.toString().split(\":\")[i].indexOf(\"=\") + 1);\n\t\t\t\t\t}\n\t\t\t\t\tif (process.toString().split(\":\")[i].contains(\"size\") && !process.toString().split(\":\")[i].contains(\"\\\"\") ) {\n\t\t\t\t\t\taeth_type = process.toString().split(\":\")[i].substring(0, process.toString().split(\":\")[i].indexOf(\"=\") + 1);\n\t\t\t\t\t}\n\t\t\t\t\tif (process.toString().split(\":\")[i].contains(\"group\") && !process.toString().split(\":\")[i].contains(\"\\\"\") ) {\n\t\t\t\t\t\taeth_type = process.toString().split(\":\")[i].substring(0, process.toString().split(\":\")[i].indexOf(\"=\") + 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tengine.eval(\"graph <- ggplot(data = frame, aes(x = X, y = Y, \" + aeth_type +\"AETH))\");\n\t\t\t\t//engine.eval(\"graph <- ggplot(subset(data = frame, !is.na(x,y)), aes(x = X, y = Y, \" + aeth_type +\"AETH))\");\n\t\t\t} else {\n\t\t\t\tengine.eval(\"frame <- data.frame(X=result_x, Y=result_y)\");\n\t\t\t\t//engine.eval(\"frame <- subset(data.frame(X=result_x, Y=result_y), !is.na(x,y))\");\n\t\t\t\tengine.eval(\"graph <- ggplot(data = frame, aes(x = X, y = Y))\");\n\t\t\t\t//engine.eval(\"graph <- ggplot(data = subset(frame, !is.na(X), !is.na(Y)), aes(x = X, y = Y))\");\n\t\t\t}\n\n\t\t\tfor (int i = 1; i < n; i++) {\n\t\t\t\tif((process.toString().split(\":\")[i].contains(\"color\") ||\n\t\t\t\t\tprocess.toString().split(\":\")[i].contains(\"fill\") ||\n\t\t\t\t\tprocess.toString().split(\":\")[i].contains(\"size\") ||\n\t\t\t\t\tprocess.toString().split(\":\")[i].contains(\"group\") ||\n\t\t\t\t\tprocess.toString().split(\":\")[i].contains(\"width\") ||\n\t\t\t\t\tprocess.toString().split(\":\")[i].contains(\"height\"))\n\t\t\t\t\t&& !process.toString().split(\":\")[i].contains(\"\\\"\")) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (process.toString().split(\":\")[i].contains(\"geom_bar\") ) {\n\t\t\t\t\tif (process.toString().split(\":\")[i].contains(\"=\")) {\n\t\t\t\t\t\tengine.eval(\" graph <- graph + geom_bar(stat = 'identity', \" + process.toString().split(\":\")[i].split(\"\\\"\")[1] + \")\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tengine.eval(\" graph <- graph + geom_bar(stat = 'identity')\");\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (process.toString().split(\":\")[i].contains(\"=\")) {\n\t\t\t\t\tengine.eval(\" graph <- graph + \" + process.toString().split(\":\")[i].split(\"=\")[0] + \"(\" + process.toString().split(\":\")[i].split(\"\\\"\")[1] + \")\");\n\t\t\t\t} else {\n\t\t\t\t\tengine.eval(\" graph <- graph + \" + process.toString().split(\":\")[i] + \"()\");\n\t\t\t\t}\n\n\n\n\t\t\t/*\tif (process.toString().split(\":\")[i].contains(\"geom_point\") ) {\n\t\t\t\t\tif (process.toString().split(\":\")[i].contains(\"=\")) {\n\t\t\t\t\t\tengine.eval(\" graph <- graph + geom_point(\" + process.toString().split(\":\")[i].split(\"\\\"\")[1] + \")\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tengine.eval(\" graph <- graph + geom_point()\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (process.toString().split(\":\")[i].contains(\"geom_line\") ) {\n\t\t\t\t\tif (process.toString().split(\":\")[i].contains(\"=\")) {\n\t\t\t\t\t\tengine.eval(\" graph <- graph + geom_line(\" + process.toString().split(\":\")[i].split(\"\\\"\")[1] + \")\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tengine.eval(\" graph <- graph + geom_line()\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (process.toString().split(\":\")[i].contains(\"geom_smooth\") ) {\n\t\t\t\t\tif (process.toString().split(\":\")[i].contains(\"=\")) {\n\t\t\t\t\t\tengine.eval(\" graph <- graph + geom_smooth(\" + process.toString().split(\":\")[i].split(\"\\\"\")[1] + \")\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tengine.eval(\" graph <- graph + geom_smooth()\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (process.toString().split(\":\")[i].contains(\"geom_bar\") ) {\n\t\t\t\t\tif (process.toString().split(\":\")[i].contains(\"=\")) {\n\t\t\t\t\t\tengine.eval(\" graph <- graph + geom_bar(stat = 'identity', \" + process.toString().split(\":\")[i].split(\"\\\"\")[1] + \")\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tengine.eval(\" graph <- graph + geom_bar(stat = 'identity')\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (process.toString().split(\":\")[i].contains(\"coord_flip\") ) {\n\t\t\t\t\tengine.eval(\" graph <- graph + coord_flip()\");\n\t\t\t\t}\n\n\t\t\t\tif (process.toString().split(\":\")[i].contains(\"coord_polar\") ) {\n\t\t\t\t\tengine.eval(\" graph <- graph + coord_polar()\");\n\t\t\t\t}\n\n\t\t\t\tif (process.toString().split(\":\")[i].contains(\"labs\") ) {\n\t\t\t\t\tengine.eval(\" graph <- graph + labs(\" + process.toString().split(\":\")[i].split(\"\\\"\")[1] + \")\");\n\t\t\t\t}\n\n////\t\t\t\tif (process.toString().split(\" \")[i].contains(\"errorbar\") ) {\n////\t\t\t\t\tengine.eval(\" graph <- graph + geom_errorbar()\");\n//\t\t\t\t} */\n\t\t\t}\n\n\t\t\tengine.eval(\"graph <- ggplotly(graph)\");\n\t\t\tLog.out(\"r: r_html_filename = \"+r_html_filename + \"_\" + count + \".html\");\n\t\t\t//engine.eval(\"htmlwidgets::saveWidget(as_widget(graph), \\\"\" + r_html_filename + \"_\" + count + \".html\\\")\");\n\t\t\tengine.eval(\"htmlwidgets::saveWidget(as_widget(graph), \\\"\" + r_html_filename + \"_\" + count + \".html\\\", selfcontained=FALSE)\");\n\t engine.end();\n\n//\t tmp = buffer.getExtList(0);\n//\t tmp.set(Integer.parseInt(target_x), \"ggplot\" + name + \".html\");\n//\t tmp.set(Integer.parseInt(target_y), name);\n//\t tuples_buffer.add(tmp);\n\n\t for (int i = 0; i < buffer.size(); i++) {\n\t \t\tbuffer.getExtList(i).set(Integer.parseInt(target_x), \"ggplot\" + r_html_filename + \"_\" + count + \".html\");\n\t \t\t//buffer.getExtList(i).set(Integer.parseInt(target_y), r_html_filename);\n\t \t\tbuffer.getExtList(i).set(Integer.parseInt(target_y), \"\");\n//\t \t\tSystem.out.println(buffer.getExtListString(i, Integer.parseInt(target_x)));\n//\t \t\tSystem.out.println(buffer.getExtListString(i, Integer.parseInt(target_y)));\n\t }\n//\t buffer.getExtList(0).set(Integer.parseInt(target_x), \"ggplot\" + name + \".html\");\n//\t buffer.getExtList(0).set(Integer.parseInt(target_y), name);\n\t tuples_buffer.addAll(buffer);\n\n\t result.add(buffer.getExtList(0));\n\t\t\tbuffer.clear();\n\n//\t\t\tcount++;\n//\t\t\tSystem.out.println(count);\n\n\t\t}\n\t\tcount++;\n\t\treturn tuples_buffer;\n\n\t}", "public interface SearchStrategy<T> {\n\t\n\t/**\n\t * Sucht den gewünschten Knoten.\n\t * @return gesuchten Knoten - wenn nicht gefunden, dann null.\n\t */\n\tpublic Node<T> search(T value, Node<T> root);\n\t\n\t/**\n\t * Gibt den Pfad der zuletzt ausgeführten Suche zurück.\n\t * \n\t * @return Liste der Knoten, die durchsucht wurden.\n\t */\n\tpublic ArrayList<Node<T>> getPath();\n}", "private PetriNet createActivityModelOfPN(PetriNet pn, PetriNet oldPN) {\n\t\t// start with merging transitions to activities.\n\t\t// it is asssumed that there are no duplicates in the process\n\t\t// model!!!!!!!!\n\t\tArrayList placesToExamine = new ArrayList<Place>(pn.getPlaces());\n\t\tArrayList placesIt = new ArrayList(pn.getPlaces());\n\t\tfor (int i = 0; i < placesIt.size(); i++) {\n\t\t\tif (placesToExamine.contains(placesIt.get(i))) {\n\t\t\t\t// the place still needs to be checked\n\t\t\t\tPlace placeIt = (Place) placesIt.get(i);\n\t\t\t\tif (placeIt.inDegree() == 1 && placeIt.outDegree() == 1) {\n\t\t\t\t\t// check whether the place is inbetween schedule and start\n\t\t\t\t\tTransition inTransition = (Transition) placeIt\n\t\t\t\t\t\t\t.getPredecessors().iterator().next();\n\t\t\t\t\tTransition outTransition = (Transition) placeIt\n\t\t\t\t\t\t\t.getSuccessors().iterator().next();\n\t\t\t\t\t// check whether inTransition and outTransition is already\n\t\t\t\t\t// an activity because in that case\n\t\t\t\t\t// you can stop with checking\n\t\t\t\t\tif (!(mergedPNTransitions.keySet().contains(inTransition) || mergedPNTransitions\n\t\t\t\t\t\t\t.keySet().contains(outTransition))) {\n\n\t\t\t\t\t\t// check whether they belong to the same activity\n\t\t\t\t\t\tif (getActivityName(inTransition).equals(\n\t\t\t\t\t\t\t\tgetActivityName(outTransition))) {\n\n\t\t\t\t\t\t\t// for inTransition and outTransition you can have 3\n\t\t\t\t\t\t\t// different combinations\n\t\t\t\t\t\t\t// namely: 1) schedule, start 2) start, complete 3)\n\t\t\t\t\t\t\t// schedule, complete\n\t\t\t\t\t\t\tif (getEventType(inTransition) == EventType.SCHEDULE\n\t\t\t\t\t\t\t\t\t&& getEventType(outTransition) == EventType.START) {\n\t\t\t\t\t\t\t\t// check whether the direct successor of start\n\t\t\t\t\t\t\t\t// is complete\n\t\t\t\t\t\t\t\tString name = getActivityName(inTransition);\n\t\t\t\t\t\t\t\tTransition complTrans = findTransitionByNameAndEvent(\n\t\t\t\t\t\t\t\t\t\tpn, name, \"complete\");\n\t\t\t\t\t\t\t\tif (complTrans != null) {\n\t\t\t\t\t\t\t\t\t// check whether one of the successor\n\t\t\t\t\t\t\t\t\t// transitions is the complete version\n\t\t\t\t\t\t\t\t\tHashSet checkSet = outTransition\n\t\t\t\t\t\t\t\t\t\t\t.getSuccessors();\n\t\t\t\t\t\t\t\t\tcheckSet.retainAll(complTrans\n\t\t\t\t\t\t\t\t\t\t\t.getPredecessors());\n\t\t\t\t\t\t\t\t\tif (checkSet.size() == 1) {\n\t\t\t\t\t\t\t\t\t\t// try to fuse schedule, start, complete\n\t\t\t\t\t\t\t\t\t\tArrayList nodes = new ArrayList();\n\t\t\t\t\t\t\t\t\t\tnodes.add(inTransition);\n\t\t\t\t\t\t\t\t\t\tnodes.add(placeIt);\n\t\t\t\t\t\t\t\t\t\tnodes.add(outTransition);\n\t\t\t\t\t\t\t\t\t\tnodes.add(checkSet.iterator().next());\n\t\t\t\t\t\t\t\t\t\tnodes.add(complTrans);\n\t\t\t\t\t\t\t\t\t\tmergedPNTransitions\n\t\t\t\t\t\t\t\t\t\t\t\t.putAll(fusionSeriesTransitions(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpn, nodes,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tplacesToExamine, oldPN));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// try to fuse schedule and start\n\t\t\t\t\t\t\t\t\tArrayList nodes = new ArrayList();\n\t\t\t\t\t\t\t\t\tnodes.add(inTransition);\n\t\t\t\t\t\t\t\t\tnodes.add(placeIt);\n\t\t\t\t\t\t\t\t\tnodes.add(outTransition);\n\t\t\t\t\t\t\t\t\tmergedPNTransitions\n\t\t\t\t\t\t\t\t\t\t\t.putAll(fusionSeriesTransitions(pn,\n\t\t\t\t\t\t\t\t\t\t\t\t\tnodes, placesToExamine,\n\t\t\t\t\t\t\t\t\t\t\t\t\toldPN));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (getEventType(inTransition) == EventType.START\n\t\t\t\t\t\t\t\t\t&& getEventType(outTransition) == EventType.COMPLETE) {\n\t\t\t\t\t\t\t\t// check whether the direct predecessor of start\n\t\t\t\t\t\t\t\t// is schedule\n\t\t\t\t\t\t\t\tString name = getActivityName(inTransition);\n\t\t\t\t\t\t\t\tTransition schedTrans = findTransitionByNameAndEvent(\n\t\t\t\t\t\t\t\t\t\tpn, name, \"schedule\");\n\t\t\t\t\t\t\t\tif (schedTrans != null) {\n\t\t\t\t\t\t\t\t\t// check whether one of the predecessor\n\t\t\t\t\t\t\t\t\t// transitions is the complete version\n\t\t\t\t\t\t\t\t\tHashSet checkSet = inTransition\n\t\t\t\t\t\t\t\t\t\t\t.getPredecessors();\n\t\t\t\t\t\t\t\t\tcheckSet.retainAll(schedTrans\n\t\t\t\t\t\t\t\t\t\t\t.getSuccessors());\n\t\t\t\t\t\t\t\t\tif (checkSet.size() == 1) {\n\t\t\t\t\t\t\t\t\t\t// try to fuse schedule, start, complete\n\t\t\t\t\t\t\t\t\t\tArrayList nodes = new ArrayList();\n\t\t\t\t\t\t\t\t\t\tnodes.add(schedTrans);\n\t\t\t\t\t\t\t\t\t\tnodes.add(checkSet.iterator().next());\n\t\t\t\t\t\t\t\t\t\tnodes.add(inTransition);\n\t\t\t\t\t\t\t\t\t\tnodes.add(placeIt);\n\t\t\t\t\t\t\t\t\t\tnodes.add(outTransition);\n\t\t\t\t\t\t\t\t\t\tmergedPNTransitions\n\t\t\t\t\t\t\t\t\t\t\t\t.putAll(fusionSeriesTransitions(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpn, nodes,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tplacesToExamine, oldPN));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// try to fuse start and complete\n\t\t\t\t\t\t\t\t\tArrayList nodes = new ArrayList();\n\t\t\t\t\t\t\t\t\tnodes.add(inTransition);\n\t\t\t\t\t\t\t\t\tnodes.add(placeIt);\n\t\t\t\t\t\t\t\t\tnodes.add(outTransition);\n\t\t\t\t\t\t\t\t\tmergedPNTransitions\n\t\t\t\t\t\t\t\t\t\t\t.putAll(fusionSeriesTransitions(pn,\n\t\t\t\t\t\t\t\t\t\t\t\t\tnodes, placesToExamine,\n\t\t\t\t\t\t\t\t\t\t\t\t\toldPN));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (getEventType(inTransition) == EventType.SCHEDULE\n\t\t\t\t\t\t\t\t\t&& getEventType(outTransition) == EventType.COMPLETE) {\n\t\t\t\t\t\t\t\t// check whether there should be start in\n\t\t\t\t\t\t\t\t// between\n\t\t\t\t\t\t\t\tString name = getActivityName(inTransition);\n\t\t\t\t\t\t\t\tTransition startTrans = findTransitionByNameAndEvent(\n\t\t\t\t\t\t\t\t\t\tpn, name, \"start\");\n\t\t\t\t\t\t\t\tif (startTrans == null) {\n\t\t\t\t\t\t\t\t\t// try to fuse schedule and complete\n\t\t\t\t\t\t\t\t\tArrayList nodes = new ArrayList();\n\t\t\t\t\t\t\t\t\tnodes.add(inTransition);\n\t\t\t\t\t\t\t\t\tnodes.add(placeIt);\n\t\t\t\t\t\t\t\t\tnodes.add(outTransition);\n\t\t\t\t\t\t\t\t\tmergedPNTransitions\n\t\t\t\t\t\t\t\t\t\t\t.putAll(fusionSeriesTransitions(pn,\n\t\t\t\t\t\t\t\t\t\t\t\t\tnodes, placesToExamine,\n\t\t\t\t\t\t\t\t\t\t\t\t\toldPN));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// generate exception\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// add the transitions that are not merged also to the mapping\n\t\tIterator transitionsIt = pn.getTransitions().iterator();\n\t\twhile (transitionsIt.hasNext()) {\n\t\t\tTransition transitionIt = (Transition) transitionsIt.next();\n\t\t\tif (!mergedPNTransitions.containsKey(transitionIt)) {\n\t\t\t\t// get the corresponding transition in oldPN\n\t\t\t\tTransition oldTransition = oldPN.findTransition(transitionIt);\n\t\t\t\tArrayList<Transition> mappedTransitions = new ArrayList<Transition>();\n\t\t\t\tmappedTransitions.add(oldTransition);\n\t\t\t\tmergedPNTransitions.put(transitionIt, mappedTransitions);\n\t\t\t}\n\t\t}\n\t\tArrayList<TransitionCluster> clusters = ((PetriNet) pn).getClusters();\n\t\t((PetriNet) pn).getClusters().removeAll(clusters);\n\t\treturn pn;\n\t}", "TabuSearchwithGreedy(double wl, double ar, TransactionClass tc, Partition p,\n\t\t\tint useCase) {\n\t\tsuper(wl, ar, tc, p, useCase);\n\t\t// TODO Auto-generated constructor stub\n\t}", "void compareSearch();", "@Test\n @Order(1)\n void algorithms() {\n \n Combination initialComb = new Combination();\n for (int i = 0; i < assignementProblem.getAssignmentData().getLength(); i++) {\n initialComb.add((long) i + 1);\n }\n assignementProblem.setInCombination(initialComb);\n executeAlgo(SearchTestUtil.ALGO.TABU);\n executeAlgo(SearchTestUtil.ALGO.RECUIT);\n }", "void selectActivityOptions(int activity_number, Model model);", "public static void main(String[] args) {\n\t\tinit(Hx.Manhattan, CostMode.Def);\n\t\tMaze smallMaze = new Maze(\"mazes/tinySearch.txt\");\n\t\tAgent astarAg = new Agent(smallMaze);\n\t\tRecorder rd = new Recorder();\n\t\tSearch.AstarMulOptimal(astarAg, smallMaze, rd);\n\t\t//System.out.println(rd.getExpandNodes());\n\t}", "public void testAdvancedQuery() {\n\t\t//manager.advancedQuery(ElasticIndex.analyzed, \"metropolitan areas\", \"sports clubs\");\n\t\t//manager.advancedQuery(ElasticIndex.analyzed, \"\", \"Award\");\n\n\t//manager.advancedQuery(ElasticIndex.analyzed,\"american actor\", \"list of movies starring Sean Connery\");\n//\tmanager.categorySearch(\"Sportspeople\", \"tennis\",ElasticIndex.analyzed,30);\n\t//manager.advancedQuery(ElasticIndex.analyzed,\"Broadway musicals\", \"Grammy Award\");\n\t//manager.advancedQuery(ElasticIndex.analyzed,\"musical movies\", \"Tony Award\");\n\t//manager.advancedQuery(ElasticIndex.analyzed,\"Top level football leagues\", \"teams\");\n\t//manager.advancedQuery(ElasticIndex.analyzed,\"american movies\", \"directed by Woody Allen\");\n\t//manager.advancedQuery(ElasticIndex.analyzed,\"United states\", \"professional sports teams\");\n\t\t//manager.advancedQuery(\"musical movies\", \"tony award\");\n\t\t//manager.advancedQuery(\"grammy\", \"best album in 2012\"); \n\t\t//manager.advancedQuery(\"american movies\", \"directed by Woody Allen\"); \n\t\t//Canceled manager.advancedQuery(\"tennis\", \"international players\"); \n\t\t// canceled manager.advancedQuery(\"tennis\", \"french open\"); \n\t\t// canceled manager.advancedQuery(\"film movie\", \"1933\"); \n//\t\tmanager.advancedQuery(\"United states\", \"professional sports teams \");\n//\t\t manager.advancedQuery(\"computer games\", \"developed by Ubisoft\");\n//\t\tmanager.advancedQuery(\"movies\", \"academy award nominations\");\n //manager.advancedQuery(\"movies\", \"starring Dustin Hoffman\");\n // manager.advancedQuery(\"movies\", \"best costume design\");\n // manager.advancedQuery(\"concert tours\", \"england\");\n // manager.advancedQuery(\"sport\", \"Francesco\");\n\t\t//System.out.println(\"******* advanced query *******\");\n\t\t//manager.advancedQuery(\"sportspeople\", \"tennis\");\n//\t\tmanager.advancedQuery(ElasticIndex.analyzed, \"Broadway musicals\", \"Grammy Award\");\n //System.out.println(\"*****************************\");\n\n\n\t\t\n\t\t//manager.advancedQuery(\"football\", \"italian championship\");\n\t\t//manager.advancedQuery(\"american basketball\", \"team\");\n\t\t //manager.advancedQuery(\"Goya Award\", \"Winner and nominees from FRA\");\n\t\t//manager.advancedQuery(\"films\", \"american comedy \");\n\t\t//manager.advancedQuery(\"films\", \"american Adventure directed by James P. Hogan\");\n\t\t//manager.advancedQuery(\"NCAA Division\", \"american universities in Arkansas\");\n\t\t//manager.advancedQuery(\"Academy award\", \"winners and nominees in acting in 2011\");\n\t\t//manager.advancedQuery(\"canadian soccer\", \"Alain Rochat position \");\n\n\t}", "@Override\n public Criteria getCriteria() {\n\n //判断是否为精确到天的时间查询\n //情况一 点击分组查询查看该天的详情\n if (this.searchObject.getEndtime() == null && this.searchObject.getStarttime() != null){\n\n this.searchObject.setEndtime(DateTool.addDays(this.searchObject.getStarttime(),1));\n\n //情况二 在分组页面按时间搜索\n }else if (this.searchObject.getEndtime() != null && this.searchObject.getStarttime().equals(this.searchObject.getEndtime())){\n\n this.searchObject.setEndtime(DateTool.addDays(this.searchObject.getStarttime(),1));\n }\n\n Criteria criteria = Criteria.and(\n\n Criteria.add(ActivityPlayerApply.PROP_ID, Operator.EQ, this.searchObject.getId()),\n Criteria.add(ActivityPlayerApply.PROP_ACTIVITY_MESSAGE_ID, Operator.EQ, this.searchObject.getActivityMessageId()),\n Criteria.add(ActivityPlayerApply.PROP_USER_ID, Operator.EQ, this.searchObject.getUserId()),\n Criteria.add(ActivityPlayerApply.PROP_USER_NAME, Operator.EQ, this.searchObject.getUserName()),\n Criteria.add(ActivityPlayerApply.PROP_REGISTER_TIME, Operator.EQ, this.searchObject.getRegisterTime()),\n Criteria.add(ActivityPlayerApply.PROP_APPLY_TIME, Operator.EQ, this.searchObject.getApplyTime()),\n Criteria.add(ActivityPlayerApply.PROP_PLAYER_RECHARGE_ID, Operator.EQ, this.searchObject.getPlayerRechargeId()),\n Criteria.add(ActivityPlayerApply.PROP_STARTTIME, Operator.GE, this.searchObject.getStarttime()),\n Criteria.add(ActivityPlayerApply.PROP_STARTTIME, Operator.LE, this.searchObject.getEndtime()),\n Criteria.add(ActivityPlayerApply.PROP_PREFERENTIAL_VALUE, Operator.EQ, this.searchObject.getPreferentialValue()),\n Criteria.add(ActivityPlayerApply.PROP_ARTICLE, Operator.EQ, this.searchObject.getArticle()),\n Criteria.add(ActivityPlayerApply.PROP_IS_REALIZE, Operator.EQ, this.searchObject.getIsRealize()),\n Criteria.add(ActivityPlayerApply.PROP_RELATION_PLAYER_ID, Operator.EQ, this.searchObject.getRelationPlayerId()),\n Criteria.add(ActivityPlayerApply.PROP_ACTIVITY_CLASSIFY_KEY, Operator.EQ, this.searchObject.getActivityClassifyKey()),\n Criteria.add(ActivityPlayerApply.PROP_ACTIVITY_TYPE_CODE, Operator.EQ, this.searchObject.getActivityTypeCode())\n );\n criteria.addAnd(ActivityPlayerApply.PROP_IS_DELETED, Operator.EQ, false);\n return criteria;\n }", "public static void main(String[] args)\n {\n /*\n * Create a new loader with default factory.\n * \n * A factory will create all rule components when loader requires them\n * Default engine is used that creates all the default constructs in:\n * org.achacha.rules.compare\n * org.achacha.rules.condition\n * org.achacha.rules.action\n * \n * RulesEngineFactoryExtension can be used to extend a default factory while keeping existing constructs\n * for basic rules the default factory provides a wide variety of comparators and action elements\n * \n * The loader uses the factory to resolve where the rule parts are loaded from\n * There are several load types (file system, in-memory string, in-memory XML)\n * Here we will configure a simple in-memory string based loader and add the\n * conditions and actions from constants\n */\n RulesEngineLoaderImplMappedString loader = new RulesEngineLoaderImplMappedString(new RulesEngineFactory());\n \n // Add a simple rule and call it 'alwaysTrue', we will execute this rule using this name\n loader.addRule(\"alwaysTrue\", SIMPLE_RULE);\n \n /*\n * Create a rules engine that uses the loader and factory we just created\n * Normally these 3 objects would be someone retained so we don't have to re-parse the rules every execution\n * However this is a tutorial example\n */\n RulesEngine engine = new RulesEngine(loader);\n \n /////////////////////////// Everything above is initialization ///////////////////////////////////////\n \n /////////////////////////// Everything below is rule execution ///////////////////////////////////////\n /*\n * Now we need to have some input for the rule to process but since were are using constants in comparison we can just pass\n * an empty input model\n * \n * We use dom4j XML Element for input\n * \n * <request>\n * <input />\n * </request>\n */\n Element request = DocumentHelper.createElement(\"request\");\n request.addElement(\"input\");\n \n /*\n * RuleContext is an object that holds the input, output, event log, etc for a given rule execution\n * The engine can create a new context for us if we specify the input for the rule\n */\n RuleContext ruleContext = engine.createContext(request);\n \n /*\n * Now that we have set up our context we can execute the rule\n * Since we used addRule above and called this rule 'alwaysTrue', this is how we invoke this rule\n * \n * NOTE:\n * you can run multiple rules sequentially against the same context\n * some actions can modify input context and some conditions can check output context\n * so rules can depend on other rules\n */\n engine.execute(ruleContext, \"alwaysTrue\");\n \n /*\n * Display the output model\n * \n * Since the action we used is:\n * \n * <Action Operator='OutputValueSet'>\"\n * <Path>/result</Path>\"\n * <Value Source='Constant'><Data>yes</Data></Value>\"\n * </Action>\"\n * \n * We get the following output model:\n * <output><result>yes</result></output>\n * \n * NOTE: The path on the output action is always relative to the output element\n */\n System.out.println(\"Output Model\\n------------\");\n System.out.println(ruleContext.getOutputModel().asXML());\n }", "public Node newAlphaBeta(Node node, boolean isMaximizing, Node[][] gameBoard,int playerID,int depth,boolean searchOnce) throws InterruptedException {\n\t\tif(depth==0) //node equals terminal node origin ***************************\n\t\t{\n\n\t\t\t\n\t\t\treturn node; //return heuristic value accumulated Score\n\t\t}\n\t\t\n\t\tif(isMaximizing == true)//max\n\t\t{\n\t\t\t\n\t\t\tNode[][] copyOne = new Node[gameBoard.length][gameBoard.length];\n\t\t\tint enescore=0;\n\t\t\tint nodesRx = 0;\n\t\t\tint nodesRy = 0;\n\t\t\tNode temNode = node;\n\t\t\t//opponent score\n\t\t\tif(node!=null)\n\t\t\t{\tenescore = node.enemy;\n\t\t\tnodesRx = node.maxrecordSearchedX;\n\t\t\tnodesRy = node.maxrecordSearchedY;}\n\t\t\t\n\t\t for (int i = 0; i < gameBoard.length; i++) {\n\t\t \tfor(int j =0;j<gameBoard.length;j++)\n\t\t \t{\t\n\t\t \t\tNode temp = new Node(gameBoard[i][j].getScore(),gameBoard[i][j].getX(),gameBoard[i][j].getY(),gameBoard[i][j].getOwnership());\n\t\t \t\tcopyOne[i][j]=temp;\n\t\t \t}\n\t\t }\n\t\t \n\t\t \n\t\t\tPriorityQueue<Node> playerOneChildrenList = new PriorityQueue<Node>(Collections.reverseOrder()); //use priorityQueue,acsending or disacsending.\n\t\t\tQueue<Node> waitList = new LinkedList<Node>();\n\t\t\tboolean walkable = false;\n\t\t\t\n\t\t\t\tfor(int i = 0;i<gameBoard.length;i++)\n\t\t\t\t{\n\t\t\t\t\tfor(int j =0;j<gameBoard.length;j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(copyOne[i][j].getOwnership()==0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\twaitList.add(new Node(copyOne[i][j].getScore(),i,j,playerID));//everyPosition through the 2D array\n\t\t\t\t\t\twalkable = true;\n\t\t\t\t//\t\tcounter++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\tif(walkable == false)\n\t\t\t{\n\t\t\t\treturn node;\n\t\t\t}\n\t\t\t\n\t\t\tint waitSize = waitList.size();\n\t\t\t\n\t\t\t\n\t\t\tfor(int l = 0;l<waitSize;l++)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tNode[][] newCopy = new Node[gameBoard.length][gameBoard.length];\n\t\t\t\tNode temT = temNode;\n\t\t\t for (int i = 0; i < gameBoard.length; i++) {\n\t\t\t \tfor(int j =0;j<gameBoard.length;j++)\n\t\t\t \t{\t\n\t\t\t \t\tNode temp = new Node(copyOne[i][j].getScore(),copyOne[i][j].getX(),copyOne[i][j].getY(),copyOne[i][j].getOwnership());\n\t\t\t \t\tnewCopy[i][j]=temp;\n\t\t\t \t}\n\t\t\t }\n\t\t\t \n\t\t\t\tNode takenNode =waitList.poll();\n\t\t\t\tcounter++;\n\t\t\t\ttakenNode.setAccumulated(newCopy[takenNode.getX()][takenNode.getY()].getScore());\n\t\t\t\ttakenNode.enemy = 0;\n\t\t\t\tnewCopy[takenNode.getX()][takenNode.getY()].setOwnership(playerID);\n\t\t\t\tboolean connected = false;\n\t\t\t\tfor(int i = 0;i<dx.length;i++)\n\t\t\t\t{\n\t\t\t\t\t\tint newX = takenNode.getX()+dx[i];\n\t\t\t\t\t\tint newY = takenNode.getY()+dy[i];\n\t\t\t\t\t\tif((newX>=0&&newX<gameBoard.length)&&(newY>=0&&newY<gameBoard.length))\n\t\t\t\t\t\t{\n\t\t\t\t\t\tif(newCopy[newX][newY].getOwnership()==playerID)\n\t\t\t\t\t\t{\n\t\t\n\t\t\t\t\t\t\tconnected = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(connected == true)\n\t\t\t\t{\n\n\t\t\t\t\tfor(int i = 0;i<dx.length;i++)\n\t\t\t\t\t{\n\t\t\n\t\t\t\t\t\t\tint newX = takenNode.getX()+dx[i];\n\t\t\t\t\t\t\tint newY = takenNode.getY()+dy[i];\n\t\t\t\t\t\t\tif((newX>=0&&newX<gameBoard.length)&&(newY>=0&&newY<gameBoard.length))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(newCopy[newX][newY].getOwnership()!=playerID&&newCopy[newX][newY].getOwnership()!=0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.eatOpponent(newCopy, playerID, newX, newY);\n\t\t\n\t\t\t\t\t\t\t\ttakenNode.setAccumulated(takenNode.getAccumulated()+newCopy[newX][newY].getScore());\n\t\t\t\t\t\t\t\tenescore-=newCopy[newX][newY].getScore();\n\t\t\t\t\t\t\t\ttakenNode.enemy = enescore;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\tif(depth==1)\n\t\t\t\t{\n\t\n\t\t\t\t\ttakenNode.setAccumulated(node.getAccumulated()+takenNode.getAccumulated());\n\n\t\t\t\t}\n\t\n\n\t\t\t\tint opponentID = 0;\n\t\t\t\tif(playerID == 1)\n\t\t\t\t{\n\t\t\t\t\topponentID = 2;\n\t\t\t\t}else if(playerID == 2)\n\t\t\t\t{\n\t\t\t\t\topponentID = 1;\n\t\t\t\t}\n\t\t\t\tif(playerOneChildrenList.isEmpty()==false)\n\t\t\t\t{\n\t\t\t\t\t//\tSystem.out.println(\"asdas\");\n\t\t\t//\t\tSystem.out.println(\"A depth: \"+depth);\n\t\t\t\t//\tThread.sleep(300);\n\t\t\t\t\t\tNode minValueNode = newAlphaBeta(takenNode,false,newCopy, opponentID, depth-1,true);\n\t\t\t\t\t\tcounter++;\n\t\t\t\t\t\n\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t\tif(node!=null)\n\t\t\t\t\t\t\t{\tminValueNode.parentNode = new Node(node.getAccumulated(),node.getX(),node.getY(),node.getOwnership());\n\t\t\t\t\t\t\tif(this.beta!=null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(minValueNode.getAccumulated()<this.alpha.getAccumulated())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//\tSystem.out.println(\"break l should be \"+waitSize+\" now: \"+l);\n\t\t\t\t\t\t\t\tplayerOneChildrenList.add(minValueNode);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t//node.noPoll = true;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tplayerOneChildrenList.add(minValueNode);\n\t\t\t\t\t\t\tcontinue;\n\t\n\t\t\t\t\t//\t}\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t//\tSystem.out.println(\"B depth: \"+depth);\n\t\t\t\t\t//Thread.sleep(300);\n\t\t\t\t\trecordDepth = depth;\n\t\t\t\t\tNode minValueNode = newAlphaBeta(takenNode,false,newCopy, opponentID, depth-1,false);\n\t\t\t\t\t//this.alpha = minValueNode;\n\t\t\t\t\t\n\t\t\t\t\tcounter++;\n\t\t\t\t\t//playeroneNode++;\n\t\t\t\t\tif(node!=null)\n\t\t\t\t\t{\tminValueNode.parentNode = new Node(node.getAccumulated(),node.getX(),node.getY(),node.getOwnership());\n\t\t\t\t\tif(this.beta!=null)\n\t\t\t\t\t{\n\t\t\t\t\tif(minValueNode.getAccumulated()>this.beta.getAccumulated())\n\t\t\t\t\t{\n\t\t\t\t\t//\tSystem.out.println(\"break l should be \"+waitSize+\" now: \"+l);\n\t\t\t\t\t\tplayerOneChildrenList.add(minValueNode);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t//node.noPoll = true;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tplayerOneChildrenList.add(minValueNode);\n\t\t\n\t\t\t\t\t\tif(depth == recordDepth)\n\t\t\t\t\t\t{\n\t\t\t//\t\t\t\tSystem.out.println(\"setting alpha\");\n\t\t\t\t\t\t\t//Thread.sleep(300);\n\t\t\t\t\n\t\t\t\t\t\t\t\tthis.alpha = minValueNode;\n\t\t\t//\t\t\tSystem.out.println(\"alpha once: \"+this.alpha.getAccumulated());\n\t\t\t\t\t//\tThread.sleep(5000);\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t\tif(playerOneChildrenList.peek().parentNode!=null||node!=null)\n\t\t\t{\n\t\t\t//\tSystem.out.println(\"returning: \"+playerOneChildrenList.peek().getAccumulated());\n\t\t\t//\tSystem.out.println(500);\n\t\t\tplayerOneChildrenList.peek().parentNode.setAccumulated(playerOneChildrenList.peek().getAccumulated());\n\t\t\tplayerOneChildrenList.peek().parentNode.noPoll = playerOneChildrenList.peek().noPoll;\n\n\t\t\treturn playerOneChildrenList.poll().parentNode;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tplayerOneChildrenList.peek().nodeExpanded = counter;\n\t\t\t\treturn playerOneChildrenList.poll();\n\t\t\t}\n\t\t\n\t\t}else\n\t\tif(isMaximizing == false)//min\n\t\t{\n\t\t\tNode[][] copyOne = new Node[gameBoard.length][gameBoard.length];\n\t\t\tint currentEnescore = node.enemy;\n\t\t\tint nodesRx = node.maxrecordSearchedX;\n\t\t\tint nodesRy = node.maxrecordSearchedY;\n\t\t\tNode temNode = node;\n\t\t for (int i = 0; i < gameBoard.length; i++) {\n\t\t \tfor(int j =0;j<gameBoard.length;j++)\n\t\t \t{\t\n\t\t \t\tNode temp = new Node(gameBoard[i][j].getScore(),gameBoard[i][j].getX(),gameBoard[i][j].getY(),gameBoard[i][j].getOwnership());\n\t\t \t copyOne[i][j]=temp;\n\t\t \t}\n\t\t }\n\t\t\tPriorityQueue<Node> playerTwoChildrenList = new PriorityQueue<Node>(); \n\t\t\tQueue<Node> waitList = new LinkedList<Node>();\n\t\t\tboolean walkable = false;\n\t\n\t\t\t\tfor(int i = 0;i<gameBoard.length;i++)\n\t\t\t\t{\n\t\t\t\t\tfor(int j =0;j<gameBoard.length;j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(copyOne[i][j].getOwnership()==0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\twaitList.add(new Node(copyOne[i][j].getScore(),i,j,playerID));//everyPosition through the 2D array\n\t\t\t\t\t\twalkable = true;\n\t\t\t\t//\t\tcounter++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\tif(walkable == false)\n\t\t\t{\n\t\t\t\treturn node;\n\t\t\t}\n\t\t\t\n\t\t\tint waitSize = waitList.size();\n\n\t\t\tfor(int l = 0;l<waitSize;l++)\n\t\t\t{\n\n\t\t\t\tNode[][] newCopy = new Node[gameBoard.length][gameBoard.length];\n\t\t\t\tNode temT = temNode;\n\t\t\t for (int i = 0; i < gameBoard.length; i++) {\n\t\t\t \tfor(int j =0;j<gameBoard.length;j++)\n\t\t\t \t{\t\n\t\t\t \t\tNode temp = new Node(copyOne[i][j].getScore(),copyOne[i][j].getX(),copyOne[i][j].getY(),copyOne[i][j].getOwnership());\n\t\t\t \t\tnewCopy[i][j]=temp;\n\t\t\t \t}\n\t\t\t }\n\n\t\t\t\tNode takenNode = waitList.poll();\n\t\t\t\tcounter++;\n\t\t\t\tnewCopy[takenNode.getX()][takenNode.getY()].setOwnership(playerID);\n\t\t\n\t\t\t\ttakenNode.setAccumulated(node.getAccumulated());\n\n\t\t\t\ttakenNode.enemy= currentEnescore+newCopy[takenNode.getX()][takenNode.getY()].getScore();\n\t\t\t\t\n\t\t\t\tboolean connected = false;\n\t\t\t\tfor(int i = 0;i<dx.length;i++)\n\t\t\t\t{\n\t\n\t\t\t\t\t\tint newX = takenNode.getX()+dx[i];\n\t\t\t\t\t\tint newY = takenNode.getY()+dy[i];\n\t\t\t\t\t\tif((newX>=0&&newX<gameBoard.length)&&(newY>=0&&newY<gameBoard.length))\n\t\t\t\t\t\t{\n\t\t\t\t\t\tif(newCopy[newX][newY].getOwnership()==playerID)\n\t\t\t\t\t\t{\n\t\t\t\t\n\t\t\t\t\t\t\tconnected = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(connected == true)\n\t\t\t\t{\n\t\t\t\n\t\t\t\t\tfor(int i = 0;i<dx.length;i++)\n\t\t\t\t\t{\n\t\t\n\t\t\t\t\t\t\tint newX = takenNode.getX()+dx[i];\n\t\t\t\t\t\t\tint newY = takenNode.getY()+dy[i];\n\t\t\t\t\t\t\tif((newX>=0&&newX<gameBoard.length)&&(newY>=0&&newY<gameBoard.length))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(newCopy[newX][newY].getOwnership()!=playerID&&newCopy[newX][newY].getOwnership()!=0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.eatOpponent(newCopy, playerID, newX, newY);\n\t\t\t\t\t\t\t\ttakenNode.setAccumulated(takenNode.getAccumulated()-newCopy[newX][newY].getScore());\t\n\t\t\t\t\t\t\t\ttakenNode.enemy+=newCopy[newX][newY].getScore();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tint opponentID = 0;\n\t\t\t\tif(playerID == 1)\n\t\t\t\t{\n\t\t\t\t\topponentID = 2;\n\t\t\t\t}else if(playerID == 2)\n\t\t\t\t{\n\t\t\t\t\topponentID = 1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(playerTwoChildrenList.isEmpty()==false)\n\t\t\t\t{\n\t\t\t//\t\tSystem.out.println(\" C depth: \"+depth);\n\t\t\t\t//\tThread.sleep(300);\n\t\t\t\t\t\tNode maxValueNode = newAlphaBeta(takenNode,true,newCopy, opponentID, depth-1,true);\n\t\t\t\t\t\tcounter++;\n\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t//playeroneNode++;\n\t\t\t\t\t\tmaxValueNode.parentNode = new Node(node.getAccumulated(),node.getX(),node.getY(),node.getOwnership());\n\t\t\t\t\t\tif(this.alpha!=null)\n\t\t\t\t\t\t{\n\t\t\t\t//\t\tSystem.out.println(maxValueNode.getAccumulated()+\" \"+this.alpha.getAccumulated());\n\t\t\t\t\t//\tThread.sleep(5000);\n\t\t\t\t\t\tif(maxValueNode.getAccumulated()<this.alpha.getAccumulated())\n\t\t\t\t\t\t{\n\t\t\t\t\t//\t\tSystem.out.println(\"break l should be \"+waitSize+\" now: \"+l);\n\t\t\t\t\t\t\tplayerTwoChildrenList.add(maxValueNode);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t//node.noPoll = true;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tplayerTwoChildrenList.add(maxValueNode);\n\t\t\t\t\t//\tif(maxValueNode.noPoll == true)\n\t\t\t\t\t//\t{\n\t\t\t\t\t//\t\tSystem.out.println(\"the discard value: \"+maxValueNode.getAccumulated()+\" compareTo: \"+this.alpha.getAccumulated());\n\t\t\t\t\t//\t\tbreak;\n\t\t\t\t\t//\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t//\tSystem.out.println(\" D depth: \"+depth);\n\t\t\t\t//\tThread.sleep(300);\n\t\t\t\t\tNode maxValueNode = newAlphaBeta(takenNode,true,newCopy, opponentID, depth-1,false);\n\t\t\t\t\tcounter++;\n\t\t\t\t\t\n\t\t\t\t\tmaxValueNode.parentNode = new Node(node.getAccumulated(),node.getX(),node.getY(),node.getOwnership());\n\t\t\t\t\tif(this.alpha!=null)\n\t\t\t\t\t{\n\t\t\t\t\tif(maxValueNode.getAccumulated()<this.alpha.getAccumulated())\n\t\t\t\t\t{\n\t\t\t\t\t//\tSystem.out.println(\"break l should be \"+waitSize+\" now: \"+l);\n\t\t\t\t\t\tplayerTwoChildrenList.add(maxValueNode);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t//node.noPoll = true;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(depth == recordDepth-1)\n\t\t\t\t\t{\n\t\t//\t\t\t\tSystem.out.println(\"setting alpha\");\n\t\t\t\t\t\t//Thread.sleep(300);\n\t\t\t\n\t\t\t\t\t\t\tthis.beta = maxValueNode;\n\t\t\t\t\t\t\tSystem.out.println(\"beta: \"+this.beta.getAccumulated());\n\t\t\t\t\t\t\t//Thread.sleep(5000);\n\t\t//\t\t\tSystem.out.println(\"alpha once: \"+this.alpha.getAccumulated());\n\t\t\t\t//\tThread.sleep(5000);\n\t\t\t\t\t}\n\t\t\t\t\tplayerTwoChildrenList.add(maxValueNode);\n\t\t\t\t//\tif(maxValueNode.noPoll == true)\n\t\t\t\t//\t{\n\t\t\t\t//\t\t\n\t\t\t\t//\t\tbreak;\n\t\t\t\t//\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\tplayerTwoChildrenList.peek().parentNode.setAccumulated(playerTwoChildrenList.peek().getAccumulated());\n\n\t\t\treturn playerTwoChildrenList.poll().parentNode;\n\t\t}\n\t\treturn null;\n\t\n\t}", "public interface ActivityManager extends GenericManager<Activity, Long> {\n// -------------------------- OTHER METHODS --------------------------\n\n Activity getActivity(Long activityID);\n\n List<Activity> getActivities();\n\n List<Activity> getActivitiesByDepartament(Long idDepartament);\n\n void removeActivity(Long activityId);\n\n Activity saveActivity(Activity activity);\n\n List<Activity> search(String searchTerm);\n}", "static AnalysisResult analyseQueryComponents(ArrayList<String> components) {\n if (components != null && components.size() > 0) {\n for (int i = 0; i < components.size(); i++) {\n String component = components.get(i).toLowerCase();\n for (String attack : commonAttacks) {\n attack = attack.toLowerCase();\n if (trim(component).contains(trim(attack))) {\n return new AnalysisResult(true, i, attack, false);\n }\n }\n }\n }\n return new AnalysisResult(false, null, null, false);\n }", "Long[] searchSolution(int timeLimit, Graph g);", "public static void main (String[] args) {\n EntityQuery query = new EntityQuery();\n Harvestable res = new OaiPmhResource();\n query.setFilter(\"test\", res);\n query.setAcl(\"diku\");\n query.setStartsWith(\"cf\",\"name\");\n System.out.println(query.asUrlParameters());\n System.out.println(query.asWhereClause(\"a\"));\n query.setQuery(\"(usedBy=library)\");\n System.out.println(query.asUrlParameters());\n System.out.println(query.asWhereClause(\"x\"));\n\n query = new EntityQuery();\n query.setQuery(\"(usedBy=library)\");\n System.out.println(query.asUrlParameters());\n System.out.println(query.asWhereClause(\"b\"));\n query.setQuery(\"usedBy=*library\");\n System.out.println(query.asUrlParameters());\n System.out.println(query.asWhereClause(\"c\"));\n query.setQuery(\"(=library\");\n System.out.println(query.asUrlParameters());\n System.out.println(query.asWhereClause(\"d\"));\n query.setQuery(\"usedBy=\");\n System.out.println(query.asUrlParameters());\n System.out.println(query.asWhereClause(\"e\"));\n query.setQuery(\"(usedBy!=library)\");\n System.out.println(query.asUrlParameters());\n System.out.println(query.asWhereClause(\"f\"));\n query.setQuery(\"(usedBy==library)\");\n System.out.println(query.asUrlParameters());\n System.out.println(query.asWhereClause(\"g\"));\n query.setQuery(\"(usedBy===library)\");\n System.out.println(query.asUrlParameters());\n System.out.println(query.asWhereClause(\"h\"));\n }", "public static void main(String[] args){\n\t\tInterview interview = new Interview();\r\n\t\tinterview.loadCandidates();\r\n\t\tinterview.setupAndPrintCandidateData();\r\n\t\t\r\n\t\t// Test the Social Media Challenge\r\n\t\tMember m1 = new Member(\"A\",\"[email protected]\");\r\n\t\tMember m2 = new Member(\"B1\",\"[email protected]\");\r\n\t\tMember m3 = new Member(\"C1\",\"[email protected]\");\r\n\t\tMember m4 = new Member(\"D1\", \"[email protected]\");\r\n\t\tMember m5 = new Member(\"E2\",\"[email protected]\");\r\n\t\tMember m6 = new Member(\"F2\", \"[email protected]\");\r\n\t\tMember m7 = new Member(\"G2\", \"[email protected]\");\r\n\t\tMember m8 = new Member(\"H2\", \"[email protected]\");\r\n\t\tMember m9 = new Member(\"I2\", \"[email protected]\");\r\n\t\tMember m10 = new Member(\"J2\", \"[email protected]\");\r\n\t\tMember m11 = new Member(\"K2\", \"[email protected]\");\r\n\t\tMember m12 = new Member(\"L2\", \"[email protected]\");\r\n\t\tMember m13 = new Member(\"M2\", \"M2gmail.com\");\r\n\t\tMember m14 = new Member(\"N3\", \"[email protected]\");\r\n\t\tMember m15 = new Member(\"O3\", \"[email protected]\");\r\n\t\tMember m16 = new Member(\"P3\", \"[email protected]\");\r\n\t\tMember m17 = new Member(\"Q3\", \"[email protected]\");\r\n\t\tMember m18 = new Member(\"R3\", \"[email protected]\");\r\n\t\t \r\n\t\t// Add friends of M1.\r\n\t\tm1.AddFriend(m2);\r\n\t\tm1.AddFriend(m3);\r\n\t\tm1.AddFriend(m4);\r\n\t\t\r\n\t\t// Add m2 friends\r\n\t\tm2.AddFriend(m5);\r\n\t\tm2.AddFriend(m6);\r\n\t\tm2.AddFriend(m7);\r\n\t\t \r\n\t\t// Add m3 friends\r\n\t\tm3.AddFriend(m8);\r\n\t\tm3.AddFriend(m9);\r\n\t\tm3.AddFriend(m10);\r\n\t\t\r\n\t\t// Add m4 friends\r\n\t\tm4.AddFriend(m11);\r\n\t\tm4.AddFriend(m12);\r\n\t\tm4.AddFriend(m13);\r\n\t\t\r\n\t\t// Add m5 friends\r\n\t\tm5.AddFriend(m14);\r\n\t\tm5.AddFriend(m15);\r\n\t\tm5.AddFriend(m16);\r\n\t\t\r\n\t\t// Add m6 friends\r\n\t\tm6.AddFriend(m17);\r\n\t\tm6.AddFriend(m18);\r\n\t\t \r\n\t\tSocialMedia.printFriends(m1);\r\n\t}", "public void search() {\r\n \t\r\n }", "public interface ActivityService {\n //分页展示首页的活动列表的接口\n PageInfo<HomeActivity> getHomeActivityPageInfo(\n Integer page, Integer rows, double coordLong, double coordLat);\n\n //搜索活动列表\n //分页返回搜索结果\n PageInfo<HomeActivity> getHomeActivityPageInfo(\n Integer page, Integer rows, double coordLong, double coordLat,\n String activityName);\n\n //根据活动类别返回对应活动列表\n //分页返回结果\n PageInfo<HomeActivity> getHomeActivityPageInfo(\n Integer page, Integer rows, double coordLong, double coordLat,\n String category, Integer collation, String district);\n\n //根据活动id和经纬度返回包装有志愿者等信息的活动详情\n ActivityDetails getActivityById(\n Integer id, double coordLong, double coordLat);\n\n //创建活动\n boolean createActivity(Activity activity);\n\n //根据志愿者id返回该志愿者参与的活动列表\n PageInfo<ActivityDetails> getActivityPageInfoByVolunteerId(\n Integer page, Integer rows, Integer id);\n\n //根据志愿者id返回该志愿者的服务历史\n PageInfo<ActivityDetails> getHistoricalActivityPageInfo(\n Integer page, Integer rows, Integer id);\n\n //根据组织id返回该组织的所有活动\n PageInfo<ActivityDetails> getActivityPageInfoByOrganizationId(\n Integer page, Integer rows, Integer id);\n\n //根据活动id和状态id更新活动\n String updateActivityStatusById(\n Integer id, Integer activityStatusId);\n}", "public Search(UserInput userInput) {\n\t\tthis.userInput = userInput;\n\t\tstorage = Storage.getInstance();\n\t\tfeedback = Feedback.getInstance();\n\t\tnew ArrayList<Task>();\n\t}", "List<TAlgmntBussRule> findTAlgmntBussRules(SearchFilter<TAlgmntBussRule> searchFilter);", "public Decision bestFor(Context context);", "public interface SearchView extends MvpView {\n\n @StateStrategyType(AddToEndStrategy.class)\n void setFilms(List<FilmPresentation> list);\n\n @StateStrategyType(AddToEndSingleStrategy.class)\n void clearSearch();\n\n @StateStrategyType(SkipStrategy.class)\n void noNetworkConnection();\n}", "public RankedSearch(CourseDataCache cache) {\n this.cache = cache;\n this.corpus = cache.getCorpus();\n\n\n setUpMappingsAndShortenings();\n this.whitespaceSuggestions = new HashMap<>();\n this.descriptionSearch = new DescriptionSearch(cache);\n this.courseCodeSearch = new CourseCodeSearch(cache);\n this.titleSearch = new TitleSearch(cache);\n this.smallWords = new HashSet<>();\n setUpSmallWords();\n }", "public static void main(String[] args) {\n\t\tlinearsearch oo=new linearsearch();\n\t\too.search();\n\t\t\n\t}", "TSearchResults searchWithQuery(TSearchQuery searchQuery, SearchParametersAPI overrideParameters, TRepo repo, AreaFactory<TContent, TArea> areaFactory, ContentFactory<TContent> contentFactory);", "public interface ComponetGraph {\n\n void inject(ManHuaApplication application);\n\n void inject(BaseActivity baseActivity);\n\n void inject(BaseFragment baseFragment);\n\n void inject(SettingActivity settingActivity);//设置\n\n void inject(BarrageSettingActivity barrageSettingActivity);//弹幕设置\n\n void inject(LookPhotoActivity lookPhotoActivity);//查看大图\n\n void inject(SplashActivity splashActivity);//启动页\n\n void inject(TestActivity testActivity);//启动页\n}", "public void testSearchByContent() {\n Message m1 = new Message(\"test\",\"bla bla david moshe\",_u1);\n Message.incId();\n try {\n Thread.sleep(10);\n } catch (InterruptedException ex) {\n ex.printStackTrace();\n }\n Message m2 = new Message(\"test2\",\"bla2 bla david tikva moshe\",_u1);\n Message.incId();\n Message m3 = new Message(\"test2\",\"moshe cohen\",_u1);\n Message.incId();\n\n this.allMsgs.put(m1.getMsg_id(), m1);\n this.allMsgs.put(m2.getMsg_id(), m2);\n this.allMsgs.put(m3.getMsg_id(), m3);\n\n this.searchEngine.addData(m1);\n this.searchEngine.addData(m2);\n this.searchEngine.addData(m3);\n\n /* SearchHit[] result = this.searchEngine.searchByContent(\"bla2\", 0,1);\n assertTrue(result.length==1);\n assertTrue(result[0].getMessage().equals(m2));\n\n SearchHit[] result2 = this.searchEngine.searchByContent(\"bla david tikva\", 0,2);\n assertTrue(result2.length==1);\n assertEquals(result2[0].getScore(),3.0);\n //assertEquals(result2[1].getScore(),2.0);\n assertTrue(result2[0].getMessage().equals(m2));\n //assertTrue(result2[1].getMessage().equals(m1));\n\n SearchHit[] result3 = this.searchEngine.searchByContent(\"bla2 tikva\", 0, 5);\n assertTrue(result3.length==0);\n */\n\n/*\n SearchHit[] result4 = this.searchEngine.searchByContent(\"bla OR tikva\", 0, 5);\n assertTrue(result4.length==2);\n assertTrue(result4[0].getMessage().equals(m2));\n assertTrue(result4[1].getMessage().equals(m1));\n\n SearchHit[] result5 = this.searchEngine.searchByContent(\"bla AND cohen\", 0, 5);\n assertTrue(result5.length==0);\n\n result5 = this.searchEngine.searchByContent(\"bla AND moshe\",0,5);\n assertTrue(result5.length==2);\n assertTrue(result5[0].getScore() == result5[1].getScore());\n assertTrue(result5[0].getMessage().equals(m2));\n assertTrue(result5[1].getMessage().equals(m1));\n\n result5 = this.searchEngine.searchByContent(\"bla AND moshe\", 10, 11);\n assertTrue(result5.length==0);\n */\n\n }", "private SearchAction makeSearchAction(boolean isSearchFree)\r\n throws MakeActionException, InvalidDateRangeException {\r\n if (params.length == 0) {\r\n throw new MakeActionException(SearchAction.ERR_INSUFFICIENT_ARGS);\r\n }\r\n\r\n SearchAction searchAction = new SearchAction(goku);\r\n\r\n // determine if search is to find free slots\r\n if (isSearchFree == true) {\r\n // test if datetime received is free of tasks\r\n searchAction.isSearchFree = isSearchFree;\r\n searchAction.freeDateQuery = parseDate();\r\n if (searchAction.freeDateQuery == null) {\r\n throw new MakeActionException(SearchAction.ERR_NO_VALID_DATE_FOUND);\r\n }\r\n } else {\r\n // search normally\r\n DateTime dq = extractDateQuery();\r\n DateTime dl = extractDeadline();\r\n DateRange dr = extractPeriod();\r\n searchAction.onDateQuery = dq;\r\n searchAction.dline = dl;\r\n searchAction.period = dr;\r\n\r\n // if datequery, deadline or periods are null, ignore keywords\r\n // \"on, by, from, to\"\r\n if (dq == null) {\r\n paramsOnIndex = null;\r\n }\r\n if (dl == null) {\r\n paramsByIndex = null;\r\n }\r\n if (dr == null) {\r\n paramsFromIndex = null;\r\n }\r\n\r\n String title = extractTitle();\r\n if (!title.isEmpty()) {\r\n searchAction.title = title;\r\n }\r\n }\r\n\r\n return searchAction;\r\n }", "public void startSearch() {\n if (solving) {\n Alg.Dijkstra();\n }\n pause(); //pause state\n }", "public void search(Indexer indexer, CityIndexer cityIndexer, Ranker ranker, String query, boolean withSemantic, ArrayList<String> chosenCities, ObservableList<String> citiesByTag, boolean withStemming, String saveInPath, String queryId, String queryDescription) {\n String[] originalQueryTerms = query.split(\" \");\n String originQuery = query;\n docsResults = new HashMap<>();\n parser = new Parse(withStemming, saveInPath, saveInPath);\n HashSet<String> docsOfChosenCities = new HashSet<>();\n query = \"\" + query + queryDescription;\n HashMap<String, Integer> queryTerms = parser.parseQuery(query);\n HashMap<String, ArrayList<Integer>> dictionary = indexer.getDictionary();\n if (!withStemming){\n setDocsInfo(saveInPath + \"\\\\docsInformation.txt\");\n }\n else{\n setDocsInfo(saveInPath + \"\\\\docsInformation_stemming.txt\");\n }\n\n\n //add semantic words of each term in query to 'queryTerms'\n if(withSemantic) {\n HashMap<String,ArrayList<String>> semanticWords = ws.connectToApi(originQuery);\n }\n\n //give an ID to query if it's a regular query (not queries file)\n if(queryId.equals(\"\")){\n queryId = \"\" + Searcher.queryID;\n Searcher.queryID++;\n }\n\n String postingDir;\n if (!withStemming) {\n postingDir = \"\\\\indexResults\\\\postingFiles\";\n } else {\n postingDir = \"\\\\indexResults\\\\postingFiles_Stemming\";\n }\n int pointer = 0;\n\n //find docs that contain the terms in the query in their text\n HashMap<String, Integer> queryTermsIgnoreCase = new HashMap<>();\n for (String term : queryTerms.keySet()) {\n String originTerm = term;\n if (!dictionary.containsKey(term.toUpperCase()) && !dictionary.containsKey(term.toLowerCase())) {\n continue;\n }\n if(dictionary.containsKey(term.toLowerCase())){\n term = term.toLowerCase();\n }\n else {\n term = term.toUpperCase();\n }\n queryTermsIgnoreCase.put(term,queryTerms.get(originTerm));\n pointer = dictionary.get(term).get(2);\n String chunk = (\"\" + term.charAt(0)).toUpperCase();\n\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + postingDir + \"\\\\posting_\" + chunk + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsResults'\n if(line != null) {\n findDocsFromLine(line, term);\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n //find docs that contain the chosen cities in their text\n for (String cityTerm : chosenCities) {\n if (!dictionary.containsKey(cityTerm) && !dictionary.containsKey(cityTerm.toLowerCase())) {\n continue;\n }\n if(dictionary.containsKey(cityTerm.toLowerCase())){\n cityTerm = cityTerm.toLowerCase();\n }\n pointer = dictionary.get(cityTerm).get(2);\n // char chunk = indexer.classifyToPosting(term).charAt(0);\n String chunk = (\"\" + cityTerm.charAt(0)).toUpperCase();\n\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + postingDir + \"\\\\posting_\" + chunk + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsOfChosenCities'\n String docs = line.substring(0, line.indexOf(\"[\") - 1); //get 'docsListStr'\n String[] docsArr = docs.split(\";\");\n for (String docInfo : docsArr) {\n String doc = docInfo.substring(0, docInfo.indexOf(\": \"));\n while(doc.charAt(0) == ' '){\n doc = doc.substring(1);\n }\n docsOfChosenCities.add(doc);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n //find docs that contain the chosen cities in their city tag\n if(!chosenCities.isEmpty()){\n for (String cityDicRec: chosenCities) {\n //get pointer to posting from cityDictionary\n try {\n pointer = cityIndexer.getCitiesDictionary().get(cityDicRec);\n } catch (NumberFormatException e) {\n e.printStackTrace();\n }\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + \"\\\\cityIndexResults\" + \"\\\\posting_city\" + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsOfChosenCities'\n String docs = line.substring(line.indexOf(\"[\") + 1, line.indexOf(\"]\")); //get 'docsListStr'\n String[] docsArr = docs.split(\"; \");\n for (String doc : docsArr) {\n docsOfChosenCities.add(doc);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n\n\n ranker.rank(docsResults, docsOfChosenCities, queryTermsIgnoreCase, dictionary, docsInfo,entities, queryId);\n }", "public interface SearchQuerySet extends QuerySet\n{\n\n // for AbstractSearch\n public static final int STAT_MODELS = 1;\n public static final int STAT_CLUSTERS = 2;\n public static final int STAT_GENOMES = 4;\n public static final int STAT_MODEL_CLUSTERS = 8;\n\n public String getStatsById(Collection data);\n public String getStatsByQuery(String query);\n public String getStatsById(Collection data,int stats);\n public String getStatsByQuery(String query,int stats);\n \n // for BlastSearch\n public String getBlastSearchQuery(Collection dbNames, Collection keys, KeyTypeUser.KeyType keyType);\n \n //for ClusterIDSearch\n public String getClusterIDSearchQuery(Collection input, int limit, int[] DBs, KeyTypeUser.KeyType keyType);\n \n // for ClusterNameSearch\n public String getClusterNameSearchQuery(Collection input, int limit, int[] DBs, KeyTypeUser.KeyType keyType);\n \n // for DescriptionSearch\n public String getDescriptionSearchQuery(Collection input, int limit, int[] DBs, KeyTypeUser.KeyType keyType);\n \n // for GoSearch \n public String getGoSearchQuery(Collection input, int limit, KeyTypeUser.KeyType keyType);\n \n // for GoTextSearch\n public String getGoTextSearchQuery(Collection input, int limit, KeyTypeUser.KeyType keyType);\n \n // for IdSearch\n public String getIdSearchQuery(Collection input, int limit, int[] DBs, KeyTypeUser.KeyType keyType);\n \n // for QueryCompSearch\n public String getQueryCompSearchQuery(String comp_id, String status, KeyTypeUser.KeyType keyType);\n \n // for QuerySearch\n public String getQuerySearchQuery(String queries_id, KeyTypeUser.KeyType keyType); \n \n // for SeqModelSearch\n public String getSeqModelSearchQuery(Collection model_ids, KeyTypeUser.KeyType keyType);\n \n // for UnknowclusterIdSearch\n public String getUnknownClusterIdSearchQuery(int cluster_id, KeyTypeUser.KeyType keyType);\n \n // for ProbeSetSearch\n public String getProbeSetSearchQuery(Collection input, int limit, KeyTypeUser.KeyType keyType);\n \n // for ProbeSetKeySearch\n public String getProbeSetKeySearchQuery(Collection input, int limit, KeyTypeUser.KeyType keyType);\n \n // for QueryTestSearch\n public String getQueryTestSearchQuery(String query_id, String version, String genome_id);\n \n // for QueryStatsSearch\n public String getQueryStatsSearchQuery(List query_ids,List DBs);\n \n // for PskClusterSearch\n public String getPskClusterSearchQuery(int cluster_id,KeyTypeUser.KeyType keyType);\n \n // for ClusterCorrSearch\n public String getClusterCorrSearchQuery(int cluster_id, int psk_id, KeyTypeUser.KeyType keyType);\n \n // for UnknownGenesSearch\n public String getUnknownGenesSearchQuery(Collection sources, KeyTypeUser.KeyType keyType);\n \n}", "@Override\n\tpublic void search() {\n\t\tpq = new IndexMinPQ<>(graph.getNumberOfStations());\n\t\tpq.insert(startIndex, distTo[startIndex]);\n\t\twhile (!pq.isEmpty()) {\n\t\t\tint v = pq.delMin();\n\t\t\tnodesVisited.add(graph.getStation(v));\n\t\t\tnodesVisitedAmount++;\n\t\t\tfor (Integer vertex : graph.getAdjacentVertices(v)) {\t\n\t\t\t\trelax(graph.getConnection(v, vertex));\n\t\t\t}\n\t\t}\n\t\tpathWeight = distTo[endIndex];\n\t\tpathTo(endIndex);\n\t}", "public interface IKataSolution\n extends IKataCommonSolution {\n\n public enum ACTION {\n TURN_LEFT, TURN_RIGHT, FORWARD, STAY\n }\n\n public enum ORIENTATION {\n UP (270), DOWN(90), LEFT(0), RIGHT(180);\n public int angle;\n ORIENTATION (int _angle) {\n angle = _angle;\n }\n public ORIENTATION moveLeft () {\n switch (this) {\n case UP: return LEFT;\n case DOWN: return RIGHT;\n case LEFT: return DOWN;\n case RIGHT: return UP;\n }\n return this;\n }\n public ORIENTATION moveRight () {\n switch (this) {\n case UP: return RIGHT;\n case DOWN: return LEFT;\n case LEFT: return UP;\n case RIGHT: return DOWN;\n }\n return this;\n }\n }\n\n public enum ITEM {\n EMPTY, PLANT, ANIMAL, END\n }\n\n public abstract class Animal {\n /**\n * Number of plants the animal ate\n */\n public int points;\n /**\n * Method to react to changing environmental conditions\n *\n * @param orientation animal's current orientation\n * @param view item currently in front of animal\n * @return action to do\n */\n public abstract ACTION react (ORIENTATION orientation, ITEM view);\n }\n\n /**\n * Factory method for an animal\n *\n * @param count count of animals to create\n * @param lastGeneration array of 'Animal' from last generation\n * @return array of 'Animal' instances\n */\n public abstract Animal[] createGeneration (int count, Animal[] lastGeneration);\n\n /**\n * If true, last generation will be visualized\n */\n public boolean visualizeLastGeneration ();\n\n /**\n * Defines how many generations of evolution should be tested\n * (minimum is 100, maximum is 10000)\n *\n * @return count of generations to test\n */\n public int countOfGenerations ();\n}", "public BookInfoResultsActivity(Context context, BookInfoActivity activity ) {\n this.context = context;\n this.statusField = statusField;\n this.roleField = roleField;\n //this.linearBox = linearBox;\n this.activity = activity;\n }", "public interface Activity extends RUP_Core_Elements {\n\n /* ***************************************************\n * Property http://www.semanticweb.org/morningstar/ontologies/2019/9/untitled-ontology-9#hasRecommendation\n */\n \n /**\n * Gets all property values for the hasRecommendation property.<p>\n * \n * @returns a collection of values for the hasRecommendation property.\n */\n Collection<? extends PM_Learning_Material> getHasRecommendation();\n\n /**\n * Checks if the class has a hasRecommendation property value.<p>\n * \n * @return true if there is a hasRecommendation property value.\n */\n boolean hasHasRecommendation();\n\n /**\n * Adds a hasRecommendation property value.<p>\n * \n * @param newHasRecommendation the hasRecommendation property value to be added\n */\n void addHasRecommendation(PM_Learning_Material newHasRecommendation);\n\n /**\n * Removes a hasRecommendation property value.<p>\n * \n * @param oldHasRecommendation the hasRecommendation property value to be removed.\n */\n void removeHasRecommendation(PM_Learning_Material oldHasRecommendation);\n\n\n /* ***************************************************\n * Property http://www.semanticweb.org/morningstar/ontologies/2019/9/untitled-ontology-9#isPerformOf\n */\n \n /**\n * Gets all property values for the isPerformOf property.<p>\n * \n * @returns a collection of values for the isPerformOf property.\n */\n Collection<? extends Role> getIsPerformOf();\n\n /**\n * Checks if the class has a isPerformOf property value.<p>\n * \n * @return true if there is a isPerformOf property value.\n */\n boolean hasIsPerformOf();\n\n /**\n * Adds a isPerformOf property value.<p>\n * \n * @param newIsPerformOf the isPerformOf property value to be added\n */\n void addIsPerformOf(Role newIsPerformOf);\n\n /**\n * Removes a isPerformOf property value.<p>\n * \n * @param oldIsPerformOf the isPerformOf property value to be removed.\n */\n void removeIsPerformOf(Role oldIsPerformOf);\n\n\n /* ***************************************************\n * Common interfaces\n */\n\n OWLNamedIndividual getOwlIndividual();\n\n OWLOntology getOwlOntology();\n\n void delete();\n\n}", "List<SearchResult> search(SearchQuery searchQuery);", "public interface Activity extends EJBObject {\r\n public void setLinkCondition(String linkCondition, Vector binds) throws RemoteException;\r\n\r\n public void setData(ActivityDao attrs) throws RemoteException;\r\n\r\n public ActivityDao getData() throws RemoteException;\r\n\r\n public void insert(ActivityDao attrs) throws RemoteException, DupKeyException, UserException;\r\n\r\n public void update(ActivityDao attrs) throws RemoteException, UserException;\r\n\r\n public void delete(Vector<String> actlistID) throws RemoteException, ConstraintViolatedException, UserException;\r\n\r\n public void findByPrimaryKey(ActivityDao attrs) throws RemoteException, RowNotFoundException, UserException;\r\n\r\n public void findNext(ActivityDao attrs) throws RemoteException, FinderException, RowNotFoundException;\r\n\r\n public void findPrev(ActivityDao attrs) throws RemoteException, FinderException, RowNotFoundException;\r\n\r\n public Collection listAll() throws RemoteException, RowNotFoundException, UserException;\r\n\r\n public Collection find(ActivityDao attrs) throws RemoteException, FinderException, RowNotFoundException;\r\n\r\n public Collection findExact(ActivityDao attrs) throws RemoteException, FinderException, RowNotFoundException;\r\n\r\n public String[] lookupDesc(Object[] pkKeys) throws RemoteException, RowNotFoundException;\r\n\r\n public Collection<ActivityDao> getActivityTree(String startActivityNode) throws RemoteException, RowNotFoundException, UserException;\r\n}", "List<Cemetery> search(String query);", "public interface Searcher<T> {\r\n\t\r\n\t//the search method\r\n\tpublic Solution<T> search(Searchable<T> s);\r\n\t\r\n\t//get how many nodes were evaluated by the algorithm\r\n\tpublic int getNumberOfNodesEvaluated();\r\n}", "public static IArtefact createActivityArtefact(JSONObject activity) {\n\t\t\n//\t\tSystem.out.println(\"DEBUG| createActivityArtefact activity: \"+activity);\n\t\tJSONObject object = activity.getJSONObject(ShindigConnector.ACTIVITY_OBJECT);\n\t\t\n\t\tswitch(object.getString(ShindigConnector.ACTIVITY_OBJECT_OBJECTTYPE)) {\n\t\t\tcase(ActivityController.TYPE_LIFERAY_BLOG_ENTRY):\n\t//\t\t\tSystem.out.println(\"It is a blog entry.\");\n\t\t\t\treturn new LiferayBlogArtefact(object.getString(\"id\").split(\":\")[1]);\t// blog entry id\n\t\t\tcase(ActivityController.TYPE_LIFERAY_FORUM_ENTRY):\n\t\t\tcase(ActivityController.TYPE_LIFERAY_FORUM_THREAD):\n\t//\t\t\tSystem.out.println(\"It is a forum entry.\");\n\t\t\t\treturn new LiferayForumArtefact(object.getString(\"id\").split(\":\")[1]);\t// message board message id\n\t\t\tcase(ActivityController.TYPE_LIFERAY_WEB_CONTENT):\n\t//\t\t\tSystem.out.println(\"It is a web content.\");\n\t\t\t\treturn new LiferayWebContentArtefact(object.getString(\"id\").split(\":\")[1]);\t// journal article id\n\t\t\tcase(ActivityController.TYPE_LIFERAY_WIKI_PAGE):\n\t//\t\t\tSystem.out.println(\"It is a wiki page.\");\n\t\t\t\treturn new LiferayWikiArtefact(object.getString(\"id\").split(\":\")[1]); // wiki page id\n\t\t\tcase(ActivityController.TYPE_NUXEO_DOCUMENT):\n\t//\t\t\tSystem.out.println(\"It is a nuxeo document.\");\n\t\t\t\treturn new NuxeoDocArtefact(object.getString(\"id\"));\t// document version series id\n\t\t\tcase(ActivityController.TYPE_OX_TASK):\n\t\t\t\tbreak;\n\t\t\tcase(ActivityController.TYPE_OX_CALENDAR_ENTRY):\n\t\t\t\tbreak;\n\t\t\tcase(ActivityController.TYPE_PUBLIC_MESSAGE):\n\t\t\t\tSocialMessageArtefact a = new SocialMessageArtefact(object.getString(\"id\"));\n\t\t\t\ta.setUserId(activity.getJSONObject(ShindigConnector.ACTIVITY_ACTOR).getString(ShindigConnector.ID));\n\t\t\t\treturn a;\n\t\t}\n\t\t\n//\t\tSystem.out.println(\"DEBUG| createActivityArtefact: return null!!!\");\n\t\treturn null;\n\t}", "public Solver(Board initial) {\r\n if (initial == null) throw new IllegalArgumentException();\r\n\r\n\r\n SearchNode initialAdjacent = new SearchNode(initial.twin(), null, 0);\r\n MinPQ<SearchNode> adjacentPriorityQueue = new MinPQ<>(1);\r\n adjacentPriorityQueue.insert(initialAdjacent);\r\n\r\n\r\n SearchNode initialNode = new SearchNode(initial, null, 0);\r\n MinPQ<SearchNode> priorityQueue = new MinPQ<>(1);\r\n priorityQueue.insert(initialNode);\r\n\r\n if (initial.isGoal()) {\r\n goal = initialNode;\r\n isSolvable = true;\r\n return;\r\n } else if (initialAdjacent.board.isGoal()) {\r\n isSolvable = false;\r\n }\r\n\r\n\r\n SearchNode currentAdjacent = initialAdjacent;\r\n SearchNode currentBoard = initialNode;\r\n\r\n while (!currentAdjacent.board.isGoal() && !currentBoard.board.isGoal()) {\r\n\r\n currentAdjacent = adjacentPriorityQueue.delMin();\r\n currentBoard = priorityQueue.delMin();\r\n\r\n for (Board adjacentNeighbor : currentAdjacent.board.neighbors()) {\r\n SearchNode toBeInserted = new SearchNode(adjacentNeighbor, currentAdjacent, currentAdjacent.previousMoves + 1);\r\n if (currentAdjacent.previousSearchNode == null || !toBeInserted.board.equals(currentAdjacent.previousSearchNode.board)) {\r\n adjacentPriorityQueue.insert(toBeInserted);\r\n }\r\n }\r\n\r\n\r\n for (Board neighbor : currentBoard.board.neighbors()) {\r\n SearchNode toBeInserted = new SearchNode(neighbor, currentBoard, currentBoard.previousMoves + 1);\r\n if (currentBoard.previousSearchNode == null || !toBeInserted.board.equals(currentBoard.previousSearchNode.board)) {\r\n\r\n priorityQueue.insert(toBeInserted);\r\n }\r\n }\r\n }\r\n if (currentAdjacent.board.isGoal()) {\r\n isSolvable = false;\r\n goal = initialNode;\r\n } else {\r\n goal = currentBoard;\r\n isSolvable = true;\r\n }\r\n\r\n }", "TSearchResults createSearchResults(TSearchQuery searchQuery);", "public static void main(String[] args) {\n //Instantiate a new instance of the Queries class called query\n Queries query = new Queries();\n //Instantiate empty strings called search, queryTerm, and cache\n String search = \"\";\n String queryTerm = \"\";\n String cache = \"\";\n\n //For each item in the arguments array\n for (int i = 0; i < args.length; i++) {\n //If the item is --search, run the following\n if (args[i].equals(\"--search\")) {\n //If --search is the last argument, set the search string to null\n if (i == args.length - 1) {\n search = null;\n }\n //Otherwise set the search string to the next argument\n else {\n search = args[i + 1];\n }\n }\n //If the item is --query run the following\n if (args[i].equals(\"--query\")) {\n //If --query is the last argument, set the queryTerm string to null\n if (i == args.length - 1) {\n queryTerm = null;\n }\n else {\n //Add the next item to the query string\n queryTerm = args[i + 1];\n //Instantiate an integer called j as i+1\n int j = i + 1;\n //While j is less than the number of arguments -1, and the argument\n //after j isn't --search or --cache and queryTerm isn't --search or --cache, add the j+1 argument to the queryTerm string\n while (j < args.length - 1 && !args[j + 1].equals(\"--search\") && !args[j + 1].equals(\"--cache\") && !queryTerm.equals(\"--search\") && !queryTerm.equals(\"--cache\")) {\n queryTerm += \" \" + args[j + 1];\n j++;\n }\n }\n }\n //If the item is --cache, run the following\n if (args[i].equals(\"--cache\")) {\n //If --cache is the last argument, set the cache string to null\n if (i == args.length - 1) {\n cache = null;\n }\n //Otherwise, set the cache string to the next argument\n else {\n cache = args[i + 1];\n }\n }\n }\n //Create a new file object from the cache\n File folder = new File(cache);\n //Instantiate a boolean variable called noErrors to true\n Boolean noErrors = true;\n //If the queryTerm string is null, --cache, or --search (indicating a missing argument), print\n //the appropriate error message and set noErrors to false\n if (queryTerm == null || queryTerm.equals(\"--cache\") || queryTerm.equals(\"--search\")) {\n System.out.println(\"Missing value for --query\\n\"\n + \"Malformed command line arguments.\");\n noErrors = false;\n }\n //If the search string is null, --cache, or --query (indicating a missing argument), print\n //the appropriate error message and set noErrors to false\n else if (search == null || search.equals(\"--cache\") || search.equals(\"--query\")) {\n System.out.println(\"Missing value for --search\\n\"\n + \"Malformed command line arguments.\");\n noErrors = false;\n }\n //If the search string isn't any of the valid search options, print the appropriate error messages and set noErrors to false\n else if (!search.equals(\"author\") && !search.equals(\"publication\") && !search.equals(\"venue\")) {\n System.out.println(\"Invalid value for --search: \" + search);\n System.out.println(\"Malformed command line arguments.\");\n noErrors = false;\n }\n //If the folder created from the cache string isn't a directory, print the appropriate error messages and set noErrors to false\n else if (!folder.isDirectory()) {\n System.out.println(\"Cache directory doesn't exist: \" + cache);\n noErrors = false;\n }\n //If noErrors is true, call the appropriate query with the queryTerm string and folder as parameters\n if (noErrors) {\n if (search.equals(\"author\")) {\n query.authorSearch(queryTerm, folder);\n }\n else if (search.equals(\"venue\")) {\n query.venueSearch(queryTerm, folder);\n }\n else if (search.equals(\"publication\")) {\n query.publicationSearch(queryTerm, folder);\n }\n }\n\n }" ]
[ "0.52946687", "0.527225", "0.5213", "0.51759475", "0.51393485", "0.5127181", "0.5095412", "0.5073466", "0.5050859", "0.5026429", "0.5019733", "0.50138354", "0.49985436", "0.4988133", "0.49828264", "0.4951299", "0.49107626", "0.4895628", "0.48912436", "0.48783162", "0.48756802", "0.48572254", "0.4853341", "0.48506716", "0.4846177", "0.48452675", "0.48375443", "0.48317245", "0.4824209", "0.4809371", "0.4804158", "0.47933713", "0.47638783", "0.47566527", "0.4736591", "0.47247902", "0.47163582", "0.4696947", "0.46849862", "0.46812552", "0.46647888", "0.46601963", "0.46599314", "0.46552995", "0.46436104", "0.4643537", "0.46363255", "0.46324357", "0.46307015", "0.46165267", "0.46165267", "0.45759532", "0.45742264", "0.45652393", "0.45635813", "0.45612603", "0.45566702", "0.45549592", "0.45437762", "0.4536449", "0.45340106", "0.45312965", "0.45288828", "0.45285192", "0.45283684", "0.45221886", "0.45186782", "0.45162946", "0.45138466", "0.450955", "0.45081383", "0.45074272", "0.45023653", "0.44963938", "0.4493689", "0.44897217", "0.44887373", "0.44866148", "0.4483218", "0.447627", "0.4475829", "0.4474737", "0.44739679", "0.44703278", "0.44663543", "0.44647816", "0.4464192", "0.446246", "0.4462269", "0.4457191", "0.44534588", "0.44529215", "0.44523177", "0.44478187", "0.44447944", "0.44431", "0.444179", "0.44222155", "0.44198155", "0.44150552" ]
0.4705325
37
Create an Activity based search strategy. "ActivityBased Search for BlackBox Constraint Propagramming Solver", Laurent Michel and Pascal Van Hentenryck, CPAIOR12. Uses default parameters (GAMMA=0.999d, DELTA=0.2d, ALPHA=8, RESTART=1.1d, FORCE_SAMPLING=1)
public static AbstractStrategy<IntVar> activity(IntVar[] VARS, long SEED) { return activity(VARS, 0.999d, 0.2d, 8, 1, SEED); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static AbstractStrategy<IntVar> activity(IntVar[] VARS, double GAMMA, double DELTA, int ALPHA,\n int FORCE_SAMPLING, long SEED) {\n return new ActivityBased(VARS[0].getSolver(), VARS, GAMMA, DELTA, ALPHA, FORCE_SAMPLING, SEED);\n }", "public static void main(String... args)\n {\n String path = Configuration.instance.dataDirectory + Configuration.instance.fileSeparator;\n String suffix = \"_default.xml\";\n String algorithm = \"\";\n boolean paramSeach = false;\n int maxGens = 10000;\n\n readItems();\n\n // Parsing CLI\n for (int i = 0; i < args.length; i++)\n {\n if (args[i].equals(\"-algorithm\"))\n {\n i++;\n algorithm = args[i];\n }\n\n if (args[i].equals(\"-configuration\"))\n {\n i++;\n if (args[i].equals(\"best\"))\n suffix = \"_best.xml\";\n }\n\n if (args[i].equals(\"-search_best_configuration\"))\n paramSeach = true;\n }\n\n if (paramSeach) suffix = \"_best.xml\";\n double[] hyperparameters = loadConfig(path + algorithm + suffix);\n System.out.println(\"Chosen algorithm: \" + algorithm);\n\n double time = System.currentTimeMillis();\n // Running correct algorithm according to CLI\n switch (algorithm)\n {\n case \"ga\":\n if (paramSeach)\n new GARecommender().recommend();\n else\n new Population(maxGens, hyperparameters).run();\n break;\n case \"sa\":\n case \"best-algorithm\":\n if (paramSeach)\n new SARecommender().recommend();\n else\n new Annealing(hyperparameters).run();\n break;\n case \"aco\":\n if (paramSeach)\n new ACORecommender().recommend();\n else\n new AntColony(maxGens, hyperparameters).run();\n break;\n case \"pso\":\n if (paramSeach)\n new PSORecommender().recommend();\n else\n new Swarm(maxGens * 10, hyperparameters).run(); // 10x max gens because PSO is does less per gen and is much faster\n break;\n default:\n System.out.println(\"Could not find algorithm with name \" + algorithm + \". Options are: ga, sa, aco, pso\");\n break;\n }\n System.out.println(\"Finished in: \" + ((System.currentTimeMillis() - time) / 1000) + \"s\");\n }", "public interface LDABetaInitStrategy{\n\t/**\n\t * Given a model and the corpus initialise the model's sufficient statistics\n\t * @param model\n\t * @param corpus\n\t */\n\tpublic void initModel(LDAModel model, Corpus corpus);\n\t\n\t/**\n\t * initialises beta randomly s.t. each each topicWord >= 1 and < 2\n\t * @author Sina Samangooei ([email protected])\n\t *\n\t */\n\tpublic static class RandomBetaInit implements LDABetaInitStrategy{\n\t\tprivate MersenneTwister random;\n\t\t\n\t\t/**\n\t\t * unseeded random\n\t\t */\n\t\tpublic RandomBetaInit() {\n\t\t\trandom = new MersenneTwister();\n\t\t}\n\t\t\n\t\t/**\n\t\t * seeded random\n\t\t * @param seed\n\t\t */\n\t\tpublic RandomBetaInit(int seed) {\n\t\t\trandom = new MersenneTwister(seed);\n\t\t}\n\t\t@Override\n\t\tpublic void initModel(LDAModel model, Corpus corpus) {\n\t\t\tfor (int topicIndex = 0; topicIndex < model.ntopics; topicIndex++) {\n\t\t\t\tfor (int wordIndex = 0; wordIndex < corpus.vocabularySize(); wordIndex++) {\n\t\t\t\t\tdouble topicWord = 1 + random.nextDouble();\n\t\t\t\t\tmodel.incTopicWord(topicIndex,wordIndex,topicWord);\n\t\t\t\t\tmodel.incTopicTotal(topicIndex, topicWord);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "Algorithm createAlgorithm();", "public static void main(String[] args) throws IOException {\n int activeThreshold = 300;\n //Activity.selectActive(\"st\", 6, activeThreshold);\n //Activity.selectActive(\"ri\", 6, activeThreshold);\n //Activity.selectActive(\"dw\", 9, activeThreshold);\n\n //Interaction.analysis(\"st\", 6);\n //Interaction.analysis(\"ri\", 6);\n\n //BehaviourIndicators.analysis(\"st\", 6);\n //BehaviourIndicators.analysis(\"ri\", 6);\n //BehaviourIndicators.analysis(\"dw\", 9);\n\n Engagement.analysis(\"st\",6);\n Engagement.analysis(\"ri\",6);\n //todo the data files for DW have to be adjusted to the ones of the other two to be able to run it\n //Engagement.analysis(\"dw\",9);\n\n //Motivation.analysis(\"ri\", 6);\n //Motivation.analysis(\"st\", 6);\n }", "public Solver(Board initial)\n {\n // validate input to Solver\n if (initial == null) throw new NullPointerException();\n if (!initial.isSolvable()) throw new IllegalArgumentException();\n \n // create first search node with pointer used for each iteration of A*\n step = new SearchNode();\n step.board = initial;\n \n // create new priority queue specifying the priority function\n MinPQ<SearchNode> pq = new MinPQ<SearchNode>(new HammingPriority());\n\n // run A-star search algorithm until goal board is dequeued\n while (!step.board.isGoal()) {\n // runs iterable of neighbors and adds non duplicates to pq\n Iterable<Board> neighbors = step.board.neighbors();\n for (Board b : neighbors) {\n // skips if possible board is duplicate of 2nd board back\n if (step.prev != null) // check not needed for first iteration\n if (b.equals(step.prev.board)) continue;\n \n // creates possible board's node and adds to pq\n SearchNode nextPossibleBoard = new SearchNode();\n nextPossibleBoard.board = b;\n nextPossibleBoard.prev = step;\n nextPossibleBoard.dist = step.dist + 1;\n pq.insert(nextPossibleBoard);\n }\n step = pq.delMin(); // dequeue next step toward goal board\n }\n \n moves = step.dist;\n goalNode = step;\n\n \n }", "public void search(int[] a, int x) {\r\n\t\tlang.setInteractionType(Language.INTERACTION_TYPE_AVINTERACTION);\r\n\t\t// Create Array: coordinates, data, name, display options,\r\n\t\t// default properties\r\n\t TextProperties headerProps = new TextProperties();\r\n\t headerProps.set(AnimationPropertiesKeys.FONT_PROPERTY, new Font(\r\n\t Font.SANS_SERIF, Font.BOLD, 24));\r\n\t\tText title = lang.newText(new Coordinates(20,30), \"Exponential Search\",\"titel\", null, headerProps);\r\n\t\t\r\n\t RectProperties rectProps = new RectProperties();\r\n\t rectProps.set(AnimationPropertiesKeys.FILLED_PROPERTY, true);\r\n\t rectProps.set(AnimationPropertiesKeys.FILL_PROPERTY, Color.CYAN);\r\n\t rectProps.set(AnimationPropertiesKeys.DEPTH_PROPERTY, 2);\r\n\t \r\n\t Rect hRect = lang.newRect(new Offset(-5, -5, \"titel\",\r\n\t AnimalScript.DIRECTION_NW), new Offset(5, 5, \"titel\", \"SE\"), \"hRect\",\r\n\t null, rectProps);\r\n//\t title.show();\r\n//\t hRect.show();\r\n\t\t\r\n\t\t//Rectangle header = lang.newRect(new Offset(-5, -5), lowerRight, name, display);\r\n\t\tText title_discr = lang.newText(new Coordinates(20, 80), \"Beschreibung des Algorithmus\",\"discr\", null);\r\n\t\tSourceCode discription = lang.newSourceCode(new Coordinates(20, 110),\"beschreibung\",null);\r\n\t\tdiscription.addCodeLine(\"Der Algorithmus in Worten:\", null, 0, null);\r\n\t\tdiscription.addCodeLine(\"\", null, 0, null);\r\n\t\tdiscription.addCodeLine(\"1. Finde den Bereich, in dem das Element vorhanden ist, indem man mit exponentialen Schritten durch das Array iteriert.\", null, 0, null);\r\n\t\tdiscription.addCodeLine(\"2. Führe eine binäre Suche in oben gefundenen Bereich durch.\", null, 0, null);\r\n\t\t\r\n//\t\tMultipleSelectionQuestionModel mulQuestion = new MultipleSelectionQuestionModel(\"1\");\r\n//\t\tmulQuestion.setPrompt(\"Welcher Algorithmus wird oder welche Algorithmen werden im ExponentialSearch verwendet?\");\r\n//\t\tmulQuestion.setNumberOfTries(1);\r\n//\t\tmulQuestion.addAnswer(\"Exponentialsearch\", 1, \"ist ein Bestandteil des Algorithmus\");\r\n//\t\tmulQuestion.addAnswer(\"FindNearestNeighbour\", 0, \"ist kein Bestandteil des Algorithmus\");\r\n//\t\tmulQuestion.addAnswer(\"Binarysearch\", 1, \"ist ein Bestandteil des Algorithmus\");\r\n//\t\tmulQuestion.addAnswer(\"Linearsearch\", 0, \"ist kein Bestandteil des Algorithmus\");\r\n//\t\tmulQuestion.addAnswer(\"Skipsearch\", 0, \"ist kein Bestandteil des Algorithmus\");\r\n//\t\tmulQuestion.addAnswer(\"BruteForce\", 0, \"ist kein Bestandteil des Algorithmus\");\r\n//\t\t\r\n//\t\tlang.addMSQuestion(mulQuestion);\r\n\t\t\r\n\t\tlang.nextStep(\"Einleitung\");\r\n\t\tTrueFalseQuestionModel trueFalseQ1 = new TrueFalseQuestionModel(\"1\", true, 1);\r\n\t\ttrueFalseQ1.setPrompt(\"Exponentialsearch Algorithmus benutzt den Binarysearch Algorithmus.\");\r\n\t\tlang.addTFQuestion(trueFalseQ1);\r\n\t\t\r\n\t\tTrueFalseQuestionModel trueFalseQ2 = new TrueFalseQuestionModel(\"1\", true, 1);\r\n\t\ttrueFalseQ2.setPrompt(\"Das Array muss sortiert sein.\");\r\n\t\tlang.addTFQuestion(trueFalseQ2);\r\n\r\n\t\ttitle_discr.hide();\r\n\t\tdiscription.hide();\r\n\t\t\r\n\t\tText t1 = lang.newText(new Coordinates(20, 80), \"Die zu suchende Zahl:\", \"suchende Zahl\", null);\r\n\t\tText t2 = lang.newText(new Coordinates(20, 100), \"x = \" + x, \"suchende Zahl\", null);\r\n\t\tText t3 = lang.newText(new Coordinates(20, 120), \"Das sortierte Array:\", \"sortierte Array\", null);\r\n\t\tText yellow = lang.newText(new Coordinates(180, 80), \"Gelb: von binären Suche geteilte Array\", \"yellow\", null);\r\n\t\t\r\n\t RectProperties rectProps2 = new RectProperties();\r\n\t rectProps2.set(AnimationPropertiesKeys.FILLED_PROPERTY, true);\r\n\t rectProps2.set(AnimationPropertiesKeys.FILL_PROPERTY, Color.YELLOW);\r\n\t rectProps2.set(AnimationPropertiesKeys.DEPTH_PROPERTY, 2);\r\n\t \r\n\t Rect hRect2 = lang.newRect(new Offset(-1, -1, \"yellow\",\r\n\t AnimalScript.DIRECTION_NW), new Offset(1, 1, \"yellow\", \"SE\"), \"hRect2\",\r\n\t null, rectProps2);\r\n\t\tText red = lang.newText(new Coordinates(180, 100), \"Rot: Element in Array[i]\", \"red\", null);\r\n\t\t\r\n\t RectProperties rectProps3 = new RectProperties();\r\n\t rectProps3.set(AnimationPropertiesKeys.FILLED_PROPERTY, true);\r\n\t rectProps3.set(AnimationPropertiesKeys.FILL_PROPERTY, Color.RED);\r\n\t rectProps3.set(AnimationPropertiesKeys.DEPTH_PROPERTY, 2);\r\n\t \r\n\t Rect hRect3 = lang.newRect(new Offset(-1, -1, \"red\",\r\n\t AnimalScript.DIRECTION_NW), new Offset(1, 1, \"red\", \"SE\"), \"hRect3\",\r\n\t null, rectProps3);\t \r\n\t \r\n\t \r\n\t\t// first, set the visual properties (somewhat similar to CSS)\r\n\t\tArrayProperties arrayProps = new ArrayProperties();\r\n\t\tarrayProps.set(AnimationPropertiesKeys.COLOR_PROPERTY, Color.BLACK);\r\n\t\tarrayProps.set(AnimationPropertiesKeys.FILL_PROPERTY, Color.WHITE);\r\n\t\tarrayProps.set(AnimationPropertiesKeys.FILLED_PROPERTY, Boolean.TRUE);\r\n\t\tarrayProps.set(AnimationPropertiesKeys.ELEMENTCOLOR_PROPERTY, Color.BLACK);\r\n\t\tarrayProps.set(AnimationPropertiesKeys.ELEMHIGHLIGHT_PROPERTY, Color.RED);\r\n\t\tarrayProps.set(AnimationPropertiesKeys.CELLHIGHLIGHT_PROPERTY, Color.YELLOW);\r\n\r\n\t\t// now, create the IntArray object, linked to the properties\r\n\t\tIntArray ia = lang.newIntArray(new Coordinates(20, 140), a, \"intArray\", null, arrayProps);\r\n\r\n\t\t\r\n\t\t\r\n//\t COUNTER\r\n\t String[] name = {\"Zuweisungen\",\"Zugriffe\"};\r\n\t\tTwoValueCounter counter = lang.newCounter(ia); // Zaehler anlegen\r\n\t CounterProperties cp = new CounterProperties(); // Zaehler-Properties anlegen\r\n\t cp.set(AnimationPropertiesKeys.FILLED_PROPERTY, true); // gefuellt...\r\n\t cp.set(AnimationPropertiesKeys.FILL_PROPERTY, Color.BLUE); // ...mit Blau\r\n\t // view anlegen, Parameter:\r\n\t // 1. Counter\r\n\t // 2. linke obere Ecke (kann auch Offset nutzen!)\r\n\t // 3. CounterProperties\r\n\t // 4. Anzeige Zaehlerwert als Zahl?\r\n\t // 5. Anzeige Zaehlerwert als Balken?\r\n\t // Alternativ: nur Angabe Counter, Koordinate und Properties\r\n\t TwoValueView view = lang.newCounterView(counter, new Coordinates(260, 30), cp, true, true, name);\r\n\t\t// start a new step after the array was created\r\n\t \r\n\t\tlang.nextStep(\"Initialisierung\");\r\n\t\t\r\n\r\n\t\t// Create SourceCode: coordinates, name, display options,\r\n\t\t// default properties\r\n\r\n\t\t// first, set the visual properties for the source code\r\n\t\tSourceCodeProperties scProps = new SourceCodeProperties();\r\n\t\tscProps.set(AnimationPropertiesKeys.CONTEXTCOLOR_PROPERTY, Color.BLUE);\r\n\t\tscProps.set(AnimationPropertiesKeys.FONT_PROPERTY, new Font(\"Monospaced\", Font.PLAIN, 12));\r\n\r\n\t\tscProps.set(AnimationPropertiesKeys.HIGHLIGHTCOLOR_PROPERTY, Color.RED);\r\n\t\tscProps.set(AnimationPropertiesKeys.COLOR_PROPERTY, Color.BLACK);\r\n\r\n\t\t// now, create the source code entity\r\n\t\tSourceCode sc = lang.newSourceCode(new Coordinates(40, 180), \"sourceCode\", null, scProps);\r\n\r\n\t\t// Add the lines to the SourceCode object.\r\n\t\t// Line, name, indentation, display dealy\r\n\t\tsc.addCodeLine(\"public int exponentialSearch(int[] arr, int n, int x) {\", null, 0, null); // 0\r\n\t\tsc.addCodeLine(\" \", null, 0, null); // 1\r\n\r\n\t\tsc.addCodeLine(\"if (arr[0] == x) \", null, 1, null); // 2\r\n\t\tsc.addCodeLine(\"return 0;\", null, 2, null); // 3\r\n\t\tsc.addCodeLine(\" \", null, 1, null); // 4\r\n\r\n\t\tsc.addCodeLine(\"int i = 1;\", null, 1, null); // 5\r\n\t\tsc.addCodeLine(\" \", null, 2, null); // 6\r\n\r\n\t\tsc.addCodeLine(\"while (i < n && arr[i] <= x) \", null, 1, null); // 7\r\n\t\tsc.addCodeLine(\"i = i*2;\", null, 2, null); // 8\r\n\t\tsc.addCodeLine(\" \", null, 4, null); // 9\r\n\r\n\t\tsc.addCodeLine(\"return Arrays.binarySearch(arr, i/2, Math.min(i, n), x); \", null, 1, null); // 10\r\n\t\tsc.addCodeLine(\"}\", null, 0, null); // 11\r\n\t\tsc.addCodeLine(\" \", null, 0, null); // 12\r\n\r\n\t\tsc.addCodeLine(\"public int binarySearch(int[] arr, int left, int right, int x) {\", null, 0, null); // 13\r\n\t\tsc.addCodeLine(\" \", null, 2, null); // 14\r\n\t\tsc.addCodeLine(\"if (right >= 1 && left <= right) {\", null, 1, null); // 15\r\n\t\tsc.addCodeLine(\"int mid = (left + right) / 2;\", null, 2, null); // 16\r\n\t\tsc.addCodeLine(\" \", null, 2, null); // 17\r\n\t\tsc.addCodeLine(\"if (arr[mid] == x)\", null, 2, null); // 18\r\n\t\tsc.addCodeLine(\"return mid;\", null, 3, null); // 19\r\n\t\tsc.addCodeLine(\" \", null, 2, null); // 20\r\n\t\tsc.addCodeLine(\"if (arr[mid] > x)\", null, 2, null); // 21\r\n\t\tsc.addCodeLine(\"return binarySearch(arr, left, mid-1, x);\", null, 3, null); // 22\r\n\t\tsc.addCodeLine(\" \", null, 2, null); // 23\r\n\t\tsc.addCodeLine(\"return binarySearch(arr, mid+1, right, x);\", null, 2, null); // 24\r\n\t\tsc.addCodeLine(\"}\", null, 1, null); // 25\r\n\t\tsc.addCodeLine(\"return -1;\", null, 1, null); // 26\r\n\t\tsc.addCodeLine(\"}\", null, 0, null); // 27\r\n\r\n\t\tlang.nextStep();\r\n\t\t// Highlight all cells\r\n\t\tia.highlightCell(0,ia.getLength()-1, null, null);\r\n\t\tint foundIndex = -1;\r\n\t\ttry {\r\n\t\t\t// Start Exp. Search\r\n\t\t\tfoundIndex = exponentialSearch(ia, sc, (ia.getLength() - 1), x);\r\n\t\t} catch (LineNotExistsException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tTextProperties textProp = new TextProperties();\r\n\t\t//textProp.set(AnimationPropertiesKeys.SIZE_PROPERTY, 40);\r\n\t\tText t4 = lang.newText(new Coordinates(400, 80), \"Die Zahl \"+ x + \" befindet sich in Index \" + foundIndex, \"Ende\", null, textProp);\r\n\t\tlang.nextStep();\r\n\t\tt1.hide();\r\n\t\tt2.hide();\r\n\t\tt3.hide();\r\n\t\tt4.hide();\r\n\t\tsc.hide();\r\n\t\tia.hide();\r\n\t\tyellow.hide();\r\n\t\tred.hide();\r\n\t\thRect2.hide();\r\n\t\thRect3.hide();\r\n\t\t\r\n\t\tText t5 = lang.newText(new Coordinates(20, 80), \"Zusammenfassung\", \"zusammenfassung\", null);\r\n\t\tSourceCode zsmf = lang.newSourceCode(new Coordinates(20, 110), \"zsmf\", null, scProps);\r\n\t\tzsmf.addCodeLine(\"1. Exponentielle Suche ist nützlich für die unbegrenzte Suche, wo die Größe vom Array gegen unendlich geht.\", null, 0, null);\r\n\t\tzsmf.addCodeLine(\"2. Die Performenz ist besser als die der en Suche für endlich große Arrays.\", null, 0, null);\r\n\t\t\r\n\t\tSourceCode zsmf2 = lang.newSourceCode(new Coordinates(20, 150), \"zsmf2\", null, scProps);\r\n\t\tzsmf2.addCodeLine(\"Komplexität in Abhängigkeit der Zeit:\", null, 0, null);\r\n\t\tzsmf2.addCodeLine(\"Worst-case - O(log i) + O(log i) = 2 O(log i)\", null, 1, null);\r\n\t\tzsmf2.addCodeLine(\"Best-case - O(1)\", null, 1, null);\r\n\t\tzsmf2.addCodeLine(\"Average-case - O(log i) + O(log i) = 2 O(log i)\", null, 1, null);\r\n\t\tzsmf2.addCodeLine(\"Hinweis: i steht für den Index des gesuchten Elements.\", null, 1, null);\r\n\t\tzsmf2.addCodeLine(\"Es werden jeweils die Komplexität des ersten und des zweiten Algorithmus zusammenaddiert\", null, 2, null);\r\n\t\tzsmf2.addCodeLine(\"Die Komplexität für den exponentiellen Teil ist log(i).\", null, 2, null);\r\n\t\tzsmf2.addCodeLine(\"Die Komplexität für den en Teil ist aufgrund der Begrenzung nicht mehr log(n), sondern log(i), da log(2^(log(i)-1)) = log(i)-1 = O(log(i))\", null, 2, null);\r\n\r\n\r\n\t\tTrueFalseQuestionModel trueFalseQ3 = new TrueFalseQuestionModel(\"3\", false, 1);\r\n\t\ttrueFalseQ3.setPrompt(\"Das Array darf keine doppelten Elemente enthalten\");\r\n\t\tlang.addTFQuestion(trueFalseQ3);\r\n\r\n\t\tlang.nextStep(\"Fazit\");\r\n\t\tlang.finalizeGeneration();\r\n\t}", "public static void main(String[] args)\r\n {\r\n //GammaDistribution gam = new GammaDistribution(10.0, 20.0);\r\n //double gamR = gam.sample();\r\n //System.out.println(gamR);\r\n \r\n for(String s : args)\r\n {\r\n System.out.println(s);\r\n }\r\n //if we run the code without any arguments then use default, else overwrite\r\n int lnth = args.length; \r\n if (lnth != 0 ) {\r\n int diff = 0;\r\n try {\r\n //totalT = Integer.valueOf(args[0+diff]);\r\n //totalY = Integer.valueOf(args[1+diff]);\r\n //totalYears = Integer.valueOf(args[2+diff]);\r\n dataSet = args[0+diff];\r\n yrs = Integer.valueOf(args[1+diff]);\r\n spreadYrs = Integer.valueOf(args[2+diff]);\r\n maxDepth = Integer.valueOf(args[3+diff]);\r\n popSize = Integer.valueOf(args[4+diff]);\r\n tournamentSize = (popSize / 100) - 1;\r\n mutProb = Double.valueOf(args[5+diff]);\r\n xoverProb = Double.valueOf(args[6+diff]); \r\n elitismPercentage = Double.valueOf(args[7+diff]);\r\n primProb = Double.valueOf(args[8+diff]);\r\n terminalNodeCrossBias = Double.valueOf(args[9+diff]);\r\n nGens = Integer.valueOf(args[10+diff]);\r\n lowerLowBound = Double.valueOf(args[11+diff]);\r\n lowerUpBound = Double.valueOf(args[12+diff]);\r\n upperLowBound = Double.valueOf(args[13+diff]);\r\n upperUpBound = Double.valueOf(args[14+diff]);\r\n movingAverage = Integer.valueOf(args[15+diff]);\r\n totalNumParams = 0;\r\n additionalParameters = 0;\r\n parameterIndex.add(0);\r\n for (int i = 16; i < args.length -1 + diff; i++) { // minus 1 as the last parameter is whether to use bound \r\n if (Integer.valueOf(args[i]) == 1) { \r\n totalNumParams++;\r\n parameterIndex.add(i-15); //parameterIndex starts from 1, becuase my pred value is in column 0\r\n if (i >= args.length -9 + diff) {//minus 1 to compensate for last value and minus 8 for the 9 parameters\r\n additionalParameters++;\r\n }\r\n } \r\n }\r\n lowerBound = Integer.valueOf(args[args.length - 1]); //last value is whether to use a lower bound\r\n } catch (ArrayIndexOutOfBoundsException t) {\r\n System.out.println(\"args not enough, please check\");\r\n }\r\n } else {\r\n for (int i = 0; i < totalNumParams; i++) {\r\n parameterIndex.add(i);\r\n }\r\n }\r\n FReader read = new FReader();\r\n header = read.readHeader(\"Data/header.txt\");\r\n parametersLength = header.length - 9; //take away the 9 parameters that will be calculated within GP\r\n \r\n Expr[] evolvedMethodParameters = new Expr[totalNumParams-1];\r\n eval = new PredictionEvaluatorTrue2(nRuns, contractLength, parameterIndex, parametersLength, additionalParameters);\r\n \r\n Function evolvedMethod = new Function(Double.TYPE, new Class[0]);\r\n TreeManager.evolvedMethod = evolvedMethod;\r\n \r\n \r\n for (int i=0; i<totalNumParams-1; i++) {\r\n \r\n evolvedMethodParameters[i] = new Parameter(i);\r\n } \r\n TreeManager.evolvedMethodParameters = evolvedMethodParameters;\r\n \r\n ArrayList methodSet = new ArrayList();\r\n methodSet.add(ADD);\r\n methodSet.add(SUB);\r\n methodSet.add(MUL);\r\n methodSet.add(DIV);\r\n methodSet.add(LOG);\r\n methodSet.add(SQRT);\r\n methodSet.add(POW);\r\n methodSet.add(MOD);\r\n //methodSet.add(SIN);\r\n //methodSet.add(COS);\r\n methodSet.add(EXP);\r\n\r\n\r\n Random r = new Random();\r\n ArrayList terminalSet = new ArrayList();\r\n// for (int i = 0; i < terminals; i++)\r\n// {\r\n// double rc = r.nextDouble();\r\n// terminalSet.add(new Constant(new Double(rc * 100.0D), Double.TYPE)); //Building in a function representing random numbers minimum and maximum, consider avearge\r\n// }\r\n// \r\n// //Add in numbers between 0 and 2 in blocks of 0.05 for the purpose of weights\r\n// \r\n// for (int i = 0; i < weights; i++)\r\n// {\r\n// double rc = (1 + i) * 0.05;\r\n// terminalSet.add(new Constant(new Double(rc), Double.TYPE));\r\n// }\r\n \r\n //terminalSet.add(new Constant(new Double(0.0D), Double.TYPE));\r\n //terminalSet.add(new Constant(new Double(3.141592653589793D), Double.TYPE));\r\n \r\n //For old data\r\n //Dynamically adds the number of parameters to be estimated, need to refer to data to input correct values\r\n //for (int i = 0; i < totalT; i++) {\r\n // terminalSet.add(new Parameter(i, Double.TYPE, Boolean.valueOf(true), \"Rain_t-\"+(i+1)));\r\n //}\r\n //for (int i = 0; i < totalY; i++) {\r\n // terminalSet.add(new Parameter(i+totalT, Double.TYPE, Boolean.valueOf(true), \"Year_t-\"+(i+1)));\r\n //}\r\n \r\n //For new data have headers read in and name accordingly.\r\n \r\n for (int i = 0; i < totalNumParams-1; i++) {\r\n terminalSet.add(new Parameter(i, Double.TYPE, Boolean.valueOf(true), header[parameterIndex.get(i)]));\r\n }\r\n \r\n \r\n //consider 3 ERC's one big range, 2 smaller ranges between -1 and 1\r\n terminalSet.add(new Constant(\"ERC\", Double.TYPE));\r\n terminalSet.add(new Constant(\"ERC2\", Double.TYPE));\r\n terminalSet.add(new Constant(\"ERC3\", Double.TYPE));\r\n \r\n double primProb = 0.6D;\r\n double terminalNodeCrossBias = 0.1D;\r\n TreeManager tm = new TreeManager(methodSet, terminalSet, primProb, maxInitialDepth, maxDepth, terminalNodeCrossBias);\r\n \r\n\r\n\r\n\r\n System.out.println(\"============= Experimental parameters =============\");\r\n System.out.println(\"Maximum initial depth: \" + maxInitialDepth);\r\n System.out.println(\"Maximum depth: \" + maxDepth);\r\n System.out.println(\"Primitive probability in Grow method: \" + primProb);\r\n System.out.println(\"Terminal node crossover bias: \" + terminalNodeCrossBias);\r\n System.out.println(\"No of generations: \" + nGens);\r\n System.out.println(\"Population size: \" + popSize);\r\n System.out.println(\"Tournament size: \" + tournamentSize);\r\n System.out.println(\"Crossover probability: \" + xoverProb);\r\n System.out.println(\"Reproduction probability: \" + (1.0D - xoverProb));\r\n System.out.println(\"Mutation probalitity: \" + mutProb);\r\n System.out.println(\"Elitism percentage: \" + elitismPercentage);\r\n System.out.println(\"===================================================\");\r\n \r\n \r\n \r\n \r\n \r\n StatisticalSummary.logExperimentSetup(methodSet, terminalSet, maxInitialDepth, maxDepth, primProb, terminalNodeCrossBias, nGens, popSize, tournamentSize, mutProb, xoverProb); \r\n \r\n StatisticalSummary stat = null;\r\n filenameS = \"Results/Results_\"+yrs+\"_\"+spreadYrs+\"_MA\"+movingAverage+\"_\"+contractLength;\r\n for (int i = 0; i < nRuns; i++)\r\n {\r\n System.out.println(\"========================== Experiment \" + i + \" ==================================\");\r\n File experiment = new File(filenameS + \"/Experiment \"+i);\r\n experiment.mkdirs();\r\n stat = new StatisticalSummary(nGens, popSize, i);\r\n alg = new GA(tm, eval, popSize, tournamentSize, stat, mutProb, elitismPercentage, xoverProb, nRuns);\r\n alg.evolve(nGens, i);\r\n System.out.println(\"===============================================================================\");\r\n }\r\n}", "public static void experiment(String name) {\n \tString probName = \"NQueensProblem\";\n \tList<OptimizationAlgorithm> algs = new ArrayList<>();\n int[] ranges = new int[N];\n Random random = new Random(N);\n for (int i = 0; i < N; i++) {\n \tranges[i] = random.nextInt();\n }\n NQueensFitnessFunction ef = new NQueensFitnessFunction();\n Distribution odd = new DiscretePermutationDistribution(N);\n NeighborFunction nf = new SwapNeighbor();\n MutationFunction mf = new SwapMutation();\n CrossoverFunction cf = new SingleCrossOver();\n Distribution df = new DiscreteDependencyTree(.1); \n \n HillClimbingProblem hcp = new GenericHillClimbingProblem(ef, odd, nf);\n GeneticAlgorithmProblem gap = new GenericGeneticAlgorithmProblem(ef, odd, mf, cf);\n ProbabilisticOptimizationProblem pop = new GenericProbabilisticOptimizationProblem(ef, odd, df);\n \n RandomizedHillClimbing rhc = new RandomizedHillClimbing(hcp); \n SimulatedAnnealing sa = new SimulatedAnnealing(1E1, .1, hcp);\n StandardGeneticAlgorithm ga = new StandardGeneticAlgorithm(200, 0, 10, gap);\n MIMIC mimic = new MIMIC(200, 10, pop);\n \n algs.add(rhc);\n algs.add(sa);\n algs.add(ga);\n algs.add(mimic);\n Experiment newExp = new Experiment();\n \n newExp.experiments(algs, ef, name);\n \n // test temperature for SA\n String paramName = \"Temperature\";\n String algName = \"SA\";\n List<Double> params2 = new ArrayList<>();\n List<OptimizationAlgorithm> algsTest = new ArrayList<>();\n for (double i = 1.0; i < 100.5; i+=1.0){\n \tparams2.add(i);\n \tsa = new SimulatedAnnealing(i, .1, hcp);\n \talgsTest.add(sa);\n }\n newExp.optParams(algsTest, ef, paramName, null, params2, algName, probName);\n \n // test cooling rate for SA\n paramName = \"CoolingRate\";\n params2 = new ArrayList<>();\n algsTest = new ArrayList<>();\n for (double i = 0.01; i < 0.51; i+=0.005){\n \tparams2.add(i);\n \tsa = new SimulatedAnnealing(1E1, i, hcp);\n \talgsTest.add(sa);\n }\n newExp.optParams(algsTest, ef, paramName, null, params2, algName, probName);\n \n // test populationSize for GA\n paramName = \"populationSize\";\n algName = \"GA\";\n List<Integer> params1 = new ArrayList<>();\n algsTest = new ArrayList<>();\n for (int i = 10; i < 1001; i+=10){\n \tparams1.add(i);\n \tga = new StandardGeneticAlgorithm(i, 0, 10, gap);\n \talgsTest.add(ga);\n }\n newExp.optParams(algsTest, ef, paramName, params1, null, algName, probName);\n \n // test toMate for GA\n paramName = \"toMate\";\n params1 = new ArrayList<>();\n algsTest = new ArrayList<>();\n for (int i = 0; i < 100; i+=1){\n \tparams1.add(i);\n \tga = new StandardGeneticAlgorithm(200, i, 10, gap);\n \talgsTest.add(ga);\n }\n newExp.optParams(algsTest, ef, paramName, params1, null, algName, probName);\n \n // test toMutate for GA\n paramName = \"toMutate\";\n params1 = new ArrayList<>();\n algsTest = new ArrayList<>();\n for (int i = 10; i < 1001; i+=10){\n \tparams1.add(i);\n \tga = new StandardGeneticAlgorithm(200, 0, i, gap);\n \talgsTest.add(ga);\n }\n newExp.optParams(algsTest, ef, paramName, params1, null, algName, probName);\n \n // test samples for MIMIC\n paramName = \"samples\";\n algName = \"MIMIC\";\n params1 = new ArrayList<>();\n algsTest = new ArrayList<>();\n for (int i = 100; i < 1101; i += 10){\n \tparams1.add(i);\n \tmimic = new MIMIC(i, 10, pop);\n \talgsTest.add(mimic);\n }\n newExp.optParams(algsTest, ef, paramName, params1, null, algName, probName);\n \n // test tokeep for MIMIC\n paramName = \"tokeeep\";\n params1 = new ArrayList<>();\n algsTest = new ArrayList<>();\n for (int i = 1; i < 101; i+=1){\n \tparams1.add(i);\n \tmimic = new MIMIC(200, i, pop);\n \talgsTest.add(mimic);\n }\n newExp.optParams(algsTest, ef, paramName, params1, null, algName, probName);\n \n \n // test different algorithms with various NQueensProblems\n // set up algorithms\n algs = new ArrayList<>();\n ga = new StandardGeneticAlgorithm(150, 98, 70, gap);\n algs.add(rhc);\n algs.add(sa);\n algs.add(ga);\n algs.add(mimic);\n // set up different efs\n List<EvaluationFunction> efs = new ArrayList<>();\n for (int i = 0; i < 50; i++){\n \tef = new NQueensFitnessFunction();\n \tefs.add(ef);\n }\n newExp.voteBest(algs, efs, 2000, probName);\n \n }", "@Override\n\t\t\t\t\tpublic Iterator<Tuple2<FirstStageAresSolution, Tuple5<Integer,Double,Double,Double,Double>>> call(Tuple2<MobileApplication, MobileDataDistributionInfrastructure> inputValues)\n\t\t\t\t\t\t\tthrows Exception {\n\t\t\t\t\t\tArrayList<Tuple2<FirstStageAresSolution,Tuple5<Integer,Double,Double,Double,Double>>> output = \n\t\t\t\t\t\t\t\t\t\tnew ArrayList<Tuple2<FirstStageAresSolution,Tuple5<Integer,Double,Double,Double,Double>>>();\n\t\t\t\t\t\tOffloadScheduler singleSearch;\n\t\t\t\t\t\t\n\t\t\t\t\t\tArrayList<FirstStageAresSolution> solutions;\n\t\t\t\t\t\t/*switch(SimulationSetup.placementAlgorithm)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tcase \"RANDOM\":\n\t\t\t\t\t\t\tRandomEdgePlanner.setupEdgeNodes(infrastructure);\n\t\t\t\t\t\t\tDefaultNetworkPlanner.setupNetworkConnections(infrastructure);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"ALL\":\n\t\t\t\t\t\t\tEdgeAllCellPlanner.setupEdgeNodes(infrastructure);\n\t\t\t\t\t\t\tDefaultNetworkPlanner.setupNetworkConnections(infrastructure);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"ares\":\n\t\t\t\t\t\t\tFirstStageAresPlanner planner = new FirstStageAresPlanner(inputValues);\n\t\t\t\t\t\t\tplanner.setupEdgeNodes(infrastructure);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tFirstStageAresPlanner aresP = new FirstStageAresPlanner(inputValues);\n\t\t\t\t\t\t\taresP.setupEdgeNodes(infrastructure);\n\t\t\t\t\t\t}*/\n\t\t\t\t\t\t\n\t\t\t\t\t\tSystem.out.println(\"Executing planner\");\n\t\t\t\t\t\t//FirstStageAresPlanner aresP = new FirstStageAresPlanner();\n\t\t\t\t\t\tFirstStageAresPlanner aresP = new FirstStageAresPlanner();\n\t\t\t\t\t\tSystem.out.println(\"Retrieving solutions\");\n\t\t\t\t\t\t//solutions = (ArrayList<FirstStageAresSolution>) aresP.getSolutionList();\n\t\t\t\t\t\tsolutions = (ArrayList<FirstStageAresSolution>) aresP.getSolutionList();\n\t\t\t\t\t\tSystem.out.println(\"Solutions retrieved!\");\n\t\t\t\t\t\t/*switch(algoritmName){\n\t\t\t\t\t\tcase \"weighted\":\n\t\t\t\t\t\t\tsingleSearch = new HeftEchoResearch(inputValues._1(), infrastructure);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"heft\":\n\t\t\t\t\t\t\tsingleSearch = new HEFTResearch(inputValues._1(), infrastructure);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"hbatt\":\n\t\t\t\t\t\t\tsingleSearch = new HEFTBattery(inputValues._1(), infrastructure);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"hcost\":\n\t\t\t\t\t\t\tsingleSearch = new HEFTCostResearch(inputValues._1(), infrastructure);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"bforce-rt\":\n\t\t\t\t\t\t\tsingleSearch = new BruteForceRuntimeOffloader(inputValues._1(), infrastructure);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"nsgaIII\":\n\t\t\t\t\t\t\tsingleSearch = new NSGAIIIResearch(inputValues._1(), infrastructure);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}*/\n\t\t\t\t\t\t//ArrayList<FirstStageAresSolution> temp = new ArrayList<FirstStageAresSolution>();\n\t\t\t\t\t\t//for(FirstStageAresSolution solution : solutions) {\n\t\t\t\t\t\tArrayList<FirstStageAresSolution> temp = new ArrayList<FirstStageAresSolution>();\n\t\t\t\t\t\tfor(FirstStageAresSolution solution : solutions) {\n\t\t\t\t\t\t\t//aresP.applySolutionToInfrastructure(solution, infrastructure);\n\t\t\t\t\t\t\t//ArrayList<InfrastructureProvisioningPlan> offloads = (ArrayList<InfrastructureProvisioningPlan>) singleSearch.findScheduling();\n\t\t\t\t\t\t\t//if(offloads != null)\n\t\t\t\t\t\t\t\t//for(InfrastructureProvisioningPlan os : offloads) \n\t\t\t\t\t\t\t\t//{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//System.out.println(solution);\n\t\t\t\t\t\t\t\t\t//plan.setInfEnergyConsumption(solution.getEnergyConsumption());\n\t\t\t\t\t\t\t\t\t//plan.setRunTime(solution.getAverageDistance());\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/*if(!temp.contains(solution)) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttemp.add(solution);\n\t\t\t\t\t\t\t\toutput.add(\n\t\t\t\t\t\t\t\t\t\tnew Tuple2<FirstStageAresSolution,Tuple5<Integer,Double,Double,Double,Double>>\n\t\t\t\t\t\t\t\t\t\t(solution,\n\t\t\t\t\t\t\t\t\t\t\t\tnew Tuple5<Integer,Double,Double,Double,Double>(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsolution.getAverageDistance(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t0.0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsolution.getEnergyConsumption(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t0.0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)));\n\t\t\t\t\t\t\t}*/\n\t\t\t\t\t\t\tif(!temp.contains(solution)) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttemp.add(solution);\n\t\t\t\t\t\t\t\toutput.add(\n\t\t\t\t\t\t\t\t\t\tnew Tuple2<FirstStageAresSolution,Tuple5<Integer,Double,Double,Double,Double>>\n\t\t\t\t\t\t\t\t\t\t(solution,\n\t\t\t\t\t\t\t\t\t\t\t\tnew Tuple5<Integer,Double,Double,Double,Double>(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsolution.getAverageDistance(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t0.0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsolution.getEnergyConsumption(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t0.0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn output.iterator();\n\t\t\t\t\t}", "void searchConstraintHit (Search search);", "@Override\n protected void start() throws Exception {\n LogManager.getLogger().log(ALGORITHM, \"STARTING TABU SEARCH...\");\n LogManager.getLogger().log(ALGORITHM, \"MAX ITERATIONS: \" + maxIterations);\n LogManager.getLogger().log(ALGORITHM, \"MAX ITERATIONS WITHOUT IMPROVEMENTS: \" + maxIterationsWithoutImprovement);\n LogManager.getLogger().log(ALGORITHM, \"MIN QUEUE: \" + minQueue);\n LogManager.getLogger().log(ALGORITHM, \"RISING TREND: \" + risingTrend);\n LogManager.getLogger().log(ALGORITHM, \"MAX THREADS: \" + (maxThreads != null ? maxThreads : \"DEFAULT\"));\n LogManager.getLogger().log(ALGORITHM, \"MULTI-STARTS -> # OF GREEDY: \" + greedyMultiStart + \", # OF RANDOM: \" + randomMultiStart);\n\n String iSettings = null;\n if (intensificationLearning) {\n iSettings = \"LEARNING\";\n }\n if (localSearchIntensification) {\n if (iSettings != null) {\n iSettings += \", \";\n } else {\n iSettings = \"\";\n }\n iSettings += \"LOCAL SEARCH\";\n }\n if (pathRelinking) {\n if (iSettings != null) {\n iSettings += \", \";\n } else {\n iSettings = \"\";\n }\n iSettings += \"PATH RELINKING\";\n }\n if (intensification) {\n if (iSettings != null) {\n iSettings += \", \";\n } else {\n iSettings = \"\";\n }\n iSettings += \"INTENSIFICATION\";\n }\n if (iSettings == null) {\n iSettings = \"NONE\";\n }\n LogManager.getLogger().log(ALGORITHM, \"INTENSIFICATION SETTINGS: \" + iSettings);\n\n String dSettings = null;\n if (diversificationLearning) {\n dSettings = \"LEARNING\";\n }\n if (greedyMultiStart + randomMultiStart > 1) {\n if (dSettings != null) {\n dSettings += \", \";\n } else {\n dSettings = \"\";\n }\n dSettings += \"MULTI-STARTS\";\n }\n if (moveDiversification) {\n if (dSettings != null) {\n dSettings += \", \";\n } else {\n dSettings = \"\";\n }\n dSettings += \"MOVE DIVERSIFY\";\n }\n if (diversification) {\n if (dSettings != null) {\n dSettings += \", \";\n } else {\n dSettings = \"\";\n }\n dSettings += \"DIVERSIFICATION\";\n }\n if (dSettings == null) {\n dSettings = \"NONE\";\n }\n LogManager.getLogger().log(ALGORITHM, \"DIVERSIFICATION SETTINGS: \" + dSettings);\n\n LabeledUndirectedGraph<N, E> zero = getZeroGraph(minGraph);\n\n if (!zero.isConnected()) {\n minCost = zero.calculateCost() + 1;\n\n Queue<LabeledUndirectedGraph<N, E>> startsQueue = new LinkedList<>();\n for (int i = 0; i < greedyMultiStart; i++) {\n startsQueue.add(applyMVCA());\n }\n for (int i = 0; i < randomMultiStart; i++) {\n startsQueue.add(new LabeledUndirectedGraph<>(getSpanningTree(graph)));\n }\n int nthreads = Runtime.getRuntime().availableProcessors();\n if (maxThreads != null) {\n if (maxThreads <= 1) {\n nthreads = 1;\n } else {\n nthreads = maxThreads;\n }\n }\n nthreads = Integer.min(nthreads, (greedyMultiStart + randomMultiStart));\n\n LogManager.getLogger().log(ALGORITHM, \"THREADS: \" + nthreads);\n\n //PRINT PROGRESS\n prog = 0;\n tot = startsQueue.size();\n print(Ansi.ansi().cursor().save().erase().eraseLine().a(String.format(\"\\t%.2f%%\", prog)));\n\n if (nthreads == 1) {\n while (!startsQueue.isEmpty()) {\n compute(startsQueue.poll());\n\n //PRINT PROGRESS\n// prog = (tot - startsQueue.size()) * 100 / tot;\n prog = 100;\n print(Ansi.ansi().cursor().load().erase().eraseLine().a(String.format(\"\\t%.2f%%\", prog)));\n }\n } else {\n\n List<Thread> pool = new ArrayList<>();\n for (int i = 0; i < nthreads; i++) {\n Thread th = new Thread(() -> {\n try {\n boolean empty;\n synchronized (lock) {\n empty = startsQueue.isEmpty();\n }\n\n while (!empty) {\n LabeledUndirectedGraph<N, E> g;\n\n synchronized (lock) {\n g = startsQueue.poll();\n }\n compute(g);\n synchronized (lock) {\n empty = startsQueue.isEmpty();\n\n //PRINT PROGRESS\n// prog = (tot - startsQueue.size()) * 100 / tot;\n prog++;\n double _prog = this.prog * 100 / tot;\n print(Ansi.ansi().cursor().load().erase().eraseLine().a(String.format(\"\\t%.2f%%\", _prog)));\n }\n }\n } catch (Exception ex) {\n throw new RuntimeException(ex);\n }\n });\n th.setDaemon(false);\n th.setName(\"TabuSearch_Calc_\" + i);\n th.setPriority(Thread.MAX_PRIORITY);\n th.start();\n pool.add(th);\n }\n for (Thread th : pool) {\n th.join();\n }\n }\n\n println();\n\n minGraphs.forEach(_min -> {\n if (_min.calculateCost() < minGraph.calculateCost()) {\n minGraph = _min;\n }\n });\n\n LogManager.getLogger().log(ALGORITHM, \"END TABU SEARCH.\");\n LogManager.getLogger().log(ALGORITHM, \"BEST AT THIS POINT: \" + minGraph.calculateCost());\n\n if (pathRelinking) {\n LogManager.getLogger().log(ALGORITHM, \"STARTING PATH RELINKING...\");\n\n pathRelinking(pathRelinkingAlt);\n\n println();\n LogManager.getLogger().log(ALGORITHM, \"BEST AT THIS POINT: \" + minGraph.calculateCost());\n }\n } else {\n minGraph = zero;\n }\n\n LogManager.getLogger().log(ALGORITHM, \"END.\");\n }", "public static void main(String[] args) throws FileNotFoundException, IOException {\nfor (double b = 0.5; b < 0.51; b+=0.1) {\n for (double k = 4.40; k < 4.5; k+=0.5) {\n Machine.b = 0.5; //0.2 - ATCnon-delay\n Machine.k = 1.5; //1.4 - ATCnon delay\n int hits = 0;\n engineJob = new cern.jet.random.engine.MersenneTwister(99999);\n noise = new cern.jet.random.Normal(0, 1, engineJob);\n SmallStatistics[] result = new SmallStatistics[5];\n result[0] = new SmallStatistics();\n result[1] = new SmallStatistics();\n for (int ds = 0; ds < 2; ds++) {\n JSPFramework[] jspTesting = new JSPFramework[105];\n for (int i = 0; i < jspTesting.length; i++) {\n jspTesting[i] = new JSPFramework();\n jspTesting[i].getJSPdata(i*2 + 1);\n }\n //DMU - instances (1-80)//la - instances (81-120)\n //mt - instances (121/-123)//orb - instances (124-133)//ta -instances (134-173)\n //////////////////////////////////////////////\n for (int i = 0; i < jspTesting.length; i++) {\n double countEval = 0;\n double tempObj = Double.POSITIVE_INFINITY;\n double globalBest = Double.POSITIVE_INFINITY;\n boolean[] isApplied_Nk = new boolean[2]; //Arrays.fill(isApplied_Nk, Boolean.TRUE);\n int Nk = 0; // index of the Iterative dispatching rule to be used\n jspTesting[i].resetALL();\n boolean firstIteration = true;\n double countLargeStep = 0;\n do{\n countEval++;\n //start evaluate schedule\n jspTesting[i].reset();\n int N = jspTesting[i].getNumberofOperations();\n jspTesting[i].initilizeSchedule();\n int nScheduledOp = 0;\n\n //choose the next machine to be schedule\n while (nScheduledOp<N){\n\n Machine M = jspTesting[i].Machines[jspTesting[i].nextMachine()];\n\n jspTesting[i].setScheduleStrategy(Machine.scheduleStrategy.HYBRID );\n jspTesting[i].setPriorityType(Machine.priorityType.ATC);\n jspTesting[i].setNonDelayFactor(0.3);\n //*\n jspTesting[i].setInitalPriority(M);\n for (Job J:M.getQueue()) {\n double RJ = J.getReadyTime();\n double RO = J.getNumberRemainingOperations();\n double RT = J.getRemainingProcessingTime();\n double PR = J.getCurrentOperationProcessingTime();\n double W = J.getWeight();\n double DD = J.getDuedate();\n double RM = M.getReadyTime();\n double RWT = J.getCurrentOperationWaitingTime();\n double RFT = J.getFinishTime();\n double RNWT = J.getNextOperationWaitingTime();\n int nextMachine = J.getNextMachine();\n\n if (nextMachine==-1){\n RNWT=0;\n } else {\n RNWT = J.getNextOperationWaitingTime();\n if (RNWT == -1){\n RNWT = jspTesting[i].getMachines()[nextMachine].getQueueWorkload()/2.0;\n }\n }\n if (RWT == -1){\n RWT = M.getQueueWorkload()/2.0;\n }\n //J.addPriority((W/PR)*Math.exp(-maxPlus((DD-RM-PR-(RT-PR+J.getRemainingWaitingTime(M)))/(3*M.getQueueWorkload()/M.getNumberofJobInQueue())))); //iATC\n //J.addPriority((PR*PR*0.614577*(-RM-RM/W)-RT*PR*RT/W)\n // -(RT*PR/(W-0.5214191)-RM/W*PR*0.614577+RT*PR/(W-0.5214191)*2*RM/W));\n //J.addPriority(((W/PR)*((W/PR)/(RFT*RFT)))/(max(div((RFT-RT),(RWT/W)),IF(RFT/W-max(RFT-RT,DD),DD,RFT))+DD/RFT+RFT/W-max(RFT-RFT/W,DD))); //best TWT priorityIterative\n if (Nk==0)\n //J.addPriority(min(W/PR-RFT+min(RT,W/RFT),((min(RT,RNWT-RFT)/(RJ-min(RWT,RFT*0.067633785)))/(RJ-min(RWT,RFT*0.067633785))))/RFT);\n J.addPriority(min(W/PR-RFT+min(RT,W/RFT),((div(min(RT,RNWT-RFT),(RJ-min(RWT,RFT*0.067633785))))/(RJ-min(RWT,RFT*0.067633785))))/RFT);\n else\n J.addPriority(min((((W/PR)/RFT)/(2*RNWT+max(RO,RFT)))/(PR+RNWT+max(RO,RFT)),((W/PR)/RFT)/PR)/RFT);\n }\n //jspTesting[i].calculatePriority(M);\n jspTesting[i].sortJobInQueue(M);\n Job J = M.completeJob();\n if (!J.isCompleted()) jspTesting[i].Machines[J.getCurrentMachine()].joinQueue(J);\n nScheduledOp++;\n }\n double currentObj = -100;\n currentObj = jspTesting[i].getTotalWeightedTardiness();\n if (tempObj > currentObj){\n tempObj = currentObj;\n jspTesting[i].recordSchedule();\n Arrays.fill(isApplied_Nk, Boolean.FALSE);\n //System.out.println(\"Improved!!!\");\n }\n else {\n isApplied_Nk[Nk] = true;\n if (!isNextApplied(Nk, isApplied_Nk)) Nk = circleShift(Nk, isApplied_Nk.length);\n else {\n if (globalBest>tempObj) {\n globalBest = tempObj;\n jspTesting[i].storeBestRecordSchedule();\n } jspTesting[i].restoreBestRecordSchedule();\n if (countLargeStep<1) {\n tempObj = Double.POSITIVE_INFINITY;\n Arrays.fill(isApplied_Nk, Boolean.FALSE);\n jspTesting[i].shakeRecordSchedule(noise, engineJob, globalBest);\n countLargeStep++;\n }\n else break;\n }\n }\n firstIteration = false;\n \n } while(true);\n result[ds].add(jspTesting[i].getDevREFTotalWeightedTardiness(globalBest));\n if (jspTesting[i].getDevLBCmax()==0) hits++;\n System.out.println(jspTesting[i].instanceName + \" & \"+ globalBest + \" & \" + countEval);\n }\n }\n //jsp.schedule();\n //*\n System.out.println(\"*************************************************************************\");\n System.out.println(\"[ & \" + formatter.format(result[0].getMin()) + \" & \"\n + formatter.format(result[0].getAverage()) + \" & \" + formatter.format(result[0].getMax()) +\n \" & \" + formatter.format(result[1].getMin()) + \" & \"\n + formatter.format(result[1].getAverage()) + \" & \" + formatter.format(result[1].getMax()) + \"]\");\n //*/\n System.out.print(\"\"+formatter.format(result[0].getAverage()) + \" \");\n }\n System.out.println(\"\");\n}\n }", "TabuSearchwithGreedy(double wl, double ar, TransactionClass tc, Partition p,\n\t\t\tint useCase) {\n\t\tsuper(wl, ar, tc, p, useCase);\n\t\t// TODO Auto-generated constructor stub\n\t}", "public Algorithms.Search<State<E>,HeuristicNode<State<E>,Double>>.Result search(Signature<E> request){\n log.info(\"Initializing composition search problem...\");\n // Composition starts with the request:\n Stopwatch compositionWatch = Stopwatch.createStarted();\n // Build the initial match graph network (first pass)\n ServiceMatchNetwork<E, T> network = discoverer.search(request);\n // Apply optimizations\n Stopwatch optWatch = Stopwatch.createStarted();\n for(NetworkOptimizer<E,T> opt : optimizations){\n network = opt.optimize(network);\n }\n optWatch.stop();\n log.info(\"Graph optimizations done in {}\", optWatch);\n log.info(\"Starting search over a network with {} levels and {} operations\", network.numberOfLevels(), network.listOperations().size());\n // Run search over network\n Algorithms.Search<State<E>,HeuristicNode<State<E>,Double>>.Result searchResult = CompositSearch.create(network).search();\n log.info(\"Optimal composition search finished in {}\", searchResult.getStopwatch().toString());\n log.debug(\" Composition : {}\", searchResult.getOptimalPath());\n log.debug(\" Total iterations : {}\", searchResult.getIterations());\n log.info(\" Composition runpath : {}\", searchResult.getOptimalPath().size()-2);\n log.info(\" Composition services: {}\", searchResult.getGoalNode().getScore());\n log.info(\"Total composition time : {}\", compositionWatch.stop().toString());\n\n List<State<E>> states = searchResult.getOptimalPath();\n List<Set<Operation<E>>> ops = Lists.transform(states, new Function<State<E>, Set<Operation<E>>>() {\n @Override\n public Set<Operation<E>> apply(State<E> state) {\n return state.getStateOperations();\n }\n });\n return searchResult;\n }", "public static void main(String[] args) throws IOException, InterruptedException, Household.InvalidHouseholdException, Matching.HouseholdAlreadyMatchedException, HousingMarket.FreeSpaceException, Matching.HouseAlreadyMatchedException, Matching.HouseholdLinkedToMultipleException, Matching.HouseholdLinkedToHouseholdException, DynamicMatching.TooManyTimestepsException, Matching.HouseLinkedToMultipleException, MatchingEvaluator.HouseholdIncomeTooHighException, CycleFinder.FullyExploredVertexDiscoveredException, Matching.PreferredNoHouseholdlessHouseException, Matching.HouseLinkedToHouseException {\n String inputFileName = \"../../Data/Input/test2.csv\";\n String outputfolder = \"../../Data/Output/Scores/\";\n\n int nTimes = 50; // Amount of matchings generated per configuration.\n long allowedRunningTime = 1_000; // Time an experiment for _nTimes_ matchings is allowed to run.\n int maxVal = 150; // Maximum lineCount.\n float timestepRatio = 2/3f; // Ratio of time-steps in a dynamic matching that have not yet been taken.\n // Uses H or F, whichever is lowest.\n // ---------------------------------------------------------------------------------------------------\n\n\n int[] startLines = new int[50];\n int counter = 0;\n for (int i = 0; i < 50; i++) {\n startLines[i] = counter;\n counter = counter + (1000 - maxVal) / nTimes; // == 17 with maxVal == 150 & nTimes == 50.\n }\n\n ArrayList<Double> envRatios = new ArrayList<>(Arrays.asList(0.5, 0.75, 1.0, 1.25, 1.5));\n\n ArrayList<Integer> lineCounts = new ArrayList<>(Arrays.asList(5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 20, 25, 30, 35, 40, 45, 50, 75, 100, 125, 150));\n// ArrayList<Integer> lineCounts = new ArrayList<>(Arrays.asList(5, 6, 7, 8, 9, 10, 11, 12));\n// ArrayList<Integer> lineCounts = new ArrayList<>(Arrays.asList(20, 25, 30, 35, 40, 45, 50, 75, 100, 125, 150));\n\n Experimenter experimenter = new Experimenter(inputFileName, outputfolder, allowedRunningTime, nTimes, startLines, envRatios, lineCounts, timestepRatio);\n experimenter.runExperiments();\n }", "public ActivityExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "Association findAssociation(World w, BlockPos pos, String strategy);", "public interface ISearchable {\n\n\n AState getStartState () throws NullError;\n\n AState getGoalState () throws NullError;\n\n ArrayList<AState> getAllSuccessors (AState state) throws LowBoundInput, OutOfBoundMatrixInput, NullError;\n\n}", "public interface SearchAlgorithm {\n\t/**\n\t * Searches the state space for a solution.\n\t * @param root\n\t * The root state to begin search from.\n\t * @param expanded_list\n\t * The expanded list in order of expansion. Filled by function.\n\t * @param goal\n\t * The goal state representation used to test if we reached the goal state.\n\t * @return\n\t * The search results containing all needed information about the search and the results.\n\t */\n\tSearchResult search(State root, List<State> expanded_list, State goal);\n}", "public AlphaBetaSearch(SearchLimitingPredicate<T> searchLimitingPredicate) {\n this.searchLimitingPredicate = searchLimitingPredicate;\n }", "ParameterRefinement createParameterRefinement();", "public Node newAlphaBeta(Node node, boolean isMaximizing, Node[][] gameBoard,int playerID,int depth,boolean searchOnce) throws InterruptedException {\n\t\tif(depth==0) //node equals terminal node origin ***************************\n\t\t{\n\n\t\t\t\n\t\t\treturn node; //return heuristic value accumulated Score\n\t\t}\n\t\t\n\t\tif(isMaximizing == true)//max\n\t\t{\n\t\t\t\n\t\t\tNode[][] copyOne = new Node[gameBoard.length][gameBoard.length];\n\t\t\tint enescore=0;\n\t\t\tint nodesRx = 0;\n\t\t\tint nodesRy = 0;\n\t\t\tNode temNode = node;\n\t\t\t//opponent score\n\t\t\tif(node!=null)\n\t\t\t{\tenescore = node.enemy;\n\t\t\tnodesRx = node.maxrecordSearchedX;\n\t\t\tnodesRy = node.maxrecordSearchedY;}\n\t\t\t\n\t\t for (int i = 0; i < gameBoard.length; i++) {\n\t\t \tfor(int j =0;j<gameBoard.length;j++)\n\t\t \t{\t\n\t\t \t\tNode temp = new Node(gameBoard[i][j].getScore(),gameBoard[i][j].getX(),gameBoard[i][j].getY(),gameBoard[i][j].getOwnership());\n\t\t \t\tcopyOne[i][j]=temp;\n\t\t \t}\n\t\t }\n\t\t \n\t\t \n\t\t\tPriorityQueue<Node> playerOneChildrenList = new PriorityQueue<Node>(Collections.reverseOrder()); //use priorityQueue,acsending or disacsending.\n\t\t\tQueue<Node> waitList = new LinkedList<Node>();\n\t\t\tboolean walkable = false;\n\t\t\t\n\t\t\t\tfor(int i = 0;i<gameBoard.length;i++)\n\t\t\t\t{\n\t\t\t\t\tfor(int j =0;j<gameBoard.length;j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(copyOne[i][j].getOwnership()==0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\twaitList.add(new Node(copyOne[i][j].getScore(),i,j,playerID));//everyPosition through the 2D array\n\t\t\t\t\t\twalkable = true;\n\t\t\t\t//\t\tcounter++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\tif(walkable == false)\n\t\t\t{\n\t\t\t\treturn node;\n\t\t\t}\n\t\t\t\n\t\t\tint waitSize = waitList.size();\n\t\t\t\n\t\t\t\n\t\t\tfor(int l = 0;l<waitSize;l++)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tNode[][] newCopy = new Node[gameBoard.length][gameBoard.length];\n\t\t\t\tNode temT = temNode;\n\t\t\t for (int i = 0; i < gameBoard.length; i++) {\n\t\t\t \tfor(int j =0;j<gameBoard.length;j++)\n\t\t\t \t{\t\n\t\t\t \t\tNode temp = new Node(copyOne[i][j].getScore(),copyOne[i][j].getX(),copyOne[i][j].getY(),copyOne[i][j].getOwnership());\n\t\t\t \t\tnewCopy[i][j]=temp;\n\t\t\t \t}\n\t\t\t }\n\t\t\t \n\t\t\t\tNode takenNode =waitList.poll();\n\t\t\t\tcounter++;\n\t\t\t\ttakenNode.setAccumulated(newCopy[takenNode.getX()][takenNode.getY()].getScore());\n\t\t\t\ttakenNode.enemy = 0;\n\t\t\t\tnewCopy[takenNode.getX()][takenNode.getY()].setOwnership(playerID);\n\t\t\t\tboolean connected = false;\n\t\t\t\tfor(int i = 0;i<dx.length;i++)\n\t\t\t\t{\n\t\t\t\t\t\tint newX = takenNode.getX()+dx[i];\n\t\t\t\t\t\tint newY = takenNode.getY()+dy[i];\n\t\t\t\t\t\tif((newX>=0&&newX<gameBoard.length)&&(newY>=0&&newY<gameBoard.length))\n\t\t\t\t\t\t{\n\t\t\t\t\t\tif(newCopy[newX][newY].getOwnership()==playerID)\n\t\t\t\t\t\t{\n\t\t\n\t\t\t\t\t\t\tconnected = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(connected == true)\n\t\t\t\t{\n\n\t\t\t\t\tfor(int i = 0;i<dx.length;i++)\n\t\t\t\t\t{\n\t\t\n\t\t\t\t\t\t\tint newX = takenNode.getX()+dx[i];\n\t\t\t\t\t\t\tint newY = takenNode.getY()+dy[i];\n\t\t\t\t\t\t\tif((newX>=0&&newX<gameBoard.length)&&(newY>=0&&newY<gameBoard.length))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(newCopy[newX][newY].getOwnership()!=playerID&&newCopy[newX][newY].getOwnership()!=0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.eatOpponent(newCopy, playerID, newX, newY);\n\t\t\n\t\t\t\t\t\t\t\ttakenNode.setAccumulated(takenNode.getAccumulated()+newCopy[newX][newY].getScore());\n\t\t\t\t\t\t\t\tenescore-=newCopy[newX][newY].getScore();\n\t\t\t\t\t\t\t\ttakenNode.enemy = enescore;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\tif(depth==1)\n\t\t\t\t{\n\t\n\t\t\t\t\ttakenNode.setAccumulated(node.getAccumulated()+takenNode.getAccumulated());\n\n\t\t\t\t}\n\t\n\n\t\t\t\tint opponentID = 0;\n\t\t\t\tif(playerID == 1)\n\t\t\t\t{\n\t\t\t\t\topponentID = 2;\n\t\t\t\t}else if(playerID == 2)\n\t\t\t\t{\n\t\t\t\t\topponentID = 1;\n\t\t\t\t}\n\t\t\t\tif(playerOneChildrenList.isEmpty()==false)\n\t\t\t\t{\n\t\t\t\t\t//\tSystem.out.println(\"asdas\");\n\t\t\t//\t\tSystem.out.println(\"A depth: \"+depth);\n\t\t\t\t//\tThread.sleep(300);\n\t\t\t\t\t\tNode minValueNode = newAlphaBeta(takenNode,false,newCopy, opponentID, depth-1,true);\n\t\t\t\t\t\tcounter++;\n\t\t\t\t\t\n\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t\tif(node!=null)\n\t\t\t\t\t\t\t{\tminValueNode.parentNode = new Node(node.getAccumulated(),node.getX(),node.getY(),node.getOwnership());\n\t\t\t\t\t\t\tif(this.beta!=null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(minValueNode.getAccumulated()<this.alpha.getAccumulated())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//\tSystem.out.println(\"break l should be \"+waitSize+\" now: \"+l);\n\t\t\t\t\t\t\t\tplayerOneChildrenList.add(minValueNode);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t//node.noPoll = true;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tplayerOneChildrenList.add(minValueNode);\n\t\t\t\t\t\t\tcontinue;\n\t\n\t\t\t\t\t//\t}\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t//\tSystem.out.println(\"B depth: \"+depth);\n\t\t\t\t\t//Thread.sleep(300);\n\t\t\t\t\trecordDepth = depth;\n\t\t\t\t\tNode minValueNode = newAlphaBeta(takenNode,false,newCopy, opponentID, depth-1,false);\n\t\t\t\t\t//this.alpha = minValueNode;\n\t\t\t\t\t\n\t\t\t\t\tcounter++;\n\t\t\t\t\t//playeroneNode++;\n\t\t\t\t\tif(node!=null)\n\t\t\t\t\t{\tminValueNode.parentNode = new Node(node.getAccumulated(),node.getX(),node.getY(),node.getOwnership());\n\t\t\t\t\tif(this.beta!=null)\n\t\t\t\t\t{\n\t\t\t\t\tif(minValueNode.getAccumulated()>this.beta.getAccumulated())\n\t\t\t\t\t{\n\t\t\t\t\t//\tSystem.out.println(\"break l should be \"+waitSize+\" now: \"+l);\n\t\t\t\t\t\tplayerOneChildrenList.add(minValueNode);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t//node.noPoll = true;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tplayerOneChildrenList.add(minValueNode);\n\t\t\n\t\t\t\t\t\tif(depth == recordDepth)\n\t\t\t\t\t\t{\n\t\t\t//\t\t\t\tSystem.out.println(\"setting alpha\");\n\t\t\t\t\t\t\t//Thread.sleep(300);\n\t\t\t\t\n\t\t\t\t\t\t\t\tthis.alpha = minValueNode;\n\t\t\t//\t\t\tSystem.out.println(\"alpha once: \"+this.alpha.getAccumulated());\n\t\t\t\t\t//\tThread.sleep(5000);\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t\tif(playerOneChildrenList.peek().parentNode!=null||node!=null)\n\t\t\t{\n\t\t\t//\tSystem.out.println(\"returning: \"+playerOneChildrenList.peek().getAccumulated());\n\t\t\t//\tSystem.out.println(500);\n\t\t\tplayerOneChildrenList.peek().parentNode.setAccumulated(playerOneChildrenList.peek().getAccumulated());\n\t\t\tplayerOneChildrenList.peek().parentNode.noPoll = playerOneChildrenList.peek().noPoll;\n\n\t\t\treturn playerOneChildrenList.poll().parentNode;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tplayerOneChildrenList.peek().nodeExpanded = counter;\n\t\t\t\treturn playerOneChildrenList.poll();\n\t\t\t}\n\t\t\n\t\t}else\n\t\tif(isMaximizing == false)//min\n\t\t{\n\t\t\tNode[][] copyOne = new Node[gameBoard.length][gameBoard.length];\n\t\t\tint currentEnescore = node.enemy;\n\t\t\tint nodesRx = node.maxrecordSearchedX;\n\t\t\tint nodesRy = node.maxrecordSearchedY;\n\t\t\tNode temNode = node;\n\t\t for (int i = 0; i < gameBoard.length; i++) {\n\t\t \tfor(int j =0;j<gameBoard.length;j++)\n\t\t \t{\t\n\t\t \t\tNode temp = new Node(gameBoard[i][j].getScore(),gameBoard[i][j].getX(),gameBoard[i][j].getY(),gameBoard[i][j].getOwnership());\n\t\t \t copyOne[i][j]=temp;\n\t\t \t}\n\t\t }\n\t\t\tPriorityQueue<Node> playerTwoChildrenList = new PriorityQueue<Node>(); \n\t\t\tQueue<Node> waitList = new LinkedList<Node>();\n\t\t\tboolean walkable = false;\n\t\n\t\t\t\tfor(int i = 0;i<gameBoard.length;i++)\n\t\t\t\t{\n\t\t\t\t\tfor(int j =0;j<gameBoard.length;j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(copyOne[i][j].getOwnership()==0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\twaitList.add(new Node(copyOne[i][j].getScore(),i,j,playerID));//everyPosition through the 2D array\n\t\t\t\t\t\twalkable = true;\n\t\t\t\t//\t\tcounter++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\tif(walkable == false)\n\t\t\t{\n\t\t\t\treturn node;\n\t\t\t}\n\t\t\t\n\t\t\tint waitSize = waitList.size();\n\n\t\t\tfor(int l = 0;l<waitSize;l++)\n\t\t\t{\n\n\t\t\t\tNode[][] newCopy = new Node[gameBoard.length][gameBoard.length];\n\t\t\t\tNode temT = temNode;\n\t\t\t for (int i = 0; i < gameBoard.length; i++) {\n\t\t\t \tfor(int j =0;j<gameBoard.length;j++)\n\t\t\t \t{\t\n\t\t\t \t\tNode temp = new Node(copyOne[i][j].getScore(),copyOne[i][j].getX(),copyOne[i][j].getY(),copyOne[i][j].getOwnership());\n\t\t\t \t\tnewCopy[i][j]=temp;\n\t\t\t \t}\n\t\t\t }\n\n\t\t\t\tNode takenNode = waitList.poll();\n\t\t\t\tcounter++;\n\t\t\t\tnewCopy[takenNode.getX()][takenNode.getY()].setOwnership(playerID);\n\t\t\n\t\t\t\ttakenNode.setAccumulated(node.getAccumulated());\n\n\t\t\t\ttakenNode.enemy= currentEnescore+newCopy[takenNode.getX()][takenNode.getY()].getScore();\n\t\t\t\t\n\t\t\t\tboolean connected = false;\n\t\t\t\tfor(int i = 0;i<dx.length;i++)\n\t\t\t\t{\n\t\n\t\t\t\t\t\tint newX = takenNode.getX()+dx[i];\n\t\t\t\t\t\tint newY = takenNode.getY()+dy[i];\n\t\t\t\t\t\tif((newX>=0&&newX<gameBoard.length)&&(newY>=0&&newY<gameBoard.length))\n\t\t\t\t\t\t{\n\t\t\t\t\t\tif(newCopy[newX][newY].getOwnership()==playerID)\n\t\t\t\t\t\t{\n\t\t\t\t\n\t\t\t\t\t\t\tconnected = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(connected == true)\n\t\t\t\t{\n\t\t\t\n\t\t\t\t\tfor(int i = 0;i<dx.length;i++)\n\t\t\t\t\t{\n\t\t\n\t\t\t\t\t\t\tint newX = takenNode.getX()+dx[i];\n\t\t\t\t\t\t\tint newY = takenNode.getY()+dy[i];\n\t\t\t\t\t\t\tif((newX>=0&&newX<gameBoard.length)&&(newY>=0&&newY<gameBoard.length))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(newCopy[newX][newY].getOwnership()!=playerID&&newCopy[newX][newY].getOwnership()!=0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.eatOpponent(newCopy, playerID, newX, newY);\n\t\t\t\t\t\t\t\ttakenNode.setAccumulated(takenNode.getAccumulated()-newCopy[newX][newY].getScore());\t\n\t\t\t\t\t\t\t\ttakenNode.enemy+=newCopy[newX][newY].getScore();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tint opponentID = 0;\n\t\t\t\tif(playerID == 1)\n\t\t\t\t{\n\t\t\t\t\topponentID = 2;\n\t\t\t\t}else if(playerID == 2)\n\t\t\t\t{\n\t\t\t\t\topponentID = 1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(playerTwoChildrenList.isEmpty()==false)\n\t\t\t\t{\n\t\t\t//\t\tSystem.out.println(\" C depth: \"+depth);\n\t\t\t\t//\tThread.sleep(300);\n\t\t\t\t\t\tNode maxValueNode = newAlphaBeta(takenNode,true,newCopy, opponentID, depth-1,true);\n\t\t\t\t\t\tcounter++;\n\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t//playeroneNode++;\n\t\t\t\t\t\tmaxValueNode.parentNode = new Node(node.getAccumulated(),node.getX(),node.getY(),node.getOwnership());\n\t\t\t\t\t\tif(this.alpha!=null)\n\t\t\t\t\t\t{\n\t\t\t\t//\t\tSystem.out.println(maxValueNode.getAccumulated()+\" \"+this.alpha.getAccumulated());\n\t\t\t\t\t//\tThread.sleep(5000);\n\t\t\t\t\t\tif(maxValueNode.getAccumulated()<this.alpha.getAccumulated())\n\t\t\t\t\t\t{\n\t\t\t\t\t//\t\tSystem.out.println(\"break l should be \"+waitSize+\" now: \"+l);\n\t\t\t\t\t\t\tplayerTwoChildrenList.add(maxValueNode);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t//node.noPoll = true;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tplayerTwoChildrenList.add(maxValueNode);\n\t\t\t\t\t//\tif(maxValueNode.noPoll == true)\n\t\t\t\t\t//\t{\n\t\t\t\t\t//\t\tSystem.out.println(\"the discard value: \"+maxValueNode.getAccumulated()+\" compareTo: \"+this.alpha.getAccumulated());\n\t\t\t\t\t//\t\tbreak;\n\t\t\t\t\t//\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t//\tSystem.out.println(\" D depth: \"+depth);\n\t\t\t\t//\tThread.sleep(300);\n\t\t\t\t\tNode maxValueNode = newAlphaBeta(takenNode,true,newCopy, opponentID, depth-1,false);\n\t\t\t\t\tcounter++;\n\t\t\t\t\t\n\t\t\t\t\tmaxValueNode.parentNode = new Node(node.getAccumulated(),node.getX(),node.getY(),node.getOwnership());\n\t\t\t\t\tif(this.alpha!=null)\n\t\t\t\t\t{\n\t\t\t\t\tif(maxValueNode.getAccumulated()<this.alpha.getAccumulated())\n\t\t\t\t\t{\n\t\t\t\t\t//\tSystem.out.println(\"break l should be \"+waitSize+\" now: \"+l);\n\t\t\t\t\t\tplayerTwoChildrenList.add(maxValueNode);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t//node.noPoll = true;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(depth == recordDepth-1)\n\t\t\t\t\t{\n\t\t//\t\t\t\tSystem.out.println(\"setting alpha\");\n\t\t\t\t\t\t//Thread.sleep(300);\n\t\t\t\n\t\t\t\t\t\t\tthis.beta = maxValueNode;\n\t\t\t\t\t\t\tSystem.out.println(\"beta: \"+this.beta.getAccumulated());\n\t\t\t\t\t\t\t//Thread.sleep(5000);\n\t\t//\t\t\tSystem.out.println(\"alpha once: \"+this.alpha.getAccumulated());\n\t\t\t\t//\tThread.sleep(5000);\n\t\t\t\t\t}\n\t\t\t\t\tplayerTwoChildrenList.add(maxValueNode);\n\t\t\t\t//\tif(maxValueNode.noPoll == true)\n\t\t\t\t//\t{\n\t\t\t\t//\t\t\n\t\t\t\t//\t\tbreak;\n\t\t\t\t//\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\tplayerTwoChildrenList.peek().parentNode.setAccumulated(playerTwoChildrenList.peek().getAccumulated());\n\n\t\t\treturn playerTwoChildrenList.poll().parentNode;\n\t\t}\n\t\treturn null;\n\t\n\t}", "public interface IKataSolution\n extends IKataCommonSolution {\n\n public enum ACTION {\n TURN_LEFT, TURN_RIGHT, FORWARD, STAY\n }\n\n public enum ORIENTATION {\n UP (270), DOWN(90), LEFT(0), RIGHT(180);\n public int angle;\n ORIENTATION (int _angle) {\n angle = _angle;\n }\n public ORIENTATION moveLeft () {\n switch (this) {\n case UP: return LEFT;\n case DOWN: return RIGHT;\n case LEFT: return DOWN;\n case RIGHT: return UP;\n }\n return this;\n }\n public ORIENTATION moveRight () {\n switch (this) {\n case UP: return RIGHT;\n case DOWN: return LEFT;\n case LEFT: return UP;\n case RIGHT: return DOWN;\n }\n return this;\n }\n }\n\n public enum ITEM {\n EMPTY, PLANT, ANIMAL, END\n }\n\n public abstract class Animal {\n /**\n * Number of plants the animal ate\n */\n public int points;\n /**\n * Method to react to changing environmental conditions\n *\n * @param orientation animal's current orientation\n * @param view item currently in front of animal\n * @return action to do\n */\n public abstract ACTION react (ORIENTATION orientation, ITEM view);\n }\n\n /**\n * Factory method for an animal\n *\n * @param count count of animals to create\n * @param lastGeneration array of 'Animal' from last generation\n * @return array of 'Animal' instances\n */\n public abstract Animal[] createGeneration (int count, Animal[] lastGeneration);\n\n /**\n * If true, last generation will be visualized\n */\n public boolean visualizeLastGeneration ();\n\n /**\n * Defines how many generations of evolution should be tested\n * (minimum is 100, maximum is 10000)\n *\n * @return count of generations to test\n */\n public int countOfGenerations ();\n}", "public Search(boolean screen, boolean beamer, int capacity, String building, int nuOfPlugs) {\n this.screen = screen;\n this.beamer = beamer;\n this.building = building;\n this.capacity = capacity;\n this.nuOfPlugs = nuOfPlugs;\n }", "public static void main(String[] args) {\n\t\tinit(Hx.Manhattan, CostMode.Def);\n\t\tMaze smallMaze = new Maze(\"mazes/tinySearch.txt\");\n\t\tAgent astarAg = new Agent(smallMaze);\n\t\tRecorder rd = new Recorder();\n\t\tSearch.AstarMulOptimal(astarAg, smallMaze, rd);\n\t\t//System.out.println(rd.getExpandNodes());\n\t}", "public interface TraversalStrategy {\n\n public static final int SEARCH_FOCUS_UNKNOWN = 0;\n public static final int SEARCH_FOCUS_FORWARD = 1;\n public static final int SEARCH_FOCUS_BACKWARD = 2;\n public static final int SEARCH_FOCUS_LEFT = 3;\n public static final int SEARCH_FOCUS_RIGHT = 4;\n public static final int SEARCH_FOCUS_UP = 5;\n public static final int SEARCH_FOCUS_DOWN = 6;\n\n @IntDef({SEARCH_FOCUS_FORWARD, SEARCH_FOCUS_BACKWARD,\n SEARCH_FOCUS_LEFT, SEARCH_FOCUS_RIGHT, SEARCH_FOCUS_UP, SEARCH_FOCUS_DOWN})\n @Retention(RetentionPolicy.SOURCE)\n public @interface SearchDirection {}\n\n @IntDef({SEARCH_FOCUS_UNKNOWN,\n SEARCH_FOCUS_FORWARD, SEARCH_FOCUS_BACKWARD,\n SEARCH_FOCUS_LEFT, SEARCH_FOCUS_RIGHT, SEARCH_FOCUS_UP, SEARCH_FOCUS_DOWN})\n @Retention(RetentionPolicy.SOURCE)\n public @interface SearchDirectionOrUnknown {}\n\n /**\n * The method searches next node to be focused\n * @param startNode - pivot node the search is start from\n * @param direction - direction to find focus\n * @return {@link android.support.v4.view.accessibility.AccessibilityNodeInfoCompat} node\n * that has next focus\n */\n public AccessibilityNodeInfoCompat findFocus(AccessibilityNodeInfoCompat startNode,\n @SearchDirection int direction);\n\n /**\n * Finds the initial focusable accessibility node in hierarchy started from root node when\n * searching in the given direction.\n *\n * For example, if {@code direction} is {@link #SEARCH_FOCUS_FORWARD}, then the\n * method should return the first node in the traversal order. If {@code direction} is\n * {@link #SEARCH_FOCUS_BACKWARD} then the method should return the last node\n * in the traversal order.\n *\n * @param root - root node\n * @param direction - the direction to search from\n * @return returns the first node that could be focused\n */\n public AccessibilityNodeInfoCompat focusInitial(AccessibilityNodeInfoCompat root,\n @SearchDirection int direction);\n\n /**\n * Calculating if node is speaking node according to AccessibilityNodeInfoUtils.isSpeakingNode()\n * method is time consuming. Traversal strategy may use cache for already calculated values.\n * If traversal strategy does not need in such cache use it could return null.\n * @return speaking node cache map. Could be null if cache is not used by traversal strategy\n */\n public Map<AccessibilityNodeInfoCompat, Boolean> getSpeakingNodesCache();\n\n /**\n * When there is no need in traversal strategy object it must be recycled before\n * garbage collected\n */\n public void recycle();\n}", "public interface AsgStrategy {\n void apply(AsgQuery query, AsgStrategyContext context);\n}", "@Parameterized.Parameters(name = \"{0}\")\n public static Collection<Object[]> algoOptions() {\n CarFlagEncoder encoder = new CarFlagEncoder();\n GraphHopper hopper = new GraphHopperOSM();\n hopper.setDataReaderFile(\"../map-data/leipzig_germany.osm.pbf\");\n hopper.setGraphHopperLocation(\"../target/mapmatchingtest-ch\");\n hopper.setEncodingManager(new EncodingManager(encoder));\n hopper.getCHFactoryDecorator().setDisablingAllowed(true);\n hopper.importOrLoad();\n\n // force CH\n AlgorithmOptions chOpts = AlgorithmOptions.start()\n .maxVisitedNodes(1000)\n .hints(new PMap().put(Parameters.CH.DISABLE, false))\n .build();\n\n // flexible should fall back to defaults\n AlgorithmOptions flexibleOpts = AlgorithmOptions.start()\n // TODO: fewer nodes than for CH are possible (short routes & different finish condition & higher degree graph)\n // .maxVisitedNodes(20)\n .build();\n\n return Arrays.asList(new Object[][]{\n {\"non-CH\", hopper, flexibleOpts},\n {\"CH\", hopper, chOpts}\n });\n }", "private void initializeAndTrainModel(float alpha) {\n\n double forecast;\n double lastValue = actual[0];\n double[][] trainMatrix = new double[trainPoints][2];\n double[][] valMatrix = new double[validationPoints][2];\n\n for (int i = 1; i < trainPoints; i++) {\n forecast = lastValue;\n\n trainMatrix[i][0] = actual[i];\n trainMatrix[i][1] = forecast;\n lastValue = (alpha * actual[i]) + ((1 - alpha) * lastValue);\n }\n\n for (int t = 1; t <= validationPoints; t++) {\n valMatrix[t - 1][1] = lastValue;\n valMatrix[t - 1][0] = actual[trainPoints + t - 1];\n }\n\n\n double biasness = BiasnessHandler.handle(valMatrix);\n AccuracyIndicators AI = new AccuracyIndicators();\n ModelUtil.computeAccuracyIndicators(AI, trainMatrix, valMatrix, dof);\n AI.setBias(biasness);\n if (min_val_error >= AI.getMAPE()) {\n min_val_error = AI.getMAPE();\n optAlpha = alpha;\n accuracyIndicators = AI;\n }\n }", "public void execFuzzySearchVariationFunc(){\n\n\n Map map = new HashMap();\n\n if(this.searchParam != null && this.searchParam.length()> 0 ){\n System.out.println(this.searchParam );\n if(this.searchParam.contains(\":\")==true || this.searchParam.startsWith(\"chr\") == true) {\n String chrom = \"\";\n int pstart = -1;\n int pend = -1;\n if (this.searchParam.indexOf(\":\") > -1) {\n int idex = this.searchParam.indexOf(\":\");\n chrom = this.searchParam.substring(0, idex );\n System.out.println(\"chrom=\" + chrom);\n map.put(\"chrom\", chrom);\n if (this.searchParam.indexOf(\"-\") > -1) {\n int idex1 = this.searchParam.indexOf(\"-\");\n pstart = Integer.parseInt(this.searchParam.substring(idex + 1, idex1 ));\n pend = Integer.parseInt(this.searchParam.substring(idex1 + 1, this.searchParam.length()));\n map.put(\"startpos\", pstart);\n map.put(\"endpos\", pend);\n } else {\n pstart = Integer.parseInt(this.searchParam.substring(idex + 1, this.searchParam.length()));\n map.put(\"startpos\", pstart);\n }\n\n } else if (this.searchParam.startsWith(\"chr\") == true) {\n map.put(\"chrom\", this.searchParam);\n }\n }\n\n map.put(\"searchParam\",this.searchParam);\n }\n\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"null\") ==false && this.searchSpecies.equals(\"all\") == false){\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"species\",this.searchSpecies);\n }\n\n if(this.searchTrait != null&& this.searchTrait.equals(\"null\") ==false && this.searchTrait.length()>0){\n\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"searchTrait\", this.searchTrait) ;\n }\n\n if(this.pvalue != null&& this.pvalue.equals(\"null\") ==false && this.pvalue.length()>0){\n\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"psitu\", this.psitu);\n map.put(\"pval\", this.pvalue) ;\n }\n\n\n //here, parse search param and get genotype information\n genotypeBeanList = (List<GenotypeBean>) baseService.findResultList(\"cn.big.gvk.dm.Genotype.selectGenotypeByPos\",map);\n if(genotypeBeanList != null && genotypeBeanList.size() > 0 ){\n for(GenotypeBean tbean :genotypeBeanList ){\n List genotypelist = new ArrayList();\n genotypelist.add(tbean.getGenotypeId()) ;\n\n Map t = new HashMap();\n t.put(\"genotypelist\",genotypelist);\n List<GenotypeAnnotateGeneView> annotateview = baseService.findResultList(\"cn.big.gvk.dm.Genotype.selectGenotypeByList\",t);\n if(annotateview != null && annotateview.size()>0 ){\n //here we need to filter the result\n Map filtermap = new HashMap();\n for(GenotypeAnnotateGeneView tview : annotateview){\n String fkey = tview.getMapGeneId()+\"_\"+tview.getConseqtype();\n if(filtermap.containsKey(fkey) == false){\n filtermap.put(fkey,tview);\n }\n }\n\n if(filtermap.size()>0){\n List<GenotypeAnnotateGeneView> alist = new ArrayList<GenotypeAnnotateGeneView>();\n Iterator it = filtermap.entrySet().iterator();\n while(it.hasNext()){\n Map.Entry entry = (Map.Entry) it.next();\n GenotypeAnnotateGeneView val = (GenotypeAnnotateGeneView) entry.getValue();\n alist.add(val);\n }\n\n tbean.setGenotypeAnnotateGeneView(alist);\n }\n\n\n }\n\n //find association count\n GwasAssociationBean gwas = (GwasAssociationBean) baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectAssociationCountByGenotypeid\",tbean.getGenotypeId());\n if(gwas != null){\n tbean.setTraitCount(gwas.getGwasCount());\n }\n\n //find studycount\n Map cmap = new HashMap();\n cmap.put(\"genotypeId\",tbean.getGenotypeId());\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"all\") == false){\n cmap.put(\"species\",this.searchSpecies);\n }\n\n\n GwasAssociationBean tg_bean1 = (GwasAssociationBean)baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectStudyCountByGenotypeid\",cmap);\n if(tg_bean1 != null ){\n tbean.setStudyCount(tg_bean1.getGwasCount());\n }\n\n }\n\n\n\n }\n\n StringBuffer sb = new StringBuffer() ;\n\n if(genotypeBeanList != null && genotypeBeanList.size()>0){\n for(GenotypeBean genotype: genotypeBeanList){\n sb.append(genotype.getVarId()).append(\"\\t\").append(genotype.getChrom()).append(\":\")\n .append(genotype.getStartPos()).append(\"\\t\").append(genotype.getTraitCount())\n .append(\"\\t\").append(genotype.getStudyCount()).append(\"\\n\");\n }\n }\n\n if(format == 1 ){ //export txt\n this.response.reset();\n this.response.setHeader(\"Content-Disposition\",\n \"attachment;filename=export.txt\");\n this.response.setContentType(\"application/ms-txt\");\n try {\n PrintWriter pr = this.response.getWriter();\n pr.print(sb.toString());\n pr.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n }", "public int alphabetaSearch(BoardState state, int maxDepth) {\n\t\tint[] pits = new int[6];\r\n\t\t\r\n\t\t// state to check moves\r\n\t\tBoardState move = state;\r\n\t\r\n\t\t// initializing the alpha and the beta value\r\n\t\tint alpha = Integer.MIN_VALUE;\r\n\t\tint beta = Integer.MAX_VALUE;\r\n\t\t\r\n\t\tint bestPit = 0;\r\n\r\n\t\t// for loop to get the SBE of the pits\r\n\t\tfor (int i = 0; i <= 5; i++) {\r\n\r\n\t\t\t// checking if the move is legal\r\n\t\t\tif (state.isLegalMove(1, i)) {\r\n\r\n\t\t\t\t// variable set to max since node at depth 1 is a max value\r\n\t\t\t\tint v = minValue(move.applyMove(1, i), maxDepth, maxDepth - 1, alpha, beta);\r\n\r\n\t\t\t\t// updating the alpha value based on our search\r\n\t\t\t\tif (v > alpha) {\r\n\t\t\t\t\talpha = v;\r\n\t\t\t\t\tbestPit = i;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// pruning\r\n\t\t\t\tif (beta <= alpha)\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn bestPit;\r\n\t}", "public interface ISimAnn {\r\n \r\n //defines the random number generator based on the passed in seed.\r\n public void setRNG(long seed);\r\n \r\n //starts search with inital, final, and change in temperature\r\n public void run(IEncoding solution, double Temp_i, double Temp_f, double alpha);\r\n\r\n}", "public interface AMDPModelLearner extends AMDPPolicyGenerator{\n\n\n public void updateModel(State s, Action a, List<Double> rewards, State sPrime, GroundedTask gt);\n\n\n}", "public Decision planBest(Context context, Decision defaultDecision);", "public List<Graph> search() {\n\n long start = System.currentTimeMillis();\n TetradLogger.getInstance().log(\"info\", \"Starting ION Search.\");\n logGraphs(\"\\nInitial Pags: \", this.input);\n TetradLogger.getInstance().log(\"info\", \"Transfering local information.\");\n long steps = System.currentTimeMillis();\n\n /*\n * Step 1 - Create the empty graph\n */\n List<Node> varNodes = new ArrayList<>();\n for (String varName : variables) {\n varNodes.add(new GraphNode(varName));\n }\n Graph graph = new EdgeListGraph(varNodes);\n\n /*\n * Step 2 - Transfer local information from the PAGs (adjacencies\n * and edge orientations)\n */\n // transfers edges from each graph and finds definite noncolliders\n transferLocal(graph);\n // adds edges for variables never jointly measured\n for (NodePair pair : nonIntersection(graph)) {\n graph.addEdge(new Edge(pair.getFirst(), pair.getSecond(), Endpoint.CIRCLE, Endpoint.CIRCLE));\n }\n TetradLogger.getInstance().log(\"info\", \"Steps 1-2: \" + (System.currentTimeMillis() - steps) / 1000. + \"s\");\n System.out.println(\"step2\");\n System.out.println(graph);\n\n /*\n * Step 3\n *\n * Branch and prune step that blocks problematic undirectedPaths, possibly d-connecting undirectedPaths\n */\n steps = System.currentTimeMillis();\n Queue<Graph> searchPags = new LinkedList<>();\n // place graph constructed in step 2 into the queue\n searchPags.offer(graph);\n // get d-separations and d-connections\n List<Set<IonIndependenceFacts>> sepAndAssoc = findSepAndAssoc(graph);\n this.separations = sepAndAssoc.get(0);\n this.associations = sepAndAssoc.get(1);\n Map<Collection<Node>, List<PossibleDConnectingPath>> paths;\n// Queue<Graph> step3PagsSet = new LinkedList<Graph>();\n HashSet<Graph> step3PagsSet = new HashSet<>();\n Set<Graph> reject = new HashSet<>();\n // if no d-separations, nothing left to search\n if (separations.isEmpty()) {\n // makes orientations preventing definite noncolliders from becoming colliders\n // do final orientations\n// doFinalOrientation(graph);\n step3PagsSet.add(graph);\n }\n // sets length to iterate once if search over path lengths not enabled, otherwise set to 2\n int numNodes = graph.getNumNodes();\n int pl = numNodes - 1;\n if (pathLengthSearch) {\n pl = 2;\n }\n // iterates over path length, then adjacencies\n for (int l = pl; l < numNodes; l++) {\n if (pathLengthSearch) {\n TetradLogger.getInstance().log(\"info\", \"Braching over path lengths: \" + l + \" of \" + (numNodes - 1));\n }\n int seps = separations.size();\n int currentSep = 1;\n int numAdjacencies = separations.size();\n for (IonIndependenceFacts fact : separations) {\n if (adjacencySearch) {\n TetradLogger.getInstance().log(\"info\", \"Braching over path nonadjacencies: \" + currentSep + \" of \" + numAdjacencies);\n }\n seps--;\n // uses two queues to keep up with which PAGs are being iterated and which have been\n // accepted to be iterated over in the next iteration of the above for loop\n searchPags.addAll(step3PagsSet);\n recGraphs.add(searchPags.size());\n step3PagsSet.clear();\n while (!searchPags.isEmpty()) {\n System.out.println(\"ION Step 3 size: \" + searchPags.size());\n double currentUsage = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();\n if (currentUsage > maxMemory) maxMemory = currentUsage;\n // deques first PAG from searchPags\n Graph pag = searchPags.poll();\n // Part 3.a - finds possibly d-connecting undirectedPaths between each pair of nodes\n // known to be d-separated\n List<PossibleDConnectingPath> dConnections = new ArrayList<>();\n // checks to see if looping over adjacencies\n if (adjacencySearch) {\n for (Collection<Node> conditions : fact.getZ()) {\n // checks to see if looping over path lengths\n if (pathLengthSearch) {\n dConnections.addAll(PossibleDConnectingPath.findDConnectingPathsOfLength\n (pag, fact.getX(), fact.getY(), conditions, l));\n } else {\n dConnections.addAll(PossibleDConnectingPath.findDConnectingPaths\n (pag, fact.getX(), fact.getY(), conditions));\n }\n }\n } else {\n for (IonIndependenceFacts allfact : separations) {\n for (Collection<Node> conditions : allfact.getZ()) {\n // checks to see if looping over path lengths\n if (pathLengthSearch) {\n dConnections.addAll(PossibleDConnectingPath.findDConnectingPathsOfLength\n (pag, allfact.getX(), allfact.getY(), conditions, l));\n } else {\n dConnections.addAll(PossibleDConnectingPath.findDConnectingPaths\n (pag, allfact.getX(), allfact.getY(), conditions));\n }\n }\n }\n }\n // accept PAG go to next PAG if no possibly d-connecting undirectedPaths\n if (dConnections.isEmpty()) {\n// doFinalOrientation(pag);\n// Graph p = screenForKnowledge(pag);\n// if (p != null) step3PagsSet.add(p);\n step3PagsSet.add(pag);\n continue;\n }\n // maps conditioning sets to list of possibly d-connecting undirectedPaths\n paths = new HashMap<>();\n for (PossibleDConnectingPath path : dConnections) {\n List<PossibleDConnectingPath> p = paths.get(path.getConditions());\n if (p == null) {\n p = new LinkedList<>();\n }\n p.add(path);\n paths.put(path.getConditions(), p);\n }\n // Part 3.b - finds minimal graphical changes to block possibly d-connecting undirectedPaths\n List<Set<GraphChange>> possibleChanges = new ArrayList<>();\n for (Set<GraphChange> changes : findChanges(paths)) {\n Set<GraphChange> newChanges = new HashSet<>();\n for (GraphChange gc : changes) {\n boolean okay = true;\n for (Triple collider : gc.getColliders()) {\n\n if (pag.isUnderlineTriple(collider.getX(), collider.getY(), collider.getZ())) {\n okay = false;\n break;\n }\n\n }\n if (!okay) {\n continue;\n }\n for (Triple collider : gc.getNoncolliders()) {\n if (pag.isDefCollider(collider.getX(), collider.getY(), collider.getZ())) {\n okay = false;\n break;\n }\n }\n if (okay) {\n newChanges.add(gc);\n }\n }\n if (!newChanges.isEmpty()) {\n possibleChanges.add(newChanges);\n } else {\n possibleChanges.clear();\n break;\n }\n }\n float starthitset = System.currentTimeMillis();\n Collection<GraphChange> hittingSets = IonHittingSet.findHittingSet(possibleChanges);\n recHitTimes.add((System.currentTimeMillis() - starthitset) / 1000.);\n // Part 3.c - checks the newly constructed graphs from 3.b and rejects those that\n // cycles or produce independencies known not to occur from the input PAGs or\n // include undirectedPaths from definite nonancestors\n for (GraphChange gc : hittingSets) {\n boolean badhittingset = false;\n for (Edge edge : gc.getRemoves()) {\n Node node1 = edge.getNode1();\n Node node2 = edge.getNode2();\n Set<Triple> triples = new HashSet<>();\n triples.addAll(gc.getColliders());\n triples.addAll(gc.getNoncolliders());\n if (triples.size() != (gc.getColliders().size() + gc.getNoncolliders().size())) {\n badhittingset = true;\n break;\n }\n for (Triple triple : triples) {\n if (node1.equals(triple.getY())) {\n if (node2.equals(triple.getX()) ||\n node2.equals(triple.getZ())) {\n badhittingset = true;\n break;\n }\n }\n if (node2.equals(triple.getY())) {\n if (node1.equals(triple.getX()) ||\n node1.equals(triple.getZ())) {\n badhittingset = true;\n break;\n }\n }\n }\n if (badhittingset) {\n break;\n }\n for (NodePair pair : gc.getOrients()) {\n if ((node1.equals(pair.getFirst()) && node2.equals(pair.getSecond())) ||\n (node2.equals(pair.getFirst()) && node1.equals(pair.getSecond()))) {\n badhittingset = true;\n break;\n }\n }\n if (badhittingset) {\n break;\n }\n }\n if (!badhittingset) {\n for (NodePair pair : gc.getOrients()) {\n for (Triple triple : gc.getNoncolliders()) {\n if (pair.getSecond().equals(triple.getY())) {\n if (pair.getFirst().equals(triple.getX()) &&\n pag.getEndpoint(triple.getZ(), triple.getY()).equals(Endpoint.ARROW)) {\n badhittingset = true;\n break;\n\n }\n if (pair.getFirst().equals(triple.getZ()) &&\n pag.getEndpoint(triple.getX(), triple.getY()).equals(Endpoint.ARROW)) {\n badhittingset = true;\n break;\n }\n }\n if (badhittingset) {\n break;\n }\n }\n if (badhittingset) {\n break;\n }\n }\n }\n if (badhittingset) {\n continue;\n }\n Graph changed = gc.applyTo(pag);\n // if graph change has already been rejected move on to next graph\n if (reject.contains(changed)) {\n continue;\n }\n // if graph change has already been accepted move on to next graph\n if (step3PagsSet.contains(changed)) {\n continue;\n }\n // reject if null, predicts false independencies or has cycle\n if (predictsFalseIndependence(associations, changed)\n || changed.existsDirectedCycle()) {\n reject.add(changed);\n }\n // makes orientations preventing definite noncolliders from becoming colliders\n // do final orientations\n// doFinalOrientation(changed);\n // now add graph to queue\n\n// Graph p = screenForKnowledge(changed);\n// if (p != null) step3PagsSet.add(p);\n step3PagsSet.add(changed);\n }\n }\n // exits loop if not looping over adjacencies\n if (!adjacencySearch) {\n break;\n }\n }\n }\n TetradLogger.getInstance().log(\"info\", \"Step 3: \" + (System.currentTimeMillis() - steps) / 1000. + \"s\");\n Queue<Graph> step3Pags = new LinkedList<>(step3PagsSet);\n\n /*\n * Step 4\n *\n * Finds redundant undirectedPaths and uses this information to expand the list\n * of possible graphs\n */\n steps = System.currentTimeMillis();\n Map<Edge, Boolean> necEdges;\n Set<Graph> outputPags = new HashSet<>();\n\n while (!step3Pags.isEmpty()) {\n Graph pag = step3Pags.poll();\n necEdges = new HashMap<>();\n // Step 4.a - if x and y are known to be unconditionally associated and there is\n // exactly one trek between them, mark each edge on that trek as necessary and\n // make the tiples on the trek definite noncolliders\n // initially mark each edge as not necessary\n for (Edge edge : pag.getEdges()) {\n necEdges.put(edge, false);\n }\n // look for unconditional associations\n for (IonIndependenceFacts fact : associations) {\n for (List<Node> nodes : fact.getZ()) {\n if (nodes.isEmpty()) {\n List<List<Node>> treks = treks(pag, fact.x, fact.y);\n if (treks.size() == 1) {\n List<Node> trek = treks.get(0);\n List<Triple> triples = new ArrayList<>();\n for (int i = 1; i < trek.size(); i++) {\n // marks each edge in trek as necessary\n necEdges.put(pag.getEdge(trek.get(i - 1), trek.get(i)), true);\n if (i == 1) {\n continue;\n }\n // makes each triple a noncollider\n pag.addUnderlineTriple(trek.get(i - 2), trek.get(i - 1), trek.get(i));\n }\n }\n // stop looping once the empty set is found\n break;\n }\n }\n }\n // Part 4.b - branches by generating graphs for every combination of removing\n // redundant undirectedPaths\n boolean elimTreks;\n // checks to see if removing redundant undirectedPaths eliminates every trek between\n // two variables known to be nconditionally assoicated\n List<Graph> possRemovePags = possRemove(pag, necEdges);\n double currentUsage = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();\n if (currentUsage > maxMemory) maxMemory = currentUsage;\n for (Graph newPag : possRemovePags) {\n elimTreks = false;\n // looks for unconditional associations\n for (IonIndependenceFacts fact : associations) {\n for (List<Node> nodes : fact.getZ()) {\n if (nodes.isEmpty()) {\n if (treks(newPag, fact.x, fact.y).isEmpty()) {\n elimTreks = true;\n }\n // stop looping once the empty set is found\n break;\n }\n }\n }\n // add new PAG to output unless a necessary trek has been eliminated\n if (!elimTreks) {\n outputPags.add(newPag);\n }\n }\n }\n outputPags = removeMoreSpecific(outputPags);\n// outputPags = applyKnowledge(outputPags);\n\n TetradLogger.getInstance().log(\"info\", \"Step 4: \" + (System.currentTimeMillis() - steps) / 1000. + \"s\");\n\n /*\n * Step 5\n *\n * Generate the Markov equivalence classes for graphs and accept only\n * those that do not predict false d-separations\n */\n steps = System.currentTimeMillis();\n Set<Graph> outputSet = new HashSet<>();\n for (Graph pag : outputPags) {\n Set<Triple> unshieldedPossibleColliders = new HashSet<>();\n for (Triple triple : getPossibleTriples(pag)) {\n if (!pag.isAdjacentTo(triple.getX(), triple.getZ())) {\n unshieldedPossibleColliders.add(triple);\n }\n }\n\n PowerSet<Triple> pset = new PowerSet<>(unshieldedPossibleColliders);\n for (Set<Triple> set : pset) {\n Graph newGraph = new EdgeListGraph(pag);\n for (Triple triple : set) {\n newGraph.setEndpoint(triple.getX(), triple.getY(), Endpoint.ARROW);\n newGraph.setEndpoint(triple.getZ(), triple.getY(), Endpoint.ARROW);\n }\n doFinalOrientation(newGraph);\n }\n for (Graph outputPag : finalResult) {\n if (!predictsFalseIndependence(associations, outputPag)) {\n Set<Triple> underlineTriples = new HashSet<>(outputPag.getUnderLines());\n for (Triple triple : underlineTriples) {\n outputPag.removeUnderlineTriple(triple.getX(), triple.getY(), triple.getZ());\n }\n outputSet.add(outputPag);\n }\n }\n }\n\n// outputSet = applyKnowledge(outputSet);\n outputSet = checkPaths(outputSet);\n\n output.addAll(outputSet);\n TetradLogger.getInstance().log(\"info\", \"Step 5: \" + (System.currentTimeMillis() - steps) / 1000. + \"s\");\n runtime = ((System.currentTimeMillis() - start) / 1000.);\n logGraphs(\"\\nReturning output (\" + output.size() + \" Graphs):\", output);\n double currentUsage = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();\n if (currentUsage > maxMemory) maxMemory = currentUsage;\n return output;\n }", "public static void main(String[] args) {\n\t\tString solutionFile = \"dataset/vlc/task1_solution.en.clusterMle.txt\";\n//\t\tString queryFile = \"dataset/vlc/task1_query.en.f8.n5.txt\";\n//\t\tString targetFile = \"dataset/vlc/task1_target.en.f8.n5.txt\";\n//\t\tString linkFile = \"dataset/vlc/sim_0p_100n.csv\";\n\t\t\n\t\tString malletFile = \"dataset/vlc/folds/all.0.4189.mallet\";\n\t\tString queryFile = \"dataset/vlc/folds/query.0.csv\";\n\t\tString targetFile = \"dataset/vlc/folds/target.0.csv\";\n\t\tString linkFile = \"dataset/vlc/folds/trainingPairs.0.csv\";\n\t\t\n\t\tdouble alpha = 0.01, beta = 0.01, lambda = 0.01;\n\t\t\n\t\tMalletMleCluster clusterMle = new MalletMleCluster(malletFile, linkFile, alpha);\n\t\tTask1Solution solver = new Task1Solution(clusterMle);\n//\t\tfor(alpha = 0.1; alpha<1; alpha += 0.2) {\n//\t\t\tfor(beta = 0.1; beta<1; beta += 0.2) {\n\t\t\t\tfor (lambda = 0.1; lambda<1; lambda += 0.05) {\n\t\t\tclusterMle.setSmoothParameters(alpha, beta, lambda);\n//\t\t\tclusterMle.retrieveTask1Solution(queryFile, solutionFile);\n\t\t\ttry {\n\t\t\t\tsolver.retrieveTask1Solution(queryFile, solutionFile);\n\t\t\t\tdouble precision = Task1Solution.evaluateResult(targetFile, solutionFile);\n\t\t\t\tSystem.out.println(\"alpha: \" + alpha + \"beta: \" + beta + \n\t\t\t\t\t\t\", Lambda: \" + lambda + \", Mle precision: \" + precision);\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\t}\n//\t\t\t}\n//\t\t}\n\t}", "private Move alphaBetaSearch(Node state) {\n\t\t\n\t\tint v = this.maxValue(state, Integer.MIN_VALUE, Integer.MAX_VALUE);\n\t\t\n\t\tthis.nodesExplored--;\n\t\tthis.nodesExploredThisTurn--;\n\t\t\n\t\tif (System.currentTimeMillis() - startMili > this.maxTime * 1000) {\n\t\t\treturn this.bestMoveSoFar;\n\t\t}\n\n\t\tif (Math.abs(v) == Integer.MAX_VALUE / 2 || Math.abs(v) == Math.abs(Integer.MIN_VALUE / 2) ) {\n\t\t\t\n\t\t\tthis.isEndGameStatusFound = true;\n\t\t\treturn state.getBestMove();\n\t\t}\n\t\t\n\t\treturn state.getBestMove();\n\t}", "public static void main(String[] args) throws IOException {\n BruteForce bruteForce = new BruteForce();\n bruteForce.setKeyword(\"robot\");\n bruteForce.searchKeyword();\n LuceneSearch luceneSearch = new LuceneSearch(\"robot\");\n luceneSearch.luceneSearch();\n HuffmanSearch huffmanSearch = new HuffmanSearch(\"robot\");\n huffmanSearch.huffmanSearch();\n\n // This creates chart for brute force algorithm with robot as the search keyword.\n BruteForceChart bruteForceChart =\n new BruteForceChart(\n \"Time vs Number of records Brute Force for Keyword robot\",\n \"Time vs Number of records Brute Force for Keyword robot\");\n\n bruteForceChart.pack();\n bruteForceChart.setLocation(0, 0);\n // This to display the chart.\n bruteForceChart.setVisible(true);\n\n // This creates chart for lucene algorithm with robot as the search keyword.\n LuceneChart luceneChart =\n new LuceneChart(\n \"Time vs Number of records Lucene for Keyword robot\",\n \"Time vs Number of records Lucene for Keyword robot\");\n luceneChart.pack();\n luceneChart.setLocation(600,0);\n // This to display the chart.\n luceneChart.setVisible(true);\n\n // This creates chart for Huffman algorithm with robot as the search keyword.\n HuffmanChart huffmanChartRobot =\n new HuffmanChart(\n \"Time vs Number of records Huffman for Keyword Wearable\",\n \"Time vs Number of records Huffman for Keyword Robot\");\n huffmanChartRobot.pack();\n huffmanChartRobot.setLocation(1200,0);\n huffmanChartRobot.setVisible(true);\n\n // These are the objects for searching the wearable keyword.\n BruteForce bruteForceWearable = new BruteForce();\n bruteForceWearable.setKeyword(\"wearables\");\n bruteForceWearable.searchKeyword();\n\n LuceneSearch luceneSearchWearable = new LuceneSearch(\"wearables\");\n luceneSearchWearable.luceneSearch();\n\n HuffmanSearch huffmanSearchWearable = new HuffmanSearch(\"wearables\");\n huffmanSearchWearable.huffmanSearch();\n\n\n // This creates chart for brute force algorithm with wearable as the search keyword.\n BruteForceChart bruteForceChartWearable =\n new BruteForceChart(\n \"Time vs Number of records Brute Force for Keyword Wearable\",\n \"Time vs Number of records Brute Force for Keyword Wearable\");\n bruteForceChartWearable.pack();\n bruteForceChartWearable.setLocation(0,500);\n // This to display the chart.\n bruteForceChartWearable.setVisible(true);\n\n\n\n // This creates chart for lucene algorithm with wearable as the search keyword.\n LuceneChart luceneChartWearable =\n new LuceneChart(\n \"Time vs Number of records Lucene for Keyword Wearable\",\n \"Time vs Number of records Lucene for Keyword Wearable\");\n luceneChartWearable.pack();\n luceneChartWearable.setLocation(600,500);\n // This to display the chart.\n luceneChartWearable.setVisible(true);\n\n\n // This creates chart for Huffman algorithm with wearable as the search keyword.\n HuffmanChart huffmanChartWearable =\n new HuffmanChart(\n \"Time vs Number of records Huffman for Keyword Wearable\",\n \"Time vs Number of records Huffman for Keyword Wearable\");\n huffmanChartWearable.pack();\n huffmanChartWearable.setLocation(1200, 500);\n huffmanChartWearable.setVisible(true);\n }", "public MultiThreadedTabuSearch(Solution initialSolution, MoveManager moveManager, ObjectiveFunction objectiveFunction, TabuList tabuList, AspirationCriteria aspirationCriteria, boolean maximizing)\n/* */ {\n/* 106 */ super(initialSolution, moveManager, objectiveFunction, tabuList, aspirationCriteria, maximizing);\n/* */ }", "public static void main(String[] args) {\n\t\t\n\t\tArrayList<Double> results = new ArrayList<Double>();\n\t\tArrayList<Double> psoResults = new ArrayList<Double>(); \n\t\tint numTermites = 20;\n\t\tint iterations = 10;\n\t\t\n\t\tdouble pStrength = 5;\n\t\tint moves = numTermites;\n\t\tdouble pImportance = 0.01;\n\t\tdouble decayRate = 0.15;\n\t\tdouble globalStrength = 0.25;\n\t\tdouble localStrength = 0.25;\n\t\tdouble randomStrength = 0.15;\n\t\tint runs = 100;\n\t\tfor (int size = 10; size<20; size+=10) {\n\t\t\tmoves = size*2;\n\t\t\ttry\n\t\t\t{\n\t\t\t FileWriter writer = new FileWriter(\"C:\\\\Users\\\\postcn\\\\Documents\\\\size_\"+moves+\".csv\");\n\t\t \n\t\t\t writer.append(\"pImportance\");\n\t\t\t writer.append(',');\n\t\t\t writer.append(\"Result\");\n\t\t\t writer.append('\\n');\n\t\t\t \n\t\t\t for (int i=0; i<runs*5-1; i++) {\n\t\t\t\t\tdouble best = 0;\n\t\t\t\t\tpImportance += 0.01;\n\t\t\t\t\tfor(int j=0; j<runs; j++) {\n\t\t\t\t\t\tGrid g = new Grid();\n\t\t\t\t\t\tg.printGrid();\n\t\t\t\t\t\tg.setSize(size, size);\n\t\t\t\t\t\t//g.setRandomValues();\n\t\t\t\t\t\tg.setGradientValues(1);\n\t\t\t\t\t\tdouble test = randomSearch(numTermites, iterations, pStrength, moves, pImportance, g, decayRate);\n\t\t\t\t\t\tif (test > best) {\n\t\t\t\t\t\t\tbest = test;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\twriter.append(pImportance+\"\");\n\t\t\t\t\twriter.append(',');\n\t\t\t\t\twriter.append(best+\"\");\n\t\t\t\t\twriter.append(\"\\n\");\n\t\t\t\t\tSystem.out.println(\"pImportance: \"+ pImportance + \" :\"+best);\n//\t\t\t\t\tresults.add();\n//\t\t\t\t\tpsoResults.add(PSOSearch(iterations,numTermites, g,globalStrength,localStrength,randomStrength));\n\t\t\t\t}\n\t\t \n\t\t\t //generate whatever data you want\n\t\t \n\t\t\t writer.flush();\n\t\t\t writer.close();\n\t\t\t}\n\t\t\tcatch(IOException e)\n\t\t\t{\n\t\t\t e.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tdouble accuracy = 0;\n\t\tfor (Double d : results) {\n\t\t\taccuracy += d;\n\t\t}\n\t\taccuracy = accuracy / (double) results.size();\n\t\tSystem.out.println(\"Termites ran an average of \" + accuracy+\"% accuracy.\");\n\t\taccuracy = 0;\n\t\tfor (Double d : psoResults) {\n\t\t\taccuracy += d;\n\t\t}\n\t\taccuracy = accuracy / (double) results.size();\n\t\tSystem.out.println(\"PSO ran an average of \" + accuracy+\"% accuracy.\");\n\t}", "@Override\n\tpublic boolean startSearch() {\n\t\tString str = \"\";\n\t\t\n\t\tDimension d = view.getInit();\n\t\tif (d == null) {\n\t\t\tstr = str + \"Falta la posicion de inicio.\\n\";\n\t\t} else {\n\t\t\ty0 = (int) d.getHeight();\n\t\t\tx0 = (int) d.getWidth();\n\t\t}\n\t\t\n\t\td = view.getGoal();\n\t\tif (d == null) {\n\t\t\tstr = str + \"Falta la posicion de meta.\\n\";\n\t\t} else {\n\t\t\tyf = (int) d.getHeight();\n\t\t\txf = (int) d.getWidth();\n\t\t}\n\t\t\n\t\tif (view.isBreadth()) {\n\t\t\tstrategy = new Breadth();\n\t\t} else if (view.isDepth()) {\n\t\t\tstrategy = new Depth();\n\t\t} else if (view.isAStar()) {\n\t\t\tstrategy = new AStar();\n\t\t\tif (view.isH0()) {\n\t\t\t\theuristic = Horse.H0;\n\t\t\t} else if (view.isH1()) {\n\t\t\t\theuristic = Horse.H1;\n\t\t\t} else if (view.isH2()) {\n\t\t\t\theuristic = Horse.H2;\n\t\t\t} else\n\t\t\t\tstr = str + \"Falta por escoger el tipo de heur’stica.\\n\";\n\t\t} else\n\t\t\tstr = str + \"Falta la estrategia de bœsqueda.\\n\";\n\t\t\n\t\tboard = view.getBoard();\n\t\t\n\t\tif (str.equals(\"\")) {\n\t\t\trootNode = new Node(new Horse(x0,y0,xf,yf, board, heuristic));\n\t\t}\n\t\t\n\t\tif (view.isTree()) {\n\t\t\tif (str.equals(\"\"))\n\t\t\t\tsearch = new Tree(rootNode, strategy);\n\t\t} else if (view.isGraph()) {\n\t\t\tif (str.equals(\"\"))\n\t\t\t\tsearch = new Graph(rootNode, strategy);\n\t\t} else \n\t\t\tstr = str + \"Falta el algoritmo de bœsqueda.\\n\";\n\t\t\n\t\tif (!str.equals(\"\")) {\n\t\t\tview.showError(str);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tgoSearch();\n\t\treturn true;\n\t}", "public SearchThread( ImagePlus imagePlus,\n\t\t\t float stackMin,\n\t\t\t float stackMax,\n\t\t\t boolean bidirectional,\n\t\t\t boolean definedGoal,\n\t\t\t boolean startPaused,\n\t\t\t int timeoutSeconds,\n\t\t\t long reportEveryMilliseconds ) {\n\n\t\tthis.imagePlus = imagePlus;\n\n\t\tthis.stackMin = stackMin;\n\t\tthis.stackMax = stackMax;\n\n\t\tthis.bidirectional = bidirectional;\n\t\tthis.definedGoal = definedGoal;\n\t\tthis.startPaused = startPaused;\n\n\t\tthis.imageType = imagePlus.getType();\n\n\t\twidth = imagePlus.getWidth();\n\t\theight = imagePlus.getHeight();\n\t\tdepth = imagePlus.getStackSize();\n\n\t\t{\n\t\t\tImageStack s = imagePlus.getStack();\n\t\t\tswitch(imageType) {\n\t\t\tcase ImagePlus.GRAY8:\n\t\t\tcase ImagePlus.COLOR_256:\n\t\t\t\tslices_data_b = new byte[depth][];\n\t\t\t\tfor( int z = 0; z < depth; ++z )\n\t\t\t\t\tslices_data_b[z] = (byte []) s.getPixels( z + 1 );\n\t\t\t\tbreak;\n\t\t\tcase ImagePlus.GRAY16:\n\t\t\t\tslices_data_s = new short[depth][];\n\t\t\t\tfor( int z = 0; z < depth; ++z )\n\t\t\t\t\tslices_data_s[z] = (short []) s.getPixels( z + 1 );\n\t\t\t\tbreak;\n\t\t\tcase ImagePlus.GRAY32:\n\t\t\t\tslices_data_f = new float[depth][];\n\t\t\t\tfor( int z = 0; z < depth; ++z )\n\t\t\t\t\tslices_data_f[z] = (float []) s.getPixels( z + 1 );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tCalibration calibration = imagePlus.getCalibration();\n\n\t\tx_spacing = (float)calibration.pixelWidth;\n\t\ty_spacing = (float)calibration.pixelHeight;\n\t\tz_spacing = (float)calibration.pixelDepth;\n\t\tspacing_units = calibration.getUnit();\n\n\t\tif( (x_spacing == 0.0) ||\n\t\t (y_spacing == 0.0) ||\n\t\t (z_spacing == 0.0) ) {\n\n\t\t\tIJ.error( \"SearchThread: One dimension of the calibration information was zero: (\" +\n\t\t\t\t x_spacing + \",\" + y_spacing + \",\" + z_spacing + \")\" );\n\t\t\treturn;\n\n\t\t}\n\n\t\tthis.timeoutSeconds = timeoutSeconds;\n\t\tthis.reportEveryMilliseconds = reportEveryMilliseconds;\n\n\t\tclosed_from_start = new PriorityQueue<SearchNode>();\n\t\topen_from_start = new PriorityQueue<SearchNode>();\n\t\tif( bidirectional ) {\n\t\t\tclosed_from_goal = new PriorityQueue<SearchNode>();\n\t\t\topen_from_goal = new PriorityQueue<SearchNode>();\n\t\t}\n\n\t\tnodes_as_image_from_start = new SearchNode[depth][];\n\t\tif( bidirectional )\n\t\t\tnodes_as_image_from_goal = new SearchNode[depth][];\n\n\t\tminimum_cost_per_unit_distance = minimumCostPerUnitDistance();\n\n\t\tprogressListeners = new ArrayList< SearchProgressCallback >();\n\t}", "public IterativeDeepeningAlphaBetaSearch(Game<S, A, P> game, double utilMin, double utilMax,\n int time) {\n this.game = game;\n this.utilMin = utilMin;\n this.utilMax = utilMax;\n this.timer = new Timer(time);\n }", "public void testSearchRules() throws Exception {\n Project project = new Project();\r\n \r\n DateFormatSymbols symbols = new DateFormatSymbols(Locale.US);\r\n \r\n for (int i = 0; i < 12; i++) {\r\n \r\n String month = symbols.getMonths()[i];\r\n String shortMonth = symbols.getShortMonths()[i];\r\n \r\n // Basic project info\r\n project.setId(i);\r\n project.setCategoryId(1);\r\n project.setAllowGuests(true);\r\n project.setMembershipRequired(false);\r\n project.setApproved(true);\r\n project.setClosed(false);\r\n project.setPortal(false);\r\n \r\n // Unique Title\r\n project.setTitle(month + \" test project\");\r\n project.setShortDescription(month + \" description word\");\r\n project.setKeywords(shortMonth);\r\n \r\n // Unique Location\r\n project.setCity(\"Virginia Beach\");\r\n project.setState(\"VA\");\r\n project.setPostalCode(\"234\" + String.valueOf(50 + i));\r\n \r\n // Random Rating for now\r\n project.setRatingCount(i + 1);\r\n project.setRatingValue(project.getRatingCount() * StringUtils.rand(1, 5));\r\n project.setRatingAverage(project.getRatingValue() / project.getRatingCount());\r\n \r\n // Index it\r\n ProjectIndexer indexer = new ProjectIndexer();\r\n indexer.add(snowballWriter, project, true);\r\n }\r\n \r\n QueryParser parser = new QueryParser(\"contents\", snowballAnalyzer);\r\n \r\n {\r\n // Make sure a single matching term yields a single hit\r\n SearchBean search = new SearchBean();\r\n search.setQuery(symbols.getMonths()[0]);\r\n search.setLocation(\"Virginia Beach\");\r\n assertNotNull(search.getQuery());\r\n assertNotNull(search.getLocation());\r\n search.parseQuery();\r\n assertTrue(search.isValid());\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n assertNotNull(queryString);\r\n \r\n // (approved:1)\r\n // AND (guests:1)\r\n // AND (closed:0)\r\n // AND (website:0)\r\n // AND (\"january\"^20 OR january^15 OR january*^4) AND (location:(\"virginia beach\"^30))\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == 1);\r\n }\r\n \r\n {\r\n // Make sure a single matching term stem yields a single hit\r\n SearchBean search = new SearchBean();\r\n search.setQuery(symbols.getMonths()[0] + \"'s\");\r\n search.setLocation(\"Virginia Beach\");\r\n assertNotNull(search.getQuery());\r\n assertNotNull(search.getLocation());\r\n search.parseQuery();\r\n assertTrue(search.isValid());\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n assertNotNull(queryString);\r\n \r\n // (approved:1)\r\n // AND (guests:1)\r\n // AND (closed:0)\r\n // AND (website:0)\r\n // AND (\"january's\"^20 OR january's^15 OR january's*^4) AND (location:(\"virginia beach\"^30))\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == 1);\r\n }\r\n \r\n {\r\n // Make sure multiple matching words yield two hits\r\n SearchBean search = new SearchBean();\r\n search.setQuery(symbols.getMonths()[0] + \" \" + symbols.getMonths()[1]);\r\n search.setLocation(\"Virginia Beach\");\r\n search.parseQuery();\r\n assertTrue(search.isValid());\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n assertNotNull(queryString);\r\n \r\n // (approved:1)\r\n // AND (guests:1)\r\n // AND (closed:0)\r\n // AND (website:0)\r\n // AND (\"january february\"^20 OR january^15 OR february^14 OR january*^4 OR february*^3) AND (location:(\"virginia beach\"^30))\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == 2);\r\n }\r\n \r\n {\r\n // Make sure wilcards yield multiple hits\r\n SearchBean search = new SearchBean();\r\n search.setQuery(\"j\");\r\n search.setLocation(\"Virginia Beach\");\r\n search.parseQuery();\r\n assertTrue(search.isValid());\r\n \r\n // Look for data with a \"j\" for comparison\r\n int jCount = 0;\r\n for (int i = 0; i < symbols.getMonths().length; i++) {\r\n if (symbols.getMonths()[i].toLowerCase().indexOf(\"j\") > -1 ||\r\n symbols.getShortMonths()[i].toLowerCase().indexOf(\"j\") > -1) {\r\n ++jCount;\r\n }\r\n }\r\n assertTrue(jCount > 0);\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n assertNotNull(queryString);\r\n \r\n // (approved:1)\r\n // AND (guests:1)\r\n // AND (closed:0)\r\n // AND (website:0)\r\n // AND (\"j\"^20 OR j^15 OR j*^4) AND (location:(\"virginia beach\"^30))\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == jCount);\r\n }\r\n \r\n {\r\n // Make sure alternate locations do not yield any hits\r\n SearchBean search = new SearchBean();\r\n search.setQuery(symbols.getMonths()[0]);\r\n search.setLocation(\"Norfolk\");\r\n search.parseQuery();\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == 0);\r\n }\r\n \r\n {\r\n // Make sure locations as query terms do not yield any hits\r\n SearchBean search = new SearchBean();\r\n search.setQuery(\"Virginia Beach\");\r\n search.setLocation(\"Virginia Beach\");\r\n search.parseQuery();\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == 0);\r\n }\r\n }", "private static void BicingsimulatedAnnealingSearch(int num, int n_est, int nbicis, int nfurgo, int d1, int cas, String Cas, String H, String D, int s) {\n\n\n try {\n\n double MedT = 0;\n //double MedN = 0;\n //double MedB = 0;\n int iteraciones = 100;\n Estado Bicing = new Estado(n_est,nbicis,nfurgo,d1,s,1);\n Bicing.setList_cdesp(iteraciones);\n long StartTime = System.nanoTime();\n Problem problem = new Problem(Bicing, new sucesoresA(), new isGoal(), new Heuristic_Function());\n SimulatedAnnealingSearch search = new SimulatedAnnealingSearch(iteraciones, 1000, 125, 0.00001D);\n SearchAgent agent = new SearchAgent(problem, search);\n List L = search.getPathStates();\n Properties properties = agent.getInstrumentation();\n long EndTime = System.nanoTime();\n Estado E = (Estado) search.getGoalState();\n long time = ((EndTime - StartTime) / 1000000);\n MedT += time;\n //MedB += E.getganancia();\n // MedN += Integer.parseInt(properties.getProperty((String)properties.keySet().iterator().next()));\n // MedB /= num;\n // MedN /= num;\n // MedT /= num;\n //MedB = (Math.round(MedB*100.0)/100.0);\n Writer output;\n output = new BufferedWriter(new FileWriter(\"Estadisticas_\" + Cas + \"_D\" + D + \"_H\" + H + \"S.txt\", true));\n double [] vec = E.getearnings();\n for (int i = 0 ; i < iteraciones; ++i) {\n String S = \"\" + vec[i];\n S = S + '\\n';\n output.append(S);\n }\n output.close();\n\n /*for (int i = 0; i < E.getN_furgo(); ++i) {\n System.out.println(\"Recorrido por furgoneta \" + i + \" \" + E.getIFurgo(i).getLong_t());\n }*/\n //printEstado(E);\n //System.out.println();\n //System.out.println(E.getganancia());\n //printActions(agent.getActions());\n //printInstrumentation(agent.getInstrumentation());\n } catch (Exception var4) {\n var4.printStackTrace();\n }\n\n }", "private Page<ElasticCandidate> search(CandidateSearchModel model, Pageable pageable){\n Integer experienceDuration = model.getSkillPlaceholder()\n .getExperienceDuration();\n String title = model.getSkillPlaceholder()\n .getSkill()\n .getTitle();\n RangeModel<Integer> rangeExperience = model.getSkillExperienceRange();\n Integer experienceUpperLimit = rangeExperience.getUpperLimit();\n Integer experienceLowerLimit = rangeExperience.getLowerLimit();\n\n // Prepares location\n String location = model.getLocation();\n\n // Prepare hourly rate\n Integer hourlyRate = model.getHourlyRate();\n RangeModel<Integer> rangeHourlyRate = model.getHourlyRateRange();\n Integer hourlyRateUpperLimit = rangeHourlyRate.getUpperLimit();\n Integer hourlyRateLowerLimit = rangeHourlyRate.getLowerLimit();\n\n // Prepares certifications\n Set<String> certifications = model.getCertifications();\n if (certifications != null && certifications.size() != 0) {\n Iterator iterator = certifications.iterator();\n String[] certificationsArray = new String[certifications.size()];\n for (int i = 0; i < certificationsArray.length; i++) {\n certificationsArray[i] = (String) iterator.next();\n }\n }\n\n // Prepares Starting date postponed !!\n// Long startingDate = model.getStartingDate().getTime();\n// Long startingDateUpperLimit = model.getStartingDateUpperRange().getTime();\n\n // Prepares time period\n String timePeriod = model.getTimePeriod();\n // endregion\n\n // region Build query\n SearchQuery searchQuery;\n\n\n if (certifications != null && certifications.size() != 0)\n searchQuery = new NativeSearchQueryBuilder().withQuery(matchAllQuery())\n\n\n .withQuery(\n boolQuery()\n .must(queryForMustSkill(title))\n .should(queryForExactValueSkill(title, experienceDuration))\n .should(queryForExactValueHourlyRate(hourlyRate))\n .should(queryForFuzzyHourlyRate(hourlyRate))\n .should(queryForFuzzySkill(title, experienceDuration))\n .should(queryForRangeSkill(title, experienceLowerLimit, experienceUpperLimit))\n .should(queryForRangeHourlyRate(hourlyRateLowerLimit, hourlyRateUpperLimit))\n .must(queryForLocation(location))\n// .must(queryForStartingDay(startingDate, startingDateUpperLimit))\n .must(queryForTimePeriod(timePeriod))\n .must(queryForCertifications(certifications)))\n .withPageable(pageable)\n .withFilter(queryForMustSkill(title))\n .withFilter(queryForExactValueSkill(title, experienceDuration))\n .withFilter(queryForExactValueHourlyRate(hourlyRate))\n .withFilter(queryForFuzzyHourlyRate(hourlyRate))\n .withFilter(queryForFuzzySkill(title, experienceDuration))\n .withFilter(queryForRangeSkill(title, experienceLowerLimit, experienceUpperLimit))\n .withFilter(queryForRangeHourlyRate(hourlyRateLowerLimit, hourlyRateUpperLimit))\n .withFilter(queryForLocation(location))\n .withFilter(queryForTimePeriod(timePeriod))\n .withFilter(queryForCertifications(certifications))\n// .withSort(SortBuilders.fieldSort(\"hourlyRate\")\n// .order(SortOrder.ASC))\n .build();\n\n else\n\n\n searchQuery = new NativeSearchQueryBuilder().withQuery(matchAllQuery())\n\n\n .withQuery(\n boolQuery()\n .must(queryForMustSkill(title))\n .should(queryForExactValueSkill(title, experienceDuration))\n .should(queryForExactValueHourlyRate(hourlyRate))\n .should(queryForFuzzyHourlyRate(hourlyRate))\n .should(queryForFuzzySkill(title, experienceDuration))\n .should(queryForRangeSkill(title, experienceLowerLimit, experienceUpperLimit))\n .should(queryForRangeHourlyRate(hourlyRateLowerLimit, hourlyRateUpperLimit))\n .must(queryForLocation(location))\n// .must(queryForStartingDay(startingDate, startingDateUpperLimit))\n .must(queryForTimePeriod(timePeriod)))\n .withPageable(pageable)\n .withFilter(queryForMustSkill(title))\n .withFilter(queryForExactValueSkill(title, experienceDuration))\n .withFilter(queryForExactValueHourlyRate(hourlyRate))\n .withFilter(queryForFuzzyHourlyRate(hourlyRate))\n .withFilter(queryForFuzzySkill(title, experienceDuration))\n .withFilter(queryForRangeSkill(title, experienceLowerLimit, experienceUpperLimit))\n .withFilter(queryForRangeHourlyRate(hourlyRateLowerLimit, hourlyRateUpperLimit))\n .withFilter(queryForLocation(location))\n .withFilter(queryForTimePeriod(timePeriod))\n// .withSort(SortBuilders.fieldSort(\"hourlyRate\")\n// .order(SortOrder.ASC))\n .build();\n\n // endregion\n\n // region Test\n Page<ElasticCandidate> queryForExactValueSkill = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForExactValueSkill(title, experienceDuration))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForExactValueHourlyRate = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForExactValueHourlyRate(hourlyRate))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForFuzzySkill = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForFuzzySkill(title, experienceDuration))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForFuzzyHourlyRate = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForFuzzyHourlyRate(hourlyRate))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForRangeSkill = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForRangeSkill(title, experienceLowerLimit, experienceUpperLimit))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForRangeHourlyRate = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForRangeHourlyRate(hourlyRateLowerLimit, hourlyRateUpperLimit))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForLocation = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForLocation(location))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForTimePeriod = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForTimePeriod(timePeriod))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForCertifications = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForCertifications(certifications))\n .build(), ElasticCandidate.class);\n // endregion\n\n\n Page<ElasticCandidate> sampleEntities = elasticsearchTemplate.queryForPage(searchQuery,\n ElasticCandidate.class);\n return sampleEntities;\n }", "@Test\n @Order(1)\n void algorithms() {\n \n Combination initialComb = new Combination();\n for (int i = 0; i < assignementProblem.getAssignmentData().getLength(); i++) {\n initialComb.add((long) i + 1);\n }\n assignementProblem.setInCombination(initialComb);\n executeAlgo(SearchTestUtil.ALGO.TABU);\n executeAlgo(SearchTestUtil.ALGO.RECUIT);\n }", "public List<OWLObject> search(OWLObject queryObj) {\n\t\tList<OWLObject> hits = new ArrayList<OWLObject>(maxHits);\n\t\tSystem.out.println(\"gettings atts for \"+queryObj+\" -- \"+simEngine.comparisonProperty);\n\t\tSet<OWLObject> atts = simEngine.getAttributeClosureFor(queryObj);\n\t\tSystem.out.println(\"all atts: \"+atts.size());\n\t\tif (atts.size() == 0)\n\t\t\treturn hits;\n\t\t\n\t\t// only compare using significant atts;\n\t\t// we don't do the same test on candidates as these will be removed by the\n\t\t// intersection operation. they will have a small effect on the score, as\n\t\t// we don't divide by the union, but instead the sum of sizes\n\t\tatts = filterNonSignificantAttributes(atts);\n\t\tSystem.out.println(\"filtered atts: \"+atts.size());\n\n\t\t//bloomFilter = new BloomFilter<OWLObject>(0.05, atts.size());\n\t\t//bloomFilter.addAll(atts);\n\t\t\t\t\n\t\tSortedMap<Integer,Set<OWLObject>> scoreCandidateMap = new TreeMap<Integer,Set<OWLObject>>();\n\t\t\n\t\tfor (OWLObject candidate : getCandidates()) {\n\t\t\tif (candidate.equals(queryObj))\n\t\t\t\tcontinue;\n\t\t\tSet<OWLObject> iAtts = simEngine.getAttributeClosureFor(candidate);\n\t\t\t//Set<OWLObject> iAtts = simEngine.getGraph().getAncestors(candidate);\n\n\t\t\tif (iAtts.size() == 0)\n\t\t\t\tcontinue;\n\t\t\tint cAttsSize = iAtts.size();\n\t\n\t\t\tiAtts.retainAll(atts);\n\t\t\t//Collection<OWLObject> iAtts = bloomFilter.intersection(cAtts);\n\t\t\t\n\t\t\t// simJ, one-sided, scaled by 1000\n\t\t\t// negate to ensure largest first\n\t\t\t//Integer score = - (iAtts.size() * 1000 / cAttsSize);\n\t\t\t\n\t\t\t// this biases us towards genes with large numbers of annotations,\n\t\t\t// but it is better at finding the models that share all features\n\t\t\tInteger score = - iAtts.size();\n\t\t\tif (!scoreCandidateMap.containsKey(score)) \n\t\t\t\tscoreCandidateMap.put(score, new HashSet<OWLObject>());\n\t\t\tscoreCandidateMap.get(score).add(candidate);\n\t\t\treporter.report(this,\"query_candidate_overlap_total\",queryObj,candidate,iAtts.size(),cAttsSize);\n\t\t}\n\t\t\n\t\tint n = 0;\n\t\tfor (Set<OWLObject> cs : scoreCandidateMap.values()) {\n\t\t\tn += cs.size();\n\t\t\thits.addAll(cs);\n\t\t}\n\t\t\n\t\tn = 0;\n\t\tfor (OWLObject hit : hits) {\n\t\t\tn++;\n\t\t\treporter.report(this,\"query_hit_rank_threshold\",queryObj,hit,n,maxHits);\n\t\t}\n\t\tif (hits.size() > maxHits)\n\t\t\thits = hits.subList(0, maxHits);\n\t\t\n\n\n\t\treturn hits;\n\t}", "private void setup_search_region (RJGUIController.XferCatalogMod xfer) {\n\n\t\t// Time range for aftershock search\n\t\t\n\t\tdouble minDays = xfer.x_dataStartTimeParam;\n\t\tdouble maxDays = xfer.x_dataEndTimeParam;\n\t\t\n\t\tlong startTime = fcmain.mainshock_time + Math.round(minDays*ComcatOAFAccessor.day_millis);\n\t\tlong endTime = fcmain.mainshock_time + Math.round(maxDays*ComcatOAFAccessor.day_millis);\n\n\t\t// Check that start date is before current time\n\n\t\tlong time_now = System.currentTimeMillis();\t\t// must be the actual system time, not ServerClock\n\t\t\n\t\tPreconditions.checkState(startTime < time_now, \"Start time is after now!\");\n\n\t\t// Check that end date is before current time, shrink the time range if not\n\t\t\n\t\tif (endTime > time_now) {\n\t\t\tdouble calcMaxDays = (time_now - startTime)/ComcatOAFAccessor.day_millis;\n\t\t\tSystem.out.println(\"WARNING: End time after current time. Setting max days to: \" + calcMaxDays);\n\t\t\txfer.modify_dataEndTimeParam(calcMaxDays);\n\t\t\tmaxDays = xfer.x_dataEndTimeParam;\n\t\t}\n\n\t\t// The magnitude-of-completeness parameters\n\n\t\tdouble magCat = fetch_fcparams.mag_comp_params.get_magCat();\n\t\tMagCompFn magCompFn = fetch_fcparams.mag_comp_params.get_magCompFn();\n\t\tSearchMagFn magSample = fetch_fcparams.mag_comp_params.get_fcn_magSample();\n\t\tSearchRadiusFn radiusSample = fetch_fcparams.mag_comp_params.get_fcn_radiusSample();\n\t\tSearchMagFn magCentroid = fetch_fcparams.mag_comp_params.get_fcn_magCentroid();\n\t\tSearchRadiusFn radiusCentroid = fetch_fcparams.mag_comp_params.get_fcn_radiusCentroid();\n\n\t\t// No custom region\n\n\t\tcustom_search_region = null;\n\n\t\t// Depth range for aftershock search, assume default\n\t\t\n\t\tdouble minDepth = ForecastParameters.SEARCH_PARAM_OMIT;\n\t\tdouble maxDepth = ForecastParameters.SEARCH_PARAM_OMIT;\n\n\t\t// Minimum magnitude is default, set from the mag-of-comp parameters\n\n\t\tdouble min_mag = ForecastParameters.SEARCH_PARAM_OMIT;\n\n\t\t// Switch on region type\n\n\t\tswitch (xfer.x_regionTypeParam) {\n\n\t\tcase STANDARD:\n\n\t\t\t// Standard region, just change to no minimum magnitude\n\n\t\t\tmagSample = magSample.makeRemovedMinMag();\n\t\t\tmagCentroid = magCentroid.makeRemovedMinMag();\n\t\t\tbreak;\n\n\t\tcase CENTROID_WC_CIRCLE:\n\n\t\t\t// WC circle around centroid, set multiplier and limits, and no minimum magnitude\n\n\t\t\tmagSample = SearchMagFn.makeNoMinMag();\n\t\t\tradiusSample = SearchRadiusFn.makeWCClip (\n\t\t\t\txfer.x_wcMultiplierParam,\n\t\t\t\txfer.x_minRadiusParam,\n\t\t\t\txfer.x_maxRadiusParam\n\t\t\t);\n\t\t\tmagCentroid = SearchMagFn.makeNoMinMag();\n\t\t\tradiusCentroid = SearchRadiusFn.makeWCClip (\n\t\t\t\txfer.x_wcMultiplierParam,\n\t\t\t\txfer.x_minRadiusParam,\n\t\t\t\txfer.x_maxRadiusParam\n\t\t\t);\n\t\t\tminDepth = xfer.x_minDepthParam;\n\t\t\tmaxDepth = xfer.x_maxDepthParam;\n\t\t\tbreak;\n\n\t\tcase CENTROID_CIRCLE:\n\n\t\t\t// Circle around centroid, set constant radius, and no minimum magnitude\n\n\t\t\tmagSample = SearchMagFn.makeNoMinMag();\n\t\t\tradiusSample = SearchRadiusFn.makeConstant (xfer.x_radiusParam);\n\t\t\tmagCentroid = SearchMagFn.makeNoMinMag();\n\t\t\tradiusCentroid = SearchRadiusFn.makeConstant (xfer.x_radiusParam);\n\t\t\tminDepth = xfer.x_minDepthParam;\n\t\t\tmaxDepth = xfer.x_maxDepthParam;\n\t\t\tbreak;\n\n\t\tcase EPICENTER_WC_CIRCLE:\n\n\t\t\t// WC circle around epicenter, set multiplier and limits, and no minimum magnitude\n\n\t\t\tmagSample = SearchMagFn.makeNoMinMag();\n\t\t\tradiusSample = SearchRadiusFn.makeWCClip (\n\t\t\t\txfer.x_wcMultiplierParam,\n\t\t\t\txfer.x_minRadiusParam,\n\t\t\t\txfer.x_maxRadiusParam\n\t\t\t);\n\t\t\tmagCentroid = SearchMagFn.makeSkipCentroid();\n\t\t\tradiusCentroid = SearchRadiusFn.makeConstant (0.0);\n\t\t\tminDepth = xfer.x_minDepthParam;\n\t\t\tmaxDepth = xfer.x_maxDepthParam;\n\t\t\tbreak;\n\n\t\tcase EPICENTER_CIRCLE:\n\n\t\t\t// Circle around epicenter, set constant radius, and no minimum magnitude\n\n\t\t\tmagSample = SearchMagFn.makeNoMinMag();\n\t\t\tradiusSample = SearchRadiusFn.makeConstant (xfer.x_radiusParam);\n\t\t\tmagCentroid = SearchMagFn.makeSkipCentroid();\n\t\t\tradiusCentroid = SearchRadiusFn.makeConstant (0.0);\n\t\t\tminDepth = xfer.x_minDepthParam;\n\t\t\tmaxDepth = xfer.x_maxDepthParam;\n\t\t\tbreak;\n\n\t\tcase CUSTOM_CIRCLE:\n\n\t\t\t// Custom circle, and no minimum magnitude\n\n\t\t\tmagSample = SearchMagFn.makeNoMinMag();\n\t\t\tmagCentroid = SearchMagFn.makeSkipCentroid();\n\t\t\tcustom_search_region = SphRegion.makeCircle (\n\t\t\t\tnew SphLatLon(xfer.x_centerLatParam, xfer.x_centerLonParam),\n\t\t\t\txfer.x_radiusParam\n\t\t\t);\n\t\t\tminDepth = xfer.x_minDepthParam;\n\t\t\tmaxDepth = xfer.x_maxDepthParam;\n\t\t\tbreak;\n\n\t\tcase CUSTOM_RECTANGLE:\n\n\t\t\t// Custom rectangle, and no minimum magnitude\n\n\t\t\tmagSample = SearchMagFn.makeNoMinMag();\n\t\t\tmagCentroid = SearchMagFn.makeSkipCentroid();\n\t\t\tcustom_search_region = SphRegion.makeMercRectangle (\n\t\t\t\tnew SphLatLon(xfer.x_minLatParam, xfer.x_minLonParam),\n\t\t\t\tnew SphLatLon(xfer.x_maxLatParam, xfer.x_maxLonParam)\n\t\t\t);\n\t\t\tminDepth = xfer.x_minDepthParam;\n\t\t\tmaxDepth = xfer.x_maxDepthParam;\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tthrow new IllegalStateException(\"Unknown region type: \" + xfer.x_regionTypeParam);\n\t\t}\n\n\t\t// Make revised magnitude-of-completeness parameters\n\n\t\tfetch_fcparams.mag_comp_params = new MagCompPage_Parameters (\n\t\t\tmagCat,\n\t\t\tmagCompFn,\n\t\t\tmagSample,\n\t\t\tradiusSample,\n\t\t\tmagCentroid,\n\t\t\tradiusCentroid\n\t\t);\n\n\t\t// Make the search region\n\n\t\tfetch_fcparams.set_aftershock_search_region (\n\t\t\tfcmain,\t\t\t\t\t// ForecastMainshock fcmain,\n\t\t\t0L,\t\t\t\t\t\t// long the_start_lag,\n\t\t\t0L,\t\t\t\t\t\t// long the_forecast_lag,\n\t\t\tcustom_search_region,\t// SphRegion the_aftershock_search_region,\n\t\t\tminDays,\t\t\t\t// double the_min_days,\n\t\t\tmaxDays,\t\t\t\t// double the_max_days,\n\t\t\tminDepth,\t\t\t\t// double the_min_depth,\n\t\t\tmaxDepth,\t\t\t\t// double the_max_depth,\n\t\t\tmin_mag\t\t\t\t\t// double the_min_mag\n\t\t);\n\n\t\tif (!( fetch_fcparams.aftershock_search_avail )) {\n\t\t\tthrow new IllegalStateException(\"Failed to build aftershock search region\");\n\t\t}\n\n\t\t// If the event (i.e. cur_mainshock) is outside the plotting domain, change its\n\t\t// hypocenter so it is inside the plotting domain\n\n\t\tLocation hypo = cur_mainshock.getHypocenterLocation();\n\t\tif (fetch_fcparams.aftershock_search_region.getPlotWrap()) {\n\t\t\tif (hypo.getLongitude() < 0.0) {\n\t\t\t\tcur_mainshock.setHypocenterLocation (new Location (\n\t\t\t\t\thypo.getLatitude(), hypo.getLongitude() + 360.0, hypo.getDepth() ));\n\t\t\t}\n\t\t} else {\n\t\t\tif (hypo.getLongitude() > 180.0) {\n\t\t\t\tcur_mainshock.setHypocenterLocation (new Location (\n\t\t\t\t\thypo.getLatitude(), hypo.getLongitude() - 360.0, hypo.getDepth() ));\n\t\t\t}\n\t\t}\n\n\t\treturn;\n\t}", "public static <STATE, ACTION, PLAYER> IterativeDeepeningAlphaBetaSearch<STATE, ACTION, PLAYER> createFor(\n Game<STATE, ACTION, PLAYER> game, double utilMin, double utilMax, int time) {\n return new IterativeDeepeningAlphaBetaSearch<>(game, utilMin, utilMax, time);\n }", "public void rodaAleatorio()\r\n {\r\n // Carrega os dados\r\n String ArqBD = \"Dados/Base\" + NUM_DB + \"/DADOS\" + NUM_PROV + \"x\" + NUM_PIS + \".txt\";\r\n String ArqReq = \"Requisicoes/Base\" + NUM_DB + \"/REQ\" + NUM_REQ + \"_\" + NUM_PIS + \".txt\";\r\n AvaliaFitness af = new AvaliaFitness(ArqBD, ArqReq);\r\n //af.imprime();\r\n \r\n // Variaveis\r\n int i, numIt, NUM_VARS = af.getBase_dados().getNumProvedores();\r\n long tempoInicial, tempoFinal;\r\n IndividuoBin atual;\r\n IndividuoBin melhor; \r\n IndividuoBin[] eleitos = new IndividuoBin[MAX_EXECUCOES]; \r\n double[] tempoExecusao = new double[MAX_EXECUCOES];\r\n \r\n System.out.println(\"# # # # # Algoritmo de Busca Aleatoria # # # # #\\n\"); \r\n //System.out.println(\"Espaço de busca: \" + (long)(Math.pow(2, NUM_VARS) - 1));\r\n System.out.println(\"NumProv: \" + NUM_PROV + \"\\nNumReq: \" + NUM_REQ + \"\\nNumPIs: \" + NUM_PIS + \"\\nNumDB: \" + NUM_DB);\r\n \r\n // Inicia as execuções\r\n int execucao = 1;\r\n // LOOP DE EXECUÇÕES\r\n while(execucao <= MAX_EXECUCOES)\r\n {\r\n numIt = 0; \r\n melhor = new IndividuoBin(NUM_VARS);\r\n // Inicia o cronômetro\r\n tempoInicial = System.currentTimeMillis(); \r\n // LOOP DE ITERAÇÕES\r\n while(numIt < MAX_ITERACOES)\r\n {\r\n atual = new IndividuoBin(NUM_VARS);\r\n atual.geraCodRand();\r\n //atual.imprimeCodificacao();\r\n af.fitness(atual);\r\n if(atual.getFitness() > melhor.getFitness())\r\n melhor = atual;\r\n \r\n numIt++;\r\n }\r\n // Interrompe o cronômetro\r\n tempoFinal = (System.currentTimeMillis() - tempoInicial);\r\n //System.out.println(\"\\nTempo de execução: \" + tempoFinal + \" ms ou \" + (tempoFinal/1000.0) + \" seg\\n\");\r\n \r\n // Guarda o melhor individuo e o tempo dessa execução\r\n eleitos[execucao - 1] = melhor;\r\n tempoExecusao[execucao - 1] = tempoFinal;\r\n \r\n // Imprime o melhor individuo\r\n System.out.println(\"\\nExecução \" + execucao + \": \");\r\n // Resposta\r\n if(!melhor.isPenalizado())\r\n {\r\n System.out.println(\"Melhor fitness: \" + melhor.getFitness());\r\n //System.out.print(\"Codificação: \");\r\n //melhor.imprimeCod();\r\n melhor.imprimeProvCod(); \r\n }\r\n else\r\n {\r\n System.out.println(\"Não foi encontrado um individuo valido com \" + MAX_ITERACOES + \" iterações.\"); \r\n System.out.println(\"Melhor fitness: \" + melhor.getFitness());\r\n //System.out.print(\"Codificação: \");\r\n //melhor.imprimeCod();\r\n melhor.imprimeProvCod(); \r\n }\r\n \r\n //System.out.println(\"\\nTempo da execução \" + execucao + \": \" + tempoFinal + \" ms ou \" + (tempoFinal/1000.0) + \" seg\");\r\n // Próxima execucao\r\n execucao++;\r\n } // Fim das execucoes\r\n \r\n // # # # # Estatisticas pós execuções do Aleatorio # # # #\r\n estatisticaFinais(eleitos, tempoExecusao);\r\n }", "private ExtList makeGraph(ExtList criteria, Object process, ExtList tuples, int aeth, ExtList result) {\n//\t\tSystem.out.println(\"propa\"+System.getProperty(\"java.library.path\"));\n\t\tLog.out(\"criteria \" + criteria);\n\t\tLog.out(\"process \" + process);\n\t\tLog.out(\"tuples \" + tuples);\n\t\tLog.out(\"aeth \" + aeth);\n\t\tLog.out(\"result \" + result);\n\t\t\n\t\tExtList buffer = new ExtList();\n\t\tExtList tuples_buffer = new ExtList();\n\t\tExtList tmp = new ExtList();\n\n\t\tExtList x;\n\t\tExtList y;\n\t\tboolean flag = true;\n\n\t\tString target_x;\n\t\tString target_y;\n\t\tString aeth_type = \"\";\n\n\n\n\t\tRengine engine;\n\n\t\tresult.clear();\n\n\t\tif (!Preprocessor.isR()) {\n\t\t\tengine = new Rengine(new String[]{\"--vanilla\"}, false, null);\n\t\t\tnew Preprocessor().setR();\n\n\t\t} else {\n\t\t\tengine = Rengine.getMainEngine();\n\t\t}\n\t\tengine.eval(\"setwd(\\\"\" + GlobalEnv.getOutputDirPath() + \"\\\")\");\n//\t\tengine.eval(\".libPaths(\\\"\" + path + \"/lib/site-library\\\")\");\n//\t\tengine.eval(\".libPaths(\\\"/Users/otawa/Documents/workspace/NewSSQL/lib/site-library\\\")\");\n//\t\tengine.eval(\".libPaths(\\\"/usr/local/lib/R/4.0/site-library\\\")\");\t\t\t//TODO_old -> おそらく無しでOK\n\t\tengine.eval(\"library(tidyverse)\");\n\t\tengine.eval(\"library(plotly)\");\n\t\tengine.eval(\"Sys.setlocale(\\\"LC_CTYPE\\\", \\\"ja_JP.UTF-8\\\")\");\n\n\t\ttarget_x = process.toString().split(\" \")[0];\n\t\ttarget_y = process.toString().split(\" \")[1];\n\t\tLog.info(\"process: \" + process.toString());\n\t\twhile (tuples.size() > 0) {\n\n\t\t\t/* find tuples with the same criteria */\n\n\t\t\tx = (ExtList)(tuples.get(0));\n\t\t\t//System.out.println(x+\" \"+x.size()+\" \"+tuples.size());\n//\t\t\tif (x.size()<2) {\n//\t\t\t\tbreak;\n//\t\t\t}\n\t\t\tfor (int i = 1; i < tuples.size(); i++) {\n\t\t\t\ty = (ExtList)(tuples.get(i));\n\t\t\t\t//Log.out(\"criteria: \" + criteria);\n\t\t\t\t//Log.out(\"criteria_size: \" + criteria.size());\n\t\t\t\t//Log.out(\"break x: \" + x + \" size: \" + x.size() + \" tuples.size\" + tuples.size());\n\t\t\t\t//Log.out(\"break y: \" + y + \" size: \" + y.size() + \" tuples.size\" + tuples.size());\n\t\t\t\t\n\t\t\t\tfor (int k = 0; k < criteria.size(); k++) {\n\t\t\t\t\t\n\t\t\t\t\tif (!(x.get(Integer.parseInt(criteria.get(k).toString())).equals\n\t\t\t\t\t (y.get(Integer.parseInt(criteria.get(k).toString()))))) {\n\t\t\t\t\t\tflag = false;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif (flag) {\n\t\t\t\t\tbuffer.add(y);\n\t\t\t\t\ttuples.remove(i--);\n\t\t\t\t} else {\n\t\t\t\t\tflag = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbuffer.add(x);\n//\t\t\tSystem.out.println(\"buffer:\"+buffer);\n\t\t\ttuples.remove(0);\n\n\n\t\t\tList<String> buffer_x = new ArrayList<String>();\n\t\t\tList<String> buffer_y = new ArrayList<String>();\n\t\t\tList<String> buffer_aeth = new ArrayList<String>();\n\n\t\t\tfor (int i = 0; i < buffer.size(); i++) {\n\t\t\t\t//Log.out(\"2.break i: \" + i + \" target_x: \" + target_x);\n\t\t\t\t//Log.out(\"2.break i: \" + i + \" target_y: \" + target_y);\n\t\t\t\t//Log.out(\"2.break size of buffer \" + buffer.size());\n\t\t\t\tbuffer_x.add(buffer.getExtListString(i, Integer.parseInt(target_x)));\n\t\t\t\tbuffer_y.add(buffer.getExtListString(i, Integer.parseInt(target_y)));\n\t\t\t\tif (aeth > 0)\n\t\t\t\t\tbuffer_aeth.add(buffer.getExtListString(i, aeth));\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tint result_x[] = new int[buffer_x.size()];\n\t\t\t\tfor (int i = 0; i < buffer_x.size(); i++) {\n\t\t\t\t\tresult_x[i] = Integer.parseInt(buffer_x.get(i));\n\t\t\t\t\tLog.out(\"result_x(int): \" + result_x);\n\t\t\t\t}\n\t\t\t\tengine.assign(\"result_x\", result_x);\n\t\t\t} catch(NumberFormatException e) {\n\t\t\t\ttry {\n\t\t\t\t\tdouble result_x[] = new double[buffer_x.size()];\n\t\t\t\t\tfor (int i = 0; i < buffer_x.size(); i++) {\n\t\t\t\t\t\tresult_x[i] = Double.parseDouble(buffer_x.get(i));\n\t\t\t\t\t\tLog.out(\"result_x(double): \" + result_x);\n\t\t\t\t\t}\n\t\t\t\t\tengine.assign(\"result_x\", result_x);\n\t\t\t\t} catch (NumberFormatException e1) {\n\t\t\t\t\tString result_x[] = new String[buffer_x.size()];\n\t\t\t\t\t\n\t\t\t\t\tfor (int i = 0; i < buffer_x.size(); i++) {\n\t\t\t\t\t\tresult_x[i] = buffer_x.get(i);\n\t\t\t\t\t}\n\t\t\t\t\t//Log.out(\"result_x(string): \" + Arrays.toString(result_x));\n\t\t\t\t\t//added by li to check date\n\t\t\t\t\ttry {\n\t\t\t\t\t\tSimpleDateFormat sdFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\t\t\t\t\tfor (int i = 0; i < buffer_x.size(); i++) {\n\t\t\t\t\t\t\tresult_x[i] = buffer_x.get(i);\n\t\t\t\t\t\t\tDate date = sdFormat.parse(result_x[i]);\n\t\t\t\t\t\t\tLog.out(\"Is Date :\" + date);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tengine.assign(\"result_x\", result_x);\n\t\t\t\t\t\t//added by li\n\t\t\t\t\t\tengine.eval(\"result_x <- as.Date(result_x)\");\n\t\t\t\t\t} catch(ParseException e2) {\n\t\t\t\t\t\t//Log.out(\"Result_x is not a date.\");\n\t\t\t\t\t\tengine.assign(\"result_x\", result_x);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tint result_y[] = new int[buffer_y.size()];\n\t\t\t\tfor (int i = 0; i < buffer_y.size(); i++) {\n\t\t\t\t\tresult_y[i] = Integer.parseInt(buffer_y.get(i));\n\t\t\t\t}\n\t\t\t\tengine.assign(\"result_y\", result_y);\n\t\t\t\t//Log.out(\"result_y: \" + result_y);\n\t\t\t} catch(NumberFormatException e) {\n\t\t\t\ttry {\n\t\t\t\t\tdouble result_y[] = new double[buffer_y.size()];\n\t\t\t\t\tfor (int i = 0; i < buffer_y.size(); i++) {\n\t\t\t\t\t\tresult_y[i] = Double.parseDouble(buffer_y.get(i));\n\t\t\t\t\t}\n\t\t\t\t\tengine.assign(\"result_y\", result_y);\n\t\t\t\t\t\n\t\t\t\t} catch (NumberFormatException e1) {\n\t\t\t\t\tString result_y[] = new String[buffer_y.size()];\n\t\t\t\t\tfor (int i = 0; i < buffer_y.size(); i++) {\n\t\t\t\t\t\tresult_y[i] = buffer_y.get(i);\n\t\t\t\t\t}\n\t\t\t\t\t//added by li to check date\n\t\t\t\t\ttry {\n\t\t\t\t\t\tSimpleDateFormat sdFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\t\t\t\t\tfor (int i = 0; i < buffer_x.size(); i++) {\n\t\t\t\t\t\t\tresult_y[i] = buffer_x.get(i);\n\t\t\t\t\t\t\tDate date = sdFormat.parse(result_y[i]);\n\t\t\t\t\t\t\tLog.out(\"Is Date :\" + date);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tengine.assign(\"result_y\", result_y);\n\t\t\t\t\t\t//added by li\n\t\t\t\t\t\tengine.eval(\"result_y <- as.Date(result_y)\");\n\t\t\t\t\t} catch(ParseException e2) {\n\t\t\t\t\t\tLog.out(\"Error!Result_y is not a date.\");\n\t\t\t\t\t\tengine.assign(\"result_y\", result_y);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (aeth > 0) {\n\t\t\t\ttry {\n\t\t\t\t\tint result_aeth[] = new int[buffer_aeth.size()];\n\t\t\t\t\tfor (int i = 0; i < buffer_aeth.size(); i++) {\n\t\t\t\t\t\tresult_aeth[i] = Integer.parseInt(buffer_aeth.get(i));\n\t\t\t\t\t}\n\t\t\t\t\tengine.assign(\"result_aeth\", result_aeth);\n\t\t\t\t} catch(NumberFormatException e) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tdouble result_aeth[] = new double[buffer_aeth.size()];\n\t\t\t\t\t\tfor (int i = 0; i < buffer_aeth.size(); i++) {\n\t\t\t\t\t\t\tresult_aeth[i] = Double.parseDouble(buffer_aeth.get(i));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tengine.assign(\"result_aeth\", result_aeth);\n\t\t\t\t\t} catch (NumberFormatException e1) {\n\t\t\t\t\t\tString result_aeth[] = new String[buffer_aeth.size()];\n\t\t\t\t\t\tfor (int i = 0; i < buffer_aeth.size(); i++) {\n\t\t\t\t\t\t\tresult_aeth[i] = buffer_aeth.get(i);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tengine.assign(\"result_aeth\", result_aeth);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tString r_html_filename = GlobalEnv.getfilename3()+\"_graph\";\n\t\t\ttry {\n\t\t\t\tr_html_filename += \"_\" + buffer.getExtListString(0, Integer.parseInt(criteria.getExtListString(0)));\n\t\t\t\tfor (int i = 1; i < criteria.size(); i++) {\n\t\t\t\t\tr_html_filename += \"_\" + buffer.getExtListString(0, Integer.parseInt(criteria.getExtListString(i)));\n\t\t\t\t}\n\t\t\t} catch (Exception e) { }\n\n\n//\t\t\tSystem.out.println(process);\n\t\t\tint n = process.toString().split(\":\").length;\n\n\n\n\t\t\tif (aeth > 0) {\n\t\t\t\tengine.eval(\"frame <- data.frame(X=result_x, Y=result_y, AETH=result_aeth)\");\n\t\t\t\tfor (int i = 1; i < n; i++) {\n\t\t\t\t\tif (process.toString().split(\":\")[i].contains(\"color\") && !process.toString().split(\":\")[i].contains(\"\\\"\") ) {\n\t\t\t\t\t\taeth_type = process.toString().split(\":\")[i].substring(0, process.toString().split(\":\")[i].indexOf(\"=\") + 1);\n\t\t\t\t\t}\n\t\t\t\t\tif (process.toString().split(\":\")[i].contains(\"fill\") && !process.toString().split(\":\")[i].contains(\"\\\"\") ) {\n\t\t\t\t\t\taeth_type = process.toString().split(\":\")[i].substring(0, process.toString().split(\":\")[i].indexOf(\"=\") + 1);\n\t\t\t\t\t}\n\t\t\t\t\tif (process.toString().split(\":\")[i].contains(\"size\") && !process.toString().split(\":\")[i].contains(\"\\\"\") ) {\n\t\t\t\t\t\taeth_type = process.toString().split(\":\")[i].substring(0, process.toString().split(\":\")[i].indexOf(\"=\") + 1);\n\t\t\t\t\t}\n\t\t\t\t\tif (process.toString().split(\":\")[i].contains(\"group\") && !process.toString().split(\":\")[i].contains(\"\\\"\") ) {\n\t\t\t\t\t\taeth_type = process.toString().split(\":\")[i].substring(0, process.toString().split(\":\")[i].indexOf(\"=\") + 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tengine.eval(\"graph <- ggplot(data = frame, aes(x = X, y = Y, \" + aeth_type +\"AETH))\");\n\t\t\t\t//engine.eval(\"graph <- ggplot(subset(data = frame, !is.na(x,y)), aes(x = X, y = Y, \" + aeth_type +\"AETH))\");\n\t\t\t} else {\n\t\t\t\tengine.eval(\"frame <- data.frame(X=result_x, Y=result_y)\");\n\t\t\t\t//engine.eval(\"frame <- subset(data.frame(X=result_x, Y=result_y), !is.na(x,y))\");\n\t\t\t\tengine.eval(\"graph <- ggplot(data = frame, aes(x = X, y = Y))\");\n\t\t\t\t//engine.eval(\"graph <- ggplot(data = subset(frame, !is.na(X), !is.na(Y)), aes(x = X, y = Y))\");\n\t\t\t}\n\n\t\t\tfor (int i = 1; i < n; i++) {\n\t\t\t\tif((process.toString().split(\":\")[i].contains(\"color\") ||\n\t\t\t\t\tprocess.toString().split(\":\")[i].contains(\"fill\") ||\n\t\t\t\t\tprocess.toString().split(\":\")[i].contains(\"size\") ||\n\t\t\t\t\tprocess.toString().split(\":\")[i].contains(\"group\") ||\n\t\t\t\t\tprocess.toString().split(\":\")[i].contains(\"width\") ||\n\t\t\t\t\tprocess.toString().split(\":\")[i].contains(\"height\"))\n\t\t\t\t\t&& !process.toString().split(\":\")[i].contains(\"\\\"\")) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (process.toString().split(\":\")[i].contains(\"geom_bar\") ) {\n\t\t\t\t\tif (process.toString().split(\":\")[i].contains(\"=\")) {\n\t\t\t\t\t\tengine.eval(\" graph <- graph + geom_bar(stat = 'identity', \" + process.toString().split(\":\")[i].split(\"\\\"\")[1] + \")\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tengine.eval(\" graph <- graph + geom_bar(stat = 'identity')\");\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (process.toString().split(\":\")[i].contains(\"=\")) {\n\t\t\t\t\tengine.eval(\" graph <- graph + \" + process.toString().split(\":\")[i].split(\"=\")[0] + \"(\" + process.toString().split(\":\")[i].split(\"\\\"\")[1] + \")\");\n\t\t\t\t} else {\n\t\t\t\t\tengine.eval(\" graph <- graph + \" + process.toString().split(\":\")[i] + \"()\");\n\t\t\t\t}\n\n\n\n\t\t\t/*\tif (process.toString().split(\":\")[i].contains(\"geom_point\") ) {\n\t\t\t\t\tif (process.toString().split(\":\")[i].contains(\"=\")) {\n\t\t\t\t\t\tengine.eval(\" graph <- graph + geom_point(\" + process.toString().split(\":\")[i].split(\"\\\"\")[1] + \")\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tengine.eval(\" graph <- graph + geom_point()\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (process.toString().split(\":\")[i].contains(\"geom_line\") ) {\n\t\t\t\t\tif (process.toString().split(\":\")[i].contains(\"=\")) {\n\t\t\t\t\t\tengine.eval(\" graph <- graph + geom_line(\" + process.toString().split(\":\")[i].split(\"\\\"\")[1] + \")\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tengine.eval(\" graph <- graph + geom_line()\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (process.toString().split(\":\")[i].contains(\"geom_smooth\") ) {\n\t\t\t\t\tif (process.toString().split(\":\")[i].contains(\"=\")) {\n\t\t\t\t\t\tengine.eval(\" graph <- graph + geom_smooth(\" + process.toString().split(\":\")[i].split(\"\\\"\")[1] + \")\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tengine.eval(\" graph <- graph + geom_smooth()\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (process.toString().split(\":\")[i].contains(\"geom_bar\") ) {\n\t\t\t\t\tif (process.toString().split(\":\")[i].contains(\"=\")) {\n\t\t\t\t\t\tengine.eval(\" graph <- graph + geom_bar(stat = 'identity', \" + process.toString().split(\":\")[i].split(\"\\\"\")[1] + \")\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tengine.eval(\" graph <- graph + geom_bar(stat = 'identity')\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (process.toString().split(\":\")[i].contains(\"coord_flip\") ) {\n\t\t\t\t\tengine.eval(\" graph <- graph + coord_flip()\");\n\t\t\t\t}\n\n\t\t\t\tif (process.toString().split(\":\")[i].contains(\"coord_polar\") ) {\n\t\t\t\t\tengine.eval(\" graph <- graph + coord_polar()\");\n\t\t\t\t}\n\n\t\t\t\tif (process.toString().split(\":\")[i].contains(\"labs\") ) {\n\t\t\t\t\tengine.eval(\" graph <- graph + labs(\" + process.toString().split(\":\")[i].split(\"\\\"\")[1] + \")\");\n\t\t\t\t}\n\n////\t\t\t\tif (process.toString().split(\" \")[i].contains(\"errorbar\") ) {\n////\t\t\t\t\tengine.eval(\" graph <- graph + geom_errorbar()\");\n//\t\t\t\t} */\n\t\t\t}\n\n\t\t\tengine.eval(\"graph <- ggplotly(graph)\");\n\t\t\tLog.out(\"r: r_html_filename = \"+r_html_filename + \"_\" + count + \".html\");\n\t\t\t//engine.eval(\"htmlwidgets::saveWidget(as_widget(graph), \\\"\" + r_html_filename + \"_\" + count + \".html\\\")\");\n\t\t\tengine.eval(\"htmlwidgets::saveWidget(as_widget(graph), \\\"\" + r_html_filename + \"_\" + count + \".html\\\", selfcontained=FALSE)\");\n\t engine.end();\n\n//\t tmp = buffer.getExtList(0);\n//\t tmp.set(Integer.parseInt(target_x), \"ggplot\" + name + \".html\");\n//\t tmp.set(Integer.parseInt(target_y), name);\n//\t tuples_buffer.add(tmp);\n\n\t for (int i = 0; i < buffer.size(); i++) {\n\t \t\tbuffer.getExtList(i).set(Integer.parseInt(target_x), \"ggplot\" + r_html_filename + \"_\" + count + \".html\");\n\t \t\t//buffer.getExtList(i).set(Integer.parseInt(target_y), r_html_filename);\n\t \t\tbuffer.getExtList(i).set(Integer.parseInt(target_y), \"\");\n//\t \t\tSystem.out.println(buffer.getExtListString(i, Integer.parseInt(target_x)));\n//\t \t\tSystem.out.println(buffer.getExtListString(i, Integer.parseInt(target_y)));\n\t }\n//\t buffer.getExtList(0).set(Integer.parseInt(target_x), \"ggplot\" + name + \".html\");\n//\t buffer.getExtList(0).set(Integer.parseInt(target_y), name);\n\t tuples_buffer.addAll(buffer);\n\n\t result.add(buffer.getExtList(0));\n\t\t\tbuffer.clear();\n\n//\t\t\tcount++;\n//\t\t\tSystem.out.println(count);\n\n\t\t}\n\t\tcount++;\n\t\treturn tuples_buffer;\n\n\t}", "public void startSearch() {\n if (solving) {\n Alg.Dijkstra();\n }\n pause(); //pause state\n }", "public void estimateParameter(){\r\n int endTime=o.length;\r\n int N=hmm.stateCount;\r\n double p[][][]=new double[endTime][N][N];\r\n for (int t=0;t<endTime;++t){\r\n double count=EPS;\r\n for (int i=0;i<N;++i){\r\n for (int j=0;j<N;++j){\r\n p[t][i][j]=fbManipulator.alpha[t][i]*hmm.a[i][j]*hmm.b[i][j][o[t]]*fbManipulator.beta[t+1][j];\r\n count +=p[t][j][j];\r\n }\r\n }\r\n for (int i=0;i<N;++i){\r\n for (int j=0;j<N;++j){\r\n p[t][i][j]/=count;\r\n }\r\n }\r\n }\r\n double pSumThroughTime[][]=new double[N][N];\r\n for (int i=0;i<N;++i){\r\n for (int j=0;j<N;++j){\r\n pSumThroughTime[i][j]=EPS;\r\n }\r\n }\r\n for (int t=0;t<endTime;++t){\r\n for (int i=0;i<N;++i){\r\n for (int j=0;j<N;++j){\r\n pSumThroughTime[i][j]+=p[t][i][j];\r\n }\r\n }\r\n }\r\n\r\n //rebuild gamma\r\n for (int t=0;t<endTime;++t){\r\n for (int i=0;i<N;++i) fbManipulator.gamma[t][i]=0;\r\n for (int i=0;i<N;++i){\r\n for (int j=0;j<N;++j){\r\n fbManipulator.gamma[t][i]+=p[t][i][j];\r\n }\r\n }\r\n }\r\n\r\n double gammaCount=EPS;\r\n //maximum parameter\r\n for (int i=0;i<N;++i){\r\n gammaCount+=fbManipulator.gamma[0][i];\r\n hmm.pi[i]=fbManipulator.gamma[0][i];\r\n }\r\n for (int i=0;i<N;++i){\r\n hmm.pi[i]/=gammaCount;\r\n }\r\n\r\n for (int i=0;i<N;++i) {\r\n gammaCount = EPS;\r\n for (int t = 0; t < endTime; ++t) gammaCount += fbManipulator.gamma[t][i];\r\n for (int j = 0; j < N; ++j) {\r\n hmm.a[i][j] = pSumThroughTime[i][j] / gammaCount;\r\n }\r\n }\r\n for (int i=0;i<N;i++){\r\n for (int j=0;j<N;++j){\r\n double tmp[]=new double[hmm.observationCount];\r\n for (int t=0;t<endTime;++t){\r\n tmp[o[t]]+=p[t][i][j];\r\n }\r\n for (int k=0;k<hmm.observationCount;++k){\r\n hmm.b[i][j][k]=(tmp[k]+1e-8)/pSumThroughTime[i][j];\r\n }\r\n }\r\n }\r\n //rebuild fbManipulator\r\n fbManipulator=new HMMForwardBackwardManipulator(hmm,o);\r\n }", "private void CreatingBeautyContent(int count,int typeSymmetry, int methodSearch) {\n\t\t\tConstraintsPlacement objConstraints= new ConstraintsPlacement(this);\r\n\t\t\t//Creating array with states\r\n\t\t\tArrayList<BlockNode> states = new ArrayList<BlockNode>();\r\n\t\t\t//Building the graph in a deph way\r\n\t \tGraphBuilder objGrapB= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB2= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB3= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB3a= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB4= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB5= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB6= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB7= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB8= new GraphBuilder(1);\r\n\t \t\r\n\t \tobjGrapB.setWparamether(wParamether);\r\n\t \tobjGrapB2.setWparamether(wParamether);\r\n\t \tobjGrapB3.setWparamether(wParamether);\r\n\t \tobjGrapB3a.setWparamether(wParamether);\r\n\t \tobjGrapB4.setWparamether(wParamether);\r\n\t \tobjGrapB5.setWparamether(wParamether);\r\n\t \tobjGrapB6.setWparamether(wParamether);\r\n\t \tobjGrapB7.setWparamether(wParamether);\r\n\t \tobjGrapB8.setWparamether(wParamether);\r\n\t \t\r\n\t \tint numElements=objElem.getNumberObjects();\r\n\t \tint numEnemies=objElem.getNumberObjectsEnemies();\r\n\t \tint globalControlSearch=0;\r\n\t \t\r\n\t \tdouble time6=0;\r\n\t \tdouble time7=0;\r\n\t \tdouble time3=0;\r\n\t \tdouble time4=0;\r\n\t \tdouble time5=0;\r\n\t \tdouble time8=0;\r\n\t \t\r\n\t \tdouble startTime=0;\r\n\t \tdouble stopTime=0;\r\n\t \t\r\n\t \tdouble sum3=0;\r\n\t \tdouble sum4=0;\r\n\t \tdouble sum5=0;\r\n\t \tdouble sum6=0;\r\n\t \tdouble sum7=0;\r\n\t \tdouble sum8=0;\r\n\r\n\t \t\r\n\t \t//Beststates=objGrapB.basicDepthSearch(mediumStraight,height,numElements,numElements,states,objConstraints, objElem.getFinalList(),objElem);\r\n\t \t//Beststates=objGrapB.relativePositionDepthSearch(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,-mediumStraight+2,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch);\r\n\t \t//Beststates=objGrapB.relativeTransPositionDepthSearch(mediumStraight,height,numElements,numElements,states,objConstraints, objElem.getFinalList(),objElem,-mediumStraight+1,mediumStraight-1,floorTileHeight,0,0,currentState,hTable);\r\n\t \t//Beststates=objGrapB.DepthSearchCenterFrame(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,1,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch);\r\n\t \t//Beststates=objGrapB.DepthSearchPruningAlt(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,1,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch);\r\n\t \t\r\n\t \r\n\r\n\t \r\n\t //3.3) Brute-force search\r\n\t //objElem.setFinalList(objElem.getFinalListNoOrder());\r\n\t \tfor(int i=0;i<1;i++)\r\n\t \t{\r\n\t \t\tstartTime = System.currentTimeMillis();\r\n\t \t\tBeststates3=objGrapB3.DepthSearchCenterFrameNoPruningNoRegionsNoObjects(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,0,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch,8,typeSymmetry);\r\n\t \t\tstopTime = System.currentTimeMillis();\r\n\t \t\ttime3 = stopTime - startTime;\r\n//\t \t\tround(time3,2);\r\n//\t \t\tdouble nodes3=round((double)objGrapB3.getCounterIDs(),2);\r\n//\t \t\tSystem.out.println(objGrapB3.bestSymmetryV+\" \"+time3+\" \"+((objGrapB3.getCounterIDs())));\r\n\t \t\tsum3=sum3+time3;\r\n\t \t}\r\n\t \ttime3=sum3/1;\r\n\t \ttime3=round(time3,2);\r\n\t //System.out.println(\"Time Brute-force search \"+elapsedTime);\r\n\t \t\r\n\t \r\n\t \r\n\t //3.7) B&B+heuristic\r\n\t //objElem.setFinalList(objElem.getFinalListNoOrder());\r\n\t \tfor(int i=0;i<1;i++)\r\n\t \t{\r\n\t \t\tstartTime = System.currentTimeMillis();\r\n\t \t\tBeststates7=objGrapB7.depthSearchBBHeuristic(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,0,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch,8,typeSymmetry);\r\n\t \t\tstopTime = System.currentTimeMillis();\r\n\t \t\ttime7 = stopTime - startTime;\r\n//\t \t\tround(time7,2);\r\n//\t \t\tdouble nodes7=round((double)objGrapB3.getCounterIDs(),2);\r\n//\t \t\tSystem.out.println(objGrapB6.bestSymmetryV+\" \"+time6+\" \"+((objGrapB6.getCounterIDs())));\r\n\t \t\tsum7=sum7+time7;\r\n\t \t}\r\n\t \ttime7=sum7/1;\r\n\t \ttime7=round(time7,2);\r\n\t //System.out.println(\"Time B&B+heuristic + region ordering \"+elapsedTime);\r\n\t \t\r\n\t \t\r\n\t \t\r\n//\t \tif(objGrapB3.bestSymmetryV<objGrapB5.bestSymmetryV)\r\n//\t \t{\r\n//\t \t\tdouble bestSYmmetry=objGrapB3.bestSymmetryV;\r\n//\t \t\t//System.out.println(\"bestSym \"+bestSYmmetry);\r\n//\t \t\tBestGlobalstates=Beststates3;\r\n//\t \t\t\r\n//\t \t}\r\n//\t \telse\r\n//\t \t{\r\n//\t \t\tdouble bestSYmmetry=objGrapB5.bestSymmetryV;\r\n//\t \t\t//System.out.println(\"bestSym \"+bestSYmmetry);\r\n//\t \t\tBestGlobalstates=Beststates5;\r\n//\t \t}\r\n\t \t\r\n\t \tBestGlobalstates=Beststates7;\r\n\t \r\n\t \r\n\t \t//**System.out.println(\"Simetry 0-> Brute-force search order \"+objGrapB3a.bestSymmetryV);\t\r\n\t \t//System.out.println(\"Simetry 1-> Brute-force search \"+objGrapB3.bestSymmetryV);\t \t\r\n\t \t//System.out.println(\"Simetry 2-> B&B+oldheuristic \"+objGrapB4.bestSymmetryV);\r\n\t \t//**System.out.println(\"Simetry 3-> B&B+heuristic + object ordering \"+objGrapB2.bestSymmetryV);\t \t\r\n\t \t//System.out.println(\"Simetry 4-> B&B+ region + leviheuristic\"+objGrapB5.bestSymmetryV);\r\n\t \t//**System.out.println(\"Simetry 5-> B&B+heuristic + region ordering + object ordering \"+objGrapB.bestSymmetryV);\r\n\t \t//System.out.println(\"Simetry 6-> B&B+heuristic + leviheuristic \"+objGrapB6.bestSymmetryV);\r\n\t \t//System.out.println(\"Simetry 7-> B&B+oldoldheuristic \"+objGrapB7.bestSymmetryV);\r\n\t \t\r\n\t \t//**System.out.println( \"States 0 \"+objGrapB3a.getCounterIDs() );\r\n\t \t//System.out.println( \"States 1 \"+objGrapB3.getCounterIDs() );\r\n\t \t//System.out.println( \"States 2 \"+objGrapB4.getCounterIDs() );\r\n\t \t//**System.out.println( \"States 3 \"+objGrapB2.getCounterIDs() );\t \t\t \t\r\n\t \t//System.out.println( \"States 4 \"+objGrapB5.getCounterIDs() );\r\n\t \t//**System.out.println( \"States 5 \"+objGrapB.getCounterIDs() );\r\n\t \t//System.out.println( \"States 6 \"+objGrapB6.getCounterIDs() );\r\n\t \t//System.out.println( \"States 7 \"+objGrapB7.getCounterIDs() );\r\n\t \t\r\n\t \tdouble TimeRate7=time3/time7;\r\n\t \tdouble TimeRate6=time3/time6;\r\n\t \tdouble TimeRate5=time3/time5;\r\n\t \t\r\n\t \tTimeRate7=round(TimeRate7,2);\r\n\t \tTimeRate6=round(TimeRate6,2);\r\n\t \tTimeRate5=round(TimeRate5,2);\r\n\t \t\r\n\t \tdouble NodesRate7=(double)objGrapB3.getCounterIDs()/(double)objGrapB7.getCounterIDs();\r\n\t \tdouble NodesRate6=(double)objGrapB3.getCounterIDs()/(double)objGrapB6.getCounterIDs();\r\n\t \tdouble NodesRate5=(double)objGrapB3.getCounterIDs()/(double)objGrapB5.getCounterIDs();\r\n\t \t\r\n\t \tNodesRate7=round(NodesRate7,2);\r\n\t \tNodesRate6=round(NodesRate6,2);\r\n\t \tNodesRate5=round(NodesRate5,2);\r\n\r\n\t \t\r\n\t \t\r\n\r\n\t //imprimiendo los estados visitados\r\n\t /*\r\n\t Iterator<BlockNode> nombreIterator = states.iterator();\r\n\t while(nombreIterator.hasNext()){\r\n\t \tBlockNode elemento = nombreIterator.next();\r\n\t \tSystem.out.print(elemento.getID()+\" / \");\r\n\t }*/\r\n\t \r\n\t //here we are painting as the best branch founded\r\n\t \r\n\t //System.out.println(\"nene \"+BestGlobalstates.size());\r\n\t Iterator<BlockNode> nombreIterator = BestGlobalstates.iterator();\r\n\t while(nombreIterator.hasNext()){\r\n\t \tBlockNode elemento = nombreIterator.next();\r\n\t \t//System.out.print(elemento.getID()+\"(\"+elemento.getX()+\" \"+elemento.getY()+\" ) - \"+elemento.getType()+\" \"+elemento.getIdElement()+ \" / \");\r\n\t }\r\n\t \r\n\t \r\n\t //Here we will put the elements on the tile\r\n\t try {\r\n\t Level levelScreen=PaintElements(BestGlobalstates,this);\r\n\t Screen objScreen=new Screen();\r\n\t\t\tobjScreen.SaveScreen(levelScreen,odds,objElem);\r\n \t\tInformacoesTelas info = new InformacoesTelas();\r\n\t CopiaArquivos copiador = new CopiaArquivos();\r\n\t \r\n\t info = info.carregaInfoTela(\"infoTela\");\r\n\t\t\tinfo.setOutrasVariaveis(0, 0); // Salva outras informacoes da Tela\r\n\t\t\tinfo.salvaInfoTela(\"infoTela\", info);\t\t\t\t\t\r\n\t\t\tcopiador.copy(\"\" + count, \"Screens/\");\r\n\t\t\t\r\n\t } catch (ClassNotFoundException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}", "private void runAlgorithm(){\n fitness = new ArrayList<Double>(); \n \n int iter = 0;\n \n // While temperature higher than absolute temperature\n this.temperature = getCurrentTemperature(0);\n while(this.temperature > this.p_absoluteTemperature && iter < 100000){\n //while(!stopCriterionMet()){\n // Select next state\n //for(int i=0;i<20;i++){\n int count = 0;\n boolean selected = false;\n while(!selected){\n Problem.ProblemState next = nextState();\n if(isStateSelected(next)){\n selected = true;\n this.state = next;\n }\n \n count++;\n if(count == 10) break;\n }\n //}\n \n // Sample data\n double fvalue = this.state.getFitnessValue();\n this.fitness.add(new Double(fvalue));\n \n iter = iter + 1;\n \n // Lower temperature\n this.temperature = getCurrentTemperature(iter);\n }\n \n this.n_iter = iter;\n return;\n }", "Strategy createStrategy();", "public void search() {\r\n\t\tfloat dist = getDistance(permutationPrev);\r\n\t\tfloat delta = 0;\r\n\t\tfloat prob = 0;\r\n\r\n\t\tboolean accept = false;\r\n\r\n\t\tRandom rand = new Random();\r\n\r\n\t\twhile ((temperature > minTemperature) || (nIter > 0)) {\r\n\t\t\tdisturbPermut(permutationPrev);\r\n\t\t\tdelta = getDistance(permutation) - dist;\r\n\r\n\t\t\tprob = (float) Math.exp(-delta / temperature);\r\n\t\t\taccept = ((delta < 0) || (delta * (prob - rand.nextFloat()) >= 0));\r\n\r\n\t\t\tif (accept) {\r\n\t\t\t\tacceptPermution(permutation);\r\n\t\t\t\tdist = delta + dist;\r\n\t\t\t}\r\n\r\n\t\t\ttemperature *= cBoltzman;\r\n\t\t\tnIter--;\r\n\r\n\t\t\ttrace.add(dist);\r\n\t\t}\r\n\t\tshortestDist = dist;\r\n\t}", "private static void normal(){\n ProblemKnapsackFromFile problem = new ProblemKnapsackFromFile(macPathGetProblemFrom);\n\n //NSGAII algorithm = new NSGAII();\n SPEA2 algorithm = new SPEA2();\n //SPEAHADKA algorithm = new SPEAHADKA();\n //AEMMT algorithm = new AEMMT();\n //AEMMD algorithm = new AEMMD();\n //MOEAD algorithm = new MOEAD();\n\n int x =1;\n int counter = 0;\n\n if (AEMMD.class.isInstance(algorithm) || AEMMT.class.isInstance(algorithm)){\n Parameters.NUMBER_OF_GENERATIONS = 15000;\n }\n else{\n Parameters.NUMBER_OF_GENERATIONS = problem.items.size() < 100? 100 : 200;\n }\n\n while (counter < x) {\n algorithm.runAlgorithm(problem);\n counter++;\n }\n }", "public static void main(String[] args) {\n String fileName = \"data1.txt\";\n \n \n //Load the data from the dataset file\n dataSet = getDataSet(fileName);\n \n //Setting up the output file\n String outputFileName = \"\";\n if (fileName.indexOf(\".\") > 0) {\n outputFileName = fileName.substring(0, fileName.lastIndexOf(\".\"));\n }\n \n createFile(outputFileName+\".csv\");\n \n //log the time the algorithm started\n long startTime = System.currentTimeMillis();\n \n //Placeholder of the fittest individual\n fittestIndividual = new Individual(GENE_SIZE, NUM_RULES, COND_LEN);\n fittestIndividual.generateRulebase(); \n \n //Setup the mating pool\n matingPool = setupArray(POP_SIZE, NUM_RULES, GENE_SIZE, COND_LEN);\n \n //used to run the GA multiple times without doing it manually\n //set to 1 because we want to run the GA once\n for (int a = 0; a < 1; a++) {\n currentBest = new Individual(GENE_SIZE, NUM_RULES, COND_LEN);\n currentBest.generateRulebase();\n\n //Generate a population\n generatePopulation();\n\n //Initial calculation of the fitness\n calculateFitness(population);\n\n for (int i = 0; i < GENERATION; i++) {\n average = 0; //reset the average\n currentBestArray[i] = currentBest.getFitness();\n \n tournamentSelect(population);\n\n //Calculate the fitness of the mating pool\n calculateFitness(matingPool);\n\n //Perfrom crossover on the mating pool\n crossover(matingPool);\n\n //Mutation\n mutation(matingPool);\n\n //Calculate the fitness of the mating pool\n calculateFitness(matingPool);\n\n //Evaluate the current population\n for (Individual individual : matingPool) {\n if (individual.getFitness() > currentBest.getFitness()) {\n currentBest = new Individual(individual);\n }\n average = average + individual.getFitness();\n }\n \n\n //Replace the population with the new generation\n for (int j = 0; j < POP_SIZE; j++) {\n population[j] = new Individual(matingPool[j]);\n }\n \n averageArray[i] = average / POP_SIZE;\n }\n \n //Check whether the current best is fitter than the global fittest individual\n if (currentBest.fitness > fittestIndividual.fitness) {\n fittestIndividual = new Individual(currentBest);\n //copy the fittest individuals performance\n fittestArray = Arrays.copyOf(currentBestArray, currentBestArray.length);\n }\n }\n\n System.out.println(\"Best fitness generated for the dataset: \" + fittestIndividual.fitness);\n \n //output the rules\n printRules(fittestIndividual.getRulebase());\n \n //Save the performance data into the output file\n for (int i = 0; i < fittestArray.length; i++) {\n addToFile(i, fittestArray[i], averageArray[i]);\n }\n \n //close the file\n close();\n \n //Evaluate the fitness agaisnt the dataset\n calculateFitness(fittestIndividual);\n double accuracyPercentage = ((double) 100 / dataSet.size()) * fittestIndividual.fitness;\n System.out.format(\"%.2f%% accuracy on the datase set.\\n\", accuracyPercentage);\n \n //Log the duration it took\n long duration = System.currentTimeMillis() - startTime;\n System.out.println(\"Completed in \" + String.format(\"%02d min, %02d.%02d sec\",\n TimeUnit.MILLISECONDS.toMinutes(duration),\n TimeUnit.MILLISECONDS.toSeconds(duration)\n - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(duration)),\n TimeUnit.MILLISECONDS.toMillis(duration) - TimeUnit.SECONDS.toMillis(TimeUnit.MILLISECONDS.toSeconds(duration))\n ));\n }", "public ColumnColorVarietyStrategyBuilder(){\n super();\n ObjectiveCardStrategy ccvs = new ColumnColorVarietyStrategy();\n this.setStrategy(ccvs);\n this.setToBeCompared(\"ColumnColorVarietyStrategy\");\n }", "private Criteria buildActiveCriteria(){\r\n Criteria criteria = new Criteria();\r\n criteria.addEqualTo(KRADPropertyConstants.ACTIVE, true);\r\n\r\n return criteria;\r\n }", "Long[] searchSolution(int timeLimit, Graph g);", "public interface IRealTimeSearchAlgorithm {\n\n /**\n * This function will calculate a prefix from the start node to the goal node path\n * @param start - The start node\n * @param goal - The goal node\n * @param numOfNodesToDevelop - The number of nodes to develop in the search\n * @param agent - The agent\n * @return - A prefix from the start node to the goal node path\n */\n public List<Node> calculatePrefix(Node start, Node goal, int numOfNodesToDevelop, Agent agent);\n}", "private static void automate() {\n \tLOG.info(\"Begin automation task.\");\n \t\n \tcurrentOpticsXi = clArgs.clusteringOpticsXi;\n \tdouble opticsXiMax = (clArgs.clusteringOpticsXiMaxValue > ELKIClusterer.MAX_OPTICS_XI ? ELKIClusterer.MAX_OPTICS_XI : clArgs.clusteringOpticsXiMaxValue);\n \tcurrentOpticsMinPoints = clArgs.clusteringOpticsMinPts;\n \tint opticsMinPointsMax = clArgs.clusteringOpticsMinPtsMaxValue;\n \t\n \tLOG.info(\"optics-xi-start: {}, optics-xi-min-points-start: {}, optics-xi-step-size: {}, optics-min-points-step-size: {}\",\n \t\t\tnew Object[] { \n \t\t\t\tdf.format(currentOpticsXi), df.format(currentOpticsMinPoints), \n \t\t\t\tdf.format(clArgs.clusteringOpticsXiStepSize), df.format(clArgs.clusteringOpticsMinPtsStepSize)\n \t\t\t});\n \t\n \twhile (currentOpticsXi <= opticsXiMax) {\n \t\twhile (currentOpticsMinPoints <= opticsMinPointsMax) {\n \t\t\t// Run automation for each combination of opticsXi and opticsMinPoints\n \t\t\tLOG.info(\"Run automation with optics-xi: {}, optics-xi-min-points: {}\", \n \t\t\t\t\tdf.format(currentOpticsXi), df.format(currentOpticsMinPoints));\n \t\t\t\n \t\t\ttry {\n\t \t\t\t// Step 1: Clustering\n\t \t\t\tclustering(clArgs.clusteringInFile, clArgs.clusteringOutDir, currentOpticsXi, currentOpticsMinPoints);\n\t \t\t\t\n\t \t\t\t// Step 2: Build shared framework\n\t \t\t\tbuildFramework();\n\t \t\t\t\n\t \t\t\t// Step 3: Build user hierarchical graphs\n\t \t\t\tbuildHierarchicalGraphs();\n\t \t\t\t\n\t \t\t\t// Step 4: Calculate similarity between all users and create evaluation results afterwards\n\t \t\t\tcalculateSimilarity();\n \t\t\t} catch (Exception e) {\n\t\t\t\t\tLOG.error(\"An error occurred during the automation task. Jumping to the next pass.\", e);\n\t\t\t\t} finally {\n\t \t\t\t// Step 5: Clean up for the next run\n\t \t\t\tcleanAutomationResults();\n\t \t\t\t\n\t \t\t\t// Increase the currentOpticsMinPoints for the next run if desired\n\t \t\t\tif (clArgs.clusteringOpticsMinPtsStepSize > 0)\n\t \t\t\t\tcurrentOpticsMinPoints += clArgs.clusteringOpticsMinPtsStepSize;\n\t \t\t\telse\n\t \t\t\t\tbreak;\n\t\t\t\t}\n \t\t}\n \t\t// Reset current values\n \t\tcurrentOpticsMinPoints = clArgs.clusteringOpticsMinPts;\n \t\t\n \t\t// Increase currentOpticsXi for the next run if desired\n \t\tif (clArgs.clusteringOpticsXiStepSize > 0)\n\t\t\t\tcurrentOpticsXi += clArgs.clusteringOpticsXiStepSize;\n\t\t\telse\n\t\t\t\tbreak;\n \t}\n \t\n \tLOG.info(\"End automation task.\");\n }", "public Algo2(Game game) {\n my_game = game;\n robots_paths = new Hashtable<>();\n fruits_status=new Hashtable<>();\n algo_g = new Graph_Algo(my_game.getGraph());\n initRobotPath();\n }", "public interface SearchSolver {\n\n /**\n * initializes the algorithm. This method has to be called before calling any other method\n * @param graph the graph of the map where the search takes place\n * @param targetStart the start position for the target (in our case the thief)\n * @param searchStart the start position for the searcher (in our case the police)\n * @param counter the counter object that counts the expanded nodes\n */\n void initialize(Graph graph, Node targetStart, Node searchStart, ExpandCounter counter);\n\n /**\n * gets the shortest path from search start to target\n * @return list of edges that describe the path\n * @throws NoPathFoundException if there is no path to the target\n */\n List<Edge> getPath() throws NoPathFoundException;\n}", "public static void main(String[] args) throws IOException {\n\n SimpleDateFormat ft = new SimpleDateFormat(\"hh:mm:ss\");\n System.out.println(\"Started at \" + ft.format(new Date()));\n\n // Folder containing android apps to analyze\n final PluginId pluginId = PluginId.getId(\"idaDoctor\");\n final IdeaPluginDescriptor pluginDescriptor = PluginManager.getPlugin(pluginId);\n File experimentDirectory = new File(root_project.getBasePath());\n fileName = new File(pluginDescriptor.getPath().getAbsolutePath()+\"/resources/results.csv\");\n String smellsNeeded = args[0];\n\n FILE_HEADER = new String[StringUtils.countMatches(smellsNeeded, \"1\") + 1];\n\n DataTransmissionWithoutCompressionRule dataTransmissionWithoutCompressionRule = new DataTransmissionWithoutCompressionRule();\n DebuggableReleaseRule debbugableReleaseRule = new DebuggableReleaseRule();\n DurableWakeLockRule durableWakeLockRule = new DurableWakeLockRule();\n InefficientDataFormatAndParserRule inefficientDataFormatAndParserRule = new InefficientDataFormatAndParserRule();\n InefficientDataStructureRule inefficientDataStructureRule = new InefficientDataStructureRule();\n InefficientSQLQueryRule inefficientSQLQueryRule = new InefficientSQLQueryRule();\n InternalGetterSetterRule internaleGetterSetterRule = new InternalGetterSetterRule();\n LeakingInnerClassRule leakingInnerClassRule = new LeakingInnerClassRule();\n LeakingThreadRule leakingThreadRule = new LeakingThreadRule();\n MemberIgnoringMethodRule memberIgnoringMethodRule = new MemberIgnoringMethodRule();\n NoLowMemoryResolverRule noLowMemoryResolverRule = new NoLowMemoryResolverRule();\n PublicDataRule publicDataRule = new PublicDataRule();\n RigidAlarmManagerRule rigidAlarmManagerRule = new RigidAlarmManagerRule();\n SlowLoopRule slowLoopRule = new SlowLoopRule();\n UnclosedCloseableRule unclosedCloseableRule = new UnclosedCloseableRule();\n\n String[] smellsType = {\"DTWC\", \"DR\", \"DW\", \"IDFP\", \"IDS\", \"ISQLQ\", \"IGS\", \"LIC\", \"LT\", \"MIM\", \"NLMR\", \"PD\", \"RAM\", \"SL\", \"UC\"};\n\n FILE_HEADER[0] = \"Class\";\n\n int headerCounter = 1;\n\n for (int i = 0; i < smellsNeeded.length(); i++) {\n if (smellsNeeded.charAt(i) == '1') {\n FILE_HEADER[headerCounter] = smellsType[i];\n headerCounter++;\n }\n }\n\n CSVFormat csvFileFormat = CSVFormat.DEFAULT.withRecordSeparator(NEW_LINE_SEPARATOR);\n FileWriter fileWriter = new FileWriter(fileName);\n try (CSVPrinter csvFilePrinter = new CSVPrinter(fileWriter, csvFileFormat)) {\n csvFilePrinter.printRecord((Object[]) FILE_HEADER);\n\n for (File project : experimentDirectory.listFiles()) {\n\n if (!project.isHidden()) {\n\n // Method to convert a directory into a set of java packages.\n ArrayList<PackageBean> packages = FolderToJavaProjectConverter.convert(project.getAbsolutePath());\n\n for (PackageBean packageBean : packages) {\n\n for (ClassBean classBean : packageBean.getClasses()) {\n\n List record = new ArrayList();\n\n System.out.println(\"-- Analyzing class: \" + classBean.getBelongingPackage() + \".\" + classBean.getName());\n\n record.add(classBean.getBelongingPackage() + \".\" + classBean.getName());\n\n if (smellsNeeded.charAt(0) == '1') {\n if (dataTransmissionWithoutCompressionRule.isDataTransmissionWithoutCompression(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(1) == '1') {\n if (debbugableReleaseRule.isDebuggableRelease(RunAndroidSmellDetection.getAndroidManifest(project))) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(2) == '1') {\n if (durableWakeLockRule.isDurableWakeLock(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(3) == '1') {\n if (inefficientDataFormatAndParserRule.isInefficientDataFormatAndParser(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(4) == '1') {\n if (inefficientDataStructureRule.isInefficientDataStructure(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(5) == '1') {\n if (inefficientSQLQueryRule.isInefficientSQLQuery(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(6) == '1') {\n if (internaleGetterSetterRule.isInternalGetterSetter(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(7) == '1') {\n if (leakingInnerClassRule.isLeakingInnerClass(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(8) == '1') {\n if (leakingThreadRule.isLeakingThread(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(9) == '1') {\n if (memberIgnoringMethodRule.isMemberIgnoringMethod(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(10) == '1') {\n if (noLowMemoryResolverRule.isNoLowMemoryResolver(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(11) == '1') {\n if (publicDataRule.isPublicData(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(12) == '1') {\n if (rigidAlarmManagerRule.isRigidAlarmManager(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(13) == '1') {\n if (slowLoopRule.isSlowLoop(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(14) == '1') {\n if (unclosedCloseableRule.isUnclosedCloseable(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n csvFilePrinter.printRecord(record);\n }\n }\n }\n }\n }\n System.out.println(\"CSV file was created successfully!\");\n System.out.println(\"Finished at \" + ft.format(new Date()));\n }", "public Decision bestFor(Context context);", "void searchProbed (Search search);", "private void startFilterCriteria() {\n\n\t\tLog.i(TAG, \"startFilterCriteria()\");\n\n\t\tFindUtilsImpl utils = new FindUtilsImpl();\n\t\tSet<String> tSet = utils.getTypeSet((ArrayList<BELEvent>) eventsListFind);\n\t\tArrayList<String> tList = new ArrayList<String>(cleanSet(tSet));\n\n\t\tString str = \"start FilterCriteria.class\";\n\t\tLog.i(TAG, \"Search Activity: \" +str);\n\n\t\t\tIntent intent = new Intent(context, FilterCriteria.class);\n\t\t\tintent.putStringArrayListExtra(\"TypesKey\", tList);\n\t\t\t//TODO capture activity not found exception\n\t\t\t//\t((Activity) context).startActivityForResult(intent,Constants.FIND_REQ);\n\t\t\tstartActivityForResult(intent,Constants.FIND_REQ);\n\n\t\t\tstr = \"startActivity(intent,Constants.FIND_REQ)\";\n\t\t\t//\tstr = \"startActivityForResult(intent,Constants.FIND_REQ)\";\n\t\t\tLog.e(\"Search Dlg: \", str);\n\t\t}", "public BagOfPatterns() {\r\n\t\tthis.PAA_intervalsPerWindow = -1;\r\n\t\tthis.SAX_alphabetSize = -1;\r\n\t\tthis.windowSize = -1;\r\n\r\n\t\t\r\n\t\tknn = new kNN(); // defaults to 1NN, Euclidean distance\r\n\t\tuseParamSearch = true;\r\n\t}", "public void runOptimizations() {\n\t\tOptInfo info = new OptInfo();\n\t\tfor (int i = 0; i < mainOpts.size(); i++) {\n\t\t\t//Extract the operator in the vector and convert it into a\n\t\t\t//SearchStrategy type. The object that is loaded into the\n\t\t\t//SearchStrategy type is not SearchStrategy as it is an\n\t\t\t//abstract class but a class that inherits off of\n\t\t\t//SearchStrategy such as FirstBestIntraOpt, FirstBestInterOpt\n\t\t\t//and so on. the opt.run method runs the run method\n\t\t\t//from the inheriting class such as FirstBestIntraOpt.\n\t\t\tSearchStrategy opt = (SearchStrategy) mainOpts.elementAt(i);\n\t\t\tSettings.printDebug(Settings.COMMENT, \"Running \" + opt);\n\n\t\t\t//The opt.run method called is dependent on the object that\n\t\t\t//was created in the mainOpts. If the object was BestBestIntraSearch\n\t\t\t//then the run method in BestBestIntraSearch is called.\n\t\t\toptInformation.add(opt.toString() + \" \" + opt.run(mainDepots));\n\t\t\tSettings.printDebug(Settings.COMMENT,\n\t\t\t\t\topt.toString() + \" Stats: \" +\n\t\t\t\t\t\t\tmainDepots.getSolutionString());\n\t\t}\n\t}", "public static void init(){\t\t\n\t\tParameters p = RunEnvironment.getInstance().getParameters();\n\n\t\tSIM_RANDOM_SEED = (Integer)p.getValue(\"randomSeed\");\n\t\tSIM_NUM_AGENTS = (Integer)p.getValue(\"maxAgents\");\n\t\tSIM_NORM_VIOLATION_RATE = (Float) p.getValue(\"Norm Violation Rate\");\n\t\tNUM_TICKS_TO_CONVERGE = (Long)p.getValue(\"NumTicksToConverge\");\n\t\tCONTENTS_QUEUE_SIZE = (Long)p.getValue(\"ContentsQueueSize\");\n\t\t\n\t\tNORM_GEN_EFF_THRESHOLD = (Double)p.getValue(\"NormsGenEffThreshold\");\n\t\tNORM_GEN_NEC_THRESHOLD = (Double)p.getValue(\"NormsGenNecThreshold\");\n\t\tNORM_SPEC_EFF_THRESHOLD = (Double)p.getValue(\"NormsSpecEffThreshold\");\n\t\tNORM_SPEC_NEC_THRESHOLD = (Double)p.getValue(\"NormsSpecNecThreshold\");\n\t\tNORM_UTILITY_WINDOW_SIZE = (Integer)p.getValue(\"NormsPerfRangeSize\");\n\t\tNORM_DEFAULT_UTILITY = (Double)p.getValue(\"NormsDefaultUtility\");\n\n\t\tNORM_SYNTHESIS_STRATEGY = (Integer)p.getValue(\"NormSynthesisStrategy\");\n\t\tNORM_GENERATION_REACTIVE = (Boolean)p.getValue(\"NormGenerationReactive\");\n\t\tNORM_GENERALISATION_MODE = (Integer)p.getValue(\"NormGeneralisationMode\");\n\t\tNORM_GENERALISATION_STEP = (Integer)p.getValue(\"NormGeneralisationStep\");\n\t\tNORM_SPEC_THRESHOLD_EPSILON = (Double)p.getValue(\"NormsSpecThresholdEpsilon\");\n\t\tNORMS_MIN_EVALS_CLASSIFY = (Integer)p.getValue(\"NormsMinEvaluationsToClassify\");\n\t\tNORMS_WITH_USER_ID = (Boolean)p.getValue(\"NormsWithUserId\");\n\n\t\t\n\t\t\n\t\t// System goals and their constants\n\t\tsystemGoals = new ArrayList<Goal>();\n\t\tsystemGoals.add(new GComplaints());\n\n\t\t//\t\tdouble tMinusEpsilon = NORM_SPEC_NEC_THRESHOLD - NORM_SPEC_THRESHOLD_EPSILON;\n\t\t//\t\t\n\t\t//\t\t/* For SIMON+ and LION, set default utility in a different manner... */\n\t\t//\t\tif(NORM_SYNTHESIS_STRATEGY == 3 || NORM_SYNTHESIS_STRATEGY == 4) {\n\t\t//\t\t\tNORM_DEFAULT_UTILITY = (float)(tMinusEpsilon * (NORM_MIN_EVALS+1)); \n\t\t//\t\t}\n\n\t\t/* For SIMON+ and LION, set default utility in a different manner... */\n\t\tif((NORM_SYNTHESIS_STRATEGY == 3 || NORM_SYNTHESIS_STRATEGY == 4) &&\n\t\t\t\t!NORM_GENERATION_REACTIVE) \n\t\t{\n\t\t\tNORM_DEFAULT_UTILITY = 0f; \n\t\t\tSystem.out.println(\"Norm generation is set as Deliberative\");\n\t\t}\n\t}", "@Override\n\tpublic void makeDecision() {\n\t\tDouble weightedFrontProximity;\n\t\tif (algorithmData.receiveMessageData != null && algorithmData.previousDistance != null) {\n\t\t\tdouble delay = (Time.getTime() - algorithmData.receiveMessageData.getStartTime()) / 100000000;\n\t\t\t//calculate the distance us and our predecessor have travelled since message received\n\t\t\talgorithmData.predictedPredecessorMovement = algorithmData.predecessorSpeed * delay\n\t\t\t\t\t+ 0.5 * algorithmData.predecessorAcceleration * delay * delay;\n\t\t\talgorithmData.predictedMovement = algorithmData.previousSpeed * delay\n\t\t\t\t\t+ 0.5 * algorithmData.previousAcceleration * delay * delay;\n\t\t\talgorithmData.predictedFrontProximity = algorithmData.predictedPredecessorMovement\n\t\t\t\t\t- algorithmData.predictedMovement + algorithmData.previousDistance;\n\n\t\t\talgorithmData.chosenSpeed = algorithmData.predecessorChosenSpeed;\n\t\t\talgorithmData.chosenTurnRate = algorithmData.predecessorTurnRate;\n\t\t} else {\n\t\t\t//no message received or no previous distance\n\t\t\talgorithmData.predictedFrontProximity = null;\n\t\t\talgorithmData.chosenSpeed = algorithmData.speed;\n\t\t\talgorithmData.chosenTurnRate = algorithmData.turnRate;\n\t\t}\n\t\tif (algorithmData.frontProximity != null && algorithmData.frontProximity > maxSensorDist) {\n\t\t\talgorithmData.frontProximity = null;\n\t\t}\n\t\tweightedFrontProximity = weightFrontProximity(algorithmData.predictedFrontProximity,\n\t\t\t\talgorithmData.frontProximity);\n\n\t\t// update previous state variables so that they are correct in next time period\n\t\talgorithmData.previousDistance = weightedFrontProximity;\n\t\talgorithmData.previousSpeed = algorithmData.speed;\n\t\talgorithmData.previousAcceleration = algorithmData.acceleration;\n\n\t\tif (weightedFrontProximity != null) {\n\t\t\tif (weightedFrontProximity < buffDist) {\n\t\t\t\tif (algorithmData.chosenAcceleration >= 0) {\n\t\t\t\t\talgorithmData.chosenAcceleration = algorithmData.chosenAcceleration * weightedFrontProximity / buffDist;\n\t\t\t\t} else {\n\t\t\t\t\t// if braking then divide by value so deceleration decreases if gap too small\n\t\t\t\t\talgorithmData.chosenAcceleration = algorithmData.chosenAcceleration / (weightedFrontProximity / buffDist);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (algorithmData.chosenAcceleration >= 0) {\n\t\t\t\t\talgorithmData.chosenAcceleration = algorithmData.chosenAcceleration\n\t\t\t\t\t\t\t* (0.75 + weightedFrontProximity / (4* buffDist));\n\t\t\t\t} else {\n\t\t\t\t\t// if braking then divide by value so deceleration decreases if gap too small\n\t\t\t\t\talgorithmData.chosenAcceleration = algorithmData.chosenAcceleration\n\t\t\t\t\t\t\t/ (0.75 + weightedFrontProximity / (4* buffDist));\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t//no messages received and proximity sensor not working\n\t\t\talgorithmData.chosenAcceleration = 0;\n\t\t}\n\n\n\t}", "GoalSpecification createGoalSpecification();", "public TTPSolution SH2() {\n \n // get TTP data\n long[][] D = ttp.getDist();\n int[] A = ttp.getAvailability();\n double maxSpeed = ttp.getMaxSpeed();\n double minSpeed = ttp.getMinSpeed();\n long capacity = ttp.getCapacity();\n double C = (maxSpeed - minSpeed) / capacity;\n double R = ttp.getRent();\n int m = ttp.getNbCities(),\n n = ttp.getNbItems();\n TTPSolution s = new TTPSolution(m, n);\n int[] x = s.getTour(),\n z = s.getPickingPlan();\n \n /*\n * the tour\n * generated using greedy algorithm\n */\n x = linkernTour();\n z = zerosPickingPlan();\n Deb.echo(x);\n Deb.echo(z);\n \n /*\n * the picking plan\n * generated so that the TTP objective value is maximized\n */\n ttp.objective(s);\n \n // partial distance from city x_i\n long di;\n \n // partial time with item k collected from city x_i\n double tik;\n \n // item scores\n Double[] score = new Double[n];\n \n // total time with no items collected\n double t_ = s.ft;\n \n // total time with only item k collected\n double tik_;\n \n // fitness value\n double u[] = new double[n];\n \n for (int k=0; k<n; k++) {\n \n int i;\n for (i=0; i<m; i++) {\n if (A[k]==x[i]) break;\n }\n //P.echo2(\"[\"+k+\"]\"+(i+1)+\"~\");\n \n // time to start with\n tik = i==0 ? .0 : s.timeAcc[i-1];\n int iw = ttp.weightOf(k),\n ip = ttp.profitOf(k);\n \n // recalculate velocities from start\n di = 0;\n for (int r=i; r<m; r++) {\n \n int c1 = x[r]-1;\n int c2 = x[(r+1)%m]-1;\n \n di += D[c1][c2];\n tik += D[c1][c2] / (maxSpeed-iw*C);\n }\n \n score[k] = ip - R*tik;\n tik_ = t_ - di + tik;\n u[k] = R*t_ + ttp.profitOf(k) - R*tik_;\n //P.echo(k+\" : \"+u[k]);\n }\n \n Quicksort<Double> qs = new Quicksort<Double>(score);\n qs.sort();\n int[] si = qs.getIndices();\n int wc = 0;\n for (int k=0; k<n; k++) {\n int i = si[k];\n int wi = ttp.weightOf(i);\n // eliminate useless\n if (wi+wc <= capacity && u[i] > 0) {\n z[i] = A[i];\n wc += wi;\n }\n }\n \n ttp.objective(s);\n \n return s;\n }", "@Override\n protected void doAlgorithmA1() {\n int xP = 0;\n int yP = 0;\n\n\n //Taking the variable out of the list that are in the bounds\n //Testing that the bound has variables\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n xP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX().getPosition();\n }\n int xU = 0;\n int xL = 0;\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n yP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY().getPosition();\n }\n int yU = 0;\n int yL = 0;\n int cright = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCright();\n int cleft = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCleft();\n\n\n\n for (Variable variable : csp.getVars()) {\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n if (variable.getPosition() == xP) {\n xU = variable.getUpperDomainBound();\n xL = variable.getLowerDomainBound();\n }\n }\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n if (variable.getPosition() == yP) {\n yU = variable.getUpperDomainBound();\n yL = variable.getLowerDomainBound();\n }\n }\n }\n\n boolean first = false;\n boolean second = false;\n\n //Testing if the bound is true, false or inconclusive\n\n if (xL + cleft >= yU + cright) {\n first = true;\n }\n if (xU + cleft < yL + cright) {\n second = true;\n }\n\n //are first and second not equal is the bound not inconclusive\n if (first != second) {\n if (first) { //a true Simple Bound was found\n //checks if it was the last constraint in a csp\n //If so the csp is true\n //else check the next constraint and do this method again\n if (csp.getSimpleConstraints().size() - 1 == cIndex) {\n System.out.println(\"P is satisfiable\");\n System.out.println(System.nanoTime()-startTime);\n return;\n } else {\n bIndex = 0;\n cIndex++;\n unit=false;\n doAlgorithmA1();\n }\n } else if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) { //a false Simple Bound was found\n //\n bIndex = 0;\n cIndex = 0;\n if (isInconclusive) {\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n doAlgorithmA2();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n } else {//an inconclusive Simple Bound was found\n //checks if the bound wasn't already inconclusive\n if(!isInconclusive){\n unit=true;\n unitSB = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex);\n }else {\n unit=false;\n }\n isInconclusive = true;\n\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) {\n cIndex = 0;\n bIndex = 0;\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n }\n }", "public static void main(String[] args) throws Exception {\n ExecutionEnvironment env = ExecutionEnvironment.createLocalEnvironment();\n env.getConfig().disableSysoutLogging();\n env.setParallelism(4);\n\n /********** DATA LOADING ***************/\n //Load the data set\n DataFlink<DataInstance> data = DataFlinkLoader.open(env,\"./datasets/BigSensorReadings.arff\");\n\n int nRooms = 10;\n\n /********** Model Definition ************/\n DAG fireDetectorModel = creatBigFireDectectorModel(data.getAttributes(),nRooms);\n\n /********** Model Learning ************/\n //Define the learning engine (distributed Variational Message Passing) and the parameters\n dVMP svb = new dVMP();\n svb.setBatchSize(1000);\n svb.setOutput(true);\n svb.setDAG(fireDetectorModel);\n\n //Specify the associated constraints (encoding prior knowledge)\n for (int i = 0; i < nRooms; i++) {\n Variable sensorT1 = fireDetectorModel.getVariables().getVariableByName(\"SensorTemp1_\"+i);\n Variable sensorT2 = fireDetectorModel.getVariables().getVariableByName(\"SensorTemp2_\"+i);\n svb.addParameterConstraint(new Constraint(\"alpha\", sensorT1, 0.0));\n svb.addParameterConstraint(new Constraint(\"alpha\", sensorT2, 0.0));\n svb.addParameterConstraint(new Constraint(\"beta1\", sensorT1, 1.0));\n svb.addParameterConstraint(new Constraint(\"beta1\", sensorT2, 1.0));\n\n Variable temp = fireDetectorModel.getVariables().getVariableByName(\"Temperature_\"+i);\n svb.addParameterConstraint(new Constraint(\"alpha | {Fire_\"+i+\" = 0}\", temp, 0.0));\n svb.addParameterConstraint(new Constraint(\"beta1 | {Fire_\"+i+\" = 0}\", temp, 1.0));\n\n }\n\n //Set-up the learning phase\n svb.initLearning();\n\n //Perform Learning\n Stopwatch watch = Stopwatch.createStarted();\n svb.updateModel(data);\n System.out.println(watch.stop());\n\n\n //Print the learnt model\n System.out.println(svb.getLearntBayesianNetwork());\n\n }", "public ServiceMatchNetwork<E, T> searchComposition(Signature<E> request){\n ServiceMatchNetwork<E, T> network = discoverer.search(request);\n // Apply optimizations\n for(NetworkOptimizer<E,T> opt : optimizations){\n network = opt.optimize(network);\n }\n Algorithms.Search<State<E>,HeuristicNode<State<E>,Double>>.Result searchResult = CompositSearch.create(network).search();\n // Take the service operations from the optimal state path. We reverse the list because\n // the search was done backwards.\n List<State<E>> states = Lists.reverse(searchResult.getOptimalPath());\n List<Set<Operation<E>>> optimalServiceOps = Lists.transform(states, new Function<State<E>, Set<Operation<E>>>() {\n @Override\n public Set<Operation<E>> apply(State<E> state) {\n return state.getStateOperations();\n }\n });\n // Generate a new ServiceMatchNetwork composition with the optimal services.\n // To build the composition, we use the information of the previous network to build the match relations\n // between services among the optimal services.\n ServiceMatchNetwork<E, T> composition = new DirectedAcyclicSMN<E, T>(new HashLeveledServices<E>(optimalServiceOps), network);\n return composition;\n }", "CampusSearchQuery generateQuery();", "public Optimizer getOptimizedCriteria() {\r\n\r\n\t\tLog.d(\"Criteria\", \"Inside getOC:\" + isIntelligenceOverridden);\r\n\r\n\t\tif (!isIntelligenceOverridden) {\r\n\r\n\t\t\t/* BATTERY LEVEL - \"HIGH\" */\r\n\t\t\tif (batteryLevel > Constants.BATTERY_LEVEL.HIGH) {\r\n\t\t\t\tLog.d(\"Test\", \"Entered High\");\r\n\t\t\t\toptimizer.setFrequency(Constants.FREQUENCY_LEVEL.HIGH);\r\n\t\t\t\toptimizer.setPriority(Constants.PRIORITY_LEVEL.HIGH);\r\n\t\t\t}\r\n\r\n\t\t\t/* BATTERY LEVEL - \"MEDIUM\" */\r\n\t\t\telse if (batteryLevel > Constants.BATTERY_LEVEL.MEDIUM\r\n\t\t\t\t\t&& batteryLevel <= Constants.BATTERY_LEVEL.HIGH) {\r\n\t\t\t\tLog.d(\"Criteria\", \"Entered Medium\");\r\n\t\t\t\toptimizer.setFrequency(Constants.FREQUENCY_LEVEL.MEDIUM);\r\n\t\t\t\toptimizer.setPriority(Constants.PRIORITY_LEVEL.MEDIUM);\r\n\t\t\t}\r\n\r\n\t\t\t/* BATTERY LEVEL - \"LOW\" */\r\n\t\t\telse if (batteryLevel <= Constants.BATTERY_LEVEL.MEDIUM) {\r\n\t\t\t\tLog.d(\"Criteria\", \"Checking Moderate Mode\");\r\n\t\t\t\tmModerateMode();\r\n\t\t\t}\r\n\t\t\tLog.d(\"Criteria\", \"Returning Op obj\");\r\n\t\t\treturn optimizer;\r\n\t\t}\r\n\r\n\t\tLog.d(\"Criteria\", \"Then continuing\");\r\n\t\tswitch (userScheme) {\r\n\t\tcase \"moderate\":\r\n\t\t\tLog.d(\"Test\", \"Entered Moderate\");\r\n\t\t\tmModerateMode();\r\n\t\t\tbreak;\r\n\t\tcase \"lazy\":\r\n\t\t\tLog.d(\"Test\", \"Lazy\");\r\n\t\t\tmLazyMode();\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tmModerateMode();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn optimizer;\r\n\t}", "void activateFlowStorer();", "public static void main(String[] args) \t{\n\n\t\tif (args.length!=7){\n\t\t\tSystem.out.println(\"\\nUsage: java SortGreedy_BLikeness inFile n SA beta part_size part_option q\");\n\t\t\tSystem.out.println(\"\\t inFile: input file name (path included).\");\n\t\t\tSystem.out.println(\"\\t n: number of tuples in inFile.\");\n\t\t\t//System.out.println(\"\\t d: dimensionality of the dataset.\");\n\t\t\tSystem.out.println(\"\\t SA: index of sensitive attribute [0 -- d-1].\");\n\t\t\tSystem.out.println(\"\\t l: beta: B-likeness parameter.\");\n\t\t\tSystem.out.println(\"\\t part_size: size of the bucket partitions.\");\n\t\t\tSystem.out.println(\"\\t part_option: 0 (safer, keeps all SAs distributions), or\");\n\t\t\tSystem.out.println(\"\\t 1 (better utility, but may cause problems), or \");\n\t\t\tSystem.out.println(\"\\t 2 (no bucket partitioning).\\n\");\n\t\t\tSystem.out.println(\"\\t q: 1 with queries, 0 without\\n\");\n\t\t\t//\t\t\tSystem.out.println(\"\\t th: distance threshold to place chunk in bucket, in [0, 1].\");\n\t\t\treturn;\n\t\t}\n\n\t\tString inputFile = args[0];\n\t\ttuples = Integer.parseInt(args[1]); // n\n\t\t//dims = Integer.parseInt(args[2]); //d\n\t\tSA = Integer.parseInt(args[2]); //Sensitive Attribute (0 - 7).\n\t\tb_param = Double.parseDouble(args[3]); // beta\n\t\tpartition_size = Integer.parseInt(args[4]);\n\t\tpartition_function = Integer.parseInt(args[5]);\n\t\tq = Boolean.parseBoolean(args[6]);\n\t\t//\t\tthreshold = Double.parseDouble(args[7]);\n\t\torigTuples = tuples;\n\n\t\t/*\n\t\tint modl = (tuples % l_param);\n\t\tif (modl > 0){\n\t\t\t//change n (#tuples), so that it is divided by l:\n\t\t\ttuples = tuples + (l_param - modl);\n\t\t\tfor (int i=0; i<dims-1; i++)\n\t\t\t\tcardinalities[1]++;\n\t\t}\n\t\tmap = new short[tuples][dims];\n\t\tbuckets = new short[l_param][tuples/l_param][dims];\n\t\t */\n\t\tmap = new short[tuples][dims];\n\t\tMinMaxPerAttribute = new int[dims][2];\n\n\t\tlong startTime = System.currentTimeMillis();\n\t\ttry {\n\t\t\tCensusParser tp = new CensusParser(inputFile, dims);\n\t\t\tint i=0;\n\t\t\twhile (tp.hasNext()){\n\t\t\t\tmap[i++]=tp.nextTuple2();\n\t\t\t\tfor (int j=0; j<dims; j++){\n\t\t\t\t\tif (map[i-1][j] < MinMaxPerAttribute[j][0]){ //min\n\t\t\t\t\t\tMinMaxPerAttribute[j][0] = map[i-1][j];\n\t\t\t\t\t}\n\t\t\t\t\tif (map[i-1][j] > MinMaxPerAttribute[j][1]){ //max\n\t\t\t\t\t\tMinMaxPerAttribute[j][1] = map[i-1][j];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t/*\n\t\tif (modl > 0){\n\t\t\t//add dummy tuples:\n\t\t\tfor(int i=(tuples-(l_param-modl)); i<tuples; i++){\n\t\t\t\tfor(int j=0; j<dims; j++){\n\t\t\t\t\tif (j == dims-1){\n\t\t\t\t\t\tmap[i][j] = -1; //unique SA\n\t\t\t\t\t}else{\n\t\t\t\t\t\tmap[i][j] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t */\n\t\tlong midTime = System.currentTimeMillis();\n\t\tdimension_sort();//sort the dimensions\n\t\tLikenessBuckets bk = new LikenessBuckets(b_param, tuples, dims, map, buckets, 0, inputFile);\n\t\tbuckets = bk.bucketization(SA);\n\t\t//bk.printBuckets();\n\n\t\tlong bucketEndTime = System.currentTimeMillis();\n\t\tSystem.out.println(\"Time of reading dataset: \"+(midTime - startTime)+\" miliseconds.\");\n\t\tSystem.out.println(\"Time of creating buckets: \"+(bucketEndTime - midTime)+\" miliseconds.\");\n\t\t//bk.printBuckets();\n\n\t\tmap=null; //delete map\n\t\tSystem.gc();\n\n\n\t\tbucket_size = bk.bucketSize;//bucket capacity (c).\n\t\tbuckNum = bk.buckNum; //number of buckets (|B|).\n\t\tSystem.out.println(\"Number of buckets:\"+buckNum);\n\t\t//update \"tuples\" number, taking into account the dummies:\n\t\ttuples = (bucket_size * buckNum);\n\n\t\tfinal_assignment = new int[tuples][buckNum];\n\n\t\tdouble distortion = 0.0;\n\t\tint chunk_size;\n\n\t\t/*\n\t\t * Sort groups of same-SA tuples in each bucket, wrt QIDs.\n\t\t * Then form bucket partitions, keeping SA distributions.\n\t\t */\n\t\tif (partition_function == 0)\n\t\t\tbucket_partition(bucket_size, bk); //keep all SAs distrubutions.\n\t\telse if (partition_function == 1){\n\t\t\tbucket_partition2(bucket_size, bk); //only keep 1st SA distribution.\n\t\t} //else NO_PARTITION //default.\n\t\tSystem.gc();\n\t\t//bk.printBuckets();\n\n\t\tif((partition_function == 0) || (partition_function == 1)){ //partitioned buckets:\n\n\t\t\tfor (int bucket_index=0; bucket_index<buckNum; bucket_index++){\n\n\t\t\t\tint chunk_offset = 0;\n\t\t\t\tfor (int chunk_index=0; chunk_index<chunk_sizes.size(); chunk_index++){\n\t\t\t\t\tchunk_size = chunk_sizes.get(chunk_index);\n\n\t\t\t\t\t//edges = new HeapNode[chunk_size*chunk_size*2];\n\t\t\t\t\tedges = new HeapNode[chunk_size*chunk_size];\n\n\t\t\t\t\t//we need SA, too!\n\t\t\t\t\tif (MIXED){\n\t\t\t\t\t\tMinMaxPerAssign = new int[chunk_size][dims-1][2];\n\t\t\t\t\t\tdistinctValuesPerAssign = (LinkedList<Integer>[][]) new LinkedList[chunk_size][dims];\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif (RANGE){\n\t\t\t\t\t\t\tMinMaxPerAssign = new int[chunk_size][dims-1][2];\n\t\t\t\t\t\t\tdistinctValues1 = (LinkedList<Integer>[]) new LinkedList[chunk_size];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tdistinctValuesPerAssign = (LinkedList<Integer>[][]) new LinkedList[chunk_size][dims];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//HeapComparator hc = new HeapComparator();\n\t\t\t\t\tdouble[][] array = computeCostMatrix(buckets[bucket_index],buckets[(bucket_index+1)%buckNum], bucket_index*bucket_size, chunk_offset, chunk_size);\n\t\t\t\t\tint[] assignment = new int[array.length];\n\t\t\t\t\tint times = 0;\n\n\t\t\t\t\twhile (++times<buckNum){\n\t\t\t\t\t\t//qSort(0, chunk_size*chunk_size-1);\n\t\t\t\t\t\tqSort(0, edge_size-1);\n\t\t\t\t\t\tgreedyAssign(array, assignment, chunk_size);//Call SortGreedy algorithm.\n\n\t\t\t\t\t\tfor (int i=0; i<assignment.length; i++){\n\t\t\t\t\t\t\tfinal_assignment[i+chunk_offset+bucket_index*bucket_size][times] = bucketToIndexMapping((bucket_index+times)%buckNum,(chunk_offset+assignment[i]));\n\t\t\t\t\t\t\tif (MIXED){\n\t\t\t\t\t\t\t\tfindSet_mixed(i, buckets[(bucket_index+times)%buckNum][chunk_offset+assignment[i]] );\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tif (RANGE)\n\t\t\t\t\t\t\t\t\tfindSet_numerical(i, buckets[(bucket_index+times)%buckNum][chunk_offset+assignment[i]]);\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tfindSet(i,buckets[(bucket_index+times)%buckNum][chunk_offset+assignment[i]]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (times!=buckNum-1)\n\t\t\t\t\t\t\trecomputeCostMatrix(array, (bucket_index+times+1)%buckNum, chunk_offset, chunk_size);\n\t\t\t\t\t}\n\t\t\t\t\tfor (int i=0; i<chunk_size; i++){\n\t\t\t\t\t\tif (MIXED){\n\t\t\t\t\t\t\tdistortion += NCP_mixed(MinMaxPerAssign[i], distinctValuesPerAssign[i]);\n\t\t\t\t\t\t}else\n\t\t\t\t\t\t\tif (RANGE)\n\t\t\t\t\t\t\t\tdistortion += NCP_numerical(MinMaxPerAssign[i]);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tdistortion += NCP(distinctValuesPerAssign[i]);\n\t\t\t\t\t}\n\t\t\t\t\tchunk_offset += chunk_size;\n\t\t\t\t}\n\t\t\t}\n\t\t}else{ //No partitioning:\n\t\t\tfor (int bucket_index=0; bucket_index<buckNum; bucket_index++){\n\n\t\t\t\t//edges = new HeapNode[bucket_size*bucket_size*2];\n\t\t\t\tedges = new HeapNode[bucket_size*bucket_size];\n\t\t\t\t//we need SA, too!\n\t\t\t\tif (MIXED){\n\t\t\t\t\tMinMaxPerAssign = new int[bucket_size][dims-1][2];\n\t\t\t\t\tdistinctValuesPerAssign = (LinkedList<Integer>[][]) new LinkedList[bucket_size][dims];\n\t\t\t\t}else{\n\t\t\t\t\tif (RANGE){\n\t\t\t\t\t\tMinMaxPerAssign = new int[bucket_size][dims-1][2];\n\t\t\t\t\t\tdistinctValues1 = (LinkedList<Integer>[]) new LinkedList[bucket_size];\n\t\t\t\t\t}else{\n\t\t\t\t\t\tdistinctValuesPerAssign = (LinkedList<Integer>[][]) new LinkedList[bucket_size][dims];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//HeapComparator hc = new HeapComparator();\n\t\t\t\tdouble[][] array = computeCostMatrix(buckets[bucket_index],buckets[(bucket_index+1)%buckNum], bucket_index*bucket_size, 0, bucket_size);\n\n\t\t\t\tint[] assignment = new int[array.length];\n\t\t\t\tint times = 0;\n\n\t\t\t\twhile (++times<buckNum){\n\t\t\t\t\t//qSort(0, bucket_size*bucket_size-1);\n\t\t\t\t\tqSort(0, edge_size-1);\n\t\t\t\t\tgreedyAssign(array, assignment, bucket_size);//Call SortGreedy algorithm.\n\n\t\t\t\t\tfor (int i=0; i<assignment.length; i++){\n\t\t\t\t\t\tfinal_assignment[i+bucket_index*bucket_size][times] = bucketToIndexMapping((bucket_index+times)%buckNum, assignment[i]);\n\t\t\t\t\t\tif (MIXED){\n\t\t\t\t\t\t\tfindSet_mixed(i, buckets[(bucket_index+times)%buckNum][assignment[i]] );\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tif (RANGE)\n\t\t\t\t\t\t\t\tfindSet_numerical(i, buckets[(bucket_index+times)%buckNum][assignment[i]]);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tfindSet(i,buckets[(bucket_index+times)%buckNum][assignment[i]]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (times!=buckNum-1)\n\t\t\t\t\t\trecomputeCostMatrix(array, (bucket_index+times+1)%buckNum, 0, bucket_size);\n\t\t\t\t}\n\t\t\t\tfor (int i=0; i<bucket_size; i++){\n\t\t\t\t\tif (MIXED){\n\t\t\t\t\t\tdistortion += NCP_mixed(MinMaxPerAssign[i], distinctValuesPerAssign[i]);\n\t\t\t\t\t}else\n\t\t\t\t\t\tif (RANGE)\n\t\t\t\t\t\t\tdistortion += NCP_numerical(MinMaxPerAssign[i]);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdistortion += NCP(distinctValuesPerAssign[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}//endif (partition or no_partition)\n\n\t\t//**** BEGIN XUE MINGQIANG **** //\n\t\t// this call returns a random assignment generated from the k-regular matching graph\n\t\tint [] rand_A = Randomization.run(final_assignment, 0, final_assignment.length, buckNum);\n\t\t//**** END XUE MINGQIANG **** //\n\t\tlong endTime = System.currentTimeMillis();\n\n\t\t//System.out.println(\"The winning assignment after \"+index+\" runs (\" + sumType + \" sum) is:\\n\");\t\n\n\t\t/*\n\t\tfor (int i=0; i<final_assignment.length; i++){\n\t\t\tfor (int j=0; j<buckNum; j++){\n\t\t\t\tSystem.out.print((final_assignment[i][j] +1)+\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\t */\n\n\t\tSystem.out.println(\"Time: \"+(endTime - startTime)+\"ms \"+\"\\n Distortion \"+ (double)(distortion/((dims-1)*tuples)));\n\n\t\tSystem.out.println(\"Saving results.\");\n\t\t//Save Results:\n\t\tFileWriter fw = null;\n\t\ttry{\n\t\t\tfw = new FileWriter(\"./SortGreedyResults.txt\",true); //true == append\n\t\t\tfw.write(origTuples+\" \"+b_param+\" \");\n\t\t\tif((partition_function == 0) || (partition_function == 1)){\n\t\t\t\tfw.write(partition_size+\" \");\n\t\t\t}else{\n\t\t\t\tfw.write(bucket_size+\" \");\n\t\t\t}\n\t\t\tfw.write((endTime - startTime)+\" \"\n\t\t\t\t\t+((double)(distortion/((dims-1)*tuples)))+\"\\n\");\n\t\t}catch(IOException ioe){\n\t\t\tSystem.err.println(\"IOException: \" + ioe.getMessage());\n\t\t}finally{\n\t\t\ttry{\n\t\t\t\tif(fw != null) fw.close();\n\t\t\t}catch(Exception e){\n\t\t\t\t//ignore.\n\t\t\t}\n\t\t}\n\t\tif (!q){\n\t\t\tSystem.out.println(\"Range Queries.\");\n\t\t\tdouble[] selectivities = {0.05, 0.1, 0.15, 0.2, 0.25};\n\t\t\tString qErr = \"\";\n\t\t\tFileWriter qw = null;\n\t\t\ttry{\n\t\t\t\tint qtimes = 1000; //numer of random queries.\n\t\t\t\tdouble[] errArray = new double[qtimes];\n\t\t\t\tqw = new FileWriter(\"./SortGreedy_QueryError.txt\",true); //true == append\n\t\t\t\t//qw.write(\"#tuples beta size lamda sel error\\n\");\n\t\t\t\t/*\n\t\t\tfor (int i=0; i<selectivities.length; i++){\n\t\t\t\tfor (int l=1; l<dims; l++){\n\t\t\t\t\tqw.write(origTuples+\" \"+b_param+\" \"+bucket_size+\" \"+\n\t\t\t\t\t\t\t l+\" \"+selectivities[i]+\" \");\n\t\t\t\t\tdouble[][] tmpres = new double[l+1][2];\n\t\t\t\t\tqErr = rangeQueries(selectivities[i], l, tmpres, qtimes);\n\t\t\t\t\tqw.write(qErr+\" \\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t */\n\t\t\t\t//sel=0.1\n\t\t\t\tdouble[][] tmpres = new double[dims][2];\n\n\t\t\t\tSystem.out.println(\"Vary lambda (sel=0.1): \");\n\t\t\t\tfor (int l=1; l<dims; l++){\n\t\t\t\t\tqw.write(origTuples+\" \"+b_param+\" \"+bucket_size+\" \"+\n\t\t\t\t\t\t\tl+\" \"+selectivities[1]+\" \");\n\t\t\t\t\tfor (int qi=0; qi<dims; qi++){ //INITIALIZATION:\n\t\t\t\t\t\ttmpres[qi][0] = (double)MinMaxPerAttribute[qi][0]-1;//<min SA value.\n\t\t\t\t\t\ttmpres[qi][1] = (double)MinMaxPerAttribute[qi][1]+1;//>max SA value\n\t\t\t\t\t}\n\n\t\t\t\t\tqErr = rangeQueries_serial(selectivities[1], l, tmpres, qtimes, errArray);\n\t\t\t\t\tqw.write(qErr+\" \\n\");\n\t\t\t\t}\n\n\t\t\t\tqw.write(\"\\n\");\n\t\t\t\tSystem.out.println(\"Vary selectivity (lambda=3): \");\n\t\t\t\tint l=3; //lambda = 3 first QIs.\n\t\t\t\tfor (int i=0; i<selectivities.length; i++){\n\t\t\t\t\tqw.write(origTuples+\" \"+b_param+\" \"+bucket_size+\" \"+\n\t\t\t\t\t\t\tl+\" \"+selectivities[i]+\" \");\n\t\t\t\t\tfor (int qi=0; qi<dims; qi++){ //INITIALIZATION:\n\t\t\t\t\t\ttmpres[qi][0] = (double)MinMaxPerAttribute[qi][0]-1;//<min SA value.\n\t\t\t\t\t\ttmpres[qi][1] = (double)MinMaxPerAttribute[qi][1]+1;//>max SA value\n\t\t\t\t\t}\n\n\t\t\t\t\tqErr = rangeQueries_serial(selectivities[i], l, tmpres, qtimes, errArray);\n\t\t\t\t\tqw.write(qErr+\" \\n\");\n\t\t\t\t}\n\n\t\t\t\tqw.write(\"\\n\");\n\t\t\t}catch(IOException ioe){\n\t\t\t\tSystem.err.println(\"IOException: \" + ioe.getMessage());\n\t\t\t}finally{\n\t\t\t\ttry{\n\t\t\t\t\tif(qw != null) qw.close();\n\t\t\t\t}catch(Exception e){\n\t\t\t\t\tSystem.err.println(e.getMessage());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "public static void main(String[] args) {\n\n\n\n\n\n ModelInterface model = new GameField(6, 7);\n Token blue = Token.BLUE;\n Token red = Token.RED;\n\n// model.setFieldStatus(0, red);\n// model.setFieldStatus(0, red);\n// model.setFieldStatus(0, red);\n\n model.setFieldStatus(0, red);\n model.setFieldStatus(1, blue);\n model.setFieldStatus(2, red);\n\n model.setFieldStatus(0, red);\n model.setFieldStatus(1, red);\n model.setFieldStatus(2, red);\n\n// model.setFieldStatus(2, blue);\n// model.setFieldStatus(2, blue);\n// model.setFieldStatus(2, blue);\n \n List<IRatingMechanism> ratingMechanisms = new ArrayList<IRatingMechanism>();\n ratingMechanisms.add(new MWin());\n ratingMechanisms.add(new MWinNot());\n// ratingMechanisms.add(new MGeneralPosition());\n// ratingMechanisms.add(new MTwoStonesWithSpaceChecking());\n// ratingMechanisms.add(new MCatch22());\n\n Tree tree = new Tree(model, ratingMechanisms, blue);\n System.out.println(tree.toString());\n\n MiniMaxAlgorithm instance = new MiniMaxAlgorithm();\n int result = instance.getBestMove(model, ratingMechanisms, blue);\n System.out.println(\"\" + result);\n\n\n\n\n\n }", "public ForecastParameters make_analyst_fcparams (RJGUIController.XferAnalystView xfer) {\n\n\t\tForecastParameters new_fcparams = new ForecastParameters();\n\t\tnew_fcparams.setup_all_default();\n\n\t\tif (xfer.x_autoEnableParam == AutoEnable.DISABLE) {\n\t\t\treturn new_fcparams;\n\t\t}\n\n\t\tnew_fcparams.set_analyst_control_params (\n\t\t\tForecastParameters.CALC_METH_AUTO_PDL,\t\t// generic_calc_meth\n\t\t\tForecastParameters.CALC_METH_AUTO_PDL,\t\t// seq_spec_calc_meth\n\t\t\tForecastParameters.CALC_METH_AUTO_PDL,\t\t// bayesian_calc_meth\n\t\t\tanalyst_inj_text.isEmpty() ? ForecastParameters.INJ_TXT_USE_DEFAULT : analyst_inj_text\n\t\t);\n\n\t\tif (!( xfer.x_useCustomParamsParam )) {\n\t\t\treturn new_fcparams;\n\t\t}\n\n\t\tnew_fcparams.set_analyst_mag_comp_params (\n\t\t\ttrue,\t\t\t\t\t\t\t\t\t\t// mag_comp_avail\n\t\t\taafs_fcparams.mag_comp_regime,\t\t\t\t// mag_comp_regime\n\t\t\tfetch_fcparams.mag_comp_params\t\t\t\t// mag_comp_params\n\t\t);\n\n\t\tnew_fcparams.set_analyst_seq_spec_params (\n\t\t\ttrue,\t\t\t\t\t\t\t\t\t\t// seq_spec_avail\n\t\t\tfetch_fcparams.seq_spec_params\t\t\t\t// seq_spec_params\n\t\t);\n\n\t\tif (custom_search_region == null) {\n\t\t\treturn new_fcparams;\n\t\t}\n\n\t\tnew_fcparams.set_analyst_aftershock_search_params (\n\t\t\ttrue,\t\t\t\t\t\t\t\t\t\t// the_aftershock_search_avail\n\t\t\tcustom_search_region,\t\t\t\t\t\t// the_aftershock_search_region\n\t\t\tForecastParameters.SEARCH_PARAM_OMIT,\t\t// the_min_days\n\t\t\tForecastParameters.SEARCH_PARAM_OMIT,\t\t// the_max_days\n\t\t\tForecastParameters.SEARCH_PARAM_OMIT,\t\t// the_min_depth\n\t\t\tForecastParameters.SEARCH_PARAM_OMIT,\t\t// the_max_depth\n\t\t\tForecastParameters.SEARCH_PARAM_OMIT\t\t// the_min_mag\n\t\t);\n\t\t\n\t\treturn new_fcparams;\n\t}", "private static GridSearch9734Mod initializeGridSearch() {\r\n\t\tGridSearch9734Mod grid = new GridSearch9734Mod();\r\n\t\t// the metric to optimize\r\n\t\tgrid.setEvaluation(\r\n\t\t\t\tnew SelectedTag(GridSearch9734Mod.EVALUATION_WAUC, GridSearch9734Mod.TAGS_EVALUATION));\r\n\t\tgrid.setGridIsExtendable(false);\r\n\t\tgrid.setNumExecutionSlots(2);\r\n\t\tgrid.setSampleSizePercent(100);\r\n\t\tgrid.setInitialNumFolds(2);\r\n\t\tgrid.setStopAfterFirstGrid(true);\r\n\t\tgrid.setTraversal(\r\n\t\t\t\tnew SelectedTag(GridSearch9734Mod.TRAVERSAL_BY_ROW, GridSearch9734Mod.TAGS_TRAVERSAL));\r\n\t\tgrid.setDebug(false);\r\n\t\treturn grid;\r\n\t}", "public interface Strategy {\n\n StrategySolution solve(List<Item> items, int weight);\n}", "public Indexer() {\n motor = new CANSparkMax(RobotMap.INDEX_MOTOR, MotorType.kBrushless);\n motorPid = motor.getPIDController();\n motorEnc = motor.getEncoder();\n\n motorEnc.setVelocityConversionFactor(1);\n motorEnc.setPositionConversionFactor(1);\n\n motorEnc.setPosition(0);\n\n motorPid.setIZone(200);\n motorPid.setOutputRange(-1, 1);\n\n motorPid.setP(Constants.INDEXER_P);\n motorPid.setI(Constants.INDEXER_I);\n motorPid.setD(Constants.INDEXER_D);\n motorPid.setFF(Constants.INDEXER_FF);\n\n motorPid.setSmartMotionMaxAccel(10000, 0);\n motorPid.setSmartMotionAccelStrategy(AccelStrategy.kTrapezoidal, 0);\n motorPid.setSmartMotionMaxVelocity(MAX_VEL, 0);\n // motorPid.setSmartMotionMinOutputVelocity(100, 0);\n motorPid.setSmartMotionAllowedClosedLoopError(0.5, 0);\n\n motor.setIdleMode(IdleMode.kBrake);\n\n input1 = new DigitalInput(RobotMap.LIMIT_PORT_1);\n input2 = new DigitalInput(RobotMap.LIMIT_PORT_2);\n input3 = new DigitalInput(RobotMap.LIMIT_PORT_3);\n input5 = new DigitalInput(RobotMap.LIMIT_PORT_5);\n inputDecrement = new DigitalInput(RobotMap.LIMIT_PORT_DECREMENT);\n\n var tab = Shuffleboard.getTab(\"Indexer\");\n tab.addNumber(\"Motor Speed\", motorEnc::getVelocity);\n // tab.addNumber(\"Position\", motorEnc::getPosition);\n tab.addNumber(\"Num Balls\", () -> numBalls);\n tab.addBoolean(\"Beam Break 1\", input1::get);\n tab.addBoolean(\"Beam Break 2\", input2::get);\n tab.addBoolean(\"Beam Break 3\", input3::get);\n // tab.addBoolean(\"Beam Break 4\", input4::get);\n tab.addBoolean(\"Beam Break 5\", input5::get);\n\n var matchTab = Shuffleboard.getTab(\"Match\");\n matchTab.addNumber(\"Num Balls\", this::getNumBalls);\n matchTab.addBoolean(\"5 Balls\", () -> getNumBalls() >= 5);\n\n new Thread(() -> {\n boolean wasRead = false;\n while (true) {\n if (inputDecrement.get() && !wasRead) {\n wasRead = true;\n } else if (!inputDecrement.get() && wasRead) {\n decrementBall();\n wasRead = false;\n }\n try {\n Thread.sleep(5);\n } catch (InterruptedException e) {\n }\n }\n }).start();\n }", "public void setNewAlpha(){\n\n\t\tretrieveAlpha();\n\t\tretrieveReducerOutput();\n\t\t\n\t\tdouble[] alphaVectorUpdate = new double[K];\n\t\tdouble[] alphaGradientVector = new double[K];\n\t\tdouble[] alphaHessianVector = new double[K];\n\n\t\tdouble[] alphaVector = oldAlpha.clone();\n\t\tdouble[] alphaSufficientStatistics = rDelta;\n\n\t\tint alphaUpdateIterationCount = 0;\n\n\t\t// update the alpha vector until converge\n\t\tboolean keepGoing = true;\n\t\ttry {\n\t\t\tint decay = 0;\n\n\t\t\tdouble alphaSum = 0;\n\t\t\tfor (int j = 0; j < K; j++) {\n\t\t\t\talphaSum += alphaVector[j];\n\t\t\t}\n\n\t\t\twhile (keepGoing) {\n\t\t\t\tdouble sumG_H = 0;\n\t\t\t\tdouble sum1_H = 0;\n\n\t\t\t\tfor (int i = 0; i < K; i++) {\n\t\t\t\t\t// compute alphaGradient\n\t\t\t\t\talphaGradientVector[i] = D\n\t\t\t\t\t\t\t* (Gamma.digamma(alphaSum) - Gamma.digamma(alphaVector[i]))\n\t\t\t\t\t\t\t+ alphaSufficientStatistics[i];\n\n\t\t\t\t\t// compute alphaHessian\n\t\t\t\t\talphaHessianVector[i] = -D * Gamma.trigamma(alphaVector[i]);\n\n\t\t\t\t\tif (alphaGradientVector[i] == Double.POSITIVE_INFINITY\n\t\t\t\t\t\t\t|| alphaGradientVector[i] == Double.NEGATIVE_INFINITY) {\n\t\t\t\t\t\tthrow new ArithmeticException(\"Invalid ALPHA gradient matrix...\");\n\t\t\t\t\t}\n\n\t\t\t\t\tsumG_H += alphaGradientVector[i] / alphaHessianVector[i];\n\t\t\t\t\tsum1_H += 1 / alphaHessianVector[i];\n\t\t\t\t}\n\n\t\t\t\tdouble z = D * Gamma.trigamma(alphaSum);\n\t\t\t\tdouble c = sumG_H / (1 / z + sum1_H);\n\n\t\t\t\twhile (true) {\n\t\t\t\t\tboolean singularHessian = false;\n\n\t\t\t\t\tfor (int i = 0; i < K; i++) {\n\t\t\t\t\t\tdouble stepSize = Math.pow(Parameters.DEFAULT_ALPHA_UPDATE_DECAY_FACTOR, decay)\n\t\t\t\t\t\t\t\t* (alphaGradientVector[i] - c) / alphaHessianVector[i];\n\t\t\t\t\t\tif (alphaVector[i] <= stepSize) {\n\t\t\t\t\t\t\t// the current hessian matrix is singular\n\t\t\t\t\t\t\tsingularHessian = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\talphaVectorUpdate[i] = alphaVector[i] - stepSize;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (singularHessian) {\n\t\t\t\t\t\t// we need to further reduce the step size\n\t\t\t\t\t\tdecay++;\n\n\t\t\t\t\t\t// recover the old alpha vector\n\t\t\t\t\t\talphaVectorUpdate = alphaVector;\n\t\t\t\t\t\tif (decay > Parameters.DEFAULT_ALPHA_UPDATE_MAXIMUM_DECAY) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// we have successfully update the alpha vector\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// compute the alpha sum and check for alpha converge\n\t\t\t\talphaSum = 0;\n\t\t\t\tkeepGoing = false;\n\t\t\t\tfor (int j = 0; j < K; j++) {\n\t\t\t\t\talphaSum += alphaVectorUpdate[j];\n\t\t\t\t\tif (Math.abs((alphaVectorUpdate[j] - alphaVector[j]) / alphaVector[j]) >= Parameters.DEFAULT_ALPHA_UPDATE_CONVERGE_THRESHOLD) {\n\t\t\t\t\t\tkeepGoing = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (alphaUpdateIterationCount >= Parameters.DEFAULT_ALPHA_UPDATE_MAXIMUM_ITERATION) {\n\t\t\t\t\tkeepGoing = false;\n\t\t\t\t}\n\n\t\t\t\tif (decay > Parameters.DEFAULT_ALPHA_UPDATE_MAXIMUM_DECAY) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\talphaUpdateIterationCount++;\n\t\t\t\talphaVector = alphaVectorUpdate;\n\t\t\t}\n\t\t} catch (IllegalArgumentException iae) {\n\t\t\tSystem.err.println(iae.getMessage());\n\t\t\tiae.printStackTrace();\n\t\t} catch (ArithmeticException ae) {\n\t\t\tSystem.err.println(ae.getMessage());\n\t\t\tae.printStackTrace();\n\t\t}\n\n\t\tnewAlpha = alphaVector;\n\n\n\t}", "public FireflyOptimization(int population, int generations, double alpha, double beta0, double gamma){\n this(population, generations, alpha, beta0, gamma, 0.98, 0.05);\n }", "public static void main(String[] args) {\n INeighbor neighbor = new RandomNeighbor();\n IEvaluator evaluator = new BentEvaluator();\n ISolver solver = new RandomSearch(neighbor, evaluator);\n\n BoolFunction solution = solver.run();\n System.out.println(solution);\n }", "public TournamentAdaptativeModel()\n {\n this(0.10, 0.15, 0.20);\n }", "public void testAStarSearch() {\n\t\ttry {\r\n\t\t\t// EightPuzzleBoard extreme = new EightPuzzleBoard(new int[]\r\n\t\t\t// {2,0,5,6,4,8,3,7,1});\r\n\t\t\t// EightPuzzleBoard extreme = new EightPuzzleBoard(new int[]\r\n\t\t\t// {0,8,7,6,5,4,3,2,1});\r\n\t\t\tEightPuzzleBoard board = new EightPuzzleBoard(new int[] { 7, 1, 8,\r\n\t\t\t\t\t0, 4, 6, 2, 3, 5 });\r\n\r\n\t\t\tProblem problem = new Problem(board,\r\n\t\t\t\t\tnew EightPuzzleSuccessorFunction(),\r\n\t\t\t\t\tnew EightPuzzleGoalTest(), new ManhattanHeuristicFunction());\r\n\t\t\tSearch search = new AStarSearch(new GraphSearch());\r\n\t\t\tSearchAgent agent = new SearchAgent(problem, search);\r\n\t\t\tassertEquals(23, agent.getActions().size());\r\n\t\t\tassertEquals(\"906\", agent.getInstrumentation().getProperty(\r\n\t\t\t\t\t\"nodesExpanded\"));\r\n\t\t\tassertEquals(\"914\", agent.getInstrumentation().getProperty(\r\n\t\t\t\t\t\"queueSize\"));\r\n\t\t\tassertEquals(\"920\", agent.getInstrumentation().getProperty(\r\n\t\t\t\t\t\"maxQueueSize\"));\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "protected Move alphaBetaSearch() {\n\n\t\tdouble value = maxValue(this.parent, Double.NEGATIVE_INFINITY,\n\t\t\t\tDouble.POSITIVE_INFINITY);\n\t\tSystem.out.println(\"value-alpha-beta = \" + value);\n\t\t\n\t\tdouble maxVal = Double.NEGATIVE_INFINITY;\n\t\tMove idealMove = new Move();\n\t\tfor (Node tempNode : this.parent.children) {\n\t\t\tSystem.out.println(\"tempNode.getEvalValue() = \" \n\t\t+ tempNode.getEvalValue());\n\n\t\t\tif (tempNode.getEvalValue() >= maxVal) {\n\t\t\t\t\tidealMove = tempNode.getMove();\n\t\t\t\t\tmaxVal = tempNode.getEvalValue();\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tif(this.forcedMove != null)\n\t\t\treturn this.forcedMove;\n\t\treturn idealMove;\n\n\t}", "public void run(IEncoding solution, double Temp_i, double Temp_f, double alpha);", "public MagicSearch createMagicSearch();", "public PayActinfoExample() {\r\n oredCriteria = new ArrayList<Criteria>();\r\n }", "public double[] runOptimizer() {\n List<Integer> sents = new ArrayList<Integer>();\n for(int i=0; i<sentNum; i++)\n sents.add(i);\n \n if(needShuffle)\n Collections.shuffle(sents);\n \n double oraMetric, oraScore, predMetric, predScore;\n double[] oraPredScore = new double[4];\n double eta = 1.0; //learning rate, will not be changed if run percep\n double avgEta = 0; //average eta, just for analysis\n double loss = 0;\n double featNorm = 0;\n double featDiffVal;\n double sumMetricScore = 0;\n double sumModelScore = 0;\n String oraFeat = \"\";\n String predFeat = \"\";\n String[] oraPredFeat = new String[2];\n String[] vecOraFeat;\n String[] vecPredFeat;\n String[] featInfo;\n boolean first = true;\n //int processedSent = 0;\n Iterator it;\n Integer diffFeatId;\n double[] avgLambda = new double[initialLambda.length]; //only needed if averaging is required\n for(int i=0; i<initialLambda.length; i++)\n avgLambda[i] = 0.0;\n\n //update weights\n for(Integer s : sents) {\n //find out oracle and prediction\n if(first)\n findOraPred(s, oraPredScore, oraPredFeat, initialLambda, featScale);\n else\n findOraPred(s, oraPredScore, oraPredFeat, finalLambda, featScale);\n \n //the model scores here are already scaled in findOraPred\n oraMetric = oraPredScore[0];\n oraScore = oraPredScore[1];\n predMetric = oraPredScore[2];\n predScore = oraPredScore[3];\n oraFeat = oraPredFeat[0];\n predFeat = oraPredFeat[1];\n \n //update the scale\n if(needScale) { //otherwise featscale remains 1.0\n sumMetricScore += java.lang.Math.abs(oraMetric+predMetric);\n sumModelScore += java.lang.Math.abs(oraScore+predScore)/featScale; //restore the original model score\n \n if(sumModelScore/sumMetricScore > scoreRatio)\n featScale = sumMetricScore/sumModelScore;\n\n /* a different scaling strategy \n if( (1.0*processedSent/sentNum) < sentForScale ) { //still need to scale\n double newFeatScale = java.lang.Math.abs(scoreRatio*sumMetricDiff / sumModelDiff); //to make sure modelScore*featScale/metricScore = scoreRatio\n \n //update the scale only when difference is significant\n if( java.lang.Math.abs(newFeatScale-featScale)/featScale > 0.2 )\n featScale = newFeatScale;\n }*/\n }\n// processedSent++;\n\n HashMap<Integer, Double> allOraFeat = new HashMap<Integer, Double>();\n HashMap<Integer, Double> allPredFeat = new HashMap<Integer, Double>();\n HashMap<Integer, Double> featDiff = new HashMap<Integer, Double>();\n\n vecOraFeat = oraFeat.split(\"\\\\s+\");\n vecPredFeat = predFeat.split(\"\\\\s+\");\n \n for (int i = 0; i < vecOraFeat.length; i++) {\n featInfo = vecOraFeat[i].split(\":\");\n diffFeatId = Integer.parseInt(featInfo[0]);\n allOraFeat.put(diffFeatId, Double.parseDouble(featInfo[1]));\n featDiff.put(diffFeatId, Double.parseDouble(featInfo[1]));\n }\n\n for (int i = 0; i < vecPredFeat.length; i++) {\n featInfo = vecPredFeat[i].split(\":\");\n diffFeatId = Integer.parseInt(featInfo[0]);\n allPredFeat.put(diffFeatId, Double.parseDouble(featInfo[1]));\n\n if (featDiff.containsKey(diffFeatId)) //overlapping features\n featDiff.put(diffFeatId, featDiff.get(diffFeatId)-Double.parseDouble(featInfo[1]));\n else //features only firing in the 2nd feature vector\n featDiff.put(diffFeatId, -1.0*Double.parseDouble(featInfo[1]));\n }\n\n if(!runPercep) { //otherwise eta=1.0\n featNorm = 0;\n\n Collection<Double> allDiff = featDiff.values();\n for(it =allDiff.iterator(); it.hasNext();) {\n featDiffVal = (Double) it.next();\n featNorm += featDiffVal*featDiffVal;\n }\n \n //a few sanity checks\n if(! evalMetric.getToBeMinimized()) {\n if(oraSelectMode==1 && predSelectMode==1) { //\"hope-fear\" selection\n /* ora_score+ora_metric > pred_score+pred_metric\n * pred_score-pred_metric > ora_score-ora_metric\n * => ora_metric > pred_metric */\n if(oraMetric+1e-10 < predMetric) {\n System.err.println(\"WARNING: for hope-fear selection, oracle metric score must be greater than prediction metric score!\");\n System.err.println(\"Something is wrong!\");\n }\n }\n \n if(oraSelectMode==2 || predSelectMode==3) {\n if(oraMetric+1e-10 < predMetric) {\n System.err.println(\"WARNING: for max-metric oracle selection or min-metric prediction selection, the oracle metric \" +\n \t\t\"score must be greater than the prediction metric score!\");\n System.err.println(\"Something is wrong!\");\n }\n }\n } else {\n if(oraSelectMode==1 && predSelectMode==1) { //\"hope-fear\" selection\n /* ora_score-ora_metric > pred_score-pred_metric\n * pred_score+pred_metric > ora_score+ora_metric\n * => ora_metric < pred_metric */\n if(oraMetric-1e-10 > predMetric) {\n System.err.println(\"WARNING: for hope-fear selection, oracle metric score must be smaller than prediction metric score!\");\n System.err.println(\"Something is wrong!\");\n }\n }\n \n if(oraSelectMode==2 || predSelectMode==3) {\n if(oraMetric-1e-10 > predMetric) {\n System.err.println(\"WARNING: for min-metric oracle selection or max-metric prediction selection, the oracle metric \" +\n \"score must be smaller than the prediction metric score!\");\n System.err.println(\"Something is wrong!\");\n }\n }\n }\n \n if(predSelectMode==2) {\n if(predScore+1e-10 < oraScore) {\n System.err.println(\"WARNING: for max-model prediction selection, the prediction model score must be greater than oracle model score!\");\n System.err.println(\"Something is wrong!\");\n }\n }\n \n //cost - margin\n //remember the model scores here are already scaled\n loss = evalMetric.getToBeMinimized() ? //cost should always be non-negative \n (predMetric-oraMetric) - (oraScore-predScore)/featScale: \n (oraMetric-predMetric) - (oraScore-predScore)/featScale;\n \n if(loss<0)\n loss = 0;\n\n if(loss == 0)\n eta = 0;\n else\n //eta = C < loss/(featNorm*featScale*featScale) ? C : loss/(featNorm*featScale*featScale); //feat vector not scaled before\n eta = C < loss/(featNorm) ? C : loss/(featNorm); //feat vector not scaled before\n }\n \n avgEta += eta;\n\n Set<Integer> diffFeatSet = featDiff.keySet();\n it = diffFeatSet.iterator();\n\n if(first) {\n first = false;\n \n if(eta!=0) {\n while(it.hasNext()) {\n diffFeatId = (Integer)it.next();\n finalLambda[diffFeatId] = initialLambda[diffFeatId] + eta*featDiff.get(diffFeatId);\n }\n }\n }\n else {\n if(eta!=0) {\n while(it.hasNext()) {\n diffFeatId = (Integer)it.next();\n finalLambda[diffFeatId] = finalLambda[diffFeatId] + eta*featDiff.get(diffFeatId);\n }\n }\n }\n \n if(needAvg) {\n for(int i=0; i<avgLambda.length; i++)\n avgLambda[i] += finalLambda[i];\n }\n }\n \n if(needAvg) {\n for(int i=0; i<finalLambda.length; i++)\n finalLambda[i] = avgLambda[i]/sentNum;\n }\n \n avgEta /= sentNum;\n System.out.println(\"Average learning rate: \"+avgEta);\n\n // the intitialLambda & finalLambda are all trainable parameters\n //if (!trainMode.equals(\"3\")) // for mode 3, no need to normalize sparse\n // feature weights\n //normalizeLambda(finalLambda);\n //else\n //normalizeLambda_mode3(finalLambda);\n\n /*\n * for( int i=0; i<finalLambda.length; i++ ) System.out.print(finalLambda[i]+\" \");\n * System.out.println(); System.exit(0);\n */ \n\n double initMetricScore = computeCorpusMetricScore(initialLambda); // compute the initial corpus-level metric score\n double finalMetricScore = computeCorpusMetricScore(finalLambda); // compute final corpus-level metric score // the\n\n // prepare the printing info\n int numParamToPrint = 0;\n String result = \"\";\n\n if (trainMode.equals(\"1\") || trainMode.equals(\"4\")) {\n numParamToPrint = paramDim > 10 ? 10 : paramDim; // how many parameters\n // to print\n result = paramDim > 10 ? \"Final lambda(first 10): {\" : \"Final lambda: {\";\n\n for (int i = 1; i < numParamToPrint; i++)\n // in ZMERT finalLambda[0] is not used\n result += finalLambda[i] + \" \";\n } else {\n int sparseNumToPrint = 0;\n if (trainMode.equals(\"2\")) {\n result = \"Final lambda(regular feats + first 5 sparse feats): {\";\n for (int i = 1; i <= regParamDim; ++i)\n result += finalLambda[i] + \" \";\n\n result += \"||| \";\n\n sparseNumToPrint = 5 < (paramDim - regParamDim) ? 5 : (paramDim - regParamDim);\n\n for (int i = 1; i <= sparseNumToPrint; i++)\n result += finalLambda[regParamDim + i] + \" \";\n } else {\n result = \"Final lambda(first 10 sparse feats): {\";\n sparseNumToPrint = 10 < paramDim ? 10 : paramDim;\n\n for (int i = 1; i < sparseNumToPrint; i++)\n result += finalLambda[i] + \" \";\n }\n }\n\n output.add(result + finalLambda[numParamToPrint] + \"}\\n\" + \"Initial \"\n + evalMetric.get_metricName() + \": \" + initMetricScore + \"\\nFinal \"\n + evalMetric.get_metricName() + \": \" + finalMetricScore);\n\n // System.out.println(output);\n\n if (trainMode.equals(\"3\")) {\n // finalLambda = baseline(unchanged)+disc\n for (int i = 0; i < paramDim; i++)\n copyLambda[i + regParamDim + 1] = finalLambda[i];\n\n finalLambda = copyLambda;\n }\n\n return finalLambda;\n }", "public void createCariculum(){\n Set<Session> s = new HashSet<>();\n allCombinations.clear();\n RunAlgo(0, s, createModel());\n filteredResults = allCombinations;//check later if need to adjust.\n }" ]
[ "0.56993335", "0.53794134", "0.5057677", "0.49996108", "0.4962604", "0.4953406", "0.4951781", "0.49510032", "0.49344614", "0.4930517", "0.49074614", "0.489001", "0.48649526", "0.48624158", "0.485608", "0.4853347", "0.48473144", "0.4819053", "0.48024717", "0.48007995", "0.47908935", "0.47895002", "0.47702882", "0.4770005", "0.47664517", "0.4754457", "0.47379562", "0.47301078", "0.47176006", "0.47087035", "0.4697169", "0.46864897", "0.4677977", "0.46776375", "0.4643361", "0.46378958", "0.46368432", "0.46357417", "0.4633811", "0.46335933", "0.46321523", "0.46184155", "0.46117288", "0.4608336", "0.4607577", "0.46071884", "0.45994407", "0.45994383", "0.45955753", "0.45881885", "0.4575312", "0.45751834", "0.4564644", "0.45634145", "0.45501238", "0.4545273", "0.45378083", "0.4534487", "0.4531033", "0.4530597", "0.45289293", "0.45174477", "0.45160854", "0.45159084", "0.45114443", "0.45105204", "0.45068455", "0.44993895", "0.44961742", "0.44867963", "0.44798294", "0.44729847", "0.4471571", "0.44683966", "0.44675404", "0.4467349", "0.44558835", "0.44555235", "0.444113", "0.44404864", "0.44371584", "0.44345802", "0.44334662", "0.44253737", "0.44248328", "0.44108793", "0.4398505", "0.4396096", "0.438697", "0.43847746", "0.4384474", "0.4383657", "0.43800864", "0.43779865", "0.43724924", "0.4362408", "0.43549955", "0.43542457", "0.43522152", "0.43485647", "0.43473378" ]
0.0
-1
Create an Impactbased search strategy. "ImpactBased Search Strategies for Constraint Programming", Philippe Refalo, CP2004.
public static AbstractStrategy<IntVar> impact(IntVar[] VARS, int ALPHA, int SPLIT, int NODEIMPACT, long SEED, boolean INITONLY) { return new ImpactBased(VARS, ALPHA, SPLIT, NODEIMPACT, SEED, INITONLY); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface AsgStrategy {\n void apply(AsgQuery query, AsgStrategyContext context);\n}", "Association findAssociation(World w, BlockPos pos, String strategy);", "Strategy createStrategy();", "void searchConstraintHit (Search search);", "GoalSpecification createGoalSpecification();", "Algorithm createAlgorithm();", "AttackImpactFactory getAttackImpactFactory();", "OperationalizingSoftgoal createOperationalizingSoftgoal();", "public interface Strategy {\n\n StrategySolution solve(List<Item> items, int weight);\n}", "ParameterRefinement createParameterRefinement();", "public interface SearchSolver {\n\n /**\n * initializes the algorithm. This method has to be called before calling any other method\n * @param graph the graph of the map where the search takes place\n * @param targetStart the start position for the target (in our case the thief)\n * @param searchStart the start position for the searcher (in our case the police)\n * @param counter the counter object that counts the expanded nodes\n */\n void initialize(Graph graph, Node targetStart, Node searchStart, ExpandCounter counter);\n\n /**\n * gets the shortest path from search start to target\n * @return list of edges that describe the path\n * @throws NoPathFoundException if there is no path to the target\n */\n List<Edge> getPath() throws NoPathFoundException;\n}", "public interface ConflictRegionStrategy extends AlgStrategy {}", "public interface IInteractStrategy {\n\n\t/**\n\t * Performs a directed interaction between the context ball and the target Ball from the perspective of the context Ball.\n\t * @param context The Ball from whose perspective the interaction processing takes place.\n\t * @param target The Ball that is the \"other ball\" in the perspective of this processing.\n\t * @param disp The Dispatcher that is to be used if desired.\n\t * @param interactFirst A boolean denoting whether this is the first in a series (usually two) of interactions.\n\t */\n\tpublic void interact(Ball context, Ball target, IDispatcher<IBallCmd> disp, Boolean interactFirst);\n\n\t/**\n\t * Null strategy with no-op behavior. \n\t * NOTE: We can use a lambda here instead of an anonymous inner class because IInteractStrategy is a functional interface (only has one\n\t * abstract method).\n\t */\n\tpublic static final IInteractStrategy NULL = (context, target, disp, isSource) -> {};\n\t\n}", "public abstract Solution<T> search(Searchable<T> s);", "public interface ISearchable {\n\n\n AState getStartState () throws NullError;\n\n AState getGoalState () throws NullError;\n\n ArrayList<AState> getAllSuccessors (AState state) throws LowBoundInput, OutOfBoundMatrixInput, NullError;\n\n}", "TSearchResults searchWithQuery(TSearchQuery searchQuery, SearchParametersAPI overrideParameters, TRepo repo, AreaFactory<TContent, TArea> areaFactory, ContentFactory<TContent> contentFactory);", "public interface ScoreAnalyzerFactory {\n ScoreAnalyzer create(ScoreProperties scoreProperties);\n}", "public interface IKataSolution\n extends IKataCommonSolution {\n\n public enum ACTION {\n TURN_LEFT, TURN_RIGHT, FORWARD, STAY\n }\n\n public enum ORIENTATION {\n UP (270), DOWN(90), LEFT(0), RIGHT(180);\n public int angle;\n ORIENTATION (int _angle) {\n angle = _angle;\n }\n public ORIENTATION moveLeft () {\n switch (this) {\n case UP: return LEFT;\n case DOWN: return RIGHT;\n case LEFT: return DOWN;\n case RIGHT: return UP;\n }\n return this;\n }\n public ORIENTATION moveRight () {\n switch (this) {\n case UP: return RIGHT;\n case DOWN: return LEFT;\n case LEFT: return UP;\n case RIGHT: return DOWN;\n }\n return this;\n }\n }\n\n public enum ITEM {\n EMPTY, PLANT, ANIMAL, END\n }\n\n public abstract class Animal {\n /**\n * Number of plants the animal ate\n */\n public int points;\n /**\n * Method to react to changing environmental conditions\n *\n * @param orientation animal's current orientation\n * @param view item currently in front of animal\n * @return action to do\n */\n public abstract ACTION react (ORIENTATION orientation, ITEM view);\n }\n\n /**\n * Factory method for an animal\n *\n * @param count count of animals to create\n * @param lastGeneration array of 'Animal' from last generation\n * @return array of 'Animal' instances\n */\n public abstract Animal[] createGeneration (int count, Animal[] lastGeneration);\n\n /**\n * If true, last generation will be visualized\n */\n public boolean visualizeLastGeneration ();\n\n /**\n * Defines how many generations of evolution should be tested\n * (minimum is 100, maximum is 10000)\n *\n * @return count of generations to test\n */\n public int countOfGenerations ();\n}", "Conector createConector();", "public interface Heuristic {\n}", "public IDetectionAlgorithm createInstance();", "public IPDStrategy()\n {\n name = \"IPD Strategy\";\n }", "Constraint createConstraint();", "Constraint createConstraint();", "public Decision planBest(Context context, Decision defaultDecision);", "public MagicSearch createMagicSearch();", "public interface Solver {\n String MESSY_FOLIAGE_STRATEGY = \"find_messy_foliage\";\n\n /**\n * Play an association.\n */\n void playAssociation(LivingEntity ply, Association assos, State eventType);\n\n /**\n * Find an association for a player particular foot. This will fetch the player\n * angle and use it as a basis to find out what block is below their feet (or\n * which block is likely to be below their feet if the player is walking on the\n * edge of a block when walking over non-emitting blocks like air or water).<br>\n * <br>\n * Returns NOT_EMITTER if no blocks are valid emitting blocks.<br>\n * Returns a string that begins with \"_NO_ASSOCIATION\" if a matching block was\n * found, but has no association in the blockmap.\n */\n Association findAssociation(LivingEntity ply, double verticalOffsetAsMinus, boolean isRightFoot);\n\n /**\n * Find an association for a certain block assuming the player is standing on\n * it, using a custom strategy which strategies are defined by the solver.\n */\n Association findAssociation(World w, BlockPos pos, String strategy);\n}", "public interface Searcher<T> {\r\n\t\r\n\t//the search method\r\n\tpublic Solution<T> search(Searchable<T> s);\r\n\t\r\n\t//get how many nodes were evaluated by the algorithm\r\n\tpublic int getNumberOfNodesEvaluated();\r\n}", "UsabilityGoal createUsabilityGoal();", "public Algorithm configure() throws JMException {\n\t\tAlgorithm algorithm;\n\t\tOperator selection;\n\t\tOperator crossover;\n\t\tOperator mutation;\n\n\t\tHashMap parameters; // Operator parameters\n\n\t\t// Creating the problem\n\t\talgorithm = new NSGAII(problem_);\n\n\t\t// Algorithm parameters\n\t\talgorithm.setInputParameter(\"populationSize\", populationSize_);\n\t\talgorithm.setInputParameter(\"maxEvaluations\", maxEvaluations_);\n\n\t\t// Mutation and Crossover Binary codification\n\t\tparameters = new HashMap();\n\t\tparameters.put(\"probability\", crossoverProbability_);\n\t\tcrossover = CrossoverFactory.getCrossoverOperator(\"SinglePointCrossover\", parameters);\n\n\t\tparameters = new HashMap();\n\t\tparameters.put(\"probability\", mutationProbability_);\n\t\tmutation = MutationFactory.getMutationOperator(\"BitFlipMutation\", parameters);\n\n\t\t// Selection Operator\n\t\tparameters = null;\n\t\tselection = SelectionFactory.getSelectionOperator(\"BinaryTournament2\", parameters);\n\n\t\t// Add the operators to the algorithm\n\t\talgorithm.addOperator(\"crossover\", crossover);\n\t\talgorithm.addOperator(\"mutation\", mutation);\n\t\talgorithm.addOperator(\"selection\", selection);\n\n\t\treturn algorithm;\n\t}", "IntStrategyFactory() {\n }", "public GraphCostBasedSearch(GraphVar graphVar) {\n this(graphVar, null);\n }", "public abstract Rank<String,String> query(String input) throws ClassificationException;", "public interface SearchAlgorithm {\n\t/**\n\t * Searches the state space for a solution.\n\t * @param root\n\t * The root state to begin search from.\n\t * @param expanded_list\n\t * The expanded list in order of expansion. Filled by function.\n\t * @param goal\n\t * The goal state representation used to test if we reached the goal state.\n\t * @return\n\t * The search results containing all needed information about the search and the results.\n\t */\n\tSearchResult search(State root, List<State> expanded_list, State goal);\n}", "InstAssignIndex createInstAssignIndex();", "public interface SharedStrategy extends InstitutionalStatement, Sanction {\n}", "public AlphaBetaSearch(SearchLimitingPredicate<T> searchLimitingPredicate) {\n this.searchLimitingPredicate = searchLimitingPredicate;\n }", "public static interface PredictorSelectionStrategy {\n /**\n * Injects kernel to kernel-MA according to predictor internal data.\n */\n public void injectKernel(final Predictor predictor);\n\n /**\n * Maximum size of kernels\n */\n public int kernelSize();\n\n /**\n * Creates a brand new predictor.\n */\n public PredictorListener buildPredictor();\n }", "public abstract Search create(String search, SearchBuilder builder);", "public interface IPredictionService {\n\t\n\t\n\t/**\n\t * \n\t * Create an instance object of TestSet\n\t * \n\t * @param position\n\t * @return\n\t * @throws Exception\n\t */\n\tpublic Instances makeTestSet(String position) throws Exception;\n\t\n\t/**\n\t * Used a particular algorithm to train the Artificial Intelligence (AI)\n\t * @throws Exception\n\t */\n\tpublic void train() throws Exception;\n\t\n\t/**\n\t * Used to classify after train\n\t * @throws Exception\n\t */\n\tpublic void classify() throws Exception;\n\n}", "public interface RecommendationStrategy {\n\tRecommendationResultsHolder getRecommendationResults(Product product, String type);\n\n}", "public Solution solve(ISearchable s) {\n return null;\n }", "public void testSearchRules() throws Exception {\n Project project = new Project();\r\n \r\n DateFormatSymbols symbols = new DateFormatSymbols(Locale.US);\r\n \r\n for (int i = 0; i < 12; i++) {\r\n \r\n String month = symbols.getMonths()[i];\r\n String shortMonth = symbols.getShortMonths()[i];\r\n \r\n // Basic project info\r\n project.setId(i);\r\n project.setCategoryId(1);\r\n project.setAllowGuests(true);\r\n project.setMembershipRequired(false);\r\n project.setApproved(true);\r\n project.setClosed(false);\r\n project.setPortal(false);\r\n \r\n // Unique Title\r\n project.setTitle(month + \" test project\");\r\n project.setShortDescription(month + \" description word\");\r\n project.setKeywords(shortMonth);\r\n \r\n // Unique Location\r\n project.setCity(\"Virginia Beach\");\r\n project.setState(\"VA\");\r\n project.setPostalCode(\"234\" + String.valueOf(50 + i));\r\n \r\n // Random Rating for now\r\n project.setRatingCount(i + 1);\r\n project.setRatingValue(project.getRatingCount() * StringUtils.rand(1, 5));\r\n project.setRatingAverage(project.getRatingValue() / project.getRatingCount());\r\n \r\n // Index it\r\n ProjectIndexer indexer = new ProjectIndexer();\r\n indexer.add(snowballWriter, project, true);\r\n }\r\n \r\n QueryParser parser = new QueryParser(\"contents\", snowballAnalyzer);\r\n \r\n {\r\n // Make sure a single matching term yields a single hit\r\n SearchBean search = new SearchBean();\r\n search.setQuery(symbols.getMonths()[0]);\r\n search.setLocation(\"Virginia Beach\");\r\n assertNotNull(search.getQuery());\r\n assertNotNull(search.getLocation());\r\n search.parseQuery();\r\n assertTrue(search.isValid());\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n assertNotNull(queryString);\r\n \r\n // (approved:1)\r\n // AND (guests:1)\r\n // AND (closed:0)\r\n // AND (website:0)\r\n // AND (\"january\"^20 OR january^15 OR january*^4) AND (location:(\"virginia beach\"^30))\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == 1);\r\n }\r\n \r\n {\r\n // Make sure a single matching term stem yields a single hit\r\n SearchBean search = new SearchBean();\r\n search.setQuery(symbols.getMonths()[0] + \"'s\");\r\n search.setLocation(\"Virginia Beach\");\r\n assertNotNull(search.getQuery());\r\n assertNotNull(search.getLocation());\r\n search.parseQuery();\r\n assertTrue(search.isValid());\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n assertNotNull(queryString);\r\n \r\n // (approved:1)\r\n // AND (guests:1)\r\n // AND (closed:0)\r\n // AND (website:0)\r\n // AND (\"january's\"^20 OR january's^15 OR january's*^4) AND (location:(\"virginia beach\"^30))\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == 1);\r\n }\r\n \r\n {\r\n // Make sure multiple matching words yield two hits\r\n SearchBean search = new SearchBean();\r\n search.setQuery(symbols.getMonths()[0] + \" \" + symbols.getMonths()[1]);\r\n search.setLocation(\"Virginia Beach\");\r\n search.parseQuery();\r\n assertTrue(search.isValid());\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n assertNotNull(queryString);\r\n \r\n // (approved:1)\r\n // AND (guests:1)\r\n // AND (closed:0)\r\n // AND (website:0)\r\n // AND (\"january february\"^20 OR january^15 OR february^14 OR january*^4 OR february*^3) AND (location:(\"virginia beach\"^30))\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == 2);\r\n }\r\n \r\n {\r\n // Make sure wilcards yield multiple hits\r\n SearchBean search = new SearchBean();\r\n search.setQuery(\"j\");\r\n search.setLocation(\"Virginia Beach\");\r\n search.parseQuery();\r\n assertTrue(search.isValid());\r\n \r\n // Look for data with a \"j\" for comparison\r\n int jCount = 0;\r\n for (int i = 0; i < symbols.getMonths().length; i++) {\r\n if (symbols.getMonths()[i].toLowerCase().indexOf(\"j\") > -1 ||\r\n symbols.getShortMonths()[i].toLowerCase().indexOf(\"j\") > -1) {\r\n ++jCount;\r\n }\r\n }\r\n assertTrue(jCount > 0);\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n assertNotNull(queryString);\r\n \r\n // (approved:1)\r\n // AND (guests:1)\r\n // AND (closed:0)\r\n // AND (website:0)\r\n // AND (\"j\"^20 OR j^15 OR j*^4) AND (location:(\"virginia beach\"^30))\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == jCount);\r\n }\r\n \r\n {\r\n // Make sure alternate locations do not yield any hits\r\n SearchBean search = new SearchBean();\r\n search.setQuery(symbols.getMonths()[0]);\r\n search.setLocation(\"Norfolk\");\r\n search.parseQuery();\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == 0);\r\n }\r\n \r\n {\r\n // Make sure locations as query terms do not yield any hits\r\n SearchBean search = new SearchBean();\r\n search.setQuery(\"Virginia Beach\");\r\n search.setLocation(\"Virginia Beach\");\r\n search.parseQuery();\r\n \r\n String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null);\r\n \r\n Query query = parser.parse(queryString);\r\n Hits hits = getSnowballSearcher().search(query);\r\n assertTrue(hits.length() == 0);\r\n }\r\n }", "Boolean getSearchObjective();", "public abstract OptimisationSolution getBestSolution();", "NFRSoftgoal createNFRSoftgoal();", "BehavioralFeatureConcept createBehavioralFeatureConcept();", "@Override\n public void newGame(ICrossingStrategy gameStrategy) {\n\n }", "public Decision bestFor(Context context);", "public interface AMDPModelLearner extends AMDPPolicyGenerator{\n\n\n public void updateModel(State s, Action a, List<Double> rewards, State sPrime, GroundedTask gt);\n\n\n}", "public interface Predictor {\n //\n // Inner interface --------------------------------------------\n //\n\n /**\n * Decission algorithm to select kernel for time series predictor.\n */\n public static interface PredictorSelectionStrategy {\n /**\n * Injects kernel to kernel-MA according to predictor internal data.\n */\n public void injectKernel(final Predictor predictor);\n\n /**\n * Maximum size of kernels\n */\n public int kernelSize();\n\n /**\n * Creates a brand new predictor.\n */\n public PredictorListener buildPredictor();\n }\n\n\n\n //\n // Interface methods -------------------------------------------\n //\n\n /**\n * Emits a single forecast based on learned values.\n */\n public double predict(final Calendar when);\n\n /**\n * Emits a forecast based on learned values.\n */\n public double[] predictVector(final Calendar when);\n\n /**\n * Memorizes several values at the same time.\n */\n public void learnVector(final Calendar when, final double[] vals);\n\n /**\n * Memorizes several values at the same time.\n */\n public void learnVector(final Calendar when, final List<Double> vals);\n\n\n /**\n * Memorizes one single value.\n */\n public void learnValue(final Calendar when, final double val);\n\n /**\n * Empties memory and predictions restoring initial state.\n */\n public void reset();\n\n /**\n * Returns the human name of the predictor.\n */\n public String toString();\n}", "CritPair createCritPair();", "AnalyticClause createAnalyticClause();", "public AdvancedSolution(int[] state, int fitness, int nbIterations) {\n\t\tsuper(state, fitness);\n\t\tthis.nbIterations = nbIterations;\n\t}", "static HintStrategyTable createHintStrategies(HintStrategyTable.Builder builder) {\n return builder\n .hintStrategy(\"no_hash_join\", HintPredicates.JOIN)\n .hintStrategy(\"time_zone\", HintPredicates.SET_VAR)\n .hintStrategy(\"REPARTITION\", HintPredicates.SET_VAR)\n .hintStrategy(\"index\", HintPredicates.TABLE_SCAN)\n .hintStrategy(\"properties\", HintPredicates.TABLE_SCAN)\n .hintStrategy(\n \"resource\", HintPredicates.or(\n HintPredicates.PROJECT, HintPredicates.AGGREGATE,\n HintPredicates.CALC, HintPredicates.VALUES,\n HintPredicates.FILTER, HintPredicates.TABLE_FUNCTION_SCAN))\n .hintStrategy(\"AGG_STRATEGY\",\n HintStrategy.builder(HintPredicates.AGGREGATE)\n .optionChecker(\n (hint, errorHandler) -> errorHandler.check(\n hint.listOptions.size() == 1\n && (hint.listOptions.get(0).equalsIgnoreCase(\"ONE_PHASE\")\n || hint.listOptions.get(0).equalsIgnoreCase(\"TWO_PHASE\")),\n \"Hint {} only allows single option, \"\n + \"allowed options: [ONE_PHASE, TWO_PHASE]\",\n hint.hintName)).build())\n .hintStrategy(\"use_hash_join\",\n HintPredicates.or(\n HintPredicates.and(HintPredicates.CORRELATE, temporalJoinWithFixedTableName()),\n HintPredicates.and(HintPredicates.JOIN, joinWithFixedTableName())))\n .hintStrategy(\"breakable\", HintPredicates.SETOP)\n .hintStrategy(\"async_merge\", HintPredicates.SORT)\n .hintStrategy(\"mini_batch\",\n HintPredicates.and(HintPredicates.WINDOW, HintPredicates.PROJECT))\n .hintStrategy(\"fast_snapshot\", HintPredicates.SNAPSHOT)\n .hintStrategy(\"use_merge_join\",\n HintStrategy.builder(\n HintPredicates.and(HintPredicates.JOIN, joinWithFixedTableName()))\n .excludedRules(EnumerableRules.ENUMERABLE_JOIN_RULE).build())\n .hintStrategy(\n \"preserved_project\", HintStrategy.builder(\n HintPredicates.PROJECT).excludedRules(CoreRules.FILTER_PROJECT_TRANSPOSE).build())\n .build();\n }", "private BFSRunner getSearcher(Predicate<Cell> isAccessible, Predicate<Cell> isGoal) {\n\t\treturn new BFSRunner(map, msgUtil, currentCell, isAccessible, isGoal, actionQueue);\n\t}", "private static HintStrategyTable createHintStrategies() {\n return createHintStrategies(HintStrategyTable.builder());\n }", "public static void experiment(String name) {\n \tString probName = \"NQueensProblem\";\n \tList<OptimizationAlgorithm> algs = new ArrayList<>();\n int[] ranges = new int[N];\n Random random = new Random(N);\n for (int i = 0; i < N; i++) {\n \tranges[i] = random.nextInt();\n }\n NQueensFitnessFunction ef = new NQueensFitnessFunction();\n Distribution odd = new DiscretePermutationDistribution(N);\n NeighborFunction nf = new SwapNeighbor();\n MutationFunction mf = new SwapMutation();\n CrossoverFunction cf = new SingleCrossOver();\n Distribution df = new DiscreteDependencyTree(.1); \n \n HillClimbingProblem hcp = new GenericHillClimbingProblem(ef, odd, nf);\n GeneticAlgorithmProblem gap = new GenericGeneticAlgorithmProblem(ef, odd, mf, cf);\n ProbabilisticOptimizationProblem pop = new GenericProbabilisticOptimizationProblem(ef, odd, df);\n \n RandomizedHillClimbing rhc = new RandomizedHillClimbing(hcp); \n SimulatedAnnealing sa = new SimulatedAnnealing(1E1, .1, hcp);\n StandardGeneticAlgorithm ga = new StandardGeneticAlgorithm(200, 0, 10, gap);\n MIMIC mimic = new MIMIC(200, 10, pop);\n \n algs.add(rhc);\n algs.add(sa);\n algs.add(ga);\n algs.add(mimic);\n Experiment newExp = new Experiment();\n \n newExp.experiments(algs, ef, name);\n \n // test temperature for SA\n String paramName = \"Temperature\";\n String algName = \"SA\";\n List<Double> params2 = new ArrayList<>();\n List<OptimizationAlgorithm> algsTest = new ArrayList<>();\n for (double i = 1.0; i < 100.5; i+=1.0){\n \tparams2.add(i);\n \tsa = new SimulatedAnnealing(i, .1, hcp);\n \talgsTest.add(sa);\n }\n newExp.optParams(algsTest, ef, paramName, null, params2, algName, probName);\n \n // test cooling rate for SA\n paramName = \"CoolingRate\";\n params2 = new ArrayList<>();\n algsTest = new ArrayList<>();\n for (double i = 0.01; i < 0.51; i+=0.005){\n \tparams2.add(i);\n \tsa = new SimulatedAnnealing(1E1, i, hcp);\n \talgsTest.add(sa);\n }\n newExp.optParams(algsTest, ef, paramName, null, params2, algName, probName);\n \n // test populationSize for GA\n paramName = \"populationSize\";\n algName = \"GA\";\n List<Integer> params1 = new ArrayList<>();\n algsTest = new ArrayList<>();\n for (int i = 10; i < 1001; i+=10){\n \tparams1.add(i);\n \tga = new StandardGeneticAlgorithm(i, 0, 10, gap);\n \talgsTest.add(ga);\n }\n newExp.optParams(algsTest, ef, paramName, params1, null, algName, probName);\n \n // test toMate for GA\n paramName = \"toMate\";\n params1 = new ArrayList<>();\n algsTest = new ArrayList<>();\n for (int i = 0; i < 100; i+=1){\n \tparams1.add(i);\n \tga = new StandardGeneticAlgorithm(200, i, 10, gap);\n \talgsTest.add(ga);\n }\n newExp.optParams(algsTest, ef, paramName, params1, null, algName, probName);\n \n // test toMutate for GA\n paramName = \"toMutate\";\n params1 = new ArrayList<>();\n algsTest = new ArrayList<>();\n for (int i = 10; i < 1001; i+=10){\n \tparams1.add(i);\n \tga = new StandardGeneticAlgorithm(200, 0, i, gap);\n \talgsTest.add(ga);\n }\n newExp.optParams(algsTest, ef, paramName, params1, null, algName, probName);\n \n // test samples for MIMIC\n paramName = \"samples\";\n algName = \"MIMIC\";\n params1 = new ArrayList<>();\n algsTest = new ArrayList<>();\n for (int i = 100; i < 1101; i += 10){\n \tparams1.add(i);\n \tmimic = new MIMIC(i, 10, pop);\n \talgsTest.add(mimic);\n }\n newExp.optParams(algsTest, ef, paramName, params1, null, algName, probName);\n \n // test tokeep for MIMIC\n paramName = \"tokeeep\";\n params1 = new ArrayList<>();\n algsTest = new ArrayList<>();\n for (int i = 1; i < 101; i+=1){\n \tparams1.add(i);\n \tmimic = new MIMIC(200, i, pop);\n \talgsTest.add(mimic);\n }\n newExp.optParams(algsTest, ef, paramName, params1, null, algName, probName);\n \n \n // test different algorithms with various NQueensProblems\n // set up algorithms\n algs = new ArrayList<>();\n ga = new StandardGeneticAlgorithm(150, 98, 70, gap);\n algs.add(rhc);\n algs.add(sa);\n algs.add(ga);\n algs.add(mimic);\n // set up different efs\n List<EvaluationFunction> efs = new ArrayList<>();\n for (int i = 0; i < 50; i++){\n \tef = new NQueensFitnessFunction();\n \tefs.add(ef);\n }\n newExp.voteBest(algs, efs, 2000, probName);\n \n }", "public static void main(String... args)\n {\n String path = Configuration.instance.dataDirectory + Configuration.instance.fileSeparator;\n String suffix = \"_default.xml\";\n String algorithm = \"\";\n boolean paramSeach = false;\n int maxGens = 10000;\n\n readItems();\n\n // Parsing CLI\n for (int i = 0; i < args.length; i++)\n {\n if (args[i].equals(\"-algorithm\"))\n {\n i++;\n algorithm = args[i];\n }\n\n if (args[i].equals(\"-configuration\"))\n {\n i++;\n if (args[i].equals(\"best\"))\n suffix = \"_best.xml\";\n }\n\n if (args[i].equals(\"-search_best_configuration\"))\n paramSeach = true;\n }\n\n if (paramSeach) suffix = \"_best.xml\";\n double[] hyperparameters = loadConfig(path + algorithm + suffix);\n System.out.println(\"Chosen algorithm: \" + algorithm);\n\n double time = System.currentTimeMillis();\n // Running correct algorithm according to CLI\n switch (algorithm)\n {\n case \"ga\":\n if (paramSeach)\n new GARecommender().recommend();\n else\n new Population(maxGens, hyperparameters).run();\n break;\n case \"sa\":\n case \"best-algorithm\":\n if (paramSeach)\n new SARecommender().recommend();\n else\n new Annealing(hyperparameters).run();\n break;\n case \"aco\":\n if (paramSeach)\n new ACORecommender().recommend();\n else\n new AntColony(maxGens, hyperparameters).run();\n break;\n case \"pso\":\n if (paramSeach)\n new PSORecommender().recommend();\n else\n new Swarm(maxGens * 10, hyperparameters).run(); // 10x max gens because PSO is does less per gen and is much faster\n break;\n default:\n System.out.println(\"Could not find algorithm with name \" + algorithm + \". Options are: ga, sa, aco, pso\");\n break;\n }\n System.out.println(\"Finished in: \" + ((System.currentTimeMillis() - time) / 1000) + \"s\");\n }", "public interface SearchInterface {\n int ACTION_TYPE_AMBIGUOUS = 1;\n int ACTION_TYPE_SWITCH_CHANNEL = 2;\n int ACTION_TYPE_SWITCH_INPUT = 3;\n\n /**\n * Search channels, inputs, or programs.\n * This assumes that parental control settings will not be change while searching.\n *\n * @param action One of {@link #ACTION_TYPE_SWITCH_CHANNEL}, {@link #ACTION_TYPE_SWITCH_INPUT},\n * or {@link #ACTION_TYPE_AMBIGUOUS},\n */\n List<SearchResult> search(String query, int limit, int action);\n}", "protected OpinionFinding() {/* intentionally empty block */}", "public void test_ck_02() {\n OntModel vocabModel = ModelFactory.createOntologyModel();\n ObjectProperty p = vocabModel.createObjectProperty(\"p\");\n OntClass A = vocabModel.createClass(\"A\");\n \n OntModel workModel = ModelFactory.createOntologyModel();\n Individual sub = workModel.createIndividual(\"uri1\", A);\n Individual obj = workModel.createIndividual(\"uri2\", A);\n workModel.createStatement(sub, p, obj);\n }", "public interface LookupConstraint {\n}", "public Policy solve(Problem prob, int iterations) {\n\t\t\tPolicy policy = new Policy(prob);\n\t\t\tint row;\n\t\t\tint col;\n\t\t\tfor (int i=0; i<= ITERATIONS ; i++)\n\t\t\t{\n\n\t\t\t\trow = rng.nextInt(prob.map.size());\n\t\t\t\tcol = rng.nextInt(prob.map.get(0).size());\t\t\t\t\t\t\t\n\t\t\t\tfetchUtilityValue(prob, row, col, policy);\n\n\t\t\t}\n\n\t\t\tfor (int r = 0; r < rewards.length; r++) \n\t\t\t{\n\t\t\t\tfor (int c = 0; c < rewards[0].length; c++) \n\t\t\t\t{\n\t\t\t\t\tif(policy.bestActions[r][c] == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tint direction =0;\n\t\t\t\t\t\tdouble maxQVal = Integer.MIN_VALUE;\n\t\t\t\t\t\tfor(int i=0; i< ACTION_COUNT ; i++)\n\t\t\t\t\t\t{ \n\t\t\t\t\t\t\tif(utilities[i][r][c] > maxQVal)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmaxQVal = utilities[i][r][c];\n\t\t\t\t\t\t\t\tdirection = i;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpolicy.bestActions[r][c] = DIRECTION[direction];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn policy;\n\t\t}", "public interface Algorithm {\n /**\n * Initialize the data store and verifies the data in it.\n * \n * @param datastore\n * @throws InvalidDatastoreException\n */\n void initialize(Datastore datastore) throws InvalidDatastoreException;\n \n /**\n * Classify the document and return the Result\n * \n * @param document\n * The document to classify\n * @param datastore\n * The data store(InMemory)\n * @param defaultCategory\n * The default category to assign Ties are broken by comparing the category\n * @return A Collection of {@link org.apache.mahout.classifier.ClassifierResult}s.\n * @throws InvalidDatastoreException\n */\n ClassifierResult classifyDocument(String[] document,\n Datastore datastore,\n String defaultCategory) throws InvalidDatastoreException;\n \n /**\n * Classify the document and return the top {@code numResults}\n *\n * @param document\n * The document to classify\n * @param datastore\n * The {@link Datastore} (InMemory)\n * @param defaultCategory\n * The default category to assign\n * @param numResults\n * The maximum number of results to return, ranked by score. Ties are broken by comparing the\n * category\n * @return A Collection of {@link ClassifierResult}s.\n * @throws InvalidDatastoreException\n */\n ClassifierResult[] classifyDocument(String[] document,\n Datastore datastore,\n String defaultCategory,\n int numResults) throws InvalidDatastoreException;\n \n /**\n * Get the weighted probability of the feature.\n * \n * @param datastore\n * The {@link Datastore} (InMemory)\n * @param label\n * The label of the feature\n * @param feature\n * The feature to calc. the prob. for\n * @return The weighted probability\n * @throws InvalidDatastoreException\n */\n double featureWeight(Datastore datastore, String label, String feature) throws InvalidDatastoreException;\n \n /**\n * Calculate the document weight as the dot product of document vector and the corresponding weight vector\n * of a particular class\n * \n * @param datastore\n * The {@link Datastore} (InMemory)\n * @param label\n * The label to calculate the probability of\n * @param document\n * The document\n * @return The probability\n * @see Algorithm#featureWeight(Datastore, String, String)\n */\n double documentWeight(Datastore datastore, String label, String[] document);\n \n /**\n * Returns the labels in the given Model\n * \n * @param datastore\n * The {@link Datastore} (InMemory)\n * @throws InvalidDatastoreException\n * @return {@link Collection} of labels\n */\n Collection<String> getLabels(Datastore datastore) throws InvalidDatastoreException;\n}", "public NormalSearch() throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException {\n super();\n //ins = new globalInstance();\n // TODO Auto-generated constructor stub\n }", "public Decision bestFor(Context context, ShapeType type);", "public interface LDABetaInitStrategy{\n\t/**\n\t * Given a model and the corpus initialise the model's sufficient statistics\n\t * @param model\n\t * @param corpus\n\t */\n\tpublic void initModel(LDAModel model, Corpus corpus);\n\t\n\t/**\n\t * initialises beta randomly s.t. each each topicWord >= 1 and < 2\n\t * @author Sina Samangooei ([email protected])\n\t *\n\t */\n\tpublic static class RandomBetaInit implements LDABetaInitStrategy{\n\t\tprivate MersenneTwister random;\n\t\t\n\t\t/**\n\t\t * unseeded random\n\t\t */\n\t\tpublic RandomBetaInit() {\n\t\t\trandom = new MersenneTwister();\n\t\t}\n\t\t\n\t\t/**\n\t\t * seeded random\n\t\t * @param seed\n\t\t */\n\t\tpublic RandomBetaInit(int seed) {\n\t\t\trandom = new MersenneTwister(seed);\n\t\t}\n\t\t@Override\n\t\tpublic void initModel(LDAModel model, Corpus corpus) {\n\t\t\tfor (int topicIndex = 0; topicIndex < model.ntopics; topicIndex++) {\n\t\t\t\tfor (int wordIndex = 0; wordIndex < corpus.vocabularySize(); wordIndex++) {\n\t\t\t\t\tdouble topicWord = 1 + random.nextDouble();\n\t\t\t\t\tmodel.incTopicWord(topicIndex,wordIndex,topicWord);\n\t\t\t\t\tmodel.incTopicTotal(topicIndex, topicWord);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "DistributedSearchType createDistributedSearchType();", "public static AbstractStrategy<IntVar> activity(IntVar[] VARS, double GAMMA, double DELTA, int ALPHA,\n int FORCE_SAMPLING, long SEED) {\n return new ActivityBased(VARS[0].getSolver(), VARS, GAMMA, DELTA, ALPHA, FORCE_SAMPLING, SEED);\n }", "public Algorithms.Search<State<E>,HeuristicNode<State<E>,Double>>.Result search(Signature<E> request){\n log.info(\"Initializing composition search problem...\");\n // Composition starts with the request:\n Stopwatch compositionWatch = Stopwatch.createStarted();\n // Build the initial match graph network (first pass)\n ServiceMatchNetwork<E, T> network = discoverer.search(request);\n // Apply optimizations\n Stopwatch optWatch = Stopwatch.createStarted();\n for(NetworkOptimizer<E,T> opt : optimizations){\n network = opt.optimize(network);\n }\n optWatch.stop();\n log.info(\"Graph optimizations done in {}\", optWatch);\n log.info(\"Starting search over a network with {} levels and {} operations\", network.numberOfLevels(), network.listOperations().size());\n // Run search over network\n Algorithms.Search<State<E>,HeuristicNode<State<E>,Double>>.Result searchResult = CompositSearch.create(network).search();\n log.info(\"Optimal composition search finished in {}\", searchResult.getStopwatch().toString());\n log.debug(\" Composition : {}\", searchResult.getOptimalPath());\n log.debug(\" Total iterations : {}\", searchResult.getIterations());\n log.info(\" Composition runpath : {}\", searchResult.getOptimalPath().size()-2);\n log.info(\" Composition services: {}\", searchResult.getGoalNode().getScore());\n log.info(\"Total composition time : {}\", compositionWatch.stop().toString());\n\n List<State<E>> states = searchResult.getOptimalPath();\n List<Set<Operation<E>>> ops = Lists.transform(states, new Function<State<E>, Set<Operation<E>>>() {\n @Override\n public Set<Operation<E>> apply(State<E> state) {\n return state.getStateOperations();\n }\n });\n return searchResult;\n }", "public interface ISimAnn {\r\n \r\n //defines the random number generator based on the passed in seed.\r\n public void setRNG(long seed);\r\n \r\n //starts search with inital, final, and change in temperature\r\n public void run(IEncoding solution, double Temp_i, double Temp_f, double alpha);\r\n\r\n}", "public interface AprioriCorpusFactory {\n \n /**\n * Initializes and populates an a priori index with documents whos text is known to be correct.\n *\n * @param dictionary dictionary to extract data from.\n * @param suggester suggester used to navigate the dictionary.\n * @param aprioriIndex lucene index, will be created/reinitialized.\n * @param aprioriIndexField index field used to store the a priori text.\n * @param aprioriAnalyzer analyzer used to tokenize a priori text.\n * @throws IOException\n * @throws QueryException\n */\n public abstract void factory(Dictionary dictionary, Suggester suggester, IndexFacade aprioriIndex, String aprioriIndexField, Analyzer aprioriAnalyzer, IndexWriter.MaxFieldLength mfl) throws IOException, QueryException;\n \n }", "CampusSearchQuery generateQuery();", "public interface IIQActions {\n void think();\n Knowledge learn(Knowledge source, Knowledge dest);\n}", "public abstract double getConstraintFitness();", "public List<OWLObject> search(OWLObject queryObj) {\n\t\tList<OWLObject> hits = new ArrayList<OWLObject>(maxHits);\n\t\tSystem.out.println(\"gettings atts for \"+queryObj+\" -- \"+simEngine.comparisonProperty);\n\t\tSet<OWLObject> atts = simEngine.getAttributeClosureFor(queryObj);\n\t\tSystem.out.println(\"all atts: \"+atts.size());\n\t\tif (atts.size() == 0)\n\t\t\treturn hits;\n\t\t\n\t\t// only compare using significant atts;\n\t\t// we don't do the same test on candidates as these will be removed by the\n\t\t// intersection operation. they will have a small effect on the score, as\n\t\t// we don't divide by the union, but instead the sum of sizes\n\t\tatts = filterNonSignificantAttributes(atts);\n\t\tSystem.out.println(\"filtered atts: \"+atts.size());\n\n\t\t//bloomFilter = new BloomFilter<OWLObject>(0.05, atts.size());\n\t\t//bloomFilter.addAll(atts);\n\t\t\t\t\n\t\tSortedMap<Integer,Set<OWLObject>> scoreCandidateMap = new TreeMap<Integer,Set<OWLObject>>();\n\t\t\n\t\tfor (OWLObject candidate : getCandidates()) {\n\t\t\tif (candidate.equals(queryObj))\n\t\t\t\tcontinue;\n\t\t\tSet<OWLObject> iAtts = simEngine.getAttributeClosureFor(candidate);\n\t\t\t//Set<OWLObject> iAtts = simEngine.getGraph().getAncestors(candidate);\n\n\t\t\tif (iAtts.size() == 0)\n\t\t\t\tcontinue;\n\t\t\tint cAttsSize = iAtts.size();\n\t\n\t\t\tiAtts.retainAll(atts);\n\t\t\t//Collection<OWLObject> iAtts = bloomFilter.intersection(cAtts);\n\t\t\t\n\t\t\t// simJ, one-sided, scaled by 1000\n\t\t\t// negate to ensure largest first\n\t\t\t//Integer score = - (iAtts.size() * 1000 / cAttsSize);\n\t\t\t\n\t\t\t// this biases us towards genes with large numbers of annotations,\n\t\t\t// but it is better at finding the models that share all features\n\t\t\tInteger score = - iAtts.size();\n\t\t\tif (!scoreCandidateMap.containsKey(score)) \n\t\t\t\tscoreCandidateMap.put(score, new HashSet<OWLObject>());\n\t\t\tscoreCandidateMap.get(score).add(candidate);\n\t\t\treporter.report(this,\"query_candidate_overlap_total\",queryObj,candidate,iAtts.size(),cAttsSize);\n\t\t}\n\t\t\n\t\tint n = 0;\n\t\tfor (Set<OWLObject> cs : scoreCandidateMap.values()) {\n\t\t\tn += cs.size();\n\t\t\thits.addAll(cs);\n\t\t}\n\t\t\n\t\tn = 0;\n\t\tfor (OWLObject hit : hits) {\n\t\t\tn++;\n\t\t\treporter.report(this,\"query_hit_rank_threshold\",queryObj,hit,n,maxHits);\n\t\t}\n\t\tif (hits.size() > maxHits)\n\t\t\thits = hits.subList(0, maxHits);\n\t\t\n\n\n\t\treturn hits;\n\t}", "public abstract ParameterVector searchVector();", "public abstract Objective createObjective(Scoreboard parent,\n String identifier,\n String title);", "public interface Strategy {\n\n\n\tpublic void operation();\n\n}", "public interface ISearchEngine {\n\n enum SearchParam {\n CORE,\n EXPERIMENT,\n HOST,\n PORT\n }\n\n /**\n * Query engine for searching relevant documents\n * @return\n */\n SearchResponse query(SearchRequest request, Map<SearchParam, String> params);\n\n /**\n * Query search engine for spell correction\n * @param request: spell check request\n * @return\n */\n SpellResponse spellQuery(SearchRequest request, Map<SearchParam, String> params);\n}", "public StrategyByGA(double ProbabilityOfCooperatingGivenCooperation,\n double ProbabilityOfCooperatingGivenDefection) {\n\n name = \"Strategy Developed by the Genetic Algorithm\";\n opponentLastMove = 1;\n proCoopGivCoop = ProbabilityOfCooperatingGivenCooperation;\n proCoopGivDef = ProbabilityOfCooperatingGivenDefection;\n }", "public BeautyCustomizedLevel(int width, int height, long seed, int difficulty, int type,int count, Hashtable hsObjectsScreen, int typeSymmetry,int[] odds,ElementsToPlace objElem, double wParamether, int methodSearch)\r\n\t {\r\n\t\t\t\r\n\t this(width, height);\r\n\t this.objElem=objElem;\r\n\t this.odds=odds;\r\n\t this.wParamether=wParamether;\r\n\t creatManySearchesObjectsNLG(seed, difficulty, type,count,hsObjectsScreen,typeSymmetry,methodSearch);\r\n\t //System.out.println(\"constructorcorrect\");\r\n\t \r\n\t }", "protected SearchSearchResponse doNewSearch(QueryContext queryContext) throws Exception {\n\t\t\n\t\tBooleanQuery query = _queryBuilder.buildSearchQuery(queryContext);\n\t\t\n\t\tBooleanQuery rescoreQuery = \n\t\t\t\t_queryBuilder.buildRescoreQuery(queryContext);\n\t\t\n\t\tList<Aggregation> aggregations = getAggregations(queryContext);\n\n\t\treturn execute(queryContext, query, rescoreQuery, aggregations);\n\t}", "DynamicBehavior createDynamicBehavior();", "TSearchResults createSearchResults(TSearchQuery searchQuery);", "BehaviorConcept createBehaviorConcept();", "public Implementation(Graph<V, E> graph, SenseInduction<V, E> inducer, ClusteringAlgorithmBuilder<Sense<V>, DefaultWeightedEdge, ?> global) {\n this.graph = graph;\n this.inducer = inducer;\n this.global = global;\n this.inventory = new ConcurrentHashMap<>(graph.vertexSet().size());\n this.senses = new ConcurrentHashMap<>(graph.vertexSet().size());\n }", "public BruteforceAttack(int[] pt,int[] ct){this(pt,ct,8);}", "public static InputSpecification getPetClinicInputSpecification() {\n\t\t\n\t\tProperties configFile = new Properties();\n\t\tInputSpecification input = new InputSpecification();\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tconfigFile.load(Crawler.class.getClassLoader().getResourceAsStream(\"app.properties\"));\n\t\t\t\n\t\t\t/*\n\t\t\tString firstname_field = configFile.getProperty(\"NEW_OWNER_FIRSTNAME\");\n\t\t\tString firstname_value = configFile.getProperty(\"NEW_OWNER_FIRSTNAME_VALUE\");\n\t\t\tString lastname_field = configFile.getProperty(\"NEW_OWNER_LASTNAME\");\n\t\t\tString lastname_value = configFile.getProperty(\"NEW_OWNER_LASTNAME_VALUE\");\n\t\t\tString address_field = configFile.getProperty(\"NEW_OWNER_ADDRESS\");\n\t\t\tString address_value = configFile.getProperty(\"NEW_OWNER_ADDRESS_VALUE\");\n\t\t\tString city_field = configFile.getProperty(\"NEW_OWNER_CITY\");\n\t\t\tString city_value = configFile.getProperty(\"NEW_OWNER_CITY_VALUE\");\n\t\t\tString telephone_field = configFile.getProperty(\"NEW_OWNER_TELEPHONE\");\n\t\t\tString telephone_value = configFile.getProperty(\"NEW_OWNER_TELEPHONE_VALUE\");\n\t\t\tString submit_field = configFile.getProperty(\"SUBMIT_FIELD\");\n\t\t\tString submit_value = configFile.getProperty(\"SUBMIT_TEXT\");\n\t\t\t\n\t\t\tForm newOwner = new Form();\n\t\t\tnewOwner.field(firstname_field).setValue(firstname_value);\n\t\t\tnewOwner.field(lastname_field).setValue(lastname_value);\n\t\t\tnewOwner.field(address_field).setValue(address_value);\n\t\t\tnewOwner.field(city_field).setValue(city_value);\n\t\t\tnewOwner.field(telephone_field).setValue(telephone_value);\n\t\t\tinput.setValuesInForm(newOwner).beforeClickElement(submit_field).withText(submit_value);\n\t\t\t*/\n\t\t\t\n\t\t\tString search_field = configFile.getProperty(\"SEARCH_FIELD\");\n\t\t\tString search_value = configFile.getProperty(\"SEARCH_VALUE\");\n\t\t\tString search_button_field = configFile.getProperty(\"SEARCH_BUTTON_FIELD\");\n\t\t\tString search_button_value = configFile.getProperty(\"SEARCH_BUTTON_VALUE\");\n\t\t\t\n\t\t\tForm search = new Form();\n\t\t\tsearch.field(search_field).setValue(search_value);\n\t\t\tinput.setValuesInForm(search).beforeClickElement(search_button_field).withText(search_button_value);\n\t\t\t\n\t\t\t/*\n\t\t\tString pet_name_field = configFile.getProperty(\"PET_NAME_FIELD\");\n\t\t\tString pet_name_value = configFile.getProperty(\"PET_NAME_VALUE\");\n\t\t\tString pet_birthday_field = configFile.getProperty(\"PET_BIRTHDATE_FIELD\");\n\t\t\tString pet_birthday_value = configFile.getProperty(\"PET_BIRTHDATE_VALUE\");\n\t\t\tString pet_type_field = configFile.getProperty(\"PET_TYPE_FIELD\");\n\t\t\tString pet_type_value = configFile.getProperty(\"PET_TYPE_VALUE\");\n\t\t\tString pet_button_field = configFile.getProperty(\"PET_ADD_BUTTON_FIELD\");\n\t\t\tString pet_button_value = configFile.getProperty(\"PET_ADD_BUTTON_VALUE\");\n\t\t\t\n\t\t\tForm addPet = new Form();\n\t\t\taddPet.field(pet_name_field).setValue(pet_name_value);\n\t\t\taddPet.field(pet_birthday_field).setValue(pet_birthday_value);\n\t\t\taddPet.field(pet_type_field).setValue(pet_type_value);\t\t\t\n\t\t\tinput.setValuesInForm(addPet).beforeClickElement(pet_button_field).withText(pet_button_value);\n\t\t\t\n\t\t\tString visit_description_field = configFile.getProperty(\"VISIT_DESCRIPTION_FIELD\");\n\t\t\tString visit_description_value = configFile.getProperty(\"VISIT_DESCRIPTION_VALUE\");\n\t\t\tdescription\n\t\t\t*/\n\t\t\t\t\t\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn input;\n\t}", "@TaDaMethod(variablesToTrack = {\"ssn\", \"weekWage\", \"workWeeks\", \"ssn2\",\n\t\t\t\"capitalGains\", \"capitalLosses\", \"stockDividends\"}, \n\t\t\tcorrespondingDatabaseAttribute = {\"job.ssn\", \"job.WEEKWAGE\", \"job.WORKWEEKS\", \"investment.ssn\",\n\t\t\t\"investment.CAPITALGAINS\", \"investment.CAPITALLOSSES\", \"investment.STOCKDIVIDENDS\"})\n\tprivate void calculateSlopesAndIntercepts(){\n\t\tHashMap<Integer, Integer> ssnWeekWage = new HashMap<Integer, Integer>();\n\t\tHashMap<Integer, Integer> ssnWorkWeeks = new HashMap<Integer, Integer>();\n\t\tHashMap<Integer, Integer> ssnInvestmentIncome = new HashMap<Integer, Integer>();\n\t\t\n\t\ttry {\n\t\t\tstatement = Factory.getConnection().createStatement();\n\t results = statement.executeQuery(\"SELECT SSN, WEEKWAGE, WORKWEEKS from job\"); \n\t while(results.next()){\n\t \tif(results.getString(\"SSN\") == null || results.getString(\"WEEKWAGE\") == null || results.getString(\"WORKWEEKS\") == null){\n\t \t\tcontinue;\n\t \t}\n\t \tint ssn = results.getInt(\"SSN\");\n\t \tint weekWage = results.getInt(\"WEEKWAGE\");\n\t \tint workWeeks = results.getInt(\"WORKWEEKS\");\n\t \t\n\t \tssnWeekWage.put(ssn, weekWage);\n\t \tssnWorkWeeks.put(ssn, workWeeks);\n\t }\n\t \n\t results = statement.executeQuery(\"SELECT SSN, CAPITALGAINS, CAPITALLOSSES, STOCKDIVIDENDS from investment\");\n\t while(results.next()){\n\t \tif(results.getString(\"SSN\") == null || results.getString(\"CAPITALGAINS\") == null || results.getString(\"CAPITALLOSSES\") == null || results.getString(\"STOCKDIVIDENDS\") == null){\n\t \t\tcontinue;\n\t \t}\n\t \tint ssn2 = results.getInt(\"SSN\");\n\t \tint capitalGains = results.getInt(\"CAPITALGAINS\");\n\t \tint capitalLosses = results.getInt(\"CAPITALLOSSES\");\n\t \tint stockDividends = results.getInt(\"STOCKDIVIDENDS\");\n\t \tint investmentIncome = capitalGains + stockDividends + capitalLosses;\n\t \t\n\t \tssnInvestmentIncome.put(ssn2, investmentIncome);\n\t }\n\t \n\t // Calculate Cofficients\n\t // Build an array list of Work Weeks and an array list of Income;\n\t ArrayList<Integer> workWeeksList = new ArrayList<Integer>();\n\t ArrayList<Integer> incomeList = new ArrayList<Integer>();\n\t ArrayList<Integer> weeklyWageList = new ArrayList<Integer>();\n\t ArrayList<Integer> investmentList = new ArrayList<Integer>();\n\t ArrayList<Integer> incomeListForInvestment = new ArrayList<Integer>();\n\t \n\t for (Iterator<Integer> i = ssnWorkWeeks.keySet().iterator(); i.hasNext();){\n\t \tint SSNkey = (Integer) i.next();\n\t \tif(ssnWorkWeeks.get(SSNkey) != null && ssnWeekWage.get(SSNkey) != null){\n\t\t \tint workWeeks = (Integer) ssnWorkWeeks.get(SSNkey);\n\t\t \tint weekWage = (Integer) ssnWeekWage.get(SSNkey);\n\t\t \tif(workWeeks > 0 && weekWage > 0){\n\t\t \t\tworkWeeksList.add(workWeeks);\n\t\t\t \tincomeList.add(workWeeks * weekWage);\n\t\t\t \tweeklyWageList.add(weekWage);\n\t\t\t \tif(ssnInvestmentIncome.get(SSNkey) != null && ssnInvestmentIncome.get(SSNkey) != null){\n\t\t\t \t\tint investmentIncome = (Integer) ssnInvestmentIncome.get(SSNkey);\n\t\t\t \t\tinvestmentList.add(investmentIncome);\n\t\t\t \t\tincomeListForInvestment.add(workWeeks * weekWage);\n\t\t\t \t}\n\t\t \t}\n\t \t}\n\t }\n\t \n\t // Set the member variable for the cofficients for given Work Weeks find Income\n\t workWeeksFindIncome = new CalculateRegression().calculateRegressionNumbers(workWeeksList,incomeList);\n\t \n\t // Set the member variable for the cofficients for given Weekly Wage find Income\n\t weeklyWageFindIncome = new CalculateRegression().calculateRegressionNumbers(weeklyWageList,incomeList);\n\t \n\t // Set the member variable for the cofficients for given InvestmentIncome find Income \n\t investmentIncomeFindIncome = new CalculateRegression().calculateRegressionNumbers(investmentList,incomeListForInvestment);\n\t \n\t\t} catch (SQLException e) {\n\t while (e != null)\n\t {\n\t System.err.println(\"\\n----- SQLException -----\");\n\t System.err.println(\" SQL State: \" + e.getSQLState());\n\t System.err.println(\" Error Code: \" + e.getErrorCode());\n\t System.err.println(\" Message: \" + e.getMessage());\n\t // for stack traces, refer to derby.log or uncomment this:\n\t //e.printStackTrace(System.err);\n\t e = e.getNextException();\n\t }\n\t\t}\t\n\t\t\n\t}", "ObstacleQuery createObstacleQuery();", "public interface IGOF {\n\n public double test(double[][] calib, double[][] test);\n public double test(double[][] calib, double[][] test, double N);\n public String testName();\n public String fieldName();\n public boolean calibrateToLessThan();\n public boolean isPerfect(double testStat);\n\n}", "public abstract IExperiment createExperiment(String description);", "public static void main(String[] args) throws IOException {\n int activeThreshold = 300;\n //Activity.selectActive(\"st\", 6, activeThreshold);\n //Activity.selectActive(\"ri\", 6, activeThreshold);\n //Activity.selectActive(\"dw\", 9, activeThreshold);\n\n //Interaction.analysis(\"st\", 6);\n //Interaction.analysis(\"ri\", 6);\n\n //BehaviourIndicators.analysis(\"st\", 6);\n //BehaviourIndicators.analysis(\"ri\", 6);\n //BehaviourIndicators.analysis(\"dw\", 9);\n\n Engagement.analysis(\"st\",6);\n Engagement.analysis(\"ri\",6);\n //todo the data files for DW have to be adjusted to the ones of the other two to be able to run it\n //Engagement.analysis(\"dw\",9);\n\n //Motivation.analysis(\"ri\", 6);\n //Motivation.analysis(\"st\", 6);\n }", "public interface ObjectiveFunctionI {\n public void setData(chromosome chromosome1, int indexOfObjective);\n public void setOriginalSolution(chromosome originalChromosome);\n\n public void setFirstImplement(boolean firstImplement);\n public void calcObjective();\n public chromosome getchromosome();\n //public double[] getObjectiveValues(int index);\n //public double getMinObjectiveValue();\n //public double getMaxObjectiveValue();\n}", "public static INeighbor explanationBased(IntVar... vars) {\n Model model = vars[0].getModel();\n// INeighbor neighbor1 = new ExplainingObjective(model, 5, 0);\n INeighbor neighbor2 = new ExplainingCut(model, 5, 0);\n INeighbor neighbor3 = new RandomNeighborhood(vars, 5, 0);\n return sequencer(/*neighbor1, */neighbor2, neighbor3);\n }", "@Override\n public Algorithm getAlgorithm(String name, Properties properties, Problem problem) {\n if (name.equals(\"NSGAII\")) {\n TypedProperties typed_props = new TypedProperties(properties);\n int pop_size = typed_props.getInt(\"populationSize\", 100);\n Initialization initialization = makeInitializer(problem, pop_size);\n DominanceComparator comparator = new ParetoDominanceComparator();\n NondominatedSortingPopulation population = new NondominatedSortingPopulation(comparator);\n TournamentSelection selection =\n new TournamentSelection(2, new ChainedComparator(new ParetoDominanceComparator(),\n new CrowdingComparator()));\n Variation variation = OperatorFactory.getInstance().getVariation(\"ux+svum+sm\", properties, problem);\n return decorateWithPeriodicActions(\n new NSGAII(problem, population, null, selection, variation, initialization));\n }\n return null;\n }", "@Override\n\tpublic void process(JCas aJCas) throws AnalysisEngineProcessException {\n\t\tString text = aJCas.getDocumentText();\n\n\t\t// create an empty Annotation just with the given text\n\t\tAnnotation document = new Annotation(text);\n//\t\tAnnotation document = new Annotation(\"Barack Obama was born in Hawaii. He is the president. Obama was elected in 2008.\");\n\n\t\t// run all Annotators on this text\n\t\tpipeline.annotate(document); \n\t\tList<CoreMap> sentences = document.get(SentencesAnnotation.class);\n\t\t HelperDataStructures hds = new HelperDataStructures();\n\n\t\t\n\t\t//SPnew language-specific settings:\n\t\t//SPnew subject tags of the parser\n\t\t HashSet<String> subjTag = new HashSet<String>(); \n\t\t HashSet<String> dirObjTag = new HashSet<String>(); \n\t\t //subordinate conjunction tags\n\t\t HashSet<String> compTag = new HashSet<String>(); \n\t\t //pronoun tags\n\t\t HashSet<String> pronTag = new HashSet<String>(); \n\t\t \n\t\t HashSet<String> passSubjTag = new HashSet<String>();\n\t\t HashSet<String> apposTag = new HashSet<String>(); \n\t\t HashSet<String> verbComplementTag = new HashSet<String>(); \n\t\t HashSet<String> infVerbTag = new HashSet<String>(); \n\t\t HashSet<String> relclauseTag = new HashSet<String>(); \n\t\t HashSet<String> aclauseTag = new HashSet<String>(); \n\t\t \n\t\t HashSet<String> compLemma = new HashSet<String>(); \n\t\t HashSet<String> coordLemma = new HashSet<String>(); \n\t\t HashSet<String> directQuoteIntro = new HashSet<String>(); \n\t\t HashSet<String> indirectQuoteIntroChunkValue = new HashSet<String>();\n\t\t \n//\t\t HashSet<String> finiteVerbTag = new HashSet<String>();\n\t\t \n\n\t\t //OPEN ISSUES PROBLEMS:\n\t\t //the subject - verb relation finding does not account for several specific cases: \n\t\t //opinion verbs with passive subjects as opinion holder are not accounted for,\n\t\t //what is needed is a marker in the lex files like PASSSUBJ\n\t\t //ex: Obama is worried/Merkel is concerned\n\t\t //Many of the poorer countries are concerned that the reduction in structural funds and farm subsidies may be detrimental in their attempts to fulfill the Copenhagen Criteria.\n\t\t //Some of the more well off EU states are also worried about the possible effects a sudden influx of cheap labor may have on their economies. Others are afraid that regional aid may be diverted away from those who currently benefit to the new, poorer countries that join in 2004 and beyond. \n\t\t// Does not account for infinitival constructions, here again a marker is needed to specify\n\t\t //subject versus object equi\n\t\t\t//Christian Noyer was reported to have said that it is ok.\n\t\t\t//Reuters has reported Christian Noyer to have said that it is ok.\n\t\t //Obama is likely to have said.. \n\t\t //Several opinion holder- opinion verb pairs in one sentence are not accounted for, right now the first pair is taken.\n\t\t //what is needed is to run through all dependencies. For inderect quotes the xcomp value of the embedded verb points to the \n\t\t //opinion verb. For direct quotes the offsets closest to thwe quote are relevant.\n\t\t //a specific treatment of inverted subjects is necessary then. Right now the\n\t\t //strategy relies on the fact that after the first subj/dirobj - verb pair the\n\t\t //search is interrupted. Thus, if the direct object precedes the subject, it is taken as subject.\n\t\t // this is the case in incorrectly analysed inverted subjeects as: said Zwickel on Monday\n\t\t //coordination of subject not accounted for:employers and many economists\n\t\t //several subject-opinion verbs:\n\t\t //Zwickel has called the hours discrepancy between east and west a \"fairness gap,\" but employers and many economists point out that many eastern operations have a much lower productivity than their western counterparts.\n\t\t if (language.equals(\"en\")){\n \t subjTag.add(\"nsubj\");\n \t subjTag.add(\"xsubj\");\n \t subjTag.add(\"nmod:agent\");\n \t \n \t dirObjTag.add(\"dobj\"); //for inverted subject: \" \" said IG metall boss Klaus Zwickel on Monday morning.\n \t \t\t\t\t\t\t//works only with break DEPENDENCYSEARCH, otherwise \"Monday\" is nsubj \n \t \t\t\t\t\t\t//for infinitival subject of object equi: Reuters reports Obama to have said\n \tpassSubjTag.add(\"nsubjpass\");\n \tapposTag.add(\"appos\");\n \trelclauseTag.add(\"acl:relcl\");\n \taclauseTag.add(\"acl\");\n \t compTag.add(\"mark\");\n \t pronTag.add(\"prp\");\n \thds.pronTag.add(\"prp\");\n \tcompLemma.add(\"that\");\n \tcoordLemma.add(\"and\");\n \tverbComplementTag.add(\"ccomp\");\n \tverbComplementTag.add(\"parataxis\");\n\n \tinfVerbTag.add(\"xcomp\"); //Reuters reported Merkel to have said\n \tinfVerbTag.add(\"advcl\");\n \tdirectQuoteIntro.add(\":\");\n \tindirectQuoteIntroChunkValue.add(\"SBAR\");\n \thds.objectEqui.add(\"report\");\n \thds.objectEqui.add(\"quote\");\n \thds.potentialIndirectQuoteTrigger.add(\"say\");\n// \thds.objectEqui.add(\"confirm\");\n// \thds.subjectEqui.add(\"promise\");\n// \thds.subjectEqui.add(\"quote\");\n// \thds.subjectEqui.add(\"confirm\");\n }\n\t\t \n\t\t boolean containsSubordinateConjunction = false;\n\t\t\n\t\t \n\t\tfor (CoreMap sentence : sentences) {\n//\t\t\tSystem.out.println(\"PREPROCESSING..\");\n\t\t\t\tSentenceAnnotation sentenceAnn = new SentenceAnnotation(aJCas);\n\t\t\t\t\n\t\t\t\tint beginSentence = sentence.get(TokensAnnotation.class).get(0)\n\t\t\t\t\t\t.beginPosition();\n\t\t\t\tint endSentence = sentence.get(TokensAnnotation.class)\n\t\t\t\t\t\t.get(sentence.get(TokensAnnotation.class).size() - 1)\n\t\t\t\t\t\t.endPosition();\n\t\t\t\tsentenceAnn.setBegin(beginSentence);\n\t\t\t\tsentenceAnn.setEnd(endSentence);\n\t\t\t\tsentenceAnn.addToIndexes();\n\t\t\t\t\n\t\t\t\t//SP Map offsets to NER\n\t\t\t\tList<NamedEntity> ners = JCasUtil.selectCovered(aJCas, //SPnew tut\n\t\t\t\t\t\tNamedEntity.class, sentenceAnn);\n\t\t\t\tfor (NamedEntity ne : ners){\n//\t\t\t\t\tSystem.out.println(\"NER TYPE: \" + ne.jcasType.toString());\n//\t\t\t\t\tSystem.out.println(\"NER TYPE: \" + ne.getCoveredText().toString());\n//\t\t\t\t\tSystem.out.println(\"NER TYPE: \" + ne.jcasType.casTypeCode);\n\t\t\t\t\t//Person is 71, Location is 213, Organization is 68 geht anders besser siehe unten\n\t\t\t\t\tint nerStart = ne\n\t\t\t\t\t\t\t.getBegin();\n\t\t\t\t\tint nerEnd = ne.getEnd();\n//\t\t\t\t\tSystem.out.println(\"NER: \" + ne.getCoveredText() + \" \" + nerStart + \"-\" + nerEnd ); \n\t\t\t\t\tString offsetNer = \"\" + nerStart + \"-\" + nerEnd;\n\t\t\t\t\thds.offsetToNer.put(offsetNer, ne.getCoveredText());\n//\t\t\t\t\tNer.add(offsetNer);\n\t\t\t\t\thds.Ner.add(offsetNer);\n//\t\t\t\t\tSystem.out.println(\"NER: TYPE \" +ne.getValue().toString());\n\t\t\t\t\tif (ne.getValue().equals(\"PERSON\")){\n\t\t\t\t\t\thds.NerPerson.add(offsetNer);\n\t\t\t\t\t}\n\t\t\t\t\telse if (ne.getValue().equals(\"ORGANIZATION\")){\n\t\t\t\t\t\thds.NerOrganization.add(offsetNer);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//DBpediaLink info: map offsets to links\n\t\t\t\tList<DBpediaResource> dbpeds = JCasUtil.selectCovered(aJCas, //SPnew tut\n\t\t\t\t\t\tDBpediaResource.class, sentenceAnn);\n\t\t\t\tfor (DBpediaResource dbped : dbpeds){\n//\t\t\t\t\t\n//\t\t\t\t\tint dbStart = dbped\n//\t\t\t\t\t\t\t.getBegin();\n//\t\t\t\t\tint dbEnd = dbped.getEnd();\n\t\t\t\t\t// not found if dbpedia offsets are wrongly outside than sentences\n//\t\t\t\t\tSystem.out.println(\"DBPED SENT: \" + sentenceAnn.getBegin()+ \"-\" + sentenceAnn.getEnd() ); \n//\t\t\t\t\tString offsetDB = \"\" + dbStart + \"-\" + dbEnd;\n//\t\t\t\t\thds.labelToDBpediaLink.put(dbped.getLabel(), dbped.getUri());\n//\t\t\t\t\tSystem.out.println(\"NOW DBPED: \" + dbped.getLabel() + \"URI: \" + dbped.getUri() ); \n\t\t\t\t\thds.dbpediaSurfaceFormToDBpediaLink.put(dbped.getCoveredText(), dbped.getUri());\n//\t\t\t\t\tSystem.out.println(\"NOW DBPED: \" + dbped.getCoveredText() + \"URI: \" + dbped.getUri() ); \n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//SP Map offsets to lemma of opinion verb/noun; parser does not provide lemma\n\t\t\t\t for (CoreLabel token: sentence.get(TokensAnnotation.class)) {\n//\t\t\t\t\t System.out.println(\"LEMMA \" + token.lemma().toString());\n\t\t\t\t\t int beginTok = token.beginPosition();\n\t\t\t\t\t int endTok = token.endPosition();\n\t\t\t\t\t String offsets = \"\" + beginTok + \"-\" + endTok;\n\t\t\t\t\t hds.offsetToLemma.put(offsets, token.lemma().toString());\n\t\t\t\t\t \n\t\t\t\t\t \t if (opinion_verbs.contains(token.lemma().toString())){\n\t\t\t\t\t\t\t hds.offsetToLemmaOfOpinionVerb.put(offsets, token.lemma().toString());\n\t\t\t\t\t\t\t hds.OpinionExpression.add(offsets);\n\t\t\t\t\t\t\t hds.offsetToLemmaOfOpinionExpression.put(offsets, token.lemma().toString());\n\t\t\t\t\t\t\t \n//\t\t\t \t System.out.println(\"offsetToLemmaOfOpinionVerb \" + token.lemma().toString());\n\t\t\t\t\t \t }\n\t\t\t\t\t \t if (passive_opinion_verbs.contains(token.lemma().toString())){\n\t\t\t\t\t\t\t hds.offsetToLemmaOfPassiveOpinionVerb.put(offsets, token.lemma().toString());\n\t\t\t\t\t\t\t hds.OpinionExpression.add(offsets);\n\t\t\t\t\t\t\t hds.offsetToLemmaOfOpinionExpression.put(offsets, token.lemma().toString());\n//\t\t\t \t System.out.println(\"offsetToLemmaOfPassiveOpinionVerb \" + token.lemma().toString());\n\t\t\t\t\t \t }\n\n\t\t\t\t } \n\n\t\t\t//SPnew parser\n\t\t\tTree tree = sentence.get(TreeAnnotation.class);\n\t\t\tTreebankLanguagePack tlp = new PennTreebankLanguagePack();\n\t\t\tGrammaticalStructureFactory gsf = tlp.grammaticalStructureFactory();\n\t\t\tGrammaticalStructure gs = gsf.newGrammaticalStructure(tree);\n\t\t\tCollection<TypedDependency> td = gs.typedDependenciesCollapsed();\n\n\t\t\t \n//\t\t\tSystem.out.println(\"TYPEDdep\" + td);\n\t\t\t\n\t\t\tObject[] list = td.toArray();\n//\t\t\tSystem.out.println(list.length);\n\t\t\tTypedDependency typedDependency;\nDEPENDENCYSEARCH: for (Object object : list) {\n\t\t\ttypedDependency = (TypedDependency) object;\n//\t\t\tSystem.out.println(\"DEP \" + typedDependency.dep().toString()+ \n//\t\t\t\t\t\" GOV \" + typedDependency.gov().toString()+ \n//\t\t\t\" :: \"+ \" RELN \"+typedDependency.reln().toString());\n\t\t\tString pos = null;\n String[] elements;\n String verbCand = null;\n int beginVerbCand = -5;\n\t\t\tint endVerbCand = -5;\n\t\t\tString offsetVerbCand = null;\n\n if (compTag.contains(typedDependency.reln().toString())) {\n \tcontainsSubordinateConjunction = true;\n// \tSystem.out.println(\"subordConj \" + typedDependency.dep().toString().toLowerCase());\n }\n \n else if (subjTag.contains(typedDependency.reln().toString())){\n \thds.predicateToSubjectChainHead.clear();\n \thds.subjectToPredicateChainHead.clear();\n \t\n \tverbCand = typedDependency.gov().toString().toLowerCase();\n\t\t\t\tbeginVerbCand = typedDependency.gov().beginPosition();\n\t\t\t\tendVerbCand = typedDependency.gov().endPosition();\n\t\t\t\toffsetVerbCand = \"\" + beginVerbCand + \"-\" + endVerbCand;\n//\t\t\t\tSystem.out.println(\"VERBCand \" + verbCand + offsetVerbCand);\n//\t\t\t\tfor (HashMap.Entry<String, String> entry : hds.offsetToLemma.entrySet()) {\n//\t\t\t\t String key = entry.getKey();\n//\t\t\t\t Object value = entry.getValue();\n//\t\t\t\t System.out.println(\"OFFSET \" + key + \" LEMMA \" + value);\n//\t\t\t\t // FOR LOOP\n//\t\t\t\t}\n//\t\t\t\tif (hds.offsetToLemma.containsKey(offsetVerbCand)){\n//\t\t\t\t\tString verbCandLemma = hds.offsetToLemma.get(offsetVerbCand);\n//\t\t\t\t\tif (hds.objectEqui.contains(verbCandLemma) || hds.subjectEqui.contains(verbCandLemma)){\n//\t\t\t\t\t\tSystem.out.println(\"SUBJCHAIN BEGIN verbCand \" + verbCand);\n//\t\t\t\t\t\tstoreRelations(typedDependency, hds.predicateToSubjectChainHead, hds.subjectToPredicateChainHead, hds);\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t\tSystem.out.println(\"SUBJCHAINHEAD1\");\n\t\t\t\tstoreRelations(typedDependency, hds.predicateToSubjectChainHead, hds.subjectToPredicateChainHead, hds);\n//\t\t\t\tSystem.out.println(\"verbCand \" + verbCand);\n\t\t\t\t//hack for subj after obj said Zwickel (obj) on Monday morning (subj)\n\t\t\t\tif (language.equals(\"en\") \n\t\t\t\t\t\t&& hds.predicateToObject.containsKey(offsetVerbCand)\n\t\t\t\t\t\t){\n// \t\tSystem.out.println(\"CONTINUE DEP\");\n \t\tcontinue DEPENDENCYSEARCH;\n \t}\n\t\t\t\telse {\n\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfOpinionVerb,\n \t\t\thds);\n\t\t\t\t}\n }\n //Merkel is concerned\n else if (passSubjTag.contains(typedDependency.reln().toString())){\n \t//Merkel was reported\n \t//Merkel was concerned\n \t//Merkel was quoted\n \thds.predicateToSubjectChainHead.clear();\n \thds.subjectToPredicateChainHead.clear();\n \tverbCand = typedDependency.gov().toString().toLowerCase();\n\t\t\t\tbeginVerbCand = typedDependency.gov().beginPosition();\n\t\t\t\tendVerbCand = typedDependency.gov().endPosition();\n\t\t\t\toffsetVerbCand = \"\" + beginVerbCand + \"-\" + endVerbCand;\n//\t\t\t\tSystem.out.println(\"VERBCand \" + verbCand + offsetVerbCand);\n//\t\t\t\tif (hds.offsetToLemma.containsKey(offsetVerbCand)){\n//\t\t\t\t\tString verbCandLemma = hds.offsetToLemma.get(offsetVerbCand);\n////\t\t\t\t\tSystem.out.println(\"LEMMA verbCand \" + verbCandLemma);\n//\t\t\t\t\tif (hds.objectEqui.contains(verbCandLemma) || hds.subjectEqui.contains(verbCandLemma)){\n//\t\t\t\t\t\tSystem.out.println(\"SUBJCHAIN BEGIN verbCand \" + verbCand);\n//\t\t\t\t\t\tstoreRelations(typedDependency, hds.predicateToSubjectChainHead, hds.subjectToPredicateChainHead, hds);\n//\t\t\t\t\t}\n//\t\t\t\t}\n \t\n \tstoreRelations(typedDependency, hds.predicateToSubjectChainHead, hds.subjectToPredicateChainHead, hds);\n// \tSystem.out.println(\"SUBJCHAINHEAD2\");\n \t//Merkel is concerned\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfPassiveOpinionVerb,\n \t\t\thds);\n }\n //Meanwhile, the ECB's vice-president, Christian Noyer, was reported at the start of the week to have said that the bank's future interest-rate moves\n// would depend on the behavior of wage negotiators as well as the pace of the economic recovery.\n\n else if (apposTag.contains(typedDependency.reln().toString())){\n \t\n \tString subjCand = typedDependency.gov().toString().toLowerCase();\n \tint beginSubjCand = typedDependency.gov().beginPosition();\n \tint endSubjCand = typedDependency.gov().endPosition();\n \tString offsetSubjCand = \"\" + beginSubjCand + \"-\" + endSubjCand;\n \tString appo = typedDependency.dep().toString().toLowerCase();\n\t\t\t\tint beginAppo = typedDependency.dep().beginPosition();\n\t\t\t\tint endAppo = typedDependency.dep().endPosition();\n\t\t\t\tString offsetAppo = \"\" + beginAppo + \"-\" + endAppo;\n\t\t\t\t\n// \tSystem.out.println(\"APPOSITION1 \" + subjCand + \"::\"+ appo + \":\" + offsetSubjCand + \" \" + offsetAppo);\n \thds.subjectToApposition.put(offsetSubjCand, offsetAppo);\n }\n else if (relclauseTag.contains(typedDependency.reln().toString())){\n \tString subjCand = typedDependency.gov().toString().toLowerCase();\n \tint beginSubjCand = typedDependency.gov().beginPosition();\n \tint endSubjCand = typedDependency.gov().endPosition();\n \tString offsetSubjCand = \"\" + beginSubjCand + \"-\" + endSubjCand;\n \tverbCand = typedDependency.dep().toString().toLowerCase();\n\t\t\t\tbeginVerbCand = typedDependency.dep().beginPosition();\n\t\t\t\tendVerbCand = typedDependency.dep().endPosition();\n\t\t\t\toffsetVerbCand = \"\" + beginVerbCand + \"-\" + endVerbCand;\n\t\t\t\tString subjCandPos = null;\n\t\t\t\tif (hds.predicateToSubject.containsKey(offsetVerbCand)){\n\t\t\t\t\t\n\t\t\t\t\tif (subjCand.matches(\".+?/.+?\")) { \n\t\t\t\t\t\telements = subjCand.split(\"/\");\n\t\t\t\t\t\tsubjCand = elements[0];\n\t\t\t\t\t\tsubjCandPos = elements[1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\tString del = hds.predicateToSubject.get(offsetVerbCand);\n\t\t\t\t\thds.predicateToSubject.remove(offsetVerbCand);\n\t\t\t\t\thds.subjectToPredicate.remove(del);\n\t\t\t\t\thds.normalPredicateToSubject.remove(offsetVerbCand);\n\t\t\t\t\thds.subjectToNormalPredicate.remove(del);\n//\t\t\t\t\tSystem.out.println(\"REMOVE RELPRO \" + verbCand + \"/\" + hds.offsetToLemma.get(del));\n\t\t\t\t\thds.predicateToSubject.put(offsetVerbCand, offsetSubjCand);\n\t\t\t\t\thds.subjectToPredicate.put( offsetSubjCand, offsetVerbCand);\n\t\t\t\t\thds.normalPredicateToSubject.put(offsetVerbCand, offsetSubjCand);\n\t\t\t\t\thds.subjectToNormalPredicate.put( offsetSubjCand, offsetVerbCand);\n//\t\t\t\t\tSystem.out.println(\"RELCLAUSE \" + subjCand + \"::\" + \":\" + verbCand);\n\t\t\t\t\thds.offsetToSubjectHead.put(offsetSubjCand,subjCand);\n\t\t\t\t\thds.SubjectHead.add(offsetSubjCand);\n\t\t\t\t\t\n\t\t\t\t\tif (subjCandPos != null && hds.pronTag.contains(subjCandPos)){\n\t\t\t\t\t\thds.PronominalSubject.add(offsetSubjCand);\n\t\t\t\t\t}\n\t\t\t\t}\n \t\n \t\n }\n \n else if (dirObjTag.contains(typedDependency.reln().toString())\n \t\t){\n \tstoreRelations(typedDependency, hds.predicateToObject, hds.ObjectToPredicate, hds);\n \tverbCand = typedDependency.gov().toString().toLowerCase();\n\t\t\t\tbeginVerbCand = typedDependency.gov().beginPosition();\n\t\t\t\tendVerbCand = typedDependency.gov().endPosition();\n\t\t\t\toffsetVerbCand = \"\" + beginVerbCand + \"-\" + endVerbCand;\n\t\t\t\t\n\t\t\t\tString objCand = typedDependency.dep().toString().toLowerCase();\n \tint beginObjCand = typedDependency.dep().beginPosition();\n \tint endObjCand = typedDependency.dep().endPosition();\n \tString offsetObjCand = \"\" + beginObjCand + \"-\" + endObjCand;\n \tString objCandPos;\n \tif (objCand.matches(\".+?/.+?\")) { \n\t\t\t\t\telements = objCand.split(\"/\");\n\t\t\t\t\tobjCand = elements[0];\n\t\t\t\t\tobjCandPos = elements[1];\n//\t\t\t\t\tSystem.out.println(\"PRON OBJ \" + objCandPos);\n\t\t\t\t\tif (pronTag.contains(objCandPos)){\n\t\t\t\t\thds.PronominalSubject.add(offsetObjCand);\n\t\t\t\t\t}\n\t\t\t\t\t}\n// \tSystem.out.println(\"DIROBJ STORE ONLY\");\n \t//told Obama\n \t//said IG metall boss Klaus Zwickel\n \t// problem: pointing DO\n \t//explains David Gems, pointing out the genetically manipulated species.\n \t if (language.equals(\"en\") \n \t\t\t\t\t\t&& !hds.normalPredicateToSubject.containsKey(offsetVerbCand)\n \t\t\t\t\t\t){\n// \t\t System.out.println(\"INVERSE SUBJ HACK ENGLISH PREDTOOBJ\");\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfOpinionVerb,\n \t\t\thds);\n \t }\n }\n //was reported to have said\n else if (infVerbTag.contains(typedDependency.reln().toString())){\n \tstoreRelations(typedDependency, hds.mainToInfinitiveVerb, hds.infinitiveToMainVerb, hds);\n// \tSystem.out.println(\"MAIN-INF\");\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfOpinionVerb,\n \t\t\thds);\n \t\n }\n else if (aclauseTag.contains(typedDependency.reln().toString())){\n \tstoreRelations(typedDependency, hds.nounToInfinitiveVerb, hds.infinitiveVerbToNoun, hds);\n// \tSystem.out.println(\"NOUN-INF\");\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfOpinionVerb,\n \t\t\thds);\n \t\n }\n \n \n\n\t\t\t}\n\t\t\t\n//\t\t\tSemanticGraph dependencies = sentence.get(CollapsedCCProcessedDependenciesAnnotation.class);\n//\t\t\tSystem.out.println(\"SEM-DEP \" + dependencies);\t\n\t\t}\n\t\t\n\n\t\tMap<Integer, edu.stanford.nlp.dcoref.CorefChain> corefChains = document.get(CorefChainAnnotation.class);\n\t\t \n\t\t if (corefChains == null) { return; }\n\t\t //SPCOPY\n\t\t for (Entry<Integer, edu.stanford.nlp.dcoref.CorefChain> entry: corefChains.entrySet()) {\n//\t\t System.out.println(\"Chain \" + entry.getKey() + \" \");\n\t\t \tint chain = entry.getKey();\n\t\t String repMenNer = null;\n\t\t String repMen = null;\n\t\t String offsetRepMenNer = null;\n\n\t\t List<IaiCorefAnnotation> listCorefAnnotation = new ArrayList<IaiCorefAnnotation>();\n\t\t \n\t\t for (CorefMention m : entry.getValue().getMentionsInTextualOrder()) {\n\t\t \tboolean corefMentionContainsNer = false;\n\t\t \tboolean repMenContainsNer = false;\n\n//\t\t \n\n\t\t\t\t// We need to subtract one since the indices count from 1 but the Lists start from 0\n\t\t \tList<CoreLabel> tokens = sentences.get(m.sentNum - 1).get(TokensAnnotation.class);\n\t\t // We subtract two for end: one for 0-based indexing, and one because we want last token of mention not one following.\n//\t\t System.out.println(\" \" + m + \", i.e., 0-based character offsets [\" + tokens.get(m.startIndex - 1).beginPosition() +\n//\t\t \", \" + tokens.get(m.endIndex - 2).endPosition() + \")\");\n\t\t \n\t\t int beginCoref = tokens.get(m.startIndex - 1).beginPosition();\n\t\t\t\t int endCoref = tokens.get(m.endIndex - 2).endPosition();\n\t\t\t\t String offsetCorefMention = \"\" + beginCoref + \"-\" + endCoref;\n\t\t\t\t String corefMention = m.mentionSpan;\n\n\t\t\t\t CorefMention RepresentativeMention = entry.getValue().getRepresentativeMention();\n\t\t\t\t repMen = RepresentativeMention.mentionSpan;\n\t\t\t\t List<CoreLabel> repMenTokens = sentences.get(RepresentativeMention.sentNum - 1).get(TokensAnnotation.class);\n//\t\t\t\t System.out.println(\"REPMEN ANNO \" + \"\\\"\" + repMen + \"\\\"\" + \" is representative mention\" +\n// \", i.e., 0-based character offsets [\" + repMenTokens.get(RepresentativeMention.startIndex - 1).beginPosition() +\n//\t\t \", \" + repMenTokens.get(RepresentativeMention.endIndex - 2).endPosition() + \")\");\n\t\t\t\t int beginRepMen = repMenTokens.get(RepresentativeMention.startIndex - 1).beginPosition();\n\t\t\t\t int endRepMen = repMenTokens.get(RepresentativeMention.endIndex - 2).endPosition();\n\t\t\t\t String offsetRepMen = \"\" + beginRepMen + \"-\" + endRepMen;\n\t\t \t \n\t\t\t\t//Determine repMenNer that consists of largest NER (Merkel) to (Angela Merkel)\n\t\t\t\t //and \"Chancellor \"Angela Merkel\" to \"Angela Merkel\"\n\t\t \t //Further reduction to NER as in \"Chancellor Angela Merkel\" to \"Angela Merkel\" is\n\t\t\t\t //done in determineBestSubject. There, Chunk information and subjectHead info is available.\n\t\t\t\t //Chunk info and subjectHead info is used to distinguish \"Chancellor Angela Merkel\" to \"Angela Merkel\"\n\t\t\t\t //from \"The enemies of Angela Merkel\" which is not reduced to \"Angela Merkel\"\n\t\t\t\t //Problem solved: The corefMentions of a particular chain do not necessarily have the same RepMenNer (RepMen) \n\t\t\t\t // any more: Chancellor Angela Merkel repMenNer Chancellor Angela Merkel , then Angela Merkel has RepMenNer Angela Merkel\n\t\t\t\t if (offsetRepMenNer != null && hds.Ner.contains(offsetRepMenNer)){\n//\t\t\t\t\t System.out.println(\"NEWNer.contains(offsetRepMenNer)\");\n\t\t\t\t }\n\t\t\t\t else if (offsetRepMen != null && hds.Ner.contains(offsetRepMen)){\n\t\t\t\t\t repMenNer = repMen;\n\t\t\t\t\t\toffsetRepMenNer = offsetRepMen;\n//\t\t\t\t\t\tSystem.out.println(\"NEWNer.contains(offsetRepMen)\");\n\t\t\t\t }\n\t\t\t\t else if (offsetCorefMention != null && hds.Ner.contains(offsetCorefMention)){\n\t\t\t\t\t\trepMenNer = corefMention;\n\t\t\t\t\t\toffsetRepMenNer = offsetCorefMention;\n//\t\t\t\t\t\tSystem.out.println(\"Ner.contains(offsetCorefMention)\");\n\t\t\t\t\t}\n\t\t\t\t else {\n\t\t\t\t\t corefMentionContainsNer = offsetsContainAnnotation(offsetCorefMention,hds.Ner);\n\t\t\t\t\t repMenContainsNer = offsetsContainAnnotation(offsetRepMen,hds.Ner);\n//\t\t\t\t\t System.out.println(\"ELSE Ner.contains(offsetCorefMention)\");\n\t\t\t\t }\n\t\t\t\t //Determine repMenNer that contains NER\n\t\t\t\t\tif (repMenNer == null){\n\t\t\t\t\t\tif (corefMentionContainsNer){\n\t\t\t\t\t\t\trepMenNer = corefMention;\n\t\t\t\t\t\t\toffsetRepMenNer = offsetCorefMention;\n//\t\t\t\t\t\t\tSystem.out.println(\"DEFAULT1\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (repMenContainsNer){\n\t\t\t\t\t\t\trepMenNer = repMen;\n\t\t\t\t\t\t\toffsetRepMenNer = offsetRepMen;\n//\t\t\t\t\t\t\tSystem.out.println(\"DEFAULT2\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//no NER:\n\t\t\t\t\t\t//Pronoun -> repMen is repMenNer\n\t\t\t\t\t\telse if (hds.PronominalSubject.contains(offsetCorefMention) && repMen != null){\n\t\t\t\t\t\t\trepMenNer = repMen;\n\t\t\t\t\t\t\toffsetRepMenNer = offsetRepMen;\n//\t\t\t\t\t\t\tSystem.out.println(\"DEFAULT3\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t//other no NER: corefMention is repMenNer because it is closer to original\n\t\t\t\t\t\trepMenNer = corefMention;\n\t\t\t\t\t\toffsetRepMenNer = offsetCorefMention;\n//\t\t\t\t\t\tSystem.out.println(\"DEFAULT4\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t \n \t IaiCorefAnnotation corefAnnotation = new IaiCorefAnnotation(aJCas);\n\t\t\t\n\t\t\t\t\t\n\n\n\t\t\t\t\tcorefAnnotation.setBegin(beginCoref);\n\t\t\t\t\tcorefAnnotation.setEnd(endCoref);\n\t\t\t\t\tcorefAnnotation.setCorefMention(corefMention);\n\t\t\t\t\tcorefAnnotation.setCorefChain(chain);\n\t\t\t\t\t//done below\n//\t\t\t\t\tcorefAnnotation.setRepresentativeMention(repMenNer);\n//\t\t\t\t\tcorefAnnotation.addToIndexes(); \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tlistCorefAnnotation.add(corefAnnotation);\n\t\t\t\t\t\n//\t\t\t\t\tdone below:\n//\t\t\t\t\t offsetToRepMen.put(offsetCorefMention, repMenNer);\n//\t\t\t\t\t RepMen.add(offsetCorefMention);\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t }//end coref mention\n//\t\t System.out.println(\"END Chain \" + chain );\n//\t\t System.out.println(listCorefAnnotation.size());\n\t\t String offsetCorefMention = null;\n\t\t for (int i = 0; i < listCorefAnnotation.size(); i++) {\n\t\t \tIaiCorefAnnotation corefAnnotation = listCorefAnnotation.get(i);\n\t\t \tcorefAnnotation.setRepresentativeMention(repMenNer);\n\t\t \tcorefAnnotation.addToIndexes();\n\t\t \toffsetCorefMention = \"\" + corefAnnotation.getBegin() + \"-\" + corefAnnotation.getEnd();\n\t\t\t\t\thds.offsetToRepMen.put(offsetCorefMention, repMenNer);\n\t\t\t\t\thds.RepMen.add(offsetCorefMention);\n\t\t\t\t\t//COREF\n//\t\t\t\t\tSystem.out.println(\"Chain \" + corefAnnotation.getCorefChain());\n//\t\t\t\t\tSystem.out.println(\"corefMention \" + corefAnnotation.getCorefMention() + offsetCorefMention);\n//\t\t\t\t\tSystem.out.println(\"repMenNer \" + repMenNer);\n\t\t }\n\t\t } //end chains\n\n\n//\t\t System.out.println(\"NOW quote finder\");\n\n\n\t\t\n\t\t///* quote finder: begin find quote relation and quotee\n\t\t// direct quotes\n\t\t\n\t\t\n\t\tString quotee_left = null;\n\t\tString quotee_right = null; \n\t\t\n\t\tString representative_quotee_left = null;\n\t\tString representative_quotee_right = null; \n\t\t\n\t\tString quote_relation_left = null;\n\t\tString quote_relation_right = null;\n\t\t\n\t\tString quoteType = null;\n\t\tint quoteeReliability = 5;\n\t\tint quoteeReliability_left = 5;\n\t\tint quoteeReliability_right = 5;\n\t\tint quotee_end = -5;\n\t\tint quotee_begin = -5;\n\t\t\n\t\tboolean quoteeBeforeQuote = false;\n\n\n\t\n\t\t\n\t\t// these are all the quotes in this document\n\t\tList<CoreMap> quotes = document.get(QuotationsAnnotation.class);\n\t\tfor (CoreMap quote : quotes) {\n\t\t\tif (quote.get(TokensAnnotation.class).size() > 5) {\n\t\t\t\tQuoteAnnotation annotation = new QuoteAnnotation(aJCas);\n\n\t\t\t\tint beginQuote = quote.get(TokensAnnotation.class).get(0)\n\t\t\t\t\t\t.beginPosition();\n\t\t\t\tint endQuote = quote.get(TokensAnnotation.class)\n\t\t\t\t\t\t.get(quote.get(TokensAnnotation.class).size() - 1)\n\t\t\t\t\t\t.endPosition();\n\t\t\t\tannotation.setBegin(beginQuote);\n\t\t\t\tannotation.setEnd(endQuote);\n\t\t\t\tannotation.addToIndexes();\n//\t\t\t}\n//\t\t}\n//\t\t\n//\t\tList<Q> newQuotes = document.get(QuotationsAnnotation.class);\t\t\n//\t\tfor (CoreMap annotation : newQuotes) {\n//\t\t\t\tif (1==1){\n//\t\t\t\tRe-initialize markup variables since they are also used for indirect quotes\n\t\t\t\tquotee_left = null;\n\t\t\t\tquotee_right = null; \n\t\t\t\t\n\t\t\t\trepresentative_quotee_left = null;\n\t\t\t\trepresentative_quotee_right = null;\n\t\t\t\t\n\t\t\t\tquote_relation_left = null;\n\t\t\t\tquote_relation_right = null;\n\t\t\t\tquoteeReliability = 5;\n\t\t\t\tquoteeReliability_left = 5;\n\t\t\t\tquoteeReliability_right = 5;\n\t\t\t\tquotee_end = -5;\n\t\t\t\tquotee_begin = -5;\n\t\t\t\tquoteType = \"direct\";\n\t\t\t\tquoteeBeforeQuote = false;\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tList<Token> directQuoteTokens = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\tToken.class, annotation);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tList<Token> followTokens = JCasUtil.selectFollowing(aJCas,\n\t\t\t\t\t\tToken.class, annotation, 1);\n\t\t\t\t\n \n//\t\t\t\tfor (Token aFollowToken: followTokens){\n//\t\t\t\t\t List<Chunk> chunks = JCasUtil.selectCovering(aJCas,\n//\t\t\t\t\tChunk.class, aFollowToken);\n \n//direct quote quotee right:\n\t\t\t\t\n\t for (Token aFollow2Token: followTokens){\n\t\t\t\t\t List<SentenceAnnotation> sentencesFollowQuote = JCasUtil.selectCovering(aJCas,\n\t\t\t\t\t\t\t SentenceAnnotation.class, aFollow2Token);\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t for (SentenceAnnotation sentenceFollowsQuote: sentencesFollowQuote){\n\t\t\t\t\t\t List<Chunk> chunks = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\tChunk.class, sentenceFollowsQuote);\n//\t\t\tSystem.out.println(\"DIRECT QUOTE RIGHT\");\n\t\t\tString[] quote_annotation_result = determine_quotee_and_quote_relation(\"RIGHT\", \n\t\t\t\t\tchunks, hds, annotation);\n\t\t\tif (quote_annotation_result.length>=4){\n\t\t\t quotee_right = quote_annotation_result[0];\n\t\t\t representative_quotee_right = quote_annotation_result[1];\n\t\t\t quote_relation_right = quote_annotation_result[2];\n\t\t\t try {\n\t\t\t\t quoteeReliability = Integer.parseInt(quote_annotation_result[3]);\n\t\t\t\t quoteeReliability_right = Integer.parseInt(quote_annotation_result[3]);\n\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t //Will Throw exception!\n\t\t\t //do something! anything to handle the exception.\n\t\t\t\tquoteeReliability = -5;\n\t\t\t\tquoteeReliability_right = -5;\n\t\t\t\t}\t\t\t\t\t \n\t\t\t }\n//\t\t\tSystem.out.println(\"DIRECT QUOTE RIGHT RESULT quotee \" + quotee_right + \" representative_quotee \" + representative_quotee_right\n//\t\t\t\t\t+ \" quote_relation \" + quote_relation_right);\n\t\t \n\t\t\t}\n\t\t\t\t\t \n\t\t\t\t\t \n }\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tList<Token> precedingTokens = JCasUtil.selectPreceding(aJCas,\n\t\t\t\t\t\tToken.class, annotation, 1);\n for (Token aPrecedingToken: precedingTokens){ \n \t\n \tif (directQuoteIntro.contains(aPrecedingToken.getLemma().getValue().toString()) \n \t\t\t|| compLemma.contains(aPrecedingToken.getLemma().getValue().toString())) {\n// \t\tSystem.out.println(\"Hello, World lemma found\" + aPrecedingToken.getLemma().getValue());\n \t\tquoteeBeforeQuote = true;\n \t}\n \t\tList <NamedEntity> namedEntities = null;\n \t\tList <Token> tokens = null;\n \t\tList<Chunk> chunks = null;\n \t\t\n\t\t\t\t List<Sentence> precedingSentences = JCasUtil.selectPreceding(aJCas,\n\t\t\t\t \t\tSentence.class, aPrecedingToken, 1);\n\t\t\t\t \n\t\t\t\t\t\tif (precedingSentences.isEmpty()){\n\t\t\t\t\t\t\tList<Sentence> firstSentence;\n\t\t\t\t \tfirstSentence = JCasUtil.selectCovering(aJCas,\n\t\t\t\t \t\tSentence.class, aPrecedingToken);\n\n\t\t\t\t \tfor (Sentence aSentence: firstSentence){\n\t\t\t\t \t\t\n\n\t\t\t\t\t\t\t\tchunks = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\t\t\t\tChunk.class, aSentence.getBegin(), aPrecedingToken.getEnd());\n\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t \t\tnamedEntities = JCasUtil.selectCovered(aJCas,\n\t \t \t\tNamedEntity.class, aSentence.getBegin(), aPrecedingToken.getEnd());\n\t\t\t\t \t\ttokens = JCasUtil.selectCovered(aJCas,\n\t\t\t\t \t\t\t\tToken.class, aSentence.getBegin(), aPrecedingToken.getEnd());\n\t\t\t\t \t\n\t\t\t\t \t}\n\t\t\t\t\t\t}\n\t\t\t\t else {\t\n\t\t\t\t \tfor (Sentence aSentence: precedingSentences){\n//\t\t\t\t \t\tSystem.out.println(\"Hello, World sentence\" + aSentence);\n\t\t\t\t \t\tchunks = JCasUtil.selectBetween(aJCas,\n\t\t\t\t \t\t\t\tChunk.class, aSentence, aPrecedingToken);\n\t\t\t\t \t\tnamedEntities = JCasUtil.selectBetween(aJCas,\n\t\t\t\t \t\t\t\tNamedEntity.class, aSentence, aPrecedingToken);\n\t\t\t\t \t\ttokens = JCasUtil.selectBetween(aJCas,\n\t\t\t\t \t\t\t\tToken.class, aSentence, aPrecedingToken);\n\t\t\t\t \t}\n\t\t\t\t }\n \t\n//\t\t\t\t \n//\t\t\t\t\t\tSystem.out.println(\"DIRECT QUOTE LEFT\");\n\t\t\t\t\t\tString[] quote_annotation_direct_left = determine_quotee_and_quote_relation(\"LEFT\", chunks,\n\t\t\t\t\t\t\t\t hds, annotation\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t );\n//\t\t\t\t\t\tSystem.out.println(\"QUOTE ANNOTATION \" + quote_annotation_direct_left.length);\t\t\n\t\tif (quote_annotation_direct_left.length>=4){\n//\t\t\tSystem.out.println(\"QUOTE ANNOTATION UPDATE \" + quote_annotation_direct_left[0] +\n//\t\t\t\t\t\" \" + quote_annotation_direct_left[1] + \" \" +\n//\t\t\t\t\tquote_annotation_direct_left[2]);\n\t\t quotee_left = quote_annotation_direct_left[0];\n\t\t representative_quotee_left = quote_annotation_direct_left[1];\n\t\t quote_relation_left = quote_annotation_direct_left[2];\n\t\t try {\n\t\t\t quoteeReliability = Integer.parseInt(quote_annotation_direct_left[3]);\n\t\t\t quoteeReliability_left = Integer.parseInt(quote_annotation_direct_left[3]);\n\t\t\t} catch (NumberFormatException e) {\n\t\t //Will Throw exception!\n\t\t //do something! anything to handle the exception.\n\t\t\tquoteeReliability = -5;\n\t\t\tquoteeReliability_left = -5;\n\t\t\t}\t\t\t\t\t \n\t\t }\n//\t\tSystem.out.println(\"DIRECT QUOTE LEFT RESULT quotee \" + quotee_left + \" representative_quotee \" + representative_quotee_left\n//\t\t\t\t+ \" quote_relation \" + quote_relation_left);\n\t\t//no subject - predicate quotee quote_relation, quote introduced with colon: \n\t\tif (quotee_left == null && quote_relation_left == null && representative_quotee_left == null \n\t\t&& directQuoteIntro.contains(aPrecedingToken.getLemma().getValue().toString())){\n//\t\t\tSystem.out.println(\"NER DIRECT QUOTE LEFT COLON\");\n\t\t\tString quoteeCandOffset = null; \n\t\t\tString quoteeCandText = null;\n\t\t if (namedEntities.size() == 1){\n \t \tfor (NamedEntity ne : namedEntities){\n// \t \t\tSystem.out.println(\"ONE NER \" + ne.getCoveredText());\n \t \t\tquoteeCandText = ne.getCoveredText();\n\t\t\t\t\tquote_relation_left = aPrecedingToken.getLemma().getValue().toString();\n\t\t\t\t\tquotee_end = ne.getEnd();\n\t\t\t\t\tquotee_begin = ne.getBegin();\n\t\t\t\t\tquoteeCandOffset = \"\" + quotee_begin + \"-\" + quotee_end;\n\t\t\t\t\tquoteeReliability = 1;\n\t\t\t\t\tquoteeReliability_left = 1;\n \t }\n \t }\n \t else if (namedEntities.size() > 1) {\n \t \tint count = 0;\n \t \tString quotee_cand = null;\n// \t \tSystem.out.println(\"Hello, World ELSE SEVERAL NER\");\n \t \tfor (NamedEntity ner : namedEntities){\n// \t \t\tSystem.out.println(\"Hello, World NER TYPE\" + ner.getValue());\n \t \t\tif (ner.getValue().equals(\"PERSON\")){\n \t \t\t\tcount = count + 1;\n \t \t\t\tquotee_cand = ner.getCoveredText();\n \t \t\t\tquotee_end = ner.getEnd();\n \t \t\t\tquotee_begin = ner.getBegin();\n \t \t\t\tquoteeCandOffset = \"\" + quotee_begin + \"-\" + quotee_end;\n \t \t\t\t\n// \t \t\t\tSystem.out.println(\"Hello, World FOUND PERSON\" + quotee_cand);\n \t \t\t}\n \t \t}\n \t \tif (count == 1){ // there is exactly one NER.PERSON\n// \t \t\tSystem.out.println(\"ONE PERSON, SEVERAL NER \" + quotee_cand);\n \t \t\t\tquoteeCandText = quotee_cand;\n\t\t\t\t\t\tquote_relation_left = aPrecedingToken.getLemma().getValue().toString();\n\t\t\t\t\t\tquoteeReliability = 3;\n\t\t\t\t\t\tquoteeReliability_left = 3;\n \t \t}\n \t }\n\t\t if(quoteeCandOffset != null && quoteeCandText != null ){\n//\t\t \t quotee_left = quoteeCandText;\n\t\t \t String result [] = determineBestRepMenSubject(\n\t\t \t\t\t quoteeCandOffset,quoteeCandOffset, quoteeCandText, hds);\n\t\t \t if (result.length>=2){\n\t\t \t\t quotee_left = result [0];\n\t\t \t\t representative_quotee_left = result [1];\n//\t\t \t System.out.println(\"RESULT2 NER quotee \" + quotee_left + \" representative_quotee \" + representative_quotee_left);\n\t\t \t }\n\t\t }\n\t\t}\n }\n\t\t\n \n\n\t\t\t\t\n\t\t\t\tif (quotee_left != null && quotee_right != null){\n//\t\t\t\t\tSystem.out.println(\"TWO QUOTEES\");\n\t\t\t\t\t\n\t\t\t\t\tif (directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\".\") \n\t\t\t\t\t\t|| \tdirectQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\"!\")\n\t\t\t\t\t\t|| directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\"?\")\n\t\t\t\t\t\t\t){\n//\t\t\t\t\t\tSystem.out.println(\"PUNCT \" + quotee_left + quote_relation_left + quoteeReliability_left);\n\t\t\t\t\t\tannotation.setQuotee(quotee_left);\n\t\t\t\t\t\tannotation.setQuoteRelation(quote_relation_left);\n\t\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_left);\n\t\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_left);\n\n\t\t\t\t\t}\n\t\t\t\t\telse if (directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\",\")){\n//\t\t\t\t\t\tSystem.out.println(\"COMMA \" + quotee_right + \" \" + quote_relation_right + \" \" + quoteeReliability_right);\n\t\t\t\t\t\tannotation.setQuotee(quotee_right);\n\t\t\t\t\t\tannotation.setQuoteRelation(quote_relation_right);\n\t\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_right);\n\t\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_right);\n\t\t\t\t\t}\n\t\t\t\t\telse if (!directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\".\")\n\t\t\t\t\t\t\t&& !directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\"!\")\n\t\t\t\t\t\t\t&& !directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\"?\")\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t){\n//\t\t\t\t\t\tSystem.out.println(\"NO PUNCT \" + quotee_right + \" \" + quote_relation_right + \" \" + quoteeReliability_right);\n\t\t\t\t\t\tannotation.setQuotee(quotee_right);\n\t\t\t\t\t\tannotation.setQuoteRelation(quote_relation_right);\n\t\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_right);\n\t\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_right);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n//\t\t\t\t\t\tSystem.out.println(\"UNCLEAR LEFT RIGHT \" + quotee_left + quote_relation_left + quote + quotee_right + quote_relation_right);\n\t\t\t\t\tannotation.setQuotee(\"<unclear>\");\n\t\t\t\t\tannotation.setQuoteRelation(\"<unclear>\");\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (quoteeBeforeQuote == true){\n\t\t\t\t\tannotation.setQuotee(quotee_left);\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_left);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_left);\n\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_left);\n\t\t\t\t}\n\t\t\t\telse if (quotee_left != null){\n//\t\t\t\t\tSystem.out.println(\"QUOTEE LEFT\" + quotee_left + quote_relation_left + quoteeReliability_left);\n\t\t\t\t\tannotation.setQuotee(quotee_left);\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_left);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_left);\n\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_left);\n\t\t\t\t}\n\t\t\t\telse if (quotee_right != null){\n//\t\t\t\t\tSystem.out.println(\"QUOTEE RIGHT FOUND\" + quotee_right + \" QUOTE RELATION \" + quote_relation_right + \":\" + quoteeReliability_right);\n\t\t\t\t\tannotation.setQuotee(quotee_right);\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_right);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_right);\n\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_right);\n\t\t\t\t}\n\t\t\t\telse if (quote_relation_left != null ){\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_left);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n//\t\t\t\t\tSystem.out.println(\"NO QUOTEE FOUND\" + quote + quote_relation_left + quote_relation_right);\n\t\t\t\t}\n\t\t\t\telse if (quote_relation_right != null){\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_right);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t}\n\t\t\t\telse if (quoteType != null){\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n//\t\t\t\t\tSystem.out.println(\"Hello, World NO QUOTEE and NO QUOTE RELATION FOUND\" + quote);\n\t\t\t\t}\n\t\t\t\tif (annotation.getRepresentativeQuoteeMention() != null){\n//\t\t\t\t\tSystem.out.println(\"NOW!!\" + annotation.getRepresentativeQuoteeMention());\n\t\t\t\t\tif (hds.dbpediaSurfaceFormToDBpediaLink.containsKey(annotation.getRepresentativeQuoteeMention())){\n\t\t\t\t\t\tannotation.setQuoteeDBpediaUri(hds.dbpediaSurfaceFormToDBpediaLink.get(annotation.getRepresentativeQuoteeMention()));\n//\t\t\t\t\t\tSystem.out.println(\"DBPRED FOUND\" + annotation.getRepresentativeQuoteeMention() + \" URI: \" + annotation.getQuoteeDBpediaUri());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t} //for direct quote\n\t\t\n\t\t// annotate indirect quotes: opinion verb + 'that' ... until end of sentence: said that ...\n\n//\t\tList<CoreMap> sentences = document.get(SentencesAnnotation.class); //already instantiated above\nINDIRECTQUOTE:\t\tfor (CoreMap sentence : sentences) {\n//\t\t\tif (sentence.get(TokensAnnotation.class).size() > 5) { \n\t\t\t\tSentenceAnnotation sentenceAnn = new SentenceAnnotation(aJCas);\n\t\t\t\t\n\t\t\t\tint beginSentence = sentence.get(TokensAnnotation.class).get(0)\n\t\t\t\t\t\t.beginPosition();\n\t\t\t\tint endSentence = sentence.get(TokensAnnotation.class)\n\t\t\t\t\t\t.get(sentence.get(TokensAnnotation.class).size() - 1)\n\t\t\t\t\t\t.endPosition();\n\t\t\t\tsentenceAnn.setBegin(beginSentence);\n\t\t\t\tsentenceAnn.setEnd(endSentence);\n//\t\t\t\tsentenceAnn.addToIndexes();\n\t\t\t\t\n\t\t\t\tQuoteAnnotation indirectQuote = new QuoteAnnotation(aJCas);\n\t \tint indirectQuoteBegin = -5;\n\t\t\t\tint indirectQuoteEnd = -5;\n\t\t\t\tboolean subsequentDirectQuoteInstance = false;\n\t\t\t\t\n\t\t\t\tList<Chunk> chunksIQ = JCasUtil.selectCovered(aJCas,\n\t\t\t\tChunk.class, sentenceAnn);\n\t\t\t\tList<Chunk> chunksBeforeIndirectQuote = null;\n\t\t\t\t\n\t\t\t\tint index = 0;\nINDIRECTCHUNK:\tfor (Chunk aChunk : chunksIQ) {\n\t\t\t\t\tindex++;\n\t\t\t\t\t\n//\t\t\t\t\tSystem.out.println(\"INDIRECT QUOTE CHUNK VALUE \" + aChunk.getChunkValue().toString());\n//\t\t\t\t\tif (aChunk.getChunkValue().equals(\"SBAR\")) {\n\t\t\t\t\tif(indirectQuoteIntroChunkValue.contains(aChunk.getChunkValue())){\n//\t\t\t\t\t\tSystem.out.println(\"INDIRECT QUOTE INDEX \" + \"\" + index);\n\t\t\t\t\t\t\n\t\t\t\t\t\tList<Token> tokensSbar = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\t\t\tToken.class, aChunk);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor (Token aTokenSbar : tokensSbar){\n//\t\t\t\t\t\t\tString that = \"that\";\n\t\t\t\t\t\t\tif (compLemma.contains(aTokenSbar.getLemma().getCoveredText())){\n\t\t\t\t\t\t// VP test: does that clause contain VP?\n//\t\t\t\t\t\t\t\tSystem.out.println(\"TOK1\" + aTokenSbar.getLemma().getCoveredText());\n//\t\t\t \tQuoteAnnotation indirectQuote = new QuoteAnnotation(aJCas);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t indirectQuoteBegin = aChunk.getEnd() + 1;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t chunksBeforeIndirectQuote = chunksIQ.subList(0, index-1);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//NEW\n//\t\t\t\t\t\t\t\tif (LANGUAGE == \"en\")\n\t\t\t\t\t\t\t\tList<Token> precedingSbarTokens = JCasUtil.selectPreceding(aJCas,\n\t\t\t\t\t\t\t\t\t\tToken.class, aChunk, 1);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tfor (Token aPrecedingSbarToken: precedingSbarTokens){ \n//\t\t\t\t\t\t\t\t\tSystem.out.println(\"TOK2\" + aPrecedingSbarToken.getLemma().getCoveredText());\n\t\t\t\t \tif (coordLemma.contains(aPrecedingSbarToken.getLemma().getValue().toString())){\n//\t\t\t\t \t\tSystem.out.println(\"TOKK\" + aPrecedingSbarToken.getLemma().getCoveredText());\n\t\t\t\t \t\tchunksBeforeIndirectQuote = chunksIQ.subList(0, index-1);\n\t\t\t\t \t\tint k = 0;\n\t\t\t\t \tSAY:\tfor (Chunk chunkBeforeAndThat : chunksBeforeIndirectQuote){\n//\t\t\t\t \t\t\txxxx\n\t\t\t\t \t\tk++;\n\t\t\t\t \t\t\tif (chunkBeforeAndThat.getChunkValue().equals(\"VP\")){\n\t\t\t\t \t\t\t\t\n\t\t\t\t \t\t\t\tList<Token> tokensInVp = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tToken.class, chunkBeforeAndThat);\n\t\t\t\t\t\t\t\t\t\t\t\tfor (Token aTokenInVp : tokensInVp){\n//\t\t\t\t\t\t\t\t\t\t\t\t\tString and;\n//\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"TOKK\" + aTokenInVp.getLemma().getCoveredText());\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (aTokenInVp.getLemma().getValue().equals(\"say\")){\n//\t\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"SAY OLD\" + indirectQuoteBegin + \":\" + sentenceAnn.getCoveredText());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tchunksBeforeIndirectQuote = chunksIQ.subList(0, k);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tindirectQuoteBegin = chunksBeforeIndirectQuote.get(chunksBeforeIndirectQuote.size()-1).getEnd()+1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"SAY NEW\" + indirectQuoteBegin + \":\" );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak SAY;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t \t\t\t\t\n\t\t\t\t \t\t\t\t\n\t\t\t\t \t\t\t}\n\t\t\t\t \t\t\t\n\t\t\t\t \t\t\t\n\t\t\t\t \t\t}\n\t\t\t\t \t\t\n\t\t\t\t \t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tList<QuoteAnnotation> coveringDirectQuoteChunk = JCasUtil.selectCovering(aJCas,\n\t\t\t\t\t\t\t\t\t\tQuoteAnnotation.class, aChunk);\n\t\t\t\t\t\t\t\tif (coveringDirectQuoteChunk.isEmpty()){\n//\t\t\t\t\t\t\t\t indirectQuoteBegin = aChunk.getEnd() + 1;\n\t\t\t\t\t\t\t\t indirectQuote.setBegin(indirectQuoteBegin);\n//\t\t\t\t\t\t\t\t chunksBeforeIndirectQuote = chunksIQ.subList(0, index-1);\n\t\t\t\t\t\t\t\t indirectQuoteEnd = sentenceAnn.getEnd();\n\t\t\t\t\t\t\t\t indirectQuote.setEnd(indirectQuoteEnd);\n\t\t\t\t\t\t\t\t indirectQuote.addToIndexes();\n\t\t\t\t\t\t\t\t subsequentDirectQuoteInstance = false;\n//\t\t\t\t\t\t\t\t System.out.println(\"SUBSEQUENT FALSE\");\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t List<Token> followTokens = JCasUtil.selectFollowing(aJCas,\n\t\t\t\t\t\t\t\t\t\t\tToken.class, indirectQuote, 1);\n\t\t\t\t\t\t\t\t for (Token aFollow3Token: followTokens){\n\t\t\t\t\t\t\t\t\t List<QuoteAnnotation> subsequentDirectQuotes = JCasUtil.selectCovering(aJCas,\n\t\t\t\t\t\t\t\t\t\t\tQuoteAnnotation.class,aFollow3Token);\n\t\t\t\t\t\t\t\t\t if (!subsequentDirectQuotes.isEmpty()){\n\t\t\t\t\t\t\t\t\t\t for (QuoteAnnotation subsequentDirectQuote: subsequentDirectQuotes){\n\t\t\t\t\t\t\t\t\t\t\t if (subsequentDirectQuote.getRepresentativeQuoteeMention() != null\n\t\t\t\t\t\t\t\t\t\t\t\t && subsequentDirectQuote.getRepresentativeQuoteeMention().equals(\"<unclear>\")){\n//\t\t\t\t\t\t\t\t\t\t\t System.out.println(\"SUBSEQUENT FOUND\"); \n\t\t\t\t\t\t\t\t\t\t\t hds.subsequentDirectQuote = subsequentDirectQuote;\n\t\t\t\t\t\t\t\t\t\t\t subsequentDirectQuoteInstance = true;\n\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t break INDIRECTCHUNK;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\n\t\t\t\t}\n\t\t\t\t\tif (indirectQuoteBegin >= 0 && indirectQuoteEnd >= 0){\n//\t\t\t\t\t\tList<QuoteAnnotation> coveringDirectQuote = JCasUtil.selectCovering(aJCas,\n//\t\t\t\t\t\t\t\tQuoteAnnotation.class, indirectQuote);\n//\t\t\t\t\t\tif (coveringDirectQuote.isEmpty()){\n////\t\t\t\t\t\t\t\n//\t\t\t\t\t\tindirectQuote.addToIndexes();\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\telse {\n//\t\t\t\t\t\t\t//indirect quote is covered by direct quote and therefore discarded\n//\t\t\t\t\t\t\tcontinue INDIRECTQUOTE;\n//\t\t\t\t\t\t}\n\t\t\t\t\tList<QuoteAnnotation> coveredDirectQuotes = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\t\t\tQuoteAnnotation.class, indirectQuote);\n\t\t\t\t\tfor (QuoteAnnotation coveredDirectQuote : coveredDirectQuotes){\n//\t\t\t\t\t\tSystem.out.println(\"Hello, World covered direct quote\" + coveredDirectQuote.getCoveredText());\n\t\t\t\t\t\t//delete coveredDirectQuoteIndex\n\t\t\t\t\t\tcoveredDirectQuote.removeFromIndexes();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t//no indirect quote in sentence\n\t\t\t\t\t\tcontinue INDIRECTQUOTE;\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n//\t\t\t\t\t\tRe-initialize markup variables since they are also used for direct quotes\n\t\t\t\t\t\tquotee_left = null;\n\t\t\t\t\t\tquotee_right = null; \n\t\t\t\t\t\t\n\t\t\t\t\t\trepresentative_quotee_left = null;\n\t\t\t\t\t\trepresentative_quotee_right = null;\n\t\t\t\t\t\t\n\t\t\t\t\t\tquote_relation_left = null;\n\t\t\t\t\t\tquote_relation_right = null;\n\t\t\t\t\t\t\n\t\t\t\t\t\tquoteType = \"indirect\";\n\t\t\t\t\t\tquoteeReliability = 5;\n\t\t\t\t\t\tquoteeReliability_left = 5;\n\t\t\t\t\t\tquoteeReliability_right = 5;\n\t\t\t\t\t\tquotee_end = -5;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\tif (chunksBeforeIndirectQuote != null){\n//\t\t\t\t\t\t\tSystem.out.println(\"chunksBeforeIndirectQuote FOUND!! \");\n\t\t\t\t\t\t\tString[] quote_annotation_result = determine_quotee_and_quote_relation(\"LEFT\", chunksBeforeIndirectQuote,\n\t\t\t\t\t\t\t\t\t hds, indirectQuote\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t );\n\t\t\tif (quote_annotation_result.length>=4){\n\t\t\t quotee_left = quote_annotation_result[0];\n\t\t\t representative_quotee_left = quote_annotation_result[1];\n\t\t\t quote_relation_left = quote_annotation_result[2];\n//\t\t\t System.out.println(\"INDIRECT QUOTE LEFT RESULT quotee \" + quotee_left + \" representative_quotee \" + representative_quotee_left\n//\t\t\t\t\t + \" QUOTE RELATION \" + quote_relation_left);\n\t\t\t try {\n\t\t\t\t quoteeReliability = Integer.parseInt(quote_annotation_result[3]);\n\t\t\t\t quoteeReliability_left = Integer.parseInt(quote_annotation_result[3]);\n\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\tquoteeReliability = -5;\n\t\t\t\tquoteeReliability_left = -5;\n\t\t\t\t}\t\t\t\t\t \n\t\t\t }\n\t\t\t\n\t\t\t}\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (quotee_left != null){\n\t\t\t\t\t\t\tindirectQuote.setQuotee(quotee_left);\n\t\t\t\t\t\t\tindirectQuote.setQuoteRelation(quote_relation_left);\n\t\t\t\t\t\t\tindirectQuote.setQuoteType(quoteType);\n\t\t\t\t\t\t\tindirectQuote.setQuoteeReliability(quoteeReliability_left);\n\t\t\t\t\t\t\tindirectQuote.setRepresentativeQuoteeMention(representative_quotee_left);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//indirect quote followed by direct quote:\n\t\t\t\t\t\t\t//the quotee and quote relation of the indirect quote are copied to the direct quote \n\t\t\t\t\t\t\t//Genetic researcher Otmar Wiestler hopes that the government's strict controls on genetic research \n\t\t\t\t\t\t\t//will be relaxed with the advent of the new ethics commission. \n\t\t\t\t\t\t\t//\"For one thing the government urgently needs advice, because of course it's such an extremely \n\t\t\t\t\t\t\t//complex field. And one of the reasons Chancellor Schröder formed this new commission was without \n\t\t\t\t\t\t\t//a doubt to create his own group of advisors.\"\n\n\t\t\t\t\t\t\tif (subsequentDirectQuoteInstance == true\n\t\t\t\t\t\t\t\t&&\thds.subsequentDirectQuote.getRepresentativeQuoteeMention().equals(\"<unclear>\")\n\t\t\t\t\t\t\t\t&& \thds.subsequentDirectQuote.getQuotee().equals(\"<unclear>\")\n\t\t\t\t\t\t\t\t&& \thds.subsequentDirectQuote.getQuoteRelation().equals(\"<unclear>\")\n\t\t\t\t\t\t\t\t\t){\n//\t\t\t\t\t\t\t\tSystem.out.println(\"SUBSEQUENT UNCLEAR DIR QUOTE FOUND!!\"); \n\t\t\t\t\t\t\t\tint begin = hds.subsequentDirectQuote.getBegin();\n\t\t\t\t\t\t\t\tint end = hds.subsequentDirectQuote.getEnd();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setQuotee(quotee_left);\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setQuoteRelation(quote_relation_left);\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setQuoteType(\"direct\");\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setQuoteeReliability(quoteeReliability_left + 2);\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setRepresentativeQuoteeMention(representative_quotee_left);\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.addToIndexes();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\tSystem.out.println(\"Hello, World INDIRECT QUOTE \" + quotee_left + quote_relation_left + quoteeReliability);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (quote_relation_left != null){\n\t\t\t\t\t\t\tindirectQuote.setQuoteRelation(quote_relation_left);\n\t\t\t\t\t\t\tindirectQuote.setQuoteType(quoteType);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\telse if (quoteType != null){\n\t\t\t\t\t\t\tindirectQuote.setQuoteType(quoteType);\n//\t\t\t\t\t\t\tSystem.out.println(\"Hello, World INDIRECT QUOTE NOT FOUND\" + quote_relation_left);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (indirectQuote.getRepresentativeQuoteeMention() != null){\n//\t\t\t\t\t\t\tSystem.out.println(\"NOW!!\" + indirectQuote.getRepresentativeQuoteeMention());\n\t\t\t\t\t\t\tif (hds.dbpediaSurfaceFormToDBpediaLink.containsKey(indirectQuote.getRepresentativeQuoteeMention())){\n\t\t\t\t\t\t\t\tindirectQuote.setQuoteeDBpediaUri(hds.dbpediaSurfaceFormToDBpediaLink.get(indirectQuote.getRepresentativeQuoteeMention()));\n//\t\t\t\t\t\t\t\tSystem.out.println(\"DBPEDIA \" + indirectQuote.getRepresentativeQuoteeMention() + \" URI: \" + hds.dbpediaSurfaceFormToDBpediaLink.get(indirectQuote.getRepresentativeQuoteeMention()));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n//\t\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t }\n//\t\t\t} //for chunk\n//\t\t\t\tsay without that\n//\t\t\t}\t\t\n\t\t} //Core map sentences indirect quotes\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "private Page<ElasticCandidate> search(CandidateSearchModel model, Pageable pageable){\n Integer experienceDuration = model.getSkillPlaceholder()\n .getExperienceDuration();\n String title = model.getSkillPlaceholder()\n .getSkill()\n .getTitle();\n RangeModel<Integer> rangeExperience = model.getSkillExperienceRange();\n Integer experienceUpperLimit = rangeExperience.getUpperLimit();\n Integer experienceLowerLimit = rangeExperience.getLowerLimit();\n\n // Prepares location\n String location = model.getLocation();\n\n // Prepare hourly rate\n Integer hourlyRate = model.getHourlyRate();\n RangeModel<Integer> rangeHourlyRate = model.getHourlyRateRange();\n Integer hourlyRateUpperLimit = rangeHourlyRate.getUpperLimit();\n Integer hourlyRateLowerLimit = rangeHourlyRate.getLowerLimit();\n\n // Prepares certifications\n Set<String> certifications = model.getCertifications();\n if (certifications != null && certifications.size() != 0) {\n Iterator iterator = certifications.iterator();\n String[] certificationsArray = new String[certifications.size()];\n for (int i = 0; i < certificationsArray.length; i++) {\n certificationsArray[i] = (String) iterator.next();\n }\n }\n\n // Prepares Starting date postponed !!\n// Long startingDate = model.getStartingDate().getTime();\n// Long startingDateUpperLimit = model.getStartingDateUpperRange().getTime();\n\n // Prepares time period\n String timePeriod = model.getTimePeriod();\n // endregion\n\n // region Build query\n SearchQuery searchQuery;\n\n\n if (certifications != null && certifications.size() != 0)\n searchQuery = new NativeSearchQueryBuilder().withQuery(matchAllQuery())\n\n\n .withQuery(\n boolQuery()\n .must(queryForMustSkill(title))\n .should(queryForExactValueSkill(title, experienceDuration))\n .should(queryForExactValueHourlyRate(hourlyRate))\n .should(queryForFuzzyHourlyRate(hourlyRate))\n .should(queryForFuzzySkill(title, experienceDuration))\n .should(queryForRangeSkill(title, experienceLowerLimit, experienceUpperLimit))\n .should(queryForRangeHourlyRate(hourlyRateLowerLimit, hourlyRateUpperLimit))\n .must(queryForLocation(location))\n// .must(queryForStartingDay(startingDate, startingDateUpperLimit))\n .must(queryForTimePeriod(timePeriod))\n .must(queryForCertifications(certifications)))\n .withPageable(pageable)\n .withFilter(queryForMustSkill(title))\n .withFilter(queryForExactValueSkill(title, experienceDuration))\n .withFilter(queryForExactValueHourlyRate(hourlyRate))\n .withFilter(queryForFuzzyHourlyRate(hourlyRate))\n .withFilter(queryForFuzzySkill(title, experienceDuration))\n .withFilter(queryForRangeSkill(title, experienceLowerLimit, experienceUpperLimit))\n .withFilter(queryForRangeHourlyRate(hourlyRateLowerLimit, hourlyRateUpperLimit))\n .withFilter(queryForLocation(location))\n .withFilter(queryForTimePeriod(timePeriod))\n .withFilter(queryForCertifications(certifications))\n// .withSort(SortBuilders.fieldSort(\"hourlyRate\")\n// .order(SortOrder.ASC))\n .build();\n\n else\n\n\n searchQuery = new NativeSearchQueryBuilder().withQuery(matchAllQuery())\n\n\n .withQuery(\n boolQuery()\n .must(queryForMustSkill(title))\n .should(queryForExactValueSkill(title, experienceDuration))\n .should(queryForExactValueHourlyRate(hourlyRate))\n .should(queryForFuzzyHourlyRate(hourlyRate))\n .should(queryForFuzzySkill(title, experienceDuration))\n .should(queryForRangeSkill(title, experienceLowerLimit, experienceUpperLimit))\n .should(queryForRangeHourlyRate(hourlyRateLowerLimit, hourlyRateUpperLimit))\n .must(queryForLocation(location))\n// .must(queryForStartingDay(startingDate, startingDateUpperLimit))\n .must(queryForTimePeriod(timePeriod)))\n .withPageable(pageable)\n .withFilter(queryForMustSkill(title))\n .withFilter(queryForExactValueSkill(title, experienceDuration))\n .withFilter(queryForExactValueHourlyRate(hourlyRate))\n .withFilter(queryForFuzzyHourlyRate(hourlyRate))\n .withFilter(queryForFuzzySkill(title, experienceDuration))\n .withFilter(queryForRangeSkill(title, experienceLowerLimit, experienceUpperLimit))\n .withFilter(queryForRangeHourlyRate(hourlyRateLowerLimit, hourlyRateUpperLimit))\n .withFilter(queryForLocation(location))\n .withFilter(queryForTimePeriod(timePeriod))\n// .withSort(SortBuilders.fieldSort(\"hourlyRate\")\n// .order(SortOrder.ASC))\n .build();\n\n // endregion\n\n // region Test\n Page<ElasticCandidate> queryForExactValueSkill = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForExactValueSkill(title, experienceDuration))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForExactValueHourlyRate = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForExactValueHourlyRate(hourlyRate))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForFuzzySkill = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForFuzzySkill(title, experienceDuration))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForFuzzyHourlyRate = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForFuzzyHourlyRate(hourlyRate))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForRangeSkill = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForRangeSkill(title, experienceLowerLimit, experienceUpperLimit))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForRangeHourlyRate = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForRangeHourlyRate(hourlyRateLowerLimit, hourlyRateUpperLimit))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForLocation = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForLocation(location))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForTimePeriod = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForTimePeriod(timePeriod))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForCertifications = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForCertifications(certifications))\n .build(), ElasticCandidate.class);\n // endregion\n\n\n Page<ElasticCandidate> sampleEntities = elasticsearchTemplate.queryForPage(searchQuery,\n ElasticCandidate.class);\n return sampleEntities;\n }" ]
[ "0.5600892", "0.55532825", "0.5539226", "0.5356957", "0.5310415", "0.525517", "0.5254404", "0.5184143", "0.50807065", "0.5051167", "0.5050741", "0.50353324", "0.5016568", "0.49579072", "0.48308253", "0.47939587", "0.47931963", "0.47796646", "0.47731557", "0.47697252", "0.47668123", "0.47634253", "0.47300202", "0.47300202", "0.4729237", "0.47244662", "0.47169217", "0.47053978", "0.47010288", "0.46842325", "0.46695733", "0.46645457", "0.46566027", "0.46520862", "0.46443936", "0.46398923", "0.4629871", "0.46214443", "0.46212846", "0.45941854", "0.45921516", "0.45827353", "0.45710102", "0.45702556", "0.45690843", "0.45580542", "0.45569903", "0.45289224", "0.45281348", "0.45279416", "0.45274234", "0.4523556", "0.4520825", "0.45172843", "0.45061082", "0.4501435", "0.4501109", "0.4480416", "0.44803825", "0.4464669", "0.44463417", "0.44437116", "0.443803", "0.4437037", "0.44364047", "0.4431474", "0.44161105", "0.44023198", "0.44021556", "0.43978783", "0.43923643", "0.43917587", "0.43916252", "0.43878892", "0.43749744", "0.43730018", "0.43723077", "0.43639702", "0.43626267", "0.43589255", "0.43559626", "0.43549082", "0.43475673", "0.43471932", "0.43470046", "0.43449083", "0.43351728", "0.43312648", "0.43260294", "0.43176657", "0.4316585", "0.43162477", "0.43139595", "0.43135893", "0.4311971", "0.43087634", "0.42935452", "0.4291885", "0.42915925", "0.42893073" ]
0.51966447
7
Create an Impactbased search strategy. "ImpactBased Search Strategies for Constraint Programming", Philippe Refalo, CP2004. Uses default parameters (ALPHA=2,SPLIT=3,NODEIMPACT=10,INITONLY=true)
public static AbstractStrategy<IntVar> impact(IntVar[] VARS, long SEED) { return impact(VARS, 2, 3, 10, SEED, true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static AbstractStrategy<IntVar> impact(IntVar[] VARS, int ALPHA, int SPLIT, int NODEIMPACT, long SEED, boolean INITONLY) {\n return new ImpactBased(VARS, ALPHA, SPLIT, NODEIMPACT, SEED, INITONLY);\n }", "ParameterRefinement createParameterRefinement();", "OperationalizingSoftgoal createOperationalizingSoftgoal();", "Association findAssociation(World w, BlockPos pos, String strategy);", "Strategy createStrategy();", "Algorithm createAlgorithm();", "public static void experiment(String name) {\n \tString probName = \"NQueensProblem\";\n \tList<OptimizationAlgorithm> algs = new ArrayList<>();\n int[] ranges = new int[N];\n Random random = new Random(N);\n for (int i = 0; i < N; i++) {\n \tranges[i] = random.nextInt();\n }\n NQueensFitnessFunction ef = new NQueensFitnessFunction();\n Distribution odd = new DiscretePermutationDistribution(N);\n NeighborFunction nf = new SwapNeighbor();\n MutationFunction mf = new SwapMutation();\n CrossoverFunction cf = new SingleCrossOver();\n Distribution df = new DiscreteDependencyTree(.1); \n \n HillClimbingProblem hcp = new GenericHillClimbingProblem(ef, odd, nf);\n GeneticAlgorithmProblem gap = new GenericGeneticAlgorithmProblem(ef, odd, mf, cf);\n ProbabilisticOptimizationProblem pop = new GenericProbabilisticOptimizationProblem(ef, odd, df);\n \n RandomizedHillClimbing rhc = new RandomizedHillClimbing(hcp); \n SimulatedAnnealing sa = new SimulatedAnnealing(1E1, .1, hcp);\n StandardGeneticAlgorithm ga = new StandardGeneticAlgorithm(200, 0, 10, gap);\n MIMIC mimic = new MIMIC(200, 10, pop);\n \n algs.add(rhc);\n algs.add(sa);\n algs.add(ga);\n algs.add(mimic);\n Experiment newExp = new Experiment();\n \n newExp.experiments(algs, ef, name);\n \n // test temperature for SA\n String paramName = \"Temperature\";\n String algName = \"SA\";\n List<Double> params2 = new ArrayList<>();\n List<OptimizationAlgorithm> algsTest = new ArrayList<>();\n for (double i = 1.0; i < 100.5; i+=1.0){\n \tparams2.add(i);\n \tsa = new SimulatedAnnealing(i, .1, hcp);\n \talgsTest.add(sa);\n }\n newExp.optParams(algsTest, ef, paramName, null, params2, algName, probName);\n \n // test cooling rate for SA\n paramName = \"CoolingRate\";\n params2 = new ArrayList<>();\n algsTest = new ArrayList<>();\n for (double i = 0.01; i < 0.51; i+=0.005){\n \tparams2.add(i);\n \tsa = new SimulatedAnnealing(1E1, i, hcp);\n \talgsTest.add(sa);\n }\n newExp.optParams(algsTest, ef, paramName, null, params2, algName, probName);\n \n // test populationSize for GA\n paramName = \"populationSize\";\n algName = \"GA\";\n List<Integer> params1 = new ArrayList<>();\n algsTest = new ArrayList<>();\n for (int i = 10; i < 1001; i+=10){\n \tparams1.add(i);\n \tga = new StandardGeneticAlgorithm(i, 0, 10, gap);\n \talgsTest.add(ga);\n }\n newExp.optParams(algsTest, ef, paramName, params1, null, algName, probName);\n \n // test toMate for GA\n paramName = \"toMate\";\n params1 = new ArrayList<>();\n algsTest = new ArrayList<>();\n for (int i = 0; i < 100; i+=1){\n \tparams1.add(i);\n \tga = new StandardGeneticAlgorithm(200, i, 10, gap);\n \talgsTest.add(ga);\n }\n newExp.optParams(algsTest, ef, paramName, params1, null, algName, probName);\n \n // test toMutate for GA\n paramName = \"toMutate\";\n params1 = new ArrayList<>();\n algsTest = new ArrayList<>();\n for (int i = 10; i < 1001; i+=10){\n \tparams1.add(i);\n \tga = new StandardGeneticAlgorithm(200, 0, i, gap);\n \talgsTest.add(ga);\n }\n newExp.optParams(algsTest, ef, paramName, params1, null, algName, probName);\n \n // test samples for MIMIC\n paramName = \"samples\";\n algName = \"MIMIC\";\n params1 = new ArrayList<>();\n algsTest = new ArrayList<>();\n for (int i = 100; i < 1101; i += 10){\n \tparams1.add(i);\n \tmimic = new MIMIC(i, 10, pop);\n \talgsTest.add(mimic);\n }\n newExp.optParams(algsTest, ef, paramName, params1, null, algName, probName);\n \n // test tokeep for MIMIC\n paramName = \"tokeeep\";\n params1 = new ArrayList<>();\n algsTest = new ArrayList<>();\n for (int i = 1; i < 101; i+=1){\n \tparams1.add(i);\n \tmimic = new MIMIC(200, i, pop);\n \talgsTest.add(mimic);\n }\n newExp.optParams(algsTest, ef, paramName, params1, null, algName, probName);\n \n \n // test different algorithms with various NQueensProblems\n // set up algorithms\n algs = new ArrayList<>();\n ga = new StandardGeneticAlgorithm(150, 98, 70, gap);\n algs.add(rhc);\n algs.add(sa);\n algs.add(ga);\n algs.add(mimic);\n // set up different efs\n List<EvaluationFunction> efs = new ArrayList<>();\n for (int i = 0; i < 50; i++){\n \tef = new NQueensFitnessFunction();\n \tefs.add(ef);\n }\n newExp.voteBest(algs, efs, 2000, probName);\n \n }", "public Algorithm configure() throws JMException {\n\t\tAlgorithm algorithm;\n\t\tOperator selection;\n\t\tOperator crossover;\n\t\tOperator mutation;\n\n\t\tHashMap parameters; // Operator parameters\n\n\t\t// Creating the problem\n\t\talgorithm = new NSGAII(problem_);\n\n\t\t// Algorithm parameters\n\t\talgorithm.setInputParameter(\"populationSize\", populationSize_);\n\t\talgorithm.setInputParameter(\"maxEvaluations\", maxEvaluations_);\n\n\t\t// Mutation and Crossover Binary codification\n\t\tparameters = new HashMap();\n\t\tparameters.put(\"probability\", crossoverProbability_);\n\t\tcrossover = CrossoverFactory.getCrossoverOperator(\"SinglePointCrossover\", parameters);\n\n\t\tparameters = new HashMap();\n\t\tparameters.put(\"probability\", mutationProbability_);\n\t\tmutation = MutationFactory.getMutationOperator(\"BitFlipMutation\", parameters);\n\n\t\t// Selection Operator\n\t\tparameters = null;\n\t\tselection = SelectionFactory.getSelectionOperator(\"BinaryTournament2\", parameters);\n\n\t\t// Add the operators to the algorithm\n\t\talgorithm.addOperator(\"crossover\", crossover);\n\t\talgorithm.addOperator(\"mutation\", mutation);\n\t\talgorithm.addOperator(\"selection\", selection);\n\n\t\treturn algorithm;\n\t}", "public interface ConflictRegionStrategy extends AlgStrategy {}", "public static void main(String... args)\n {\n String path = Configuration.instance.dataDirectory + Configuration.instance.fileSeparator;\n String suffix = \"_default.xml\";\n String algorithm = \"\";\n boolean paramSeach = false;\n int maxGens = 10000;\n\n readItems();\n\n // Parsing CLI\n for (int i = 0; i < args.length; i++)\n {\n if (args[i].equals(\"-algorithm\"))\n {\n i++;\n algorithm = args[i];\n }\n\n if (args[i].equals(\"-configuration\"))\n {\n i++;\n if (args[i].equals(\"best\"))\n suffix = \"_best.xml\";\n }\n\n if (args[i].equals(\"-search_best_configuration\"))\n paramSeach = true;\n }\n\n if (paramSeach) suffix = \"_best.xml\";\n double[] hyperparameters = loadConfig(path + algorithm + suffix);\n System.out.println(\"Chosen algorithm: \" + algorithm);\n\n double time = System.currentTimeMillis();\n // Running correct algorithm according to CLI\n switch (algorithm)\n {\n case \"ga\":\n if (paramSeach)\n new GARecommender().recommend();\n else\n new Population(maxGens, hyperparameters).run();\n break;\n case \"sa\":\n case \"best-algorithm\":\n if (paramSeach)\n new SARecommender().recommend();\n else\n new Annealing(hyperparameters).run();\n break;\n case \"aco\":\n if (paramSeach)\n new ACORecommender().recommend();\n else\n new AntColony(maxGens, hyperparameters).run();\n break;\n case \"pso\":\n if (paramSeach)\n new PSORecommender().recommend();\n else\n new Swarm(maxGens * 10, hyperparameters).run(); // 10x max gens because PSO is does less per gen and is much faster\n break;\n default:\n System.out.println(\"Could not find algorithm with name \" + algorithm + \". Options are: ga, sa, aco, pso\");\n break;\n }\n System.out.println(\"Finished in: \" + ((System.currentTimeMillis() - time) / 1000) + \"s\");\n }", "public interface LDABetaInitStrategy{\n\t/**\n\t * Given a model and the corpus initialise the model's sufficient statistics\n\t * @param model\n\t * @param corpus\n\t */\n\tpublic void initModel(LDAModel model, Corpus corpus);\n\t\n\t/**\n\t * initialises beta randomly s.t. each each topicWord >= 1 and < 2\n\t * @author Sina Samangooei ([email protected])\n\t *\n\t */\n\tpublic static class RandomBetaInit implements LDABetaInitStrategy{\n\t\tprivate MersenneTwister random;\n\t\t\n\t\t/**\n\t\t * unseeded random\n\t\t */\n\t\tpublic RandomBetaInit() {\n\t\t\trandom = new MersenneTwister();\n\t\t}\n\t\t\n\t\t/**\n\t\t * seeded random\n\t\t * @param seed\n\t\t */\n\t\tpublic RandomBetaInit(int seed) {\n\t\t\trandom = new MersenneTwister(seed);\n\t\t}\n\t\t@Override\n\t\tpublic void initModel(LDAModel model, Corpus corpus) {\n\t\t\tfor (int topicIndex = 0; topicIndex < model.ntopics; topicIndex++) {\n\t\t\t\tfor (int wordIndex = 0; wordIndex < corpus.vocabularySize(); wordIndex++) {\n\t\t\t\t\tdouble topicWord = 1 + random.nextDouble();\n\t\t\t\t\tmodel.incTopicWord(topicIndex,wordIndex,topicWord);\n\t\t\t\t\tmodel.incTopicTotal(topicIndex, topicWord);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "public Decision planBest(Context context, Decision defaultDecision);", "public knnImpute(String fileParam) {\r\n\t\tconfig_read(fileParam);\r\n\t\tIS = new InstanceSet();\r\n\t\tIStest = new InstanceSet();\r\n\t}", "public interface Strategy {\n\n StrategySolution solve(List<Item> items, int weight);\n}", "public IPDStrategy()\n {\n name = \"IPD Strategy\";\n }", "public interface AsgStrategy {\n void apply(AsgQuery query, AsgStrategyContext context);\n}", "public interface AMDPModelLearner extends AMDPPolicyGenerator{\n\n\n public void updateModel(State s, Action a, List<Double> rewards, State sPrime, GroundedTask gt);\n\n\n}", "void searchConstraintHit (Search search);", "public IDetectionAlgorithm createInstance();", "public AdvancedSolution(int[] state, int fitness, int nbIterations) {\n\t\tsuper(state, fitness);\n\t\tthis.nbIterations = nbIterations;\n\t}", "public GraphCostBasedSearch(GraphVar graphVar) {\n this(graphVar, null);\n }", "public interface IInteractStrategy {\n\n\t/**\n\t * Performs a directed interaction between the context ball and the target Ball from the perspective of the context Ball.\n\t * @param context The Ball from whose perspective the interaction processing takes place.\n\t * @param target The Ball that is the \"other ball\" in the perspective of this processing.\n\t * @param disp The Dispatcher that is to be used if desired.\n\t * @param interactFirst A boolean denoting whether this is the first in a series (usually two) of interactions.\n\t */\n\tpublic void interact(Ball context, Ball target, IDispatcher<IBallCmd> disp, Boolean interactFirst);\n\n\t/**\n\t * Null strategy with no-op behavior. \n\t * NOTE: We can use a lambda here instead of an anonymous inner class because IInteractStrategy is a functional interface (only has one\n\t * abstract method).\n\t */\n\tpublic static final IInteractStrategy NULL = (context, target, disp, isSource) -> {};\n\t\n}", "private static void normal(){\n ProblemKnapsackFromFile problem = new ProblemKnapsackFromFile(macPathGetProblemFrom);\n\n //NSGAII algorithm = new NSGAII();\n SPEA2 algorithm = new SPEA2();\n //SPEAHADKA algorithm = new SPEAHADKA();\n //AEMMT algorithm = new AEMMT();\n //AEMMD algorithm = new AEMMD();\n //MOEAD algorithm = new MOEAD();\n\n int x =1;\n int counter = 0;\n\n if (AEMMD.class.isInstance(algorithm) || AEMMT.class.isInstance(algorithm)){\n Parameters.NUMBER_OF_GENERATIONS = 15000;\n }\n else{\n Parameters.NUMBER_OF_GENERATIONS = problem.items.size() < 100? 100 : 200;\n }\n\n while (counter < x) {\n algorithm.runAlgorithm(problem);\n counter++;\n }\n }", "@Override\n public void init(NegotiationInfo info)\n {\n super.init(info);\n\n // initializes User Model and Opponent Model\n userModelInterface = new UserModelInterfaceImpl(this);\n utilitySpace = userModelInterface.estimateUtilitySpace();\n\n // search all outcomes and sort\n sortedOutcomeSpace = new SortedOutcomeSpace(utilitySpace);\n feasibleBids = sortedOutcomeSpace.getAllOutcomes();\n\n // initializes acceptance and offering strategy\n acceptanceStrategy = new DefaultAcceptanceStrategyImpl(this);\n offeringStrategy = new DefaultOfferingStrategyBasedOpponentImpl(this);\n }", "public BaseOptimizer() {\r\n Candidates = new ArrayList<>();\r\n }", "public static interface PredictorSelectionStrategy {\n /**\n * Injects kernel to kernel-MA according to predictor internal data.\n */\n public void injectKernel(final Predictor predictor);\n\n /**\n * Maximum size of kernels\n */\n public int kernelSize();\n\n /**\n * Creates a brand new predictor.\n */\n public PredictorListener buildPredictor();\n }", "public interface SearchSolver {\n\n /**\n * initializes the algorithm. This method has to be called before calling any other method\n * @param graph the graph of the map where the search takes place\n * @param targetStart the start position for the target (in our case the thief)\n * @param searchStart the start position for the searcher (in our case the police)\n * @param counter the counter object that counts the expanded nodes\n */\n void initialize(Graph graph, Node targetStart, Node searchStart, ExpandCounter counter);\n\n /**\n * gets the shortest path from search start to target\n * @return list of edges that describe the path\n * @throws NoPathFoundException if there is no path to the target\n */\n List<Edge> getPath() throws NoPathFoundException;\n}", "GoalSpecification createGoalSpecification();", "public AlphaBetaSearch(SearchLimitingPredicate<T> searchLimitingPredicate) {\n this.searchLimitingPredicate = searchLimitingPredicate;\n }", "@Test\n @Order(1)\n void algorithms() {\n \n Combination initialComb = new Combination();\n for (int i = 0; i < assignementProblem.getAssignmentData().getLength(); i++) {\n initialComb.add((long) i + 1);\n }\n assignementProblem.setInCombination(initialComb);\n executeAlgo(SearchTestUtil.ALGO.TABU);\n executeAlgo(SearchTestUtil.ALGO.RECUIT);\n }", "public Implementation(Graph<V, E> graph, SenseInduction<V, E> inducer, ClusteringAlgorithmBuilder<Sense<V>, DefaultWeightedEdge, ?> global) {\n this.graph = graph;\n this.inducer = inducer;\n this.global = global;\n this.inventory = new ConcurrentHashMap<>(graph.vertexSet().size());\n this.senses = new ConcurrentHashMap<>(graph.vertexSet().size());\n }", "public interface IKataSolution\n extends IKataCommonSolution {\n\n public enum ACTION {\n TURN_LEFT, TURN_RIGHT, FORWARD, STAY\n }\n\n public enum ORIENTATION {\n UP (270), DOWN(90), LEFT(0), RIGHT(180);\n public int angle;\n ORIENTATION (int _angle) {\n angle = _angle;\n }\n public ORIENTATION moveLeft () {\n switch (this) {\n case UP: return LEFT;\n case DOWN: return RIGHT;\n case LEFT: return DOWN;\n case RIGHT: return UP;\n }\n return this;\n }\n public ORIENTATION moveRight () {\n switch (this) {\n case UP: return RIGHT;\n case DOWN: return LEFT;\n case LEFT: return UP;\n case RIGHT: return DOWN;\n }\n return this;\n }\n }\n\n public enum ITEM {\n EMPTY, PLANT, ANIMAL, END\n }\n\n public abstract class Animal {\n /**\n * Number of plants the animal ate\n */\n public int points;\n /**\n * Method to react to changing environmental conditions\n *\n * @param orientation animal's current orientation\n * @param view item currently in front of animal\n * @return action to do\n */\n public abstract ACTION react (ORIENTATION orientation, ITEM view);\n }\n\n /**\n * Factory method for an animal\n *\n * @param count count of animals to create\n * @param lastGeneration array of 'Animal' from last generation\n * @return array of 'Animal' instances\n */\n public abstract Animal[] createGeneration (int count, Animal[] lastGeneration);\n\n /**\n * If true, last generation will be visualized\n */\n public boolean visualizeLastGeneration ();\n\n /**\n * Defines how many generations of evolution should be tested\n * (minimum is 100, maximum is 10000)\n *\n * @return count of generations to test\n */\n public int countOfGenerations ();\n}", "public static AbstractStrategy<IntVar> activity(IntVar[] VARS, double GAMMA, double DELTA, int ALPHA,\n int FORCE_SAMPLING, long SEED) {\n return new ActivityBased(VARS[0].getSolver(), VARS, GAMMA, DELTA, ALPHA, FORCE_SAMPLING, SEED);\n }", "Conector createConector();", "public TSPMSTSolution(int[] included, int[] includedT, int[] excluded, int[] excludedT, int iterations, double[] weight)\n {\n// System.out.println(\"CHILD NODE CREATED\");\n this.included = included;\n this.includedT = includedT;\n this.excluded = excluded;\n this.excludedT = excludedT;\n this.iterations = iterations;\n this.weight = weight;\n }", "public interface ISearchable {\n\n\n AState getStartState () throws NullError;\n\n AState getGoalState () throws NullError;\n\n ArrayList<AState> getAllSuccessors (AState state) throws LowBoundInput, OutOfBoundMatrixInput, NullError;\n\n}", "AttackImpactFactory getAttackImpactFactory();", "public TSPMSTSolution(int iterations)\n {\n// System.out.println(\"NODE CREATED\");\n this.included = new int[0];\n this.includedT = new int[0];\n this.excluded = new int[0];\n this.excludedT = new int[0];\n this.iterations = iterations;\n }", "public interface Heuristic {\n}", "InstAssignIndex createInstAssignIndex();", "@Override\n\tpublic Alg newInstance() {\n\t\treturn new BnetDistributedCF();\n\t}", "public void testLearn()\n {\n RandomSubVectorThresholdLearner<String> instance = new RandomSubVectorThresholdLearner<String>(\n new VectorThresholdInformationGainLearner<String>(),\n 0.1, random);\n\n VectorFactory<?> vectorFactory = VectorFactory.getDefault();\n ArrayList<InputOutputPair<Vector, String>> data =\n new ArrayList<InputOutputPair<Vector, String>>();\n for (int i = 0; i < 10; i++)\n {\n data.add(new DefaultInputOutputPair<Vector, String>(vectorFactory.createUniformRandom(\n 100, 1.0, 10.0, random), \"a\"));\n }\n\n for (int i = 0; i < 10; i++)\n {\n data.add(new DefaultInputOutputPair<Vector, String>(vectorFactory.createUniformRandom(\n 100, 1.0, 10.0, random), \"b\"));\n }\n\n VectorElementThresholdCategorizer result = instance.learn(data);\n assertNotNull(result);\n assertTrue(result.getIndex() >= 0);\n assertTrue(result.getIndex() < 100);\n \n // Change the dimensions to consider.\n instance.setDimensionsToConsider(new int[] {10, 20, 30, 40, 50});\n instance.setPercentToSample(0.5);\n result = instance.learn(data);\n assertNotNull(result);\n assertTrue(result.getIndex() >= 10);\n assertTrue(result.getIndex() <= 50);\n assertTrue(result.getIndex() % 10 == 0);\n }", "public static void main(String[] args) throws IOException {\n int activeThreshold = 300;\n //Activity.selectActive(\"st\", 6, activeThreshold);\n //Activity.selectActive(\"ri\", 6, activeThreshold);\n //Activity.selectActive(\"dw\", 9, activeThreshold);\n\n //Interaction.analysis(\"st\", 6);\n //Interaction.analysis(\"ri\", 6);\n\n //BehaviourIndicators.analysis(\"st\", 6);\n //BehaviourIndicators.analysis(\"ri\", 6);\n //BehaviourIndicators.analysis(\"dw\", 9);\n\n Engagement.analysis(\"st\",6);\n Engagement.analysis(\"ri\",6);\n //todo the data files for DW have to be adjusted to the ones of the other two to be able to run it\n //Engagement.analysis(\"dw\",9);\n\n //Motivation.analysis(\"ri\", 6);\n //Motivation.analysis(\"st\", 6);\n }", "public interface OnlineStructuredAlgorithm extends StructuredAlgorithm {\n\n\t/**\n\t * Strategy to update the learning rate.\n\t * \n\t * @author eraldof\n\t * \n\t */\n\tpublic enum LearnRateUpdateStrategy {\n\t\t/**\n\t\t * No update, i.e., constant learning rate.\n\t\t */\n\t\tNONE,\n\n\t\t/**\n\t\t * The learning rate is equal to n/t, where n is the initial learning\n\t\t * rate and t is the current iteration (number of processed examples).\n\t\t */\n\t\tLINEAR,\n\n\t\t/**\n\t\t * The learning rate is equal to n/(t*t), where n is the initial\n\t\t * learning rate and t is the current iteration (number of processed\n\t\t * examples).\n\t\t */\n\t\tQUADRATIC,\n\n\t\t/**\n\t\t * The learning rate is equal to n/(sqrt(t)), where n is the initial\n\t\t * learning rate and t is the current iteration (number of processed\n\t\t * examples).\n\t\t */\n\t\tSQUARE_ROOT\n\t}\n\n\t/**\n\t * Update the currect model using the given correct output and the predicted\n\t * output for this example. Attention: the given <code>predicted</code> is\n\t * only a placeholder to store the predicted structure, i.e., the prediction\n\t * will be done inside this method.\n\t * \n\t * @param input\n\t * the input structure.\n\t * @param output\n\t * the correct output structured.\n\t * @param predicted\n\t * a place holder for the predicted structured.\n\t * @return the loss function value for the given correct output and the\n\t * predicted output using the current weight vector (before the\n\t * possible update generated by the given example).\n\t */\n\tpublic double train(ExampleInput input, ExampleOutput output,\n\t\t\tExampleOutput predicted);\n\n\t/**\n\t * Set the learning rate.\n\t * \n\t * @param rate\n\t */\n\tpublic void setLearningRate(double rate);\n\n\t/**\n\t * Return the current iteration.\n\t * \n\t * @return\n\t */\n\tpublic int getIteration();\n\n}", "IntStrategyFactory() {\n }", "public static void main(String[] args) {\n\t\tUtility.dirPath = \"C:\\\\Users\\\\imSlappy\\\\workspace\\\\FeelingAnalysis\\\\Documents\\\\2_group_eng\";\n\t\tString sub[] = {\"dup\",\"bug\"};\n\t\tUtility.classLabel = sub;\n\t\tUtility.numdoc = 350;\n\t\tSetClassPath.read_path(Utility.dirPath);\n\t\tUtility.language = \"en\";\n\t\t\n\t\tUtility.stopWordHSEN = Fileprocess.FileHashSet(\"data/stopwordAndSpc_eng.txt\");\n\t\tUtility.dicen = new _dictionary();\n\t\tUtility.dicen.getDictionary(\"data/dicEngScore.txt\");\n\t\t\n\t\tUtility.vocabHM = new HashMap();\n\t\t// ================= completed initial main Program ==========================\n\n\t\tMainExampleNaive ob = new MainExampleNaive();\n\t\t\n\t\t// --------------------- Pre-process -----------------------\n\t\tob.word_arr = new HashSet [Utility.listFile.length][];\n\t\tob.wordSet = new ArrayList<String>();\n\t\tfor (int i = 0; i < Utility.listFile.length; i++) {\n\t\t\tob.word_arr[i]=new HashSet[Utility.listFile[i].length];\n\t\t\tfor (int j = 0; j < Utility.listFile[i].length; j++) {\n\t\t\t\tStringBuffer strDoc = Fileprocess.readFile(Utility.listFile[i][j]);\n\t\t\t\tob.word_arr[i][j]=ob.docTokenization(new String(strDoc));\n\t\t\t}\n\t\t\tob.checkBound(3, 10000);\n\t\t}\n\t\t\n\t\tSystem.out.println(\"++ Total : \"+Utility.vocabHM.size()+\" words\");\n\t\tSystem.out.println(\"++ \"+Utility.vocabHM);\n\t\t\n\t\t// ---------------------- Selection ------------------------\n//\t\tInformationGain ig = new InformationGain(ob.word_arr.length*ob.word_arr[0].length , ob.wordSet,ob.word_arr);\n//\t\tArrayList<String> ban_word = ig.featureSelection(0.0); // selected out with IG = 0\n//\t\t//ob.banFeature(ban_word);\n//\t\tSystem.out.println(\"ban list[\"+ban_word.size()+\"] : \"+ban_word);\n//\t\t\n//\t\tSystem.out.println(\"-- After \"+Utility.vocabHM.size());\n//\t\tSystem.out.println(\"-- \"+Utility.vocabHM);\n\t\t\n\t\tob.setWordPosition();\n\t\t// ---------------------- Processing -----------------------\n\t\tNaiveBayes naive = new NaiveBayes();\n\t\tnaive.naiveTrain(true);\n\t\t\n\t\tint result = naive.naiveUsage(\"after cold reset of my pc (crash of xp) the favorites of firefox are destroyed and all settings are standard again! Where are firefox-favorites stored and the settings ? how to backup them rgularely? All other software on my pc still works properly ! even INternetExplorer\");\n\t\tSystem.out.println(\"\\nResult : \"+Utility.classLabel[result]);\n\t}", "public abstract OptimisationSolution getBestSolution();", "public void test_ck_02() {\n OntModel vocabModel = ModelFactory.createOntologyModel();\n ObjectProperty p = vocabModel.createObjectProperty(\"p\");\n OntClass A = vocabModel.createClass(\"A\");\n \n OntModel workModel = ModelFactory.createOntologyModel();\n Individual sub = workModel.createIndividual(\"uri1\", A);\n Individual obj = workModel.createIndividual(\"uri2\", A);\n workModel.createStatement(sub, p, obj);\n }", "public List<Graph> search() {\n\n long start = System.currentTimeMillis();\n TetradLogger.getInstance().log(\"info\", \"Starting ION Search.\");\n logGraphs(\"\\nInitial Pags: \", this.input);\n TetradLogger.getInstance().log(\"info\", \"Transfering local information.\");\n long steps = System.currentTimeMillis();\n\n /*\n * Step 1 - Create the empty graph\n */\n List<Node> varNodes = new ArrayList<>();\n for (String varName : variables) {\n varNodes.add(new GraphNode(varName));\n }\n Graph graph = new EdgeListGraph(varNodes);\n\n /*\n * Step 2 - Transfer local information from the PAGs (adjacencies\n * and edge orientations)\n */\n // transfers edges from each graph and finds definite noncolliders\n transferLocal(graph);\n // adds edges for variables never jointly measured\n for (NodePair pair : nonIntersection(graph)) {\n graph.addEdge(new Edge(pair.getFirst(), pair.getSecond(), Endpoint.CIRCLE, Endpoint.CIRCLE));\n }\n TetradLogger.getInstance().log(\"info\", \"Steps 1-2: \" + (System.currentTimeMillis() - steps) / 1000. + \"s\");\n System.out.println(\"step2\");\n System.out.println(graph);\n\n /*\n * Step 3\n *\n * Branch and prune step that blocks problematic undirectedPaths, possibly d-connecting undirectedPaths\n */\n steps = System.currentTimeMillis();\n Queue<Graph> searchPags = new LinkedList<>();\n // place graph constructed in step 2 into the queue\n searchPags.offer(graph);\n // get d-separations and d-connections\n List<Set<IonIndependenceFacts>> sepAndAssoc = findSepAndAssoc(graph);\n this.separations = sepAndAssoc.get(0);\n this.associations = sepAndAssoc.get(1);\n Map<Collection<Node>, List<PossibleDConnectingPath>> paths;\n// Queue<Graph> step3PagsSet = new LinkedList<Graph>();\n HashSet<Graph> step3PagsSet = new HashSet<>();\n Set<Graph> reject = new HashSet<>();\n // if no d-separations, nothing left to search\n if (separations.isEmpty()) {\n // makes orientations preventing definite noncolliders from becoming colliders\n // do final orientations\n// doFinalOrientation(graph);\n step3PagsSet.add(graph);\n }\n // sets length to iterate once if search over path lengths not enabled, otherwise set to 2\n int numNodes = graph.getNumNodes();\n int pl = numNodes - 1;\n if (pathLengthSearch) {\n pl = 2;\n }\n // iterates over path length, then adjacencies\n for (int l = pl; l < numNodes; l++) {\n if (pathLengthSearch) {\n TetradLogger.getInstance().log(\"info\", \"Braching over path lengths: \" + l + \" of \" + (numNodes - 1));\n }\n int seps = separations.size();\n int currentSep = 1;\n int numAdjacencies = separations.size();\n for (IonIndependenceFacts fact : separations) {\n if (adjacencySearch) {\n TetradLogger.getInstance().log(\"info\", \"Braching over path nonadjacencies: \" + currentSep + \" of \" + numAdjacencies);\n }\n seps--;\n // uses two queues to keep up with which PAGs are being iterated and which have been\n // accepted to be iterated over in the next iteration of the above for loop\n searchPags.addAll(step3PagsSet);\n recGraphs.add(searchPags.size());\n step3PagsSet.clear();\n while (!searchPags.isEmpty()) {\n System.out.println(\"ION Step 3 size: \" + searchPags.size());\n double currentUsage = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();\n if (currentUsage > maxMemory) maxMemory = currentUsage;\n // deques first PAG from searchPags\n Graph pag = searchPags.poll();\n // Part 3.a - finds possibly d-connecting undirectedPaths between each pair of nodes\n // known to be d-separated\n List<PossibleDConnectingPath> dConnections = new ArrayList<>();\n // checks to see if looping over adjacencies\n if (adjacencySearch) {\n for (Collection<Node> conditions : fact.getZ()) {\n // checks to see if looping over path lengths\n if (pathLengthSearch) {\n dConnections.addAll(PossibleDConnectingPath.findDConnectingPathsOfLength\n (pag, fact.getX(), fact.getY(), conditions, l));\n } else {\n dConnections.addAll(PossibleDConnectingPath.findDConnectingPaths\n (pag, fact.getX(), fact.getY(), conditions));\n }\n }\n } else {\n for (IonIndependenceFacts allfact : separations) {\n for (Collection<Node> conditions : allfact.getZ()) {\n // checks to see if looping over path lengths\n if (pathLengthSearch) {\n dConnections.addAll(PossibleDConnectingPath.findDConnectingPathsOfLength\n (pag, allfact.getX(), allfact.getY(), conditions, l));\n } else {\n dConnections.addAll(PossibleDConnectingPath.findDConnectingPaths\n (pag, allfact.getX(), allfact.getY(), conditions));\n }\n }\n }\n }\n // accept PAG go to next PAG if no possibly d-connecting undirectedPaths\n if (dConnections.isEmpty()) {\n// doFinalOrientation(pag);\n// Graph p = screenForKnowledge(pag);\n// if (p != null) step3PagsSet.add(p);\n step3PagsSet.add(pag);\n continue;\n }\n // maps conditioning sets to list of possibly d-connecting undirectedPaths\n paths = new HashMap<>();\n for (PossibleDConnectingPath path : dConnections) {\n List<PossibleDConnectingPath> p = paths.get(path.getConditions());\n if (p == null) {\n p = new LinkedList<>();\n }\n p.add(path);\n paths.put(path.getConditions(), p);\n }\n // Part 3.b - finds minimal graphical changes to block possibly d-connecting undirectedPaths\n List<Set<GraphChange>> possibleChanges = new ArrayList<>();\n for (Set<GraphChange> changes : findChanges(paths)) {\n Set<GraphChange> newChanges = new HashSet<>();\n for (GraphChange gc : changes) {\n boolean okay = true;\n for (Triple collider : gc.getColliders()) {\n\n if (pag.isUnderlineTriple(collider.getX(), collider.getY(), collider.getZ())) {\n okay = false;\n break;\n }\n\n }\n if (!okay) {\n continue;\n }\n for (Triple collider : gc.getNoncolliders()) {\n if (pag.isDefCollider(collider.getX(), collider.getY(), collider.getZ())) {\n okay = false;\n break;\n }\n }\n if (okay) {\n newChanges.add(gc);\n }\n }\n if (!newChanges.isEmpty()) {\n possibleChanges.add(newChanges);\n } else {\n possibleChanges.clear();\n break;\n }\n }\n float starthitset = System.currentTimeMillis();\n Collection<GraphChange> hittingSets = IonHittingSet.findHittingSet(possibleChanges);\n recHitTimes.add((System.currentTimeMillis() - starthitset) / 1000.);\n // Part 3.c - checks the newly constructed graphs from 3.b and rejects those that\n // cycles or produce independencies known not to occur from the input PAGs or\n // include undirectedPaths from definite nonancestors\n for (GraphChange gc : hittingSets) {\n boolean badhittingset = false;\n for (Edge edge : gc.getRemoves()) {\n Node node1 = edge.getNode1();\n Node node2 = edge.getNode2();\n Set<Triple> triples = new HashSet<>();\n triples.addAll(gc.getColliders());\n triples.addAll(gc.getNoncolliders());\n if (triples.size() != (gc.getColliders().size() + gc.getNoncolliders().size())) {\n badhittingset = true;\n break;\n }\n for (Triple triple : triples) {\n if (node1.equals(triple.getY())) {\n if (node2.equals(triple.getX()) ||\n node2.equals(triple.getZ())) {\n badhittingset = true;\n break;\n }\n }\n if (node2.equals(triple.getY())) {\n if (node1.equals(triple.getX()) ||\n node1.equals(triple.getZ())) {\n badhittingset = true;\n break;\n }\n }\n }\n if (badhittingset) {\n break;\n }\n for (NodePair pair : gc.getOrients()) {\n if ((node1.equals(pair.getFirst()) && node2.equals(pair.getSecond())) ||\n (node2.equals(pair.getFirst()) && node1.equals(pair.getSecond()))) {\n badhittingset = true;\n break;\n }\n }\n if (badhittingset) {\n break;\n }\n }\n if (!badhittingset) {\n for (NodePair pair : gc.getOrients()) {\n for (Triple triple : gc.getNoncolliders()) {\n if (pair.getSecond().equals(triple.getY())) {\n if (pair.getFirst().equals(triple.getX()) &&\n pag.getEndpoint(triple.getZ(), triple.getY()).equals(Endpoint.ARROW)) {\n badhittingset = true;\n break;\n\n }\n if (pair.getFirst().equals(triple.getZ()) &&\n pag.getEndpoint(triple.getX(), triple.getY()).equals(Endpoint.ARROW)) {\n badhittingset = true;\n break;\n }\n }\n if (badhittingset) {\n break;\n }\n }\n if (badhittingset) {\n break;\n }\n }\n }\n if (badhittingset) {\n continue;\n }\n Graph changed = gc.applyTo(pag);\n // if graph change has already been rejected move on to next graph\n if (reject.contains(changed)) {\n continue;\n }\n // if graph change has already been accepted move on to next graph\n if (step3PagsSet.contains(changed)) {\n continue;\n }\n // reject if null, predicts false independencies or has cycle\n if (predictsFalseIndependence(associations, changed)\n || changed.existsDirectedCycle()) {\n reject.add(changed);\n }\n // makes orientations preventing definite noncolliders from becoming colliders\n // do final orientations\n// doFinalOrientation(changed);\n // now add graph to queue\n\n// Graph p = screenForKnowledge(changed);\n// if (p != null) step3PagsSet.add(p);\n step3PagsSet.add(changed);\n }\n }\n // exits loop if not looping over adjacencies\n if (!adjacencySearch) {\n break;\n }\n }\n }\n TetradLogger.getInstance().log(\"info\", \"Step 3: \" + (System.currentTimeMillis() - steps) / 1000. + \"s\");\n Queue<Graph> step3Pags = new LinkedList<>(step3PagsSet);\n\n /*\n * Step 4\n *\n * Finds redundant undirectedPaths and uses this information to expand the list\n * of possible graphs\n */\n steps = System.currentTimeMillis();\n Map<Edge, Boolean> necEdges;\n Set<Graph> outputPags = new HashSet<>();\n\n while (!step3Pags.isEmpty()) {\n Graph pag = step3Pags.poll();\n necEdges = new HashMap<>();\n // Step 4.a - if x and y are known to be unconditionally associated and there is\n // exactly one trek between them, mark each edge on that trek as necessary and\n // make the tiples on the trek definite noncolliders\n // initially mark each edge as not necessary\n for (Edge edge : pag.getEdges()) {\n necEdges.put(edge, false);\n }\n // look for unconditional associations\n for (IonIndependenceFacts fact : associations) {\n for (List<Node> nodes : fact.getZ()) {\n if (nodes.isEmpty()) {\n List<List<Node>> treks = treks(pag, fact.x, fact.y);\n if (treks.size() == 1) {\n List<Node> trek = treks.get(0);\n List<Triple> triples = new ArrayList<>();\n for (int i = 1; i < trek.size(); i++) {\n // marks each edge in trek as necessary\n necEdges.put(pag.getEdge(trek.get(i - 1), trek.get(i)), true);\n if (i == 1) {\n continue;\n }\n // makes each triple a noncollider\n pag.addUnderlineTriple(trek.get(i - 2), trek.get(i - 1), trek.get(i));\n }\n }\n // stop looping once the empty set is found\n break;\n }\n }\n }\n // Part 4.b - branches by generating graphs for every combination of removing\n // redundant undirectedPaths\n boolean elimTreks;\n // checks to see if removing redundant undirectedPaths eliminates every trek between\n // two variables known to be nconditionally assoicated\n List<Graph> possRemovePags = possRemove(pag, necEdges);\n double currentUsage = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();\n if (currentUsage > maxMemory) maxMemory = currentUsage;\n for (Graph newPag : possRemovePags) {\n elimTreks = false;\n // looks for unconditional associations\n for (IonIndependenceFacts fact : associations) {\n for (List<Node> nodes : fact.getZ()) {\n if (nodes.isEmpty()) {\n if (treks(newPag, fact.x, fact.y).isEmpty()) {\n elimTreks = true;\n }\n // stop looping once the empty set is found\n break;\n }\n }\n }\n // add new PAG to output unless a necessary trek has been eliminated\n if (!elimTreks) {\n outputPags.add(newPag);\n }\n }\n }\n outputPags = removeMoreSpecific(outputPags);\n// outputPags = applyKnowledge(outputPags);\n\n TetradLogger.getInstance().log(\"info\", \"Step 4: \" + (System.currentTimeMillis() - steps) / 1000. + \"s\");\n\n /*\n * Step 5\n *\n * Generate the Markov equivalence classes for graphs and accept only\n * those that do not predict false d-separations\n */\n steps = System.currentTimeMillis();\n Set<Graph> outputSet = new HashSet<>();\n for (Graph pag : outputPags) {\n Set<Triple> unshieldedPossibleColliders = new HashSet<>();\n for (Triple triple : getPossibleTriples(pag)) {\n if (!pag.isAdjacentTo(triple.getX(), triple.getZ())) {\n unshieldedPossibleColliders.add(triple);\n }\n }\n\n PowerSet<Triple> pset = new PowerSet<>(unshieldedPossibleColliders);\n for (Set<Triple> set : pset) {\n Graph newGraph = new EdgeListGraph(pag);\n for (Triple triple : set) {\n newGraph.setEndpoint(triple.getX(), triple.getY(), Endpoint.ARROW);\n newGraph.setEndpoint(triple.getZ(), triple.getY(), Endpoint.ARROW);\n }\n doFinalOrientation(newGraph);\n }\n for (Graph outputPag : finalResult) {\n if (!predictsFalseIndependence(associations, outputPag)) {\n Set<Triple> underlineTriples = new HashSet<>(outputPag.getUnderLines());\n for (Triple triple : underlineTriples) {\n outputPag.removeUnderlineTriple(triple.getX(), triple.getY(), triple.getZ());\n }\n outputSet.add(outputPag);\n }\n }\n }\n\n// outputSet = applyKnowledge(outputSet);\n outputSet = checkPaths(outputSet);\n\n output.addAll(outputSet);\n TetradLogger.getInstance().log(\"info\", \"Step 5: \" + (System.currentTimeMillis() - steps) / 1000. + \"s\");\n runtime = ((System.currentTimeMillis() - start) / 1000.);\n logGraphs(\"\\nReturning output (\" + output.size() + \" Graphs):\", output);\n double currentUsage = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();\n if (currentUsage > maxMemory) maxMemory = currentUsage;\n return output;\n }", "public Node newAlphaBeta(Node node, boolean isMaximizing, Node[][] gameBoard,int playerID,int depth,boolean searchOnce) throws InterruptedException {\n\t\tif(depth==0) //node equals terminal node origin ***************************\n\t\t{\n\n\t\t\t\n\t\t\treturn node; //return heuristic value accumulated Score\n\t\t}\n\t\t\n\t\tif(isMaximizing == true)//max\n\t\t{\n\t\t\t\n\t\t\tNode[][] copyOne = new Node[gameBoard.length][gameBoard.length];\n\t\t\tint enescore=0;\n\t\t\tint nodesRx = 0;\n\t\t\tint nodesRy = 0;\n\t\t\tNode temNode = node;\n\t\t\t//opponent score\n\t\t\tif(node!=null)\n\t\t\t{\tenescore = node.enemy;\n\t\t\tnodesRx = node.maxrecordSearchedX;\n\t\t\tnodesRy = node.maxrecordSearchedY;}\n\t\t\t\n\t\t for (int i = 0; i < gameBoard.length; i++) {\n\t\t \tfor(int j =0;j<gameBoard.length;j++)\n\t\t \t{\t\n\t\t \t\tNode temp = new Node(gameBoard[i][j].getScore(),gameBoard[i][j].getX(),gameBoard[i][j].getY(),gameBoard[i][j].getOwnership());\n\t\t \t\tcopyOne[i][j]=temp;\n\t\t \t}\n\t\t }\n\t\t \n\t\t \n\t\t\tPriorityQueue<Node> playerOneChildrenList = new PriorityQueue<Node>(Collections.reverseOrder()); //use priorityQueue,acsending or disacsending.\n\t\t\tQueue<Node> waitList = new LinkedList<Node>();\n\t\t\tboolean walkable = false;\n\t\t\t\n\t\t\t\tfor(int i = 0;i<gameBoard.length;i++)\n\t\t\t\t{\n\t\t\t\t\tfor(int j =0;j<gameBoard.length;j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(copyOne[i][j].getOwnership()==0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\twaitList.add(new Node(copyOne[i][j].getScore(),i,j,playerID));//everyPosition through the 2D array\n\t\t\t\t\t\twalkable = true;\n\t\t\t\t//\t\tcounter++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\tif(walkable == false)\n\t\t\t{\n\t\t\t\treturn node;\n\t\t\t}\n\t\t\t\n\t\t\tint waitSize = waitList.size();\n\t\t\t\n\t\t\t\n\t\t\tfor(int l = 0;l<waitSize;l++)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tNode[][] newCopy = new Node[gameBoard.length][gameBoard.length];\n\t\t\t\tNode temT = temNode;\n\t\t\t for (int i = 0; i < gameBoard.length; i++) {\n\t\t\t \tfor(int j =0;j<gameBoard.length;j++)\n\t\t\t \t{\t\n\t\t\t \t\tNode temp = new Node(copyOne[i][j].getScore(),copyOne[i][j].getX(),copyOne[i][j].getY(),copyOne[i][j].getOwnership());\n\t\t\t \t\tnewCopy[i][j]=temp;\n\t\t\t \t}\n\t\t\t }\n\t\t\t \n\t\t\t\tNode takenNode =waitList.poll();\n\t\t\t\tcounter++;\n\t\t\t\ttakenNode.setAccumulated(newCopy[takenNode.getX()][takenNode.getY()].getScore());\n\t\t\t\ttakenNode.enemy = 0;\n\t\t\t\tnewCopy[takenNode.getX()][takenNode.getY()].setOwnership(playerID);\n\t\t\t\tboolean connected = false;\n\t\t\t\tfor(int i = 0;i<dx.length;i++)\n\t\t\t\t{\n\t\t\t\t\t\tint newX = takenNode.getX()+dx[i];\n\t\t\t\t\t\tint newY = takenNode.getY()+dy[i];\n\t\t\t\t\t\tif((newX>=0&&newX<gameBoard.length)&&(newY>=0&&newY<gameBoard.length))\n\t\t\t\t\t\t{\n\t\t\t\t\t\tif(newCopy[newX][newY].getOwnership()==playerID)\n\t\t\t\t\t\t{\n\t\t\n\t\t\t\t\t\t\tconnected = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(connected == true)\n\t\t\t\t{\n\n\t\t\t\t\tfor(int i = 0;i<dx.length;i++)\n\t\t\t\t\t{\n\t\t\n\t\t\t\t\t\t\tint newX = takenNode.getX()+dx[i];\n\t\t\t\t\t\t\tint newY = takenNode.getY()+dy[i];\n\t\t\t\t\t\t\tif((newX>=0&&newX<gameBoard.length)&&(newY>=0&&newY<gameBoard.length))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(newCopy[newX][newY].getOwnership()!=playerID&&newCopy[newX][newY].getOwnership()!=0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.eatOpponent(newCopy, playerID, newX, newY);\n\t\t\n\t\t\t\t\t\t\t\ttakenNode.setAccumulated(takenNode.getAccumulated()+newCopy[newX][newY].getScore());\n\t\t\t\t\t\t\t\tenescore-=newCopy[newX][newY].getScore();\n\t\t\t\t\t\t\t\ttakenNode.enemy = enescore;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\tif(depth==1)\n\t\t\t\t{\n\t\n\t\t\t\t\ttakenNode.setAccumulated(node.getAccumulated()+takenNode.getAccumulated());\n\n\t\t\t\t}\n\t\n\n\t\t\t\tint opponentID = 0;\n\t\t\t\tif(playerID == 1)\n\t\t\t\t{\n\t\t\t\t\topponentID = 2;\n\t\t\t\t}else if(playerID == 2)\n\t\t\t\t{\n\t\t\t\t\topponentID = 1;\n\t\t\t\t}\n\t\t\t\tif(playerOneChildrenList.isEmpty()==false)\n\t\t\t\t{\n\t\t\t\t\t//\tSystem.out.println(\"asdas\");\n\t\t\t//\t\tSystem.out.println(\"A depth: \"+depth);\n\t\t\t\t//\tThread.sleep(300);\n\t\t\t\t\t\tNode minValueNode = newAlphaBeta(takenNode,false,newCopy, opponentID, depth-1,true);\n\t\t\t\t\t\tcounter++;\n\t\t\t\t\t\n\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t\tif(node!=null)\n\t\t\t\t\t\t\t{\tminValueNode.parentNode = new Node(node.getAccumulated(),node.getX(),node.getY(),node.getOwnership());\n\t\t\t\t\t\t\tif(this.beta!=null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(minValueNode.getAccumulated()<this.alpha.getAccumulated())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//\tSystem.out.println(\"break l should be \"+waitSize+\" now: \"+l);\n\t\t\t\t\t\t\t\tplayerOneChildrenList.add(minValueNode);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t//node.noPoll = true;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tplayerOneChildrenList.add(minValueNode);\n\t\t\t\t\t\t\tcontinue;\n\t\n\t\t\t\t\t//\t}\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t//\tSystem.out.println(\"B depth: \"+depth);\n\t\t\t\t\t//Thread.sleep(300);\n\t\t\t\t\trecordDepth = depth;\n\t\t\t\t\tNode minValueNode = newAlphaBeta(takenNode,false,newCopy, opponentID, depth-1,false);\n\t\t\t\t\t//this.alpha = minValueNode;\n\t\t\t\t\t\n\t\t\t\t\tcounter++;\n\t\t\t\t\t//playeroneNode++;\n\t\t\t\t\tif(node!=null)\n\t\t\t\t\t{\tminValueNode.parentNode = new Node(node.getAccumulated(),node.getX(),node.getY(),node.getOwnership());\n\t\t\t\t\tif(this.beta!=null)\n\t\t\t\t\t{\n\t\t\t\t\tif(minValueNode.getAccumulated()>this.beta.getAccumulated())\n\t\t\t\t\t{\n\t\t\t\t\t//\tSystem.out.println(\"break l should be \"+waitSize+\" now: \"+l);\n\t\t\t\t\t\tplayerOneChildrenList.add(minValueNode);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t//node.noPoll = true;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tplayerOneChildrenList.add(minValueNode);\n\t\t\n\t\t\t\t\t\tif(depth == recordDepth)\n\t\t\t\t\t\t{\n\t\t\t//\t\t\t\tSystem.out.println(\"setting alpha\");\n\t\t\t\t\t\t\t//Thread.sleep(300);\n\t\t\t\t\n\t\t\t\t\t\t\t\tthis.alpha = minValueNode;\n\t\t\t//\t\t\tSystem.out.println(\"alpha once: \"+this.alpha.getAccumulated());\n\t\t\t\t\t//\tThread.sleep(5000);\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t\tif(playerOneChildrenList.peek().parentNode!=null||node!=null)\n\t\t\t{\n\t\t\t//\tSystem.out.println(\"returning: \"+playerOneChildrenList.peek().getAccumulated());\n\t\t\t//\tSystem.out.println(500);\n\t\t\tplayerOneChildrenList.peek().parentNode.setAccumulated(playerOneChildrenList.peek().getAccumulated());\n\t\t\tplayerOneChildrenList.peek().parentNode.noPoll = playerOneChildrenList.peek().noPoll;\n\n\t\t\treturn playerOneChildrenList.poll().parentNode;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tplayerOneChildrenList.peek().nodeExpanded = counter;\n\t\t\t\treturn playerOneChildrenList.poll();\n\t\t\t}\n\t\t\n\t\t}else\n\t\tif(isMaximizing == false)//min\n\t\t{\n\t\t\tNode[][] copyOne = new Node[gameBoard.length][gameBoard.length];\n\t\t\tint currentEnescore = node.enemy;\n\t\t\tint nodesRx = node.maxrecordSearchedX;\n\t\t\tint nodesRy = node.maxrecordSearchedY;\n\t\t\tNode temNode = node;\n\t\t for (int i = 0; i < gameBoard.length; i++) {\n\t\t \tfor(int j =0;j<gameBoard.length;j++)\n\t\t \t{\t\n\t\t \t\tNode temp = new Node(gameBoard[i][j].getScore(),gameBoard[i][j].getX(),gameBoard[i][j].getY(),gameBoard[i][j].getOwnership());\n\t\t \t copyOne[i][j]=temp;\n\t\t \t}\n\t\t }\n\t\t\tPriorityQueue<Node> playerTwoChildrenList = new PriorityQueue<Node>(); \n\t\t\tQueue<Node> waitList = new LinkedList<Node>();\n\t\t\tboolean walkable = false;\n\t\n\t\t\t\tfor(int i = 0;i<gameBoard.length;i++)\n\t\t\t\t{\n\t\t\t\t\tfor(int j =0;j<gameBoard.length;j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(copyOne[i][j].getOwnership()==0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\twaitList.add(new Node(copyOne[i][j].getScore(),i,j,playerID));//everyPosition through the 2D array\n\t\t\t\t\t\twalkable = true;\n\t\t\t\t//\t\tcounter++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\tif(walkable == false)\n\t\t\t{\n\t\t\t\treturn node;\n\t\t\t}\n\t\t\t\n\t\t\tint waitSize = waitList.size();\n\n\t\t\tfor(int l = 0;l<waitSize;l++)\n\t\t\t{\n\n\t\t\t\tNode[][] newCopy = new Node[gameBoard.length][gameBoard.length];\n\t\t\t\tNode temT = temNode;\n\t\t\t for (int i = 0; i < gameBoard.length; i++) {\n\t\t\t \tfor(int j =0;j<gameBoard.length;j++)\n\t\t\t \t{\t\n\t\t\t \t\tNode temp = new Node(copyOne[i][j].getScore(),copyOne[i][j].getX(),copyOne[i][j].getY(),copyOne[i][j].getOwnership());\n\t\t\t \t\tnewCopy[i][j]=temp;\n\t\t\t \t}\n\t\t\t }\n\n\t\t\t\tNode takenNode = waitList.poll();\n\t\t\t\tcounter++;\n\t\t\t\tnewCopy[takenNode.getX()][takenNode.getY()].setOwnership(playerID);\n\t\t\n\t\t\t\ttakenNode.setAccumulated(node.getAccumulated());\n\n\t\t\t\ttakenNode.enemy= currentEnescore+newCopy[takenNode.getX()][takenNode.getY()].getScore();\n\t\t\t\t\n\t\t\t\tboolean connected = false;\n\t\t\t\tfor(int i = 0;i<dx.length;i++)\n\t\t\t\t{\n\t\n\t\t\t\t\t\tint newX = takenNode.getX()+dx[i];\n\t\t\t\t\t\tint newY = takenNode.getY()+dy[i];\n\t\t\t\t\t\tif((newX>=0&&newX<gameBoard.length)&&(newY>=0&&newY<gameBoard.length))\n\t\t\t\t\t\t{\n\t\t\t\t\t\tif(newCopy[newX][newY].getOwnership()==playerID)\n\t\t\t\t\t\t{\n\t\t\t\t\n\t\t\t\t\t\t\tconnected = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(connected == true)\n\t\t\t\t{\n\t\t\t\n\t\t\t\t\tfor(int i = 0;i<dx.length;i++)\n\t\t\t\t\t{\n\t\t\n\t\t\t\t\t\t\tint newX = takenNode.getX()+dx[i];\n\t\t\t\t\t\t\tint newY = takenNode.getY()+dy[i];\n\t\t\t\t\t\t\tif((newX>=0&&newX<gameBoard.length)&&(newY>=0&&newY<gameBoard.length))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(newCopy[newX][newY].getOwnership()!=playerID&&newCopy[newX][newY].getOwnership()!=0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.eatOpponent(newCopy, playerID, newX, newY);\n\t\t\t\t\t\t\t\ttakenNode.setAccumulated(takenNode.getAccumulated()-newCopy[newX][newY].getScore());\t\n\t\t\t\t\t\t\t\ttakenNode.enemy+=newCopy[newX][newY].getScore();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tint opponentID = 0;\n\t\t\t\tif(playerID == 1)\n\t\t\t\t{\n\t\t\t\t\topponentID = 2;\n\t\t\t\t}else if(playerID == 2)\n\t\t\t\t{\n\t\t\t\t\topponentID = 1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(playerTwoChildrenList.isEmpty()==false)\n\t\t\t\t{\n\t\t\t//\t\tSystem.out.println(\" C depth: \"+depth);\n\t\t\t\t//\tThread.sleep(300);\n\t\t\t\t\t\tNode maxValueNode = newAlphaBeta(takenNode,true,newCopy, opponentID, depth-1,true);\n\t\t\t\t\t\tcounter++;\n\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t//playeroneNode++;\n\t\t\t\t\t\tmaxValueNode.parentNode = new Node(node.getAccumulated(),node.getX(),node.getY(),node.getOwnership());\n\t\t\t\t\t\tif(this.alpha!=null)\n\t\t\t\t\t\t{\n\t\t\t\t//\t\tSystem.out.println(maxValueNode.getAccumulated()+\" \"+this.alpha.getAccumulated());\n\t\t\t\t\t//\tThread.sleep(5000);\n\t\t\t\t\t\tif(maxValueNode.getAccumulated()<this.alpha.getAccumulated())\n\t\t\t\t\t\t{\n\t\t\t\t\t//\t\tSystem.out.println(\"break l should be \"+waitSize+\" now: \"+l);\n\t\t\t\t\t\t\tplayerTwoChildrenList.add(maxValueNode);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t//node.noPoll = true;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tplayerTwoChildrenList.add(maxValueNode);\n\t\t\t\t\t//\tif(maxValueNode.noPoll == true)\n\t\t\t\t\t//\t{\n\t\t\t\t\t//\t\tSystem.out.println(\"the discard value: \"+maxValueNode.getAccumulated()+\" compareTo: \"+this.alpha.getAccumulated());\n\t\t\t\t\t//\t\tbreak;\n\t\t\t\t\t//\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t//\tSystem.out.println(\" D depth: \"+depth);\n\t\t\t\t//\tThread.sleep(300);\n\t\t\t\t\tNode maxValueNode = newAlphaBeta(takenNode,true,newCopy, opponentID, depth-1,false);\n\t\t\t\t\tcounter++;\n\t\t\t\t\t\n\t\t\t\t\tmaxValueNode.parentNode = new Node(node.getAccumulated(),node.getX(),node.getY(),node.getOwnership());\n\t\t\t\t\tif(this.alpha!=null)\n\t\t\t\t\t{\n\t\t\t\t\tif(maxValueNode.getAccumulated()<this.alpha.getAccumulated())\n\t\t\t\t\t{\n\t\t\t\t\t//\tSystem.out.println(\"break l should be \"+waitSize+\" now: \"+l);\n\t\t\t\t\t\tplayerTwoChildrenList.add(maxValueNode);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t//node.noPoll = true;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(depth == recordDepth-1)\n\t\t\t\t\t{\n\t\t//\t\t\t\tSystem.out.println(\"setting alpha\");\n\t\t\t\t\t\t//Thread.sleep(300);\n\t\t\t\n\t\t\t\t\t\t\tthis.beta = maxValueNode;\n\t\t\t\t\t\t\tSystem.out.println(\"beta: \"+this.beta.getAccumulated());\n\t\t\t\t\t\t\t//Thread.sleep(5000);\n\t\t//\t\t\tSystem.out.println(\"alpha once: \"+this.alpha.getAccumulated());\n\t\t\t\t//\tThread.sleep(5000);\n\t\t\t\t\t}\n\t\t\t\t\tplayerTwoChildrenList.add(maxValueNode);\n\t\t\t\t//\tif(maxValueNode.noPoll == true)\n\t\t\t\t//\t{\n\t\t\t\t//\t\t\n\t\t\t\t//\t\tbreak;\n\t\t\t\t//\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\tplayerTwoChildrenList.peek().parentNode.setAccumulated(playerTwoChildrenList.peek().getAccumulated());\n\n\t\t\treturn playerTwoChildrenList.poll().parentNode;\n\t\t}\n\t\treturn null;\n\t\n\t}", "public interface IPredictionService {\n\t\n\t\n\t/**\n\t * \n\t * Create an instance object of TestSet\n\t * \n\t * @param position\n\t * @return\n\t * @throws Exception\n\t */\n\tpublic Instances makeTestSet(String position) throws Exception;\n\t\n\t/**\n\t * Used a particular algorithm to train the Artificial Intelligence (AI)\n\t * @throws Exception\n\t */\n\tpublic void train() throws Exception;\n\t\n\t/**\n\t * Used to classify after train\n\t * @throws Exception\n\t */\n\tpublic void classify() throws Exception;\n\n}", "public static void main(String[] args) throws FileNotFoundException, IOException {\nfor (double b = 0.5; b < 0.51; b+=0.1) {\n for (double k = 4.40; k < 4.5; k+=0.5) {\n Machine.b = 0.5; //0.2 - ATCnon-delay\n Machine.k = 1.5; //1.4 - ATCnon delay\n int hits = 0;\n engineJob = new cern.jet.random.engine.MersenneTwister(99999);\n noise = new cern.jet.random.Normal(0, 1, engineJob);\n SmallStatistics[] result = new SmallStatistics[5];\n result[0] = new SmallStatistics();\n result[1] = new SmallStatistics();\n for (int ds = 0; ds < 2; ds++) {\n JSPFramework[] jspTesting = new JSPFramework[105];\n for (int i = 0; i < jspTesting.length; i++) {\n jspTesting[i] = new JSPFramework();\n jspTesting[i].getJSPdata(i*2 + 1);\n }\n //DMU - instances (1-80)//la - instances (81-120)\n //mt - instances (121/-123)//orb - instances (124-133)//ta -instances (134-173)\n //////////////////////////////////////////////\n for (int i = 0; i < jspTesting.length; i++) {\n double countEval = 0;\n double tempObj = Double.POSITIVE_INFINITY;\n double globalBest = Double.POSITIVE_INFINITY;\n boolean[] isApplied_Nk = new boolean[2]; //Arrays.fill(isApplied_Nk, Boolean.TRUE);\n int Nk = 0; // index of the Iterative dispatching rule to be used\n jspTesting[i].resetALL();\n boolean firstIteration = true;\n double countLargeStep = 0;\n do{\n countEval++;\n //start evaluate schedule\n jspTesting[i].reset();\n int N = jspTesting[i].getNumberofOperations();\n jspTesting[i].initilizeSchedule();\n int nScheduledOp = 0;\n\n //choose the next machine to be schedule\n while (nScheduledOp<N){\n\n Machine M = jspTesting[i].Machines[jspTesting[i].nextMachine()];\n\n jspTesting[i].setScheduleStrategy(Machine.scheduleStrategy.HYBRID );\n jspTesting[i].setPriorityType(Machine.priorityType.ATC);\n jspTesting[i].setNonDelayFactor(0.3);\n //*\n jspTesting[i].setInitalPriority(M);\n for (Job J:M.getQueue()) {\n double RJ = J.getReadyTime();\n double RO = J.getNumberRemainingOperations();\n double RT = J.getRemainingProcessingTime();\n double PR = J.getCurrentOperationProcessingTime();\n double W = J.getWeight();\n double DD = J.getDuedate();\n double RM = M.getReadyTime();\n double RWT = J.getCurrentOperationWaitingTime();\n double RFT = J.getFinishTime();\n double RNWT = J.getNextOperationWaitingTime();\n int nextMachine = J.getNextMachine();\n\n if (nextMachine==-1){\n RNWT=0;\n } else {\n RNWT = J.getNextOperationWaitingTime();\n if (RNWT == -1){\n RNWT = jspTesting[i].getMachines()[nextMachine].getQueueWorkload()/2.0;\n }\n }\n if (RWT == -1){\n RWT = M.getQueueWorkload()/2.0;\n }\n //J.addPriority((W/PR)*Math.exp(-maxPlus((DD-RM-PR-(RT-PR+J.getRemainingWaitingTime(M)))/(3*M.getQueueWorkload()/M.getNumberofJobInQueue())))); //iATC\n //J.addPriority((PR*PR*0.614577*(-RM-RM/W)-RT*PR*RT/W)\n // -(RT*PR/(W-0.5214191)-RM/W*PR*0.614577+RT*PR/(W-0.5214191)*2*RM/W));\n //J.addPriority(((W/PR)*((W/PR)/(RFT*RFT)))/(max(div((RFT-RT),(RWT/W)),IF(RFT/W-max(RFT-RT,DD),DD,RFT))+DD/RFT+RFT/W-max(RFT-RFT/W,DD))); //best TWT priorityIterative\n if (Nk==0)\n //J.addPriority(min(W/PR-RFT+min(RT,W/RFT),((min(RT,RNWT-RFT)/(RJ-min(RWT,RFT*0.067633785)))/(RJ-min(RWT,RFT*0.067633785))))/RFT);\n J.addPriority(min(W/PR-RFT+min(RT,W/RFT),((div(min(RT,RNWT-RFT),(RJ-min(RWT,RFT*0.067633785))))/(RJ-min(RWT,RFT*0.067633785))))/RFT);\n else\n J.addPriority(min((((W/PR)/RFT)/(2*RNWT+max(RO,RFT)))/(PR+RNWT+max(RO,RFT)),((W/PR)/RFT)/PR)/RFT);\n }\n //jspTesting[i].calculatePriority(M);\n jspTesting[i].sortJobInQueue(M);\n Job J = M.completeJob();\n if (!J.isCompleted()) jspTesting[i].Machines[J.getCurrentMachine()].joinQueue(J);\n nScheduledOp++;\n }\n double currentObj = -100;\n currentObj = jspTesting[i].getTotalWeightedTardiness();\n if (tempObj > currentObj){\n tempObj = currentObj;\n jspTesting[i].recordSchedule();\n Arrays.fill(isApplied_Nk, Boolean.FALSE);\n //System.out.println(\"Improved!!!\");\n }\n else {\n isApplied_Nk[Nk] = true;\n if (!isNextApplied(Nk, isApplied_Nk)) Nk = circleShift(Nk, isApplied_Nk.length);\n else {\n if (globalBest>tempObj) {\n globalBest = tempObj;\n jspTesting[i].storeBestRecordSchedule();\n } jspTesting[i].restoreBestRecordSchedule();\n if (countLargeStep<1) {\n tempObj = Double.POSITIVE_INFINITY;\n Arrays.fill(isApplied_Nk, Boolean.FALSE);\n jspTesting[i].shakeRecordSchedule(noise, engineJob, globalBest);\n countLargeStep++;\n }\n else break;\n }\n }\n firstIteration = false;\n \n } while(true);\n result[ds].add(jspTesting[i].getDevREFTotalWeightedTardiness(globalBest));\n if (jspTesting[i].getDevLBCmax()==0) hits++;\n System.out.println(jspTesting[i].instanceName + \" & \"+ globalBest + \" & \" + countEval);\n }\n }\n //jsp.schedule();\n //*\n System.out.println(\"*************************************************************************\");\n System.out.println(\"[ & \" + formatter.format(result[0].getMin()) + \" & \"\n + formatter.format(result[0].getAverage()) + \" & \" + formatter.format(result[0].getMax()) +\n \" & \" + formatter.format(result[1].getMin()) + \" & \"\n + formatter.format(result[1].getAverage()) + \" & \" + formatter.format(result[1].getMax()) + \"]\");\n //*/\n System.out.print(\"\"+formatter.format(result[0].getAverage()) + \" \");\n }\n System.out.println(\"\");\n}\n }", "public interface Searcher<T> {\r\n\t\r\n\t//the search method\r\n\tpublic Solution<T> search(Searchable<T> s);\r\n\t\r\n\t//get how many nodes were evaluated by the algorithm\r\n\tpublic int getNumberOfNodesEvaluated();\r\n}", "@Override\n public Algorithm getAlgorithm(String name, Properties properties, Problem problem) {\n if (name.equals(\"NSGAII\")) {\n TypedProperties typed_props = new TypedProperties(properties);\n int pop_size = typed_props.getInt(\"populationSize\", 100);\n Initialization initialization = makeInitializer(problem, pop_size);\n DominanceComparator comparator = new ParetoDominanceComparator();\n NondominatedSortingPopulation population = new NondominatedSortingPopulation(comparator);\n TournamentSelection selection =\n new TournamentSelection(2, new ChainedComparator(new ParetoDominanceComparator(),\n new CrowdingComparator()));\n Variation variation = OperatorFactory.getInstance().getVariation(\"ux+svum+sm\", properties, problem);\n return decorateWithPeriodicActions(\n new NSGAII(problem, population, null, selection, variation, initialization));\n }\n return null;\n }", "public interface Solver {\n String MESSY_FOLIAGE_STRATEGY = \"find_messy_foliage\";\n\n /**\n * Play an association.\n */\n void playAssociation(LivingEntity ply, Association assos, State eventType);\n\n /**\n * Find an association for a player particular foot. This will fetch the player\n * angle and use it as a basis to find out what block is below their feet (or\n * which block is likely to be below their feet if the player is walking on the\n * edge of a block when walking over non-emitting blocks like air or water).<br>\n * <br>\n * Returns NOT_EMITTER if no blocks are valid emitting blocks.<br>\n * Returns a string that begins with \"_NO_ASSOCIATION\" if a matching block was\n * found, but has no association in the blockmap.\n */\n Association findAssociation(LivingEntity ply, double verticalOffsetAsMinus, boolean isRightFoot);\n\n /**\n * Find an association for a certain block assuming the player is standing on\n * it, using a custom strategy which strategies are defined by the solver.\n */\n Association findAssociation(World w, BlockPos pos, String strategy);\n}", "public BruteforceAttack(int[] pt,int[] ct){this(pt,ct,8);}", "public abstract SolutionPartielle solutionInitiale();", "public interface ISimAnn {\r\n \r\n //defines the random number generator based on the passed in seed.\r\n public void setRNG(long seed);\r\n \r\n //starts search with inital, final, and change in temperature\r\n public void run(IEncoding solution, double Temp_i, double Temp_f, double alpha);\r\n\r\n}", "NFRSoftgoal createNFRSoftgoal();", "private void CreatingBeautyContent(int count,int typeSymmetry, int methodSearch) {\n\t\t\tConstraintsPlacement objConstraints= new ConstraintsPlacement(this);\r\n\t\t\t//Creating array with states\r\n\t\t\tArrayList<BlockNode> states = new ArrayList<BlockNode>();\r\n\t\t\t//Building the graph in a deph way\r\n\t \tGraphBuilder objGrapB= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB2= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB3= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB3a= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB4= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB5= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB6= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB7= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB8= new GraphBuilder(1);\r\n\t \t\r\n\t \tobjGrapB.setWparamether(wParamether);\r\n\t \tobjGrapB2.setWparamether(wParamether);\r\n\t \tobjGrapB3.setWparamether(wParamether);\r\n\t \tobjGrapB3a.setWparamether(wParamether);\r\n\t \tobjGrapB4.setWparamether(wParamether);\r\n\t \tobjGrapB5.setWparamether(wParamether);\r\n\t \tobjGrapB6.setWparamether(wParamether);\r\n\t \tobjGrapB7.setWparamether(wParamether);\r\n\t \tobjGrapB8.setWparamether(wParamether);\r\n\t \t\r\n\t \tint numElements=objElem.getNumberObjects();\r\n\t \tint numEnemies=objElem.getNumberObjectsEnemies();\r\n\t \tint globalControlSearch=0;\r\n\t \t\r\n\t \tdouble time6=0;\r\n\t \tdouble time7=0;\r\n\t \tdouble time3=0;\r\n\t \tdouble time4=0;\r\n\t \tdouble time5=0;\r\n\t \tdouble time8=0;\r\n\t \t\r\n\t \tdouble startTime=0;\r\n\t \tdouble stopTime=0;\r\n\t \t\r\n\t \tdouble sum3=0;\r\n\t \tdouble sum4=0;\r\n\t \tdouble sum5=0;\r\n\t \tdouble sum6=0;\r\n\t \tdouble sum7=0;\r\n\t \tdouble sum8=0;\r\n\r\n\t \t\r\n\t \t//Beststates=objGrapB.basicDepthSearch(mediumStraight,height,numElements,numElements,states,objConstraints, objElem.getFinalList(),objElem);\r\n\t \t//Beststates=objGrapB.relativePositionDepthSearch(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,-mediumStraight+2,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch);\r\n\t \t//Beststates=objGrapB.relativeTransPositionDepthSearch(mediumStraight,height,numElements,numElements,states,objConstraints, objElem.getFinalList(),objElem,-mediumStraight+1,mediumStraight-1,floorTileHeight,0,0,currentState,hTable);\r\n\t \t//Beststates=objGrapB.DepthSearchCenterFrame(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,1,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch);\r\n\t \t//Beststates=objGrapB.DepthSearchPruningAlt(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,1,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch);\r\n\t \t\r\n\t \r\n\r\n\t \r\n\t //3.3) Brute-force search\r\n\t //objElem.setFinalList(objElem.getFinalListNoOrder());\r\n\t \tfor(int i=0;i<1;i++)\r\n\t \t{\r\n\t \t\tstartTime = System.currentTimeMillis();\r\n\t \t\tBeststates3=objGrapB3.DepthSearchCenterFrameNoPruningNoRegionsNoObjects(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,0,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch,8,typeSymmetry);\r\n\t \t\tstopTime = System.currentTimeMillis();\r\n\t \t\ttime3 = stopTime - startTime;\r\n//\t \t\tround(time3,2);\r\n//\t \t\tdouble nodes3=round((double)objGrapB3.getCounterIDs(),2);\r\n//\t \t\tSystem.out.println(objGrapB3.bestSymmetryV+\" \"+time3+\" \"+((objGrapB3.getCounterIDs())));\r\n\t \t\tsum3=sum3+time3;\r\n\t \t}\r\n\t \ttime3=sum3/1;\r\n\t \ttime3=round(time3,2);\r\n\t //System.out.println(\"Time Brute-force search \"+elapsedTime);\r\n\t \t\r\n\t \r\n\t \r\n\t //3.7) B&B+heuristic\r\n\t //objElem.setFinalList(objElem.getFinalListNoOrder());\r\n\t \tfor(int i=0;i<1;i++)\r\n\t \t{\r\n\t \t\tstartTime = System.currentTimeMillis();\r\n\t \t\tBeststates7=objGrapB7.depthSearchBBHeuristic(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,0,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch,8,typeSymmetry);\r\n\t \t\tstopTime = System.currentTimeMillis();\r\n\t \t\ttime7 = stopTime - startTime;\r\n//\t \t\tround(time7,2);\r\n//\t \t\tdouble nodes7=round((double)objGrapB3.getCounterIDs(),2);\r\n//\t \t\tSystem.out.println(objGrapB6.bestSymmetryV+\" \"+time6+\" \"+((objGrapB6.getCounterIDs())));\r\n\t \t\tsum7=sum7+time7;\r\n\t \t}\r\n\t \ttime7=sum7/1;\r\n\t \ttime7=round(time7,2);\r\n\t //System.out.println(\"Time B&B+heuristic + region ordering \"+elapsedTime);\r\n\t \t\r\n\t \t\r\n\t \t\r\n//\t \tif(objGrapB3.bestSymmetryV<objGrapB5.bestSymmetryV)\r\n//\t \t{\r\n//\t \t\tdouble bestSYmmetry=objGrapB3.bestSymmetryV;\r\n//\t \t\t//System.out.println(\"bestSym \"+bestSYmmetry);\r\n//\t \t\tBestGlobalstates=Beststates3;\r\n//\t \t\t\r\n//\t \t}\r\n//\t \telse\r\n//\t \t{\r\n//\t \t\tdouble bestSYmmetry=objGrapB5.bestSymmetryV;\r\n//\t \t\t//System.out.println(\"bestSym \"+bestSYmmetry);\r\n//\t \t\tBestGlobalstates=Beststates5;\r\n//\t \t}\r\n\t \t\r\n\t \tBestGlobalstates=Beststates7;\r\n\t \r\n\t \r\n\t \t//**System.out.println(\"Simetry 0-> Brute-force search order \"+objGrapB3a.bestSymmetryV);\t\r\n\t \t//System.out.println(\"Simetry 1-> Brute-force search \"+objGrapB3.bestSymmetryV);\t \t\r\n\t \t//System.out.println(\"Simetry 2-> B&B+oldheuristic \"+objGrapB4.bestSymmetryV);\r\n\t \t//**System.out.println(\"Simetry 3-> B&B+heuristic + object ordering \"+objGrapB2.bestSymmetryV);\t \t\r\n\t \t//System.out.println(\"Simetry 4-> B&B+ region + leviheuristic\"+objGrapB5.bestSymmetryV);\r\n\t \t//**System.out.println(\"Simetry 5-> B&B+heuristic + region ordering + object ordering \"+objGrapB.bestSymmetryV);\r\n\t \t//System.out.println(\"Simetry 6-> B&B+heuristic + leviheuristic \"+objGrapB6.bestSymmetryV);\r\n\t \t//System.out.println(\"Simetry 7-> B&B+oldoldheuristic \"+objGrapB7.bestSymmetryV);\r\n\t \t\r\n\t \t//**System.out.println( \"States 0 \"+objGrapB3a.getCounterIDs() );\r\n\t \t//System.out.println( \"States 1 \"+objGrapB3.getCounterIDs() );\r\n\t \t//System.out.println( \"States 2 \"+objGrapB4.getCounterIDs() );\r\n\t \t//**System.out.println( \"States 3 \"+objGrapB2.getCounterIDs() );\t \t\t \t\r\n\t \t//System.out.println( \"States 4 \"+objGrapB5.getCounterIDs() );\r\n\t \t//**System.out.println( \"States 5 \"+objGrapB.getCounterIDs() );\r\n\t \t//System.out.println( \"States 6 \"+objGrapB6.getCounterIDs() );\r\n\t \t//System.out.println( \"States 7 \"+objGrapB7.getCounterIDs() );\r\n\t \t\r\n\t \tdouble TimeRate7=time3/time7;\r\n\t \tdouble TimeRate6=time3/time6;\r\n\t \tdouble TimeRate5=time3/time5;\r\n\t \t\r\n\t \tTimeRate7=round(TimeRate7,2);\r\n\t \tTimeRate6=round(TimeRate6,2);\r\n\t \tTimeRate5=round(TimeRate5,2);\r\n\t \t\r\n\t \tdouble NodesRate7=(double)objGrapB3.getCounterIDs()/(double)objGrapB7.getCounterIDs();\r\n\t \tdouble NodesRate6=(double)objGrapB3.getCounterIDs()/(double)objGrapB6.getCounterIDs();\r\n\t \tdouble NodesRate5=(double)objGrapB3.getCounterIDs()/(double)objGrapB5.getCounterIDs();\r\n\t \t\r\n\t \tNodesRate7=round(NodesRate7,2);\r\n\t \tNodesRate6=round(NodesRate6,2);\r\n\t \tNodesRate5=round(NodesRate5,2);\r\n\r\n\t \t\r\n\t \t\r\n\r\n\t //imprimiendo los estados visitados\r\n\t /*\r\n\t Iterator<BlockNode> nombreIterator = states.iterator();\r\n\t while(nombreIterator.hasNext()){\r\n\t \tBlockNode elemento = nombreIterator.next();\r\n\t \tSystem.out.print(elemento.getID()+\" / \");\r\n\t }*/\r\n\t \r\n\t //here we are painting as the best branch founded\r\n\t \r\n\t //System.out.println(\"nene \"+BestGlobalstates.size());\r\n\t Iterator<BlockNode> nombreIterator = BestGlobalstates.iterator();\r\n\t while(nombreIterator.hasNext()){\r\n\t \tBlockNode elemento = nombreIterator.next();\r\n\t \t//System.out.print(elemento.getID()+\"(\"+elemento.getX()+\" \"+elemento.getY()+\" ) - \"+elemento.getType()+\" \"+elemento.getIdElement()+ \" / \");\r\n\t }\r\n\t \r\n\t \r\n\t //Here we will put the elements on the tile\r\n\t try {\r\n\t Level levelScreen=PaintElements(BestGlobalstates,this);\r\n\t Screen objScreen=new Screen();\r\n\t\t\tobjScreen.SaveScreen(levelScreen,odds,objElem);\r\n \t\tInformacoesTelas info = new InformacoesTelas();\r\n\t CopiaArquivos copiador = new CopiaArquivos();\r\n\t \r\n\t info = info.carregaInfoTela(\"infoTela\");\r\n\t\t\tinfo.setOutrasVariaveis(0, 0); // Salva outras informacoes da Tela\r\n\t\t\tinfo.salvaInfoTela(\"infoTela\", info);\t\t\t\t\t\r\n\t\t\tcopiador.copy(\"\" + count, \"Screens/\");\r\n\t\t\t\r\n\t } catch (ClassNotFoundException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}", "public BeautyCustomizedLevel(int width, int height, long seed, int difficulty, int type,int count, Hashtable hsObjectsScreen, int typeSymmetry,int[] odds,ElementsToPlace objElem, double wParamether, int methodSearch)\r\n\t {\r\n\t\t\t\r\n\t this(width, height);\r\n\t this.objElem=objElem;\r\n\t this.odds=odds;\r\n\t this.wParamether=wParamether;\r\n\t creatManySearchesObjectsNLG(seed, difficulty, type,count,hsObjectsScreen,typeSymmetry,methodSearch);\r\n\t //System.out.println(\"constructorcorrect\");\r\n\t \r\n\t }", "public static void main(String[] args) {\n\t\tString typeBaseline = \"Optimal Tophat\";\n\t\tint windowSize = 3;\n\t\tBaseline b = new Baseline(typeBaseline, windowSize);\n\n\t\t// Make ImzMLWrapper\n\t\tString imzmlPath = \"/Users/parker/work/imzMLPracticeDatasets/s042_continuous-1/S042_Continuous.imzML\";\n\t\tImzMLWrapper imzml = new ImzMLWrapper(imzmlPath);\n\n\t\t// Make experiment.\n\t\tBaselineExperiments exper = new BaselineExperiments(b, imzml, BaselineExperiments.f_LOGARITHMIC,\n\t\t\t\tBaselineExperiments.m_EUCLIDEAN_METRIC, typeBaseline, \"Logarithmic\", windowSize);\n\t\t\n\t\texper.doExperiment();\n\t\t\n\t\texper.Window = 7;\n\t\texper.baseline.setWindowSize(7);\n\t\texper.doExperiment();\n\t\t\n\t\texper.Window = 11;\n\t\texper.baseline.setWindowSize(11);\n\t\texper.doExperiment();\n\t}", "public LiteralValuePartitionAlgorithm() {\n\t\t\n\t}", "@Override\n\tpublic void boostingIBK() {\n\t\talgo.boostingIBK();\n\t}", "public interface IDetectionAlgorithm {\n\n /**\n * Creates a database where an algorithm would store its model\n *\n * @param modelName\n * Name of the database\n * @param dataAccessObject\n * An object of IDataAccessObject\n * @param trainingSettings\n * Training Settings\n * @throws TotalADSDBMSException\n * An exception related to the DBMS\n * @throws TotalADSGeneralException\n * An exception related to validation of parameters\n */\n public void initializeModelAndSettings(String modelName, IDataAccessObject dataAccessObject, String[] trainingSettings) throws TotalADSDBMSException, TotalADSGeneralException;\n\n /**\n * Returns the training settings/options of an algorithm as setting name at\n * index i and value at index i+1.\n *\n * @return Array of Strings as options/settings\n */\n public String[] getTrainingSettings();\n\n /**\n * Returns the testing options/settings of an algorithm as option name at\n * index i and value ate index i+1. It takes database name and connection\n * information, in case if the model (database) is already created and\n * previously modified settings exist in the database\n *\n * @param database\n * Database name\n * @param dataAccessObject\n * IDataAccessObject object\n * @return An array of String as options/settings\n * @throws TotalADSDBMSException\n * An exception related to the DBMS\n */\n public String[] getTestSettings(String database, IDataAccessObject dataAccessObject) throws TotalADSDBMSException;\n\n /**\n * Validates the testing options and saves them into the database. On error\n * throws exception\n *\n * @param options\n * Settings array\n * @param database\n * Model(database name)\n * @param dataAccessObject\n * An object to access database\n * @throws TotalADSGeneralException\n * An exception related to validation of parameters\n * @throws TotalADSDBMSException\n * An exception related to the DBMS\n */\n public void saveTestSettings(String[] options, String database, IDataAccessObject dataAccessObject) throws TotalADSGeneralException, TotalADSDBMSException;\n\n /**\n * Returns settings selected for a model by a user during training and\n * testing. These would be displayed in the properties view.\n *\n * @param database\n * Model(database) name\n * @param dataAccessObject\n * An object to access database\n * @return An array of selected settings\n * @throws TotalADSDBMSException\n * An exception related to the DBMS\n */\n public String[] getSettingsToDisplay(String database, IDataAccessObject dataAccessObject) throws TotalADSDBMSException;\n\n /**\n * An algorithm will take a trace through this function. Some algorithms can\n * train on the traces as they come and some need to wait till the last\n * trace. Caller will make isLastTrace true when the lastTrace will be sent\n * to this function. This function is called for every trace separately\n *\n * @param trace\n * Trace iterator to a trace\n * @param isLastTrace\n * True if the trace is the last trace, else false\n * @param database\n * Database/mode name\n * @param connection\n * Connection object\n * @param outStream\n * Use this object to display the events during processing\n * @throws TotalADSGeneralException\n * An exception related to validation of parameters\n * @throws TotalADSDBMSException\n * An exception related to DBMS\n * @throws TotalADSReaderException\n * An exception related to the trace reader\n */\n public void train(ITraceIterator trace, Boolean isLastTrace, String database, IDataAccessObject connection, IAlgorithmOutStream outStream) throws TotalADSGeneralException, TotalADSDBMSException, TotalADSReaderException;\n\n /**\n * This function is called after the train function has finished processing\n * and has built a model. This function is called for every single trace in\n * the validation set separately\n *\n * @param trace\n * Trace iterator to one trace\n * @param database\n * Database name\n * @param dataAccessObject\n * Connection name\n * @param isLastTrace\n * True if the trace is the last trace, else false\n * @param outStream\n * Use this object to display the events during processing\n * @throws TotalADSGeneralException\n * An exception related to validation of parameters\n * @throws TotalADSDBMSException\n * An exception related to DBMS\n * @throws TotalADSReaderException\n * An exception related to the trace reader\n */\n public void validate(ITraceIterator trace, String database, IDataAccessObject dataAccessObject, Boolean isLastTrace, IAlgorithmOutStream outStream) throws TotalADSGeneralException, TotalADSDBMSException, TotalADSReaderException;\n\n /**\n * This function evaluates an existing model in the database on the traces\n * in the test set. It is called for every single trace separately.\n *\n * @param trace\n * Trace iterator to a single trace\n * @param database\n * Database name\n * @param dataAccessObject\n * Data accessor\n * @param outputStream\n * Use this object to display the events during processing\n * @return An object of type Result containing the evaluation information of\n * a trace\n * @throws TotalADSGeneralException\n * An exception related to validation of parameters\n * @throws TotalADSDBMSException\n * An exception related to DBMS\n * @throws TotalADSReaderException\n * An exception related to reader\n */\n public Results test(ITraceIterator trace, String database, IDataAccessObject dataAccessObject, IAlgorithmOutStream outputStream) throws TotalADSGeneralException, TotalADSDBMSException, TotalADSReaderException;\n\n /**\n * Returns the total anomalies during testing\n *\n * @return total anomalies\n **/\n public Double getTotalAnomalyPercentage();\n\n /**\n * Returns the graphical result in the form of a chart if any for a trace.\n * Currently unimplemented.\n *\n * @param traceIterator\n * An iterator a trace\n * @return A chart object\n **/\n public org.swtchart.Chart graphicalResults(ITraceIterator traceIterator);\n\n /**\n * Returns a self created instance of the algorithm\n *\n * @return An instance of the algorithm\n **/\n public IDetectionAlgorithm createInstance();\n\n // /////////////////////////////////////////////////////////////////////////////////\n // An algorithm registers itself with the AlgorithmFactory\n // Each derived class must implement the following static method\n // public static void registerAlgorithm() throws TotalADSGeneralException;\n // /////////////////////////////////////////////////////////////////////////////////\n /**\n * Gets the name of the algorithm\n *\n * @return The name\n **/\n public String getName();\n\n /**\n * Gets the description of an algorithm\n *\n * @return The description\n */\n public String getDescription();\n\n /**\n * Returns the acronym of the algorithm; should only be three to four\n * characters long. This acronym is very important as it is used in the name\n * of a model and facilitates in finding out which algorithm represents the\n * model\n *\n * @return Acronym\n */\n public String getAcronym();\n\n /**\n * Returns true if online learning is supported. If false is returned it\n * would mean the algorithm can only train in batch mode and live training\n * is not supported\n *\n * @return True if online learning is supported, else false\n */\n public boolean isOnlineLearningSupported();\n}", "private void addPR(){\n \n try {\n Print.prln(\"Initialising ANNIE...\");\n\n // create a serial analyser controller to run ANNIE with\n annieController = (SerialAnalyserController) Factory.createResource(\n \"gate.creole.SerialAnalyserController\",\n Factory.newFeatureMap(),\n Factory.newFeatureMap(),\n \"ANNIE_\" + Gate.genSym());\n FeatureMap features = Factory.newFeatureMap(); // use default parameters\n\n // adding Annie PRs : i. document reset\n features.clear();\n ProcessingResource documentReset = (ProcessingResource)\n Factory.createResource(\"gate.creole.annotdelete.AnnotationDeletePR\", features);\n annieController.add(documentReset);\n\n // adding Annie PR : ii. english tokeniser\n features.clear();\n ProcessingResource englishTokeniser = (ProcessingResource)\n Factory.createResource(\"gate.creole.tokeniser.DefaultTokeniser\", features);\n annieController.add(englishTokeniser);\n\n // ading inhouse built PR: iii.. gazetteer\n features.clear();\n features.put(\"listsURL\", Converter.getURL(gazetteer));\n ProcessingResource myAnnieGaz = (ProcessingResource)\n Factory.createResource(\"gate.creole.gazetteer.DefaultGazetteer\", features);\n annieController.add(myAnnieGaz);\n\n // adding Annie PR : iv. fake sentence splitter\n features.clear();\n ProcessingResource fakeSentenceSplitter = (ProcessingResource)\n Factory.createResource(\"gate.clone.ql.FakeSentenceSplitter\", features);\n annieController.add(fakeSentenceSplitter);\n\n //. ading inhouse built PR: v. jape grammar 1\n features.clear();\n features.put(\"grammarURL\", Converter.getURL(jape1));\n ProcessingResource myJape1 = (ProcessingResource)\n Factory.createResource(\"gate.creole.Transducer\", features);\n annieController.add(myJape1);\n\n // adding Annie PRs : vi.. regex sentence splitter\n features.clear();\n ProcessingResource regexSentenceSplitter = (ProcessingResource)\n Factory.createResource(\"gate.creole.splitter.RegexSentenceSplitter\", features);\n annieController.add(regexSentenceSplitter);\n\n // adding Annie PRs :vii. pos tagger\n features.clear();\n ProcessingResource posTagger = (ProcessingResource)\n Factory.createResource(\"gate.creole.POSTagger\", features);\n annieController.add(posTagger);\n\n // ading inhouse built PR: viii. jape grammar 2\n features.clear();\n features.put(\"grammarURL\", Converter.getURL(jape2));\n ProcessingResource myJape2 = (ProcessingResource)\n Factory.createResource(\"gate.creole.Transducer\", features);\n annieController.add(myJape2);\n Print.prln(\"...PR loaded\");\n features.clear();\n }\n catch (ResourceInstantiationException ex) {\n Out.prln(ex);\n }\n }", "TabuSearchwithGreedy(double wl, double ar, TransactionClass tc, Partition p,\n\t\t\tint useCase) {\n\t\tsuper(wl, ar, tc, p, useCase);\n\t\t// TODO Auto-generated constructor stub\n\t}", "public interface Predictor {\n //\n // Inner interface --------------------------------------------\n //\n\n /**\n * Decission algorithm to select kernel for time series predictor.\n */\n public static interface PredictorSelectionStrategy {\n /**\n * Injects kernel to kernel-MA according to predictor internal data.\n */\n public void injectKernel(final Predictor predictor);\n\n /**\n * Maximum size of kernels\n */\n public int kernelSize();\n\n /**\n * Creates a brand new predictor.\n */\n public PredictorListener buildPredictor();\n }\n\n\n\n //\n // Interface methods -------------------------------------------\n //\n\n /**\n * Emits a single forecast based on learned values.\n */\n public double predict(final Calendar when);\n\n /**\n * Emits a forecast based on learned values.\n */\n public double[] predictVector(final Calendar when);\n\n /**\n * Memorizes several values at the same time.\n */\n public void learnVector(final Calendar when, final double[] vals);\n\n /**\n * Memorizes several values at the same time.\n */\n public void learnVector(final Calendar when, final List<Double> vals);\n\n\n /**\n * Memorizes one single value.\n */\n public void learnValue(final Calendar when, final double val);\n\n /**\n * Empties memory and predictions restoring initial state.\n */\n public void reset();\n\n /**\n * Returns the human name of the predictor.\n */\n public String toString();\n}", "public static void main(String[] args) {\n INeighbor neighbor = new RandomNeighbor();\n IEvaluator evaluator = new BentEvaluator();\n ISolver solver = new RandomSearch(neighbor, evaluator);\n\n BoolFunction solution = solver.run();\n System.out.println(solution);\n }", "public FFANNAdaptiveBackPropagationJSP()\n\t{\n\t\t//run(network, numberInputNeurons, numberHiddenNeurons, numberOutputNeurons, trainingSet);\n\t}", "public interface SearchAlgorithm {\n\t/**\n\t * Searches the state space for a solution.\n\t * @param root\n\t * The root state to begin search from.\n\t * @param expanded_list\n\t * The expanded list in order of expansion. Filled by function.\n\t * @param goal\n\t * The goal state representation used to test if we reached the goal state.\n\t * @return\n\t * The search results containing all needed information about the search and the results.\n\t */\n\tSearchResult search(State root, List<State> expanded_list, State goal);\n}", "@Override\n\tprotected void initClassifierParameters() {\n\t\tlinearKernel = new SelectedParameterItem(\"Linear kernel\", \"-K 0\");\n\t\tpolynomialKernel = new SelectedParameterItem(\"Polynomial kernel\", \"-K 1\");\n\t\tradialBasisKernel = new SelectedParameterItem(\"Radial basis kernel\", \"-K 2\");\n\t\tsigmoidKernel = new SelectedParameterItem(\"Sigmoid kernel\", \"-K 3\");\n\t\tcSVC = new SelectedParameterItem(\"C-SVC\", \"-S 0\");\n\t\tnuSVC = new SelectedParameterItem(\"&nu;-SVC\", \"-S 1\");\n\t\tsvmType = ParameterUtilities.createSelectedParameter(\"SVM type\", cSVC, nuSVC);\n\t\tkernelType = ParameterUtilities.createSelectedParameter(\"Kernel type\", linearKernel, polynomialKernel, radialBasisKernel,\n\t\t\t\tsigmoidKernel);\n\t\tkernelDegree = new Parameter(3, \"Degree in kernel function\", Parameter.TYPE.INTEGER, \"-D\", \"classifier.degree\");\n\t\tkernelGamma = new Parameter(0.5, \"&gamma; in kernel function\", Parameter.TYPE.DOUBLE, \"-G\", \"classifier.gamma\");\n\t\tkernelCoefficient = new Parameter(0.0, \"Coefficient in kernel function\", Parameter.TYPE.DOUBLE, \"-R\", \"classifier.coef0\");\n\t\tparameterC = new Parameter(1.0, \"Parameter C\", Parameter.TYPE.DOUBLE, \"-C\", \"classifier.cost\");\n\t\tparameterNu = new Parameter(0.5, \"Parameter &nu;\", Parameter.TYPE.DOUBLE, \"-N\", \"classifier.nu\");\n\t\ttolerance = new Parameter(0.001, \"Tolerance of termination criterion\", Parameter.TYPE.DOUBLE, \"-E\");\n\t\tweight = new Parameter(null, \"Weight, set C of class i to (weight &times; C)\", Parameter.TYPE.STRING, \"-W\");\n\t}", "public ACGJ5(Infrastructure i)\n\t{\trandom = new Random();\n\t\ttlc = new BestFirstTLC(i);\n\t\tsetInfrastructure(i);\n\t}", "public knnImpute(String input_tra, String input_tst, String output_tra,\r\n\t\t\tString output_tst, int neighbors) {\r\n\t\tinput_train_name = input_tra;\r\n\t\tinput_test_name = input_tst;\r\n\t\toutput_train_name = output_tra;\r\n\t\toutput_test_name = output_tst;\r\n\t\tnneigh = neighbors;\r\n\t\tIS = new InstanceSet();\r\n\t\tIStest = new InstanceSet();\r\n\t}", "@SubL(source = \"cycl/inference/harness/inference-balanced-tactician-motivation.lisp\", position = 24008) \n public static final SubLObject balanced_strategy_problem_is_the_rest_of_an_early_removalP(SubLObject problem, SubLObject strategy) {\n {\n SubLObject set_contents_var = inference_datastructures_problem.problem_dependent_links(problem);\n SubLObject basis_object = set_contents.do_set_contents_basis_object(set_contents_var);\n SubLObject state = NIL;\n for (state = set_contents.do_set_contents_initial_state(basis_object, set_contents_var); (NIL == set_contents.do_set_contents_doneP(basis_object, state)); state = set_contents.do_set_contents_update_state(state)) {\n {\n SubLObject restriction_link = set_contents.do_set_contents_next(basis_object, state);\n if ((NIL != set_contents.do_set_contents_element_validP(state, restriction_link))) {\n if ((NIL != inference_datastructures_problem_link.problem_link_has_typeP(restriction_link, $kw9$RESTRICTION))) {\n {\n SubLObject non_focal_problem = inference_datastructures_problem_link.problem_link_supported_problem(restriction_link);\n SubLObject set_contents_var_16 = inference_datastructures_problem.problem_dependent_links(non_focal_problem);\n SubLObject basis_object_17 = set_contents.do_set_contents_basis_object(set_contents_var_16);\n SubLObject state_18 = NIL;\n for (state_18 = set_contents.do_set_contents_initial_state(basis_object_17, set_contents_var_16); (NIL == set_contents.do_set_contents_doneP(basis_object_17, state_18)); state_18 = set_contents.do_set_contents_update_state(state_18)) {\n {\n SubLObject join_ordered_link = set_contents.do_set_contents_next(basis_object_17, state_18);\n if ((NIL != set_contents.do_set_contents_element_validP(state_18, join_ordered_link))) {\n if ((NIL != inference_datastructures_problem_link.problem_link_has_typeP(join_ordered_link, $kw12$JOIN_ORDERED))) {\n if ((NIL != inference_worker_join_ordered.join_ordered_link_restricted_non_focal_linkP(join_ordered_link, restriction_link))) {\n if ((non_focal_problem == inference_worker_join_ordered.join_ordered_link_non_focal_problem(join_ordered_link))) {\n if ((NIL != balanced_strategy_chooses_to_propagate_new_root_motivation_to_restricted_non_focal_problemP(strategy, problem, join_ordered_link))) {\n return T;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n return NIL;\n }", "public abstract StandaloneAlgorithm createAlgorithm();", "public ANNTopology training(int repeat, double splitPercent) throws IOException, ExceptionWrongParameterClass\r\n\t{\n\t this.trainingNetwork = (networkTopology) this.originalTrainingNetwork.cloneNetwork();\r\n\t algorithm.setIn(inputTrain);\r\n algorithm.setTarget(targetTrain);\r\n\t algorithm.initializeForRNA(this.trainingNetwork, this.learnVelocity);\t\r\n\t \r\n //aca debo setear la \"trainingNetwork\" con una copia de la red original\r\n\r\n double calcValidationError = 1;\r\n double calcError = 1;\r\n\t for (int cicle = 0; cicle < repeat; cicle++) {\r\n\t\t\t//para que no salga en el 1º loop\r\n\t\t\tfor (int i=0; i < age && calcError > errorTarget ; i++) {\r\n\t\t\t\talgorithm.runAlgorithm();\r\n\t\t\t\tcalcError = algorithm.getCuadraticMediumError();\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\treturn this.trainingNetwork;\r\n\t\r\n\t\t\r\n\t}", "public StrategyByGA(double ProbabilityOfCooperatingGivenCooperation,\n double ProbabilityOfCooperatingGivenDefection) {\n\n name = \"Strategy Developed by the Genetic Algorithm\";\n opponentLastMove = 1;\n proCoopGivCoop = ProbabilityOfCooperatingGivenCooperation;\n proCoopGivDef = ProbabilityOfCooperatingGivenDefection;\n }", "Constraint createConstraint();", "Constraint createConstraint();", "BehavioralFeatureConcept createBehavioralFeatureConcept();", "public ExperimentController(int n, int m, int is, int fs, int iss, int rps) { \n\t\tthis.n = n;\n\t\tthis.m = m;\n\t\tinitialSize = is; \n\t\trepetitionsPerSize = rps; \n\t\tincrementalSizeStep = iss; \n\t\tfinalSize = fs; \n\t\tresultsPerStrategy = new ArrayList<>();\n\n\t}", "@Test\r\n void testSoftMajorityAlwaysDefect() {\r\n AlwaysDefect testStrat = new AlwaysDefect();\r\n SoftMajority testStrat2 = new SoftMajority();\r\n ArrayList<Integer> payoffs = new ArrayList<>(Arrays.asList(3, 5, 0, 1));\r\n Game game = new Game(testStrat, testStrat2, 3, payoffs);\r\n game.playGame();\r\n assertEquals(testStrat2.getPoints(), 2, \"SoftMajority strategy not functioning correctly\");\r\n }", "public interface IOptAlgorithm {\n\n\t/**\n\t * @return Array of weights.\n\t */\n\tpublic double[] run();\n}", "public interface BuildStrategy {\n\n public void execute(GameSession session, int village) throws InterruptedException;\n\n}", "public abstract Rank<String,String> query(String input) throws ClassificationException;", "public interface SharedStrategy extends InstitutionalStatement, Sanction {\n}", "void initialize(Graph graph, Node targetStart, Node searchStart, ExpandCounter counter);", "@SuppressWarnings(\"null\")\r\n\t@Override\r\n\tpublic PWPSolution createSolution(InitialisationMode mode) {\n\t\t\r\n\t\tif (mode == InitialisationMode.RANDOM) {\r\n\t\t\r\n\t\tint[] solutions = new int[getNumberOfLocations()];//array of solutions\r\n\t\t\r\n\t\tfor (int i = 0 ; i <= getNumberOfLocations() -1 ; i++) { //enumerate the array, giving each location an integer value\r\n\t\t\t\r\n\t\t\tsolutions[i]= i;\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\tCollections.shuffle(Arrays.asList(solutions)); //shuffle the array\r\n\t\t\r\n\t\tSolutionRepresentation solution = new SolutionRepresentation(solutions); //create a new solution representation using the array of ints\r\n\t\t\r\n\t\tObjectiveFunctionInterface objfunc = getPWPObjectiveFunction(); //get the objective function to be used \r\n\r\n\t\tPWPSolution sol = new PWPSolution(solution, objfunc.getObjectiveFunctionValue(solution)); //create the new PWPSolution using the solution representation and the value of the objective function applied to the solution\r\n\t\t\r\n\t\treturn sol;\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\telse {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "public static void main (String[] args){\n\n Graph test = new Graph(30,\"/main/graphs/test30\");\n Graph test2 = new Graph(5,\"/main/graphs/graph5\");\n Graph g1 = new Graph(30,\"/main/graphs/graph30\");\n Graph g2 = new Graph(50,\"/main/graphs/graph50\");\n Graph g3 = new Graph(55,\"/main/graphs/graph55\");\n Graph g4 = new Graph(60,\"/main/graphs/graph60\");\n Graph g5 = new Graph(65,\"/main/graphs/graph65\");\n Graph g6 = new Graph(70,\"/main/graphs/graph70\");\n Graph g7 = new Graph(75,\"/main/graphs/graph75\");\n Graph g8 = new Graph(80,\"/main/graphs/graph80\");\n Graph g9 = new Graph(85,\"/main/graphs/graph85\");\n Graph g10 = new Graph(90,\"/main/graphs/graph90\");\n Graph g11= new Graph(100,\"/main/graphs/graph100\");\n Graph g12= new Graph(200,\"/main/graphs/graph200\");\n Graph g13= new Graph(200,\"/main/graphs/graph200_2\");\n\n Algo algo = new Algo(test);\n System.out.println(\"Graphe test : \" + algo.runNtimes((int) (10*Math.pow(2,30/2))));\n\n algo = new Algo(g1);\n System.out.println(\"Graphe a 30 sommets : \" + algo.runNtimes((int) (10*Math.pow(2,30/2))));\n\n algo = new Algo(g2);\n System.out.println(\"Graphe a 50 sommets : \" +algo.runNtimes((int) (10*Math.pow(2,50/2))));\n\n algo = new Algo(g3);\n System.out.println(\"Graphe a 55 sommets : \" + algo.runNtimes((int) (10*Math.pow(2,55/2))));\n\n algo = new Algo(g4);\n System.out.println(\"Graphe a 60 sommets : \" + algo.runNtimes((int) (10*Math.pow(2,60/2))));\n\n algo = new Algo(g5);\n System.out.println(\"Graphe a 65 sommets : \" + algo.runNtimes((int) (10*Math.pow(2,65/2))));\n\n algo = new Algo(g6);\n System.out.println(\"Graphe a 70 sommets : \" + algo.runNtimes((int) (10*Math.pow(2,70/2))));\n\n algo = new Algo(g7);\n System.out.println(\"Graphe a 75 sommets : \" + algo.runNtimes((int) (10*Math.pow(2,75/2))));\n\n algo = new Algo(g8);\n System.out.println(\"Graphe a 80 sommets : \" + algo.runNtimes((int) (10*Math.pow(2,80/2))));\n\n algo = new Algo(g9);\n System.out.println(\"Graphe a 85 sommets : \" + algo.runNtimes((int) (10*Math.pow(2,85/2))));\n\n algo = new Algo(g10);\n System.out.println(\"Graphe a 90 sommets : \" + algo.runNtimes((int) (10*Math.pow(2,90/2))));\n\n algo = new Algo(g11);\n System.out.println(\"Graphe a 100 sommets : \" + algo.runNtimes((int) (10*Math.pow(2,100/2))));\n\n algo = new Algo(g12);\n System.out.println(\"Graphe a 200 sommets : \" + algo.runNtimes((int) (10*Math.pow(2,200/2))));\n\n algo = new Algo(g13);\n System.out.println(\"Graphe a 200 sommets : \" + algo.runNtimes((int) (10*Math.pow(2,200/2))));\n\n }", "public void initialize(Instance inst){\n\n\t\t\tDoubleVector weights = CreateDoubleVector(inst.numAttributes(),0) ;// extended length ;\n// \t\tVarianceRationREduction\n\t\t\tif (learningCriteriaOption.getChosenIndex()==1) {\n\t\t\t\tdefaultRule = new RuleVR(this);\n\t\t\t}else {\n\t\t\t\tdefaultRule = new RuleErrR(this);\n\t\t\t}\n\n\t\t\tVector<FuzzySet> terms = new Vector<FuzzySet>();\n\t\t\tfor (int i = 0; i < inst.numAttributes(); i++) {\n\t\t\t\tif (inst.classIndex()==i)\n\t\t\t\t\tcontinue ;\n\t\t\t\tterms.add(new FuzzySet.LOToRO()) ;\n\t\t\t}\n\t\t\n\t\t\tdefaultRule.setAll(terms, weights);\n\t\t\tdefaultRule.setPrefixAndVersion(\"\", currentSystemVersion);\n\t\t\trs.add(defaultRule);\n\t\t\tcurrentValidCandidates = new Vector<FuzzyRuleExtendedCandidate>() ;\n\t\t\tcurrentNonReadyCandidates = new Vector<FuzzyRuleExtendedCandidate>() ;\n\t\t\tinitialized = true ;\n\t\n\t\t\tif (statsAttributes.size()==0){\n\t\t\t\tfor (int j = 0; j < inst.numAttributes(); j++) {\n\t\t\t\t\tif (inst.classIndex()==j)\n\t\t\t\t\t\tcontinue ;\n\t\t\t\t\tstatsAttributes.add(new IncrementalVariance()) ;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public ImpactScore(\n @JsonProperty(\"name\") String name,\n @JsonProperty(\"feature\") Feature<Impact> feature) {\n\n super(name, feature);\n this.feature = Objects.requireNonNull(feature, \"Oops! Feature can't be null!\");\n }", "public static INeighbor explanationBased(IntVar... vars) {\n Model model = vars[0].getModel();\n// INeighbor neighbor1 = new ExplainingObjective(model, 5, 0);\n INeighbor neighbor2 = new ExplainingCut(model, 5, 0);\n INeighbor neighbor3 = new RandomNeighborhood(vars, 5, 0);\n return sequencer(/*neighbor1, */neighbor2, neighbor3);\n }", "protected LearningAbstractAgent(){}", "public RandomNeighborhoodOperator(int nbRelaxedVars)\n{\n\tthis(nbRelaxedVars, 0);\n}", "@Override\n\tpublic Algorithm configure(Properties configuration) throws JMException {\n\t\tAlgorithm algorithm;\n\t\tSelection selection;\n\t\tCrossover crossover;\n\t\tMutation mutation;\n\n\t\tHashMap parameters; // Operator parameters\n\n\t\t// Creating the algorithm.\n\t\talgorithm = new NSGAII(problem_);\n\n\t\t// Algorithm parameters\n\t\tpopulationSize_ = Integer\n\t\t\t\t.parseInt(configuration.getProperty(\"populationSize\", String.valueOf(populationSize_)));\n\t\tmaxEvaluations_ = Integer\n\t\t\t\t.parseInt(configuration.getProperty(\"maxEvaluations\", String.valueOf(maxEvaluations_)));\n\t\talgorithm.setInputParameter(\"populationSize\", populationSize_);\n\t\talgorithm.setInputParameter(\"maxEvaluations\", maxEvaluations_);\n\n\t\t// Mutation and Crossover for Real codification\n\t\tcrossoverProbability_ = Double\n\t\t\t\t.parseDouble(configuration.getProperty(\"crossoverProbability\", String.valueOf(crossoverProbability_)));\n\t\tparameters = new HashMap();\n\t\tparameters.put(\"probability\", crossoverProbability_);\n\t\tcrossover = CrossoverFactory.getCrossoverOperator(\"SinglePointCrossover\", parameters);\n\n\t\tmutationProbability_ = Double\n\t\t\t\t.parseDouble(configuration.getProperty(\"mutationProbability\", String.valueOf(mutationProbability_)));\n\t\tparameters = new HashMap();\n\t\tparameters.put(\"probability\", mutationProbability_);\n\t\tmutation = MutationFactory.getMutationOperator(\"BitFlipMutation\", parameters);\n\n\t\t// Selection Operator\n\t\tparameters = null;\n\t\tselection = SelectionFactory.getSelectionOperator(\"BinaryTournament2\", parameters);\n\n\t\t// Add the operators to the algorithm\n\t\talgorithm.addOperator(\"crossover\", crossover);\n\t\talgorithm.addOperator(\"mutation\", mutation);\n\t\talgorithm.addOperator(\"selection\", selection);\n\n\t\treturn algorithm;\n\t}", "public CvBoostParams()\r\n {\r\n\r\n super( CvBoostParams_0() );\r\n\r\n return;\r\n }", "public abstract Solution<T> search(Searchable<T> s);", "public OpticalElements() {\n }", "public static void main(String[] args) {\n\t\tinit(Hx.Manhattan, CostMode.Def);\n\t\tMaze smallMaze = new Maze(\"mazes/tinySearch.txt\");\n\t\tAgent astarAg = new Agent(smallMaze);\n\t\tRecorder rd = new Recorder();\n\t\tSearch.AstarMulOptimal(astarAg, smallMaze, rd);\n\t\t//System.out.println(rd.getExpandNodes());\n\t}", "public interface GeneticOptimizer {\r\n\tpublic int getGenPopulation();\r\n\tpublic void setGenPopulation(Integer popSize);\r\n\tpublic int getGenIterations();\r\n\tpublic void setGenIterations(Integer iterations);\r\n\r\n}" ]
[ "0.6241232", "0.52751094", "0.51124996", "0.51055866", "0.50654763", "0.5047742", "0.5002073", "0.49921173", "0.49887985", "0.4981936", "0.49684337", "0.49608532", "0.4937287", "0.4910856", "0.49068347", "0.4873534", "0.48559028", "0.4815395", "0.48090896", "0.4805954", "0.48058537", "0.4799535", "0.47722358", "0.47513503", "0.47451365", "0.47307488", "0.47219163", "0.47178861", "0.47159427", "0.47054684", "0.46842742", "0.46546793", "0.46466595", "0.4635439", "0.46351686", "0.46333075", "0.4628817", "0.46020982", "0.46012065", "0.45993268", "0.45844045", "0.4563314", "0.456177", "0.4552815", "0.4541161", "0.45262796", "0.45221433", "0.45206532", "0.45105258", "0.4504647", "0.45032483", "0.44947678", "0.44828048", "0.44353792", "0.4429859", "0.44244337", "0.4424035", "0.44240326", "0.44211212", "0.4416573", "0.44111767", "0.44065025", "0.439854", "0.43952477", "0.43934652", "0.43931782", "0.4391964", "0.4389728", "0.4376355", "0.4372719", "0.4362102", "0.43589517", "0.43534315", "0.43529215", "0.43525547", "0.43441015", "0.43412638", "0.4334614", "0.43331277", "0.43331277", "0.43301082", "0.4325556", "0.43186283", "0.43177062", "0.43152127", "0.43128964", "0.4308354", "0.4306891", "0.43061972", "0.42993185", "0.42973328", "0.42945328", "0.42918673", "0.428425", "0.42797214", "0.4279548", "0.42789948", "0.42767525", "0.42759967", "0.4274696", "0.4273891" ]
0.0
-1
Use the last conflict heuristic as a pluggin to improve a former search heuristic STRAT
public static AbstractStrategy lastConflict(Solver SOLVER) { return lastConflict(SOLVER, SOLVER.getStrategy()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static LinkedList<Integer> localSearch2Opt(File fileNameWithPath, int kNeighborHood ) throws Exception{\n\t\t\n\t\tString traceString = \"\";\n\t\tdouble bestCost = Double.POSITIVE_INFINITY;\n\t\tLinkedList<Integer> bestTspList = null;\n\t\tdouble bestCycleTime = Double.POSITIVE_INFINITY;\n\n\t\tif (Project.runId == -1 )\n\t\t\tProject.runId = 1;\n\n\t\t/* \n\t\t * read the file and build the cost table\n\t\t */\n parseEdges(fileNameWithPath);\n\n /*\n\t\t * time starts once you read the data\n */\n\t\tdouble baseTime = System.nanoTime();\n\n\t\t/*\n\t\t * invoking furthest insertion algorithm to get the tsp\n\t\t */\n\t\tlong startNodeSeed = (long)(1000.0*generator.nextDouble());\n\t\tLinkedList<Integer> currentTspList = FurthestInsertion.generateTSP(Project.sourceGTree,startNodeSeed);\n\t\t\n\t\tdouble currentTspCost = tspCost(currentTspList);\n\n\t\tbestTspList = currentTspList;\n\t\tbestCost = currentTspCost;\n\t\tbestCycleTime = System.nanoTime() - baseTime;\n\n\t\t/* print the trace file */\n\t\ttraceString = String.format(\"%.2f, %d\",Math.round(((System.nanoTime()-baseTime)/nanosecs)*100.0)/100.0,Math.round(bestCost));\n\t\tprintTrace(runId,traceString);\n\n\t\t/*\n\t\t * remove the last node as it matches the first\n\t\t */\n\t\tcurrentTspList.removeLast();\n\n\t\twhile ( true )\n\t\t{\n\t\t\t/*\n\t\t\t * reached cutoff time\n\t\t\t */\n\t\t\tif ( System.nanoTime()-baseTime >= Project.cutoffTimeSeconds*nanosecs ) {\n\t\t\t\ttimedOut=true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tdouble cycleStartTime = System.nanoTime();\n\n\t\t\tLinkedList<Integer> newTspList = currentTspList;\n\n\t\t\t/* do a 2 opt search in current k=5 neighborhood to get a newtsp */\n\t\t\t/* 1. Pick the first random element in the current tsp */\n\t\t\tint element2 = (int)((double)(newTspList.size()-1) * generator.nextDouble());\n\t\t\tint element1 = element2 - 1;\n\t\t\tif ( element1 == -1 ){\n\t\t\t\telement1 = newTspList.size()-1;\n\t\t\t}\n\t\t\t\n int delta;\n\n\t\t\t/*\n\t\t\t * search in the neighborhood specified\n * if not specified search all\n\t\t\t */\n if ( kNeighborHood != -1 ) {\n\t\t\t /* We want to search in the specified k=n neighborhoods of element1 */\n\t\t\t delta= (int)(2*kNeighborHood*generator.nextDouble()) - kNeighborHood;\n } else {\n\t\t\t delta= (int)((newTspList.size()-1)*generator.nextDouble()) - (int)(newTspList.size()/2);\n\t\t\t}\n\n\t\t\tif ( delta == 0 ) {\n\t\t\t\tdelta = 2;\n\t\t\t} else if ( delta == 1 ) {\n\t\t\t\tdelta = 2;\n\t\t\t} else if ( delta == -1) {\n\t\t\t\tdelta = -2; }\n\n\t\t\tint element4 = element2 + delta;\n\n\t\t\tif ( element4 < 0 ) {\n\t\t\t\telement4 = newTspList.size()+element4;\n\t\t\t}else if ( element4 >= newTspList.size() ) {\n\t\t\t\telement4 = element4-(newTspList.size()-1);\n\t\t\t}\n\n\t\t\tint element3 = element4 -1;\n\t\t\tif ( element3 == -1 ){\n\t\t\t\telement3 = newTspList.size()-1;\n\t\t\t}\n\n\n\t\t\t/* \n\t\t\t * the new tsp will have element2->element4.......element1->element3....\n\t\t\t */\n\t\t\tInteger vertex_3 = newTspList.get(element3);\n\t\t\tnewTspList.set(element3,newTspList.get(element2));\n\t\t\tnewTspList.set(element2,vertex_3);\n\n\t\t\t/*\n\t\t\t * from element2+1 to element3-1 swap to reverse their order\n\t\t\t */\n\t\t\twhile ( element2 < element3 ){\n\t\t\t\telement3 = element3-1;\n\t\t\t\tif ( element3 == -1 ) {\n\t\t\t\t\telement3 = newTspList.size()-1;\n\t\t\t\t}\n\n\t\t\t\telement2 = element2 + 1;\n\t\t\t\tif ( element2 == newTspList.size() ) {\n\t\t\t\t\telement3 = 0;\n\t\t\t\t}\n\n\t\t\t\tInteger tempVertex = newTspList.get(element2);\n\t\t\t\tnewTspList.set(element2,newTspList.get(element3));\n\t\t\t\tnewTspList.set(element3,tempVertex);\n\n\t\t\t}\n\n\t\t\tdouble newTspCost = tspCost(newTspList);\n\n\t\t\t/* if new local search solution is better than eariler take the search and continue search\n\t\t\t */\n\t\t\tif ( newTspCost <= currentTspCost ){\n\t\t\t\tcurrentTspList = newTspList;\n\t\t\t\tcurrentTspCost = newTspCost;\n\t\t\t} else {\n\t\t\t/* if new local search solution is not better than eariler \n\t\t\t */\n\t\t\t\tcontinue;\n\t\t\t}\n\t\n\t\t\t//Subtract the start time from the finish time to get the actual algorithm running time; divide by 10e6 to convert to milliseconds\n\t\t\tdouble cycleTime = (System.nanoTime()-cycleStartTime);\n\n\t\t\t/* first improvement , take the best each time */\n\t\t\tif ( newTspCost < bestCost ) {\n\t\t\t\tbestCost = newTspCost;\n\t\t\t\tbestTspList = newTspList;\n\t\t\t\tbestCycleTime = cycleTime;\n\t\t\t\t/* print the trace file */\n\t\t\t\ttraceString = String.format(\"%.2f, %d\",Math.round(((System.nanoTime()-baseTime)/nanosecs)*100.0)/100.0,Math.round(bestCost));\n\t\t\t\tappendToTraceFile(runId,traceString);\n\n\t\t\t\tif ( bestCost <= optimalCost )\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\n\t\t/* print the sol file */\n\t\tprintSol(runId,bestTspList,bestCost);\n\n\t\t/* print the tab results file */\n\t\tappendTabResults(runId,bestCycleTime,bestCost,bestTspList);\n\n\t\treturn bestTspList;\n\n\t}", "@Override\n public Matching solve() {\n while (!matching.freeElements().isEmpty()) {\n /* get first element from the queue */\n Element element = problem.element(matching.freeElements().poll().elemId());\n\n /* get its preference element: looping through its list => by the level value */\n while (!element.preferences().isEmpty()) {\n Element pref = problem.element(element.preferences().poll().elemId());\n\n /* check if is an acceptable partner for current preference */\n if (!pref.accepts(element)) {\n continue;\n }\n\n /* verify the availability of its current preference */\n if (problem.isAvailable(pref.elemId())) {\n problem.element(pref.elemId()).setAvailability(false);\n problem.element(element.elemId()).setAvailability(false);\n matching.addPair(new Pair(element, pref));\n break;\n }\n else {\n /* if the preference is already taken, get the best one between current element and its current match */\n String currMatchName = matching.getElementPair(pref);\n Element currentMatch = pref.getIndex(currMatchName);\n Element elem = pref.getIndex(element.elemId());\n\n /* when current element is better than the current match */\n if (currentMatch.level() > elem.level()){\n if (matching.isFree(elem))\n matching.removeFreeElement(elem);\n\n problem.element(pref.elemId()).setAvailability(false);\n problem.element(element.elemId()).setAvailability(false);\n problem.element(currentMatch.elemId()).setAvailability(true);\n\n /* add the current pair to the Matching and the old match for the woman to the free list */\n matching.addPair(new Pair(problem.element(element.elemId()), problem.element(pref.elemId())));\n\n matching.addFreeElement(problem.element(currMatchName));\n break;\n }\n else {\n matching.addPair(new Pair(currentMatch, pref));\n }\n }\n }\n /* when man was rejected by all its preferences */\n if (element.preferences().isEmpty())\n element.setAvailability(true);\n }\n problem.getSets().get(0).getElements().stream().filter(Element::isAvailable).forEach(Element::remakeList);\n problem.getSets().get(0).getElements().stream().filter(Element::isAvailable).forEach(element -> matching.addFreeElement(problem.element(element.elemId())));\n\n return matching;\n }", "public abstract OptimisationSolution getBestSolution();", "private void applyBestRepairPlan(){\n\t\t\n\t\tSet<OWLAxiom> best_repair=null;\n\t\t\t\t\n\t\tdouble min_conf = 10000;\n\t\tdouble conf;\n\t\t\n\t\tmappingVisitor.setDeleteAxiom(false);//used in confidence\n\t\t\n\t\tfor (Set<OWLAxiom> repair : repair_plans){\n\t\t\t\n\t\t\tconf = getConfidence4Plan(repair);\n\t\t\t\n\t\t\tif (min_conf > conf){\n\t\t\t\tmin_conf = conf;\n\t\t\t\tbest_repair = repair;\n\t\t\t}\n\t\t}\n\t\t\n\t\tmappingVisitor.setDeleteAxiom(true);\n\t\t\n\t\tfor (OWLAxiom ax : best_repair){\t\t\t\n\t\t\tax.accept(mappingVisitor);\n\t\t\t//It also deletes axiom from structures\n\t\t\t//TODO add to conflicts\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public interface ConflictRegionStrategy extends AlgStrategy {}", "public void aEstrella2 (String input)\r\n\t{\r\n\t\tNode root_aEstrella2 = new Node (input);\r\n\t\tNode current = new Node(root_aEstrella2.getState());\r\n\t\t\r\n\t\tHeuristicComparator aEstrella_comparator = new HeuristicComparator();\r\n\t\tPriorityQueue<Node> queue_gbfs = new PriorityQueue<Node>(12, aEstrella_comparator);\r\n\t\tArrayList<String> visited = new ArrayList<String>();\r\n\t\tArrayList<String> children = new ArrayList<String>();\r\n\t\t\r\n\t\tint nodes_popped = 0;\r\n\t\tint pqueue_max_size = 0;\r\n\t\tint pq_size = 0;\r\n\t\t\r\n\t\tcurrent.cost = 0;\r\n\t\t\r\n\t\twhile(!goal_aEstrella2)\r\n\t\t{\r\n\t\t\tvisited.add(current.getState());\r\n\t\t\tchildren = Successor.findChildren(current.getState());\r\n\t\t\t\r\n\t\t\tfor (String a : children)\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tif (visited.contains(a))\r\n\t\t\t\t{\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNode nino = new Node(a);\r\n\t\t\t\t\tcurrent.children_nodes.add(nino);\r\n\t\t\t\t\tvisited.add(nino.getState());\r\n\t\t\t\t\t\r\n\t\t\t\t\tint cost = isCost(current.getState(), nino.getState());\r\n\t\t\t\t\tnino.cost = cost;\r\n\t\t\t\t\tnino.parent = current;\r\n\t\t\t\t\tint manhattanD = manhattanDistance(nino.getState(), root_aEstrella2.getState());\r\n\t\t\t\t\tnino.setTotalCost(nino.parent.getTotalCost() + nino.cost);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// f(n) = g(n) + h(n)\r\n\t\t\t\t\tnino.setHeuristicCost(nino.getTotalCost() + manhattanD);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (!queue_gbfs.contains(nino))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tqueue_gbfs.add(nino);\r\n\t\t\t\t\t\tpq_size++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Repeated State checking. Removing the same node from PQ if the path cost is less then the current one \r\n\t\t\t\t\telse if (queue_gbfs.contains(nino))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfor (Node original : queue_gbfs)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (original.equals(nino))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tNode copy = original;\r\n\t\t\t\t\t\t\t\tif (nino.getHeuristicCost() < copy.getHeuristicCost())\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tqueue_gbfs.remove(copy);\r\n\t\t\t\t\t\t\t\t\tqueue_gbfs.add(nino);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcurrent = queue_gbfs.poll();\r\n\t\t\tnodes_popped++;\r\n\t\t\t\r\n\t\t\tif (pq_size > pqueue_max_size)\r\n\t\t\t{\r\n\t\t\t\tpqueue_max_size = pq_size;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tpq_size--;\r\n\t\t\tgoal_aEstrella2 = isGoal(current.getState());\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tgoal_aEstrella2 = false;\r\n\t\tSystem.out.println(\"A*2 Solved!!\");\r\n\t\tSolution.performSolution(current, root_aEstrella2, nodes_popped, pqueue_max_size);\r\n\t}", "@Override\n List<NodeData> pathFind() throws NoPathException {\n System.out.println(\"Starting Scenic\");\n\n frontier.add(start);\n\n while(!frontier.isEmpty()) {\n StarNode current = frontier.getLast();\n frontier.removeLast(); // pop the priority queue\n if(current.getXCoord() == goal.getXCoord() && current.getYCoord() == goal.getYCoord()) {\n // If we are at the goal, we need to backtrack through the shortest path\n System.out.println(\"At target!\");\n finalList.add(current); // we have to add the goal to the path before we start backtracking\n while(!(current.getXCoord() == start.getXCoord() && current.getYCoord() == start.getYCoord())) {\n finalList.add(current.getPreviousNode());\n current = current.getPreviousNode();\n System.out.println(current.getNodeID());\n }\n return finalList;\n }\n else {\n // we need to get all the neighbor nodes, identify their costs, and put them into the queue\n LinkedList<StarNode> neighbors = current.getNeighbors();\n // we also need to remove the previous node from the list of neighbors because we do not want to backtrack\n neighbors.remove(current.getPreviousNode());\n\n for (StarNode newnode : neighbors) {\n int nodePlace = this.listContainsId(frontier, newnode);\n if(nodePlace > -1) {\n if (frontier.get(nodePlace).getF() > actionCost(newnode) + distanceToGo(newnode, goal)) {\n System.out.println(\"Here\");\n frontier.remove(frontier.get(nodePlace));\n newnode.setPreviousNode(current);\n frontier.add(newnode);\n newnode.setF(actionCost(newnode) + distanceToGo(newnode, goal));\n }\n }\n else {\n newnode.setPreviousNode(current);\n frontier.add(newnode);\n newnode.setF(actionCost(newnode) + distanceToGo(newnode, goal));\n }\n\n // This fixes the problem with infinitely looping elevators (I hope)\n if(current.getNodeType().equals(\"ELEV\") && newnode.getNodeType().equals(\"ELEV\")) {\n for (Iterator<StarNode> iterator = newnode.neighbors.iterator(); iterator.hasNext();) {\n StarNode newneighbor = iterator.next();\n if (newneighbor.getNodeType().equals(\"ELEV\")) {\n // Remove the current element from the iterator and the list.\n iterator.remove();\n }\n }\n }\n if(current.getNodeType().equals(\"STAI\") && newnode.getNodeType().equals(\"STAI\")) {\n for (Iterator<StarNode> iterator = newnode.neighbors.iterator(); iterator.hasNext();) {\n StarNode newneighbor = iterator.next();\n if (newneighbor.getNodeType().equals(\"STAI\")) {\n // Remove the current element from the iterator and the list.\n iterator.remove();\n }\n }\n }\n // this is where the node is put in the right place in the queue\n Collections.sort(frontier);\n }\n }\n }\n throw new NoPathException(start.getLongName(), goal.getLongName());\n }", "public static AbstractStrategy lastConflict(Solver SOLVER, AbstractStrategy STRAT) {\n return lastKConflicts(SOLVER, 1, STRAT);\n }", "protected IPlanningGoal selectGoal(){ \n List<IPlanningGoal> relevantGoals = representation.getRelevantGoals(body);\n \n //If we have failed to find plans for high priority goals and environment has not changed, lets try some \n //lower priority ones\n if(numFailuresSinceLastImportantEnvChange < relevantGoals.size()){\n return relevantGoals.get(numFailuresSinceLastImportantEnvChange);\n } else {\n //tried all relevant goals but all failed, lets try it once more\n representation.setMarker(body);\n numFailuresSinceLastImportantEnvChange = 0;\n return relevantGoals.get(0);\n }\n }", "private void findBestPath(){\n\t\t// The method will try to find the best path for every starting point and will use the minimum\n\t\tfor(int start = 0; start < this.getDimension(); start++){\n\t\t\tfindBestPath(start);\t\n\t\t}\t\n\t}", "private BGPPath internalPathSelection(Collection<BGPPath> possList, boolean avoidDecoys) {\n BGPPath currentBest = null;\n int currentRel = -4;\n\n for (BGPPath tPath : possList) {\n\n /*\n * If we're doing avoidance based on ignoring local preference, then\n * for the first pass we're literally just going to throw out all\n * routes that are NOT clean, this is corrected in path selection if\n * this leaves us w/ no viable routes\n */\n if (avoidDecoys && (this.avoidMode == AS.AvoidMode.LOCALPREF || this.avoidMode == AS.AvoidMode.LEGACY)) {\n if (tPath.containsAnyOf(this.botSet)) {\n continue;\n }\n }\n\n /*\n * If we have no best path currently selected, the first one is best\n * by default\n */\n if (currentBest == null) {\n currentBest = tPath;\n currentRel = this.getRel(currentBest.getNextHop());\n continue;\n }\n\n /*\n * Local pref based on relationship step\n */\n int newRel = this.getRel(tPath.getNextHop());\n if (newRel > currentRel) {\n currentBest = tPath;\n currentRel = newRel;\n continue;\n }\n\n /*\n * If local pref is the same, move on to the next critera\n */\n if (newRel == currentRel) {\n /*\n * If we're inserting the decision to route around decoys after\n * local pref, but before path length, do so here\n */\n if (this.avoidMode == AS.AvoidMode.PATHLEN) {\n if (avoidDecoys && currentBest.containsAnyOf(this.botSet) && !tPath.containsAnyOf(this.botSet)) {\n currentBest = tPath;\n currentRel = newRel;\n continue;\n }\n if (avoidDecoys && !currentBest.containsAnyOf(this.botSet) && tPath.containsAnyOf(this.botSet)) {\n continue;\n }\n }\n\n if (currentBest.getPathLength() > tPath.getPathLength()) {\n currentBest = tPath;\n currentRel = newRel;\n continue;\n } else if (currentBest.getPathLength() == tPath.getPathLength()) {\n if (avoidDecoys && this.avoidMode == AS.AvoidMode.TIEBREAK\n && currentBest.containsAnyOf(this.botSet) && !tPath.containsAnyOf(this.botSet)) {\n currentBest = tPath;\n currentRel = newRel;\n continue;\n }\n if (avoidDecoys && this.avoidMode == AS.AvoidMode.TIEBREAK\n && !currentBest.containsAnyOf(this.botSet) && tPath.containsAnyOf(this.botSet)) {\n continue;\n }\n\n if (tPath.getNextHop() < currentBest.getNextHop()) {\n currentBest = tPath;\n currentRel = newRel;\n }\n }\n }\n }\n\n return currentBest;\n }", "public SolutionType getBestSolution();", "private LineString pickBestGrowthPossibility3(final LineString stem, List<LineString> lookAheads) {\t\t\n\t\tif (lookAheads == null || lookAheads.size() == 0) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t//sort by:\n\t\t//1. is moving away?\n\t\t//2. number of coordinates in line\n\t\t//3. average elevation rise (above the lowest coord) divided by length of line\n\t\t// e..g if Z values of growth possibility are 618m, 625m, 634m, the average will be the average\n\t\t//Z above the lowest coord will be 7.6m. that value will be divided by the line length\n\t\tfinal AvgElevationSectionFitness avgElevationFitness = new AvgElevationSectionFitness(getTinEdges());\n\t\tComparator<LineString> lookAheadComparator = new Comparator<LineString>() {\n\t\t\tpublic int compare(LineString s1, LineString s2) {\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t//is end of extension moving away\n\t\t\t\tboolean m1 = LineGrowthHelpers.isMovingAway(stem, s1.getCoordinateN(s1.getNumPoints()-1));\n\t\t\t\tboolean m2 = LineGrowthHelpers.isMovingAway(stem, s2.getCoordinateN(s2.getNumPoints()-1));\n\t\t\t\tif (m1 != m2) {\n\t\t\t\t\treturn m1 ? -1 : 1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t//is start of extension moving away\n\t\t\t\t\tboolean a1 = LineGrowthHelpers.isMovingAway(stem, s1.getCoordinateN(1));\n\t\t\t\t\tboolean a2 = LineGrowthHelpers.isMovingAway(stem, s2.getCoordinateN(1));\n\t\t\t\t\tif (a1 != a2) {\n\t\t\t\t\t\treturn a1 ? -1 : 1;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\n\t\t\t\t\t\tif (s1.getNumPoints() == s2.getNumPoints()) {\n\t\t\t\t\t\t\ttry {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tdouble fit1 = (avgElevationFitness.fitness(s1) - s1.getCoordinateN(0).getZ()) / s1.getLength();\n\t\t\t\t\t\t\t\tdouble fit2 = (avgElevationFitness.fitness(s2) - s2.getCoordinateN(0).getZ()) / s2.getLength();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (fit1<0) {\n\t\t\t\t\t\t\t\t\tfit1 = 1/fit1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (fit2<0) {\n\t\t\t\t\t\t\t\t\tfit2 = 1/fit2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\treturn fit1 > fit2 ? -1 \n\t\t\t\t\t\t\t\t\t\t : fit1 < fit2 ? 1 \n\t\t\t\t\t\t\t\t\t : 0;\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\tcatch(IOException e) {\n\t\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\treturn s1.getNumPoints() > s2.getNumPoints() ? -1 \n\t\t\t\t\t\t\t\t\t : s1.getNumPoints() < s2.getNumPoints() ? 1 \n\t\t\t\t\t\t\t\t : 0; \n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tlookAheads.sort(lookAheadComparator);\n\t\t\n\t\treturn lookAheads.get(0);\n\t}", "@Override\n\tpublic BoardLocation findBestLocWhenStuck() {\n\t\treturn null;\n\t}", "public static void main(String[] args) throws IOException {\n util.importUtility();\n \n // Create a list of numbers for the players; values initialized\n // to zero. This is a strategy profile.\n ArrayList<Integer> moves = new ArrayList<>();\n for(int i = 0; i < util.getNumPlayers(); i++)\n moves.add(0);\n \n // This list of Strings will store newly found strategy profiles.\n ArrayList<String> strats = new ArrayList<>();\n String s;\n \n // Indexes for players.\n int p1 = 0;\n int p2 = 1;\n \n // Loop control.\n int i = 0;\n \n // Index of beginning and end of the sink equilibrium best response\n // cycle found by generating the the list of profiles.\n // Once we've found said cycle, it's as if there's a long string\n // of strategy profiles still attached to it. This index allows us\n // to *snip* it off.\n int index = 0;\n \n // BEGIN!!! Let's hope this works....\n while(i < 1000) {\n // The next two if statements check if a best response to the\n // current strategy profile for p1 or p2 can be found. If it can, then\n // we check if the new strategy profile *is already in* our list.\n // If not, we add it in. If so, we note the index of where the \n // matching profile is in our current list and throw it on top anyway\n // (it's a String that will be the last line of our results file).\n if (bestResponse(moves, p1)) {\n s = newVertex(moves);\n if(strats.indexOf(s) == -1)\n strats.add(s);\n else {\n index = strats.indexOf(s);\n strats.add(s);\n break;\n }\n }\n if (bestResponse(moves, p2)) {\n s = newVertex(moves);\n if(strats.indexOf(s) == -1)\n strats.add(s);\n else {\n index = strats.indexOf(s);\n strats.add(s);\n break;\n }\n }\n i++;\n \n // This is what happens if finding the solution is *a bit* less \n // trivial than we'd hope. Once we try looking for best responses \n // between the two players a thousand times, we reset the iterator;\n // clear the profiles list, and increment the p2 index... changing\n // the player with which p1 would like to play. Then we do it again.\n if (i == 1000) {\n i = 0;\n strats.clear();\n p2++;\n }\n \n // If p1 has tried trading moves back in forth with EVERY player in \n // the list, then the player at the next index can try doing so.\n if (p2 == 20) {\n p1++;\n p2 = 0;\n }\n }\n // This algorithm will continue until it finds a sink or every player \n // has traded blows with each other. Note that there's no mechanism in \n // place to reset p1's counter; so if it ever reached that point it \n // would completely fail. In that case, it may not really be all that\n // useful to reset it anyway.\n \n // This is where the *snipping* takes place as described above.\n for (int j = 0; j < index; j++) {\n strats.remove(0);\n }\n \n // Print the result. If we've found one, of course.\n strats.stream().forEach(System.out::println);\n \n }", "@Override\n public Matching stableMarriageGaleShapley_hospitaloptimal(Matching marriage) {\n int m = marriage.getHospitalCount();\n int n = marriage.getResidentCount();\n\n ArrayList<ArrayList<Integer>> hospital_preference = marriage.getHospitalPreference();\n ArrayList<ArrayList<Integer>> resident_preference = marriage.getResidentPreference();\n\n ArrayList<Integer> hospitalSlots = marriage.getHospitalSlots();\n\n ArrayList<Integer> residentMatching = new ArrayList<Integer>();\n arrlistInit(residentMatching, n, -1, false);\n\n /*list of residents that each hospital can propose to\n * Initially equals the hospital_preference list*/\n ArrayList<ArrayList<Integer>> residentsToProposeTo = new ArrayList<ArrayList<Integer>>();\n for (int i = 0; i < m; i++) //O(m)\n residentsToProposeTo.add(new ArrayList<Integer>(hospital_preference.get(i)));\n\n /*list of hospitals that still can propose(has free spots and hasn't proposed to every resident)*/\n ArrayList<Integer> proposing = new ArrayList<Integer>();\n arrlistInit(proposing, m, 0, true); //O(n)\n\n /*Keep track of each hospital matched residents*/\n ArrayList<ArrayList<Integer>> hospitalResidents = new ArrayList<ArrayList<Integer>>(0);\n for (int i = 0; i < m; i++) //O(m)\n hospitalResidents.add(new ArrayList<Integer>(0));\n\n /*Looping through each hospital in the proposing list\n * Even though some hospital may be added again in the proposing list, each hospital can propose at most once to each resident\n * So total running time of the loop will be O(m*n)*/\n while (!proposing.isEmpty()) {\n for (int hospitalIndex = 0; hospitalIndex < proposing.size(); hospitalIndex++) {\n /*Get the head of the proposing Arraylist*/\n int hospital = proposing.get(0);\n int residentIndex;\n int resident = 0;\n for (residentIndex = 0; residentIndex < residentsToProposeTo.get(hospital).size() && proposing.contains(hospital); hospitalIndex++) {\n /*Get the next resident the hospital hasn't proposed to yed*/\n resident = residentsToProposeTo.get(hospital).get(0);\n int hospitalRank = resident_preference.get(resident).indexOf(hospital);\n\n /*resident is matched, compare the hospitals rank*/\n if (residentMatching.get(resident) != -1) {\n int matchedHospital = residentMatching.get(resident);\n int matchedHospitalRank = resident_preference.get(resident).indexOf(matchedHospital);\n if (hospitalRank < matchedHospitalRank) {\n /*1.Add/remove to hospitalResidents\n * 2.Add in resident-matching\n * 3.Add matchedHospital to the proposing list if it's not in it\n */\n hospitalResidents.get(hospital).add(resident);\n hospitalResidents.get(matchedHospital).remove(hospitalResidents.get(matchedHospital).indexOf(resident));\n residentMatching.set(resident, hospital);\n if (!proposing.contains(matchedHospital))\n proposing.add(matchedHospital);\n\n }\n }\n /*resident is free, match with the hospital*/\n else {\n /*1.Add in hospitalResidents\n * 2.Add in resident-matching\n */\n hospitalResidents.get(hospital).add(resident);\n residentMatching.set(resident, hospital);\n }\n\n /*1.Remove resident from the hospital's list of residentsToProposeTo\n * 2.If hospital's slots are full, remove hospital from the proposing list\n */\n residentsToProposeTo.get(hospital).remove(residentsToProposeTo.get(hospital).indexOf(resident));\n if (hospitalResidents.get(hospital).size() >= hospitalSlots.get(hospital))\n proposing.remove(proposing.indexOf(hospital));\n }\n }\n }\n marriage.setResidentMatching(residentMatching);\n return marriage;\n }", "private void findBest()\r\n\t{\r\n\t\tint i;\r\n\t\tint size_mature_pool;\r\n\t\tint idx_current;//index of a currently checked genotype\r\n\t\tint num_errors;//number of errors of the current chromosome\r\n\t\tdouble min_error;//smallest error among the oldest genotypes\r\n\t\tVector<Integer> idx_oldest;\r\n\t\t\r\n\t\tsize_mature_pool = _pool_of_bests.size();\r\n\t\t\r\n\t\tidx_oldest = new Vector<Integer>(0, 1);\r\n\t\t\r\n\t\t//find all oldest genotypes\r\n\t\tfor(i=0; i<size_mature_pool; i++)\r\n\t\t{\r\n\t\t\tnum_errors = _pool_of_bests.get(i)._error.all_single_squares.size();\r\n\t\t\tif(num_errors>=_min_life_span)\r\n\t\t\t{\r\n\t\t\t\tidx_oldest.add(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//find the best oldest gentypes with a span above a threshold\r\n\t\t_best_idx = -1;\r\n\t\tif(idx_oldest.size() > 0)\r\n\t\t{\r\n\t\t\t_best_idx = idx_oldest.get(0);\r\n\t\t\tmin_error = _pool_of_bests.get(_best_idx)._error.getAverageError();\r\n\t\t\tfor(i=1; i<idx_oldest.size(); i++)\r\n\t\t\t{\r\n\t\t\t\tidx_current = idx_oldest.get(i);\r\n\t\t\t\tif(min_error > _pool_of_bests.get(idx_current)._error.getAverageError())\r\n\t\t\t\t{\r\n\t\t\t\t\t_best_idx = idx_current;\r\n\t\t\t\t\tmin_error = _pool_of_bests.get(_best_idx)._error.getAverageError();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void solve() {\n// BruteForceSolver bfs = new BruteForceSolver(pointList);\n// bfs.solve(); // prints the best polygon, its area, and time needed\n// System.out.println(\"-------------\");\n\n// StarshapedSolver ss = new StarshapedSolver(pointList);\n// foundPolygons = ss.solve();\n// System.out.println(\"-------------\");\n\n// RandomAddPointHeuristic ra = new RandomAddPointHeuristic(pointList);\n// foundPolygons = ra.solve(750);\n// System.out.println(\"-------------\");\n\n// GreedyAddPointHeuristic ga = new GreedyAddPointHeuristic(pointList,false);\n// foundPolygons = ga.solve(750);\n// System.out.println(\"-------------\");\n\n// long time = 4000;\n// GreedyAddPointHeuristic gaInit = new GreedyAddPointHeuristic(pointList,false);\n// Polygon2D initSolution = gaInit.solve(time*1/4).get(0);\n// System.out.println(initSolution.area);\n// System.out.println(initSolution);\n//\n// SimulatedAnnealing sa = new SimulatedAnnealing(pointList,initSolution,3);\n// foundPolygons.addAll(sa.solve(time-gaInit.timeInit,2,0.005,0.95));\n// System.out.println(sa.maxPolygon);\n// System.out.println(\"-------------\");\n\n// foundPolygons.addAll(findMultiplePolygonsStarshaped(8,0.6));\n\n }", "public void makePreferredOTTOLRelationshipsNOConflicts() {\n \n // TraversalDescription CHILDOF_TRAVERSAL = Traversal.description()\n // .relationships(RelType.TAXCHILDOF, Direction.INCOMING);\n \n // get the start point\n Node life = getLifeNode();\n System.out.println(life.getProperty(\"name\"));\n \n Transaction tx = beginTx();\n addToPreferredIndexes(life, ALLTAXA);\n HashSet<Long> traveled = new HashSet<Long>();\n int nNewRels = 0;\n try {\n // walk out to the tips from the base of the tree\n for (Node n : TAXCHILDOF_TRAVERSAL.traverse(life).nodes()) {\n if (n.hasRelationship(Direction.INCOMING, RelType.TAXCHILDOF) == false) {\n \n // when we hit a tip, start walking back\n Node curNode = n;\n while (curNode.hasRelationship(Direction.OUTGOING, RelType.TAXCHILDOF)) {\n Node startNode = curNode;\n if (traveled.contains((Long)startNode.getId())){\n \tbreak;\n }else{\n \ttraveled.add((Long)startNode.getId());\n }\n Node endNode = null;\n \n // if the current node already has a preferred relationship, we will just follow it\n if (startNode.hasRelationship(Direction.OUTGOING, RelType.PREFTAXCHILDOF)) {\n Relationship prefRel = startNode.getSingleRelationship(RelType.PREFTAXCHILDOF, Direction.OUTGOING);\n \n // make sure we don't get stuck in an infinite loop (should not happen, could do weird things to the graph)\n if (prefRel.getStartNode().getId() == prefRel.getEndNode().getId()) {\n System.out.println(\"pointing to itself \" + prefRel + \" \" + prefRel.getStartNode().getId() + \" \" + prefRel.getEndNode().getId());\n break;\n }\n \n // prepare to move on\n endNode = prefRel.getEndNode();\n \n } else {\n \n // if there is no preferred rel then they all point to the same end node; just follow the first non-looping relationship\n for (Relationship rel : curNode.getRelationships(RelType.TAXCHILDOF, Direction.OUTGOING)) {\n if (rel.getStartNode().getId() == rel.getEndNode().getId()) {\n System.out.println(\"pointing to itself \" + rel + \" \" + rel.getStartNode().getId() + \" \" + rel.getEndNode().getId());\n break;\n } else {\n endNode = rel.getEndNode();\n break;\n }\n }\n \n // if we found a dead-end, die\n if (endNode == null) {\n System.out.println(curNode.getProperty(\"name\"));\n System.out.println(\"Strange, this relationship seems to be pointing at a nonexistent node. Quitting.\");\n System.exit(0);\n }\n \n // create preferred relationships\n curNode.createRelationshipTo(endNode, RelType.PREFTAXCHILDOF);\n curNode.createRelationshipTo(endNode, RelType.TAXCHILDOF).setProperty(\"source\", \"ottol\");\n nNewRels += 1;\n }\n \n if (startNode == endNode) {\n System.out.println(startNode);\n System.out.println(\"The node seems to be pointing at itself. This is a problem. Quitting.\");\n System.exit(0);\n \n // prepare for next iteration\n } else {\n curNode = endNode;\n addToPreferredIndexes(startNode, ALLTAXA);\n }\n }\n }\n \n if (nNewRels % transaction_iter == 0) {\n System.out.println(nNewRels);\n // tx.success();\n // tx.finish();\n // tx = beginTx();\n }\n }\n tx.success();\n } finally {\n tx.finish();\n }\n }", "private Pair<Track,Pair<List<LCRelation>,List<HelicalTrackHit>>> fitNewTrack(Track track, TrackerHit hitL1, List<LCRelation> helicalTrackHitToStripHitRelations){\n String[] strategyResources = new String[4];\n strategyResources[0] = \"/org/hps/recon/tracking/strategies/HPS_s345_c2_e16.xml\";\n strategyResources[1] = \"/org/hps/recon/tracking/strategies/HPS_s456_c3_e21.xml\";\n strategyResources[2] = \"/org/hps/recon/tracking/strategies/HPS_s123_c4_e56.xml\";\n strategyResources[3] = \"/org/hps/recon/tracking/strategies/HPS_s123_c5_e46.xml\";\n \n List<SeedStrategy> sFinallist = StrategyXMLUtils.getStrategyListFromInputStream(this.getClass().getResourceAsStream(strategyResources[0]));\n List<LCRelation> hthToStripHitRefitList = new ArrayList<LCRelation>();\n List<HelicalTrackHit> helicalHits = new ArrayList<HelicalTrackHit>();\n\n HelicalTrackStrip strip1 = null;\n HelicalTrackStrip strip2 = null;\n TrackerHit hit1 = null;\n TrackerHit hit2 = null;\n HelicalTrackHit hth = null;\n \n //Build the HelicalTrackStrip for the first layer refit\n for(LCRelation rel:helicalTrackHitToStripHitRelations){\n if(((TrackerHit) rel.getFrom()).equals(hitL1)){\n HelicalTrackStrip strip = makeDigiStrip(new SiTrackerHitStrip1D((TrackerHit) rel.getTo()));\n if(strip1 == null){\n strip1 = strip;\n hit1 = (TrackerHit) rel.getTo();\n }\n else{\n strip2 = strip;\n hit2 = (TrackerHit) rel.getTo();\n break;\n }\n }\n }\n \n //Build the HelicalTrackHit for the first layer refit\n if(strip1 != null && strip2 != null){\n HelicalTrackCross trackCross = new HelicalTrackCross(strip1,strip2);\n hth = (HelicalTrackHit) trackCross;\n helicalHits.add(hth);\n }\n \n List<TrackerHit> hits = track.getTrackerHits();\n \n //Build the HelicalTrackStrips for the remaining layers\n for(TrackerHit hit:hits){\n if(hit.equals(hits.get(0))){\n hthToStripHitRefitList.add(new BaseLCRelation(hth,hit1));\n hthToStripHitRefitList.add(new BaseLCRelation(hth,hit2));\n continue;\n }\n strip1 = null;\n strip2 = null;\n for(LCRelation rel:helicalTrackHitToStripHitRelations){\n if(checkSameHit((TrackerHit) rel.getFrom(),hit)){\n HelicalTrackStrip strip = makeDigiStrip(new SiTrackerHitStrip1D((TrackerHit) rel.getTo()));\n if(strip1 == null){\n strip1 = strip;\n hit1 = (TrackerHit) rel.getTo();\n }\n else{\n strip2 = strip;\n hit2 = (TrackerHit) rel.getTo();\n break;\n }\n }\n }\n //Build the HelicalTrackHit for the remaining layers\n if(strip1 != null && strip2 != null){\n HelicalTrackCross trackCross = new HelicalTrackCross(strip1,strip2);\n hth = (HelicalTrackHit) trackCross;\n helicalHits.add(hth);\n hthToStripHitRefitList.add(new BaseLCRelation(hth,hit1));\n hthToStripHitRefitList.add(new BaseLCRelation(hth,hit2));\n }\n }\n \n SeedCandidate trackseed = new SeedCandidate(helicalHits, sFinallist.get(0), TrackUtils.getHTF(track.getTrackStates().get(0)), bfield);\n \n // Initialize the reference point to the origin\n double[] ref = new double[] {0., 0., 0.};\n \n // Create a new SeedTrack (SeedTrack extends BaseTrack)\n SeedTrack trk = new SeedTrack();\n \n // Add the hits to the track\n for (HelicalTrackHit hit : trackseed.getHits()) {\n trk.addHit((TrackerHit) hit);\n }\n \n // Retrieve the helix and save the relevant bits of helix info\n HelicalTrackFit helix = trackseed.getHelix();\n trk.setTrackParameters(helix.parameters(), bfield); // Sets first TrackState.\n trk.setCovarianceMatrix(helix.covariance()); // Modifies first TrackState.\n trk.setChisq(helix.chisqtot());\n trk.setNDF(helix.ndf()[0]+helix.ndf()[1]);\n \n // Flag that the fit was successful and set the reference point\n trk.setFitSuccess(true);\n trk.setReferencePoint(ref); // Modifies first TrackState.\n trk.setRefPointIsDCA(true);\n \n // Set the strategy used to find this track\n trk.setStratetgy(trackseed.getSeedStrategy());\n \n // Set the SeedCandidate this track is based on\n trk.setSeedCandidate(trackseed);\n \n return new Pair<>((Track) trk,new Pair<>(hthToStripHitRefitList,helicalHits));\n }", "private void updateBest() {\n if (bestTourOrder == null) {\n bestTourOrder = ants.get(0).trail;\n bestTourLength = ants.get(0)\n .trailLength(graph);\n }\n for (Ant a : ants) {\n if (a.trailLength(graph) > bestTourLength) {\n bestTourLength = a.trailLength(graph);\n bestTourOrder = a.trail.clone();\n }\n }\n\n\n }", "private LineString pickBestGrowthPossibility2(List<LineString> lookAheads) {\t\t\n\t\tif (lookAheads == null || lookAheads.size() == 0) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t//sort by:\n\t\t//1. is moving away?\n\t\t//2. number of coordinates in line\n\t\t//3. slope\n\t\tComparator<LineString> lookAheadComparator = new Comparator<LineString>() {\n\t\t\tpublic int compare(LineString s1, LineString s2) {\n\t\t\t\t\n\t\t\t\tboolean m1 = LineGrowthHelpers.isMovingAway(s1, s1.getCoordinateN(s1.getNumPoints()-1));\n\t\t\t\tboolean m2 = LineGrowthHelpers.isMovingAway(s2, s2.getCoordinateN(s2.getNumPoints()-1));\n\t\t\t\tif (m1 != m2) {\n\t\t\t\t\treturn m1 ? -1 : 1;\n\t\t\t\t}\n\t\t\t\telse { //both moving away, or neither moving away. look to second criteria\n\t\t\t\t\t\n\t\t\t\t\tif (s1.getNumPoints() == s2.getNumPoints()) {\n\n\t\t\t\t\t\tdouble slope1 = SpatialUtils.getSlope(s1);\n\t\t\t\t\t\tdouble slope2 = SpatialUtils.getSlope(s2);\n\t\t\t\t\t\treturn slope1 > slope2 ? -1 \n\t\t\t\t\t\t\t\t : slope1 < slope2 ? 1 \n\t\t\t\t\t\t\t : 0; \n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\treturn s1.getNumPoints() > s2.getNumPoints() ? -1 \n\t\t\t\t\t\t\t\t : s1.getNumPoints() < s2.getNumPoints() ? 1 \n\t\t\t\t\t\t\t : 0; \n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tlookAheads.sort(lookAheadComparator);\n\t\treturn lookAheads.get(0);\n\t}", "public void makePreferredOTTOLRelationshipsConflicts(){\n \t\tTransaction tx;\n \t\tString name = \"life\";\n \t\tIndexHits<Node> foundNodes = findTaxNodeByName(name);\n Node firstNode = null;\n if (foundNodes.size() < 1){\n System.out.println(\"name '\" + name + \"' not found. quitting.\");\n return;\n } else if (foundNodes.size() > 1) {\n System.out.println(\"more than one node found for name '\" + name + \"'not sure how to deal with this. quitting\");\n } else {\n for (Node n : foundNodes)\n firstNode = n;\n }\n \t\tTraversalDescription CHILDOF_TRAVERSAL = Traversal.description()\n \t\t\t\t.relationships( RelTypes.TAXCHILDOF,Direction.INCOMING );\n \t\tSystem.out.println(firstNode.getProperty(\"name\"));\n \t\tint count = 0;\n \t\ttx = graphDb.beginTx();\n \t\ttry{\n \t\t\tfor(Node friendnode : CHILDOF_TRAVERSAL.traverse(firstNode).nodes()){\n \t\t\t\tboolean conflict = false;\n \t\t\t\tString endNode = \"\";\n \t\t\t\tRelationship ncbirel = null;\n \t\t\t\tRelationship ottolrel = null;\n \t\t\t\tfor(Relationship rel : friendnode.getRelationships(Direction.OUTGOING)){\n \t\t\t\t\tif (rel.getEndNode() == rel.getStartNode()){\n \t\t\t\t\t\tcontinue;\n \t\t\t\t\t}else{\n \t\t\t\t\t\tif (endNode == \"\")\n \t\t\t\t\t\t\tendNode = (String) rel.getEndNode().getProperty(\"name\");\n \t\t\t\t\t\tif ((String)rel.getEndNode().getProperty(\"name\") != endNode){\n \t\t\t\t\t\t\tconflict = true;\n \t\t\t\t\t\t}\n \t\t\t\t\t\tif(((String)rel.getProperty(\"source\")).compareTo(\"ncbi\")==0)\n \t\t\t\t\t\t\tncbirel = rel;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\tif (conflict && ncbirel != null){\n \t\t\t\t\tcount += 1;\n //\t\t\t\t\tSystem.out.println(\"would make one from \"+ncbirel.getStartNode().getProperty(\"name\")+\" \"+ncbirel.getEndNode().getProperty(\"name\"));\n \t\t\t\t\tif(ncbirel.getStartNode()!=ncbirel.getEndNode()){\n \t\t\t\t\t\tncbirel.getStartNode().createRelationshipTo(ncbirel.getEndNode(), RelTypes.PREFTAXCHILDOF);\n \t\t\t\t\t\tRelationship newrel2 = ncbirel.getStartNode().createRelationshipTo(ncbirel.getEndNode(), RelTypes.TAXCHILDOF);\n \t\t\t\t\t\tnewrel2.setProperty(\"source\", \"ottol\");\n \t\t\t\t\t}else{\n \t\t\t\t\t\tSystem.out.println(\"would make cycle from \"+ncbirel.getEndNode().getProperty(\"name\"));\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t}\n \t\t\t\tif(count % transaction_iter == 0)\n \t\t\t\t\tSystem.out.println(count);\n \t\t\t}\n \t\t\ttx.success();\n \t\t}finally{\n \t\t\ttx.finish();\n \t\t}\n \t}", "protected static List<Conflict> solve() {\n\t\tcleaned = false;\n\t\tif (curMIDI != null)\n\t\t\ttry {\n\t\t\t\tSolver greedy = new OOGreedySolver(setOfStrings);\n\t\t\t\tcurMIDI = TrackSplitter.split(curMIDI, setOfStrings.length, bassTrack);\n\t\t\t\tcurMIDI = greedy.solve(curMIDI);\n\t\t\t\tsetOfConflicts = Cleaner.getConflicts(curMIDI, setOfStrings);\n\n\t\t\t\t//serve users valid choices\n\t\t\t\t//receive users choice\n\t\t\t\t//call appropriate method\n\n\t\t\t\t// give the simulation the new midi\n\t\t\t\tcurMIDI = Cleaner.prePos(curMIDI, prepositionDelay, setOfStrings, prepositionLength);\n\t\t\t\tif (sim!=null) sim.setSequence(curMIDI);\n\t\t\t\treturn setOfConflicts;\n\t\t\t} catch (InvalidMidiDataException e) {\n\t\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "public void solveGame() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\n\t\t\tif(!relaxAllControllables){\n\t\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\n\t\t\t\t\t\tcurrentSet.add(s);\n\t\t\t\t}\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "private static void BicingsimulatedAnnealingSearch(int num, int n_est, int nbicis, int nfurgo, int d1, int cas, String Cas, String H, String D, int s) {\n\n\n try {\n\n double MedT = 0;\n //double MedN = 0;\n //double MedB = 0;\n int iteraciones = 100;\n Estado Bicing = new Estado(n_est,nbicis,nfurgo,d1,s,1);\n Bicing.setList_cdesp(iteraciones);\n long StartTime = System.nanoTime();\n Problem problem = new Problem(Bicing, new sucesoresA(), new isGoal(), new Heuristic_Function());\n SimulatedAnnealingSearch search = new SimulatedAnnealingSearch(iteraciones, 1000, 125, 0.00001D);\n SearchAgent agent = new SearchAgent(problem, search);\n List L = search.getPathStates();\n Properties properties = agent.getInstrumentation();\n long EndTime = System.nanoTime();\n Estado E = (Estado) search.getGoalState();\n long time = ((EndTime - StartTime) / 1000000);\n MedT += time;\n //MedB += E.getganancia();\n // MedN += Integer.parseInt(properties.getProperty((String)properties.keySet().iterator().next()));\n // MedB /= num;\n // MedN /= num;\n // MedT /= num;\n //MedB = (Math.round(MedB*100.0)/100.0);\n Writer output;\n output = new BufferedWriter(new FileWriter(\"Estadisticas_\" + Cas + \"_D\" + D + \"_H\" + H + \"S.txt\", true));\n double [] vec = E.getearnings();\n for (int i = 0 ; i < iteraciones; ++i) {\n String S = \"\" + vec[i];\n S = S + '\\n';\n output.append(S);\n }\n output.close();\n\n /*for (int i = 0; i < E.getN_furgo(); ++i) {\n System.out.println(\"Recorrido por furgoneta \" + i + \" \" + E.getIFurgo(i).getLong_t());\n }*/\n //printEstado(E);\n //System.out.println();\n //System.out.println(E.getganancia());\n //printActions(agent.getActions());\n //printInstrumentation(agent.getInstrumentation());\n } catch (Exception var4) {\n var4.printStackTrace();\n }\n\n }", "private void heuristicSetter(Node node){\n int goalNodeFirstDigit = Integer.parseInt(goalNode.getDigit().getFirst_digit());\n int goalNodeSecondDigit = Integer.parseInt(goalNode.getDigit().getSecond_digit());\n int goalNodeThirdDigit = Integer.parseInt(goalNode.getDigit().getThird_digit());\n\n int nodeFirstDigit = Integer.parseInt(node.getDigit().getFirst_digit());\n int nodeSecondDigit = Integer.parseInt(node.getDigit().getSecond_digit());\n int nodeThirdDigit = Integer.parseInt(node.getDigit().getThird_digit());\n\n int heuristic = Math.abs(goalNodeFirstDigit - nodeFirstDigit)+\n Math.abs(goalNodeSecondDigit - nodeSecondDigit)+\n Math.abs(goalNodeThirdDigit - nodeThirdDigit);\n\n node.setHeuristic(heuristic);\n }", "private void recalcBestPath(int dest) {\n boolean changed;\n\n List<BGPPath> possList = this.inRib.get(dest);\n BGPPath currentBest = this.pathSelection(possList);\n BGPPath currentInstall = this.locRib.get(dest);\n\n /*\n * We need to handle advertisements in one of two cases a) we have found\n * a new best path and it's not the same as our current best path b) we\n * had a best path prior, but currently do not\n */\n changed = (currentBest != null && (currentInstall == null || !currentBest.equals(currentInstall)))\n || (currentBest == null && currentInstall != null);\n this.locRib.put(dest, currentBest);\n if (this.isWardenAS()) {\n if (currentBest == null) {\n this.routeStatusMap.put(dest, AS.RS_NULL);\n } else if (this.botSet == null) {\n this.routeStatusMap.put(dest, AS.RS_CLEAN);\n } else if (currentBest.containsAnyOf(this.botSet)) {\n this.routeStatusMap.put(dest, AS.RS_DIRTY);\n } else {\n this.routeStatusMap.put(dest, AS.RS_CLEAN);\n }\n }\n\n /*\n * If we have a new path, mark that we have a dirty destination\n */\n if (changed) {\n this.dirtyDest.add(dest);\n }\n }", "private void checkIsBetterSolution() {\n if (solution == null) {\n solution = generateSolution();\n //Si la solucion que propone esta iteracion es mejor que las anteriores la guardamos como mejor solucion\n } else if (getHealthFromAvailableWorkers(availableWorkersHours, errorPoints.size()) < solution.getHealth()) {\n solution = generateSolution();\n }\n }", "private List<Pair<Integer, Integer>> getBestPath(Pair<Integer, Integer> curLocation, Pair<Integer, Integer> dest) {\n\t\tList<Pair<Integer, Integer>> path = new LinkedList<Pair<Integer, Integer>>();\n\t\t\n\t\t\n\t\tNode current = new Node(curLocation.getX(), curLocation.getY(), getHitProbability(curLocation.getX(), curLocation.getY()));\n\t\tNode target = new Node(dest.getX(), dest.getY(), getHitProbability(dest.getX(), dest.getY()));\n\t\tList<Node> openSet = new ArrayList<>();\n List<Node> closedSet = new ArrayList<>();\n \n \n while (true) {\n openSet.remove(current);\n List<Node> adjacent = getAdjacentNodes(current, closedSet, target);\n\n // Find the adjacent node with the lowest heuristic cost.\n for (Node neighbor : adjacent) {\n \tboolean inOpenset = false;\n \tList<Node> openSetCopy = new ArrayList<>(openSet);\n \tfor (Node node : openSetCopy) {\n \t\tif (neighbor.equals(node)) {\n \t\t\tinOpenset = true;\n \t\t\tif (neighbor.getAccumulatedCost() < node.getAccumulatedCost()) {\n \t\t\t\topenSet.remove(node);\n \t\t\t\topenSet.add(neighbor);\n \t\t\t}\n \t\t}\n \t}\n \t\n \tif (!inOpenset) {\n \t\topenSet.add(neighbor);\n \t}\n }\n\n // Exit search if done.\n if (openSet.isEmpty()) {\n System.out.printf(\"Target (%d, %d) is unreachable from position (%d, %d).\\n\",\n target.getX(), target.getY(), curLocation.getX(), curLocation.getY());\n return null;\n } else if (/*isAdjacent(current, target)*/ current.equals(target)) {\n break;\n }\n\n // This node has been explored now.\n closedSet.add(current);\n\n // Find the next open node with the lowest cost.\n Node next = openSet.get(0);\n for (Node node : openSet) {\n if (node.getCost(target) < next.getCost(target)) {\n next = node;\n }\n }\n// System.out.println(\"Moving to node: \" + current);\n current = next;\n }\n \n // Rebuild the path using the node parents\n path.add(new Pair<Integer, Integer>(curLocation.getX(), curLocation.getY()));\n while(current.getParent() != null) {\n \tcurrent = current.getParent();\n \tpath.add(0, new Pair<Integer, Integer>(current.getX(), current.getY()));\n }\n \n if (path.size() > 1) {\n \tpath.remove(0);\n }\n \n\t\treturn path;\n\t}", "private double getHeuristic(MapLocation current, MapLocation goal) {\n\t\treturn Math.max(Math.abs(current.x - goal.x), Math.abs(current.y - goal.y));\n\t}", "public void solveGame4() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\t\t\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t}\n\n\t\t// Handle the pending states\n\t\twhile (!losing.isEmpty()) {\n\t\t\tS state = losing.poll();\n\n\t\t\t\n\t\t\tlosingStates.add(state);\n\n\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\tfor (S pred : predecessors) {\n\t\t\t\tif(losing.contains(pred) || losingStates.contains(pred))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t//if(i == -1)\n\t\t\t\t\t//continue;\n\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}else{\n\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "private void identifySuccessors(T node, T goal, Set<T> goals, Queue<T> open, Set<T> closed, Map<T, T> parentMap,\n Map<T, Double> fMap, Map<T, Double> gMap, Map<T, Double> hMap) {\n // get all neighbors to the current node\n Collection<T> neighbors = findNeighbors(node, parentMap);\n\n double d;\n double ng;\n for (T neighbor : neighbors) {\n // jump in the direction of our neighbor\n T jumpNode = jump(neighbor, node, goals);\n\n // don't add a node we have already gotten to quicker\n if (jumpNode == null || closed.contains(jumpNode)) continue;\n\n // determine the jumpNode's distance from the start along the current path\n d = graph.getDistance(jumpNode, node);\n ng = gMap.getOrDefault(node, 0d) + d;\n\n // if the node has already been opened and this is a shorter path, update it\n // if it hasn't been opened, mark as open and update it\n if (!open.contains(jumpNode) || ng < gMap.getOrDefault(jumpNode, 0d)) {\n gMap.put(jumpNode, ng);\n hMap.put(jumpNode, graph.getHeuristicDistance(jumpNode, goal));\n fMap.put(jumpNode, gMap.getOrDefault(jumpNode, 0d) + hMap.getOrDefault(jumpNode, 0d));\n //System.out.println(\"jumpNode: \" + jumpNode.x + \",\" + jumpNode.y + \" f: \" + fMap.get(jumpNode));\n parentMap.put(jumpNode, node);\n\n if (!open.contains(jumpNode)) {\n open.offer(jumpNode);\n }\n }\n }\n }", "private void updateFringeAndConflicts(List<String> changed) {\n //update fringe\n for (Clause ci : fringe) {\n for (CLiteral l : ci.getCLiterals()) {\n if (changed.contains(l.getName())) {\n ci.updateClause(labels);\n if ( ci.numOfNegative>0)\n // else if (c.numUnknownLiterals==0 && c.numOfNegative==c.numUnknownLiterals)\n if (!conflicts.contains(ci)) {\n if (conflicts.size()+1<=maxConflicts)\n conflicts.add(ci);\n\n break;\n }\n }\n }\n }\n\n // check rest of clauses which not in fringe or conflicts.\n for (Clause c : clauses) {\n if (!fringe.contains(c) && !conflicts.contains(c)) {\n for (CLiteral l : c.getCLiterals()) {\n if (changed.contains(l.getName())) {\n c.updateClause(labels);\n\n if (c.getNumUnknownLiterals() == 1 && c.getNumOfNegative() == c.getNumOfLiterals() - c.getNumUnknownLiterals()) {\n fringe.push(c);\n break;\n } else if (c.numOfNegative >0) {\n // else if (c.numUnknownLiterals==0 && c.numOfNegative==c.numUnknownLiterals)\n if (!conflicts.contains(c)) {\n if (conflicts.size()+1<=maxConflicts)\n conflicts.add(c);\n\n break;\n }\n }\n }\n }\n }\n }\n }", "public void aEstrella (String input)\r\n\t{\r\n\t\tNode root_aEstrella = new Node (input);\r\n\t\tNode current = new Node(root_aEstrella.getState());\r\n\t\t\r\n\t\tHeuristicComparator aEstrella_comparator = new HeuristicComparator();\r\n\t\tPriorityQueue<Node> queue_gbfs = new PriorityQueue<Node>(12, aEstrella_comparator);\r\n\t\tArrayList<String> visited = new ArrayList<String>();\r\n\t\tArrayList<String> children = new ArrayList<String>();\r\n\t\t\r\n\t\tint nodes_popped = 0;\r\n\t\tint pqueue_max_size = 0;\r\n\t\tint pq_size = 0;\r\n\t\t\r\n\t\tcurrent.cost = 0;\r\n\t\tcurrent.setTotalCost(0);\r\n\t\t\r\n\t\twhile(!goal_aEstrella)\r\n\t\t{\r\n\t\t\tvisited.add(current.getState());\r\n\t\t\tchildren = Successor.findChildren(current.getState());\r\n\t\t\t\r\n\t\t\tfor (String a : children)\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tif (visited.contains(a))\r\n\t\t\t\t{\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNode nino = new Node(a);\r\n\t\t\t\t\tcurrent.children_nodes.add(nino);\r\n\t\t\t\t\tvisited.add(nino.getState());\r\n\t\t\t\t\t\r\n\t\t\t\t\tint cost = isCost(current.getState(), nino.getState());\r\n\t\t\t\t\tnino.cost = cost;\r\n\t\t\t\t\tnino.parent = current;\r\n\t\t\t\t\tint greedy_cost = greedybfsCost(nino.getState(), root_aEstrella.getState());\r\n\t\t\t\t\tnino.setTotalCost(nino.parent.getTotalCost() + nino.cost);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// f(n) = g(n) + h(n)\r\n\t\t\t\t\tnino.setHeuristicCost(nino.getTotalCost() + greedy_cost);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (!queue_gbfs.contains(nino))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tqueue_gbfs.add(nino);\r\n\t\t\t\t\t\tpq_size++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Repeated State checking. Removing the same node from PQ if the path cost is less then the current one \r\n\t\t\t\t\telse if (queue_gbfs.contains(nino))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfor (Node original : queue_gbfs)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (original.equals(nino))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tNode copy = original;\r\n\t\t\t\t\t\t\t\tif (nino.getHeuristicCost() < copy.getHeuristicCost())\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tqueue_gbfs.remove(copy);\r\n\t\t\t\t\t\t\t\t\tqueue_gbfs.add(nino);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcurrent = queue_gbfs.poll();\r\n\t\t\tnodes_popped++;\r\n\t\t\t\r\n\t\t\tif (pq_size > pqueue_max_size)\r\n\t\t\t{\r\n\t\t\t\tpqueue_max_size = pq_size;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tpq_size--;\r\n\t\t\tgoal_aEstrella = isGoal(current.getState());\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tgoal_aEstrella = false;\r\n\t\tSystem.out.println(\"A* Solved!!\");\r\n\t\tSolution.performSolution(current, root_aEstrella, nodes_popped, pqueue_max_size);\r\n\t}", "void BackTrackBestPath(double[] delta_T_1,\n int[][] best,\n int[] best_path) {\n FindBestInLevel(delta_T_1, ((best_path)[T_-1]));\n for (int i = T_-2;i >= 0;i--) {\n (best_path)[i] = best[i+1][(best_path)[i+1]];\n }\n}", "@Override\n\tprotected void notifyNewBest(LinkedList<City> goodSolution, double length) {\n\t}", "private TargetInformation findHighGoal(Mat image) {\r\n\t\tTargetInformation ret = new TargetInformation();\r\n\t\tret.targetingPeg = false;\r\n\t\t\r\n long[] xsums = sums(image, true);\r\n long[] ysums = sums(image, false);\r\n \r\n\t List<PeakLoc> xpeaks = findPeaks(xsums, 10);\r\n\t List<PeakLoc> ypeaks = findPeaks(ysums, 10);\r\n\r\n\t if (ypeaks.size() == 2 && xpeaks.size() > 0) {\r\n\t \tret.targetFound = true;\r\n\t \tret.x = (xpeaks.get(0).getStop() - xpeaks.get(0).getStart()) / 2;\r\n\t \tret.gap = ypeaks.get(1).getStart() - ypeaks.get(0).getStop();\r\n\t \tret.width = xpeaks.get(0).getStop() - xpeaks.get(0).getStart();\r\n\t \tret.height = ypeaks.get(1).getStop() - ypeaks.get(0).getStart();\r\n\t \tret.y = (ypeaks.get(0).getStop() + ypeaks.get(1).getStart())/2;\r\n\t \t\r\n\t \tdouble pixelsPerInch = ret.gap / highGoalGapInches;\r\n\t \tif (xpeaks.get(0).isTruePeak() && xpeaks.get(1).isTruePeak())\r\n\t \t{\r\n\t \t\tpixelsPerInch = (pixelsPerInch + ret.width / highGoalWidthInches) / 2;\r\n\t \t}\r\n\t \tif (ypeaks.get(0).isTruePeak())\r\n\t \t{\r\n\t \t\tif (xpeaks.get(0).isTruePeak() && xpeaks.get(1).isTruePeak())\r\n\t \t\t{\r\n\t \t\t\tpixelsPerInch = (pixelsPerInch * 2 + ret.width / highGoalHeightInches) / 3;\r\n\t \t\t}\r\n\t \t\telse\r\n\t \t\t{\r\n\t \t\t\tpixelsPerInch = (pixelsPerInch + ret.width / highGoalHeightInches) / 2;\r\n\t \t\t}\r\n\t \t} \t\r\n\t \t\r\n\t \tret.aimX = ret.x + (cameraOffsetInches - shooterOffsetInches) * pixelsPerInch;\r\n\t \t\r\n\t \tret.correctionAngle = (double)((ret.aimX - image.cols() / 2)) / pixelsPerXDegree;\r\n\t }\r\n\t else\r\n\t {\r\n\t \tret.targetFound = false;\r\n\t }\r\n\t \r\n\t return ret;\r\n\t}", "@Override\n\tprotected double[] calculateNeighbourhoodBest(int i) {\n\t\t\t//System.out.println(\"Gbest particle from local typology!\");\n\t\t\tint indexBestParticle = i;\n\t\t\tint indexLeftNeighbour = (i > 0) ? i - 1 : swarmSize - 1;\n\t\t\tint indexRightNeighbour = (i < swarmSize - 1) ? i + 1 : 0;\t\t\n\t\t\t\t\t\n\t\t\tdouble nBestFitness = swarm.get(i).getPBestFitness();\n\t\t\tdouble leftNeighborParticlePBestFitness = swarm.get(indexLeftNeighbour).getPBestFitness();\n\t\t\tdouble rightNeighborParticlePBestFitness = swarm.get(indexRightNeighbour).getPBestFitness();\n\t\t\t\t\t\n\t\t\tif (leftNeighborParticlePBestFitness < nBestFitness) {\n\t\t\t\tindexBestParticle = indexLeftNeighbour;\n\t\t\t\tnBestFitness = leftNeighborParticlePBestFitness;\n\t\t\t}\n\t\t\tif (rightNeighborParticlePBestFitness < nBestFitness) {\n\t\t\t\tindexBestParticle = indexRightNeighbour;\n\t\t\t\tnBestFitness = rightNeighborParticlePBestFitness;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\treturn swarm.get(indexBestParticle).getPBest();\n\t\t\t//return swarm.get(indexBestParticle);\n\t\t\t\n\t}", "private void lastResortFindPeer() {\n\t\tDecentLogger.write(\"Resolving peers from DNS (last resort)\");\n\t\tfor(String seed: DNS_SEEDS) {\n\t\t\tArrayList<InetAddress> hosts = DNSResolver.getARecords(seed);\n\t\t\tif(hosts != null) {\n\t\t\t\tcheckList(hosts);\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n public String bringSolution(String arr) {\r\n\tMaze3d maze = hMaze.get(arr);\r\n//\tSolution<Position> s = hSol.get(maze);\r\n\tif (maze != null) {\r\n\t Stack<Position> sol = hSol.get(maze).getSolution();\r\n\t sb = new StringBuilder();\r\n\t while (!sol.isEmpty()) {\r\n\t\tsb.append(sol.pop());\r\n\t }\r\n\t return sb.toString();\r\n\t}\r\n\treturn \"Solution do not exist for \" + arr + \" maze.\";\r\n }", "private Outfit getBestWithJacket(double desired_clo) {\n Cursor jacketCursor = mOuterLoaderListener.getCursor();\n Outfit best_outfit = new Outfit();\n Outfit temp_top_bottom;\n Outfit temp_dress;\n double diff = Double.MAX_VALUE;\n double jacket_clo = 0;\n int result_jacket_position = 0;\n if (jacketCursor.moveToFirst()) {\n while (!jacketCursor.isAfterLast()) {\n jacket_clo = jacketCursor.getDouble(jacketCursor.getColumnIndex(ClothesEntry.COLUMN_ARTICLE_CLO_VALUE));\n temp_top_bottom = getBestTopBottom(desired_clo - jacket_clo);\n temp_dress = getBestDress(desired_clo - jacket_clo);\n\n if (Math.abs(temp_top_bottom.getCloValue() + jacket_clo - desired_clo) < diff) {\n diff = Math.abs(temp_top_bottom.getCloValue() + jacket_clo - desired_clo);\n result_jacket_position = jacketCursor.getPosition();\n best_outfit = temp_top_bottom;\n }\n if (Math.abs(temp_dress.getCloValue() + jacket_clo - desired_clo) < diff) {\n diff = Math.abs(temp_dress.getCloValue() + jacket_clo - desired_clo);\n result_jacket_position = jacketCursor.getPosition();\n best_outfit = temp_dress;\n }\n\n jacketCursor.moveToNext();\n }\n\n if (!best_outfit.isEmpty() && jacketCursor.moveToPosition(result_jacket_position)) {\n byte[] imageByteArray = jacketCursor.getBlob(jacketCursor.getColumnIndex(ClothesEntry.COLUMN_ARTICLE_IMAGE));\n double clo = jacketCursor.getDouble(jacketCursor.getColumnIndex(ClothesEntry.COLUMN_ARTICLE_CLO_VALUE));\n\n if (imageByteArray != null && imageByteArray.length > 0)\n {\n ByteArrayInputStream imageStream = new ByteArrayInputStream(imageByteArray);\n best_outfit.addItem(new ClothingItem(Outfit.OUTER1, BitmapFactory.decodeStream(imageStream), clo));\n } else {\n best_outfit.addItem(new ClothingItem(Outfit.OUTER1, null, clo));\n }\n }\n }\n return best_outfit;\n }", "private void runBest() {\n }", "protected int bestDirection(int _y, int _x)\n {\n int sX = -1, sY = -1;\n for (int i = 0; i < m; i++) {\n boolean breakable = false;\n for (int j = 0; j < n; j++) {\n if (map[i][j] == 'p' || map[i][j] == '5') {\n sX = i;\n sY = j;\n breakable = true;\n break;\n }\n }\n if(breakable) break;\n sX =0; sY = 0;\n }\n Pair s = new Pair(sX, sY);\n Queue<Pair> queue = new Queue<Pair>();\n int[][] distance = new int[m][n];\n for (int i = 0; i < m; i++)\n for (int j = 0; j < n; j++)\n distance[i][j] = -1;\n distance[sX][sY] = 0;\n queue.add(s);\n /*\n System.out.println(\"DEBUG TIME!!!!\");\n for(int i = 0; i < m; i++)\n {\n for(int j = 0; j < n; j++)\n System.out.print(map[i][j]);\n System.out.println();\n }\n System.out.println();\n */\n while (!queue.isEmpty())\n {\n Pair u = queue.remove();\n for (int i = 0; i < 4; i++)\n {\n int x = u.getX() + hX[i];\n int y = u.getY() + hY[i];\n if (!validate(x, y)) continue;\n if (distance[x][y] != -1) continue;\n if (!canGo.get(map[x][y])) continue;\n distance[x][y] = distance[u.getX()][u.getY()] + 1;\n queue.add(new Pair(x, y));\n }\n }\n\n //slove if this enemy in danger\n //System.out.println(_x + \" \" + _y);\n if (inDanger[_x][_y])\n {\n int direction = -1;\n boolean canAlive = false;\n int curDistance = dangerDistance[_x][_y];\n int distanceToBomber = m * n;\n if (curDistance == -1) return 0;\n for (int i = 0; i < 4; i++)\n {\n int x = _x + hX[i];\n int y = _y + hY[i];\n if (!validate(x, y)) continue;\n if (dangerDistance[x][y] == -1) continue;\n if (dangerDistance[x][y] < curDistance)\n {\n curDistance = dangerDistance[x][y];\n direction = i;\n distanceToBomber = distance[x][y];\n } else if (dangerDistance[x][y] == curDistance)\n {\n if (distanceToBomber == -1 || distanceToBomber > distance[x][y])\n {\n direction = i;\n distanceToBomber = distance[x][y];\n }\n }\n }\n if (direction == -1) direction = random.nextInt(4);\n allowSpeedUp = true;\n return direction;\n }\n // or not, it will try to catch bomber\n else\n {\n /*\n System.out.println(\"x = \" + _x + \"y = \" + _y);\n for(int i = 0; i < n; i++) System.out.printf(\"%2d \",i);\n System.out.println();\n for(int i = 0; i < m; i++)\n {\n for(int j = 0; j < n; j++)\n System.out.printf(\"%2d \",distance[i][j]);\n System.out.println();\n }\n System.out.println();\n System.out.println();\n */\n int direction = -1;\n int[] die = new int[4];\n for (int i = 0; i < 4; i++)\n die[i] = 0;\n int curDistance = distance[_x][_y];\n for (int i = 0; i < 4; i++)\n {\n int x = _x + hX[i];\n int y = _y + hY[i];\n if (!validate(x, y))\n {\n die[i] = 1;\n continue;\n }\n ;\n if (inDanger[x][y])\n {\n die[i] = 2;\n continue;\n }\n if (distance[x][y] == -1) continue;\n if (distance[x][y] < curDistance)\n {\n curDistance = distance[x][y];\n direction = i;\n }\n }\n if(curDistance < 4) allowSpeedUp = true;\n else allowSpeedUp = false; //TODO: TEST :))\n if (direction == -1)\n {\n for (int i = 0; i < 4; i++)\n if (die[i] == 0) return i;\n for (int i = 0; i < 4; i++)\n if (die[i] == 1) return i;\n return 0;\n } else return direction;\n }\n }", "protected void optimize() {\n int[][] cutMemo = new int[dimX + 1][dimY + 1];\n Tuple[][] tupleMemo = new Tuple[dimX + 1][dimY + 1];\n Memo memo = new Memo(cutMemo,tupleMemo);\n\n //array is filled with -1 because -1 is used as a flag in the memo\n fillMemo(0, dimX, 0, dimY, cutMemo);\n\n //Calculates optimal value of cloth\n ArrayList<FittedPattern> answer = computeOptimal(dimX, dimY, pattern, memo, new ArrayList<>(), 0);\n coordinates = answer;\n finalValue = memo.getFittedPatternMemo()[dimX][dimY].getOptimalValue();\n\n }", "public static List<Vec2i> solve(int[][] grid, Vec2i start, Vec2i goal, Heuristic h){\n if(h == null){ //if null replace with default heuristic\n h = new Heuristic() {\n @Override\n\n public double eval(Vec2i loc) {\n double dx = (loc.x - goal.x);\n double dy = (loc.y - goal.y);\n return Math.sqrt(dx*dx + dy*dy);\n }\n };\n }\n\n PriorityQueue<GridLocation> edge = new PriorityQueue<GridLocation>(10, AStarGrid::compareGridLocations);\n edge.add(new GridLocation(start,0));\n\n Map<Vec2i, Vec2i> cameFrom = new HashMap<Vec2i, Vec2i>();\n Map<Vec2i, Double> g = new HashMap<Vec2i, Double>(); //distance to node\n g.put(start,0.0);\n Map<Vec2i, Double> f = new HashMap<Vec2i, Double>(); //distance from start to goal through this node\n f.put(start,h.eval(start));\n //f = g + h\n\n while(!edge.isEmpty()){\n\n Vec2i current = edge.poll().loc;\n if(current.x == goal.x && current.y == goal.y){\n return reconstructPath(cameFrom, current);\n }\n\n LinkedList<Vec2i> neighbors = new LinkedList<Vec2i>();\n if(current.x != 0 && grid[current.x - 1][current.y] == 0)\n neighbors.add(new Vec2i(current.x - 1,current.y));\n if(current.x != grid.length-1 && grid[current.x + 1][current.y] == 0)\n neighbors.add(new Vec2i(current.x + 1,current.y));\n if(current.y != 0 && grid[current.x][current.y - 1] == 0)\n neighbors.add(new Vec2i(current.x,current.y - 1));\n if(current.y != grid[0].length-1 && grid[current.x][current.y + 1] == 0)\n neighbors.add(new Vec2i(current.x,current.y + 1));\n\n\n for(Vec2i neighbor: neighbors){\n double score = g.get(current) + 1;\n if(!g.containsKey(neighbor) || score < g.get(neighbor)){\n cameFrom.put(neighbor,current);\n g.put(neighbor, score);\n f.put(neighbor, score + h.eval(neighbor));\n if(!edge.contains(neighbor)){\n edge.add(new GridLocation(neighbor,score + h.eval(neighbor)));\n }\n }\n }\n }\n //No path was found\n return null;\n }", "@Override\n protected void search() {\n \n obtainProblem();\n if (prioritizedHeroes.length > maxCreatures){\n frame.recieveProgressString(\"Too many prioritized creatures\");\n return;\n }\n bestComboPermu();\n if (searching){\n frame.recieveDone();\n searching = false;\n }\n }", "private void computeConflicts() {\n\t\tthis.conflictGraph = new HashMap<Class, List<Class>>();\n\n\t\tfor (Class c : this.core) {\n\t\t\tif (c.getSuperClasses().size() >= 2) {\n\n\t\t\t\tList<List<Class>> linExts = new ArrayList<List<Class>>();\n\t\t\t\tfor (int i = 0; i < c.getSuperClasses().size(); i++) {\n\t\t\t\t\tlinExts.add(this.linearExts.get(c.getSuperClasses().get(i)));\n\t\t\t\t\tlinExts.get(i).add(c.getSuperClasses().get(i));\n\t\t\t\t}\n\n\t\t\t\tList<HashSet<Class>> diffs = new ArrayList<HashSet<Class>>();\n\n\t\t\t\t// Compute lini - linj for all i != j\n\t\t\t\tfor (List<Class> linExt : linExts) {\n\t\t\t\t\tfor (List<Class> linExt2 : linExts) {\n\t\t\t\t\t\tif (linExt != linExt2) {\n\t\t\t\t\t\t\tHashSet<Class> diff = new HashSet<Class>();\n\t\t\t\t\t\t\tfor (Class p : linExt2) {\n\t\t\t\t\t\t\t\tif (!linExt.contains(p))\n\t\t\t\t\t\t\t\t\tdiff.add(p);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdiffs.add(diff);\n\n\t\t\t\t\t\t\tdiff = new HashSet<Class>();\n\t\t\t\t\t\t\tfor (Class p : linExt) {\n\t\t\t\t\t\t\t\tif (!linExt2.contains(p))\n\t\t\t\t\t\t\t\t\tdiff.add(p);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdiffs.add(diff);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Compute conflicts di * dj for all j != i\n\t\t\t\tfor (HashSet<Class> diff : diffs) {\n\t\t\t\t\tfor (HashSet<Class> diff2 : diffs) {\n\t\t\t\t\t\tif (diff != diff2) {\n\t\t\t\t\t\t\tfor (Class c1 : diff) {\n\t\t\t\t\t\t\t\tList<Class> conflicts = new ArrayList<Class>();\n\t\t\t\t\t\t\t\tif (this.conflictGraph.containsKey(c1))\n\t\t\t\t\t\t\t\t\tconflicts = this.conflictGraph.get(c1);\n\n\t\t\t\t\t\t\t\tfor (Class c2 : diff2) {\n\t\t\t\t\t\t\t\t\tconflicts.add(c2);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis.conflictGraph.put(c1, conflicts);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void resolveConflicts( Grammar grammar, State state, List<Action> tshifts, List<Action> ntshifts)\n {\n List<State> splits = new ArrayList<State>();\n\n Collections.sort( tshifts);\n Collections.sort( ntshifts);\n \n State currSplit = null;\n State prevSplit = null;\n for( int i=1, k=1; i<tshifts.size(); i++, k++)\n {\n prevSplit = currSplit;\n currSplit = null;\n \n Action prev = tshifts.get( i-1);\n Action curr = tshifts.get( i);\n \n if ( isOverlapping( prev.symbols, curr.symbols))\n {\n boolean conflict =\n (curr.type == Action.Type.tshift && prev.type == Action.Type.reduce) || \n (curr.type == Action.Type.reduce && prev.type == Action.Type.tshift) ||\n (curr.type == Action.Type.reduce && prev.type == Action.Type.reduce) ||\n (curr.type == Action.Type.tshift && prev.type == Action.Type.tshift);\n\n if ( conflict)\n {\n long prevPriority = prev.getPriority();\n long currPriority = curr.getPriority();\n if ( prevPriority < currPriority)\n {\n log.debugf( \"\\nConflict in state %d:\\n %s\\n %s\", state.index, prev, curr);\n log.debug( \"Conflict resolved: second rule(s) have higher priority\");\n deleteStackOp( state, k-1); k--;\n }\n else if ( prevPriority > currPriority)\n {\n log.debugf( \"\\nConflict in state %d:\\n %s\\n %s\", state.index, prev, curr);\n log.debug( \"Conflict resolved: first rule(s) have higher priority\");\n deleteStackOp( state, k); k--;\n }\n else\n {\n log.warnf( \"\\nConflict in state %d:\\n %s\\n %s\", state.index, prev, curr);\n log.warn( \"Conflict resolved by splitting state\");\n splitState( state, k, prevSplit, splits);\n currSplit = splits.get( splits.size() - 1);\n conflicts++;\n }\n }\n }\n }\n \n for( int i=1; i<ntshifts.size(); i++)\n {\n prevSplit = currSplit;\n currSplit = null;\n \n Action prev = ntshifts.get( i-1);\n Action curr = ntshifts.get( i);\n \n if ( curr.symbols[ 0] <= prev.symbols[ 0])\n {\n if ( curr.type == Action.Type.ntshift && prev.type == Action.Type.ntshift && curr.itemSet.equals( prev.itemSet))\n {\n log.warnf( \"\\nConflict in state %d:\\n %s\\n %s\", state.index, prev, curr);\n conflicts++;\n }\n }\n }\n \n if ( splits.size() > 0)\n {\n for( State split: splits) \n {\n log.debugf( \"Created new state %d to resolve conflict.\", split.index);\n removeNulls( split);\n \n for( StackOp shift: split.stackOps)\n {\n if ( shift == nullShift)\n throw new IllegalStateException();\n }\n }\n\n state.splits = splits.toArray( new State[ 0]);\n state.stackOps = null;\n state.gotos = null;\n }\n }", "public void affichageSolution() {\n\t\t//On commence par retirer toutes les traces pré-existantes du labyrinthe\n\t\tfor (int i = 0 ; i < this.laby.getHauteur() ; i++) {\n\t\t\tfor (int j = 0 ; j < this.laby.getLargeur() ; j++) {\n\t\t\t\tif (this.laby.getLabyrinthe()[i][j] instanceof Trace) {\n\t\t\t\t\tthis.laby.getLabyrinthe()[i][j] = new Case();\n\t\t\t\t\t((JLabel)grille.getComponents()[i*this.laby.getLargeur()+j]).setIcon(this.laby.getLabyrinthe()[i][j].imageCase(themeJeu));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//On parcourt toutes les cases du labyrinthe. Si on trouve un filon non extrait dont le chemin qui le sépare au mineur est plus petit que shortestPath, on enregistre la longueur du chemin ainsi que les coordonnees de ledit filon\n\t\tint shortestPath = Integer.MAX_VALUE;\n\t\tint[] coordsNearestFilon = {-1,-1};\n\t\tfor (int i=0 ; i < this.laby.getHauteur() ; i++) {\n\t\t\tfor (int j=0 ; j < this.laby.getLargeur() ; j++) {\n\t\t\t\tif (this.laby.getLabyrinthe()[i][j] instanceof Filon && ((Filon)this.laby.getLabyrinthe()[i][j]).getExtrait() == false) {\n\t\t\t\t\tif (this.laby.solve(j,i) != null) {\n\t\t\t\t\t\tint pathSize = this.laby.solve(j,i).size();\n\t\t\t\t\t\tif (pathSize < shortestPath) {\n\t\t\t\t\t\t\tshortestPath = pathSize;\n\t\t\t\t\t\t\tcoordsNearestFilon[0] = j;\n\t\t\t\t\t\t\tcoordsNearestFilon[1] = i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//Si il n'y a plus de filon non extrait atteignable, on cherche les coordonnes de la clef\n\t\tif (coordsNearestFilon[0] == -1) {\n\t\t\tcoordsNearestFilon = this.laby.getCoordsClef();\n\t\t\t//Si il n'y a plus de filon non extrait atteignable et que la clef a deja ouvert la porte, on cherche les coordonnes de la sortie\n\t\t\tif (coordsNearestFilon == null)\tcoordsNearestFilon = this.laby.getCoordsSortie();\n\t\t}\n\n\t\t//On cree une pile qui contient des couples de coordonnees qui correspondent a la solution, puis on depile car le dernier element est l'objectif vise\n\t\tStack<Integer[]> solution = this.laby.solve(coordsNearestFilon[0], coordsNearestFilon[1]);\n\t\tsolution.pop();\n\n\t\t//Tant que l'on n'arrive pas au premier element de la pile (cad la case ou se trouve le mineur), on depile tout en gardant l'element depile, qui contient les coordonnees d'une trace que l'on dessine en suivant dans la fenetre\n\t\twhile (solution.size() != 1) {\n\t\t\tInteger[] coordsTmp = solution.pop();\n\t\t\tTrace traceTmp = new Trace();\n\t\t\tthis.laby.getLabyrinthe()[coordsTmp[1]][coordsTmp[0]] = new Trace();\n\t\t\t((JLabel)grille.getComponents()[coordsTmp[1]*this.laby.getLargeur()+coordsTmp[0]]).setIcon(traceTmp.imageCase());\n\t\t}\n\t\tSystem.out.println(\"\\n========================================== SOLUTION =====================================\\n\");\n\t\tthis.affichageLabyrinthe();\n\t}", "@Override\n\t\tpublic double heuristic() {\n\t\t\tint sum = 0;\n\t\t\tfor (int i = 0; i < k; i++) {\n\t\t\t\tsum += Math.abs(xGoals[i] - state[i]);\n\t\t\t\tsum += Math.abs(yGoals[i] - state[k + i]);\n\t\t\t}\n\t\t\treturn sum;\n\t\t}", "public void solveGame3() {\n\t\tlosingStates = new HashSet<S>();\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tint[] uncontrollableCount = new int[game.getStates().size()+1];\n\t\tint[] uncontrollableLosingCount = new int[game.getStates().size()+1];\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> uncontrollableSuccesors;\n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\t uncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\n\t\t\t uncontrollableCount[indexCount] = uncontrollableSuccesors.size();\n\t\t\t uncontrollableLosingCount[indexCount] = 0;\n\t\t\t isUncontrollable[indexCount] = game.isUncontrollable(state);\n\t\t\t indexCount+=1;\n\t\t}\n\t\t\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t}\n\n\t\t// Handle the pending states\n\t\twhile (!losing.isEmpty()) {\n\t\t\tS state = losing.poll();\n\n\t\t\t\n\t\t\tlosingStates.add(state);\n\n\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\tfor (S pred : predecessors) {\n\t\t\t\tif(losing.contains(pred) || losingStates.contains(pred))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t//if(i == -1)\n\t\t\t\t\t//continue;\n\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}else{\n\t\t\t\t\tuncontrollableLosingCount[i]++;\n\t\t\t\t\tif (uncontrollableLosingCount[i] == uncontrollableCount[i])\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "private static LinkedList<Integer> localSearchSimulatedAnnealing(File fileNameWithPath, int kNeighborHood ) throws Exception{\n\t\t\n\t\tString traceString = \"\";\n\t\tdouble bestCost = Double.POSITIVE_INFINITY;\n\t\tLinkedList<Integer> bestTspList = null;\n\t\tdouble bestCycleTime = Double.POSITIVE_INFINITY;\n\n\t\tif (Project.runId == -1 )\n\t\t\tProject.runId = 1;\n\n\t\t/* \n\t\t * read the file and build the cost table\n\t\t */\n parseEdges(fileNameWithPath);\n\n /*\n\t\t * time starts once you read the data\n */\n\t\tdouble baseTime = System.nanoTime();\n\n\t\t/*\n\t\t * invoking furthest insertion algorithm to get the tsp\n\t\t */\n\t\tlong startNodeSeed = (long)(1000.0*generator.nextDouble());\n\t\tLinkedList<Integer> currentTspList = FurthestInsertion.generateTSP(Project.sourceGTree,startNodeSeed);\n\t\t\n\t\tdouble currentTspCost = tspCost(currentTspList);\n\n\t\tbestTspList = currentTspList;\n\t\tbestCost = currentTspCost;\n\t\tbestCycleTime = System.nanoTime() - baseTime;\n\n\t\t/* print the trace file */\n\t\ttraceString = String.format(\"%.2f, %d\",Math.round(((System.nanoTime()-baseTime)/nanosecs)*100.0)/100.0,Math.round(bestCost));\n\t\tprintTrace(runId,traceString);\n\n\t\t/*\n\t\t * time starts now - start annealing\n\t\t */\n\t\tdouble annealingProbabilityThreshold = .2*generator.nextDouble(); // acceptance prob threshold for bad results\n\t\tdouble T = 100; // annealing temp\n\t\tdouble coolingRate = .00000001; // rate of cooling in each step\n\n\t\t/*\n\t\t * remove the last node as it matches the first\n\t\t */\n\t\tcurrentTspList.removeLast();\n\n\t\twhile ( T > 1 )\n\t\t{\n\t\t\t/*\n\t\t\t * reached cutoff time\n\t\t\t */\n\t\t\tif ( System.nanoTime()-baseTime >= Project.cutoffTimeSeconds*nanosecs ) {\n\t\t\t\ttimedOut=true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tdouble cycleStartTime = System.nanoTime();\n\n\t\t\tLinkedList<Integer> newTspList = currentTspList;\n\n\t\t\t/* do a 2 opt search in current k=5 neighborhood to get a newtsp */\n\t\t\t/* 1. Pick the first random element in the current tsp */\n\t\t\tint element2 = (int)((double)(newTspList.size()-1) * generator.nextDouble());\n\t\t\tint element1 = element2 - 1;\n\t\t\tif ( element1 == -1 ){\n\t\t\t\telement1 = newTspList.size()-1;\n\t\t\t}\n\t\t\t\n int delta;\n\n\t\t\t/*\n\t\t\t * search in the neighborhood specified\n * if not specified search all\n\t\t\t */\n if ( kNeighborHood != -1 ) {\n\t\t\t /* We want to search in the specified k=n neighborhoods of element1 */\n\t\t\t delta= (int)(2*kNeighborHood*generator.nextDouble()) - kNeighborHood;\n } else {\n\t\t\t delta= (int)((newTspList.size()-1)*generator.nextDouble()) - (int)(newTspList.size()/2);\n\t\t\t}\n\n\t\t\tif ( delta == 0 ) {\n\t\t\t\tdelta = 2;\n\t\t\t} else if ( delta == 1 ) {\n\t\t\t\tdelta = 2;\n\t\t\t} else if ( delta == -1) {\n\t\t\t\tdelta = -2; }\n\n\t\t\tint element4 = element2 + delta;\n\n\t\t\tif ( element4 < 0 ) {\n\t\t\t\telement4 = newTspList.size()+element4;\n\t\t\t}else if ( element4 >= newTspList.size() ) {\n\t\t\t\telement4 = element4-(newTspList.size()-1);\n\t\t\t}\n\n\t\t\tint element3 = element4 -1;\n\t\t\tif ( element3 == -1 ){\n\t\t\t\telement3 = newTspList.size()-1;\n\t\t\t}\n\n\n\t\t\t/* \n\t\t\t * the new tsp will have element2->element4.......element1->element3....\n\t\t\t */\n\t\t\tInteger vertex_3 = newTspList.get(element3);\n\t\t\tnewTspList.set(element3,newTspList.get(element2));\n\t\t\tnewTspList.set(element2,vertex_3);\n\n\t\t\t/*\n\t\t\t * from element2+1 to element3-1 swap to reverse their order\n\t\t\t */\n\t\t\twhile ( element2 < element3 ){\n\t\t\t\telement3 = element3-1;\n\t\t\t\tif ( element3 == -1 ) {\n\t\t\t\t\telement3 = newTspList.size()-1;\n\t\t\t\t}\n\n\t\t\t\telement2 = element2 + 1;\n\t\t\t\tif ( element2 == newTspList.size() ) {\n\t\t\t\t\telement3 = 0;\n\t\t\t\t}\n\n\t\t\t\tInteger tempVertex = newTspList.get(element2);\n\t\t\t\tnewTspList.set(element2,newTspList.get(element3));\n\t\t\t\tnewTspList.set(element3,tempVertex);\n\n\t\t\t}\n\n\t\t\tdouble newTspCost = tspCost(newTspList);\n\n\t\t\t/* if new local search solution is better than eariler take the search and continue search\n\t\t\t */\n\t\t\tif ( newTspCost <= currentTspCost ){\n\t\t\t\tcurrentTspList = newTspList;\n\t\t\t\tcurrentTspCost = newTspCost;\n\t\t\t} else {\n\t\t\t/* if new local search solution is not better than eariler \n\t\t\t * then check the difference and the probability at this stage of annealing\n\t\t\t * if probability is higher than threshold set, then keep new search ad continue, else discard \n\t\t\t */\n\t\t\t\tif ( Math.exp((currentTspCost - newTspCost) / T) > generator.nextDouble() ){\n\t\t\t\t\tcurrentTspList = newTspList;\n\t\t\t\t\tcurrentTspCost = newTspCost;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t//Subtract the start time from the finish time to get the actual algorithm running time; divide by 10e6 to convert to milliseconds\n\t\t\tdouble cycleTime = (System.nanoTime()-cycleStartTime);\n\n\t\t\t/* first improvement , take the best each time */\n\t\t\tif ( newTspCost < bestCost ) {\n\t\t\t\tbestCost = newTspCost;\n\t\t\t\tbestTspList = newTspList;\n\t\t\t\tbestCycleTime = cycleTime;\n\t\t\t\t/* print the trace file */\n\t\t\t\ttraceString = String.format(\"%.2f, %d\",Math.round(((System.nanoTime()-baseTime)/nanosecs)*100.0)/100.0,Math.round(bestCost));\n\t\t\t\tappendToTraceFile(runId,traceString);\n\n\t\t\t\tif ( bestCost <= optimalCost )\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t/* the cooling */\n\t\t\tT = T - T * coolingRate;\n\n\t\t}\n\n\t\t/* print the sol file */\n\t\tprintSol(runId,bestTspList,bestCost);\n\n\t\t/* print the tab results file */\n\t\tappendTabResults(runId,bestCycleTime,bestCost,bestTspList);\n\n\t\treturn bestTspList;\n\n\t}", "public Solver(Board initial) {\r\n if (initial == null) throw new IllegalArgumentException();\r\n\r\n\r\n SearchNode initialAdjacent = new SearchNode(initial.twin(), null, 0);\r\n MinPQ<SearchNode> adjacentPriorityQueue = new MinPQ<>(1);\r\n adjacentPriorityQueue.insert(initialAdjacent);\r\n\r\n\r\n SearchNode initialNode = new SearchNode(initial, null, 0);\r\n MinPQ<SearchNode> priorityQueue = new MinPQ<>(1);\r\n priorityQueue.insert(initialNode);\r\n\r\n if (initial.isGoal()) {\r\n goal = initialNode;\r\n isSolvable = true;\r\n return;\r\n } else if (initialAdjacent.board.isGoal()) {\r\n isSolvable = false;\r\n }\r\n\r\n\r\n SearchNode currentAdjacent = initialAdjacent;\r\n SearchNode currentBoard = initialNode;\r\n\r\n while (!currentAdjacent.board.isGoal() && !currentBoard.board.isGoal()) {\r\n\r\n currentAdjacent = adjacentPriorityQueue.delMin();\r\n currentBoard = priorityQueue.delMin();\r\n\r\n for (Board adjacentNeighbor : currentAdjacent.board.neighbors()) {\r\n SearchNode toBeInserted = new SearchNode(adjacentNeighbor, currentAdjacent, currentAdjacent.previousMoves + 1);\r\n if (currentAdjacent.previousSearchNode == null || !toBeInserted.board.equals(currentAdjacent.previousSearchNode.board)) {\r\n adjacentPriorityQueue.insert(toBeInserted);\r\n }\r\n }\r\n\r\n\r\n for (Board neighbor : currentBoard.board.neighbors()) {\r\n SearchNode toBeInserted = new SearchNode(neighbor, currentBoard, currentBoard.previousMoves + 1);\r\n if (currentBoard.previousSearchNode == null || !toBeInserted.board.equals(currentBoard.previousSearchNode.board)) {\r\n\r\n priorityQueue.insert(toBeInserted);\r\n }\r\n }\r\n }\r\n if (currentAdjacent.board.isGoal()) {\r\n isSolvable = false;\r\n goal = initialNode;\r\n } else {\r\n goal = currentBoard;\r\n isSolvable = true;\r\n }\r\n\r\n }", "public void solveGame5() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "public ReturnClass astar_algo(){\n long start=System.nanoTime();\n TreeStar node=new TreeStar(variables,0);\n openList.push(node);\n\n while (!openList.isEmpty())\n {\n\n TreeStar temp= openList.pollLast(); //pop the highest scoring node in openList\n refreshUsage(temp.variables); //uses the current node variables to update usageArray\n\n if((System.nanoTime()-start)/1000000000>=maxTime){\n System.out.println(\"time limit reached\");\n ReturnClass returnClass= new ReturnClass(temp.variables,temp.score,false);\n return returnClass;\n }\n\n if(temp.score==nbC){\n System.out.println(\"solution trouvée !\");\n printArray(temp.variables);\n ReturnClass returnClass= new ReturnClass(temp.variables,temp.score,true);\n return returnClass;\n }\n\n int bestVar=0;\n if(heuristic.equals(\"TD Heuristic\")){\n bestVar= chooseVTD(); //get the highest scoring unused var to use it in children\n }\n else if(heuristic.equals(\"TD-long heuristic\")){\n bestVar=chooseVTD();\n }\n else if(heuristic.equals(\"Partial-diff Heuristic\")){\n bestVar= chooseVDiff(temp.variables); //get the highest scoring unused var to use it in children\n }\n else {\n bestVar= chooseVDiff(temp.variables);\n }\n\n\n TreeStar node1= nextVar(temp.variables, 0,bestVar,temp.profondeur+1);\n TreeStar node2= nextVar(temp.variables, 1,bestVar,temp.profondeur+1);\n\n if(node1!=null){\n addToOpenList(node1);\n addToOpenList(node2);\n }\n }\n\n System.out.println(\"solution non trouvée\");\n return null;\n }", "private Game findBestUpcomingGame(List<Game> games,\n Map<String, Integer> previous, int time) {\n Game bestGame = null;\n int bestScore = -1;\n for (Game game : games) {\n if (game.isFinal()) continue;\n Team team1 = game.getTeam1();\n Team team2 = game.getTeam2();\n int minLagViolation = 0;\n int maxLagViolation = 0;\n int earliestStartViolation = 0;\n int latestStartViolation = 0;\n int score;\n Object previousTimeTeam1 = previous.get(team1.getName());\n Object previousTimeTeam2 = previous.get(team2.getName());\n \n earliestStartViolation += calculateEarliestStartViolation(game, time);\n latestStartViolation += calculateLatestStartViolation(game, time);\n if (previousTimeTeam1 != null) {\n minLagViolation += calculateMinLagViolation(team1, time, (int) previousTimeTeam1);\n maxLagViolation += calculateMaxLagViolation(team1, time, (int) previousTimeTeam1);\n }\n if (previousTimeTeam2 != null) {\n minLagViolation += calculateMinLagViolation(team2, time, (int) previousTimeTeam2);\n maxLagViolation += calculateMaxLagViolation(team2, time, (int) previousTimeTeam2);\n }\n\n score = MAX_LAG_WEIGHT * maxLagViolation \n + MIN_LAG_WEIGHT * minLagViolation \n + EARLIEST_START_WEIGHT * earliestStartViolation \n + LATEST_START_WEIGHT * latestStartViolation;\n if (bestScore < 0 || score < bestScore) {\n bestScore = score;\n bestGame = game;\n }\n }\n // no improvement found, use first game\n if (bestGame == null) {\n bestGame = games.get(0);\n }\n \n return bestGame;\n }", "Object getBest();", "public long getBestSolutionTime();", "@Override\n public final void solve() {\n this.flag1 = this.neo.getPosition().equals(this.goal);\n \n }", "private void planDynamicStairs() throws GameActionException, HungryException {\r\n\t\tInteger fluxHeight = gameMap.get(fluxInfo.location).totalHeight;\r\n\t\tif (fluxHeight == fluxHeightWhenStairsPlanned){\r\n\t\t\tif (DEBUG) System.out.println(\"No need to plan stairs now\");\r\n\t\t\t//return; /* No return for now. Always plan stairs, so no stupid block lockups will occur */\r\n\t\t}\r\n\t\t\r\n\t\tif (DEBUG) System.out.println(\"-----TOWER-----\");\r\n\t\tDirection randDir = navigation.getRandomDirection();\r\n\t\tMapLocation start1 = fluxInfo.location.add(randDir).add(randDir);\r\n\t\tMapLocation start2 = fluxInfo.location.subtract(randDir).subtract(randDir);\r\n\t\tif ((gameMap.get(start1) == null) || (gameMap.get(start2) == null))\r\n\t\t\t/* unlucky - start position wasn't scanned yet */\r\n\t\t\treturn;\r\n\t\t\r\n\t\tfluxHeightWhenStairsPlanned = fluxHeight;\r\n\t\t\r\n\t\tList<MapLocation> fluxPath1 = navigation.findPathUsingAStar(gameMap, start1, fluxInfo.location, false);\r\n\t\t//if (DEBUG) System.out.println(fluxPath1);\r\n\t\tList<MapLocation> fluxPath2 = navigation.findPathUsingAStar(gameMap, start2, fluxInfo.location, false);\r\n\t\t//if (DEBUG) System.out.println(fluxPath2);\r\n\t\tCollections.reverse(fluxPath1);\r\n\t\tCollections.reverse(fluxPath2);\r\n\t\tList<MapLocation> result = new ArrayList<MapLocation>();\r\n\t\twhile ((fluxPath1.size() > 0) && (fluxPath2.size() > 0) && (fluxPath1.get(0).equals(fluxPath2.get(0)))){\r\n\t\t\tresult.add(fluxPath1.remove(0));\r\n\t\t\tfluxPath2.remove(0);\r\n\t\t}\r\n\t\tCollections.reverse(result);\r\n\t\tif (result.size() >= stairs.size())\r\n\t\t\t/* prefer fresh data, but not too short */\r\n\t\t\tstairs = result;\r\n\t\tif (DEBUG) System.out.println(result);\r\n\t\tif (DEBUG) System.out.println(navigation.changePathToDirections(result));\r\n\t\tif (DEBUG) System.out.println(\"----/TOWER-----\");\r\n\t}", "@Override\n public Matching stableMarriageGaleShapley_residentoptimal(Matching marriage) {\n\n int m = marriage.getHospitalCount();\n int n = marriage.getResidentCount();\n\n ArrayList<ArrayList<Integer>> hospital_preference = marriage.getHospitalPreference();\n ArrayList<ArrayList<Integer>> resident_preference = marriage.getResidentPreference();\n ArrayList<Integer> hospitalSlots = marriage.getHospitalSlots();\n ArrayList<Integer> residentMatching = new ArrayList<Integer>();\n arrlistInit(residentMatching, n, -1, false); //O(n)\n\n /*At first the resident can propose to all his list.\n Each time a proposal is made the hospital is removed from the list*/\n\n /*Trying to create a copy of the arraylist elements not copy of references*/\n ArrayList<ArrayList<Integer>> hospitalsToProposeTo = new ArrayList<ArrayList<Integer>>();\n for (int i = 0; i < n; i++) //O(n)\n hospitalsToProposeTo.add(new ArrayList<Integer>(resident_preference.get(i)));\n\n\n /*list of residents that still can propose(free and hasn't proposed to every hospital)*/\n ArrayList<Integer> proposing = new ArrayList<Integer>();\n arrlistInit(proposing, n, 0, true); //O(n)\n\n\n /*Keep track of each hospital matched residents*/\n ArrayList<ArrayList<Integer>> hospitalResidents = new ArrayList<ArrayList<Integer>>(0);\n for (int i = 0; i < m; i++)\n hospitalResidents.add(new ArrayList<Integer>(0)); //O(m)\n\n /*Array list that holds the value of the lowest matched resident rank in each hospital\n * so each time a resident propose to a full hospital, the resident is swapped with the least ranked rmatched resident */\n ArrayList<Integer> lowestMatchedResidentRank = new ArrayList<Integer>();\n arrlistInit(lowestMatchedResidentRank, m, -1, false); //O(m)\n\n /*we enter the loop as long as some residents aren't done proposing to all hospitals yet O(mn*maximum no of spots)*/\n while (!proposing.isEmpty()) {\n\n /*Get the head of the proposing list*/\n for (int residentIndex = 0; residentIndex < proposing.size(); residentIndex++) {\n int resident = proposing.get(0);\n int hospital = 0;\n int hospitalIndex;\n /*Get the first hospital in the resident list which he hasn't proposed to yet, breaks if he can't no longer propose if matched*/\n for (hospitalIndex = 0; hospitalIndex < hospitalsToProposeTo.get(resident).size() && proposing.contains(resident); hospitalIndex++) {\n hospital = hospitalsToProposeTo.get(resident).get(0);\n int residentRank = hospital_preference.get(hospital).indexOf(resident);\n\n /*hospital is full, loop through the matched residents and see if anyone can be kicked out*/\n if (hospitalResidents.get(hospital).size() == hospitalSlots.get(hospital)) {\n\n if (residentRank < lowestMatchedResidentRank.get(hospital)) {\n /*1.Replace in hospitalResidents\n * 2.Add/remove in resident-matching\n * 3.Remove resident from the proposing list\n * 4.Check if matched resident still has hospitals to propose to (if yes, add to proposing)\n */\n int lowestMatchedResident = hospital_preference.get(hospital).get(lowestMatchedResidentRank.get(hospital));\n\n hospitalResidents.get(hospital).set(hospitalResidents.get(hospital).indexOf(lowestMatchedResident), resident);\n residentMatching.set(lowestMatchedResident, -1);\n residentMatching.set(resident, hospital);\n proposing.remove(proposing.indexOf(resident));\n if (!hospitalsToProposeTo.get(lowestMatchedResident).isEmpty()) {\n proposing.add(lowestMatchedResident);\n }\n\n /*set the lowest rank\n * TODO make it O(1)*/\n int min = 0;\n for (int i = 0; i < hospitalResidents.get(hospital).size(); i++) {\n int tempRank = hospital_preference.get(hospital).indexOf(hospitalResidents.get(hospital).get(i));\n if (tempRank > min)\n min = tempRank;\n }\n lowestMatchedResidentRank.set(hospital, min);\n\n }\n }\n\n /*If there is available spot*/\n else {\n /*1.Add in hospitalResidents\n * 2.Add in resident-matching\n * 3.Set the lowest ranked resident\n * 4.Remove resident from proposing list\n */\n\n /*Update the lowest rank*/\n if (residentRank > lowestMatchedResidentRank.get(hospital))\n lowestMatchedResidentRank.set(hospital, residentRank);\n\n hospitalResidents.get(hospital).add(resident);\n residentMatching.set(resident, hospital);\n proposing.remove(proposing.indexOf(resident));\n }\n\n /*1. Remove hospital from resident's hospitalsToProposeTo\n *2. If resident is matched or proposed to every possible hospital, remove resident from proposing list\n */\n\n hospitalsToProposeTo.get(resident).remove(hospitalsToProposeTo.get(resident).indexOf(hospital));\n if (hospitalsToProposeTo.get(resident).size() == 0 && proposing.contains(resident))\n proposing.remove(proposing.indexOf(resident));\n }\n }\n }\n\n marriage.setResidentMatching(residentMatching);\n return marriage;\n\n }", "private void adjustHits(Node winner, String string) {\n\t\tIterator<HitHolder> ite = winner.hitList.iterator();\n\t\tHitHolder temp = null;\n\t\tboolean exists = false;\n\t\t\n\t\t\n\t\twhile(ite.hasNext())\n\t\t{\n\t\t\ttemp = ite.next();\n\t\t\t\n\t\t\tif(temp.element.equalsIgnoreCase(string))\n\t\t\t{\n\t\t\t\tif(temp.getFirstIteration() == -1)\n\t\t\t\t{\n\t\t\t\t\ttemp.firstIteration = CURRENT_ITERATION;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttemp.lastIteration = CURRENT_ITERATION;\n\t\t\t\ttemp.numberOfHits++;\n\t\t\t\texists = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!exists)\n\t\t{\n\t\t\twinner.hitList.add(new HitHolder(string, CURRENT_ITERATION));\n\t\t}\n\t}", "private static MapLocation getBestPastrLocNearMeBasedOnCowGrowthRate() {\n\t\tif (Clock.getRoundNum() < 1) {\n\t\t\tallCowGrowths = rc.senseCowGrowth();\t\t\t\n\t\t}\n\t\tMapLocation bestLocation = new MapLocation(curLoc.x, curLoc.y);\n\t\tdouble cowGrowthAmount = 0;\n\t\tMapLocation enemyHQLocation = rc.senseEnemyHQLocation();\n\t\tdouble distanceToEnemyHQ = curLoc.distanceSquaredTo(enemyHQLocation);\n\t\tfor (int i = 15; i-- > 0;) {\n\t\t\tfor (int j = 15; j-- > 0;) {\n\t\t\t\t// Check that it's in bounds\n\t\t\t\tif (curLoc.x - i + 8 >= 0 && curLoc.x - i + 8 < rc.getMapWidth() &&\n\t\t\t\t\tcurLoc.y - j + 8 >= 0 && curLoc.y - j + 8 < rc.getMapHeight()) {\n\t\t\t\t\tMapLocation mapLoc = new MapLocation(curLoc.x - i + 8, curLoc.y - j + 8);\n\t\t\t\t\tdouble currentLocGrowth = allCowGrowths[curLoc.x - i + 8][curLoc.y - j + 8];\n\n\t\t\t\t\t// Check that it's behind a perpendicular line and not void\n\t\t\t\t\t// and choose the best point.\n\t\t\t\t\tif (mapLoc.distanceSquaredTo(enemyHQLocation) < distanceToEnemyHQ &&\n\t\t\t\t\t\tcurrentLocGrowth > cowGrowthAmount && rc.senseTerrainTile(mapLoc) != TerrainTile.VOID) {\n\t\t\t\t\t\tcowGrowthAmount = currentLocGrowth;\n\t\t\t\t\t\tbestLocation = mapLoc;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn bestLocation;\n\t}", "void findInstantiations (final Buffers buffers)\n\t{\n\t\tbuffers.removeDecayedChunks();\n\n\t\tHashSet<Instantiation> set = new HashSet<Instantiation>();\n\t\tbuffers.sortGoals();\n\n\t\tif (buffers.numGoals() == 0)\n\t\t{\n for (Production p : productions.values()) {\n Instantiation inst = p.instantiate(buffers);\n if (inst != null) set.add(inst);\n }\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor (int i=0 ; set.isEmpty() && i<buffers.numGoals() ; i++)\n\t\t\t{\n\t\t\t\tbuffers.tryGoal (i);\n\t\t\t\tif (threadedCognitionTrace)\n\t\t\t\t\tmodel.output (\"*** (tct) trying goal \" + buffers.get(Symbol.goal));\n for (Production p : productions.values()) {\n Instantiation inst = p.instantiate(buffers);\n if (inst != null) set.add(inst);\n }\n\t\t\t}\n\t\t}\n\n\t\tif (threadedCognitionTrace)\n\t\t\tmodel.output (\"*** (tct) found \"+set.size()+\" match\"+(set.size()==1 ? \"\" : \"es\"));\n\n\t\tif (!set.isEmpty())\n\t\t{\n\t\t\tif (conflictSetTrace) model.output (\"Conflict Set:\");\n\t\t\tIterator<Instantiation> itInst = set.iterator();\n\t\t\tInstantiation highestU = itInst.next();\n\t\t\tif (conflictSetTrace) model.output (\"* (\" + String.format(\"%.3f\",highestU.getUtility()) + \") \" + highestU);\n\t\t\twhile (itInst.hasNext())\n\t\t\t{\n\t\t\t\tInstantiation inst = itInst.next();\n\t\t\t\tif (conflictSetTrace) model.output (\"* (\" + String.format(\"%.3f\",inst.getUtility()) + \") \" + inst);\n\t\t\t\tif (inst.getUtility() > highestU.getUtility()) highestU = inst;\n\t\t\t}\n\n\t\t\tfinal Instantiation finalInst = highestU;\n\t\t\tif (conflictSetTrace) model.output (\"-> (\" + String.format(\"%.3f\",finalInst.getUtility()) + \") \" + finalInst);\n\n\t\t\tif (finalInst.getProduction().isBreakPoint())\n\t\t\t{\n\t\t\t\tmodel.addEvent (new Event (model.getTime() + .049,\n\t\t\t\t\t\t\"procedural\", \"about to fire \" + finalInst.getProduction().getName().getString().toUpperCase())\n\t\t\t\t{\n\t\t\t\t\tpublic void action() {\n\t\t\t\t\t\tmodel.output (\"------\", \"break\");\n\t\t\t\t\t\tmodel.stop();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tString extra = \"\";\n\t\t\tif (buffers.numGoals() > 1)\n\t\t\t{\n\t\t\t\tChunk goal = buffers.get(Symbol.goal);\n\t\t\t\textra = \" [\" + ((goal!=null) ? goal.getName().getString() : \"nil\") + \"]\";\n\t\t\t}\n\n\t\t\tmodel.addEvent (new Event (model.getTime() + .050,\n\t\t\t\t\t\"procedural\", \"** \" + finalInst.getProduction().getName().getString().toUpperCase() + \" **\" + extra)\n\t\t\t{\n\t\t\t\tpublic void action() {\n\t\t\t\t\tfire (finalInst, buffers);\n\t\t\t\t\tfindInstantiations (buffers);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "public void generateNeighborhood(TSPSolution s){\r\n\t\tint [] rounte = new int[problem.city_num+1];\r\n\t\tfor(int i=0;i<problem.city_num;i++) rounte[i] = s.route[i];\r\n\t\trounte[problem.city_num] = rounte[0];\r\n\t\tint [] pos = new int[problem.city_num];\r\n\t\tproblem.calculatePosition(rounte, pos);\r\n\t\tint pos1 = 0;\r\n\t\tint pos2 = 0;\r\n\t\tfor(int k=0;k<problem.city_num;k++){\r\n\t\t\tint i = k;\r\n\t\t\tpos1 = i;\r\n\t\t\tint curIndex = rounte[i];\r\n\t\t\tint nextIndex = rounte[i+1];\r\n\t\t\tArrayList<Integer> candidate = problem.candidateList.get(curIndex);\r\n\t\t\tIterator<Integer> iter = candidate.iterator();\r\n\t\t\twhile(iter.hasNext()){\r\n\t\t\t\tint next = iter.next();\r\n\t\t\t\tpos2 = pos[next];\r\n\t\t\t\tint curIndex1 = rounte[pos2];\r\n\t\t\t\tint nextIndex1 = rounte[pos2+1];\r\n\t\t\t\tif(curIndex == nextIndex1) continue;\r\n\t\t\t\tif(curIndex == curIndex1) continue;\r\n\t\t\t\tif(nextIndex == nextIndex1) continue;\r\n\t\t\t\tif(curIndex1 == nextIndex) continue;\r\n\t\t\t\tint betterTimes = 0;\r\n\t\t\t\tTSPSolution solution = new TSPSolution(problem.city_num, problem.obj_num, -1);\r\n\t\t\t\tfor(int j=0;j<problem.obj_num;j++){\r\n\t\t\t\t\tint gain = problem.disMatrix[j*problem.city_num*problem.city_num+curIndex*problem.city_num+curIndex1] +\r\n\t\t\t\t\t\t\tproblem.disMatrix[j*problem.city_num*problem.city_num+nextIndex*problem.city_num+nextIndex1] - \r\n\t\t\t\t\t\t\t(problem.disMatrix[j*problem.city_num*problem.city_num+curIndex*problem.city_num+nextIndex]+\r\n\t\t\t\t\t\t\tproblem.disMatrix[j*problem.city_num*problem.city_num+curIndex1*problem.city_num+nextIndex1]);\r\n\t\t\t\t\tif(gain<0) betterTimes++;\r\n\t\t\t\t\tsolution.object_val[j] = s.object_val[j] + gain;\r\n\t\t\t\t}\r\n\t\t\t\tif(betterTimes==0) continue;\r\n\t\t\t\tsolution.route = s.route.clone();\r\n\r\n\t\t\t\tif(problem.kdSet.add(solution)){\r\n\t\t\t\t\tproblem.converse(pos1, pos2, solution.route, 0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected Set<Norm> regulateConflict(Conflict conflict, Goal goal) {\n\t\tSet<Norm> createdNorms = new HashSet<Norm>();\n\t\tList<Long> blamedAgents = new ArrayList<Long>();\n\t\tView sourceView = conflict.getConflictSource().getView(-1);\n\t\tList<EnvironmentAgentAction> agActions;\n\t\tEnvironmentAgentContext agContext;\n\t\tEnvironmentAgentAction agAction;\n\n\t\t/* Get a list of those agents that are considered as responsible \n\t\t * for the conflict (requires domain knowledge) */\n\t\tblamedAgents = this.cbrMachine.getConflictSource(conflict);\n\n\t\t/* Create a norm that regulates the behavior of each agent\n\t\t * blamed for the conflict in the context previous to the conflict */\n\t\tfor(Long blamedAgentId : blamedAgents) {\n\n\t\t\t/* Get agent's context and action */\n\t\t\tagContext = this.dmFunctions.agentContext(blamedAgentId, sourceView);\n\t\t\tagActions = this.dmFunctions.agentAction(blamedAgentId, \n\t\t\t\t\tconflict.getConflictSource());\n\t\t\tagAction = agActions.get(random.nextInt(agActions.size()));\n\n\t\t\t/* Check that the agent has a valid context */\n\t\t\tif(agContext == null) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t/* Check that no norms applied to the agent in the state\n\t\t\t * previous to the state containing the conflict */\n\t\t\tif(this.normsAppliedToAgentContext(agContext)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t/* Create a new norm prohibiting that action in that context */\n\t\t\tSetOfPredicatesWithTerms precondition = agContext.getDescription();\n\t\t\tif(!precondition.isEmpty()) {\n\t\t\t\tNorm norm = new Norm(precondition, NormModality.Prohibition, \n\t\t\t\t\t\tagAction, goal);\n\t\t\t\t\n\t\t\t\tcreatedNorms.add(norm);\n\t\t\t\t\n\t\t\t\t/* Update metrics */\n\t\t\t\tthis.nsMetrics.newNonRegulatedConflictsSolvedThisTick();\n\t\t\t}\n\t\t}\n\t\treturn createdNorms;\n\t}", "@Override\r\n\tpublic void solve() {\n\t\t\r\n\t}", "void MemorizeBestSource() \n\t{\n\t int i,j;\n\t \n\t\tfor(i=0;i<FoodNumber;i++)\n\t\t{\n\t\tif (f[i]<GlobalMin)\n\t\t\t{\n\t GlobalMin=f[i];\n\t for(j=0;j<D;j++)\n\t GlobalParams[j]=Foods[i][j];\n\t }\n\t\t}\n\t }", "public SpaceProbe gradientDescend(SpaceObject source, SpaceObject goal, double yearsTime){\n double swarmspeed = 10E7;\n Boolean stop = false;\n SpaceProbe localBestProbe = new SpaceProbe(source.getPosition().clone().addConstant(source.getRadius()), source.getVelocity().clone(),5000);\n SpaceProbe globalBestProbe = localBestProbe.clone();\n\n while (!stop){\n System.out.println(swarmspeed);\n ArrayList<SpaceProbe> probesList = new ArrayList<>();\n probesList.addAll(createSwarm(localBestProbe, swarmspeed));\n solarSystem = solarSystem.reset();\n solarSystem.objectList.addAll(probesList);\n\n\n for (int i = 0; i < (int) (yearsTime * 365 * 86400 / 60); i++) {\n solarSystem.updateSolarSystem(60);\n for (SpaceProbe p : probesList) {\n p.calcMinDist(goal);\n }\n }\n localBestProbe = bestProbe(probesList);\n System.out.println(localBestProbe);\n if (localBestProbe.getMinDist() < goal.getRadius()){\n stop = true;\n globalBestProbe = localBestProbe.clone();\n return globalBestProbe;\n }\n if (localBestProbe.getMinDist() < globalBestProbe.getMinDist()){\n globalBestProbe = localBestProbe.clone();\n }\n swarmspeed *= 0.7;\n if (swarmspeed < 1){\n return globalBestProbe;\n }\n Vector3D bestVelocity = globalBestProbe.getVelocity().clone();\n localBestProbe.reset();\n localBestProbe.setVelocity(bestVelocity.clone());\n }\n return globalBestProbe;\n }", "private LineString pickBestGrowthPossibility1(List<LineString> lookAheads) {\n\t\tif (lookAheads == null || lookAheads.size() == 0) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t//sort by:\n\t\t//1. is moving away?\n\t\t//2. number of coordinates in line\n\t\t//3. average elevation of line\n\t\tfinal AvgElevationSectionFitness sectionFitness = new AvgElevationSectionFitness(getTinEdges());\n\t\tComparator<LineString> lookAheadComparator = new Comparator<LineString>() {\n\t\t\tpublic int compare(LineString s1, LineString s2) {\n\t\t\t\t\n\t\t\t\tboolean m1 = LineGrowthHelpers.isMovingAway(s1, s1.getCoordinateN(s1.getNumPoints()-1));\n\t\t\t\tboolean m2 = LineGrowthHelpers.isMovingAway(s2, s2.getCoordinateN(s2.getNumPoints()-1));\n\t\t\t\tif (m1 != m2) {\n\t\t\t\t\treturn m1 ? -1 : 1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (s1.getNumPoints() == s2.getNumPoints()) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tdouble fit1 = sectionFitness.fitness(s1);\n\t\t\t\t\t\t\tdouble fit2 = sectionFitness.fitness(s2);\n\t\t\t\t\t\t\treturn fit1 > fit2 ? -1 \n\t\t\t\t\t\t\t\t\t : fit1 < fit2 ? 1 \n\t\t\t\t\t\t\t\t : 0;\n\t\t\t\t\t\t} \n\t\t\t\t\t\tcatch(IOException e) {\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\treturn s1.getNumPoints() > s2.getNumPoints() ? -1 \n\t\t\t\t\t\t\t\t : s1.getNumPoints() < s2.getNumPoints() ? 1 \n\t\t\t\t\t\t\t : 0; \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tlookAheads.sort(lookAheadComparator);\n\t\treturn lookAheads.get(0);\n\t}", "public interface Heuristic {\n}", "public boolean bestFirstSearch() {\n\t\twhile(!soloution){\n\t\t\tif(open.isEmpty()){\n\t\t\t\tSystem.out.println(\"No more choices to explore\");\n\t\t\t\tSystem.out.println(\"SolutionId: \" + solutionId);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t//chooses the most optimal X\n\t\t\tNode x = popNode();\n\t\t\tclosed.add(x);\n\t\t\tSystem.out.println(\"X:\\t\\t\" + x.state + \" \" + x.h + \" + \" + x.g + \" = \" + x.f);\n\t\t\t//checks if it is a soulution\n\t\t\tif(solution(x)){\n\t\t\t\tSystem.out.println(\"SOLUTION:\\t\" + x.state);\n\t\t\t\tSystem.out.println(\"nodes created: \" + open.size() + closed.size());\n\t\t\t\tprintSolution(x);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t//handles the possible moves from the state x\n\t\t\tsucc = generateAllSuccesors(x);\n\t\t\tfor (Node s : succ) {\n\t\t\t\t//if this state already exist, we will use the node keeping it instead\n\t\t\t\tNode old = findOld(s);\n\t\t\t\tif(old != null)\n\t\t\t\t\ts = old;\n\t\t\t\t//makes the new node a child of x\n\t\t\t\tx.kids.add(s);\n\t\t\t\t//if its a new state it will be inserted to open after evaluation\n\t\t\t\tif(!open.contains(s) && !closed.contains(s)){\n\t\t\t\t\tattachAndEval(s,x);\n\t\t\t\t\tinsert(s);\n\t\t\t\t}\n\t\t\t\t//if its an old node and x is a better parent it will be evalueted again.\n\t\t\t\telse if(x.g + arcCost(x, s) < s.g){\n\t\t\t\t\tattachAndEval(s, x);\n\t\t\t\t\tif(closed.contains(s)){\n\t\t\t\t\t\t//if its closed all children will be evaluated with the new score of \"s\"\n\t\t\t\t\t\tpropagatePathImprovements(s);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public void performMove() {\n\t\tfor (int x = 0; x <= size-1; x++)\n\t\t\tfor (int y = 0; y <= size-1; y++)\n\t\t\t\tlocalBoard[y][x] = 0;\n\t\t\n\t\t//reset the flag that indicates if a move has been found that decreases the heuristic\n\t\tfoundBetterMove = false;\n\t\t\n\t\t//fill in the appropriate heuristic values\n\t\tpopulateHillValues();\n\t\tArrayList<PotentialMove> myBestList = new ArrayList<PotentialMove>();\n\n\t\t//Find the square with the lowest heuristic value. this should really write the values to an array. \n\t\tint squareDifferential = -1;\n\t\t//String outValue = \"\";\n\t\tfor (int y = 0; y <= size-1; y++) {\n\t\t\tfor (int x = 0; x <= size-1; x++){\n\t\t\t\t//outValue = outValue + localBoard[y][x];\n\t\t\t\tif (squareDifferential < 0) //lowestSquareFound not found yet \n\t\t\t\t{\n\t\t\t\t\tif ((NQueens.queens[x] != y) && //set if the current square isn't already occupied by a queen\n\t\t\t\t\t\t\t(localBoard[NQueens.queens[x]][x] >= localBoard[y][x])) {\n\t\t\t\t\t\tif (localBoard[y][x] == localBoard[NQueens.queens[x]][x])\n\t\t\t\t\t\t\tmyBestList.add(new PotentialMove(x, y, true));\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tmyBestList.add(new PotentialMove(x, y, false));\n\t\t\t\t\t\tsquareDifferential = localBoard[NQueens.queens[x]][x] - localBoard[y][x];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if ((localBoard[NQueens.queens[x]][x] - localBoard[y][x]) > squareDifferential) { // find the square with the largest differential in value from the queen in the column\n\t\t\t\t\tmyBestList.clear();\n\t\t\t\t\tmyBestList.add(new PotentialMove(x, y, false));\n\t\t\t\t\tsquareDifferential = localBoard[NQueens.queens[x]][x] - localBoard[y][x];\n\t\t\t\t}\n\t\t\t\telse if (((localBoard[NQueens.queens[x]][x] - localBoard[y][x]) == squareDifferential) && // the differential is equal to the current best differential\n\t\t\t\t\t\t(NQueens.queens[x] != y)) { // and isn't already occupied by a queen\n\t\t\t\t\tmyBestList.add(new PotentialMove(x, y, true));\n\t\t\t\t}\n\t\t\t\t//else the square is higher, has a queen or isn't marginally better than the current queen's position in the row\n\t\t\t}\n\t\t\t//outValue = outValue + \"\\n\";\n\t\t}\n\t\t//JOptionPane.showMessageDialog(null, outValue);\n\t\t\n\t\tif (myBestList.isEmpty())\n\t\t\treturn;\n\t\t\n\t\tint listSize = myBestList.size();\n\t\tPotentialMove bestMove;\n\t\t\n\t\t//grab the non-Sideways moves first\n\t\tfor (int i = 0; i < listSize; i++) {\n\t\t\tif (!(myBestList.get(i).isSideways)) {\n\t\t\t\tbestMove = myBestList.get(i);\n\t\t\t\tfoundBetterMove = true;\n\t\t\t\tsidewaysMoves = 0;\n\t\t\t\tNQueens.queens[bestMove.xCoordinate] = bestMove.yCoordinate;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (sidewaysMoves > MAXSIDEWAYSMOVES) { // hit MAXSIDEWAYSMOVES consecutive sideways moves, mark as unsolvable\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//all available moves sideways moves, let's select one randomly\n\t\tRandom generator = new Random();\n\t\tint randomElement = generator.nextInt(listSize);\n\t\t\n\t\tbestMove = myBestList.get(randomElement);\n\t\tfoundBetterMove = true;\n\t\tsidewaysMoves++;\n\t\tNQueens.queens[bestMove.xCoordinate] = bestMove.yCoordinate;\n\t}", "public Solution solve(ISearchable s) {\n return null;\n }", "public void execFuzzySearchVariationFunc(){\n\n\n Map map = new HashMap();\n\n if(this.searchParam != null && this.searchParam.length()> 0 ){\n System.out.println(this.searchParam );\n if(this.searchParam.contains(\":\")==true || this.searchParam.startsWith(\"chr\") == true) {\n String chrom = \"\";\n int pstart = -1;\n int pend = -1;\n if (this.searchParam.indexOf(\":\") > -1) {\n int idex = this.searchParam.indexOf(\":\");\n chrom = this.searchParam.substring(0, idex );\n System.out.println(\"chrom=\" + chrom);\n map.put(\"chrom\", chrom);\n if (this.searchParam.indexOf(\"-\") > -1) {\n int idex1 = this.searchParam.indexOf(\"-\");\n pstart = Integer.parseInt(this.searchParam.substring(idex + 1, idex1 ));\n pend = Integer.parseInt(this.searchParam.substring(idex1 + 1, this.searchParam.length()));\n map.put(\"startpos\", pstart);\n map.put(\"endpos\", pend);\n } else {\n pstart = Integer.parseInt(this.searchParam.substring(idex + 1, this.searchParam.length()));\n map.put(\"startpos\", pstart);\n }\n\n } else if (this.searchParam.startsWith(\"chr\") == true) {\n map.put(\"chrom\", this.searchParam);\n }\n }\n\n map.put(\"searchParam\",this.searchParam);\n }\n\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"null\") ==false && this.searchSpecies.equals(\"all\") == false){\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"species\",this.searchSpecies);\n }\n\n if(this.searchTrait != null&& this.searchTrait.equals(\"null\") ==false && this.searchTrait.length()>0){\n\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"searchTrait\", this.searchTrait) ;\n }\n\n if(this.pvalue != null&& this.pvalue.equals(\"null\") ==false && this.pvalue.length()>0){\n\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"psitu\", this.psitu);\n map.put(\"pval\", this.pvalue) ;\n }\n\n\n //here, parse search param and get genotype information\n genotypeBeanList = (List<GenotypeBean>) baseService.findResultList(\"cn.big.gvk.dm.Genotype.selectGenotypeByPos\",map);\n if(genotypeBeanList != null && genotypeBeanList.size() > 0 ){\n for(GenotypeBean tbean :genotypeBeanList ){\n List genotypelist = new ArrayList();\n genotypelist.add(tbean.getGenotypeId()) ;\n\n Map t = new HashMap();\n t.put(\"genotypelist\",genotypelist);\n List<GenotypeAnnotateGeneView> annotateview = baseService.findResultList(\"cn.big.gvk.dm.Genotype.selectGenotypeByList\",t);\n if(annotateview != null && annotateview.size()>0 ){\n //here we need to filter the result\n Map filtermap = new HashMap();\n for(GenotypeAnnotateGeneView tview : annotateview){\n String fkey = tview.getMapGeneId()+\"_\"+tview.getConseqtype();\n if(filtermap.containsKey(fkey) == false){\n filtermap.put(fkey,tview);\n }\n }\n\n if(filtermap.size()>0){\n List<GenotypeAnnotateGeneView> alist = new ArrayList<GenotypeAnnotateGeneView>();\n Iterator it = filtermap.entrySet().iterator();\n while(it.hasNext()){\n Map.Entry entry = (Map.Entry) it.next();\n GenotypeAnnotateGeneView val = (GenotypeAnnotateGeneView) entry.getValue();\n alist.add(val);\n }\n\n tbean.setGenotypeAnnotateGeneView(alist);\n }\n\n\n }\n\n //find association count\n GwasAssociationBean gwas = (GwasAssociationBean) baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectAssociationCountByGenotypeid\",tbean.getGenotypeId());\n if(gwas != null){\n tbean.setTraitCount(gwas.getGwasCount());\n }\n\n //find studycount\n Map cmap = new HashMap();\n cmap.put(\"genotypeId\",tbean.getGenotypeId());\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"all\") == false){\n cmap.put(\"species\",this.searchSpecies);\n }\n\n\n GwasAssociationBean tg_bean1 = (GwasAssociationBean)baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectStudyCountByGenotypeid\",cmap);\n if(tg_bean1 != null ){\n tbean.setStudyCount(tg_bean1.getGwasCount());\n }\n\n }\n\n\n\n }\n\n StringBuffer sb = new StringBuffer() ;\n\n if(genotypeBeanList != null && genotypeBeanList.size()>0){\n for(GenotypeBean genotype: genotypeBeanList){\n sb.append(genotype.getVarId()).append(\"\\t\").append(genotype.getChrom()).append(\":\")\n .append(genotype.getStartPos()).append(\"\\t\").append(genotype.getTraitCount())\n .append(\"\\t\").append(genotype.getStudyCount()).append(\"\\n\");\n }\n }\n\n if(format == 1 ){ //export txt\n this.response.reset();\n this.response.setHeader(\"Content-Disposition\",\n \"attachment;filename=export.txt\");\n this.response.setContentType(\"application/ms-txt\");\n try {\n PrintWriter pr = this.response.getWriter();\n pr.print(sb.toString());\n pr.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n }", "public void findSolution() {\n\n\t\t// TODO\n\t}", "private Point backtrack(Point p){\n\t\t// coordinates of the point\n\t\tint x = (int)p.getX();\n\t\tint y = (int)p.getY();\n\t\t// neigh hold the return value\n\t\tPoint neigh= p;\n\t\t// the lowest score\n\t\tint score=10000;\n\t\t// look at all the neighbor and compare them\n\t\tif(x>0\t && topology[x-1][y]>=0){\n\t\t\tscore = topology[x-1][y];\n\t\t\tneigh = new Point(x-1,y);\n\t\t}\n\t\tif(x<row-1 && topology[x+1][y]>=0 && score > topology[x+1][y]) {\n\t\t\tscore = topology[x+1][y];\n\t\t\tneigh = new Point(x+1,y);\n\t\t}\n\t\tif(y<col-1 && topology[x][y+1]>=0 && score > topology[x][y+1]) {\n\t\t\tscore = topology[x][y+1];\n\t\t\tneigh = new Point(x,y+1);\n\t\t}\n\t\tif(y>0 && topology[x][y-1]>=0 && score > topology[x][y-1]) {\n\t\t\tscore = topology[x][y-1];\n\t\t\tneigh = new Point(x,y-1);\n\t\t}\n\t\treturn neigh;\n\t}", "private static void findBestRelocationMove(RelocationMove rm, Solution s, double [][] distanceMatrix, int numberOfVehicles) \n\t{\n\t\t//This is a variable that will hold the cost of the best relocation move\n\t\tdouble bestMoveCost = Double.MAX_VALUE;\n\n\t\t//We will iterate through all available vehicles\n\t\t\n\t\t//Vehicles to relocate FROM\n\t\tfor (int from = 0; from<numberOfVehicles; from++)\n\t\t{\n\t\t\t// Vehicles to relocate TO\n\t\t\tfor (int to = 0; to<numberOfVehicles; to++)\n\t\t\t{\n\n\t\t\t\tfor (int fromIndex = 1; fromIndex < s.routes.get(from).customers.size() - 1; fromIndex++)\n\t\t\t\t{\n\t\t\t\t\t//Node A is the predecessor of B\n\t\t\t\t\tCustomer A = s.routes.get(from).customers.get(fromIndex - 1);\n\n\t\t\t\t\t//Node B is the relocated node\n\t\t\t\t\tCustomer B = s.routes.get(from).customers.get(fromIndex);\n\n\t\t\t\t\t//Node C is the successor of B\n\t\t\t\t\tCustomer C = s.routes.get(from).customers.get(fromIndex + 1);\n\n\t\t\t\t\t//We will iterate through all possible re-insertion positions for B\n\t\t\t\t\tfor (int afterIndex = 0; afterIndex < s.routes.get(to).customers.size() -1; afterIndex ++)\n\t\t\t\t\t{\n\n\t\t\t\t\t\tif ((afterIndex != fromIndex && afterIndex != fromIndex - 1)||from != to)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//Node F the node after which B is going to be reinserted\n\t\t\t\t\t\t\tCustomer F = s.routes.get(to).customers.get(afterIndex);\n\n\t\t\t\t\t\t\t//Node G the successor of F\n\t\t\t\t\t\t\tCustomer G = s.routes.get(to).customers.get(afterIndex + 1);\n\n\t\t\t\t\t\t\t//The arcs A-B, B-C, and F-G break\n\t\t\t\t\t\t\tdouble costRemovedFrom = distanceMatrix[A.ID][B.ID] + distanceMatrix[B.ID][C.ID];\n\t\t\t\t\t\t\tdouble costRemovedTo = distanceMatrix[F.ID][G.ID];\n\n\t\t\t\t\t\t\t//The arcs A-C, F-B and B-G are created\n\t\t\t\t\t\t\tdouble costAddedFrom = distanceMatrix[A.ID][C.ID];\n\t\t\t\t\t\t\tdouble costAddedTo = distanceMatrix[F.ID][B.ID] + distanceMatrix[B.ID][G.ID];\n\n\t\t\t\t\t\t\t//This is the cost of the move, or in other words\n\t\t\t\t\t\t\t//the change that this move will cause if applied to the current solution\n\t\t\t\t\t\t\tdouble fromMoveCost = costAddedFrom - costRemovedFrom;\n\t\t\t\t\t\t\tdouble toMoveCost = costAddedTo - costRemovedTo;\n\n\t\t\t\t\t\t\t//If this move is the best found so far\n\t\t\t\t\t\t\tdouble moveCost = fromMoveCost+toMoveCost;\n\t\t\t\t\t\t\tif ((moveCost < bestMoveCost)&&(from == to || (s.routes.get(to).load + s.routes.get(from).customers.get(fromIndex).demand<=s.routes.get(to).capacity)))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//set the best cost equal to the cost of this solution\n\t\t\t\t\t\t\t\tbestMoveCost = moveCost;\n\n\t\t\t\t\t\t\t\t//store its characteristics\n\t\t\t\t\t\t\t\trm.positionOfRelocated = fromIndex;\n\t\t\t\t\t\t\t\trm.positionToBeInserted = afterIndex;\n\t\t\t\t\t\t\t\trm.toMoveCost = toMoveCost;\n\t\t\t\t\t\t\t\trm.fromMoveCost = fromMoveCost;\n\t\t\t\t\t\t\t\trm.fromRoute = from;\n\t\t\t\t\t\t\t\trm.toRoute = to;\n\t\t\t\t\t\t\t\trm.moveCost = moveCost;\n\t\t\t\t\t\t\t\tif (from != to) {\n\t\t\t\t\t\t\t\t\trm.fromUpdLoad = s.routes.get(from).load - s.routes.get(from).customers.get(fromIndex).demand;\n\t\t\t\t\t\t\t\t\trm.toUpdLoad = s.routes.get(to).load + s.routes.get(from).customers.get(fromIndex).demand;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\trm.fromUpdLoad = s.routes.get(from).load;\n\t\t\t\t\t\t\t\t\trm.toUpdLoad = s.routes.get(to).load;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private int heuristic(int x, int y, MapLocation goal) {\n return Math.max(Math.abs(x - goal.x), Math.abs(y - goal.y));\n }", "private static int getHeuristic(MazeState current, HashSet<MazeState> goals) {\n\t\tint lowestCost = Integer.MAX_VALUE;\n\t\tint currentCost = 0;\n\t\tfor (MazeState goal : goals) {\n\t\t\tcurrentCost = Math.abs(current.col - goal.col) + Math.abs(current.row - goal.row);\n\t\t\tif (currentCost <= lowestCost) {\n\t\t\t\tlowestCost = currentCost;\n\t\t\t}\n\t\t}\n\t\treturn currentCost;\n\t}", "int findAugmentingPath() {\n while ((!this.eligibleS.isEmpty()) || (!this.eligibleT.isEmpty())) {\n if (!this.eligibleS.isEmpty()) {\n int i = this.eligibleS.get(this.eligibleS.size() - 1).intValue();\n this.eligibleS.remove(this.eligibleS.size() - 1);\n for (int j = 0; j < this.m; j++) {\n // If pi[j] has already been decreased essentially\n // to zero, then j is already labeled, and we\n // can't decrease pi[j] any more. Omitting the\n // pi[j] >= TOL check could lead us to relabel j\n // unnecessarily, since the diff we compute on the\n // next line may end up being less than pi[j] due\n // to floating point imprecision.\n if ((this.tMatches[j] != i) && (this.pi[j] >= TOL)) {\n double diff = this.u[i] + this.v[j] - this.weights[i][j];\n if (diff < this.pi[j]) {\n this.tLabels[j] = i;\n this.pi[j] = diff;\n if (this.pi[j] < TOL) {\n this.eligibleT.add(j);\n }\n }\n }\n }\n }\n else {\n int j = this.eligibleT.get(this.eligibleT.size() - 1).intValue();\n this.eligibleT.remove(this.eligibleT.size() - 1);\n if (this.tMatches[j] == -1) {\n return j; // we've found an augmenting path\n }\n\n int i = this.tMatches[j];\n this.sLabels[i] = j;\n this.eligibleS.add(i); // ok to add twice\n }\n }\n\n return -1;\n }", "private Suggestion getBestLinearization(List<String> linearizations,\n Interpretation interpretation,\n Map<String, WordType> originalWords, boolean matchAllWords) {\n\n Suggestion best = null;\n\n for (String current : linearizations) {\n Suggestion suggestion = buildSuggestion(\n current, interpretation,\n originalWords, matchAllWords);\n\n if (suggestion != null) {\n if (best == null) {\n best = suggestion;\n }\n else {\n if (suggestionComparator.compare(best, suggestion) > 0) {\n best = suggestion;\n }\n }\n }\n }\n\n return best;\n }", "public abstract double getHeuristic(State state);", "@Override\n\tpublic void solve() {\n\t\tlong startTime = System.nanoTime();\n\n\t\twhile(!unvisitedPM.isEmpty()){\n\t\t\tProblemModel current = findCheapestNode();\n\t\n\t\t\tfor(ProblemModel pm : current.getSubNodes()){\n\t\t\n\t\t\t\tif(!visited.contains(pm) && !unvisitedPM.contains(pm)){\n\t\t\t\t\t\n\t\t\t\t\tunvisitedPM.add(pm);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(current.getSideStart().isEmpty()){\n\t\t\t\tSystem.out.print( \"\\n\"+ \"StartSide Runners: \");\n\t\t\t\tfor(Integer r: current.getSideStart()){\n\t\t\t\t\tSystem.out.print( \" \" +r) ;\n\t\t\t\t}\n\t\t\t\tSystem.out.print( \"\\n\" + \"EndSide Runners: \");\n\t\t\t\tfor(Integer r: current.getSideEnd()){\n\t\t\t\t\tSystem.out.print( \" \" + r);\n\t\t\t\t}\n\n\t\t\t\tprintPathTaken(current);\n\t\t\t\tSystem.out.print( \"\\n\" + \"------------done--------------\");\n\t\t\t\tlong endTime = System.nanoTime();\n\t\t\t\tlong duration = ((endTime - startTime)/1000000);\n\t\t\t\tSystem.out.print( \"\\n\" + \"-AS1 Time taken: \" + duration + \"ms\");\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tvisited.add(current);\n\t\t\n\t\t}\n\t\t\n\n\t}", "private void updateSingles(Hierarchy con, ViolatedCandidate lCandidate, ViolatedCandidate tCandidate,\n double delta) {\n Multiset<Constraint> targetPreferringView = UpdateUtils.getViolatedByLearner(lCandidate, tCandidate);\n Multiset<Constraint> learnerPreferringView = UpdateUtils.getViolatedByTarget(lCandidate, tCandidate);\n Multiset<Constraint> learnerPreferringHigh = HashMultiset.create(learnerPreferringView.size());\n double promoteWeightedDelta = delta / targetPreferringView.size();\n double maxTPreferringRanking = Double.MIN_VALUE;\n for (Constraint constraint : targetPreferringView.elementSet()) {\n maxTPreferringRanking = Math.max(maxTPreferringRanking, con.getRanking(constraint));\n double multipliedDelta = (targetPreferringView.count(constraint) * promoteWeightedDelta);\n con.changeConstraintRanking(constraint, multipliedDelta);\n }\n\n for (Constraint constraint : learnerPreferringView.elementSet()) {\n double thisRanking = con.getRanking(constraint);\n if (thisRanking > maxTPreferringRanking) {\n int count = learnerPreferringView.count(constraint);\n learnerPreferringHigh.add(constraint, count);\n }\n }\n // If 'higher' set is empty, just add argMax to it\n if (learnerPreferringHigh.isEmpty()) {\n Constraint argMax = UpdateUtils.getMax(learnerPreferringView, con);\n learnerPreferringHigh.add(argMax);\n }\n\n Multiset<Constraint> toIterateOver = learnerPreferringHigh;\n\n double demoteWeightedDelta = -(delta / toIterateOver.size());\n for (Constraint constraint : toIterateOver.elementSet()) {\n double multipliedDelta = toIterateOver.count(constraint) * demoteWeightedDelta;\n con.changeConstraintRanking(constraint, multipliedDelta);\n // System.out.println(\"↓ Updating \" + constraint +\" by \" +\n // multipliedDelta);\n }\n }", "public List<Graph> search() {\n\n long start = System.currentTimeMillis();\n TetradLogger.getInstance().log(\"info\", \"Starting ION Search.\");\n logGraphs(\"\\nInitial Pags: \", this.input);\n TetradLogger.getInstance().log(\"info\", \"Transfering local information.\");\n long steps = System.currentTimeMillis();\n\n /*\n * Step 1 - Create the empty graph\n */\n List<Node> varNodes = new ArrayList<>();\n for (String varName : variables) {\n varNodes.add(new GraphNode(varName));\n }\n Graph graph = new EdgeListGraph(varNodes);\n\n /*\n * Step 2 - Transfer local information from the PAGs (adjacencies\n * and edge orientations)\n */\n // transfers edges from each graph and finds definite noncolliders\n transferLocal(graph);\n // adds edges for variables never jointly measured\n for (NodePair pair : nonIntersection(graph)) {\n graph.addEdge(new Edge(pair.getFirst(), pair.getSecond(), Endpoint.CIRCLE, Endpoint.CIRCLE));\n }\n TetradLogger.getInstance().log(\"info\", \"Steps 1-2: \" + (System.currentTimeMillis() - steps) / 1000. + \"s\");\n System.out.println(\"step2\");\n System.out.println(graph);\n\n /*\n * Step 3\n *\n * Branch and prune step that blocks problematic undirectedPaths, possibly d-connecting undirectedPaths\n */\n steps = System.currentTimeMillis();\n Queue<Graph> searchPags = new LinkedList<>();\n // place graph constructed in step 2 into the queue\n searchPags.offer(graph);\n // get d-separations and d-connections\n List<Set<IonIndependenceFacts>> sepAndAssoc = findSepAndAssoc(graph);\n this.separations = sepAndAssoc.get(0);\n this.associations = sepAndAssoc.get(1);\n Map<Collection<Node>, List<PossibleDConnectingPath>> paths;\n// Queue<Graph> step3PagsSet = new LinkedList<Graph>();\n HashSet<Graph> step3PagsSet = new HashSet<>();\n Set<Graph> reject = new HashSet<>();\n // if no d-separations, nothing left to search\n if (separations.isEmpty()) {\n // makes orientations preventing definite noncolliders from becoming colliders\n // do final orientations\n// doFinalOrientation(graph);\n step3PagsSet.add(graph);\n }\n // sets length to iterate once if search over path lengths not enabled, otherwise set to 2\n int numNodes = graph.getNumNodes();\n int pl = numNodes - 1;\n if (pathLengthSearch) {\n pl = 2;\n }\n // iterates over path length, then adjacencies\n for (int l = pl; l < numNodes; l++) {\n if (pathLengthSearch) {\n TetradLogger.getInstance().log(\"info\", \"Braching over path lengths: \" + l + \" of \" + (numNodes - 1));\n }\n int seps = separations.size();\n int currentSep = 1;\n int numAdjacencies = separations.size();\n for (IonIndependenceFacts fact : separations) {\n if (adjacencySearch) {\n TetradLogger.getInstance().log(\"info\", \"Braching over path nonadjacencies: \" + currentSep + \" of \" + numAdjacencies);\n }\n seps--;\n // uses two queues to keep up with which PAGs are being iterated and which have been\n // accepted to be iterated over in the next iteration of the above for loop\n searchPags.addAll(step3PagsSet);\n recGraphs.add(searchPags.size());\n step3PagsSet.clear();\n while (!searchPags.isEmpty()) {\n System.out.println(\"ION Step 3 size: \" + searchPags.size());\n double currentUsage = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();\n if (currentUsage > maxMemory) maxMemory = currentUsage;\n // deques first PAG from searchPags\n Graph pag = searchPags.poll();\n // Part 3.a - finds possibly d-connecting undirectedPaths between each pair of nodes\n // known to be d-separated\n List<PossibleDConnectingPath> dConnections = new ArrayList<>();\n // checks to see if looping over adjacencies\n if (adjacencySearch) {\n for (Collection<Node> conditions : fact.getZ()) {\n // checks to see if looping over path lengths\n if (pathLengthSearch) {\n dConnections.addAll(PossibleDConnectingPath.findDConnectingPathsOfLength\n (pag, fact.getX(), fact.getY(), conditions, l));\n } else {\n dConnections.addAll(PossibleDConnectingPath.findDConnectingPaths\n (pag, fact.getX(), fact.getY(), conditions));\n }\n }\n } else {\n for (IonIndependenceFacts allfact : separations) {\n for (Collection<Node> conditions : allfact.getZ()) {\n // checks to see if looping over path lengths\n if (pathLengthSearch) {\n dConnections.addAll(PossibleDConnectingPath.findDConnectingPathsOfLength\n (pag, allfact.getX(), allfact.getY(), conditions, l));\n } else {\n dConnections.addAll(PossibleDConnectingPath.findDConnectingPaths\n (pag, allfact.getX(), allfact.getY(), conditions));\n }\n }\n }\n }\n // accept PAG go to next PAG if no possibly d-connecting undirectedPaths\n if (dConnections.isEmpty()) {\n// doFinalOrientation(pag);\n// Graph p = screenForKnowledge(pag);\n// if (p != null) step3PagsSet.add(p);\n step3PagsSet.add(pag);\n continue;\n }\n // maps conditioning sets to list of possibly d-connecting undirectedPaths\n paths = new HashMap<>();\n for (PossibleDConnectingPath path : dConnections) {\n List<PossibleDConnectingPath> p = paths.get(path.getConditions());\n if (p == null) {\n p = new LinkedList<>();\n }\n p.add(path);\n paths.put(path.getConditions(), p);\n }\n // Part 3.b - finds minimal graphical changes to block possibly d-connecting undirectedPaths\n List<Set<GraphChange>> possibleChanges = new ArrayList<>();\n for (Set<GraphChange> changes : findChanges(paths)) {\n Set<GraphChange> newChanges = new HashSet<>();\n for (GraphChange gc : changes) {\n boolean okay = true;\n for (Triple collider : gc.getColliders()) {\n\n if (pag.isUnderlineTriple(collider.getX(), collider.getY(), collider.getZ())) {\n okay = false;\n break;\n }\n\n }\n if (!okay) {\n continue;\n }\n for (Triple collider : gc.getNoncolliders()) {\n if (pag.isDefCollider(collider.getX(), collider.getY(), collider.getZ())) {\n okay = false;\n break;\n }\n }\n if (okay) {\n newChanges.add(gc);\n }\n }\n if (!newChanges.isEmpty()) {\n possibleChanges.add(newChanges);\n } else {\n possibleChanges.clear();\n break;\n }\n }\n float starthitset = System.currentTimeMillis();\n Collection<GraphChange> hittingSets = IonHittingSet.findHittingSet(possibleChanges);\n recHitTimes.add((System.currentTimeMillis() - starthitset) / 1000.);\n // Part 3.c - checks the newly constructed graphs from 3.b and rejects those that\n // cycles or produce independencies known not to occur from the input PAGs or\n // include undirectedPaths from definite nonancestors\n for (GraphChange gc : hittingSets) {\n boolean badhittingset = false;\n for (Edge edge : gc.getRemoves()) {\n Node node1 = edge.getNode1();\n Node node2 = edge.getNode2();\n Set<Triple> triples = new HashSet<>();\n triples.addAll(gc.getColliders());\n triples.addAll(gc.getNoncolliders());\n if (triples.size() != (gc.getColliders().size() + gc.getNoncolliders().size())) {\n badhittingset = true;\n break;\n }\n for (Triple triple : triples) {\n if (node1.equals(triple.getY())) {\n if (node2.equals(triple.getX()) ||\n node2.equals(triple.getZ())) {\n badhittingset = true;\n break;\n }\n }\n if (node2.equals(triple.getY())) {\n if (node1.equals(triple.getX()) ||\n node1.equals(triple.getZ())) {\n badhittingset = true;\n break;\n }\n }\n }\n if (badhittingset) {\n break;\n }\n for (NodePair pair : gc.getOrients()) {\n if ((node1.equals(pair.getFirst()) && node2.equals(pair.getSecond())) ||\n (node2.equals(pair.getFirst()) && node1.equals(pair.getSecond()))) {\n badhittingset = true;\n break;\n }\n }\n if (badhittingset) {\n break;\n }\n }\n if (!badhittingset) {\n for (NodePair pair : gc.getOrients()) {\n for (Triple triple : gc.getNoncolliders()) {\n if (pair.getSecond().equals(triple.getY())) {\n if (pair.getFirst().equals(triple.getX()) &&\n pag.getEndpoint(triple.getZ(), triple.getY()).equals(Endpoint.ARROW)) {\n badhittingset = true;\n break;\n\n }\n if (pair.getFirst().equals(triple.getZ()) &&\n pag.getEndpoint(triple.getX(), triple.getY()).equals(Endpoint.ARROW)) {\n badhittingset = true;\n break;\n }\n }\n if (badhittingset) {\n break;\n }\n }\n if (badhittingset) {\n break;\n }\n }\n }\n if (badhittingset) {\n continue;\n }\n Graph changed = gc.applyTo(pag);\n // if graph change has already been rejected move on to next graph\n if (reject.contains(changed)) {\n continue;\n }\n // if graph change has already been accepted move on to next graph\n if (step3PagsSet.contains(changed)) {\n continue;\n }\n // reject if null, predicts false independencies or has cycle\n if (predictsFalseIndependence(associations, changed)\n || changed.existsDirectedCycle()) {\n reject.add(changed);\n }\n // makes orientations preventing definite noncolliders from becoming colliders\n // do final orientations\n// doFinalOrientation(changed);\n // now add graph to queue\n\n// Graph p = screenForKnowledge(changed);\n// if (p != null) step3PagsSet.add(p);\n step3PagsSet.add(changed);\n }\n }\n // exits loop if not looping over adjacencies\n if (!adjacencySearch) {\n break;\n }\n }\n }\n TetradLogger.getInstance().log(\"info\", \"Step 3: \" + (System.currentTimeMillis() - steps) / 1000. + \"s\");\n Queue<Graph> step3Pags = new LinkedList<>(step3PagsSet);\n\n /*\n * Step 4\n *\n * Finds redundant undirectedPaths and uses this information to expand the list\n * of possible graphs\n */\n steps = System.currentTimeMillis();\n Map<Edge, Boolean> necEdges;\n Set<Graph> outputPags = new HashSet<>();\n\n while (!step3Pags.isEmpty()) {\n Graph pag = step3Pags.poll();\n necEdges = new HashMap<>();\n // Step 4.a - if x and y are known to be unconditionally associated and there is\n // exactly one trek between them, mark each edge on that trek as necessary and\n // make the tiples on the trek definite noncolliders\n // initially mark each edge as not necessary\n for (Edge edge : pag.getEdges()) {\n necEdges.put(edge, false);\n }\n // look for unconditional associations\n for (IonIndependenceFacts fact : associations) {\n for (List<Node> nodes : fact.getZ()) {\n if (nodes.isEmpty()) {\n List<List<Node>> treks = treks(pag, fact.x, fact.y);\n if (treks.size() == 1) {\n List<Node> trek = treks.get(0);\n List<Triple> triples = new ArrayList<>();\n for (int i = 1; i < trek.size(); i++) {\n // marks each edge in trek as necessary\n necEdges.put(pag.getEdge(trek.get(i - 1), trek.get(i)), true);\n if (i == 1) {\n continue;\n }\n // makes each triple a noncollider\n pag.addUnderlineTriple(trek.get(i - 2), trek.get(i - 1), trek.get(i));\n }\n }\n // stop looping once the empty set is found\n break;\n }\n }\n }\n // Part 4.b - branches by generating graphs for every combination of removing\n // redundant undirectedPaths\n boolean elimTreks;\n // checks to see if removing redundant undirectedPaths eliminates every trek between\n // two variables known to be nconditionally assoicated\n List<Graph> possRemovePags = possRemove(pag, necEdges);\n double currentUsage = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();\n if (currentUsage > maxMemory) maxMemory = currentUsage;\n for (Graph newPag : possRemovePags) {\n elimTreks = false;\n // looks for unconditional associations\n for (IonIndependenceFacts fact : associations) {\n for (List<Node> nodes : fact.getZ()) {\n if (nodes.isEmpty()) {\n if (treks(newPag, fact.x, fact.y).isEmpty()) {\n elimTreks = true;\n }\n // stop looping once the empty set is found\n break;\n }\n }\n }\n // add new PAG to output unless a necessary trek has been eliminated\n if (!elimTreks) {\n outputPags.add(newPag);\n }\n }\n }\n outputPags = removeMoreSpecific(outputPags);\n// outputPags = applyKnowledge(outputPags);\n\n TetradLogger.getInstance().log(\"info\", \"Step 4: \" + (System.currentTimeMillis() - steps) / 1000. + \"s\");\n\n /*\n * Step 5\n *\n * Generate the Markov equivalence classes for graphs and accept only\n * those that do not predict false d-separations\n */\n steps = System.currentTimeMillis();\n Set<Graph> outputSet = new HashSet<>();\n for (Graph pag : outputPags) {\n Set<Triple> unshieldedPossibleColliders = new HashSet<>();\n for (Triple triple : getPossibleTriples(pag)) {\n if (!pag.isAdjacentTo(triple.getX(), triple.getZ())) {\n unshieldedPossibleColliders.add(triple);\n }\n }\n\n PowerSet<Triple> pset = new PowerSet<>(unshieldedPossibleColliders);\n for (Set<Triple> set : pset) {\n Graph newGraph = new EdgeListGraph(pag);\n for (Triple triple : set) {\n newGraph.setEndpoint(triple.getX(), triple.getY(), Endpoint.ARROW);\n newGraph.setEndpoint(triple.getZ(), triple.getY(), Endpoint.ARROW);\n }\n doFinalOrientation(newGraph);\n }\n for (Graph outputPag : finalResult) {\n if (!predictsFalseIndependence(associations, outputPag)) {\n Set<Triple> underlineTriples = new HashSet<>(outputPag.getUnderLines());\n for (Triple triple : underlineTriples) {\n outputPag.removeUnderlineTriple(triple.getX(), triple.getY(), triple.getZ());\n }\n outputSet.add(outputPag);\n }\n }\n }\n\n// outputSet = applyKnowledge(outputSet);\n outputSet = checkPaths(outputSet);\n\n output.addAll(outputSet);\n TetradLogger.getInstance().log(\"info\", \"Step 5: \" + (System.currentTimeMillis() - steps) / 1000. + \"s\");\n runtime = ((System.currentTimeMillis() - start) / 1000.);\n logGraphs(\"\\nReturning output (\" + output.size() + \" Graphs):\", output);\n double currentUsage = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();\n if (currentUsage > maxMemory) maxMemory = currentUsage;\n return output;\n }", "public Solver(Board initial) {\r\n this.board = initial;\r\n\r\n final Comparator<SearchNode> solverComparator = new Comparator<SearchNode>() {\r\n @Override\r\n public int compare(SearchNode o1, SearchNode o2) {\r\n return o1.weight() - o2.weight();\r\n }\r\n };\r\n MinPQ<SearchNode> pq = new MinPQ<SearchNode>(solverComparator);\r\n MinPQ<SearchNode> twinPq = new MinPQ<SearchNode>(solverComparator);\r\n\r\n pq.insert(new SearchNode(board, null, 0));\r\n twinPq.insert(new SearchNode(board.twin(), null, 0));\r\n do {\r\n SearchNode current = pq.delMin();\r\n SearchNode twin = twinPq.delMin();\r\n\r\n //solution.enqueue(current.getBoard());\r\n if (!current.getBoard().isGoal()) {\r\n for (Board neighbour : current.getBoard().neighbors()) {\r\n if (current.getParent() == null || current.getParent() != null && !neighbour.equals(current.getParent().getBoard())) {\r\n pq.insert(new SearchNode(neighbour, current, current.moves() + 1));\r\n }\r\n }\r\n } else {\r\n solution = new LinkedStack<Board>();\r\n SearchNode node = current;\r\n while (node != null) {\r\n solution.push(node.getBoard());\r\n node = node.getParent();\r\n }\r\n break;\r\n }\r\n\r\n if (!twin.getBoard().isGoal()) {\r\n for (Board neighbour : twin.getBoard().neighbors()) {\r\n if (twin.getParent() == null || twin.getParent() != null && !neighbour.equals(twin.getParent().getBoard())) {\r\n twinPq.insert(new SearchNode(neighbour, twin, twin.moves() + 1));\r\n }\r\n }\r\n } else {\r\n break;\r\n }\r\n } while (!pq.isEmpty() || !twinPq.isEmpty());\r\n }", "protected void foundGoal( Path pathToGoal ) {\n\t\t/* A dummy implementation that does nothing with this\n\t\t exciting news. */\n\t}", "public double heuristic(game Game){\n // int l[] = {0,1};\n // board b = Game.getBoard();\n // tic smallBoard = b.getState(l); \n \n /* if O wins the game */\n if(Game.getState() == 2){return 99;}\n \n /* X wins the game */\n if(Game.getState() == 1){return -99;}\n \n return 0;\n }", "public void conflict(Object arg0) {\n\n\t}", "public void findSolution() {\n\t\tif (lenA > lenB) {\n\t\t\toptPairs = new String[lenB];\n\t\t} else {\n\t\t\toptPairs = new String[lenA];\n\t\t}\n\n\t\tint counter = 0;\n\t\tint i = lenA;\n\t\tint j = lenB;\n\n\t\twhile(i>0 && j>0) {\n\t\t\tif (optArray[i][j] == g+optArray[i-1][j]) {\n\t\t\t\ti--;\n\t\t\t}\n\t\t\telse if (optArray[i][j] == g+optArray[i][j-1]) {\n\t\t\t\tj--;\n\t\t\t}\n\t\t\telse {\n\t\t\t\toptPairs[counter] = i + \" \" + j;\n\t\t\t\tcounter++;\n\t\t\t\ti--;\n\t\t\t\tj--;\n\t\t\t}\n\t\t}\n\n\t\tpairNum = counter;\n\n\t}", "private void applyLocationAlgorithms() {\n List<NodeState> states = new ArrayList<NodeState>();\n List<RemoteNode> nodes = new ArrayList<RemoteNode>(nodeManager.getNodes());\n AlgorithmMatchCriteria criteria;\n\n for (Algorithm la : algorithmManager.getAlgorithms()) {\n if (!la.isEnabled()) continue;\n criteria = algorithmManager.getCriteria(la);\n\n List<Node> filteredNodes = criteria.filter(nodes);\n if (filteredNodes.size() > 0) {\n states.add(la.applyTo(nodeManager.getLocalNode(), filteredNodes));\n }\n }\n for (NodeState s : states) {\n nodeManager.getLocalNode().addPending(s);\n }\n }", "private void locateBestMatch(int queryStartIdx){\n \n double dist;\n double bsfDist = Double.MAX_VALUE;\n int bsfIdx = -1;\n\n double[] query = zNormalise(series, queryStartIdx, this.windowSize, false);\n double[] comparison;\n\n for(int comparisonStartIdx = 0; comparisonStartIdx <= seriesLength-windowSize; comparisonStartIdx+=stride){\n \n // exclusion zone +/- windowSize/2 around the window\n if(comparisonStartIdx >= queryStartIdx-windowSize*1.5 && comparisonStartIdx <= queryStartIdx+windowSize*1.5){\n continue;\n }\n \n // using a bespoke version of this, rather than the shapelet version, for efficiency - see notes with method\n comparison = zNormalise(series, comparisonStartIdx, windowSize, false);\n dist = 0;\n\n for(int j = 0; j < windowSize;j++){\n dist += (query[j]-comparison[j])*(query[j]-comparison[j]);\n if(dist > bsfDist){\n dist = Double.MAX_VALUE;\n break;\n }\n }\n\n if(dist < bsfDist){\n bsfDist = dist;\n bsfIdx = comparisonStartIdx;\n }\n\n }\n \n this.distances[queryStartIdx] = bsfDist;\n this.indices[queryStartIdx] = bsfIdx;\n }", "static double removeHeuristic2(GameState c, boolean isMaxNode) {\n\t\treturn addHeuristic4(c, isMaxNode);\n\t}", "public int heuristic()\n {\n if (this.heuristic != Integer.MIN_VALUE)\n return this.heuristic;\n this.heuristic = 0;\n if (!this.safe)\n return 0;\n // End game bonus\n int bonus = this.d.size() * Math.max(0, (this.L - 3 * this.b.shots)) * 3;\n this.heuristic = (this.d.size() * 100) + (this.NE * 10) + bonus;\n // value:\n return this.heuristic;\n }", "public void findTrack() {\n for (Node n : start_node.getLinks()) {\n precedenti.put(n, start_node);\n valori.put(n, calculator.calcDistance(n, start_node));\n }\n while (!da_collegare.isEmpty()) {\n Node piu_vicino = null;\n double min = Double.MAX_VALUE;\n for (Node n : da_collegare) {\n double dist = valori.get(n);\n if (dist - min < THRESHOLD) {\n min = dist;\n piu_vicino = n;\n }\n }\n double dist = valori.get(piu_vicino);\n for (Node n : piu_vicino.getLinks()) {\n double ricalc = dist + calculator.calcDistance(n, piu_vicino);\n if (ricalc - valori.get(n) < THRESHOLD) {\n precedenti.put(n, piu_vicino);\n valori.put(n, ricalc);\n }\n }\n da_collegare.remove(piu_vicino);\n }\n }", "@Override\n public Variable useHeuristic(Deque<Variable> deque) {\n Variable highDomain = deque.getFirst();\n for (Variable var : deque){\n if (var.getDomain().size() > highDomain.getDomain().size()){\n highDomain = var;\n }\n }\n return highDomain;\n }", "private void findPath2(List<Coordinate> path) {\n List<Integer> cost = new ArrayList<>(); // store the total cost of each path\n // store all possible sequences of way points\n ArrayList<List<Coordinate>> allSorts = new ArrayList<>();\n int[] index = new int[waypointCells.size()];\n for (int i = 0; i < index.length; i++) {// generate the index reference list\n index[i] = i;\n }\n permutation(index, 0, index.length - 1);\n for (Coordinate o1 : originCells) {\n for (Coordinate d1 : destCells) {\n for (int[] ints1 : allOrderSorts) {\n List<Coordinate> temp = getOneSort(ints1, waypointCells);\n temp.add(0, o1);\n temp.add(d1);\n int tempCost = 0;\n for (int i = 0; i < temp.size() - 1; i++) {\n Graph graph = new Graph(getEdge(map));\n Coordinate start = temp.get(i);\n graph.dijkstra(start);\n Coordinate end = temp.get(i + 1);\n graph.printPath(end);\n tempCost = tempCost + graph.getPathCost(end);\n if (graph.getPathCost(end) == Integer.MAX_VALUE) {\n tempCost = Integer.MAX_VALUE;\n break;\n }\n }\n cost.add(tempCost);\n allSorts.add(temp);\n }\n }\n }\n System.out.println(\"All sorts now have <\" + allSorts.size() + \"> items.\");\n List<Coordinate> best = allSorts.get(getMinIndex(cost));\n generatePath(best, path);\n setSuccess(path);\n }", "public MapLocation findNearestAction() {\n MapLocation origin = rc.getLocation();\n MapLocation nearestHelp = findNearestHelp();\n MapLocation nearestArchon = findNearestArchon();\n\n if (nearestArchon == null && nearestHelp == null) {\n return rc.getInitialArchonLocations(rc.getTeam().opponent())[0]; // when no target is known, go to enemy archon initial position\n } else if (nearestArchon == null) { // when some of the targets is not present, just return the other one\n return nearestHelp; // is not null\n } else if (nearestHelp == null) {\n return nearestArchon; // is not null\n }\n\n if (origin.distanceSquaredTo(nearestHelp) < origin.distanceSquaredTo(nearestArchon)) {\n return nearestHelp;\n } else {\n return nearestArchon;\n }\n }" ]
[ "0.5802915", "0.5674299", "0.56610936", "0.5640925", "0.55954564", "0.5537333", "0.5531402", "0.55253565", "0.55212694", "0.5518381", "0.54757524", "0.544788", "0.54435074", "0.53933764", "0.5392995", "0.5391413", "0.5371845", "0.5362997", "0.53625464", "0.5352009", "0.5327777", "0.5292187", "0.5277118", "0.5267063", "0.5264827", "0.52552795", "0.52492946", "0.5244493", "0.5240968", "0.5231515", "0.5223601", "0.5217179", "0.5212187", "0.5200324", "0.5194328", "0.51886594", "0.51748693", "0.51581794", "0.5153237", "0.51413816", "0.512402", "0.5120952", "0.5119431", "0.5116532", "0.5114416", "0.5112336", "0.51096815", "0.5105741", "0.51052135", "0.50909954", "0.508184", "0.5067758", "0.5063821", "0.5053129", "0.50420964", "0.5039974", "0.50252205", "0.50247276", "0.50218594", "0.50012195", "0.5000538", "0.4993779", "0.4991361", "0.4988535", "0.4984456", "0.49753773", "0.49729437", "0.49551058", "0.49517986", "0.49513605", "0.4947421", "0.4946385", "0.49457282", "0.49402872", "0.49381223", "0.49317276", "0.4929713", "0.49257576", "0.49220055", "0.4921032", "0.49171805", "0.49163213", "0.49083582", "0.49081743", "0.4906793", "0.489648", "0.48919946", "0.4891098", "0.4887443", "0.48780975", "0.48742354", "0.48741028", "0.48668733", "0.48644525", "0.48641488", "0.48635536", "0.48517865", "0.48490474", "0.48479724", "0.4843425" ]
0.4903609
85
Use the last conflict heuristic as a pluggin to improve a former search heuristic STRAT
public static AbstractStrategy lastConflict(Solver SOLVER, AbstractStrategy STRAT) { return lastKConflicts(SOLVER, 1, STRAT); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static LinkedList<Integer> localSearch2Opt(File fileNameWithPath, int kNeighborHood ) throws Exception{\n\t\t\n\t\tString traceString = \"\";\n\t\tdouble bestCost = Double.POSITIVE_INFINITY;\n\t\tLinkedList<Integer> bestTspList = null;\n\t\tdouble bestCycleTime = Double.POSITIVE_INFINITY;\n\n\t\tif (Project.runId == -1 )\n\t\t\tProject.runId = 1;\n\n\t\t/* \n\t\t * read the file and build the cost table\n\t\t */\n parseEdges(fileNameWithPath);\n\n /*\n\t\t * time starts once you read the data\n */\n\t\tdouble baseTime = System.nanoTime();\n\n\t\t/*\n\t\t * invoking furthest insertion algorithm to get the tsp\n\t\t */\n\t\tlong startNodeSeed = (long)(1000.0*generator.nextDouble());\n\t\tLinkedList<Integer> currentTspList = FurthestInsertion.generateTSP(Project.sourceGTree,startNodeSeed);\n\t\t\n\t\tdouble currentTspCost = tspCost(currentTspList);\n\n\t\tbestTspList = currentTspList;\n\t\tbestCost = currentTspCost;\n\t\tbestCycleTime = System.nanoTime() - baseTime;\n\n\t\t/* print the trace file */\n\t\ttraceString = String.format(\"%.2f, %d\",Math.round(((System.nanoTime()-baseTime)/nanosecs)*100.0)/100.0,Math.round(bestCost));\n\t\tprintTrace(runId,traceString);\n\n\t\t/*\n\t\t * remove the last node as it matches the first\n\t\t */\n\t\tcurrentTspList.removeLast();\n\n\t\twhile ( true )\n\t\t{\n\t\t\t/*\n\t\t\t * reached cutoff time\n\t\t\t */\n\t\t\tif ( System.nanoTime()-baseTime >= Project.cutoffTimeSeconds*nanosecs ) {\n\t\t\t\ttimedOut=true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tdouble cycleStartTime = System.nanoTime();\n\n\t\t\tLinkedList<Integer> newTspList = currentTspList;\n\n\t\t\t/* do a 2 opt search in current k=5 neighborhood to get a newtsp */\n\t\t\t/* 1. Pick the first random element in the current tsp */\n\t\t\tint element2 = (int)((double)(newTspList.size()-1) * generator.nextDouble());\n\t\t\tint element1 = element2 - 1;\n\t\t\tif ( element1 == -1 ){\n\t\t\t\telement1 = newTspList.size()-1;\n\t\t\t}\n\t\t\t\n int delta;\n\n\t\t\t/*\n\t\t\t * search in the neighborhood specified\n * if not specified search all\n\t\t\t */\n if ( kNeighborHood != -1 ) {\n\t\t\t /* We want to search in the specified k=n neighborhoods of element1 */\n\t\t\t delta= (int)(2*kNeighborHood*generator.nextDouble()) - kNeighborHood;\n } else {\n\t\t\t delta= (int)((newTspList.size()-1)*generator.nextDouble()) - (int)(newTspList.size()/2);\n\t\t\t}\n\n\t\t\tif ( delta == 0 ) {\n\t\t\t\tdelta = 2;\n\t\t\t} else if ( delta == 1 ) {\n\t\t\t\tdelta = 2;\n\t\t\t} else if ( delta == -1) {\n\t\t\t\tdelta = -2; }\n\n\t\t\tint element4 = element2 + delta;\n\n\t\t\tif ( element4 < 0 ) {\n\t\t\t\telement4 = newTspList.size()+element4;\n\t\t\t}else if ( element4 >= newTspList.size() ) {\n\t\t\t\telement4 = element4-(newTspList.size()-1);\n\t\t\t}\n\n\t\t\tint element3 = element4 -1;\n\t\t\tif ( element3 == -1 ){\n\t\t\t\telement3 = newTspList.size()-1;\n\t\t\t}\n\n\n\t\t\t/* \n\t\t\t * the new tsp will have element2->element4.......element1->element3....\n\t\t\t */\n\t\t\tInteger vertex_3 = newTspList.get(element3);\n\t\t\tnewTspList.set(element3,newTspList.get(element2));\n\t\t\tnewTspList.set(element2,vertex_3);\n\n\t\t\t/*\n\t\t\t * from element2+1 to element3-1 swap to reverse their order\n\t\t\t */\n\t\t\twhile ( element2 < element3 ){\n\t\t\t\telement3 = element3-1;\n\t\t\t\tif ( element3 == -1 ) {\n\t\t\t\t\telement3 = newTspList.size()-1;\n\t\t\t\t}\n\n\t\t\t\telement2 = element2 + 1;\n\t\t\t\tif ( element2 == newTspList.size() ) {\n\t\t\t\t\telement3 = 0;\n\t\t\t\t}\n\n\t\t\t\tInteger tempVertex = newTspList.get(element2);\n\t\t\t\tnewTspList.set(element2,newTspList.get(element3));\n\t\t\t\tnewTspList.set(element3,tempVertex);\n\n\t\t\t}\n\n\t\t\tdouble newTspCost = tspCost(newTspList);\n\n\t\t\t/* if new local search solution is better than eariler take the search and continue search\n\t\t\t */\n\t\t\tif ( newTspCost <= currentTspCost ){\n\t\t\t\tcurrentTspList = newTspList;\n\t\t\t\tcurrentTspCost = newTspCost;\n\t\t\t} else {\n\t\t\t/* if new local search solution is not better than eariler \n\t\t\t */\n\t\t\t\tcontinue;\n\t\t\t}\n\t\n\t\t\t//Subtract the start time from the finish time to get the actual algorithm running time; divide by 10e6 to convert to milliseconds\n\t\t\tdouble cycleTime = (System.nanoTime()-cycleStartTime);\n\n\t\t\t/* first improvement , take the best each time */\n\t\t\tif ( newTspCost < bestCost ) {\n\t\t\t\tbestCost = newTspCost;\n\t\t\t\tbestTspList = newTspList;\n\t\t\t\tbestCycleTime = cycleTime;\n\t\t\t\t/* print the trace file */\n\t\t\t\ttraceString = String.format(\"%.2f, %d\",Math.round(((System.nanoTime()-baseTime)/nanosecs)*100.0)/100.0,Math.round(bestCost));\n\t\t\t\tappendToTraceFile(runId,traceString);\n\n\t\t\t\tif ( bestCost <= optimalCost )\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\n\t\t/* print the sol file */\n\t\tprintSol(runId,bestTspList,bestCost);\n\n\t\t/* print the tab results file */\n\t\tappendTabResults(runId,bestCycleTime,bestCost,bestTspList);\n\n\t\treturn bestTspList;\n\n\t}", "@Override\n public Matching solve() {\n while (!matching.freeElements().isEmpty()) {\n /* get first element from the queue */\n Element element = problem.element(matching.freeElements().poll().elemId());\n\n /* get its preference element: looping through its list => by the level value */\n while (!element.preferences().isEmpty()) {\n Element pref = problem.element(element.preferences().poll().elemId());\n\n /* check if is an acceptable partner for current preference */\n if (!pref.accepts(element)) {\n continue;\n }\n\n /* verify the availability of its current preference */\n if (problem.isAvailable(pref.elemId())) {\n problem.element(pref.elemId()).setAvailability(false);\n problem.element(element.elemId()).setAvailability(false);\n matching.addPair(new Pair(element, pref));\n break;\n }\n else {\n /* if the preference is already taken, get the best one between current element and its current match */\n String currMatchName = matching.getElementPair(pref);\n Element currentMatch = pref.getIndex(currMatchName);\n Element elem = pref.getIndex(element.elemId());\n\n /* when current element is better than the current match */\n if (currentMatch.level() > elem.level()){\n if (matching.isFree(elem))\n matching.removeFreeElement(elem);\n\n problem.element(pref.elemId()).setAvailability(false);\n problem.element(element.elemId()).setAvailability(false);\n problem.element(currentMatch.elemId()).setAvailability(true);\n\n /* add the current pair to the Matching and the old match for the woman to the free list */\n matching.addPair(new Pair(problem.element(element.elemId()), problem.element(pref.elemId())));\n\n matching.addFreeElement(problem.element(currMatchName));\n break;\n }\n else {\n matching.addPair(new Pair(currentMatch, pref));\n }\n }\n }\n /* when man was rejected by all its preferences */\n if (element.preferences().isEmpty())\n element.setAvailability(true);\n }\n problem.getSets().get(0).getElements().stream().filter(Element::isAvailable).forEach(Element::remakeList);\n problem.getSets().get(0).getElements().stream().filter(Element::isAvailable).forEach(element -> matching.addFreeElement(problem.element(element.elemId())));\n\n return matching;\n }", "public abstract OptimisationSolution getBestSolution();", "private void applyBestRepairPlan(){\n\t\t\n\t\tSet<OWLAxiom> best_repair=null;\n\t\t\t\t\n\t\tdouble min_conf = 10000;\n\t\tdouble conf;\n\t\t\n\t\tmappingVisitor.setDeleteAxiom(false);//used in confidence\n\t\t\n\t\tfor (Set<OWLAxiom> repair : repair_plans){\n\t\t\t\n\t\t\tconf = getConfidence4Plan(repair);\n\t\t\t\n\t\t\tif (min_conf > conf){\n\t\t\t\tmin_conf = conf;\n\t\t\t\tbest_repair = repair;\n\t\t\t}\n\t\t}\n\t\t\n\t\tmappingVisitor.setDeleteAxiom(true);\n\t\t\n\t\tfor (OWLAxiom ax : best_repair){\t\t\t\n\t\t\tax.accept(mappingVisitor);\n\t\t\t//It also deletes axiom from structures\n\t\t\t//TODO add to conflicts\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public interface ConflictRegionStrategy extends AlgStrategy {}", "public void aEstrella2 (String input)\r\n\t{\r\n\t\tNode root_aEstrella2 = new Node (input);\r\n\t\tNode current = new Node(root_aEstrella2.getState());\r\n\t\t\r\n\t\tHeuristicComparator aEstrella_comparator = new HeuristicComparator();\r\n\t\tPriorityQueue<Node> queue_gbfs = new PriorityQueue<Node>(12, aEstrella_comparator);\r\n\t\tArrayList<String> visited = new ArrayList<String>();\r\n\t\tArrayList<String> children = new ArrayList<String>();\r\n\t\t\r\n\t\tint nodes_popped = 0;\r\n\t\tint pqueue_max_size = 0;\r\n\t\tint pq_size = 0;\r\n\t\t\r\n\t\tcurrent.cost = 0;\r\n\t\t\r\n\t\twhile(!goal_aEstrella2)\r\n\t\t{\r\n\t\t\tvisited.add(current.getState());\r\n\t\t\tchildren = Successor.findChildren(current.getState());\r\n\t\t\t\r\n\t\t\tfor (String a : children)\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tif (visited.contains(a))\r\n\t\t\t\t{\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNode nino = new Node(a);\r\n\t\t\t\t\tcurrent.children_nodes.add(nino);\r\n\t\t\t\t\tvisited.add(nino.getState());\r\n\t\t\t\t\t\r\n\t\t\t\t\tint cost = isCost(current.getState(), nino.getState());\r\n\t\t\t\t\tnino.cost = cost;\r\n\t\t\t\t\tnino.parent = current;\r\n\t\t\t\t\tint manhattanD = manhattanDistance(nino.getState(), root_aEstrella2.getState());\r\n\t\t\t\t\tnino.setTotalCost(nino.parent.getTotalCost() + nino.cost);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// f(n) = g(n) + h(n)\r\n\t\t\t\t\tnino.setHeuristicCost(nino.getTotalCost() + manhattanD);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (!queue_gbfs.contains(nino))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tqueue_gbfs.add(nino);\r\n\t\t\t\t\t\tpq_size++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Repeated State checking. Removing the same node from PQ if the path cost is less then the current one \r\n\t\t\t\t\telse if (queue_gbfs.contains(nino))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfor (Node original : queue_gbfs)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (original.equals(nino))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tNode copy = original;\r\n\t\t\t\t\t\t\t\tif (nino.getHeuristicCost() < copy.getHeuristicCost())\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tqueue_gbfs.remove(copy);\r\n\t\t\t\t\t\t\t\t\tqueue_gbfs.add(nino);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcurrent = queue_gbfs.poll();\r\n\t\t\tnodes_popped++;\r\n\t\t\t\r\n\t\t\tif (pq_size > pqueue_max_size)\r\n\t\t\t{\r\n\t\t\t\tpqueue_max_size = pq_size;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tpq_size--;\r\n\t\t\tgoal_aEstrella2 = isGoal(current.getState());\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tgoal_aEstrella2 = false;\r\n\t\tSystem.out.println(\"A*2 Solved!!\");\r\n\t\tSolution.performSolution(current, root_aEstrella2, nodes_popped, pqueue_max_size);\r\n\t}", "@Override\n List<NodeData> pathFind() throws NoPathException {\n System.out.println(\"Starting Scenic\");\n\n frontier.add(start);\n\n while(!frontier.isEmpty()) {\n StarNode current = frontier.getLast();\n frontier.removeLast(); // pop the priority queue\n if(current.getXCoord() == goal.getXCoord() && current.getYCoord() == goal.getYCoord()) {\n // If we are at the goal, we need to backtrack through the shortest path\n System.out.println(\"At target!\");\n finalList.add(current); // we have to add the goal to the path before we start backtracking\n while(!(current.getXCoord() == start.getXCoord() && current.getYCoord() == start.getYCoord())) {\n finalList.add(current.getPreviousNode());\n current = current.getPreviousNode();\n System.out.println(current.getNodeID());\n }\n return finalList;\n }\n else {\n // we need to get all the neighbor nodes, identify their costs, and put them into the queue\n LinkedList<StarNode> neighbors = current.getNeighbors();\n // we also need to remove the previous node from the list of neighbors because we do not want to backtrack\n neighbors.remove(current.getPreviousNode());\n\n for (StarNode newnode : neighbors) {\n int nodePlace = this.listContainsId(frontier, newnode);\n if(nodePlace > -1) {\n if (frontier.get(nodePlace).getF() > actionCost(newnode) + distanceToGo(newnode, goal)) {\n System.out.println(\"Here\");\n frontier.remove(frontier.get(nodePlace));\n newnode.setPreviousNode(current);\n frontier.add(newnode);\n newnode.setF(actionCost(newnode) + distanceToGo(newnode, goal));\n }\n }\n else {\n newnode.setPreviousNode(current);\n frontier.add(newnode);\n newnode.setF(actionCost(newnode) + distanceToGo(newnode, goal));\n }\n\n // This fixes the problem with infinitely looping elevators (I hope)\n if(current.getNodeType().equals(\"ELEV\") && newnode.getNodeType().equals(\"ELEV\")) {\n for (Iterator<StarNode> iterator = newnode.neighbors.iterator(); iterator.hasNext();) {\n StarNode newneighbor = iterator.next();\n if (newneighbor.getNodeType().equals(\"ELEV\")) {\n // Remove the current element from the iterator and the list.\n iterator.remove();\n }\n }\n }\n if(current.getNodeType().equals(\"STAI\") && newnode.getNodeType().equals(\"STAI\")) {\n for (Iterator<StarNode> iterator = newnode.neighbors.iterator(); iterator.hasNext();) {\n StarNode newneighbor = iterator.next();\n if (newneighbor.getNodeType().equals(\"STAI\")) {\n // Remove the current element from the iterator and the list.\n iterator.remove();\n }\n }\n }\n // this is where the node is put in the right place in the queue\n Collections.sort(frontier);\n }\n }\n }\n throw new NoPathException(start.getLongName(), goal.getLongName());\n }", "protected IPlanningGoal selectGoal(){ \n List<IPlanningGoal> relevantGoals = representation.getRelevantGoals(body);\n \n //If we have failed to find plans for high priority goals and environment has not changed, lets try some \n //lower priority ones\n if(numFailuresSinceLastImportantEnvChange < relevantGoals.size()){\n return relevantGoals.get(numFailuresSinceLastImportantEnvChange);\n } else {\n //tried all relevant goals but all failed, lets try it once more\n representation.setMarker(body);\n numFailuresSinceLastImportantEnvChange = 0;\n return relevantGoals.get(0);\n }\n }", "private void findBestPath(){\n\t\t// The method will try to find the best path for every starting point and will use the minimum\n\t\tfor(int start = 0; start < this.getDimension(); start++){\n\t\t\tfindBestPath(start);\t\n\t\t}\t\n\t}", "private BGPPath internalPathSelection(Collection<BGPPath> possList, boolean avoidDecoys) {\n BGPPath currentBest = null;\n int currentRel = -4;\n\n for (BGPPath tPath : possList) {\n\n /*\n * If we're doing avoidance based on ignoring local preference, then\n * for the first pass we're literally just going to throw out all\n * routes that are NOT clean, this is corrected in path selection if\n * this leaves us w/ no viable routes\n */\n if (avoidDecoys && (this.avoidMode == AS.AvoidMode.LOCALPREF || this.avoidMode == AS.AvoidMode.LEGACY)) {\n if (tPath.containsAnyOf(this.botSet)) {\n continue;\n }\n }\n\n /*\n * If we have no best path currently selected, the first one is best\n * by default\n */\n if (currentBest == null) {\n currentBest = tPath;\n currentRel = this.getRel(currentBest.getNextHop());\n continue;\n }\n\n /*\n * Local pref based on relationship step\n */\n int newRel = this.getRel(tPath.getNextHop());\n if (newRel > currentRel) {\n currentBest = tPath;\n currentRel = newRel;\n continue;\n }\n\n /*\n * If local pref is the same, move on to the next critera\n */\n if (newRel == currentRel) {\n /*\n * If we're inserting the decision to route around decoys after\n * local pref, but before path length, do so here\n */\n if (this.avoidMode == AS.AvoidMode.PATHLEN) {\n if (avoidDecoys && currentBest.containsAnyOf(this.botSet) && !tPath.containsAnyOf(this.botSet)) {\n currentBest = tPath;\n currentRel = newRel;\n continue;\n }\n if (avoidDecoys && !currentBest.containsAnyOf(this.botSet) && tPath.containsAnyOf(this.botSet)) {\n continue;\n }\n }\n\n if (currentBest.getPathLength() > tPath.getPathLength()) {\n currentBest = tPath;\n currentRel = newRel;\n continue;\n } else if (currentBest.getPathLength() == tPath.getPathLength()) {\n if (avoidDecoys && this.avoidMode == AS.AvoidMode.TIEBREAK\n && currentBest.containsAnyOf(this.botSet) && !tPath.containsAnyOf(this.botSet)) {\n currentBest = tPath;\n currentRel = newRel;\n continue;\n }\n if (avoidDecoys && this.avoidMode == AS.AvoidMode.TIEBREAK\n && !currentBest.containsAnyOf(this.botSet) && tPath.containsAnyOf(this.botSet)) {\n continue;\n }\n\n if (tPath.getNextHop() < currentBest.getNextHop()) {\n currentBest = tPath;\n currentRel = newRel;\n }\n }\n }\n }\n\n return currentBest;\n }", "public SolutionType getBestSolution();", "private LineString pickBestGrowthPossibility3(final LineString stem, List<LineString> lookAheads) {\t\t\n\t\tif (lookAheads == null || lookAheads.size() == 0) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t//sort by:\n\t\t//1. is moving away?\n\t\t//2. number of coordinates in line\n\t\t//3. average elevation rise (above the lowest coord) divided by length of line\n\t\t// e..g if Z values of growth possibility are 618m, 625m, 634m, the average will be the average\n\t\t//Z above the lowest coord will be 7.6m. that value will be divided by the line length\n\t\tfinal AvgElevationSectionFitness avgElevationFitness = new AvgElevationSectionFitness(getTinEdges());\n\t\tComparator<LineString> lookAheadComparator = new Comparator<LineString>() {\n\t\t\tpublic int compare(LineString s1, LineString s2) {\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t//is end of extension moving away\n\t\t\t\tboolean m1 = LineGrowthHelpers.isMovingAway(stem, s1.getCoordinateN(s1.getNumPoints()-1));\n\t\t\t\tboolean m2 = LineGrowthHelpers.isMovingAway(stem, s2.getCoordinateN(s2.getNumPoints()-1));\n\t\t\t\tif (m1 != m2) {\n\t\t\t\t\treturn m1 ? -1 : 1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t//is start of extension moving away\n\t\t\t\t\tboolean a1 = LineGrowthHelpers.isMovingAway(stem, s1.getCoordinateN(1));\n\t\t\t\t\tboolean a2 = LineGrowthHelpers.isMovingAway(stem, s2.getCoordinateN(1));\n\t\t\t\t\tif (a1 != a2) {\n\t\t\t\t\t\treturn a1 ? -1 : 1;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\n\t\t\t\t\t\tif (s1.getNumPoints() == s2.getNumPoints()) {\n\t\t\t\t\t\t\ttry {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tdouble fit1 = (avgElevationFitness.fitness(s1) - s1.getCoordinateN(0).getZ()) / s1.getLength();\n\t\t\t\t\t\t\t\tdouble fit2 = (avgElevationFitness.fitness(s2) - s2.getCoordinateN(0).getZ()) / s2.getLength();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (fit1<0) {\n\t\t\t\t\t\t\t\t\tfit1 = 1/fit1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (fit2<0) {\n\t\t\t\t\t\t\t\t\tfit2 = 1/fit2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\treturn fit1 > fit2 ? -1 \n\t\t\t\t\t\t\t\t\t\t : fit1 < fit2 ? 1 \n\t\t\t\t\t\t\t\t\t : 0;\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\tcatch(IOException e) {\n\t\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\treturn s1.getNumPoints() > s2.getNumPoints() ? -1 \n\t\t\t\t\t\t\t\t\t : s1.getNumPoints() < s2.getNumPoints() ? 1 \n\t\t\t\t\t\t\t\t : 0; \n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tlookAheads.sort(lookAheadComparator);\n\t\t\n\t\treturn lookAheads.get(0);\n\t}", "@Override\n\tpublic BoardLocation findBestLocWhenStuck() {\n\t\treturn null;\n\t}", "public static void main(String[] args) throws IOException {\n util.importUtility();\n \n // Create a list of numbers for the players; values initialized\n // to zero. This is a strategy profile.\n ArrayList<Integer> moves = new ArrayList<>();\n for(int i = 0; i < util.getNumPlayers(); i++)\n moves.add(0);\n \n // This list of Strings will store newly found strategy profiles.\n ArrayList<String> strats = new ArrayList<>();\n String s;\n \n // Indexes for players.\n int p1 = 0;\n int p2 = 1;\n \n // Loop control.\n int i = 0;\n \n // Index of beginning and end of the sink equilibrium best response\n // cycle found by generating the the list of profiles.\n // Once we've found said cycle, it's as if there's a long string\n // of strategy profiles still attached to it. This index allows us\n // to *snip* it off.\n int index = 0;\n \n // BEGIN!!! Let's hope this works....\n while(i < 1000) {\n // The next two if statements check if a best response to the\n // current strategy profile for p1 or p2 can be found. If it can, then\n // we check if the new strategy profile *is already in* our list.\n // If not, we add it in. If so, we note the index of where the \n // matching profile is in our current list and throw it on top anyway\n // (it's a String that will be the last line of our results file).\n if (bestResponse(moves, p1)) {\n s = newVertex(moves);\n if(strats.indexOf(s) == -1)\n strats.add(s);\n else {\n index = strats.indexOf(s);\n strats.add(s);\n break;\n }\n }\n if (bestResponse(moves, p2)) {\n s = newVertex(moves);\n if(strats.indexOf(s) == -1)\n strats.add(s);\n else {\n index = strats.indexOf(s);\n strats.add(s);\n break;\n }\n }\n i++;\n \n // This is what happens if finding the solution is *a bit* less \n // trivial than we'd hope. Once we try looking for best responses \n // between the two players a thousand times, we reset the iterator;\n // clear the profiles list, and increment the p2 index... changing\n // the player with which p1 would like to play. Then we do it again.\n if (i == 1000) {\n i = 0;\n strats.clear();\n p2++;\n }\n \n // If p1 has tried trading moves back in forth with EVERY player in \n // the list, then the player at the next index can try doing so.\n if (p2 == 20) {\n p1++;\n p2 = 0;\n }\n }\n // This algorithm will continue until it finds a sink or every player \n // has traded blows with each other. Note that there's no mechanism in \n // place to reset p1's counter; so if it ever reached that point it \n // would completely fail. In that case, it may not really be all that\n // useful to reset it anyway.\n \n // This is where the *snipping* takes place as described above.\n for (int j = 0; j < index; j++) {\n strats.remove(0);\n }\n \n // Print the result. If we've found one, of course.\n strats.stream().forEach(System.out::println);\n \n }", "@Override\n public Matching stableMarriageGaleShapley_hospitaloptimal(Matching marriage) {\n int m = marriage.getHospitalCount();\n int n = marriage.getResidentCount();\n\n ArrayList<ArrayList<Integer>> hospital_preference = marriage.getHospitalPreference();\n ArrayList<ArrayList<Integer>> resident_preference = marriage.getResidentPreference();\n\n ArrayList<Integer> hospitalSlots = marriage.getHospitalSlots();\n\n ArrayList<Integer> residentMatching = new ArrayList<Integer>();\n arrlistInit(residentMatching, n, -1, false);\n\n /*list of residents that each hospital can propose to\n * Initially equals the hospital_preference list*/\n ArrayList<ArrayList<Integer>> residentsToProposeTo = new ArrayList<ArrayList<Integer>>();\n for (int i = 0; i < m; i++) //O(m)\n residentsToProposeTo.add(new ArrayList<Integer>(hospital_preference.get(i)));\n\n /*list of hospitals that still can propose(has free spots and hasn't proposed to every resident)*/\n ArrayList<Integer> proposing = new ArrayList<Integer>();\n arrlistInit(proposing, m, 0, true); //O(n)\n\n /*Keep track of each hospital matched residents*/\n ArrayList<ArrayList<Integer>> hospitalResidents = new ArrayList<ArrayList<Integer>>(0);\n for (int i = 0; i < m; i++) //O(m)\n hospitalResidents.add(new ArrayList<Integer>(0));\n\n /*Looping through each hospital in the proposing list\n * Even though some hospital may be added again in the proposing list, each hospital can propose at most once to each resident\n * So total running time of the loop will be O(m*n)*/\n while (!proposing.isEmpty()) {\n for (int hospitalIndex = 0; hospitalIndex < proposing.size(); hospitalIndex++) {\n /*Get the head of the proposing Arraylist*/\n int hospital = proposing.get(0);\n int residentIndex;\n int resident = 0;\n for (residentIndex = 0; residentIndex < residentsToProposeTo.get(hospital).size() && proposing.contains(hospital); hospitalIndex++) {\n /*Get the next resident the hospital hasn't proposed to yed*/\n resident = residentsToProposeTo.get(hospital).get(0);\n int hospitalRank = resident_preference.get(resident).indexOf(hospital);\n\n /*resident is matched, compare the hospitals rank*/\n if (residentMatching.get(resident) != -1) {\n int matchedHospital = residentMatching.get(resident);\n int matchedHospitalRank = resident_preference.get(resident).indexOf(matchedHospital);\n if (hospitalRank < matchedHospitalRank) {\n /*1.Add/remove to hospitalResidents\n * 2.Add in resident-matching\n * 3.Add matchedHospital to the proposing list if it's not in it\n */\n hospitalResidents.get(hospital).add(resident);\n hospitalResidents.get(matchedHospital).remove(hospitalResidents.get(matchedHospital).indexOf(resident));\n residentMatching.set(resident, hospital);\n if (!proposing.contains(matchedHospital))\n proposing.add(matchedHospital);\n\n }\n }\n /*resident is free, match with the hospital*/\n else {\n /*1.Add in hospitalResidents\n * 2.Add in resident-matching\n */\n hospitalResidents.get(hospital).add(resident);\n residentMatching.set(resident, hospital);\n }\n\n /*1.Remove resident from the hospital's list of residentsToProposeTo\n * 2.If hospital's slots are full, remove hospital from the proposing list\n */\n residentsToProposeTo.get(hospital).remove(residentsToProposeTo.get(hospital).indexOf(resident));\n if (hospitalResidents.get(hospital).size() >= hospitalSlots.get(hospital))\n proposing.remove(proposing.indexOf(hospital));\n }\n }\n }\n marriage.setResidentMatching(residentMatching);\n return marriage;\n }", "private void findBest()\r\n\t{\r\n\t\tint i;\r\n\t\tint size_mature_pool;\r\n\t\tint idx_current;//index of a currently checked genotype\r\n\t\tint num_errors;//number of errors of the current chromosome\r\n\t\tdouble min_error;//smallest error among the oldest genotypes\r\n\t\tVector<Integer> idx_oldest;\r\n\t\t\r\n\t\tsize_mature_pool = _pool_of_bests.size();\r\n\t\t\r\n\t\tidx_oldest = new Vector<Integer>(0, 1);\r\n\t\t\r\n\t\t//find all oldest genotypes\r\n\t\tfor(i=0; i<size_mature_pool; i++)\r\n\t\t{\r\n\t\t\tnum_errors = _pool_of_bests.get(i)._error.all_single_squares.size();\r\n\t\t\tif(num_errors>=_min_life_span)\r\n\t\t\t{\r\n\t\t\t\tidx_oldest.add(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//find the best oldest gentypes with a span above a threshold\r\n\t\t_best_idx = -1;\r\n\t\tif(idx_oldest.size() > 0)\r\n\t\t{\r\n\t\t\t_best_idx = idx_oldest.get(0);\r\n\t\t\tmin_error = _pool_of_bests.get(_best_idx)._error.getAverageError();\r\n\t\t\tfor(i=1; i<idx_oldest.size(); i++)\r\n\t\t\t{\r\n\t\t\t\tidx_current = idx_oldest.get(i);\r\n\t\t\t\tif(min_error > _pool_of_bests.get(idx_current)._error.getAverageError())\r\n\t\t\t\t{\r\n\t\t\t\t\t_best_idx = idx_current;\r\n\t\t\t\t\tmin_error = _pool_of_bests.get(_best_idx)._error.getAverageError();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void makePreferredOTTOLRelationshipsNOConflicts() {\n \n // TraversalDescription CHILDOF_TRAVERSAL = Traversal.description()\n // .relationships(RelType.TAXCHILDOF, Direction.INCOMING);\n \n // get the start point\n Node life = getLifeNode();\n System.out.println(life.getProperty(\"name\"));\n \n Transaction tx = beginTx();\n addToPreferredIndexes(life, ALLTAXA);\n HashSet<Long> traveled = new HashSet<Long>();\n int nNewRels = 0;\n try {\n // walk out to the tips from the base of the tree\n for (Node n : TAXCHILDOF_TRAVERSAL.traverse(life).nodes()) {\n if (n.hasRelationship(Direction.INCOMING, RelType.TAXCHILDOF) == false) {\n \n // when we hit a tip, start walking back\n Node curNode = n;\n while (curNode.hasRelationship(Direction.OUTGOING, RelType.TAXCHILDOF)) {\n Node startNode = curNode;\n if (traveled.contains((Long)startNode.getId())){\n \tbreak;\n }else{\n \ttraveled.add((Long)startNode.getId());\n }\n Node endNode = null;\n \n // if the current node already has a preferred relationship, we will just follow it\n if (startNode.hasRelationship(Direction.OUTGOING, RelType.PREFTAXCHILDOF)) {\n Relationship prefRel = startNode.getSingleRelationship(RelType.PREFTAXCHILDOF, Direction.OUTGOING);\n \n // make sure we don't get stuck in an infinite loop (should not happen, could do weird things to the graph)\n if (prefRel.getStartNode().getId() == prefRel.getEndNode().getId()) {\n System.out.println(\"pointing to itself \" + prefRel + \" \" + prefRel.getStartNode().getId() + \" \" + prefRel.getEndNode().getId());\n break;\n }\n \n // prepare to move on\n endNode = prefRel.getEndNode();\n \n } else {\n \n // if there is no preferred rel then they all point to the same end node; just follow the first non-looping relationship\n for (Relationship rel : curNode.getRelationships(RelType.TAXCHILDOF, Direction.OUTGOING)) {\n if (rel.getStartNode().getId() == rel.getEndNode().getId()) {\n System.out.println(\"pointing to itself \" + rel + \" \" + rel.getStartNode().getId() + \" \" + rel.getEndNode().getId());\n break;\n } else {\n endNode = rel.getEndNode();\n break;\n }\n }\n \n // if we found a dead-end, die\n if (endNode == null) {\n System.out.println(curNode.getProperty(\"name\"));\n System.out.println(\"Strange, this relationship seems to be pointing at a nonexistent node. Quitting.\");\n System.exit(0);\n }\n \n // create preferred relationships\n curNode.createRelationshipTo(endNode, RelType.PREFTAXCHILDOF);\n curNode.createRelationshipTo(endNode, RelType.TAXCHILDOF).setProperty(\"source\", \"ottol\");\n nNewRels += 1;\n }\n \n if (startNode == endNode) {\n System.out.println(startNode);\n System.out.println(\"The node seems to be pointing at itself. This is a problem. Quitting.\");\n System.exit(0);\n \n // prepare for next iteration\n } else {\n curNode = endNode;\n addToPreferredIndexes(startNode, ALLTAXA);\n }\n }\n }\n \n if (nNewRels % transaction_iter == 0) {\n System.out.println(nNewRels);\n // tx.success();\n // tx.finish();\n // tx = beginTx();\n }\n }\n tx.success();\n } finally {\n tx.finish();\n }\n }", "public void solve() {\n// BruteForceSolver bfs = new BruteForceSolver(pointList);\n// bfs.solve(); // prints the best polygon, its area, and time needed\n// System.out.println(\"-------------\");\n\n// StarshapedSolver ss = new StarshapedSolver(pointList);\n// foundPolygons = ss.solve();\n// System.out.println(\"-------------\");\n\n// RandomAddPointHeuristic ra = new RandomAddPointHeuristic(pointList);\n// foundPolygons = ra.solve(750);\n// System.out.println(\"-------------\");\n\n// GreedyAddPointHeuristic ga = new GreedyAddPointHeuristic(pointList,false);\n// foundPolygons = ga.solve(750);\n// System.out.println(\"-------------\");\n\n// long time = 4000;\n// GreedyAddPointHeuristic gaInit = new GreedyAddPointHeuristic(pointList,false);\n// Polygon2D initSolution = gaInit.solve(time*1/4).get(0);\n// System.out.println(initSolution.area);\n// System.out.println(initSolution);\n//\n// SimulatedAnnealing sa = new SimulatedAnnealing(pointList,initSolution,3);\n// foundPolygons.addAll(sa.solve(time-gaInit.timeInit,2,0.005,0.95));\n// System.out.println(sa.maxPolygon);\n// System.out.println(\"-------------\");\n\n// foundPolygons.addAll(findMultiplePolygonsStarshaped(8,0.6));\n\n }", "private Pair<Track,Pair<List<LCRelation>,List<HelicalTrackHit>>> fitNewTrack(Track track, TrackerHit hitL1, List<LCRelation> helicalTrackHitToStripHitRelations){\n String[] strategyResources = new String[4];\n strategyResources[0] = \"/org/hps/recon/tracking/strategies/HPS_s345_c2_e16.xml\";\n strategyResources[1] = \"/org/hps/recon/tracking/strategies/HPS_s456_c3_e21.xml\";\n strategyResources[2] = \"/org/hps/recon/tracking/strategies/HPS_s123_c4_e56.xml\";\n strategyResources[3] = \"/org/hps/recon/tracking/strategies/HPS_s123_c5_e46.xml\";\n \n List<SeedStrategy> sFinallist = StrategyXMLUtils.getStrategyListFromInputStream(this.getClass().getResourceAsStream(strategyResources[0]));\n List<LCRelation> hthToStripHitRefitList = new ArrayList<LCRelation>();\n List<HelicalTrackHit> helicalHits = new ArrayList<HelicalTrackHit>();\n\n HelicalTrackStrip strip1 = null;\n HelicalTrackStrip strip2 = null;\n TrackerHit hit1 = null;\n TrackerHit hit2 = null;\n HelicalTrackHit hth = null;\n \n //Build the HelicalTrackStrip for the first layer refit\n for(LCRelation rel:helicalTrackHitToStripHitRelations){\n if(((TrackerHit) rel.getFrom()).equals(hitL1)){\n HelicalTrackStrip strip = makeDigiStrip(new SiTrackerHitStrip1D((TrackerHit) rel.getTo()));\n if(strip1 == null){\n strip1 = strip;\n hit1 = (TrackerHit) rel.getTo();\n }\n else{\n strip2 = strip;\n hit2 = (TrackerHit) rel.getTo();\n break;\n }\n }\n }\n \n //Build the HelicalTrackHit for the first layer refit\n if(strip1 != null && strip2 != null){\n HelicalTrackCross trackCross = new HelicalTrackCross(strip1,strip2);\n hth = (HelicalTrackHit) trackCross;\n helicalHits.add(hth);\n }\n \n List<TrackerHit> hits = track.getTrackerHits();\n \n //Build the HelicalTrackStrips for the remaining layers\n for(TrackerHit hit:hits){\n if(hit.equals(hits.get(0))){\n hthToStripHitRefitList.add(new BaseLCRelation(hth,hit1));\n hthToStripHitRefitList.add(new BaseLCRelation(hth,hit2));\n continue;\n }\n strip1 = null;\n strip2 = null;\n for(LCRelation rel:helicalTrackHitToStripHitRelations){\n if(checkSameHit((TrackerHit) rel.getFrom(),hit)){\n HelicalTrackStrip strip = makeDigiStrip(new SiTrackerHitStrip1D((TrackerHit) rel.getTo()));\n if(strip1 == null){\n strip1 = strip;\n hit1 = (TrackerHit) rel.getTo();\n }\n else{\n strip2 = strip;\n hit2 = (TrackerHit) rel.getTo();\n break;\n }\n }\n }\n //Build the HelicalTrackHit for the remaining layers\n if(strip1 != null && strip2 != null){\n HelicalTrackCross trackCross = new HelicalTrackCross(strip1,strip2);\n hth = (HelicalTrackHit) trackCross;\n helicalHits.add(hth);\n hthToStripHitRefitList.add(new BaseLCRelation(hth,hit1));\n hthToStripHitRefitList.add(new BaseLCRelation(hth,hit2));\n }\n }\n \n SeedCandidate trackseed = new SeedCandidate(helicalHits, sFinallist.get(0), TrackUtils.getHTF(track.getTrackStates().get(0)), bfield);\n \n // Initialize the reference point to the origin\n double[] ref = new double[] {0., 0., 0.};\n \n // Create a new SeedTrack (SeedTrack extends BaseTrack)\n SeedTrack trk = new SeedTrack();\n \n // Add the hits to the track\n for (HelicalTrackHit hit : trackseed.getHits()) {\n trk.addHit((TrackerHit) hit);\n }\n \n // Retrieve the helix and save the relevant bits of helix info\n HelicalTrackFit helix = trackseed.getHelix();\n trk.setTrackParameters(helix.parameters(), bfield); // Sets first TrackState.\n trk.setCovarianceMatrix(helix.covariance()); // Modifies first TrackState.\n trk.setChisq(helix.chisqtot());\n trk.setNDF(helix.ndf()[0]+helix.ndf()[1]);\n \n // Flag that the fit was successful and set the reference point\n trk.setFitSuccess(true);\n trk.setReferencePoint(ref); // Modifies first TrackState.\n trk.setRefPointIsDCA(true);\n \n // Set the strategy used to find this track\n trk.setStratetgy(trackseed.getSeedStrategy());\n \n // Set the SeedCandidate this track is based on\n trk.setSeedCandidate(trackseed);\n \n return new Pair<>((Track) trk,new Pair<>(hthToStripHitRefitList,helicalHits));\n }", "private void updateBest() {\n if (bestTourOrder == null) {\n bestTourOrder = ants.get(0).trail;\n bestTourLength = ants.get(0)\n .trailLength(graph);\n }\n for (Ant a : ants) {\n if (a.trailLength(graph) > bestTourLength) {\n bestTourLength = a.trailLength(graph);\n bestTourOrder = a.trail.clone();\n }\n }\n\n\n }", "private LineString pickBestGrowthPossibility2(List<LineString> lookAheads) {\t\t\n\t\tif (lookAheads == null || lookAheads.size() == 0) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t//sort by:\n\t\t//1. is moving away?\n\t\t//2. number of coordinates in line\n\t\t//3. slope\n\t\tComparator<LineString> lookAheadComparator = new Comparator<LineString>() {\n\t\t\tpublic int compare(LineString s1, LineString s2) {\n\t\t\t\t\n\t\t\t\tboolean m1 = LineGrowthHelpers.isMovingAway(s1, s1.getCoordinateN(s1.getNumPoints()-1));\n\t\t\t\tboolean m2 = LineGrowthHelpers.isMovingAway(s2, s2.getCoordinateN(s2.getNumPoints()-1));\n\t\t\t\tif (m1 != m2) {\n\t\t\t\t\treturn m1 ? -1 : 1;\n\t\t\t\t}\n\t\t\t\telse { //both moving away, or neither moving away. look to second criteria\n\t\t\t\t\t\n\t\t\t\t\tif (s1.getNumPoints() == s2.getNumPoints()) {\n\n\t\t\t\t\t\tdouble slope1 = SpatialUtils.getSlope(s1);\n\t\t\t\t\t\tdouble slope2 = SpatialUtils.getSlope(s2);\n\t\t\t\t\t\treturn slope1 > slope2 ? -1 \n\t\t\t\t\t\t\t\t : slope1 < slope2 ? 1 \n\t\t\t\t\t\t\t : 0; \n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\treturn s1.getNumPoints() > s2.getNumPoints() ? -1 \n\t\t\t\t\t\t\t\t : s1.getNumPoints() < s2.getNumPoints() ? 1 \n\t\t\t\t\t\t\t : 0; \n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tlookAheads.sort(lookAheadComparator);\n\t\treturn lookAheads.get(0);\n\t}", "public void makePreferredOTTOLRelationshipsConflicts(){\n \t\tTransaction tx;\n \t\tString name = \"life\";\n \t\tIndexHits<Node> foundNodes = findTaxNodeByName(name);\n Node firstNode = null;\n if (foundNodes.size() < 1){\n System.out.println(\"name '\" + name + \"' not found. quitting.\");\n return;\n } else if (foundNodes.size() > 1) {\n System.out.println(\"more than one node found for name '\" + name + \"'not sure how to deal with this. quitting\");\n } else {\n for (Node n : foundNodes)\n firstNode = n;\n }\n \t\tTraversalDescription CHILDOF_TRAVERSAL = Traversal.description()\n \t\t\t\t.relationships( RelTypes.TAXCHILDOF,Direction.INCOMING );\n \t\tSystem.out.println(firstNode.getProperty(\"name\"));\n \t\tint count = 0;\n \t\ttx = graphDb.beginTx();\n \t\ttry{\n \t\t\tfor(Node friendnode : CHILDOF_TRAVERSAL.traverse(firstNode).nodes()){\n \t\t\t\tboolean conflict = false;\n \t\t\t\tString endNode = \"\";\n \t\t\t\tRelationship ncbirel = null;\n \t\t\t\tRelationship ottolrel = null;\n \t\t\t\tfor(Relationship rel : friendnode.getRelationships(Direction.OUTGOING)){\n \t\t\t\t\tif (rel.getEndNode() == rel.getStartNode()){\n \t\t\t\t\t\tcontinue;\n \t\t\t\t\t}else{\n \t\t\t\t\t\tif (endNode == \"\")\n \t\t\t\t\t\t\tendNode = (String) rel.getEndNode().getProperty(\"name\");\n \t\t\t\t\t\tif ((String)rel.getEndNode().getProperty(\"name\") != endNode){\n \t\t\t\t\t\t\tconflict = true;\n \t\t\t\t\t\t}\n \t\t\t\t\t\tif(((String)rel.getProperty(\"source\")).compareTo(\"ncbi\")==0)\n \t\t\t\t\t\t\tncbirel = rel;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\tif (conflict && ncbirel != null){\n \t\t\t\t\tcount += 1;\n //\t\t\t\t\tSystem.out.println(\"would make one from \"+ncbirel.getStartNode().getProperty(\"name\")+\" \"+ncbirel.getEndNode().getProperty(\"name\"));\n \t\t\t\t\tif(ncbirel.getStartNode()!=ncbirel.getEndNode()){\n \t\t\t\t\t\tncbirel.getStartNode().createRelationshipTo(ncbirel.getEndNode(), RelTypes.PREFTAXCHILDOF);\n \t\t\t\t\t\tRelationship newrel2 = ncbirel.getStartNode().createRelationshipTo(ncbirel.getEndNode(), RelTypes.TAXCHILDOF);\n \t\t\t\t\t\tnewrel2.setProperty(\"source\", \"ottol\");\n \t\t\t\t\t}else{\n \t\t\t\t\t\tSystem.out.println(\"would make cycle from \"+ncbirel.getEndNode().getProperty(\"name\"));\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t}\n \t\t\t\tif(count % transaction_iter == 0)\n \t\t\t\t\tSystem.out.println(count);\n \t\t\t}\n \t\t\ttx.success();\n \t\t}finally{\n \t\t\ttx.finish();\n \t\t}\n \t}", "protected static List<Conflict> solve() {\n\t\tcleaned = false;\n\t\tif (curMIDI != null)\n\t\t\ttry {\n\t\t\t\tSolver greedy = new OOGreedySolver(setOfStrings);\n\t\t\t\tcurMIDI = TrackSplitter.split(curMIDI, setOfStrings.length, bassTrack);\n\t\t\t\tcurMIDI = greedy.solve(curMIDI);\n\t\t\t\tsetOfConflicts = Cleaner.getConflicts(curMIDI, setOfStrings);\n\n\t\t\t\t//serve users valid choices\n\t\t\t\t//receive users choice\n\t\t\t\t//call appropriate method\n\n\t\t\t\t// give the simulation the new midi\n\t\t\t\tcurMIDI = Cleaner.prePos(curMIDI, prepositionDelay, setOfStrings, prepositionLength);\n\t\t\t\tif (sim!=null) sim.setSequence(curMIDI);\n\t\t\t\treturn setOfConflicts;\n\t\t\t} catch (InvalidMidiDataException e) {\n\t\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "public void solveGame() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\n\t\t\tif(!relaxAllControllables){\n\t\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\n\t\t\t\t\t\tcurrentSet.add(s);\n\t\t\t\t}\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "private static void BicingsimulatedAnnealingSearch(int num, int n_est, int nbicis, int nfurgo, int d1, int cas, String Cas, String H, String D, int s) {\n\n\n try {\n\n double MedT = 0;\n //double MedN = 0;\n //double MedB = 0;\n int iteraciones = 100;\n Estado Bicing = new Estado(n_est,nbicis,nfurgo,d1,s,1);\n Bicing.setList_cdesp(iteraciones);\n long StartTime = System.nanoTime();\n Problem problem = new Problem(Bicing, new sucesoresA(), new isGoal(), new Heuristic_Function());\n SimulatedAnnealingSearch search = new SimulatedAnnealingSearch(iteraciones, 1000, 125, 0.00001D);\n SearchAgent agent = new SearchAgent(problem, search);\n List L = search.getPathStates();\n Properties properties = agent.getInstrumentation();\n long EndTime = System.nanoTime();\n Estado E = (Estado) search.getGoalState();\n long time = ((EndTime - StartTime) / 1000000);\n MedT += time;\n //MedB += E.getganancia();\n // MedN += Integer.parseInt(properties.getProperty((String)properties.keySet().iterator().next()));\n // MedB /= num;\n // MedN /= num;\n // MedT /= num;\n //MedB = (Math.round(MedB*100.0)/100.0);\n Writer output;\n output = new BufferedWriter(new FileWriter(\"Estadisticas_\" + Cas + \"_D\" + D + \"_H\" + H + \"S.txt\", true));\n double [] vec = E.getearnings();\n for (int i = 0 ; i < iteraciones; ++i) {\n String S = \"\" + vec[i];\n S = S + '\\n';\n output.append(S);\n }\n output.close();\n\n /*for (int i = 0; i < E.getN_furgo(); ++i) {\n System.out.println(\"Recorrido por furgoneta \" + i + \" \" + E.getIFurgo(i).getLong_t());\n }*/\n //printEstado(E);\n //System.out.println();\n //System.out.println(E.getganancia());\n //printActions(agent.getActions());\n //printInstrumentation(agent.getInstrumentation());\n } catch (Exception var4) {\n var4.printStackTrace();\n }\n\n }", "private void heuristicSetter(Node node){\n int goalNodeFirstDigit = Integer.parseInt(goalNode.getDigit().getFirst_digit());\n int goalNodeSecondDigit = Integer.parseInt(goalNode.getDigit().getSecond_digit());\n int goalNodeThirdDigit = Integer.parseInt(goalNode.getDigit().getThird_digit());\n\n int nodeFirstDigit = Integer.parseInt(node.getDigit().getFirst_digit());\n int nodeSecondDigit = Integer.parseInt(node.getDigit().getSecond_digit());\n int nodeThirdDigit = Integer.parseInt(node.getDigit().getThird_digit());\n\n int heuristic = Math.abs(goalNodeFirstDigit - nodeFirstDigit)+\n Math.abs(goalNodeSecondDigit - nodeSecondDigit)+\n Math.abs(goalNodeThirdDigit - nodeThirdDigit);\n\n node.setHeuristic(heuristic);\n }", "private void recalcBestPath(int dest) {\n boolean changed;\n\n List<BGPPath> possList = this.inRib.get(dest);\n BGPPath currentBest = this.pathSelection(possList);\n BGPPath currentInstall = this.locRib.get(dest);\n\n /*\n * We need to handle advertisements in one of two cases a) we have found\n * a new best path and it's not the same as our current best path b) we\n * had a best path prior, but currently do not\n */\n changed = (currentBest != null && (currentInstall == null || !currentBest.equals(currentInstall)))\n || (currentBest == null && currentInstall != null);\n this.locRib.put(dest, currentBest);\n if (this.isWardenAS()) {\n if (currentBest == null) {\n this.routeStatusMap.put(dest, AS.RS_NULL);\n } else if (this.botSet == null) {\n this.routeStatusMap.put(dest, AS.RS_CLEAN);\n } else if (currentBest.containsAnyOf(this.botSet)) {\n this.routeStatusMap.put(dest, AS.RS_DIRTY);\n } else {\n this.routeStatusMap.put(dest, AS.RS_CLEAN);\n }\n }\n\n /*\n * If we have a new path, mark that we have a dirty destination\n */\n if (changed) {\n this.dirtyDest.add(dest);\n }\n }", "private void checkIsBetterSolution() {\n if (solution == null) {\n solution = generateSolution();\n //Si la solucion que propone esta iteracion es mejor que las anteriores la guardamos como mejor solucion\n } else if (getHealthFromAvailableWorkers(availableWorkersHours, errorPoints.size()) < solution.getHealth()) {\n solution = generateSolution();\n }\n }", "private List<Pair<Integer, Integer>> getBestPath(Pair<Integer, Integer> curLocation, Pair<Integer, Integer> dest) {\n\t\tList<Pair<Integer, Integer>> path = new LinkedList<Pair<Integer, Integer>>();\n\t\t\n\t\t\n\t\tNode current = new Node(curLocation.getX(), curLocation.getY(), getHitProbability(curLocation.getX(), curLocation.getY()));\n\t\tNode target = new Node(dest.getX(), dest.getY(), getHitProbability(dest.getX(), dest.getY()));\n\t\tList<Node> openSet = new ArrayList<>();\n List<Node> closedSet = new ArrayList<>();\n \n \n while (true) {\n openSet.remove(current);\n List<Node> adjacent = getAdjacentNodes(current, closedSet, target);\n\n // Find the adjacent node with the lowest heuristic cost.\n for (Node neighbor : adjacent) {\n \tboolean inOpenset = false;\n \tList<Node> openSetCopy = new ArrayList<>(openSet);\n \tfor (Node node : openSetCopy) {\n \t\tif (neighbor.equals(node)) {\n \t\t\tinOpenset = true;\n \t\t\tif (neighbor.getAccumulatedCost() < node.getAccumulatedCost()) {\n \t\t\t\topenSet.remove(node);\n \t\t\t\topenSet.add(neighbor);\n \t\t\t}\n \t\t}\n \t}\n \t\n \tif (!inOpenset) {\n \t\topenSet.add(neighbor);\n \t}\n }\n\n // Exit search if done.\n if (openSet.isEmpty()) {\n System.out.printf(\"Target (%d, %d) is unreachable from position (%d, %d).\\n\",\n target.getX(), target.getY(), curLocation.getX(), curLocation.getY());\n return null;\n } else if (/*isAdjacent(current, target)*/ current.equals(target)) {\n break;\n }\n\n // This node has been explored now.\n closedSet.add(current);\n\n // Find the next open node with the lowest cost.\n Node next = openSet.get(0);\n for (Node node : openSet) {\n if (node.getCost(target) < next.getCost(target)) {\n next = node;\n }\n }\n// System.out.println(\"Moving to node: \" + current);\n current = next;\n }\n \n // Rebuild the path using the node parents\n path.add(new Pair<Integer, Integer>(curLocation.getX(), curLocation.getY()));\n while(current.getParent() != null) {\n \tcurrent = current.getParent();\n \tpath.add(0, new Pair<Integer, Integer>(current.getX(), current.getY()));\n }\n \n if (path.size() > 1) {\n \tpath.remove(0);\n }\n \n\t\treturn path;\n\t}", "private double getHeuristic(MapLocation current, MapLocation goal) {\n\t\treturn Math.max(Math.abs(current.x - goal.x), Math.abs(current.y - goal.y));\n\t}", "public void solveGame4() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\t\t\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t}\n\n\t\t// Handle the pending states\n\t\twhile (!losing.isEmpty()) {\n\t\t\tS state = losing.poll();\n\n\t\t\t\n\t\t\tlosingStates.add(state);\n\n\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\tfor (S pred : predecessors) {\n\t\t\t\tif(losing.contains(pred) || losingStates.contains(pred))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t//if(i == -1)\n\t\t\t\t\t//continue;\n\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}else{\n\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "private void identifySuccessors(T node, T goal, Set<T> goals, Queue<T> open, Set<T> closed, Map<T, T> parentMap,\n Map<T, Double> fMap, Map<T, Double> gMap, Map<T, Double> hMap) {\n // get all neighbors to the current node\n Collection<T> neighbors = findNeighbors(node, parentMap);\n\n double d;\n double ng;\n for (T neighbor : neighbors) {\n // jump in the direction of our neighbor\n T jumpNode = jump(neighbor, node, goals);\n\n // don't add a node we have already gotten to quicker\n if (jumpNode == null || closed.contains(jumpNode)) continue;\n\n // determine the jumpNode's distance from the start along the current path\n d = graph.getDistance(jumpNode, node);\n ng = gMap.getOrDefault(node, 0d) + d;\n\n // if the node has already been opened and this is a shorter path, update it\n // if it hasn't been opened, mark as open and update it\n if (!open.contains(jumpNode) || ng < gMap.getOrDefault(jumpNode, 0d)) {\n gMap.put(jumpNode, ng);\n hMap.put(jumpNode, graph.getHeuristicDistance(jumpNode, goal));\n fMap.put(jumpNode, gMap.getOrDefault(jumpNode, 0d) + hMap.getOrDefault(jumpNode, 0d));\n //System.out.println(\"jumpNode: \" + jumpNode.x + \",\" + jumpNode.y + \" f: \" + fMap.get(jumpNode));\n parentMap.put(jumpNode, node);\n\n if (!open.contains(jumpNode)) {\n open.offer(jumpNode);\n }\n }\n }\n }", "private void updateFringeAndConflicts(List<String> changed) {\n //update fringe\n for (Clause ci : fringe) {\n for (CLiteral l : ci.getCLiterals()) {\n if (changed.contains(l.getName())) {\n ci.updateClause(labels);\n if ( ci.numOfNegative>0)\n // else if (c.numUnknownLiterals==0 && c.numOfNegative==c.numUnknownLiterals)\n if (!conflicts.contains(ci)) {\n if (conflicts.size()+1<=maxConflicts)\n conflicts.add(ci);\n\n break;\n }\n }\n }\n }\n\n // check rest of clauses which not in fringe or conflicts.\n for (Clause c : clauses) {\n if (!fringe.contains(c) && !conflicts.contains(c)) {\n for (CLiteral l : c.getCLiterals()) {\n if (changed.contains(l.getName())) {\n c.updateClause(labels);\n\n if (c.getNumUnknownLiterals() == 1 && c.getNumOfNegative() == c.getNumOfLiterals() - c.getNumUnknownLiterals()) {\n fringe.push(c);\n break;\n } else if (c.numOfNegative >0) {\n // else if (c.numUnknownLiterals==0 && c.numOfNegative==c.numUnknownLiterals)\n if (!conflicts.contains(c)) {\n if (conflicts.size()+1<=maxConflicts)\n conflicts.add(c);\n\n break;\n }\n }\n }\n }\n }\n }\n }", "public void aEstrella (String input)\r\n\t{\r\n\t\tNode root_aEstrella = new Node (input);\r\n\t\tNode current = new Node(root_aEstrella.getState());\r\n\t\t\r\n\t\tHeuristicComparator aEstrella_comparator = new HeuristicComparator();\r\n\t\tPriorityQueue<Node> queue_gbfs = new PriorityQueue<Node>(12, aEstrella_comparator);\r\n\t\tArrayList<String> visited = new ArrayList<String>();\r\n\t\tArrayList<String> children = new ArrayList<String>();\r\n\t\t\r\n\t\tint nodes_popped = 0;\r\n\t\tint pqueue_max_size = 0;\r\n\t\tint pq_size = 0;\r\n\t\t\r\n\t\tcurrent.cost = 0;\r\n\t\tcurrent.setTotalCost(0);\r\n\t\t\r\n\t\twhile(!goal_aEstrella)\r\n\t\t{\r\n\t\t\tvisited.add(current.getState());\r\n\t\t\tchildren = Successor.findChildren(current.getState());\r\n\t\t\t\r\n\t\t\tfor (String a : children)\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tif (visited.contains(a))\r\n\t\t\t\t{\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNode nino = new Node(a);\r\n\t\t\t\t\tcurrent.children_nodes.add(nino);\r\n\t\t\t\t\tvisited.add(nino.getState());\r\n\t\t\t\t\t\r\n\t\t\t\t\tint cost = isCost(current.getState(), nino.getState());\r\n\t\t\t\t\tnino.cost = cost;\r\n\t\t\t\t\tnino.parent = current;\r\n\t\t\t\t\tint greedy_cost = greedybfsCost(nino.getState(), root_aEstrella.getState());\r\n\t\t\t\t\tnino.setTotalCost(nino.parent.getTotalCost() + nino.cost);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// f(n) = g(n) + h(n)\r\n\t\t\t\t\tnino.setHeuristicCost(nino.getTotalCost() + greedy_cost);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (!queue_gbfs.contains(nino))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tqueue_gbfs.add(nino);\r\n\t\t\t\t\t\tpq_size++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Repeated State checking. Removing the same node from PQ if the path cost is less then the current one \r\n\t\t\t\t\telse if (queue_gbfs.contains(nino))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfor (Node original : queue_gbfs)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (original.equals(nino))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tNode copy = original;\r\n\t\t\t\t\t\t\t\tif (nino.getHeuristicCost() < copy.getHeuristicCost())\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tqueue_gbfs.remove(copy);\r\n\t\t\t\t\t\t\t\t\tqueue_gbfs.add(nino);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcurrent = queue_gbfs.poll();\r\n\t\t\tnodes_popped++;\r\n\t\t\t\r\n\t\t\tif (pq_size > pqueue_max_size)\r\n\t\t\t{\r\n\t\t\t\tpqueue_max_size = pq_size;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tpq_size--;\r\n\t\t\tgoal_aEstrella = isGoal(current.getState());\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tgoal_aEstrella = false;\r\n\t\tSystem.out.println(\"A* Solved!!\");\r\n\t\tSolution.performSolution(current, root_aEstrella, nodes_popped, pqueue_max_size);\r\n\t}", "void BackTrackBestPath(double[] delta_T_1,\n int[][] best,\n int[] best_path) {\n FindBestInLevel(delta_T_1, ((best_path)[T_-1]));\n for (int i = T_-2;i >= 0;i--) {\n (best_path)[i] = best[i+1][(best_path)[i+1]];\n }\n}", "@Override\n\tprotected void notifyNewBest(LinkedList<City> goodSolution, double length) {\n\t}", "private TargetInformation findHighGoal(Mat image) {\r\n\t\tTargetInformation ret = new TargetInformation();\r\n\t\tret.targetingPeg = false;\r\n\t\t\r\n long[] xsums = sums(image, true);\r\n long[] ysums = sums(image, false);\r\n \r\n\t List<PeakLoc> xpeaks = findPeaks(xsums, 10);\r\n\t List<PeakLoc> ypeaks = findPeaks(ysums, 10);\r\n\r\n\t if (ypeaks.size() == 2 && xpeaks.size() > 0) {\r\n\t \tret.targetFound = true;\r\n\t \tret.x = (xpeaks.get(0).getStop() - xpeaks.get(0).getStart()) / 2;\r\n\t \tret.gap = ypeaks.get(1).getStart() - ypeaks.get(0).getStop();\r\n\t \tret.width = xpeaks.get(0).getStop() - xpeaks.get(0).getStart();\r\n\t \tret.height = ypeaks.get(1).getStop() - ypeaks.get(0).getStart();\r\n\t \tret.y = (ypeaks.get(0).getStop() + ypeaks.get(1).getStart())/2;\r\n\t \t\r\n\t \tdouble pixelsPerInch = ret.gap / highGoalGapInches;\r\n\t \tif (xpeaks.get(0).isTruePeak() && xpeaks.get(1).isTruePeak())\r\n\t \t{\r\n\t \t\tpixelsPerInch = (pixelsPerInch + ret.width / highGoalWidthInches) / 2;\r\n\t \t}\r\n\t \tif (ypeaks.get(0).isTruePeak())\r\n\t \t{\r\n\t \t\tif (xpeaks.get(0).isTruePeak() && xpeaks.get(1).isTruePeak())\r\n\t \t\t{\r\n\t \t\t\tpixelsPerInch = (pixelsPerInch * 2 + ret.width / highGoalHeightInches) / 3;\r\n\t \t\t}\r\n\t \t\telse\r\n\t \t\t{\r\n\t \t\t\tpixelsPerInch = (pixelsPerInch + ret.width / highGoalHeightInches) / 2;\r\n\t \t\t}\r\n\t \t} \t\r\n\t \t\r\n\t \tret.aimX = ret.x + (cameraOffsetInches - shooterOffsetInches) * pixelsPerInch;\r\n\t \t\r\n\t \tret.correctionAngle = (double)((ret.aimX - image.cols() / 2)) / pixelsPerXDegree;\r\n\t }\r\n\t else\r\n\t {\r\n\t \tret.targetFound = false;\r\n\t }\r\n\t \r\n\t return ret;\r\n\t}", "@Override\n\tprotected double[] calculateNeighbourhoodBest(int i) {\n\t\t\t//System.out.println(\"Gbest particle from local typology!\");\n\t\t\tint indexBestParticle = i;\n\t\t\tint indexLeftNeighbour = (i > 0) ? i - 1 : swarmSize - 1;\n\t\t\tint indexRightNeighbour = (i < swarmSize - 1) ? i + 1 : 0;\t\t\n\t\t\t\t\t\n\t\t\tdouble nBestFitness = swarm.get(i).getPBestFitness();\n\t\t\tdouble leftNeighborParticlePBestFitness = swarm.get(indexLeftNeighbour).getPBestFitness();\n\t\t\tdouble rightNeighborParticlePBestFitness = swarm.get(indexRightNeighbour).getPBestFitness();\n\t\t\t\t\t\n\t\t\tif (leftNeighborParticlePBestFitness < nBestFitness) {\n\t\t\t\tindexBestParticle = indexLeftNeighbour;\n\t\t\t\tnBestFitness = leftNeighborParticlePBestFitness;\n\t\t\t}\n\t\t\tif (rightNeighborParticlePBestFitness < nBestFitness) {\n\t\t\t\tindexBestParticle = indexRightNeighbour;\n\t\t\t\tnBestFitness = rightNeighborParticlePBestFitness;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\treturn swarm.get(indexBestParticle).getPBest();\n\t\t\t//return swarm.get(indexBestParticle);\n\t\t\t\n\t}", "private void lastResortFindPeer() {\n\t\tDecentLogger.write(\"Resolving peers from DNS (last resort)\");\n\t\tfor(String seed: DNS_SEEDS) {\n\t\t\tArrayList<InetAddress> hosts = DNSResolver.getARecords(seed);\n\t\t\tif(hosts != null) {\n\t\t\t\tcheckList(hosts);\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n public String bringSolution(String arr) {\r\n\tMaze3d maze = hMaze.get(arr);\r\n//\tSolution<Position> s = hSol.get(maze);\r\n\tif (maze != null) {\r\n\t Stack<Position> sol = hSol.get(maze).getSolution();\r\n\t sb = new StringBuilder();\r\n\t while (!sol.isEmpty()) {\r\n\t\tsb.append(sol.pop());\r\n\t }\r\n\t return sb.toString();\r\n\t}\r\n\treturn \"Solution do not exist for \" + arr + \" maze.\";\r\n }", "private Outfit getBestWithJacket(double desired_clo) {\n Cursor jacketCursor = mOuterLoaderListener.getCursor();\n Outfit best_outfit = new Outfit();\n Outfit temp_top_bottom;\n Outfit temp_dress;\n double diff = Double.MAX_VALUE;\n double jacket_clo = 0;\n int result_jacket_position = 0;\n if (jacketCursor.moveToFirst()) {\n while (!jacketCursor.isAfterLast()) {\n jacket_clo = jacketCursor.getDouble(jacketCursor.getColumnIndex(ClothesEntry.COLUMN_ARTICLE_CLO_VALUE));\n temp_top_bottom = getBestTopBottom(desired_clo - jacket_clo);\n temp_dress = getBestDress(desired_clo - jacket_clo);\n\n if (Math.abs(temp_top_bottom.getCloValue() + jacket_clo - desired_clo) < diff) {\n diff = Math.abs(temp_top_bottom.getCloValue() + jacket_clo - desired_clo);\n result_jacket_position = jacketCursor.getPosition();\n best_outfit = temp_top_bottom;\n }\n if (Math.abs(temp_dress.getCloValue() + jacket_clo - desired_clo) < diff) {\n diff = Math.abs(temp_dress.getCloValue() + jacket_clo - desired_clo);\n result_jacket_position = jacketCursor.getPosition();\n best_outfit = temp_dress;\n }\n\n jacketCursor.moveToNext();\n }\n\n if (!best_outfit.isEmpty() && jacketCursor.moveToPosition(result_jacket_position)) {\n byte[] imageByteArray = jacketCursor.getBlob(jacketCursor.getColumnIndex(ClothesEntry.COLUMN_ARTICLE_IMAGE));\n double clo = jacketCursor.getDouble(jacketCursor.getColumnIndex(ClothesEntry.COLUMN_ARTICLE_CLO_VALUE));\n\n if (imageByteArray != null && imageByteArray.length > 0)\n {\n ByteArrayInputStream imageStream = new ByteArrayInputStream(imageByteArray);\n best_outfit.addItem(new ClothingItem(Outfit.OUTER1, BitmapFactory.decodeStream(imageStream), clo));\n } else {\n best_outfit.addItem(new ClothingItem(Outfit.OUTER1, null, clo));\n }\n }\n }\n return best_outfit;\n }", "private void runBest() {\n }", "protected int bestDirection(int _y, int _x)\n {\n int sX = -1, sY = -1;\n for (int i = 0; i < m; i++) {\n boolean breakable = false;\n for (int j = 0; j < n; j++) {\n if (map[i][j] == 'p' || map[i][j] == '5') {\n sX = i;\n sY = j;\n breakable = true;\n break;\n }\n }\n if(breakable) break;\n sX =0; sY = 0;\n }\n Pair s = new Pair(sX, sY);\n Queue<Pair> queue = new Queue<Pair>();\n int[][] distance = new int[m][n];\n for (int i = 0; i < m; i++)\n for (int j = 0; j < n; j++)\n distance[i][j] = -1;\n distance[sX][sY] = 0;\n queue.add(s);\n /*\n System.out.println(\"DEBUG TIME!!!!\");\n for(int i = 0; i < m; i++)\n {\n for(int j = 0; j < n; j++)\n System.out.print(map[i][j]);\n System.out.println();\n }\n System.out.println();\n */\n while (!queue.isEmpty())\n {\n Pair u = queue.remove();\n for (int i = 0; i < 4; i++)\n {\n int x = u.getX() + hX[i];\n int y = u.getY() + hY[i];\n if (!validate(x, y)) continue;\n if (distance[x][y] != -1) continue;\n if (!canGo.get(map[x][y])) continue;\n distance[x][y] = distance[u.getX()][u.getY()] + 1;\n queue.add(new Pair(x, y));\n }\n }\n\n //slove if this enemy in danger\n //System.out.println(_x + \" \" + _y);\n if (inDanger[_x][_y])\n {\n int direction = -1;\n boolean canAlive = false;\n int curDistance = dangerDistance[_x][_y];\n int distanceToBomber = m * n;\n if (curDistance == -1) return 0;\n for (int i = 0; i < 4; i++)\n {\n int x = _x + hX[i];\n int y = _y + hY[i];\n if (!validate(x, y)) continue;\n if (dangerDistance[x][y] == -1) continue;\n if (dangerDistance[x][y] < curDistance)\n {\n curDistance = dangerDistance[x][y];\n direction = i;\n distanceToBomber = distance[x][y];\n } else if (dangerDistance[x][y] == curDistance)\n {\n if (distanceToBomber == -1 || distanceToBomber > distance[x][y])\n {\n direction = i;\n distanceToBomber = distance[x][y];\n }\n }\n }\n if (direction == -1) direction = random.nextInt(4);\n allowSpeedUp = true;\n return direction;\n }\n // or not, it will try to catch bomber\n else\n {\n /*\n System.out.println(\"x = \" + _x + \"y = \" + _y);\n for(int i = 0; i < n; i++) System.out.printf(\"%2d \",i);\n System.out.println();\n for(int i = 0; i < m; i++)\n {\n for(int j = 0; j < n; j++)\n System.out.printf(\"%2d \",distance[i][j]);\n System.out.println();\n }\n System.out.println();\n System.out.println();\n */\n int direction = -1;\n int[] die = new int[4];\n for (int i = 0; i < 4; i++)\n die[i] = 0;\n int curDistance = distance[_x][_y];\n for (int i = 0; i < 4; i++)\n {\n int x = _x + hX[i];\n int y = _y + hY[i];\n if (!validate(x, y))\n {\n die[i] = 1;\n continue;\n }\n ;\n if (inDanger[x][y])\n {\n die[i] = 2;\n continue;\n }\n if (distance[x][y] == -1) continue;\n if (distance[x][y] < curDistance)\n {\n curDistance = distance[x][y];\n direction = i;\n }\n }\n if(curDistance < 4) allowSpeedUp = true;\n else allowSpeedUp = false; //TODO: TEST :))\n if (direction == -1)\n {\n for (int i = 0; i < 4; i++)\n if (die[i] == 0) return i;\n for (int i = 0; i < 4; i++)\n if (die[i] == 1) return i;\n return 0;\n } else return direction;\n }\n }", "protected void optimize() {\n int[][] cutMemo = new int[dimX + 1][dimY + 1];\n Tuple[][] tupleMemo = new Tuple[dimX + 1][dimY + 1];\n Memo memo = new Memo(cutMemo,tupleMemo);\n\n //array is filled with -1 because -1 is used as a flag in the memo\n fillMemo(0, dimX, 0, dimY, cutMemo);\n\n //Calculates optimal value of cloth\n ArrayList<FittedPattern> answer = computeOptimal(dimX, dimY, pattern, memo, new ArrayList<>(), 0);\n coordinates = answer;\n finalValue = memo.getFittedPatternMemo()[dimX][dimY].getOptimalValue();\n\n }", "public static List<Vec2i> solve(int[][] grid, Vec2i start, Vec2i goal, Heuristic h){\n if(h == null){ //if null replace with default heuristic\n h = new Heuristic() {\n @Override\n\n public double eval(Vec2i loc) {\n double dx = (loc.x - goal.x);\n double dy = (loc.y - goal.y);\n return Math.sqrt(dx*dx + dy*dy);\n }\n };\n }\n\n PriorityQueue<GridLocation> edge = new PriorityQueue<GridLocation>(10, AStarGrid::compareGridLocations);\n edge.add(new GridLocation(start,0));\n\n Map<Vec2i, Vec2i> cameFrom = new HashMap<Vec2i, Vec2i>();\n Map<Vec2i, Double> g = new HashMap<Vec2i, Double>(); //distance to node\n g.put(start,0.0);\n Map<Vec2i, Double> f = new HashMap<Vec2i, Double>(); //distance from start to goal through this node\n f.put(start,h.eval(start));\n //f = g + h\n\n while(!edge.isEmpty()){\n\n Vec2i current = edge.poll().loc;\n if(current.x == goal.x && current.y == goal.y){\n return reconstructPath(cameFrom, current);\n }\n\n LinkedList<Vec2i> neighbors = new LinkedList<Vec2i>();\n if(current.x != 0 && grid[current.x - 1][current.y] == 0)\n neighbors.add(new Vec2i(current.x - 1,current.y));\n if(current.x != grid.length-1 && grid[current.x + 1][current.y] == 0)\n neighbors.add(new Vec2i(current.x + 1,current.y));\n if(current.y != 0 && grid[current.x][current.y - 1] == 0)\n neighbors.add(new Vec2i(current.x,current.y - 1));\n if(current.y != grid[0].length-1 && grid[current.x][current.y + 1] == 0)\n neighbors.add(new Vec2i(current.x,current.y + 1));\n\n\n for(Vec2i neighbor: neighbors){\n double score = g.get(current) + 1;\n if(!g.containsKey(neighbor) || score < g.get(neighbor)){\n cameFrom.put(neighbor,current);\n g.put(neighbor, score);\n f.put(neighbor, score + h.eval(neighbor));\n if(!edge.contains(neighbor)){\n edge.add(new GridLocation(neighbor,score + h.eval(neighbor)));\n }\n }\n }\n }\n //No path was found\n return null;\n }", "@Override\n protected void search() {\n \n obtainProblem();\n if (prioritizedHeroes.length > maxCreatures){\n frame.recieveProgressString(\"Too many prioritized creatures\");\n return;\n }\n bestComboPermu();\n if (searching){\n frame.recieveDone();\n searching = false;\n }\n }", "private void computeConflicts() {\n\t\tthis.conflictGraph = new HashMap<Class, List<Class>>();\n\n\t\tfor (Class c : this.core) {\n\t\t\tif (c.getSuperClasses().size() >= 2) {\n\n\t\t\t\tList<List<Class>> linExts = new ArrayList<List<Class>>();\n\t\t\t\tfor (int i = 0; i < c.getSuperClasses().size(); i++) {\n\t\t\t\t\tlinExts.add(this.linearExts.get(c.getSuperClasses().get(i)));\n\t\t\t\t\tlinExts.get(i).add(c.getSuperClasses().get(i));\n\t\t\t\t}\n\n\t\t\t\tList<HashSet<Class>> diffs = new ArrayList<HashSet<Class>>();\n\n\t\t\t\t// Compute lini - linj for all i != j\n\t\t\t\tfor (List<Class> linExt : linExts) {\n\t\t\t\t\tfor (List<Class> linExt2 : linExts) {\n\t\t\t\t\t\tif (linExt != linExt2) {\n\t\t\t\t\t\t\tHashSet<Class> diff = new HashSet<Class>();\n\t\t\t\t\t\t\tfor (Class p : linExt2) {\n\t\t\t\t\t\t\t\tif (!linExt.contains(p))\n\t\t\t\t\t\t\t\t\tdiff.add(p);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdiffs.add(diff);\n\n\t\t\t\t\t\t\tdiff = new HashSet<Class>();\n\t\t\t\t\t\t\tfor (Class p : linExt) {\n\t\t\t\t\t\t\t\tif (!linExt2.contains(p))\n\t\t\t\t\t\t\t\t\tdiff.add(p);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdiffs.add(diff);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Compute conflicts di * dj for all j != i\n\t\t\t\tfor (HashSet<Class> diff : diffs) {\n\t\t\t\t\tfor (HashSet<Class> diff2 : diffs) {\n\t\t\t\t\t\tif (diff != diff2) {\n\t\t\t\t\t\t\tfor (Class c1 : diff) {\n\t\t\t\t\t\t\t\tList<Class> conflicts = new ArrayList<Class>();\n\t\t\t\t\t\t\t\tif (this.conflictGraph.containsKey(c1))\n\t\t\t\t\t\t\t\t\tconflicts = this.conflictGraph.get(c1);\n\n\t\t\t\t\t\t\t\tfor (Class c2 : diff2) {\n\t\t\t\t\t\t\t\t\tconflicts.add(c2);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis.conflictGraph.put(c1, conflicts);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void resolveConflicts( Grammar grammar, State state, List<Action> tshifts, List<Action> ntshifts)\n {\n List<State> splits = new ArrayList<State>();\n\n Collections.sort( tshifts);\n Collections.sort( ntshifts);\n \n State currSplit = null;\n State prevSplit = null;\n for( int i=1, k=1; i<tshifts.size(); i++, k++)\n {\n prevSplit = currSplit;\n currSplit = null;\n \n Action prev = tshifts.get( i-1);\n Action curr = tshifts.get( i);\n \n if ( isOverlapping( prev.symbols, curr.symbols))\n {\n boolean conflict =\n (curr.type == Action.Type.tshift && prev.type == Action.Type.reduce) || \n (curr.type == Action.Type.reduce && prev.type == Action.Type.tshift) ||\n (curr.type == Action.Type.reduce && prev.type == Action.Type.reduce) ||\n (curr.type == Action.Type.tshift && prev.type == Action.Type.tshift);\n\n if ( conflict)\n {\n long prevPriority = prev.getPriority();\n long currPriority = curr.getPriority();\n if ( prevPriority < currPriority)\n {\n log.debugf( \"\\nConflict in state %d:\\n %s\\n %s\", state.index, prev, curr);\n log.debug( \"Conflict resolved: second rule(s) have higher priority\");\n deleteStackOp( state, k-1); k--;\n }\n else if ( prevPriority > currPriority)\n {\n log.debugf( \"\\nConflict in state %d:\\n %s\\n %s\", state.index, prev, curr);\n log.debug( \"Conflict resolved: first rule(s) have higher priority\");\n deleteStackOp( state, k); k--;\n }\n else\n {\n log.warnf( \"\\nConflict in state %d:\\n %s\\n %s\", state.index, prev, curr);\n log.warn( \"Conflict resolved by splitting state\");\n splitState( state, k, prevSplit, splits);\n currSplit = splits.get( splits.size() - 1);\n conflicts++;\n }\n }\n }\n }\n \n for( int i=1; i<ntshifts.size(); i++)\n {\n prevSplit = currSplit;\n currSplit = null;\n \n Action prev = ntshifts.get( i-1);\n Action curr = ntshifts.get( i);\n \n if ( curr.symbols[ 0] <= prev.symbols[ 0])\n {\n if ( curr.type == Action.Type.ntshift && prev.type == Action.Type.ntshift && curr.itemSet.equals( prev.itemSet))\n {\n log.warnf( \"\\nConflict in state %d:\\n %s\\n %s\", state.index, prev, curr);\n conflicts++;\n }\n }\n }\n \n if ( splits.size() > 0)\n {\n for( State split: splits) \n {\n log.debugf( \"Created new state %d to resolve conflict.\", split.index);\n removeNulls( split);\n \n for( StackOp shift: split.stackOps)\n {\n if ( shift == nullShift)\n throw new IllegalStateException();\n }\n }\n\n state.splits = splits.toArray( new State[ 0]);\n state.stackOps = null;\n state.gotos = null;\n }\n }", "public void affichageSolution() {\n\t\t//On commence par retirer toutes les traces pré-existantes du labyrinthe\n\t\tfor (int i = 0 ; i < this.laby.getHauteur() ; i++) {\n\t\t\tfor (int j = 0 ; j < this.laby.getLargeur() ; j++) {\n\t\t\t\tif (this.laby.getLabyrinthe()[i][j] instanceof Trace) {\n\t\t\t\t\tthis.laby.getLabyrinthe()[i][j] = new Case();\n\t\t\t\t\t((JLabel)grille.getComponents()[i*this.laby.getLargeur()+j]).setIcon(this.laby.getLabyrinthe()[i][j].imageCase(themeJeu));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//On parcourt toutes les cases du labyrinthe. Si on trouve un filon non extrait dont le chemin qui le sépare au mineur est plus petit que shortestPath, on enregistre la longueur du chemin ainsi que les coordonnees de ledit filon\n\t\tint shortestPath = Integer.MAX_VALUE;\n\t\tint[] coordsNearestFilon = {-1,-1};\n\t\tfor (int i=0 ; i < this.laby.getHauteur() ; i++) {\n\t\t\tfor (int j=0 ; j < this.laby.getLargeur() ; j++) {\n\t\t\t\tif (this.laby.getLabyrinthe()[i][j] instanceof Filon && ((Filon)this.laby.getLabyrinthe()[i][j]).getExtrait() == false) {\n\t\t\t\t\tif (this.laby.solve(j,i) != null) {\n\t\t\t\t\t\tint pathSize = this.laby.solve(j,i).size();\n\t\t\t\t\t\tif (pathSize < shortestPath) {\n\t\t\t\t\t\t\tshortestPath = pathSize;\n\t\t\t\t\t\t\tcoordsNearestFilon[0] = j;\n\t\t\t\t\t\t\tcoordsNearestFilon[1] = i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//Si il n'y a plus de filon non extrait atteignable, on cherche les coordonnes de la clef\n\t\tif (coordsNearestFilon[0] == -1) {\n\t\t\tcoordsNearestFilon = this.laby.getCoordsClef();\n\t\t\t//Si il n'y a plus de filon non extrait atteignable et que la clef a deja ouvert la porte, on cherche les coordonnes de la sortie\n\t\t\tif (coordsNearestFilon == null)\tcoordsNearestFilon = this.laby.getCoordsSortie();\n\t\t}\n\n\t\t//On cree une pile qui contient des couples de coordonnees qui correspondent a la solution, puis on depile car le dernier element est l'objectif vise\n\t\tStack<Integer[]> solution = this.laby.solve(coordsNearestFilon[0], coordsNearestFilon[1]);\n\t\tsolution.pop();\n\n\t\t//Tant que l'on n'arrive pas au premier element de la pile (cad la case ou se trouve le mineur), on depile tout en gardant l'element depile, qui contient les coordonnees d'une trace que l'on dessine en suivant dans la fenetre\n\t\twhile (solution.size() != 1) {\n\t\t\tInteger[] coordsTmp = solution.pop();\n\t\t\tTrace traceTmp = new Trace();\n\t\t\tthis.laby.getLabyrinthe()[coordsTmp[1]][coordsTmp[0]] = new Trace();\n\t\t\t((JLabel)grille.getComponents()[coordsTmp[1]*this.laby.getLargeur()+coordsTmp[0]]).setIcon(traceTmp.imageCase());\n\t\t}\n\t\tSystem.out.println(\"\\n========================================== SOLUTION =====================================\\n\");\n\t\tthis.affichageLabyrinthe();\n\t}", "@Override\n\t\tpublic double heuristic() {\n\t\t\tint sum = 0;\n\t\t\tfor (int i = 0; i < k; i++) {\n\t\t\t\tsum += Math.abs(xGoals[i] - state[i]);\n\t\t\t\tsum += Math.abs(yGoals[i] - state[k + i]);\n\t\t\t}\n\t\t\treturn sum;\n\t\t}", "public void solveGame3() {\n\t\tlosingStates = new HashSet<S>();\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tint[] uncontrollableCount = new int[game.getStates().size()+1];\n\t\tint[] uncontrollableLosingCount = new int[game.getStates().size()+1];\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> uncontrollableSuccesors;\n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\t uncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\n\t\t\t uncontrollableCount[indexCount] = uncontrollableSuccesors.size();\n\t\t\t uncontrollableLosingCount[indexCount] = 0;\n\t\t\t isUncontrollable[indexCount] = game.isUncontrollable(state);\n\t\t\t indexCount+=1;\n\t\t}\n\t\t\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t}\n\n\t\t// Handle the pending states\n\t\twhile (!losing.isEmpty()) {\n\t\t\tS state = losing.poll();\n\n\t\t\t\n\t\t\tlosingStates.add(state);\n\n\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\tfor (S pred : predecessors) {\n\t\t\t\tif(losing.contains(pred) || losingStates.contains(pred))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t//if(i == -1)\n\t\t\t\t\t//continue;\n\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}else{\n\t\t\t\t\tuncontrollableLosingCount[i]++;\n\t\t\t\t\tif (uncontrollableLosingCount[i] == uncontrollableCount[i])\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "private static LinkedList<Integer> localSearchSimulatedAnnealing(File fileNameWithPath, int kNeighborHood ) throws Exception{\n\t\t\n\t\tString traceString = \"\";\n\t\tdouble bestCost = Double.POSITIVE_INFINITY;\n\t\tLinkedList<Integer> bestTspList = null;\n\t\tdouble bestCycleTime = Double.POSITIVE_INFINITY;\n\n\t\tif (Project.runId == -1 )\n\t\t\tProject.runId = 1;\n\n\t\t/* \n\t\t * read the file and build the cost table\n\t\t */\n parseEdges(fileNameWithPath);\n\n /*\n\t\t * time starts once you read the data\n */\n\t\tdouble baseTime = System.nanoTime();\n\n\t\t/*\n\t\t * invoking furthest insertion algorithm to get the tsp\n\t\t */\n\t\tlong startNodeSeed = (long)(1000.0*generator.nextDouble());\n\t\tLinkedList<Integer> currentTspList = FurthestInsertion.generateTSP(Project.sourceGTree,startNodeSeed);\n\t\t\n\t\tdouble currentTspCost = tspCost(currentTspList);\n\n\t\tbestTspList = currentTspList;\n\t\tbestCost = currentTspCost;\n\t\tbestCycleTime = System.nanoTime() - baseTime;\n\n\t\t/* print the trace file */\n\t\ttraceString = String.format(\"%.2f, %d\",Math.round(((System.nanoTime()-baseTime)/nanosecs)*100.0)/100.0,Math.round(bestCost));\n\t\tprintTrace(runId,traceString);\n\n\t\t/*\n\t\t * time starts now - start annealing\n\t\t */\n\t\tdouble annealingProbabilityThreshold = .2*generator.nextDouble(); // acceptance prob threshold for bad results\n\t\tdouble T = 100; // annealing temp\n\t\tdouble coolingRate = .00000001; // rate of cooling in each step\n\n\t\t/*\n\t\t * remove the last node as it matches the first\n\t\t */\n\t\tcurrentTspList.removeLast();\n\n\t\twhile ( T > 1 )\n\t\t{\n\t\t\t/*\n\t\t\t * reached cutoff time\n\t\t\t */\n\t\t\tif ( System.nanoTime()-baseTime >= Project.cutoffTimeSeconds*nanosecs ) {\n\t\t\t\ttimedOut=true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tdouble cycleStartTime = System.nanoTime();\n\n\t\t\tLinkedList<Integer> newTspList = currentTspList;\n\n\t\t\t/* do a 2 opt search in current k=5 neighborhood to get a newtsp */\n\t\t\t/* 1. Pick the first random element in the current tsp */\n\t\t\tint element2 = (int)((double)(newTspList.size()-1) * generator.nextDouble());\n\t\t\tint element1 = element2 - 1;\n\t\t\tif ( element1 == -1 ){\n\t\t\t\telement1 = newTspList.size()-1;\n\t\t\t}\n\t\t\t\n int delta;\n\n\t\t\t/*\n\t\t\t * search in the neighborhood specified\n * if not specified search all\n\t\t\t */\n if ( kNeighborHood != -1 ) {\n\t\t\t /* We want to search in the specified k=n neighborhoods of element1 */\n\t\t\t delta= (int)(2*kNeighborHood*generator.nextDouble()) - kNeighborHood;\n } else {\n\t\t\t delta= (int)((newTspList.size()-1)*generator.nextDouble()) - (int)(newTspList.size()/2);\n\t\t\t}\n\n\t\t\tif ( delta == 0 ) {\n\t\t\t\tdelta = 2;\n\t\t\t} else if ( delta == 1 ) {\n\t\t\t\tdelta = 2;\n\t\t\t} else if ( delta == -1) {\n\t\t\t\tdelta = -2; }\n\n\t\t\tint element4 = element2 + delta;\n\n\t\t\tif ( element4 < 0 ) {\n\t\t\t\telement4 = newTspList.size()+element4;\n\t\t\t}else if ( element4 >= newTspList.size() ) {\n\t\t\t\telement4 = element4-(newTspList.size()-1);\n\t\t\t}\n\n\t\t\tint element3 = element4 -1;\n\t\t\tif ( element3 == -1 ){\n\t\t\t\telement3 = newTspList.size()-1;\n\t\t\t}\n\n\n\t\t\t/* \n\t\t\t * the new tsp will have element2->element4.......element1->element3....\n\t\t\t */\n\t\t\tInteger vertex_3 = newTspList.get(element3);\n\t\t\tnewTspList.set(element3,newTspList.get(element2));\n\t\t\tnewTspList.set(element2,vertex_3);\n\n\t\t\t/*\n\t\t\t * from element2+1 to element3-1 swap to reverse their order\n\t\t\t */\n\t\t\twhile ( element2 < element3 ){\n\t\t\t\telement3 = element3-1;\n\t\t\t\tif ( element3 == -1 ) {\n\t\t\t\t\telement3 = newTspList.size()-1;\n\t\t\t\t}\n\n\t\t\t\telement2 = element2 + 1;\n\t\t\t\tif ( element2 == newTspList.size() ) {\n\t\t\t\t\telement3 = 0;\n\t\t\t\t}\n\n\t\t\t\tInteger tempVertex = newTspList.get(element2);\n\t\t\t\tnewTspList.set(element2,newTspList.get(element3));\n\t\t\t\tnewTspList.set(element3,tempVertex);\n\n\t\t\t}\n\n\t\t\tdouble newTspCost = tspCost(newTspList);\n\n\t\t\t/* if new local search solution is better than eariler take the search and continue search\n\t\t\t */\n\t\t\tif ( newTspCost <= currentTspCost ){\n\t\t\t\tcurrentTspList = newTspList;\n\t\t\t\tcurrentTspCost = newTspCost;\n\t\t\t} else {\n\t\t\t/* if new local search solution is not better than eariler \n\t\t\t * then check the difference and the probability at this stage of annealing\n\t\t\t * if probability is higher than threshold set, then keep new search ad continue, else discard \n\t\t\t */\n\t\t\t\tif ( Math.exp((currentTspCost - newTspCost) / T) > generator.nextDouble() ){\n\t\t\t\t\tcurrentTspList = newTspList;\n\t\t\t\t\tcurrentTspCost = newTspCost;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t//Subtract the start time from the finish time to get the actual algorithm running time; divide by 10e6 to convert to milliseconds\n\t\t\tdouble cycleTime = (System.nanoTime()-cycleStartTime);\n\n\t\t\t/* first improvement , take the best each time */\n\t\t\tif ( newTspCost < bestCost ) {\n\t\t\t\tbestCost = newTspCost;\n\t\t\t\tbestTspList = newTspList;\n\t\t\t\tbestCycleTime = cycleTime;\n\t\t\t\t/* print the trace file */\n\t\t\t\ttraceString = String.format(\"%.2f, %d\",Math.round(((System.nanoTime()-baseTime)/nanosecs)*100.0)/100.0,Math.round(bestCost));\n\t\t\t\tappendToTraceFile(runId,traceString);\n\n\t\t\t\tif ( bestCost <= optimalCost )\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t/* the cooling */\n\t\t\tT = T - T * coolingRate;\n\n\t\t}\n\n\t\t/* print the sol file */\n\t\tprintSol(runId,bestTspList,bestCost);\n\n\t\t/* print the tab results file */\n\t\tappendTabResults(runId,bestCycleTime,bestCost,bestTspList);\n\n\t\treturn bestTspList;\n\n\t}", "public Solver(Board initial) {\r\n if (initial == null) throw new IllegalArgumentException();\r\n\r\n\r\n SearchNode initialAdjacent = new SearchNode(initial.twin(), null, 0);\r\n MinPQ<SearchNode> adjacentPriorityQueue = new MinPQ<>(1);\r\n adjacentPriorityQueue.insert(initialAdjacent);\r\n\r\n\r\n SearchNode initialNode = new SearchNode(initial, null, 0);\r\n MinPQ<SearchNode> priorityQueue = new MinPQ<>(1);\r\n priorityQueue.insert(initialNode);\r\n\r\n if (initial.isGoal()) {\r\n goal = initialNode;\r\n isSolvable = true;\r\n return;\r\n } else if (initialAdjacent.board.isGoal()) {\r\n isSolvable = false;\r\n }\r\n\r\n\r\n SearchNode currentAdjacent = initialAdjacent;\r\n SearchNode currentBoard = initialNode;\r\n\r\n while (!currentAdjacent.board.isGoal() && !currentBoard.board.isGoal()) {\r\n\r\n currentAdjacent = adjacentPriorityQueue.delMin();\r\n currentBoard = priorityQueue.delMin();\r\n\r\n for (Board adjacentNeighbor : currentAdjacent.board.neighbors()) {\r\n SearchNode toBeInserted = new SearchNode(adjacentNeighbor, currentAdjacent, currentAdjacent.previousMoves + 1);\r\n if (currentAdjacent.previousSearchNode == null || !toBeInserted.board.equals(currentAdjacent.previousSearchNode.board)) {\r\n adjacentPriorityQueue.insert(toBeInserted);\r\n }\r\n }\r\n\r\n\r\n for (Board neighbor : currentBoard.board.neighbors()) {\r\n SearchNode toBeInserted = new SearchNode(neighbor, currentBoard, currentBoard.previousMoves + 1);\r\n if (currentBoard.previousSearchNode == null || !toBeInserted.board.equals(currentBoard.previousSearchNode.board)) {\r\n\r\n priorityQueue.insert(toBeInserted);\r\n }\r\n }\r\n }\r\n if (currentAdjacent.board.isGoal()) {\r\n isSolvable = false;\r\n goal = initialNode;\r\n } else {\r\n goal = currentBoard;\r\n isSolvable = true;\r\n }\r\n\r\n }", "public void solveGame5() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "public ReturnClass astar_algo(){\n long start=System.nanoTime();\n TreeStar node=new TreeStar(variables,0);\n openList.push(node);\n\n while (!openList.isEmpty())\n {\n\n TreeStar temp= openList.pollLast(); //pop the highest scoring node in openList\n refreshUsage(temp.variables); //uses the current node variables to update usageArray\n\n if((System.nanoTime()-start)/1000000000>=maxTime){\n System.out.println(\"time limit reached\");\n ReturnClass returnClass= new ReturnClass(temp.variables,temp.score,false);\n return returnClass;\n }\n\n if(temp.score==nbC){\n System.out.println(\"solution trouvée !\");\n printArray(temp.variables);\n ReturnClass returnClass= new ReturnClass(temp.variables,temp.score,true);\n return returnClass;\n }\n\n int bestVar=0;\n if(heuristic.equals(\"TD Heuristic\")){\n bestVar= chooseVTD(); //get the highest scoring unused var to use it in children\n }\n else if(heuristic.equals(\"TD-long heuristic\")){\n bestVar=chooseVTD();\n }\n else if(heuristic.equals(\"Partial-diff Heuristic\")){\n bestVar= chooseVDiff(temp.variables); //get the highest scoring unused var to use it in children\n }\n else {\n bestVar= chooseVDiff(temp.variables);\n }\n\n\n TreeStar node1= nextVar(temp.variables, 0,bestVar,temp.profondeur+1);\n TreeStar node2= nextVar(temp.variables, 1,bestVar,temp.profondeur+1);\n\n if(node1!=null){\n addToOpenList(node1);\n addToOpenList(node2);\n }\n }\n\n System.out.println(\"solution non trouvée\");\n return null;\n }", "private Game findBestUpcomingGame(List<Game> games,\n Map<String, Integer> previous, int time) {\n Game bestGame = null;\n int bestScore = -1;\n for (Game game : games) {\n if (game.isFinal()) continue;\n Team team1 = game.getTeam1();\n Team team2 = game.getTeam2();\n int minLagViolation = 0;\n int maxLagViolation = 0;\n int earliestStartViolation = 0;\n int latestStartViolation = 0;\n int score;\n Object previousTimeTeam1 = previous.get(team1.getName());\n Object previousTimeTeam2 = previous.get(team2.getName());\n \n earliestStartViolation += calculateEarliestStartViolation(game, time);\n latestStartViolation += calculateLatestStartViolation(game, time);\n if (previousTimeTeam1 != null) {\n minLagViolation += calculateMinLagViolation(team1, time, (int) previousTimeTeam1);\n maxLagViolation += calculateMaxLagViolation(team1, time, (int) previousTimeTeam1);\n }\n if (previousTimeTeam2 != null) {\n minLagViolation += calculateMinLagViolation(team2, time, (int) previousTimeTeam2);\n maxLagViolation += calculateMaxLagViolation(team2, time, (int) previousTimeTeam2);\n }\n\n score = MAX_LAG_WEIGHT * maxLagViolation \n + MIN_LAG_WEIGHT * minLagViolation \n + EARLIEST_START_WEIGHT * earliestStartViolation \n + LATEST_START_WEIGHT * latestStartViolation;\n if (bestScore < 0 || score < bestScore) {\n bestScore = score;\n bestGame = game;\n }\n }\n // no improvement found, use first game\n if (bestGame == null) {\n bestGame = games.get(0);\n }\n \n return bestGame;\n }", "Object getBest();", "public long getBestSolutionTime();", "@Override\n public final void solve() {\n this.flag1 = this.neo.getPosition().equals(this.goal);\n \n }", "private void planDynamicStairs() throws GameActionException, HungryException {\r\n\t\tInteger fluxHeight = gameMap.get(fluxInfo.location).totalHeight;\r\n\t\tif (fluxHeight == fluxHeightWhenStairsPlanned){\r\n\t\t\tif (DEBUG) System.out.println(\"No need to plan stairs now\");\r\n\t\t\t//return; /* No return for now. Always plan stairs, so no stupid block lockups will occur */\r\n\t\t}\r\n\t\t\r\n\t\tif (DEBUG) System.out.println(\"-----TOWER-----\");\r\n\t\tDirection randDir = navigation.getRandomDirection();\r\n\t\tMapLocation start1 = fluxInfo.location.add(randDir).add(randDir);\r\n\t\tMapLocation start2 = fluxInfo.location.subtract(randDir).subtract(randDir);\r\n\t\tif ((gameMap.get(start1) == null) || (gameMap.get(start2) == null))\r\n\t\t\t/* unlucky - start position wasn't scanned yet */\r\n\t\t\treturn;\r\n\t\t\r\n\t\tfluxHeightWhenStairsPlanned = fluxHeight;\r\n\t\t\r\n\t\tList<MapLocation> fluxPath1 = navigation.findPathUsingAStar(gameMap, start1, fluxInfo.location, false);\r\n\t\t//if (DEBUG) System.out.println(fluxPath1);\r\n\t\tList<MapLocation> fluxPath2 = navigation.findPathUsingAStar(gameMap, start2, fluxInfo.location, false);\r\n\t\t//if (DEBUG) System.out.println(fluxPath2);\r\n\t\tCollections.reverse(fluxPath1);\r\n\t\tCollections.reverse(fluxPath2);\r\n\t\tList<MapLocation> result = new ArrayList<MapLocation>();\r\n\t\twhile ((fluxPath1.size() > 0) && (fluxPath2.size() > 0) && (fluxPath1.get(0).equals(fluxPath2.get(0)))){\r\n\t\t\tresult.add(fluxPath1.remove(0));\r\n\t\t\tfluxPath2.remove(0);\r\n\t\t}\r\n\t\tCollections.reverse(result);\r\n\t\tif (result.size() >= stairs.size())\r\n\t\t\t/* prefer fresh data, but not too short */\r\n\t\t\tstairs = result;\r\n\t\tif (DEBUG) System.out.println(result);\r\n\t\tif (DEBUG) System.out.println(navigation.changePathToDirections(result));\r\n\t\tif (DEBUG) System.out.println(\"----/TOWER-----\");\r\n\t}", "@Override\n public Matching stableMarriageGaleShapley_residentoptimal(Matching marriage) {\n\n int m = marriage.getHospitalCount();\n int n = marriage.getResidentCount();\n\n ArrayList<ArrayList<Integer>> hospital_preference = marriage.getHospitalPreference();\n ArrayList<ArrayList<Integer>> resident_preference = marriage.getResidentPreference();\n ArrayList<Integer> hospitalSlots = marriage.getHospitalSlots();\n ArrayList<Integer> residentMatching = new ArrayList<Integer>();\n arrlistInit(residentMatching, n, -1, false); //O(n)\n\n /*At first the resident can propose to all his list.\n Each time a proposal is made the hospital is removed from the list*/\n\n /*Trying to create a copy of the arraylist elements not copy of references*/\n ArrayList<ArrayList<Integer>> hospitalsToProposeTo = new ArrayList<ArrayList<Integer>>();\n for (int i = 0; i < n; i++) //O(n)\n hospitalsToProposeTo.add(new ArrayList<Integer>(resident_preference.get(i)));\n\n\n /*list of residents that still can propose(free and hasn't proposed to every hospital)*/\n ArrayList<Integer> proposing = new ArrayList<Integer>();\n arrlistInit(proposing, n, 0, true); //O(n)\n\n\n /*Keep track of each hospital matched residents*/\n ArrayList<ArrayList<Integer>> hospitalResidents = new ArrayList<ArrayList<Integer>>(0);\n for (int i = 0; i < m; i++)\n hospitalResidents.add(new ArrayList<Integer>(0)); //O(m)\n\n /*Array list that holds the value of the lowest matched resident rank in each hospital\n * so each time a resident propose to a full hospital, the resident is swapped with the least ranked rmatched resident */\n ArrayList<Integer> lowestMatchedResidentRank = new ArrayList<Integer>();\n arrlistInit(lowestMatchedResidentRank, m, -1, false); //O(m)\n\n /*we enter the loop as long as some residents aren't done proposing to all hospitals yet O(mn*maximum no of spots)*/\n while (!proposing.isEmpty()) {\n\n /*Get the head of the proposing list*/\n for (int residentIndex = 0; residentIndex < proposing.size(); residentIndex++) {\n int resident = proposing.get(0);\n int hospital = 0;\n int hospitalIndex;\n /*Get the first hospital in the resident list which he hasn't proposed to yet, breaks if he can't no longer propose if matched*/\n for (hospitalIndex = 0; hospitalIndex < hospitalsToProposeTo.get(resident).size() && proposing.contains(resident); hospitalIndex++) {\n hospital = hospitalsToProposeTo.get(resident).get(0);\n int residentRank = hospital_preference.get(hospital).indexOf(resident);\n\n /*hospital is full, loop through the matched residents and see if anyone can be kicked out*/\n if (hospitalResidents.get(hospital).size() == hospitalSlots.get(hospital)) {\n\n if (residentRank < lowestMatchedResidentRank.get(hospital)) {\n /*1.Replace in hospitalResidents\n * 2.Add/remove in resident-matching\n * 3.Remove resident from the proposing list\n * 4.Check if matched resident still has hospitals to propose to (if yes, add to proposing)\n */\n int lowestMatchedResident = hospital_preference.get(hospital).get(lowestMatchedResidentRank.get(hospital));\n\n hospitalResidents.get(hospital).set(hospitalResidents.get(hospital).indexOf(lowestMatchedResident), resident);\n residentMatching.set(lowestMatchedResident, -1);\n residentMatching.set(resident, hospital);\n proposing.remove(proposing.indexOf(resident));\n if (!hospitalsToProposeTo.get(lowestMatchedResident).isEmpty()) {\n proposing.add(lowestMatchedResident);\n }\n\n /*set the lowest rank\n * TODO make it O(1)*/\n int min = 0;\n for (int i = 0; i < hospitalResidents.get(hospital).size(); i++) {\n int tempRank = hospital_preference.get(hospital).indexOf(hospitalResidents.get(hospital).get(i));\n if (tempRank > min)\n min = tempRank;\n }\n lowestMatchedResidentRank.set(hospital, min);\n\n }\n }\n\n /*If there is available spot*/\n else {\n /*1.Add in hospitalResidents\n * 2.Add in resident-matching\n * 3.Set the lowest ranked resident\n * 4.Remove resident from proposing list\n */\n\n /*Update the lowest rank*/\n if (residentRank > lowestMatchedResidentRank.get(hospital))\n lowestMatchedResidentRank.set(hospital, residentRank);\n\n hospitalResidents.get(hospital).add(resident);\n residentMatching.set(resident, hospital);\n proposing.remove(proposing.indexOf(resident));\n }\n\n /*1. Remove hospital from resident's hospitalsToProposeTo\n *2. If resident is matched or proposed to every possible hospital, remove resident from proposing list\n */\n\n hospitalsToProposeTo.get(resident).remove(hospitalsToProposeTo.get(resident).indexOf(hospital));\n if (hospitalsToProposeTo.get(resident).size() == 0 && proposing.contains(resident))\n proposing.remove(proposing.indexOf(resident));\n }\n }\n }\n\n marriage.setResidentMatching(residentMatching);\n return marriage;\n\n }", "private void adjustHits(Node winner, String string) {\n\t\tIterator<HitHolder> ite = winner.hitList.iterator();\n\t\tHitHolder temp = null;\n\t\tboolean exists = false;\n\t\t\n\t\t\n\t\twhile(ite.hasNext())\n\t\t{\n\t\t\ttemp = ite.next();\n\t\t\t\n\t\t\tif(temp.element.equalsIgnoreCase(string))\n\t\t\t{\n\t\t\t\tif(temp.getFirstIteration() == -1)\n\t\t\t\t{\n\t\t\t\t\ttemp.firstIteration = CURRENT_ITERATION;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttemp.lastIteration = CURRENT_ITERATION;\n\t\t\t\ttemp.numberOfHits++;\n\t\t\t\texists = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!exists)\n\t\t{\n\t\t\twinner.hitList.add(new HitHolder(string, CURRENT_ITERATION));\n\t\t}\n\t}", "private static MapLocation getBestPastrLocNearMeBasedOnCowGrowthRate() {\n\t\tif (Clock.getRoundNum() < 1) {\n\t\t\tallCowGrowths = rc.senseCowGrowth();\t\t\t\n\t\t}\n\t\tMapLocation bestLocation = new MapLocation(curLoc.x, curLoc.y);\n\t\tdouble cowGrowthAmount = 0;\n\t\tMapLocation enemyHQLocation = rc.senseEnemyHQLocation();\n\t\tdouble distanceToEnemyHQ = curLoc.distanceSquaredTo(enemyHQLocation);\n\t\tfor (int i = 15; i-- > 0;) {\n\t\t\tfor (int j = 15; j-- > 0;) {\n\t\t\t\t// Check that it's in bounds\n\t\t\t\tif (curLoc.x - i + 8 >= 0 && curLoc.x - i + 8 < rc.getMapWidth() &&\n\t\t\t\t\tcurLoc.y - j + 8 >= 0 && curLoc.y - j + 8 < rc.getMapHeight()) {\n\t\t\t\t\tMapLocation mapLoc = new MapLocation(curLoc.x - i + 8, curLoc.y - j + 8);\n\t\t\t\t\tdouble currentLocGrowth = allCowGrowths[curLoc.x - i + 8][curLoc.y - j + 8];\n\n\t\t\t\t\t// Check that it's behind a perpendicular line and not void\n\t\t\t\t\t// and choose the best point.\n\t\t\t\t\tif (mapLoc.distanceSquaredTo(enemyHQLocation) < distanceToEnemyHQ &&\n\t\t\t\t\t\tcurrentLocGrowth > cowGrowthAmount && rc.senseTerrainTile(mapLoc) != TerrainTile.VOID) {\n\t\t\t\t\t\tcowGrowthAmount = currentLocGrowth;\n\t\t\t\t\t\tbestLocation = mapLoc;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn bestLocation;\n\t}", "void findInstantiations (final Buffers buffers)\n\t{\n\t\tbuffers.removeDecayedChunks();\n\n\t\tHashSet<Instantiation> set = new HashSet<Instantiation>();\n\t\tbuffers.sortGoals();\n\n\t\tif (buffers.numGoals() == 0)\n\t\t{\n for (Production p : productions.values()) {\n Instantiation inst = p.instantiate(buffers);\n if (inst != null) set.add(inst);\n }\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor (int i=0 ; set.isEmpty() && i<buffers.numGoals() ; i++)\n\t\t\t{\n\t\t\t\tbuffers.tryGoal (i);\n\t\t\t\tif (threadedCognitionTrace)\n\t\t\t\t\tmodel.output (\"*** (tct) trying goal \" + buffers.get(Symbol.goal));\n for (Production p : productions.values()) {\n Instantiation inst = p.instantiate(buffers);\n if (inst != null) set.add(inst);\n }\n\t\t\t}\n\t\t}\n\n\t\tif (threadedCognitionTrace)\n\t\t\tmodel.output (\"*** (tct) found \"+set.size()+\" match\"+(set.size()==1 ? \"\" : \"es\"));\n\n\t\tif (!set.isEmpty())\n\t\t{\n\t\t\tif (conflictSetTrace) model.output (\"Conflict Set:\");\n\t\t\tIterator<Instantiation> itInst = set.iterator();\n\t\t\tInstantiation highestU = itInst.next();\n\t\t\tif (conflictSetTrace) model.output (\"* (\" + String.format(\"%.3f\",highestU.getUtility()) + \") \" + highestU);\n\t\t\twhile (itInst.hasNext())\n\t\t\t{\n\t\t\t\tInstantiation inst = itInst.next();\n\t\t\t\tif (conflictSetTrace) model.output (\"* (\" + String.format(\"%.3f\",inst.getUtility()) + \") \" + inst);\n\t\t\t\tif (inst.getUtility() > highestU.getUtility()) highestU = inst;\n\t\t\t}\n\n\t\t\tfinal Instantiation finalInst = highestU;\n\t\t\tif (conflictSetTrace) model.output (\"-> (\" + String.format(\"%.3f\",finalInst.getUtility()) + \") \" + finalInst);\n\n\t\t\tif (finalInst.getProduction().isBreakPoint())\n\t\t\t{\n\t\t\t\tmodel.addEvent (new Event (model.getTime() + .049,\n\t\t\t\t\t\t\"procedural\", \"about to fire \" + finalInst.getProduction().getName().getString().toUpperCase())\n\t\t\t\t{\n\t\t\t\t\tpublic void action() {\n\t\t\t\t\t\tmodel.output (\"------\", \"break\");\n\t\t\t\t\t\tmodel.stop();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tString extra = \"\";\n\t\t\tif (buffers.numGoals() > 1)\n\t\t\t{\n\t\t\t\tChunk goal = buffers.get(Symbol.goal);\n\t\t\t\textra = \" [\" + ((goal!=null) ? goal.getName().getString() : \"nil\") + \"]\";\n\t\t\t}\n\n\t\t\tmodel.addEvent (new Event (model.getTime() + .050,\n\t\t\t\t\t\"procedural\", \"** \" + finalInst.getProduction().getName().getString().toUpperCase() + \" **\" + extra)\n\t\t\t{\n\t\t\t\tpublic void action() {\n\t\t\t\t\tfire (finalInst, buffers);\n\t\t\t\t\tfindInstantiations (buffers);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "public void generateNeighborhood(TSPSolution s){\r\n\t\tint [] rounte = new int[problem.city_num+1];\r\n\t\tfor(int i=0;i<problem.city_num;i++) rounte[i] = s.route[i];\r\n\t\trounte[problem.city_num] = rounte[0];\r\n\t\tint [] pos = new int[problem.city_num];\r\n\t\tproblem.calculatePosition(rounte, pos);\r\n\t\tint pos1 = 0;\r\n\t\tint pos2 = 0;\r\n\t\tfor(int k=0;k<problem.city_num;k++){\r\n\t\t\tint i = k;\r\n\t\t\tpos1 = i;\r\n\t\t\tint curIndex = rounte[i];\r\n\t\t\tint nextIndex = rounte[i+1];\r\n\t\t\tArrayList<Integer> candidate = problem.candidateList.get(curIndex);\r\n\t\t\tIterator<Integer> iter = candidate.iterator();\r\n\t\t\twhile(iter.hasNext()){\r\n\t\t\t\tint next = iter.next();\r\n\t\t\t\tpos2 = pos[next];\r\n\t\t\t\tint curIndex1 = rounte[pos2];\r\n\t\t\t\tint nextIndex1 = rounte[pos2+1];\r\n\t\t\t\tif(curIndex == nextIndex1) continue;\r\n\t\t\t\tif(curIndex == curIndex1) continue;\r\n\t\t\t\tif(nextIndex == nextIndex1) continue;\r\n\t\t\t\tif(curIndex1 == nextIndex) continue;\r\n\t\t\t\tint betterTimes = 0;\r\n\t\t\t\tTSPSolution solution = new TSPSolution(problem.city_num, problem.obj_num, -1);\r\n\t\t\t\tfor(int j=0;j<problem.obj_num;j++){\r\n\t\t\t\t\tint gain = problem.disMatrix[j*problem.city_num*problem.city_num+curIndex*problem.city_num+curIndex1] +\r\n\t\t\t\t\t\t\tproblem.disMatrix[j*problem.city_num*problem.city_num+nextIndex*problem.city_num+nextIndex1] - \r\n\t\t\t\t\t\t\t(problem.disMatrix[j*problem.city_num*problem.city_num+curIndex*problem.city_num+nextIndex]+\r\n\t\t\t\t\t\t\tproblem.disMatrix[j*problem.city_num*problem.city_num+curIndex1*problem.city_num+nextIndex1]);\r\n\t\t\t\t\tif(gain<0) betterTimes++;\r\n\t\t\t\t\tsolution.object_val[j] = s.object_val[j] + gain;\r\n\t\t\t\t}\r\n\t\t\t\tif(betterTimes==0) continue;\r\n\t\t\t\tsolution.route = s.route.clone();\r\n\r\n\t\t\t\tif(problem.kdSet.add(solution)){\r\n\t\t\t\t\tproblem.converse(pos1, pos2, solution.route, 0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected Set<Norm> regulateConflict(Conflict conflict, Goal goal) {\n\t\tSet<Norm> createdNorms = new HashSet<Norm>();\n\t\tList<Long> blamedAgents = new ArrayList<Long>();\n\t\tView sourceView = conflict.getConflictSource().getView(-1);\n\t\tList<EnvironmentAgentAction> agActions;\n\t\tEnvironmentAgentContext agContext;\n\t\tEnvironmentAgentAction agAction;\n\n\t\t/* Get a list of those agents that are considered as responsible \n\t\t * for the conflict (requires domain knowledge) */\n\t\tblamedAgents = this.cbrMachine.getConflictSource(conflict);\n\n\t\t/* Create a norm that regulates the behavior of each agent\n\t\t * blamed for the conflict in the context previous to the conflict */\n\t\tfor(Long blamedAgentId : blamedAgents) {\n\n\t\t\t/* Get agent's context and action */\n\t\t\tagContext = this.dmFunctions.agentContext(blamedAgentId, sourceView);\n\t\t\tagActions = this.dmFunctions.agentAction(blamedAgentId, \n\t\t\t\t\tconflict.getConflictSource());\n\t\t\tagAction = agActions.get(random.nextInt(agActions.size()));\n\n\t\t\t/* Check that the agent has a valid context */\n\t\t\tif(agContext == null) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t/* Check that no norms applied to the agent in the state\n\t\t\t * previous to the state containing the conflict */\n\t\t\tif(this.normsAppliedToAgentContext(agContext)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t/* Create a new norm prohibiting that action in that context */\n\t\t\tSetOfPredicatesWithTerms precondition = agContext.getDescription();\n\t\t\tif(!precondition.isEmpty()) {\n\t\t\t\tNorm norm = new Norm(precondition, NormModality.Prohibition, \n\t\t\t\t\t\tagAction, goal);\n\t\t\t\t\n\t\t\t\tcreatedNorms.add(norm);\n\t\t\t\t\n\t\t\t\t/* Update metrics */\n\t\t\t\tthis.nsMetrics.newNonRegulatedConflictsSolvedThisTick();\n\t\t\t}\n\t\t}\n\t\treturn createdNorms;\n\t}", "@Override\r\n\tpublic void solve() {\n\t\t\r\n\t}", "void MemorizeBestSource() \n\t{\n\t int i,j;\n\t \n\t\tfor(i=0;i<FoodNumber;i++)\n\t\t{\n\t\tif (f[i]<GlobalMin)\n\t\t\t{\n\t GlobalMin=f[i];\n\t for(j=0;j<D;j++)\n\t GlobalParams[j]=Foods[i][j];\n\t }\n\t\t}\n\t }", "public SpaceProbe gradientDescend(SpaceObject source, SpaceObject goal, double yearsTime){\n double swarmspeed = 10E7;\n Boolean stop = false;\n SpaceProbe localBestProbe = new SpaceProbe(source.getPosition().clone().addConstant(source.getRadius()), source.getVelocity().clone(),5000);\n SpaceProbe globalBestProbe = localBestProbe.clone();\n\n while (!stop){\n System.out.println(swarmspeed);\n ArrayList<SpaceProbe> probesList = new ArrayList<>();\n probesList.addAll(createSwarm(localBestProbe, swarmspeed));\n solarSystem = solarSystem.reset();\n solarSystem.objectList.addAll(probesList);\n\n\n for (int i = 0; i < (int) (yearsTime * 365 * 86400 / 60); i++) {\n solarSystem.updateSolarSystem(60);\n for (SpaceProbe p : probesList) {\n p.calcMinDist(goal);\n }\n }\n localBestProbe = bestProbe(probesList);\n System.out.println(localBestProbe);\n if (localBestProbe.getMinDist() < goal.getRadius()){\n stop = true;\n globalBestProbe = localBestProbe.clone();\n return globalBestProbe;\n }\n if (localBestProbe.getMinDist() < globalBestProbe.getMinDist()){\n globalBestProbe = localBestProbe.clone();\n }\n swarmspeed *= 0.7;\n if (swarmspeed < 1){\n return globalBestProbe;\n }\n Vector3D bestVelocity = globalBestProbe.getVelocity().clone();\n localBestProbe.reset();\n localBestProbe.setVelocity(bestVelocity.clone());\n }\n return globalBestProbe;\n }", "private LineString pickBestGrowthPossibility1(List<LineString> lookAheads) {\n\t\tif (lookAheads == null || lookAheads.size() == 0) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t//sort by:\n\t\t//1. is moving away?\n\t\t//2. number of coordinates in line\n\t\t//3. average elevation of line\n\t\tfinal AvgElevationSectionFitness sectionFitness = new AvgElevationSectionFitness(getTinEdges());\n\t\tComparator<LineString> lookAheadComparator = new Comparator<LineString>() {\n\t\t\tpublic int compare(LineString s1, LineString s2) {\n\t\t\t\t\n\t\t\t\tboolean m1 = LineGrowthHelpers.isMovingAway(s1, s1.getCoordinateN(s1.getNumPoints()-1));\n\t\t\t\tboolean m2 = LineGrowthHelpers.isMovingAway(s2, s2.getCoordinateN(s2.getNumPoints()-1));\n\t\t\t\tif (m1 != m2) {\n\t\t\t\t\treturn m1 ? -1 : 1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (s1.getNumPoints() == s2.getNumPoints()) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tdouble fit1 = sectionFitness.fitness(s1);\n\t\t\t\t\t\t\tdouble fit2 = sectionFitness.fitness(s2);\n\t\t\t\t\t\t\treturn fit1 > fit2 ? -1 \n\t\t\t\t\t\t\t\t\t : fit1 < fit2 ? 1 \n\t\t\t\t\t\t\t\t : 0;\n\t\t\t\t\t\t} \n\t\t\t\t\t\tcatch(IOException e) {\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\treturn s1.getNumPoints() > s2.getNumPoints() ? -1 \n\t\t\t\t\t\t\t\t : s1.getNumPoints() < s2.getNumPoints() ? 1 \n\t\t\t\t\t\t\t : 0; \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tlookAheads.sort(lookAheadComparator);\n\t\treturn lookAheads.get(0);\n\t}", "public interface Heuristic {\n}", "public boolean bestFirstSearch() {\n\t\twhile(!soloution){\n\t\t\tif(open.isEmpty()){\n\t\t\t\tSystem.out.println(\"No more choices to explore\");\n\t\t\t\tSystem.out.println(\"SolutionId: \" + solutionId);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t//chooses the most optimal X\n\t\t\tNode x = popNode();\n\t\t\tclosed.add(x);\n\t\t\tSystem.out.println(\"X:\\t\\t\" + x.state + \" \" + x.h + \" + \" + x.g + \" = \" + x.f);\n\t\t\t//checks if it is a soulution\n\t\t\tif(solution(x)){\n\t\t\t\tSystem.out.println(\"SOLUTION:\\t\" + x.state);\n\t\t\t\tSystem.out.println(\"nodes created: \" + open.size() + closed.size());\n\t\t\t\tprintSolution(x);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t//handles the possible moves from the state x\n\t\t\tsucc = generateAllSuccesors(x);\n\t\t\tfor (Node s : succ) {\n\t\t\t\t//if this state already exist, we will use the node keeping it instead\n\t\t\t\tNode old = findOld(s);\n\t\t\t\tif(old != null)\n\t\t\t\t\ts = old;\n\t\t\t\t//makes the new node a child of x\n\t\t\t\tx.kids.add(s);\n\t\t\t\t//if its a new state it will be inserted to open after evaluation\n\t\t\t\tif(!open.contains(s) && !closed.contains(s)){\n\t\t\t\t\tattachAndEval(s,x);\n\t\t\t\t\tinsert(s);\n\t\t\t\t}\n\t\t\t\t//if its an old node and x is a better parent it will be evalueted again.\n\t\t\t\telse if(x.g + arcCost(x, s) < s.g){\n\t\t\t\t\tattachAndEval(s, x);\n\t\t\t\t\tif(closed.contains(s)){\n\t\t\t\t\t\t//if its closed all children will be evaluated with the new score of \"s\"\n\t\t\t\t\t\tpropagatePathImprovements(s);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public void performMove() {\n\t\tfor (int x = 0; x <= size-1; x++)\n\t\t\tfor (int y = 0; y <= size-1; y++)\n\t\t\t\tlocalBoard[y][x] = 0;\n\t\t\n\t\t//reset the flag that indicates if a move has been found that decreases the heuristic\n\t\tfoundBetterMove = false;\n\t\t\n\t\t//fill in the appropriate heuristic values\n\t\tpopulateHillValues();\n\t\tArrayList<PotentialMove> myBestList = new ArrayList<PotentialMove>();\n\n\t\t//Find the square with the lowest heuristic value. this should really write the values to an array. \n\t\tint squareDifferential = -1;\n\t\t//String outValue = \"\";\n\t\tfor (int y = 0; y <= size-1; y++) {\n\t\t\tfor (int x = 0; x <= size-1; x++){\n\t\t\t\t//outValue = outValue + localBoard[y][x];\n\t\t\t\tif (squareDifferential < 0) //lowestSquareFound not found yet \n\t\t\t\t{\n\t\t\t\t\tif ((NQueens.queens[x] != y) && //set if the current square isn't already occupied by a queen\n\t\t\t\t\t\t\t(localBoard[NQueens.queens[x]][x] >= localBoard[y][x])) {\n\t\t\t\t\t\tif (localBoard[y][x] == localBoard[NQueens.queens[x]][x])\n\t\t\t\t\t\t\tmyBestList.add(new PotentialMove(x, y, true));\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tmyBestList.add(new PotentialMove(x, y, false));\n\t\t\t\t\t\tsquareDifferential = localBoard[NQueens.queens[x]][x] - localBoard[y][x];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if ((localBoard[NQueens.queens[x]][x] - localBoard[y][x]) > squareDifferential) { // find the square with the largest differential in value from the queen in the column\n\t\t\t\t\tmyBestList.clear();\n\t\t\t\t\tmyBestList.add(new PotentialMove(x, y, false));\n\t\t\t\t\tsquareDifferential = localBoard[NQueens.queens[x]][x] - localBoard[y][x];\n\t\t\t\t}\n\t\t\t\telse if (((localBoard[NQueens.queens[x]][x] - localBoard[y][x]) == squareDifferential) && // the differential is equal to the current best differential\n\t\t\t\t\t\t(NQueens.queens[x] != y)) { // and isn't already occupied by a queen\n\t\t\t\t\tmyBestList.add(new PotentialMove(x, y, true));\n\t\t\t\t}\n\t\t\t\t//else the square is higher, has a queen or isn't marginally better than the current queen's position in the row\n\t\t\t}\n\t\t\t//outValue = outValue + \"\\n\";\n\t\t}\n\t\t//JOptionPane.showMessageDialog(null, outValue);\n\t\t\n\t\tif (myBestList.isEmpty())\n\t\t\treturn;\n\t\t\n\t\tint listSize = myBestList.size();\n\t\tPotentialMove bestMove;\n\t\t\n\t\t//grab the non-Sideways moves first\n\t\tfor (int i = 0; i < listSize; i++) {\n\t\t\tif (!(myBestList.get(i).isSideways)) {\n\t\t\t\tbestMove = myBestList.get(i);\n\t\t\t\tfoundBetterMove = true;\n\t\t\t\tsidewaysMoves = 0;\n\t\t\t\tNQueens.queens[bestMove.xCoordinate] = bestMove.yCoordinate;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (sidewaysMoves > MAXSIDEWAYSMOVES) { // hit MAXSIDEWAYSMOVES consecutive sideways moves, mark as unsolvable\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//all available moves sideways moves, let's select one randomly\n\t\tRandom generator = new Random();\n\t\tint randomElement = generator.nextInt(listSize);\n\t\t\n\t\tbestMove = myBestList.get(randomElement);\n\t\tfoundBetterMove = true;\n\t\tsidewaysMoves++;\n\t\tNQueens.queens[bestMove.xCoordinate] = bestMove.yCoordinate;\n\t}", "public Solution solve(ISearchable s) {\n return null;\n }", "public void execFuzzySearchVariationFunc(){\n\n\n Map map = new HashMap();\n\n if(this.searchParam != null && this.searchParam.length()> 0 ){\n System.out.println(this.searchParam );\n if(this.searchParam.contains(\":\")==true || this.searchParam.startsWith(\"chr\") == true) {\n String chrom = \"\";\n int pstart = -1;\n int pend = -1;\n if (this.searchParam.indexOf(\":\") > -1) {\n int idex = this.searchParam.indexOf(\":\");\n chrom = this.searchParam.substring(0, idex );\n System.out.println(\"chrom=\" + chrom);\n map.put(\"chrom\", chrom);\n if (this.searchParam.indexOf(\"-\") > -1) {\n int idex1 = this.searchParam.indexOf(\"-\");\n pstart = Integer.parseInt(this.searchParam.substring(idex + 1, idex1 ));\n pend = Integer.parseInt(this.searchParam.substring(idex1 + 1, this.searchParam.length()));\n map.put(\"startpos\", pstart);\n map.put(\"endpos\", pend);\n } else {\n pstart = Integer.parseInt(this.searchParam.substring(idex + 1, this.searchParam.length()));\n map.put(\"startpos\", pstart);\n }\n\n } else if (this.searchParam.startsWith(\"chr\") == true) {\n map.put(\"chrom\", this.searchParam);\n }\n }\n\n map.put(\"searchParam\",this.searchParam);\n }\n\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"null\") ==false && this.searchSpecies.equals(\"all\") == false){\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"species\",this.searchSpecies);\n }\n\n if(this.searchTrait != null&& this.searchTrait.equals(\"null\") ==false && this.searchTrait.length()>0){\n\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"searchTrait\", this.searchTrait) ;\n }\n\n if(this.pvalue != null&& this.pvalue.equals(\"null\") ==false && this.pvalue.length()>0){\n\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"psitu\", this.psitu);\n map.put(\"pval\", this.pvalue) ;\n }\n\n\n //here, parse search param and get genotype information\n genotypeBeanList = (List<GenotypeBean>) baseService.findResultList(\"cn.big.gvk.dm.Genotype.selectGenotypeByPos\",map);\n if(genotypeBeanList != null && genotypeBeanList.size() > 0 ){\n for(GenotypeBean tbean :genotypeBeanList ){\n List genotypelist = new ArrayList();\n genotypelist.add(tbean.getGenotypeId()) ;\n\n Map t = new HashMap();\n t.put(\"genotypelist\",genotypelist);\n List<GenotypeAnnotateGeneView> annotateview = baseService.findResultList(\"cn.big.gvk.dm.Genotype.selectGenotypeByList\",t);\n if(annotateview != null && annotateview.size()>0 ){\n //here we need to filter the result\n Map filtermap = new HashMap();\n for(GenotypeAnnotateGeneView tview : annotateview){\n String fkey = tview.getMapGeneId()+\"_\"+tview.getConseqtype();\n if(filtermap.containsKey(fkey) == false){\n filtermap.put(fkey,tview);\n }\n }\n\n if(filtermap.size()>0){\n List<GenotypeAnnotateGeneView> alist = new ArrayList<GenotypeAnnotateGeneView>();\n Iterator it = filtermap.entrySet().iterator();\n while(it.hasNext()){\n Map.Entry entry = (Map.Entry) it.next();\n GenotypeAnnotateGeneView val = (GenotypeAnnotateGeneView) entry.getValue();\n alist.add(val);\n }\n\n tbean.setGenotypeAnnotateGeneView(alist);\n }\n\n\n }\n\n //find association count\n GwasAssociationBean gwas = (GwasAssociationBean) baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectAssociationCountByGenotypeid\",tbean.getGenotypeId());\n if(gwas != null){\n tbean.setTraitCount(gwas.getGwasCount());\n }\n\n //find studycount\n Map cmap = new HashMap();\n cmap.put(\"genotypeId\",tbean.getGenotypeId());\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"all\") == false){\n cmap.put(\"species\",this.searchSpecies);\n }\n\n\n GwasAssociationBean tg_bean1 = (GwasAssociationBean)baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectStudyCountByGenotypeid\",cmap);\n if(tg_bean1 != null ){\n tbean.setStudyCount(tg_bean1.getGwasCount());\n }\n\n }\n\n\n\n }\n\n StringBuffer sb = new StringBuffer() ;\n\n if(genotypeBeanList != null && genotypeBeanList.size()>0){\n for(GenotypeBean genotype: genotypeBeanList){\n sb.append(genotype.getVarId()).append(\"\\t\").append(genotype.getChrom()).append(\":\")\n .append(genotype.getStartPos()).append(\"\\t\").append(genotype.getTraitCount())\n .append(\"\\t\").append(genotype.getStudyCount()).append(\"\\n\");\n }\n }\n\n if(format == 1 ){ //export txt\n this.response.reset();\n this.response.setHeader(\"Content-Disposition\",\n \"attachment;filename=export.txt\");\n this.response.setContentType(\"application/ms-txt\");\n try {\n PrintWriter pr = this.response.getWriter();\n pr.print(sb.toString());\n pr.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n }", "public void findSolution() {\n\n\t\t// TODO\n\t}", "private Point backtrack(Point p){\n\t\t// coordinates of the point\n\t\tint x = (int)p.getX();\n\t\tint y = (int)p.getY();\n\t\t// neigh hold the return value\n\t\tPoint neigh= p;\n\t\t// the lowest score\n\t\tint score=10000;\n\t\t// look at all the neighbor and compare them\n\t\tif(x>0\t && topology[x-1][y]>=0){\n\t\t\tscore = topology[x-1][y];\n\t\t\tneigh = new Point(x-1,y);\n\t\t}\n\t\tif(x<row-1 && topology[x+1][y]>=0 && score > topology[x+1][y]) {\n\t\t\tscore = topology[x+1][y];\n\t\t\tneigh = new Point(x+1,y);\n\t\t}\n\t\tif(y<col-1 && topology[x][y+1]>=0 && score > topology[x][y+1]) {\n\t\t\tscore = topology[x][y+1];\n\t\t\tneigh = new Point(x,y+1);\n\t\t}\n\t\tif(y>0 && topology[x][y-1]>=0 && score > topology[x][y-1]) {\n\t\t\tscore = topology[x][y-1];\n\t\t\tneigh = new Point(x,y-1);\n\t\t}\n\t\treturn neigh;\n\t}", "private static void findBestRelocationMove(RelocationMove rm, Solution s, double [][] distanceMatrix, int numberOfVehicles) \n\t{\n\t\t//This is a variable that will hold the cost of the best relocation move\n\t\tdouble bestMoveCost = Double.MAX_VALUE;\n\n\t\t//We will iterate through all available vehicles\n\t\t\n\t\t//Vehicles to relocate FROM\n\t\tfor (int from = 0; from<numberOfVehicles; from++)\n\t\t{\n\t\t\t// Vehicles to relocate TO\n\t\t\tfor (int to = 0; to<numberOfVehicles; to++)\n\t\t\t{\n\n\t\t\t\tfor (int fromIndex = 1; fromIndex < s.routes.get(from).customers.size() - 1; fromIndex++)\n\t\t\t\t{\n\t\t\t\t\t//Node A is the predecessor of B\n\t\t\t\t\tCustomer A = s.routes.get(from).customers.get(fromIndex - 1);\n\n\t\t\t\t\t//Node B is the relocated node\n\t\t\t\t\tCustomer B = s.routes.get(from).customers.get(fromIndex);\n\n\t\t\t\t\t//Node C is the successor of B\n\t\t\t\t\tCustomer C = s.routes.get(from).customers.get(fromIndex + 1);\n\n\t\t\t\t\t//We will iterate through all possible re-insertion positions for B\n\t\t\t\t\tfor (int afterIndex = 0; afterIndex < s.routes.get(to).customers.size() -1; afterIndex ++)\n\t\t\t\t\t{\n\n\t\t\t\t\t\tif ((afterIndex != fromIndex && afterIndex != fromIndex - 1)||from != to)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//Node F the node after which B is going to be reinserted\n\t\t\t\t\t\t\tCustomer F = s.routes.get(to).customers.get(afterIndex);\n\n\t\t\t\t\t\t\t//Node G the successor of F\n\t\t\t\t\t\t\tCustomer G = s.routes.get(to).customers.get(afterIndex + 1);\n\n\t\t\t\t\t\t\t//The arcs A-B, B-C, and F-G break\n\t\t\t\t\t\t\tdouble costRemovedFrom = distanceMatrix[A.ID][B.ID] + distanceMatrix[B.ID][C.ID];\n\t\t\t\t\t\t\tdouble costRemovedTo = distanceMatrix[F.ID][G.ID];\n\n\t\t\t\t\t\t\t//The arcs A-C, F-B and B-G are created\n\t\t\t\t\t\t\tdouble costAddedFrom = distanceMatrix[A.ID][C.ID];\n\t\t\t\t\t\t\tdouble costAddedTo = distanceMatrix[F.ID][B.ID] + distanceMatrix[B.ID][G.ID];\n\n\t\t\t\t\t\t\t//This is the cost of the move, or in other words\n\t\t\t\t\t\t\t//the change that this move will cause if applied to the current solution\n\t\t\t\t\t\t\tdouble fromMoveCost = costAddedFrom - costRemovedFrom;\n\t\t\t\t\t\t\tdouble toMoveCost = costAddedTo - costRemovedTo;\n\n\t\t\t\t\t\t\t//If this move is the best found so far\n\t\t\t\t\t\t\tdouble moveCost = fromMoveCost+toMoveCost;\n\t\t\t\t\t\t\tif ((moveCost < bestMoveCost)&&(from == to || (s.routes.get(to).load + s.routes.get(from).customers.get(fromIndex).demand<=s.routes.get(to).capacity)))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//set the best cost equal to the cost of this solution\n\t\t\t\t\t\t\t\tbestMoveCost = moveCost;\n\n\t\t\t\t\t\t\t\t//store its characteristics\n\t\t\t\t\t\t\t\trm.positionOfRelocated = fromIndex;\n\t\t\t\t\t\t\t\trm.positionToBeInserted = afterIndex;\n\t\t\t\t\t\t\t\trm.toMoveCost = toMoveCost;\n\t\t\t\t\t\t\t\trm.fromMoveCost = fromMoveCost;\n\t\t\t\t\t\t\t\trm.fromRoute = from;\n\t\t\t\t\t\t\t\trm.toRoute = to;\n\t\t\t\t\t\t\t\trm.moveCost = moveCost;\n\t\t\t\t\t\t\t\tif (from != to) {\n\t\t\t\t\t\t\t\t\trm.fromUpdLoad = s.routes.get(from).load - s.routes.get(from).customers.get(fromIndex).demand;\n\t\t\t\t\t\t\t\t\trm.toUpdLoad = s.routes.get(to).load + s.routes.get(from).customers.get(fromIndex).demand;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\trm.fromUpdLoad = s.routes.get(from).load;\n\t\t\t\t\t\t\t\t\trm.toUpdLoad = s.routes.get(to).load;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private int heuristic(int x, int y, MapLocation goal) {\n return Math.max(Math.abs(x - goal.x), Math.abs(y - goal.y));\n }", "private static int getHeuristic(MazeState current, HashSet<MazeState> goals) {\n\t\tint lowestCost = Integer.MAX_VALUE;\n\t\tint currentCost = 0;\n\t\tfor (MazeState goal : goals) {\n\t\t\tcurrentCost = Math.abs(current.col - goal.col) + Math.abs(current.row - goal.row);\n\t\t\tif (currentCost <= lowestCost) {\n\t\t\t\tlowestCost = currentCost;\n\t\t\t}\n\t\t}\n\t\treturn currentCost;\n\t}", "int findAugmentingPath() {\n while ((!this.eligibleS.isEmpty()) || (!this.eligibleT.isEmpty())) {\n if (!this.eligibleS.isEmpty()) {\n int i = this.eligibleS.get(this.eligibleS.size() - 1).intValue();\n this.eligibleS.remove(this.eligibleS.size() - 1);\n for (int j = 0; j < this.m; j++) {\n // If pi[j] has already been decreased essentially\n // to zero, then j is already labeled, and we\n // can't decrease pi[j] any more. Omitting the\n // pi[j] >= TOL check could lead us to relabel j\n // unnecessarily, since the diff we compute on the\n // next line may end up being less than pi[j] due\n // to floating point imprecision.\n if ((this.tMatches[j] != i) && (this.pi[j] >= TOL)) {\n double diff = this.u[i] + this.v[j] - this.weights[i][j];\n if (diff < this.pi[j]) {\n this.tLabels[j] = i;\n this.pi[j] = diff;\n if (this.pi[j] < TOL) {\n this.eligibleT.add(j);\n }\n }\n }\n }\n }\n else {\n int j = this.eligibleT.get(this.eligibleT.size() - 1).intValue();\n this.eligibleT.remove(this.eligibleT.size() - 1);\n if (this.tMatches[j] == -1) {\n return j; // we've found an augmenting path\n }\n\n int i = this.tMatches[j];\n this.sLabels[i] = j;\n this.eligibleS.add(i); // ok to add twice\n }\n }\n\n return -1;\n }", "@Override\n\tpublic void solve() {\n\t\tlong startTime = System.nanoTime();\n\n\t\twhile(!unvisitedPM.isEmpty()){\n\t\t\tProblemModel current = findCheapestNode();\n\t\n\t\t\tfor(ProblemModel pm : current.getSubNodes()){\n\t\t\n\t\t\t\tif(!visited.contains(pm) && !unvisitedPM.contains(pm)){\n\t\t\t\t\t\n\t\t\t\t\tunvisitedPM.add(pm);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(current.getSideStart().isEmpty()){\n\t\t\t\tSystem.out.print( \"\\n\"+ \"StartSide Runners: \");\n\t\t\t\tfor(Integer r: current.getSideStart()){\n\t\t\t\t\tSystem.out.print( \" \" +r) ;\n\t\t\t\t}\n\t\t\t\tSystem.out.print( \"\\n\" + \"EndSide Runners: \");\n\t\t\t\tfor(Integer r: current.getSideEnd()){\n\t\t\t\t\tSystem.out.print( \" \" + r);\n\t\t\t\t}\n\n\t\t\t\tprintPathTaken(current);\n\t\t\t\tSystem.out.print( \"\\n\" + \"------------done--------------\");\n\t\t\t\tlong endTime = System.nanoTime();\n\t\t\t\tlong duration = ((endTime - startTime)/1000000);\n\t\t\t\tSystem.out.print( \"\\n\" + \"-AS1 Time taken: \" + duration + \"ms\");\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tvisited.add(current);\n\t\t\n\t\t}\n\t\t\n\n\t}", "public abstract double getHeuristic(State state);", "private Suggestion getBestLinearization(List<String> linearizations,\n Interpretation interpretation,\n Map<String, WordType> originalWords, boolean matchAllWords) {\n\n Suggestion best = null;\n\n for (String current : linearizations) {\n Suggestion suggestion = buildSuggestion(\n current, interpretation,\n originalWords, matchAllWords);\n\n if (suggestion != null) {\n if (best == null) {\n best = suggestion;\n }\n else {\n if (suggestionComparator.compare(best, suggestion) > 0) {\n best = suggestion;\n }\n }\n }\n }\n\n return best;\n }", "public static AbstractStrategy lastConflict(Solver SOLVER) {\n return lastConflict(SOLVER, SOLVER.getStrategy());\n }", "private void updateSingles(Hierarchy con, ViolatedCandidate lCandidate, ViolatedCandidate tCandidate,\n double delta) {\n Multiset<Constraint> targetPreferringView = UpdateUtils.getViolatedByLearner(lCandidate, tCandidate);\n Multiset<Constraint> learnerPreferringView = UpdateUtils.getViolatedByTarget(lCandidate, tCandidate);\n Multiset<Constraint> learnerPreferringHigh = HashMultiset.create(learnerPreferringView.size());\n double promoteWeightedDelta = delta / targetPreferringView.size();\n double maxTPreferringRanking = Double.MIN_VALUE;\n for (Constraint constraint : targetPreferringView.elementSet()) {\n maxTPreferringRanking = Math.max(maxTPreferringRanking, con.getRanking(constraint));\n double multipliedDelta = (targetPreferringView.count(constraint) * promoteWeightedDelta);\n con.changeConstraintRanking(constraint, multipliedDelta);\n }\n\n for (Constraint constraint : learnerPreferringView.elementSet()) {\n double thisRanking = con.getRanking(constraint);\n if (thisRanking > maxTPreferringRanking) {\n int count = learnerPreferringView.count(constraint);\n learnerPreferringHigh.add(constraint, count);\n }\n }\n // If 'higher' set is empty, just add argMax to it\n if (learnerPreferringHigh.isEmpty()) {\n Constraint argMax = UpdateUtils.getMax(learnerPreferringView, con);\n learnerPreferringHigh.add(argMax);\n }\n\n Multiset<Constraint> toIterateOver = learnerPreferringHigh;\n\n double demoteWeightedDelta = -(delta / toIterateOver.size());\n for (Constraint constraint : toIterateOver.elementSet()) {\n double multipliedDelta = toIterateOver.count(constraint) * demoteWeightedDelta;\n con.changeConstraintRanking(constraint, multipliedDelta);\n // System.out.println(\"↓ Updating \" + constraint +\" by \" +\n // multipliedDelta);\n }\n }", "public List<Graph> search() {\n\n long start = System.currentTimeMillis();\n TetradLogger.getInstance().log(\"info\", \"Starting ION Search.\");\n logGraphs(\"\\nInitial Pags: \", this.input);\n TetradLogger.getInstance().log(\"info\", \"Transfering local information.\");\n long steps = System.currentTimeMillis();\n\n /*\n * Step 1 - Create the empty graph\n */\n List<Node> varNodes = new ArrayList<>();\n for (String varName : variables) {\n varNodes.add(new GraphNode(varName));\n }\n Graph graph = new EdgeListGraph(varNodes);\n\n /*\n * Step 2 - Transfer local information from the PAGs (adjacencies\n * and edge orientations)\n */\n // transfers edges from each graph and finds definite noncolliders\n transferLocal(graph);\n // adds edges for variables never jointly measured\n for (NodePair pair : nonIntersection(graph)) {\n graph.addEdge(new Edge(pair.getFirst(), pair.getSecond(), Endpoint.CIRCLE, Endpoint.CIRCLE));\n }\n TetradLogger.getInstance().log(\"info\", \"Steps 1-2: \" + (System.currentTimeMillis() - steps) / 1000. + \"s\");\n System.out.println(\"step2\");\n System.out.println(graph);\n\n /*\n * Step 3\n *\n * Branch and prune step that blocks problematic undirectedPaths, possibly d-connecting undirectedPaths\n */\n steps = System.currentTimeMillis();\n Queue<Graph> searchPags = new LinkedList<>();\n // place graph constructed in step 2 into the queue\n searchPags.offer(graph);\n // get d-separations and d-connections\n List<Set<IonIndependenceFacts>> sepAndAssoc = findSepAndAssoc(graph);\n this.separations = sepAndAssoc.get(0);\n this.associations = sepAndAssoc.get(1);\n Map<Collection<Node>, List<PossibleDConnectingPath>> paths;\n// Queue<Graph> step3PagsSet = new LinkedList<Graph>();\n HashSet<Graph> step3PagsSet = new HashSet<>();\n Set<Graph> reject = new HashSet<>();\n // if no d-separations, nothing left to search\n if (separations.isEmpty()) {\n // makes orientations preventing definite noncolliders from becoming colliders\n // do final orientations\n// doFinalOrientation(graph);\n step3PagsSet.add(graph);\n }\n // sets length to iterate once if search over path lengths not enabled, otherwise set to 2\n int numNodes = graph.getNumNodes();\n int pl = numNodes - 1;\n if (pathLengthSearch) {\n pl = 2;\n }\n // iterates over path length, then adjacencies\n for (int l = pl; l < numNodes; l++) {\n if (pathLengthSearch) {\n TetradLogger.getInstance().log(\"info\", \"Braching over path lengths: \" + l + \" of \" + (numNodes - 1));\n }\n int seps = separations.size();\n int currentSep = 1;\n int numAdjacencies = separations.size();\n for (IonIndependenceFacts fact : separations) {\n if (adjacencySearch) {\n TetradLogger.getInstance().log(\"info\", \"Braching over path nonadjacencies: \" + currentSep + \" of \" + numAdjacencies);\n }\n seps--;\n // uses two queues to keep up with which PAGs are being iterated and which have been\n // accepted to be iterated over in the next iteration of the above for loop\n searchPags.addAll(step3PagsSet);\n recGraphs.add(searchPags.size());\n step3PagsSet.clear();\n while (!searchPags.isEmpty()) {\n System.out.println(\"ION Step 3 size: \" + searchPags.size());\n double currentUsage = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();\n if (currentUsage > maxMemory) maxMemory = currentUsage;\n // deques first PAG from searchPags\n Graph pag = searchPags.poll();\n // Part 3.a - finds possibly d-connecting undirectedPaths between each pair of nodes\n // known to be d-separated\n List<PossibleDConnectingPath> dConnections = new ArrayList<>();\n // checks to see if looping over adjacencies\n if (adjacencySearch) {\n for (Collection<Node> conditions : fact.getZ()) {\n // checks to see if looping over path lengths\n if (pathLengthSearch) {\n dConnections.addAll(PossibleDConnectingPath.findDConnectingPathsOfLength\n (pag, fact.getX(), fact.getY(), conditions, l));\n } else {\n dConnections.addAll(PossibleDConnectingPath.findDConnectingPaths\n (pag, fact.getX(), fact.getY(), conditions));\n }\n }\n } else {\n for (IonIndependenceFacts allfact : separations) {\n for (Collection<Node> conditions : allfact.getZ()) {\n // checks to see if looping over path lengths\n if (pathLengthSearch) {\n dConnections.addAll(PossibleDConnectingPath.findDConnectingPathsOfLength\n (pag, allfact.getX(), allfact.getY(), conditions, l));\n } else {\n dConnections.addAll(PossibleDConnectingPath.findDConnectingPaths\n (pag, allfact.getX(), allfact.getY(), conditions));\n }\n }\n }\n }\n // accept PAG go to next PAG if no possibly d-connecting undirectedPaths\n if (dConnections.isEmpty()) {\n// doFinalOrientation(pag);\n// Graph p = screenForKnowledge(pag);\n// if (p != null) step3PagsSet.add(p);\n step3PagsSet.add(pag);\n continue;\n }\n // maps conditioning sets to list of possibly d-connecting undirectedPaths\n paths = new HashMap<>();\n for (PossibleDConnectingPath path : dConnections) {\n List<PossibleDConnectingPath> p = paths.get(path.getConditions());\n if (p == null) {\n p = new LinkedList<>();\n }\n p.add(path);\n paths.put(path.getConditions(), p);\n }\n // Part 3.b - finds minimal graphical changes to block possibly d-connecting undirectedPaths\n List<Set<GraphChange>> possibleChanges = new ArrayList<>();\n for (Set<GraphChange> changes : findChanges(paths)) {\n Set<GraphChange> newChanges = new HashSet<>();\n for (GraphChange gc : changes) {\n boolean okay = true;\n for (Triple collider : gc.getColliders()) {\n\n if (pag.isUnderlineTriple(collider.getX(), collider.getY(), collider.getZ())) {\n okay = false;\n break;\n }\n\n }\n if (!okay) {\n continue;\n }\n for (Triple collider : gc.getNoncolliders()) {\n if (pag.isDefCollider(collider.getX(), collider.getY(), collider.getZ())) {\n okay = false;\n break;\n }\n }\n if (okay) {\n newChanges.add(gc);\n }\n }\n if (!newChanges.isEmpty()) {\n possibleChanges.add(newChanges);\n } else {\n possibleChanges.clear();\n break;\n }\n }\n float starthitset = System.currentTimeMillis();\n Collection<GraphChange> hittingSets = IonHittingSet.findHittingSet(possibleChanges);\n recHitTimes.add((System.currentTimeMillis() - starthitset) / 1000.);\n // Part 3.c - checks the newly constructed graphs from 3.b and rejects those that\n // cycles or produce independencies known not to occur from the input PAGs or\n // include undirectedPaths from definite nonancestors\n for (GraphChange gc : hittingSets) {\n boolean badhittingset = false;\n for (Edge edge : gc.getRemoves()) {\n Node node1 = edge.getNode1();\n Node node2 = edge.getNode2();\n Set<Triple> triples = new HashSet<>();\n triples.addAll(gc.getColliders());\n triples.addAll(gc.getNoncolliders());\n if (triples.size() != (gc.getColliders().size() + gc.getNoncolliders().size())) {\n badhittingset = true;\n break;\n }\n for (Triple triple : triples) {\n if (node1.equals(triple.getY())) {\n if (node2.equals(triple.getX()) ||\n node2.equals(triple.getZ())) {\n badhittingset = true;\n break;\n }\n }\n if (node2.equals(triple.getY())) {\n if (node1.equals(triple.getX()) ||\n node1.equals(triple.getZ())) {\n badhittingset = true;\n break;\n }\n }\n }\n if (badhittingset) {\n break;\n }\n for (NodePair pair : gc.getOrients()) {\n if ((node1.equals(pair.getFirst()) && node2.equals(pair.getSecond())) ||\n (node2.equals(pair.getFirst()) && node1.equals(pair.getSecond()))) {\n badhittingset = true;\n break;\n }\n }\n if (badhittingset) {\n break;\n }\n }\n if (!badhittingset) {\n for (NodePair pair : gc.getOrients()) {\n for (Triple triple : gc.getNoncolliders()) {\n if (pair.getSecond().equals(triple.getY())) {\n if (pair.getFirst().equals(triple.getX()) &&\n pag.getEndpoint(triple.getZ(), triple.getY()).equals(Endpoint.ARROW)) {\n badhittingset = true;\n break;\n\n }\n if (pair.getFirst().equals(triple.getZ()) &&\n pag.getEndpoint(triple.getX(), triple.getY()).equals(Endpoint.ARROW)) {\n badhittingset = true;\n break;\n }\n }\n if (badhittingset) {\n break;\n }\n }\n if (badhittingset) {\n break;\n }\n }\n }\n if (badhittingset) {\n continue;\n }\n Graph changed = gc.applyTo(pag);\n // if graph change has already been rejected move on to next graph\n if (reject.contains(changed)) {\n continue;\n }\n // if graph change has already been accepted move on to next graph\n if (step3PagsSet.contains(changed)) {\n continue;\n }\n // reject if null, predicts false independencies or has cycle\n if (predictsFalseIndependence(associations, changed)\n || changed.existsDirectedCycle()) {\n reject.add(changed);\n }\n // makes orientations preventing definite noncolliders from becoming colliders\n // do final orientations\n// doFinalOrientation(changed);\n // now add graph to queue\n\n// Graph p = screenForKnowledge(changed);\n// if (p != null) step3PagsSet.add(p);\n step3PagsSet.add(changed);\n }\n }\n // exits loop if not looping over adjacencies\n if (!adjacencySearch) {\n break;\n }\n }\n }\n TetradLogger.getInstance().log(\"info\", \"Step 3: \" + (System.currentTimeMillis() - steps) / 1000. + \"s\");\n Queue<Graph> step3Pags = new LinkedList<>(step3PagsSet);\n\n /*\n * Step 4\n *\n * Finds redundant undirectedPaths and uses this information to expand the list\n * of possible graphs\n */\n steps = System.currentTimeMillis();\n Map<Edge, Boolean> necEdges;\n Set<Graph> outputPags = new HashSet<>();\n\n while (!step3Pags.isEmpty()) {\n Graph pag = step3Pags.poll();\n necEdges = new HashMap<>();\n // Step 4.a - if x and y are known to be unconditionally associated and there is\n // exactly one trek between them, mark each edge on that trek as necessary and\n // make the tiples on the trek definite noncolliders\n // initially mark each edge as not necessary\n for (Edge edge : pag.getEdges()) {\n necEdges.put(edge, false);\n }\n // look for unconditional associations\n for (IonIndependenceFacts fact : associations) {\n for (List<Node> nodes : fact.getZ()) {\n if (nodes.isEmpty()) {\n List<List<Node>> treks = treks(pag, fact.x, fact.y);\n if (treks.size() == 1) {\n List<Node> trek = treks.get(0);\n List<Triple> triples = new ArrayList<>();\n for (int i = 1; i < trek.size(); i++) {\n // marks each edge in trek as necessary\n necEdges.put(pag.getEdge(trek.get(i - 1), trek.get(i)), true);\n if (i == 1) {\n continue;\n }\n // makes each triple a noncollider\n pag.addUnderlineTriple(trek.get(i - 2), trek.get(i - 1), trek.get(i));\n }\n }\n // stop looping once the empty set is found\n break;\n }\n }\n }\n // Part 4.b - branches by generating graphs for every combination of removing\n // redundant undirectedPaths\n boolean elimTreks;\n // checks to see if removing redundant undirectedPaths eliminates every trek between\n // two variables known to be nconditionally assoicated\n List<Graph> possRemovePags = possRemove(pag, necEdges);\n double currentUsage = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();\n if (currentUsage > maxMemory) maxMemory = currentUsage;\n for (Graph newPag : possRemovePags) {\n elimTreks = false;\n // looks for unconditional associations\n for (IonIndependenceFacts fact : associations) {\n for (List<Node> nodes : fact.getZ()) {\n if (nodes.isEmpty()) {\n if (treks(newPag, fact.x, fact.y).isEmpty()) {\n elimTreks = true;\n }\n // stop looping once the empty set is found\n break;\n }\n }\n }\n // add new PAG to output unless a necessary trek has been eliminated\n if (!elimTreks) {\n outputPags.add(newPag);\n }\n }\n }\n outputPags = removeMoreSpecific(outputPags);\n// outputPags = applyKnowledge(outputPags);\n\n TetradLogger.getInstance().log(\"info\", \"Step 4: \" + (System.currentTimeMillis() - steps) / 1000. + \"s\");\n\n /*\n * Step 5\n *\n * Generate the Markov equivalence classes for graphs and accept only\n * those that do not predict false d-separations\n */\n steps = System.currentTimeMillis();\n Set<Graph> outputSet = new HashSet<>();\n for (Graph pag : outputPags) {\n Set<Triple> unshieldedPossibleColliders = new HashSet<>();\n for (Triple triple : getPossibleTriples(pag)) {\n if (!pag.isAdjacentTo(triple.getX(), triple.getZ())) {\n unshieldedPossibleColliders.add(triple);\n }\n }\n\n PowerSet<Triple> pset = new PowerSet<>(unshieldedPossibleColliders);\n for (Set<Triple> set : pset) {\n Graph newGraph = new EdgeListGraph(pag);\n for (Triple triple : set) {\n newGraph.setEndpoint(triple.getX(), triple.getY(), Endpoint.ARROW);\n newGraph.setEndpoint(triple.getZ(), triple.getY(), Endpoint.ARROW);\n }\n doFinalOrientation(newGraph);\n }\n for (Graph outputPag : finalResult) {\n if (!predictsFalseIndependence(associations, outputPag)) {\n Set<Triple> underlineTriples = new HashSet<>(outputPag.getUnderLines());\n for (Triple triple : underlineTriples) {\n outputPag.removeUnderlineTriple(triple.getX(), triple.getY(), triple.getZ());\n }\n outputSet.add(outputPag);\n }\n }\n }\n\n// outputSet = applyKnowledge(outputSet);\n outputSet = checkPaths(outputSet);\n\n output.addAll(outputSet);\n TetradLogger.getInstance().log(\"info\", \"Step 5: \" + (System.currentTimeMillis() - steps) / 1000. + \"s\");\n runtime = ((System.currentTimeMillis() - start) / 1000.);\n logGraphs(\"\\nReturning output (\" + output.size() + \" Graphs):\", output);\n double currentUsage = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();\n if (currentUsage > maxMemory) maxMemory = currentUsage;\n return output;\n }", "public Solver(Board initial) {\r\n this.board = initial;\r\n\r\n final Comparator<SearchNode> solverComparator = new Comparator<SearchNode>() {\r\n @Override\r\n public int compare(SearchNode o1, SearchNode o2) {\r\n return o1.weight() - o2.weight();\r\n }\r\n };\r\n MinPQ<SearchNode> pq = new MinPQ<SearchNode>(solverComparator);\r\n MinPQ<SearchNode> twinPq = new MinPQ<SearchNode>(solverComparator);\r\n\r\n pq.insert(new SearchNode(board, null, 0));\r\n twinPq.insert(new SearchNode(board.twin(), null, 0));\r\n do {\r\n SearchNode current = pq.delMin();\r\n SearchNode twin = twinPq.delMin();\r\n\r\n //solution.enqueue(current.getBoard());\r\n if (!current.getBoard().isGoal()) {\r\n for (Board neighbour : current.getBoard().neighbors()) {\r\n if (current.getParent() == null || current.getParent() != null && !neighbour.equals(current.getParent().getBoard())) {\r\n pq.insert(new SearchNode(neighbour, current, current.moves() + 1));\r\n }\r\n }\r\n } else {\r\n solution = new LinkedStack<Board>();\r\n SearchNode node = current;\r\n while (node != null) {\r\n solution.push(node.getBoard());\r\n node = node.getParent();\r\n }\r\n break;\r\n }\r\n\r\n if (!twin.getBoard().isGoal()) {\r\n for (Board neighbour : twin.getBoard().neighbors()) {\r\n if (twin.getParent() == null || twin.getParent() != null && !neighbour.equals(twin.getParent().getBoard())) {\r\n twinPq.insert(new SearchNode(neighbour, twin, twin.moves() + 1));\r\n }\r\n }\r\n } else {\r\n break;\r\n }\r\n } while (!pq.isEmpty() || !twinPq.isEmpty());\r\n }", "protected void foundGoal( Path pathToGoal ) {\n\t\t/* A dummy implementation that does nothing with this\n\t\t exciting news. */\n\t}", "public double heuristic(game Game){\n // int l[] = {0,1};\n // board b = Game.getBoard();\n // tic smallBoard = b.getState(l); \n \n /* if O wins the game */\n if(Game.getState() == 2){return 99;}\n \n /* X wins the game */\n if(Game.getState() == 1){return -99;}\n \n return 0;\n }", "public void findSolution() {\n\t\tif (lenA > lenB) {\n\t\t\toptPairs = new String[lenB];\n\t\t} else {\n\t\t\toptPairs = new String[lenA];\n\t\t}\n\n\t\tint counter = 0;\n\t\tint i = lenA;\n\t\tint j = lenB;\n\n\t\twhile(i>0 && j>0) {\n\t\t\tif (optArray[i][j] == g+optArray[i-1][j]) {\n\t\t\t\ti--;\n\t\t\t}\n\t\t\telse if (optArray[i][j] == g+optArray[i][j-1]) {\n\t\t\t\tj--;\n\t\t\t}\n\t\t\telse {\n\t\t\t\toptPairs[counter] = i + \" \" + j;\n\t\t\t\tcounter++;\n\t\t\t\ti--;\n\t\t\t\tj--;\n\t\t\t}\n\t\t}\n\n\t\tpairNum = counter;\n\n\t}", "public void conflict(Object arg0) {\n\n\t}", "private void applyLocationAlgorithms() {\n List<NodeState> states = new ArrayList<NodeState>();\n List<RemoteNode> nodes = new ArrayList<RemoteNode>(nodeManager.getNodes());\n AlgorithmMatchCriteria criteria;\n\n for (Algorithm la : algorithmManager.getAlgorithms()) {\n if (!la.isEnabled()) continue;\n criteria = algorithmManager.getCriteria(la);\n\n List<Node> filteredNodes = criteria.filter(nodes);\n if (filteredNodes.size() > 0) {\n states.add(la.applyTo(nodeManager.getLocalNode(), filteredNodes));\n }\n }\n for (NodeState s : states) {\n nodeManager.getLocalNode().addPending(s);\n }\n }", "private void locateBestMatch(int queryStartIdx){\n \n double dist;\n double bsfDist = Double.MAX_VALUE;\n int bsfIdx = -1;\n\n double[] query = zNormalise(series, queryStartIdx, this.windowSize, false);\n double[] comparison;\n\n for(int comparisonStartIdx = 0; comparisonStartIdx <= seriesLength-windowSize; comparisonStartIdx+=stride){\n \n // exclusion zone +/- windowSize/2 around the window\n if(comparisonStartIdx >= queryStartIdx-windowSize*1.5 && comparisonStartIdx <= queryStartIdx+windowSize*1.5){\n continue;\n }\n \n // using a bespoke version of this, rather than the shapelet version, for efficiency - see notes with method\n comparison = zNormalise(series, comparisonStartIdx, windowSize, false);\n dist = 0;\n\n for(int j = 0; j < windowSize;j++){\n dist += (query[j]-comparison[j])*(query[j]-comparison[j]);\n if(dist > bsfDist){\n dist = Double.MAX_VALUE;\n break;\n }\n }\n\n if(dist < bsfDist){\n bsfDist = dist;\n bsfIdx = comparisonStartIdx;\n }\n\n }\n \n this.distances[queryStartIdx] = bsfDist;\n this.indices[queryStartIdx] = bsfIdx;\n }", "static double removeHeuristic2(GameState c, boolean isMaxNode) {\n\t\treturn addHeuristic4(c, isMaxNode);\n\t}", "public int heuristic()\n {\n if (this.heuristic != Integer.MIN_VALUE)\n return this.heuristic;\n this.heuristic = 0;\n if (!this.safe)\n return 0;\n // End game bonus\n int bonus = this.d.size() * Math.max(0, (this.L - 3 * this.b.shots)) * 3;\n this.heuristic = (this.d.size() * 100) + (this.NE * 10) + bonus;\n // value:\n return this.heuristic;\n }", "public void findTrack() {\n for (Node n : start_node.getLinks()) {\n precedenti.put(n, start_node);\n valori.put(n, calculator.calcDistance(n, start_node));\n }\n while (!da_collegare.isEmpty()) {\n Node piu_vicino = null;\n double min = Double.MAX_VALUE;\n for (Node n : da_collegare) {\n double dist = valori.get(n);\n if (dist - min < THRESHOLD) {\n min = dist;\n piu_vicino = n;\n }\n }\n double dist = valori.get(piu_vicino);\n for (Node n : piu_vicino.getLinks()) {\n double ricalc = dist + calculator.calcDistance(n, piu_vicino);\n if (ricalc - valori.get(n) < THRESHOLD) {\n precedenti.put(n, piu_vicino);\n valori.put(n, ricalc);\n }\n }\n da_collegare.remove(piu_vicino);\n }\n }", "@Override\n public Variable useHeuristic(Deque<Variable> deque) {\n Variable highDomain = deque.getFirst();\n for (Variable var : deque){\n if (var.getDomain().size() > highDomain.getDomain().size()){\n highDomain = var;\n }\n }\n return highDomain;\n }", "private void findPath2(List<Coordinate> path) {\n List<Integer> cost = new ArrayList<>(); // store the total cost of each path\n // store all possible sequences of way points\n ArrayList<List<Coordinate>> allSorts = new ArrayList<>();\n int[] index = new int[waypointCells.size()];\n for (int i = 0; i < index.length; i++) {// generate the index reference list\n index[i] = i;\n }\n permutation(index, 0, index.length - 1);\n for (Coordinate o1 : originCells) {\n for (Coordinate d1 : destCells) {\n for (int[] ints1 : allOrderSorts) {\n List<Coordinate> temp = getOneSort(ints1, waypointCells);\n temp.add(0, o1);\n temp.add(d1);\n int tempCost = 0;\n for (int i = 0; i < temp.size() - 1; i++) {\n Graph graph = new Graph(getEdge(map));\n Coordinate start = temp.get(i);\n graph.dijkstra(start);\n Coordinate end = temp.get(i + 1);\n graph.printPath(end);\n tempCost = tempCost + graph.getPathCost(end);\n if (graph.getPathCost(end) == Integer.MAX_VALUE) {\n tempCost = Integer.MAX_VALUE;\n break;\n }\n }\n cost.add(tempCost);\n allSorts.add(temp);\n }\n }\n }\n System.out.println(\"All sorts now have <\" + allSorts.size() + \"> items.\");\n List<Coordinate> best = allSorts.get(getMinIndex(cost));\n generatePath(best, path);\n setSuccess(path);\n }", "public MapLocation findNearestAction() {\n MapLocation origin = rc.getLocation();\n MapLocation nearestHelp = findNearestHelp();\n MapLocation nearestArchon = findNearestArchon();\n\n if (nearestArchon == null && nearestHelp == null) {\n return rc.getInitialArchonLocations(rc.getTeam().opponent())[0]; // when no target is known, go to enemy archon initial position\n } else if (nearestArchon == null) { // when some of the targets is not present, just return the other one\n return nearestHelp; // is not null\n } else if (nearestHelp == null) {\n return nearestArchon; // is not null\n }\n\n if (origin.distanceSquaredTo(nearestHelp) < origin.distanceSquaredTo(nearestArchon)) {\n return nearestHelp;\n } else {\n return nearestArchon;\n }\n }" ]
[ "0.5803704", "0.5674495", "0.56615466", "0.56404454", "0.5595784", "0.5538583", "0.55328065", "0.5521278", "0.5519174", "0.5475558", "0.5448433", "0.5442656", "0.5394064", "0.53936714", "0.53917956", "0.5371264", "0.5364015", "0.5363394", "0.53520894", "0.53278446", "0.5291471", "0.5278499", "0.52672917", "0.5265015", "0.5255939", "0.5248777", "0.5244748", "0.52406603", "0.5231855", "0.5223723", "0.5217445", "0.5212785", "0.52009094", "0.5195824", "0.5189041", "0.5175367", "0.51587534", "0.5152975", "0.51422757", "0.51259667", "0.5120107", "0.5119924", "0.5116484", "0.5114139", "0.5112984", "0.5109583", "0.5105819", "0.51050776", "0.5092088", "0.5082245", "0.5067492", "0.5064874", "0.5053681", "0.5042321", "0.5040583", "0.502563", "0.5025252", "0.5022762", "0.5002551", "0.5001358", "0.4994276", "0.49917233", "0.4988248", "0.49841878", "0.4976104", "0.497315", "0.49566445", "0.49522018", "0.49517173", "0.49469942", "0.4946893", "0.49457368", "0.49407363", "0.49390164", "0.4932547", "0.49311113", "0.49257866", "0.49221587", "0.49209473", "0.49174267", "0.4916819", "0.49091128", "0.49087095", "0.49081293", "0.49028957", "0.48963138", "0.48927993", "0.48921221", "0.4888396", "0.4877802", "0.4874722", "0.48736084", "0.48674235", "0.48646116", "0.48630401", "0.48628435", "0.48519263", "0.48499134", "0.48485225", "0.48435682" ]
0.5524736
7
Use the last conflict heuristic as a pluggin to improve a former search heuristic STRAT Considers the K last conflicts
public static AbstractStrategy lastKConflicts(Solver SOLVER, int K, AbstractStrategy STRAT) { return new LastConflict(SOLVER, STRAT, K); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static AbstractStrategy lastConflict(Solver SOLVER, AbstractStrategy STRAT) {\n return lastKConflicts(SOLVER, 1, STRAT);\n }", "private static LinkedList<Integer> localSearch2Opt(File fileNameWithPath, int kNeighborHood ) throws Exception{\n\t\t\n\t\tString traceString = \"\";\n\t\tdouble bestCost = Double.POSITIVE_INFINITY;\n\t\tLinkedList<Integer> bestTspList = null;\n\t\tdouble bestCycleTime = Double.POSITIVE_INFINITY;\n\n\t\tif (Project.runId == -1 )\n\t\t\tProject.runId = 1;\n\n\t\t/* \n\t\t * read the file and build the cost table\n\t\t */\n parseEdges(fileNameWithPath);\n\n /*\n\t\t * time starts once you read the data\n */\n\t\tdouble baseTime = System.nanoTime();\n\n\t\t/*\n\t\t * invoking furthest insertion algorithm to get the tsp\n\t\t */\n\t\tlong startNodeSeed = (long)(1000.0*generator.nextDouble());\n\t\tLinkedList<Integer> currentTspList = FurthestInsertion.generateTSP(Project.sourceGTree,startNodeSeed);\n\t\t\n\t\tdouble currentTspCost = tspCost(currentTspList);\n\n\t\tbestTspList = currentTspList;\n\t\tbestCost = currentTspCost;\n\t\tbestCycleTime = System.nanoTime() - baseTime;\n\n\t\t/* print the trace file */\n\t\ttraceString = String.format(\"%.2f, %d\",Math.round(((System.nanoTime()-baseTime)/nanosecs)*100.0)/100.0,Math.round(bestCost));\n\t\tprintTrace(runId,traceString);\n\n\t\t/*\n\t\t * remove the last node as it matches the first\n\t\t */\n\t\tcurrentTspList.removeLast();\n\n\t\twhile ( true )\n\t\t{\n\t\t\t/*\n\t\t\t * reached cutoff time\n\t\t\t */\n\t\t\tif ( System.nanoTime()-baseTime >= Project.cutoffTimeSeconds*nanosecs ) {\n\t\t\t\ttimedOut=true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tdouble cycleStartTime = System.nanoTime();\n\n\t\t\tLinkedList<Integer> newTspList = currentTspList;\n\n\t\t\t/* do a 2 opt search in current k=5 neighborhood to get a newtsp */\n\t\t\t/* 1. Pick the first random element in the current tsp */\n\t\t\tint element2 = (int)((double)(newTspList.size()-1) * generator.nextDouble());\n\t\t\tint element1 = element2 - 1;\n\t\t\tif ( element1 == -1 ){\n\t\t\t\telement1 = newTspList.size()-1;\n\t\t\t}\n\t\t\t\n int delta;\n\n\t\t\t/*\n\t\t\t * search in the neighborhood specified\n * if not specified search all\n\t\t\t */\n if ( kNeighborHood != -1 ) {\n\t\t\t /* We want to search in the specified k=n neighborhoods of element1 */\n\t\t\t delta= (int)(2*kNeighborHood*generator.nextDouble()) - kNeighborHood;\n } else {\n\t\t\t delta= (int)((newTspList.size()-1)*generator.nextDouble()) - (int)(newTspList.size()/2);\n\t\t\t}\n\n\t\t\tif ( delta == 0 ) {\n\t\t\t\tdelta = 2;\n\t\t\t} else if ( delta == 1 ) {\n\t\t\t\tdelta = 2;\n\t\t\t} else if ( delta == -1) {\n\t\t\t\tdelta = -2; }\n\n\t\t\tint element4 = element2 + delta;\n\n\t\t\tif ( element4 < 0 ) {\n\t\t\t\telement4 = newTspList.size()+element4;\n\t\t\t}else if ( element4 >= newTspList.size() ) {\n\t\t\t\telement4 = element4-(newTspList.size()-1);\n\t\t\t}\n\n\t\t\tint element3 = element4 -1;\n\t\t\tif ( element3 == -1 ){\n\t\t\t\telement3 = newTspList.size()-1;\n\t\t\t}\n\n\n\t\t\t/* \n\t\t\t * the new tsp will have element2->element4.......element1->element3....\n\t\t\t */\n\t\t\tInteger vertex_3 = newTspList.get(element3);\n\t\t\tnewTspList.set(element3,newTspList.get(element2));\n\t\t\tnewTspList.set(element2,vertex_3);\n\n\t\t\t/*\n\t\t\t * from element2+1 to element3-1 swap to reverse their order\n\t\t\t */\n\t\t\twhile ( element2 < element3 ){\n\t\t\t\telement3 = element3-1;\n\t\t\t\tif ( element3 == -1 ) {\n\t\t\t\t\telement3 = newTspList.size()-1;\n\t\t\t\t}\n\n\t\t\t\telement2 = element2 + 1;\n\t\t\t\tif ( element2 == newTspList.size() ) {\n\t\t\t\t\telement3 = 0;\n\t\t\t\t}\n\n\t\t\t\tInteger tempVertex = newTspList.get(element2);\n\t\t\t\tnewTspList.set(element2,newTspList.get(element3));\n\t\t\t\tnewTspList.set(element3,tempVertex);\n\n\t\t\t}\n\n\t\t\tdouble newTspCost = tspCost(newTspList);\n\n\t\t\t/* if new local search solution is better than eariler take the search and continue search\n\t\t\t */\n\t\t\tif ( newTspCost <= currentTspCost ){\n\t\t\t\tcurrentTspList = newTspList;\n\t\t\t\tcurrentTspCost = newTspCost;\n\t\t\t} else {\n\t\t\t/* if new local search solution is not better than eariler \n\t\t\t */\n\t\t\t\tcontinue;\n\t\t\t}\n\t\n\t\t\t//Subtract the start time from the finish time to get the actual algorithm running time; divide by 10e6 to convert to milliseconds\n\t\t\tdouble cycleTime = (System.nanoTime()-cycleStartTime);\n\n\t\t\t/* first improvement , take the best each time */\n\t\t\tif ( newTspCost < bestCost ) {\n\t\t\t\tbestCost = newTspCost;\n\t\t\t\tbestTspList = newTspList;\n\t\t\t\tbestCycleTime = cycleTime;\n\t\t\t\t/* print the trace file */\n\t\t\t\ttraceString = String.format(\"%.2f, %d\",Math.round(((System.nanoTime()-baseTime)/nanosecs)*100.0)/100.0,Math.round(bestCost));\n\t\t\t\tappendToTraceFile(runId,traceString);\n\n\t\t\t\tif ( bestCost <= optimalCost )\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\n\t\t/* print the sol file */\n\t\tprintSol(runId,bestTspList,bestCost);\n\n\t\t/* print the tab results file */\n\t\tappendTabResults(runId,bestCycleTime,bestCost,bestTspList);\n\n\t\treturn bestTspList;\n\n\t}", "@Override\n public Matching solve() {\n while (!matching.freeElements().isEmpty()) {\n /* get first element from the queue */\n Element element = problem.element(matching.freeElements().poll().elemId());\n\n /* get its preference element: looping through its list => by the level value */\n while (!element.preferences().isEmpty()) {\n Element pref = problem.element(element.preferences().poll().elemId());\n\n /* check if is an acceptable partner for current preference */\n if (!pref.accepts(element)) {\n continue;\n }\n\n /* verify the availability of its current preference */\n if (problem.isAvailable(pref.elemId())) {\n problem.element(pref.elemId()).setAvailability(false);\n problem.element(element.elemId()).setAvailability(false);\n matching.addPair(new Pair(element, pref));\n break;\n }\n else {\n /* if the preference is already taken, get the best one between current element and its current match */\n String currMatchName = matching.getElementPair(pref);\n Element currentMatch = pref.getIndex(currMatchName);\n Element elem = pref.getIndex(element.elemId());\n\n /* when current element is better than the current match */\n if (currentMatch.level() > elem.level()){\n if (matching.isFree(elem))\n matching.removeFreeElement(elem);\n\n problem.element(pref.elemId()).setAvailability(false);\n problem.element(element.elemId()).setAvailability(false);\n problem.element(currentMatch.elemId()).setAvailability(true);\n\n /* add the current pair to the Matching and the old match for the woman to the free list */\n matching.addPair(new Pair(problem.element(element.elemId()), problem.element(pref.elemId())));\n\n matching.addFreeElement(problem.element(currMatchName));\n break;\n }\n else {\n matching.addPair(new Pair(currentMatch, pref));\n }\n }\n }\n /* when man was rejected by all its preferences */\n if (element.preferences().isEmpty())\n element.setAvailability(true);\n }\n problem.getSets().get(0).getElements().stream().filter(Element::isAvailable).forEach(Element::remakeList);\n problem.getSets().get(0).getElements().stream().filter(Element::isAvailable).forEach(element -> matching.addFreeElement(problem.element(element.elemId())));\n\n return matching;\n }", "private void findBestPath(){\n\t\t// The method will try to find the best path for every starting point and will use the minimum\n\t\tfor(int start = 0; start < this.getDimension(); start++){\n\t\t\tfindBestPath(start);\t\n\t\t}\t\n\t}", "private void computeConflicts() {\n\t\tthis.conflictGraph = new HashMap<Class, List<Class>>();\n\n\t\tfor (Class c : this.core) {\n\t\t\tif (c.getSuperClasses().size() >= 2) {\n\n\t\t\t\tList<List<Class>> linExts = new ArrayList<List<Class>>();\n\t\t\t\tfor (int i = 0; i < c.getSuperClasses().size(); i++) {\n\t\t\t\t\tlinExts.add(this.linearExts.get(c.getSuperClasses().get(i)));\n\t\t\t\t\tlinExts.get(i).add(c.getSuperClasses().get(i));\n\t\t\t\t}\n\n\t\t\t\tList<HashSet<Class>> diffs = new ArrayList<HashSet<Class>>();\n\n\t\t\t\t// Compute lini - linj for all i != j\n\t\t\t\tfor (List<Class> linExt : linExts) {\n\t\t\t\t\tfor (List<Class> linExt2 : linExts) {\n\t\t\t\t\t\tif (linExt != linExt2) {\n\t\t\t\t\t\t\tHashSet<Class> diff = new HashSet<Class>();\n\t\t\t\t\t\t\tfor (Class p : linExt2) {\n\t\t\t\t\t\t\t\tif (!linExt.contains(p))\n\t\t\t\t\t\t\t\t\tdiff.add(p);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdiffs.add(diff);\n\n\t\t\t\t\t\t\tdiff = new HashSet<Class>();\n\t\t\t\t\t\t\tfor (Class p : linExt) {\n\t\t\t\t\t\t\t\tif (!linExt2.contains(p))\n\t\t\t\t\t\t\t\t\tdiff.add(p);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdiffs.add(diff);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Compute conflicts di * dj for all j != i\n\t\t\t\tfor (HashSet<Class> diff : diffs) {\n\t\t\t\t\tfor (HashSet<Class> diff2 : diffs) {\n\t\t\t\t\t\tif (diff != diff2) {\n\t\t\t\t\t\t\tfor (Class c1 : diff) {\n\t\t\t\t\t\t\t\tList<Class> conflicts = new ArrayList<Class>();\n\t\t\t\t\t\t\t\tif (this.conflictGraph.containsKey(c1))\n\t\t\t\t\t\t\t\t\tconflicts = this.conflictGraph.get(c1);\n\n\t\t\t\t\t\t\t\tfor (Class c2 : diff2) {\n\t\t\t\t\t\t\t\t\tconflicts.add(c2);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis.conflictGraph.put(c1, conflicts);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\n public Matching stableMarriageGaleShapley_hospitaloptimal(Matching marriage) {\n int m = marriage.getHospitalCount();\n int n = marriage.getResidentCount();\n\n ArrayList<ArrayList<Integer>> hospital_preference = marriage.getHospitalPreference();\n ArrayList<ArrayList<Integer>> resident_preference = marriage.getResidentPreference();\n\n ArrayList<Integer> hospitalSlots = marriage.getHospitalSlots();\n\n ArrayList<Integer> residentMatching = new ArrayList<Integer>();\n arrlistInit(residentMatching, n, -1, false);\n\n /*list of residents that each hospital can propose to\n * Initially equals the hospital_preference list*/\n ArrayList<ArrayList<Integer>> residentsToProposeTo = new ArrayList<ArrayList<Integer>>();\n for (int i = 0; i < m; i++) //O(m)\n residentsToProposeTo.add(new ArrayList<Integer>(hospital_preference.get(i)));\n\n /*list of hospitals that still can propose(has free spots and hasn't proposed to every resident)*/\n ArrayList<Integer> proposing = new ArrayList<Integer>();\n arrlistInit(proposing, m, 0, true); //O(n)\n\n /*Keep track of each hospital matched residents*/\n ArrayList<ArrayList<Integer>> hospitalResidents = new ArrayList<ArrayList<Integer>>(0);\n for (int i = 0; i < m; i++) //O(m)\n hospitalResidents.add(new ArrayList<Integer>(0));\n\n /*Looping through each hospital in the proposing list\n * Even though some hospital may be added again in the proposing list, each hospital can propose at most once to each resident\n * So total running time of the loop will be O(m*n)*/\n while (!proposing.isEmpty()) {\n for (int hospitalIndex = 0; hospitalIndex < proposing.size(); hospitalIndex++) {\n /*Get the head of the proposing Arraylist*/\n int hospital = proposing.get(0);\n int residentIndex;\n int resident = 0;\n for (residentIndex = 0; residentIndex < residentsToProposeTo.get(hospital).size() && proposing.contains(hospital); hospitalIndex++) {\n /*Get the next resident the hospital hasn't proposed to yed*/\n resident = residentsToProposeTo.get(hospital).get(0);\n int hospitalRank = resident_preference.get(resident).indexOf(hospital);\n\n /*resident is matched, compare the hospitals rank*/\n if (residentMatching.get(resident) != -1) {\n int matchedHospital = residentMatching.get(resident);\n int matchedHospitalRank = resident_preference.get(resident).indexOf(matchedHospital);\n if (hospitalRank < matchedHospitalRank) {\n /*1.Add/remove to hospitalResidents\n * 2.Add in resident-matching\n * 3.Add matchedHospital to the proposing list if it's not in it\n */\n hospitalResidents.get(hospital).add(resident);\n hospitalResidents.get(matchedHospital).remove(hospitalResidents.get(matchedHospital).indexOf(resident));\n residentMatching.set(resident, hospital);\n if (!proposing.contains(matchedHospital))\n proposing.add(matchedHospital);\n\n }\n }\n /*resident is free, match with the hospital*/\n else {\n /*1.Add in hospitalResidents\n * 2.Add in resident-matching\n */\n hospitalResidents.get(hospital).add(resident);\n residentMatching.set(resident, hospital);\n }\n\n /*1.Remove resident from the hospital's list of residentsToProposeTo\n * 2.If hospital's slots are full, remove hospital from the proposing list\n */\n residentsToProposeTo.get(hospital).remove(residentsToProposeTo.get(hospital).indexOf(resident));\n if (hospitalResidents.get(hospital).size() >= hospitalSlots.get(hospital))\n proposing.remove(proposing.indexOf(hospital));\n }\n }\n }\n marriage.setResidentMatching(residentMatching);\n return marriage;\n }", "int findAugmentingPath() {\n while ((!this.eligibleS.isEmpty()) || (!this.eligibleT.isEmpty())) {\n if (!this.eligibleS.isEmpty()) {\n int i = this.eligibleS.get(this.eligibleS.size() - 1).intValue();\n this.eligibleS.remove(this.eligibleS.size() - 1);\n for (int j = 0; j < this.m; j++) {\n // If pi[j] has already been decreased essentially\n // to zero, then j is already labeled, and we\n // can't decrease pi[j] any more. Omitting the\n // pi[j] >= TOL check could lead us to relabel j\n // unnecessarily, since the diff we compute on the\n // next line may end up being less than pi[j] due\n // to floating point imprecision.\n if ((this.tMatches[j] != i) && (this.pi[j] >= TOL)) {\n double diff = this.u[i] + this.v[j] - this.weights[i][j];\n if (diff < this.pi[j]) {\n this.tLabels[j] = i;\n this.pi[j] = diff;\n if (this.pi[j] < TOL) {\n this.eligibleT.add(j);\n }\n }\n }\n }\n }\n else {\n int j = this.eligibleT.get(this.eligibleT.size() - 1).intValue();\n this.eligibleT.remove(this.eligibleT.size() - 1);\n if (this.tMatches[j] == -1) {\n return j; // we've found an augmenting path\n }\n\n int i = this.tMatches[j];\n this.sLabels[i] = j;\n this.eligibleS.add(i); // ok to add twice\n }\n }\n\n return -1;\n }", "private LineString pickBestGrowthPossibility3(final LineString stem, List<LineString> lookAheads) {\t\t\n\t\tif (lookAheads == null || lookAheads.size() == 0) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t//sort by:\n\t\t//1. is moving away?\n\t\t//2. number of coordinates in line\n\t\t//3. average elevation rise (above the lowest coord) divided by length of line\n\t\t// e..g if Z values of growth possibility are 618m, 625m, 634m, the average will be the average\n\t\t//Z above the lowest coord will be 7.6m. that value will be divided by the line length\n\t\tfinal AvgElevationSectionFitness avgElevationFitness = new AvgElevationSectionFitness(getTinEdges());\n\t\tComparator<LineString> lookAheadComparator = new Comparator<LineString>() {\n\t\t\tpublic int compare(LineString s1, LineString s2) {\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t//is end of extension moving away\n\t\t\t\tboolean m1 = LineGrowthHelpers.isMovingAway(stem, s1.getCoordinateN(s1.getNumPoints()-1));\n\t\t\t\tboolean m2 = LineGrowthHelpers.isMovingAway(stem, s2.getCoordinateN(s2.getNumPoints()-1));\n\t\t\t\tif (m1 != m2) {\n\t\t\t\t\treturn m1 ? -1 : 1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t//is start of extension moving away\n\t\t\t\t\tboolean a1 = LineGrowthHelpers.isMovingAway(stem, s1.getCoordinateN(1));\n\t\t\t\t\tboolean a2 = LineGrowthHelpers.isMovingAway(stem, s2.getCoordinateN(1));\n\t\t\t\t\tif (a1 != a2) {\n\t\t\t\t\t\treturn a1 ? -1 : 1;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\n\t\t\t\t\t\tif (s1.getNumPoints() == s2.getNumPoints()) {\n\t\t\t\t\t\t\ttry {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tdouble fit1 = (avgElevationFitness.fitness(s1) - s1.getCoordinateN(0).getZ()) / s1.getLength();\n\t\t\t\t\t\t\t\tdouble fit2 = (avgElevationFitness.fitness(s2) - s2.getCoordinateN(0).getZ()) / s2.getLength();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (fit1<0) {\n\t\t\t\t\t\t\t\t\tfit1 = 1/fit1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (fit2<0) {\n\t\t\t\t\t\t\t\t\tfit2 = 1/fit2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\treturn fit1 > fit2 ? -1 \n\t\t\t\t\t\t\t\t\t\t : fit1 < fit2 ? 1 \n\t\t\t\t\t\t\t\t\t : 0;\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\tcatch(IOException e) {\n\t\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\treturn s1.getNumPoints() > s2.getNumPoints() ? -1 \n\t\t\t\t\t\t\t\t\t : s1.getNumPoints() < s2.getNumPoints() ? 1 \n\t\t\t\t\t\t\t\t : 0; \n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tlookAheads.sort(lookAheadComparator);\n\t\t\n\t\treturn lookAheads.get(0);\n\t}", "public void solveGame4() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\t\t\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t}\n\n\t\t// Handle the pending states\n\t\twhile (!losing.isEmpty()) {\n\t\t\tS state = losing.poll();\n\n\t\t\t\n\t\t\tlosingStates.add(state);\n\n\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\tfor (S pred : predecessors) {\n\t\t\t\tif(losing.contains(pred) || losingStates.contains(pred))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t//if(i == -1)\n\t\t\t\t\t//continue;\n\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}else{\n\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "public void solveGame5() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "private void findBest()\r\n\t{\r\n\t\tint i;\r\n\t\tint size_mature_pool;\r\n\t\tint idx_current;//index of a currently checked genotype\r\n\t\tint num_errors;//number of errors of the current chromosome\r\n\t\tdouble min_error;//smallest error among the oldest genotypes\r\n\t\tVector<Integer> idx_oldest;\r\n\t\t\r\n\t\tsize_mature_pool = _pool_of_bests.size();\r\n\t\t\r\n\t\tidx_oldest = new Vector<Integer>(0, 1);\r\n\t\t\r\n\t\t//find all oldest genotypes\r\n\t\tfor(i=0; i<size_mature_pool; i++)\r\n\t\t{\r\n\t\t\tnum_errors = _pool_of_bests.get(i)._error.all_single_squares.size();\r\n\t\t\tif(num_errors>=_min_life_span)\r\n\t\t\t{\r\n\t\t\t\tidx_oldest.add(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//find the best oldest gentypes with a span above a threshold\r\n\t\t_best_idx = -1;\r\n\t\tif(idx_oldest.size() > 0)\r\n\t\t{\r\n\t\t\t_best_idx = idx_oldest.get(0);\r\n\t\t\tmin_error = _pool_of_bests.get(_best_idx)._error.getAverageError();\r\n\t\t\tfor(i=1; i<idx_oldest.size(); i++)\r\n\t\t\t{\r\n\t\t\t\tidx_current = idx_oldest.get(i);\r\n\t\t\t\tif(min_error > _pool_of_bests.get(idx_current)._error.getAverageError())\r\n\t\t\t\t{\r\n\t\t\t\t\t_best_idx = idx_current;\r\n\t\t\t\t\tmin_error = _pool_of_bests.get(_best_idx)._error.getAverageError();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void solveGame() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\n\t\t\tif(!relaxAllControllables){\n\t\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\n\t\t\t\t\t\tcurrentSet.add(s);\n\t\t\t\t}\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "@Override\n List<NodeData> pathFind() throws NoPathException {\n System.out.println(\"Starting Scenic\");\n\n frontier.add(start);\n\n while(!frontier.isEmpty()) {\n StarNode current = frontier.getLast();\n frontier.removeLast(); // pop the priority queue\n if(current.getXCoord() == goal.getXCoord() && current.getYCoord() == goal.getYCoord()) {\n // If we are at the goal, we need to backtrack through the shortest path\n System.out.println(\"At target!\");\n finalList.add(current); // we have to add the goal to the path before we start backtracking\n while(!(current.getXCoord() == start.getXCoord() && current.getYCoord() == start.getYCoord())) {\n finalList.add(current.getPreviousNode());\n current = current.getPreviousNode();\n System.out.println(current.getNodeID());\n }\n return finalList;\n }\n else {\n // we need to get all the neighbor nodes, identify their costs, and put them into the queue\n LinkedList<StarNode> neighbors = current.getNeighbors();\n // we also need to remove the previous node from the list of neighbors because we do not want to backtrack\n neighbors.remove(current.getPreviousNode());\n\n for (StarNode newnode : neighbors) {\n int nodePlace = this.listContainsId(frontier, newnode);\n if(nodePlace > -1) {\n if (frontier.get(nodePlace).getF() > actionCost(newnode) + distanceToGo(newnode, goal)) {\n System.out.println(\"Here\");\n frontier.remove(frontier.get(nodePlace));\n newnode.setPreviousNode(current);\n frontier.add(newnode);\n newnode.setF(actionCost(newnode) + distanceToGo(newnode, goal));\n }\n }\n else {\n newnode.setPreviousNode(current);\n frontier.add(newnode);\n newnode.setF(actionCost(newnode) + distanceToGo(newnode, goal));\n }\n\n // This fixes the problem with infinitely looping elevators (I hope)\n if(current.getNodeType().equals(\"ELEV\") && newnode.getNodeType().equals(\"ELEV\")) {\n for (Iterator<StarNode> iterator = newnode.neighbors.iterator(); iterator.hasNext();) {\n StarNode newneighbor = iterator.next();\n if (newneighbor.getNodeType().equals(\"ELEV\")) {\n // Remove the current element from the iterator and the list.\n iterator.remove();\n }\n }\n }\n if(current.getNodeType().equals(\"STAI\") && newnode.getNodeType().equals(\"STAI\")) {\n for (Iterator<StarNode> iterator = newnode.neighbors.iterator(); iterator.hasNext();) {\n StarNode newneighbor = iterator.next();\n if (newneighbor.getNodeType().equals(\"STAI\")) {\n // Remove the current element from the iterator and the list.\n iterator.remove();\n }\n }\n }\n // this is where the node is put in the right place in the queue\n Collections.sort(frontier);\n }\n }\n }\n throw new NoPathException(start.getLongName(), goal.getLongName());\n }", "void BackTrackBestPath(double[] delta_T_1,\n int[][] best,\n int[] best_path) {\n FindBestInLevel(delta_T_1, ((best_path)[T_-1]));\n for (int i = T_-2;i >= 0;i--) {\n (best_path)[i] = best[i+1][(best_path)[i+1]];\n }\n}", "public interface ConflictRegionStrategy extends AlgStrategy {}", "public void solveGame3() {\n\t\tlosingStates = new HashSet<S>();\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tint[] uncontrollableCount = new int[game.getStates().size()+1];\n\t\tint[] uncontrollableLosingCount = new int[game.getStates().size()+1];\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> uncontrollableSuccesors;\n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\t uncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\n\t\t\t uncontrollableCount[indexCount] = uncontrollableSuccesors.size();\n\t\t\t uncontrollableLosingCount[indexCount] = 0;\n\t\t\t isUncontrollable[indexCount] = game.isUncontrollable(state);\n\t\t\t indexCount+=1;\n\t\t}\n\t\t\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t}\n\n\t\t// Handle the pending states\n\t\twhile (!losing.isEmpty()) {\n\t\t\tS state = losing.poll();\n\n\t\t\t\n\t\t\tlosingStates.add(state);\n\n\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\tfor (S pred : predecessors) {\n\t\t\t\tif(losing.contains(pred) || losingStates.contains(pred))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t//if(i == -1)\n\t\t\t\t\t//continue;\n\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}else{\n\t\t\t\t\tuncontrollableLosingCount[i]++;\n\t\t\t\t\tif (uncontrollableLosingCount[i] == uncontrollableCount[i])\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "private void distrErrToNeighbors(GNode winner, String leftK, String rightK, String topK, String bottomK) {\n\n }", "private void applyBestRepairPlan(){\n\t\t\n\t\tSet<OWLAxiom> best_repair=null;\n\t\t\t\t\n\t\tdouble min_conf = 10000;\n\t\tdouble conf;\n\t\t\n\t\tmappingVisitor.setDeleteAxiom(false);//used in confidence\n\t\t\n\t\tfor (Set<OWLAxiom> repair : repair_plans){\n\t\t\t\n\t\t\tconf = getConfidence4Plan(repair);\n\t\t\t\n\t\t\tif (min_conf > conf){\n\t\t\t\tmin_conf = conf;\n\t\t\t\tbest_repair = repair;\n\t\t\t}\n\t\t}\n\t\t\n\t\tmappingVisitor.setDeleteAxiom(true);\n\t\t\n\t\tfor (OWLAxiom ax : best_repair){\t\t\t\n\t\t\tax.accept(mappingVisitor);\n\t\t\t//It also deletes axiom from structures\n\t\t\t//TODO add to conflicts\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "private BGPPath internalPathSelection(Collection<BGPPath> possList, boolean avoidDecoys) {\n BGPPath currentBest = null;\n int currentRel = -4;\n\n for (BGPPath tPath : possList) {\n\n /*\n * If we're doing avoidance based on ignoring local preference, then\n * for the first pass we're literally just going to throw out all\n * routes that are NOT clean, this is corrected in path selection if\n * this leaves us w/ no viable routes\n */\n if (avoidDecoys && (this.avoidMode == AS.AvoidMode.LOCALPREF || this.avoidMode == AS.AvoidMode.LEGACY)) {\n if (tPath.containsAnyOf(this.botSet)) {\n continue;\n }\n }\n\n /*\n * If we have no best path currently selected, the first one is best\n * by default\n */\n if (currentBest == null) {\n currentBest = tPath;\n currentRel = this.getRel(currentBest.getNextHop());\n continue;\n }\n\n /*\n * Local pref based on relationship step\n */\n int newRel = this.getRel(tPath.getNextHop());\n if (newRel > currentRel) {\n currentBest = tPath;\n currentRel = newRel;\n continue;\n }\n\n /*\n * If local pref is the same, move on to the next critera\n */\n if (newRel == currentRel) {\n /*\n * If we're inserting the decision to route around decoys after\n * local pref, but before path length, do so here\n */\n if (this.avoidMode == AS.AvoidMode.PATHLEN) {\n if (avoidDecoys && currentBest.containsAnyOf(this.botSet) && !tPath.containsAnyOf(this.botSet)) {\n currentBest = tPath;\n currentRel = newRel;\n continue;\n }\n if (avoidDecoys && !currentBest.containsAnyOf(this.botSet) && tPath.containsAnyOf(this.botSet)) {\n continue;\n }\n }\n\n if (currentBest.getPathLength() > tPath.getPathLength()) {\n currentBest = tPath;\n currentRel = newRel;\n continue;\n } else if (currentBest.getPathLength() == tPath.getPathLength()) {\n if (avoidDecoys && this.avoidMode == AS.AvoidMode.TIEBREAK\n && currentBest.containsAnyOf(this.botSet) && !tPath.containsAnyOf(this.botSet)) {\n currentBest = tPath;\n currentRel = newRel;\n continue;\n }\n if (avoidDecoys && this.avoidMode == AS.AvoidMode.TIEBREAK\n && !currentBest.containsAnyOf(this.botSet) && tPath.containsAnyOf(this.botSet)) {\n continue;\n }\n\n if (tPath.getNextHop() < currentBest.getNextHop()) {\n currentBest = tPath;\n currentRel = newRel;\n }\n }\n }\n }\n\n return currentBest;\n }", "private void updateFringeAndConflicts(List<String> changed) {\n //update fringe\n for (Clause ci : fringe) {\n for (CLiteral l : ci.getCLiterals()) {\n if (changed.contains(l.getName())) {\n ci.updateClause(labels);\n if ( ci.numOfNegative>0)\n // else if (c.numUnknownLiterals==0 && c.numOfNegative==c.numUnknownLiterals)\n if (!conflicts.contains(ci)) {\n if (conflicts.size()+1<=maxConflicts)\n conflicts.add(ci);\n\n break;\n }\n }\n }\n }\n\n // check rest of clauses which not in fringe or conflicts.\n for (Clause c : clauses) {\n if (!fringe.contains(c) && !conflicts.contains(c)) {\n for (CLiteral l : c.getCLiterals()) {\n if (changed.contains(l.getName())) {\n c.updateClause(labels);\n\n if (c.getNumUnknownLiterals() == 1 && c.getNumOfNegative() == c.getNumOfLiterals() - c.getNumUnknownLiterals()) {\n fringe.push(c);\n break;\n } else if (c.numOfNegative >0) {\n // else if (c.numUnknownLiterals==0 && c.numOfNegative==c.numUnknownLiterals)\n if (!conflicts.contains(c)) {\n if (conflicts.size()+1<=maxConflicts)\n conflicts.add(c);\n\n break;\n }\n }\n }\n }\n }\n }\n }", "public void makePreferredOTTOLRelationshipsNOConflicts() {\n \n // TraversalDescription CHILDOF_TRAVERSAL = Traversal.description()\n // .relationships(RelType.TAXCHILDOF, Direction.INCOMING);\n \n // get the start point\n Node life = getLifeNode();\n System.out.println(life.getProperty(\"name\"));\n \n Transaction tx = beginTx();\n addToPreferredIndexes(life, ALLTAXA);\n HashSet<Long> traveled = new HashSet<Long>();\n int nNewRels = 0;\n try {\n // walk out to the tips from the base of the tree\n for (Node n : TAXCHILDOF_TRAVERSAL.traverse(life).nodes()) {\n if (n.hasRelationship(Direction.INCOMING, RelType.TAXCHILDOF) == false) {\n \n // when we hit a tip, start walking back\n Node curNode = n;\n while (curNode.hasRelationship(Direction.OUTGOING, RelType.TAXCHILDOF)) {\n Node startNode = curNode;\n if (traveled.contains((Long)startNode.getId())){\n \tbreak;\n }else{\n \ttraveled.add((Long)startNode.getId());\n }\n Node endNode = null;\n \n // if the current node already has a preferred relationship, we will just follow it\n if (startNode.hasRelationship(Direction.OUTGOING, RelType.PREFTAXCHILDOF)) {\n Relationship prefRel = startNode.getSingleRelationship(RelType.PREFTAXCHILDOF, Direction.OUTGOING);\n \n // make sure we don't get stuck in an infinite loop (should not happen, could do weird things to the graph)\n if (prefRel.getStartNode().getId() == prefRel.getEndNode().getId()) {\n System.out.println(\"pointing to itself \" + prefRel + \" \" + prefRel.getStartNode().getId() + \" \" + prefRel.getEndNode().getId());\n break;\n }\n \n // prepare to move on\n endNode = prefRel.getEndNode();\n \n } else {\n \n // if there is no preferred rel then they all point to the same end node; just follow the first non-looping relationship\n for (Relationship rel : curNode.getRelationships(RelType.TAXCHILDOF, Direction.OUTGOING)) {\n if (rel.getStartNode().getId() == rel.getEndNode().getId()) {\n System.out.println(\"pointing to itself \" + rel + \" \" + rel.getStartNode().getId() + \" \" + rel.getEndNode().getId());\n break;\n } else {\n endNode = rel.getEndNode();\n break;\n }\n }\n \n // if we found a dead-end, die\n if (endNode == null) {\n System.out.println(curNode.getProperty(\"name\"));\n System.out.println(\"Strange, this relationship seems to be pointing at a nonexistent node. Quitting.\");\n System.exit(0);\n }\n \n // create preferred relationships\n curNode.createRelationshipTo(endNode, RelType.PREFTAXCHILDOF);\n curNode.createRelationshipTo(endNode, RelType.TAXCHILDOF).setProperty(\"source\", \"ottol\");\n nNewRels += 1;\n }\n \n if (startNode == endNode) {\n System.out.println(startNode);\n System.out.println(\"The node seems to be pointing at itself. This is a problem. Quitting.\");\n System.exit(0);\n \n // prepare for next iteration\n } else {\n curNode = endNode;\n addToPreferredIndexes(startNode, ALLTAXA);\n }\n }\n }\n \n if (nNewRels % transaction_iter == 0) {\n System.out.println(nNewRels);\n // tx.success();\n // tx.finish();\n // tx = beginTx();\n }\n }\n tx.success();\n } finally {\n tx.finish();\n }\n }", "private void resolveConflicts( Grammar grammar, State state, List<Action> tshifts, List<Action> ntshifts)\n {\n List<State> splits = new ArrayList<State>();\n\n Collections.sort( tshifts);\n Collections.sort( ntshifts);\n \n State currSplit = null;\n State prevSplit = null;\n for( int i=1, k=1; i<tshifts.size(); i++, k++)\n {\n prevSplit = currSplit;\n currSplit = null;\n \n Action prev = tshifts.get( i-1);\n Action curr = tshifts.get( i);\n \n if ( isOverlapping( prev.symbols, curr.symbols))\n {\n boolean conflict =\n (curr.type == Action.Type.tshift && prev.type == Action.Type.reduce) || \n (curr.type == Action.Type.reduce && prev.type == Action.Type.tshift) ||\n (curr.type == Action.Type.reduce && prev.type == Action.Type.reduce) ||\n (curr.type == Action.Type.tshift && prev.type == Action.Type.tshift);\n\n if ( conflict)\n {\n long prevPriority = prev.getPriority();\n long currPriority = curr.getPriority();\n if ( prevPriority < currPriority)\n {\n log.debugf( \"\\nConflict in state %d:\\n %s\\n %s\", state.index, prev, curr);\n log.debug( \"Conflict resolved: second rule(s) have higher priority\");\n deleteStackOp( state, k-1); k--;\n }\n else if ( prevPriority > currPriority)\n {\n log.debugf( \"\\nConflict in state %d:\\n %s\\n %s\", state.index, prev, curr);\n log.debug( \"Conflict resolved: first rule(s) have higher priority\");\n deleteStackOp( state, k); k--;\n }\n else\n {\n log.warnf( \"\\nConflict in state %d:\\n %s\\n %s\", state.index, prev, curr);\n log.warn( \"Conflict resolved by splitting state\");\n splitState( state, k, prevSplit, splits);\n currSplit = splits.get( splits.size() - 1);\n conflicts++;\n }\n }\n }\n }\n \n for( int i=1; i<ntshifts.size(); i++)\n {\n prevSplit = currSplit;\n currSplit = null;\n \n Action prev = ntshifts.get( i-1);\n Action curr = ntshifts.get( i);\n \n if ( curr.symbols[ 0] <= prev.symbols[ 0])\n {\n if ( curr.type == Action.Type.ntshift && prev.type == Action.Type.ntshift && curr.itemSet.equals( prev.itemSet))\n {\n log.warnf( \"\\nConflict in state %d:\\n %s\\n %s\", state.index, prev, curr);\n conflicts++;\n }\n }\n }\n \n if ( splits.size() > 0)\n {\n for( State split: splits) \n {\n log.debugf( \"Created new state %d to resolve conflict.\", split.index);\n removeNulls( split);\n \n for( StackOp shift: split.stackOps)\n {\n if ( shift == nullShift)\n throw new IllegalStateException();\n }\n }\n\n state.splits = splits.toArray( new State[ 0]);\n state.stackOps = null;\n state.gotos = null;\n }\n }", "public void computeConflicts() { //compute the number of conflicts to calculate fitness\r\n String board[][] = new String[MAX_LENGTH][MAX_LENGTH]; //initialize board\r\n int x = 0; //row\r\n int y = 0; //column\r\n int tempx = 0; //temprow\r\n int tempy = 0; //temcolumn\r\n\r\n int dx[] = new int[] {-1, 1, -1, 1}; //to check for diagonal\r\n int dy[] = new int[] {-1, 1, 1, -1}; //paired with dx to check for diagonal\r\n\r\n boolean done = false; //used to check is checking fo diagonal is out of bounds\r\n int conflicts = 0; //number of conflicts found\r\n\r\n clearBoard(board); //clears the board into empty strings\r\n plotQueens(board); // plots the Q in the board\r\n\r\n // Walk through each of the Queens and compute the number of conflicts.\r\n for(int i = 0; i < MAX_LENGTH; i++) {\r\n x = i;\r\n y = pos[i];\r\n\r\n // Check diagonals.\r\n for(int j = 0; j < 4; j++) { // because of dx and dy where there are 4 directions for diagonal searching for conflicts\r\n tempx = x;\r\n tempy = y; // store coordinate in temp\r\n done = false;\r\n\r\n while(!done) {//traverse the diagonals\r\n tempx += dx[j];\r\n tempy += dy[j];\r\n\r\n if((tempx < 0 || tempx >= MAX_LENGTH) || (tempy < 0 || tempy >= MAX_LENGTH)) { //if exceeds board\r\n done = true;\r\n } else {\r\n if(board[tempx][tempy].equals(\"Q\")) {\r\n conflicts++;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n this.conflicts = conflicts; //set conflicts of this particle\r\n }", "private Pair<Track,Pair<List<LCRelation>,List<HelicalTrackHit>>> fitNewTrack(Track track, TrackerHit hitL1, List<LCRelation> helicalTrackHitToStripHitRelations){\n String[] strategyResources = new String[4];\n strategyResources[0] = \"/org/hps/recon/tracking/strategies/HPS_s345_c2_e16.xml\";\n strategyResources[1] = \"/org/hps/recon/tracking/strategies/HPS_s456_c3_e21.xml\";\n strategyResources[2] = \"/org/hps/recon/tracking/strategies/HPS_s123_c4_e56.xml\";\n strategyResources[3] = \"/org/hps/recon/tracking/strategies/HPS_s123_c5_e46.xml\";\n \n List<SeedStrategy> sFinallist = StrategyXMLUtils.getStrategyListFromInputStream(this.getClass().getResourceAsStream(strategyResources[0]));\n List<LCRelation> hthToStripHitRefitList = new ArrayList<LCRelation>();\n List<HelicalTrackHit> helicalHits = new ArrayList<HelicalTrackHit>();\n\n HelicalTrackStrip strip1 = null;\n HelicalTrackStrip strip2 = null;\n TrackerHit hit1 = null;\n TrackerHit hit2 = null;\n HelicalTrackHit hth = null;\n \n //Build the HelicalTrackStrip for the first layer refit\n for(LCRelation rel:helicalTrackHitToStripHitRelations){\n if(((TrackerHit) rel.getFrom()).equals(hitL1)){\n HelicalTrackStrip strip = makeDigiStrip(new SiTrackerHitStrip1D((TrackerHit) rel.getTo()));\n if(strip1 == null){\n strip1 = strip;\n hit1 = (TrackerHit) rel.getTo();\n }\n else{\n strip2 = strip;\n hit2 = (TrackerHit) rel.getTo();\n break;\n }\n }\n }\n \n //Build the HelicalTrackHit for the first layer refit\n if(strip1 != null && strip2 != null){\n HelicalTrackCross trackCross = new HelicalTrackCross(strip1,strip2);\n hth = (HelicalTrackHit) trackCross;\n helicalHits.add(hth);\n }\n \n List<TrackerHit> hits = track.getTrackerHits();\n \n //Build the HelicalTrackStrips for the remaining layers\n for(TrackerHit hit:hits){\n if(hit.equals(hits.get(0))){\n hthToStripHitRefitList.add(new BaseLCRelation(hth,hit1));\n hthToStripHitRefitList.add(new BaseLCRelation(hth,hit2));\n continue;\n }\n strip1 = null;\n strip2 = null;\n for(LCRelation rel:helicalTrackHitToStripHitRelations){\n if(checkSameHit((TrackerHit) rel.getFrom(),hit)){\n HelicalTrackStrip strip = makeDigiStrip(new SiTrackerHitStrip1D((TrackerHit) rel.getTo()));\n if(strip1 == null){\n strip1 = strip;\n hit1 = (TrackerHit) rel.getTo();\n }\n else{\n strip2 = strip;\n hit2 = (TrackerHit) rel.getTo();\n break;\n }\n }\n }\n //Build the HelicalTrackHit for the remaining layers\n if(strip1 != null && strip2 != null){\n HelicalTrackCross trackCross = new HelicalTrackCross(strip1,strip2);\n hth = (HelicalTrackHit) trackCross;\n helicalHits.add(hth);\n hthToStripHitRefitList.add(new BaseLCRelation(hth,hit1));\n hthToStripHitRefitList.add(new BaseLCRelation(hth,hit2));\n }\n }\n \n SeedCandidate trackseed = new SeedCandidate(helicalHits, sFinallist.get(0), TrackUtils.getHTF(track.getTrackStates().get(0)), bfield);\n \n // Initialize the reference point to the origin\n double[] ref = new double[] {0., 0., 0.};\n \n // Create a new SeedTrack (SeedTrack extends BaseTrack)\n SeedTrack trk = new SeedTrack();\n \n // Add the hits to the track\n for (HelicalTrackHit hit : trackseed.getHits()) {\n trk.addHit((TrackerHit) hit);\n }\n \n // Retrieve the helix and save the relevant bits of helix info\n HelicalTrackFit helix = trackseed.getHelix();\n trk.setTrackParameters(helix.parameters(), bfield); // Sets first TrackState.\n trk.setCovarianceMatrix(helix.covariance()); // Modifies first TrackState.\n trk.setChisq(helix.chisqtot());\n trk.setNDF(helix.ndf()[0]+helix.ndf()[1]);\n \n // Flag that the fit was successful and set the reference point\n trk.setFitSuccess(true);\n trk.setReferencePoint(ref); // Modifies first TrackState.\n trk.setRefPointIsDCA(true);\n \n // Set the strategy used to find this track\n trk.setStratetgy(trackseed.getSeedStrategy());\n \n // Set the SeedCandidate this track is based on\n trk.setSeedCandidate(trackseed);\n \n return new Pair<>((Track) trk,new Pair<>(hthToStripHitRefitList,helicalHits));\n }", "private LineString pickBestGrowthPossibility2(List<LineString> lookAheads) {\t\t\n\t\tif (lookAheads == null || lookAheads.size() == 0) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t//sort by:\n\t\t//1. is moving away?\n\t\t//2. number of coordinates in line\n\t\t//3. slope\n\t\tComparator<LineString> lookAheadComparator = new Comparator<LineString>() {\n\t\t\tpublic int compare(LineString s1, LineString s2) {\n\t\t\t\t\n\t\t\t\tboolean m1 = LineGrowthHelpers.isMovingAway(s1, s1.getCoordinateN(s1.getNumPoints()-1));\n\t\t\t\tboolean m2 = LineGrowthHelpers.isMovingAway(s2, s2.getCoordinateN(s2.getNumPoints()-1));\n\t\t\t\tif (m1 != m2) {\n\t\t\t\t\treturn m1 ? -1 : 1;\n\t\t\t\t}\n\t\t\t\telse { //both moving away, or neither moving away. look to second criteria\n\t\t\t\t\t\n\t\t\t\t\tif (s1.getNumPoints() == s2.getNumPoints()) {\n\n\t\t\t\t\t\tdouble slope1 = SpatialUtils.getSlope(s1);\n\t\t\t\t\t\tdouble slope2 = SpatialUtils.getSlope(s2);\n\t\t\t\t\t\treturn slope1 > slope2 ? -1 \n\t\t\t\t\t\t\t\t : slope1 < slope2 ? 1 \n\t\t\t\t\t\t\t : 0; \n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\treturn s1.getNumPoints() > s2.getNumPoints() ? -1 \n\t\t\t\t\t\t\t\t : s1.getNumPoints() < s2.getNumPoints() ? 1 \n\t\t\t\t\t\t\t : 0; \n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tlookAheads.sort(lookAheadComparator);\n\t\treturn lookAheads.get(0);\n\t}", "@Override\n\t\tpublic double heuristic() {\n\t\t\tint sum = 0;\n\t\t\tfor (int i = 0; i < k; i++) {\n\t\t\t\tsum += Math.abs(xGoals[i] - state[i]);\n\t\t\t\tsum += Math.abs(yGoals[i] - state[k + i]);\n\t\t\t}\n\t\t\treturn sum;\n\t\t}", "public void generateNeighborhood(TSPSolution s){\r\n\t\tint [] rounte = new int[problem.city_num+1];\r\n\t\tfor(int i=0;i<problem.city_num;i++) rounte[i] = s.route[i];\r\n\t\trounte[problem.city_num] = rounte[0];\r\n\t\tint [] pos = new int[problem.city_num];\r\n\t\tproblem.calculatePosition(rounte, pos);\r\n\t\tint pos1 = 0;\r\n\t\tint pos2 = 0;\r\n\t\tfor(int k=0;k<problem.city_num;k++){\r\n\t\t\tint i = k;\r\n\t\t\tpos1 = i;\r\n\t\t\tint curIndex = rounte[i];\r\n\t\t\tint nextIndex = rounte[i+1];\r\n\t\t\tArrayList<Integer> candidate = problem.candidateList.get(curIndex);\r\n\t\t\tIterator<Integer> iter = candidate.iterator();\r\n\t\t\twhile(iter.hasNext()){\r\n\t\t\t\tint next = iter.next();\r\n\t\t\t\tpos2 = pos[next];\r\n\t\t\t\tint curIndex1 = rounte[pos2];\r\n\t\t\t\tint nextIndex1 = rounte[pos2+1];\r\n\t\t\t\tif(curIndex == nextIndex1) continue;\r\n\t\t\t\tif(curIndex == curIndex1) continue;\r\n\t\t\t\tif(nextIndex == nextIndex1) continue;\r\n\t\t\t\tif(curIndex1 == nextIndex) continue;\r\n\t\t\t\tint betterTimes = 0;\r\n\t\t\t\tTSPSolution solution = new TSPSolution(problem.city_num, problem.obj_num, -1);\r\n\t\t\t\tfor(int j=0;j<problem.obj_num;j++){\r\n\t\t\t\t\tint gain = problem.disMatrix[j*problem.city_num*problem.city_num+curIndex*problem.city_num+curIndex1] +\r\n\t\t\t\t\t\t\tproblem.disMatrix[j*problem.city_num*problem.city_num+nextIndex*problem.city_num+nextIndex1] - \r\n\t\t\t\t\t\t\t(problem.disMatrix[j*problem.city_num*problem.city_num+curIndex*problem.city_num+nextIndex]+\r\n\t\t\t\t\t\t\tproblem.disMatrix[j*problem.city_num*problem.city_num+curIndex1*problem.city_num+nextIndex1]);\r\n\t\t\t\t\tif(gain<0) betterTimes++;\r\n\t\t\t\t\tsolution.object_val[j] = s.object_val[j] + gain;\r\n\t\t\t\t}\r\n\t\t\t\tif(betterTimes==0) continue;\r\n\t\t\t\tsolution.route = s.route.clone();\r\n\r\n\t\t\t\tif(problem.kdSet.add(solution)){\r\n\t\t\t\t\tproblem.converse(pos1, pos2, solution.route, 0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private Outfit getBestWithJacket(double desired_clo) {\n Cursor jacketCursor = mOuterLoaderListener.getCursor();\n Outfit best_outfit = new Outfit();\n Outfit temp_top_bottom;\n Outfit temp_dress;\n double diff = Double.MAX_VALUE;\n double jacket_clo = 0;\n int result_jacket_position = 0;\n if (jacketCursor.moveToFirst()) {\n while (!jacketCursor.isAfterLast()) {\n jacket_clo = jacketCursor.getDouble(jacketCursor.getColumnIndex(ClothesEntry.COLUMN_ARTICLE_CLO_VALUE));\n temp_top_bottom = getBestTopBottom(desired_clo - jacket_clo);\n temp_dress = getBestDress(desired_clo - jacket_clo);\n\n if (Math.abs(temp_top_bottom.getCloValue() + jacket_clo - desired_clo) < diff) {\n diff = Math.abs(temp_top_bottom.getCloValue() + jacket_clo - desired_clo);\n result_jacket_position = jacketCursor.getPosition();\n best_outfit = temp_top_bottom;\n }\n if (Math.abs(temp_dress.getCloValue() + jacket_clo - desired_clo) < diff) {\n diff = Math.abs(temp_dress.getCloValue() + jacket_clo - desired_clo);\n result_jacket_position = jacketCursor.getPosition();\n best_outfit = temp_dress;\n }\n\n jacketCursor.moveToNext();\n }\n\n if (!best_outfit.isEmpty() && jacketCursor.moveToPosition(result_jacket_position)) {\n byte[] imageByteArray = jacketCursor.getBlob(jacketCursor.getColumnIndex(ClothesEntry.COLUMN_ARTICLE_IMAGE));\n double clo = jacketCursor.getDouble(jacketCursor.getColumnIndex(ClothesEntry.COLUMN_ARTICLE_CLO_VALUE));\n\n if (imageByteArray != null && imageByteArray.length > 0)\n {\n ByteArrayInputStream imageStream = new ByteArrayInputStream(imageByteArray);\n best_outfit.addItem(new ClothingItem(Outfit.OUTER1, BitmapFactory.decodeStream(imageStream), clo));\n } else {\n best_outfit.addItem(new ClothingItem(Outfit.OUTER1, null, clo));\n }\n }\n }\n return best_outfit;\n }", "public void aEstrella2 (String input)\r\n\t{\r\n\t\tNode root_aEstrella2 = new Node (input);\r\n\t\tNode current = new Node(root_aEstrella2.getState());\r\n\t\t\r\n\t\tHeuristicComparator aEstrella_comparator = new HeuristicComparator();\r\n\t\tPriorityQueue<Node> queue_gbfs = new PriorityQueue<Node>(12, aEstrella_comparator);\r\n\t\tArrayList<String> visited = new ArrayList<String>();\r\n\t\tArrayList<String> children = new ArrayList<String>();\r\n\t\t\r\n\t\tint nodes_popped = 0;\r\n\t\tint pqueue_max_size = 0;\r\n\t\tint pq_size = 0;\r\n\t\t\r\n\t\tcurrent.cost = 0;\r\n\t\t\r\n\t\twhile(!goal_aEstrella2)\r\n\t\t{\r\n\t\t\tvisited.add(current.getState());\r\n\t\t\tchildren = Successor.findChildren(current.getState());\r\n\t\t\t\r\n\t\t\tfor (String a : children)\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tif (visited.contains(a))\r\n\t\t\t\t{\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNode nino = new Node(a);\r\n\t\t\t\t\tcurrent.children_nodes.add(nino);\r\n\t\t\t\t\tvisited.add(nino.getState());\r\n\t\t\t\t\t\r\n\t\t\t\t\tint cost = isCost(current.getState(), nino.getState());\r\n\t\t\t\t\tnino.cost = cost;\r\n\t\t\t\t\tnino.parent = current;\r\n\t\t\t\t\tint manhattanD = manhattanDistance(nino.getState(), root_aEstrella2.getState());\r\n\t\t\t\t\tnino.setTotalCost(nino.parent.getTotalCost() + nino.cost);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// f(n) = g(n) + h(n)\r\n\t\t\t\t\tnino.setHeuristicCost(nino.getTotalCost() + manhattanD);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (!queue_gbfs.contains(nino))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tqueue_gbfs.add(nino);\r\n\t\t\t\t\t\tpq_size++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Repeated State checking. Removing the same node from PQ if the path cost is less then the current one \r\n\t\t\t\t\telse if (queue_gbfs.contains(nino))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfor (Node original : queue_gbfs)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (original.equals(nino))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tNode copy = original;\r\n\t\t\t\t\t\t\t\tif (nino.getHeuristicCost() < copy.getHeuristicCost())\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tqueue_gbfs.remove(copy);\r\n\t\t\t\t\t\t\t\t\tqueue_gbfs.add(nino);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcurrent = queue_gbfs.poll();\r\n\t\t\tnodes_popped++;\r\n\t\t\t\r\n\t\t\tif (pq_size > pqueue_max_size)\r\n\t\t\t{\r\n\t\t\t\tpqueue_max_size = pq_size;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tpq_size--;\r\n\t\t\tgoal_aEstrella2 = isGoal(current.getState());\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tgoal_aEstrella2 = false;\r\n\t\tSystem.out.println(\"A*2 Solved!!\");\r\n\t\tSolution.performSolution(current, root_aEstrella2, nodes_popped, pqueue_max_size);\r\n\t}", "private Map<Integer, Integer> fillInSolutionObject(Graph graph, HashSet<Integer> finalEntities, double[][] allCloseness) {\n Map<Integer, Integer> graphMapping = new HashMap<Integer, Integer>();\n for (int mentionNodeId : bestMentionDegrees.keySet()) {\n GraphNode mentionNode = graph.getNode(mentionNodeId);\n Mention mention = (Mention) mentionNode.getNodeData();\n\n ResultMention rm = new ResultMention(mention.getMention(), mention.getCharOffset(), mention.getCharLength());\n\n int mentionOutdegree = graph.getNodeOutdegree(mentionNodeId);\n if (mentionOutdegree == 0) {\n solution.put(rm, ResultEntity.getResultEntityAsList(ResultEntity.getNoMatchingEntity()));\n graphMapping.put(mentionNodeId, -1);\n } else {\n TIntDoubleHashMap successorsMap = mentionNode.getSuccessors();\n TIntDoubleIterator successorsIterator = successorsMap.iterator();\n for (int i = successorsMap.size(); i-- > 0; ) {\n successorsIterator.advance();\n\n int entityNodeId = successorsIterator.key();\n double mentionEntitySimilarity = successorsIterator.value();\n if (finalEntities.contains(entityNodeId)) {\n double confidence = mentionEntitySimilarity;\n double averageCloseness = 0.0;\n\n for (int otherMention : bestMentionDegrees.keySet()) {\n if (otherMention == mentionNodeId || allCloseness[entityNodeId][otherMention] == Double.NEGATIVE_INFINITY) {\n continue;\n }\n averageCloseness += allCloseness[entityNodeId][otherMention];\n }\n\n int numOtherMentions = bestMentionDegrees.keySet().size() - 1;\n if (numOtherMentions > 0) {\n averageCloseness = averageCloseness / numOtherMentions;\n }\n confidence += averageCloseness;\n\n GraphNode entityNode = graph.getNode(entityNodeId);\n int entityInternalId = (int) entityNode.getNodeData();\n Entity entity = allEntities_.getEntityById(entityInternalId);\n List<ResultEntity> res = new ArrayList<ResultEntity>(1);\n res.add(new ResultEntity(entity, confidence));\n\n graphMapping.put(mentionNodeId, entityNodeId);\n solution.put(rm, res);\n }\n }\n }\n }\n return graphMapping;\n }", "public abstract OptimisationSolution getBestSolution();", "public static AbstractStrategy lastConflict(Solver SOLVER) {\n return lastConflict(SOLVER, SOLVER.getStrategy());\n }", "private static void mergeNext() {\n\t\tString ids[] = getMinGeneIds();\n\t\tString minI = ids[0];\n\t\tString minJ = ids[1];\n\t\tString newEntry = createNewEntry(minI, minJ);\n\t\tTreeMap<String, Double> prevI = distanceMatrix.remove(minI);\n\t\tTreeMap<String, Double> prevJ = distanceMatrix.remove(minJ);\n\t\tminMatrix.remove(minI);minMatrix.remove(minJ);\n\t\tallClusters.remove(minI);allClusters.remove(minJ);\n\t\tTreeMap<String, Double> newTemp = new TreeMap<String, Double>(); \n\t\tfor(String c: allClusters) {\n\t\t\tTreeMap<String, Double> temp = distanceMatrix.get(c);\n\t\t\ttemp.remove(minI);temp.remove(minJ);\n\t\t\tdouble dist1 = prevI.get(c);\n\t\t\tdouble dist2 = prevJ.get(c);\n\t\t\tif(dist1 < dist2) {\n\t\t\t\tnewTemp.put(c,dist1);\n\t\t\t\tupdateMinMatrix(newEntry, c, dist1);\n\t\t\t\ttemp.put(newEntry, dist1);\n\t\t\t\tString minData[] = minMatrix.get(c).split(\";\");\n\t\t\t\tif(minData[0].equals(minI) || minData[0].equals(minJ)) {\n\t\t\t\t\tminMatrix.remove(c);\n\t\t\t\t\tcreateMinMatrixAfterRemoval(c);\n\t\t\t\t}\n\t\t\t\tupdateMinMatrix(c, newEntry, dist1);\n\t\t\t} else {\n\t\t\t\tnewTemp.put(c,dist2);\n\t\t\t\tupdateMinMatrix(newEntry, c, dist2);\n\t\t\t\ttemp.put(newEntry, dist2);\n\t\t\t\tString minData[] = minMatrix.get(c).split(\";\");\n\t\t\t\tif(minData[0].equals(minI) || minData[0].equals(minJ)) {\n\t\t\t\t\tminMatrix.remove(c);\n\t\t\t\t\tcreateMinMatrixAfterRemoval(c);\n\t\t\t\t}\n\t\t\t\tupdateMinMatrix(c, newEntry, dist2);\n\t\t\t}\n\t\t\tdistanceMatrix.put(c, temp);\n\t\t}\n\t\tdistanceMatrix.put(newEntry, newTemp);\n\t\tallClusters.add(newEntry);\n\t\ttotalCluster = allClusters.size();\n\t}", "public HashMap<Integer, Integer> findAugumentPath() {\n if (debug == 1) printFree();\n HashMap<Integer, Integer> Path = new HashMap<>();\n if (V1.isEmpty() || V2.isEmpty()) {\n if (debug == 1) System.out.println(\"V1||V2 is empty\");\n return Path;\n }\n\n GM.clearAllEdge();\n for (int i = 0; i < x.length; i++) {\n for (int j : x[i].getDomain()) {\n GM.addEdge(i, Map.get(j));\n }\n }\n GM.adjList[X].clear();\n for (int i : V1) {\n GM.addEdge(X, i);\n }\n for (int i = 0; i < x.length; i++) {\n if (MaxMatch[i] != 0) GM.addEdge(MaxMatch[i], i);\n }\n if (debug == 1) System.out.println(GM);\n\n // DFS từ X. Gặp 1 đỉnh thuộc V2 thì break\n boolean[] visited = new boolean[nbOfVertex + 10];\n int[] prev = new int[nbOfVertex + 10];\n prev[X] = -1;\n int last = -1;\n\n Stack<Integer> S = new Stack<>();\n S.push(X);\n while (!S.isEmpty() && last == -1) {\n int top = S.pop();\n //System.out.println(\"Popped \" + top);\n if (!visited[top]) {\n visited[top] = true;\n for (int next : GM.adjList[top])\n if (!visited[next]) {\n prev[next] = top;\n if (V2.contains(next)) {\n last = next;\n //System.out.println(\"Here \" + next);\n break;\n }\n S.push(next);\n //System.out.println(\"Pushed \" + next);\n }\n }\n }\n if (last == -1) {\n //System.out.println(\"Cant find any augument path\\n\");\n } else {\n //System.out.println(\"Constructing augument path\");\n //int step = 0;\n while (last != -1) {\n int from = prev[last];\n if (from == X) break;\n Path.put(from, last);\n ////System.out.println(Math.min(from, last) + \" --> \" + Math.max(from, last));\n last = from;\n //step++;\n //if(step>10) break;\n }\n if (debug == 1) System.out.println(\"Construct augument path completed \" + Path.size());\n if (debug == 1) printCurrentAugumentPath(Path);\n }\n //System.out.println(Path.size());\n return Path;\n }", "@Override\n\tprotected void notifyNewBest(LinkedList<City> goodSolution, double length) {\n\t}", "public void findSolution() {\n\t\tif (lenA > lenB) {\n\t\t\toptPairs = new String[lenB];\n\t\t} else {\n\t\t\toptPairs = new String[lenA];\n\t\t}\n\n\t\tint counter = 0;\n\t\tint i = lenA;\n\t\tint j = lenB;\n\n\t\twhile(i>0 && j>0) {\n\t\t\tif (optArray[i][j] == g+optArray[i-1][j]) {\n\t\t\t\ti--;\n\t\t\t}\n\t\t\telse if (optArray[i][j] == g+optArray[i][j-1]) {\n\t\t\t\tj--;\n\t\t\t}\n\t\t\telse {\n\t\t\t\toptPairs[counter] = i + \" \" + j;\n\t\t\t\tcounter++;\n\t\t\t\ti--;\n\t\t\t\tj--;\n\t\t\t}\n\t\t}\n\n\t\tpairNum = counter;\n\n\t}", "public void makePreferredOTTOLRelationshipsConflicts(){\n \t\tTransaction tx;\n \t\tString name = \"life\";\n \t\tIndexHits<Node> foundNodes = findTaxNodeByName(name);\n Node firstNode = null;\n if (foundNodes.size() < 1){\n System.out.println(\"name '\" + name + \"' not found. quitting.\");\n return;\n } else if (foundNodes.size() > 1) {\n System.out.println(\"more than one node found for name '\" + name + \"'not sure how to deal with this. quitting\");\n } else {\n for (Node n : foundNodes)\n firstNode = n;\n }\n \t\tTraversalDescription CHILDOF_TRAVERSAL = Traversal.description()\n \t\t\t\t.relationships( RelTypes.TAXCHILDOF,Direction.INCOMING );\n \t\tSystem.out.println(firstNode.getProperty(\"name\"));\n \t\tint count = 0;\n \t\ttx = graphDb.beginTx();\n \t\ttry{\n \t\t\tfor(Node friendnode : CHILDOF_TRAVERSAL.traverse(firstNode).nodes()){\n \t\t\t\tboolean conflict = false;\n \t\t\t\tString endNode = \"\";\n \t\t\t\tRelationship ncbirel = null;\n \t\t\t\tRelationship ottolrel = null;\n \t\t\t\tfor(Relationship rel : friendnode.getRelationships(Direction.OUTGOING)){\n \t\t\t\t\tif (rel.getEndNode() == rel.getStartNode()){\n \t\t\t\t\t\tcontinue;\n \t\t\t\t\t}else{\n \t\t\t\t\t\tif (endNode == \"\")\n \t\t\t\t\t\t\tendNode = (String) rel.getEndNode().getProperty(\"name\");\n \t\t\t\t\t\tif ((String)rel.getEndNode().getProperty(\"name\") != endNode){\n \t\t\t\t\t\t\tconflict = true;\n \t\t\t\t\t\t}\n \t\t\t\t\t\tif(((String)rel.getProperty(\"source\")).compareTo(\"ncbi\")==0)\n \t\t\t\t\t\t\tncbirel = rel;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\tif (conflict && ncbirel != null){\n \t\t\t\t\tcount += 1;\n //\t\t\t\t\tSystem.out.println(\"would make one from \"+ncbirel.getStartNode().getProperty(\"name\")+\" \"+ncbirel.getEndNode().getProperty(\"name\"));\n \t\t\t\t\tif(ncbirel.getStartNode()!=ncbirel.getEndNode()){\n \t\t\t\t\t\tncbirel.getStartNode().createRelationshipTo(ncbirel.getEndNode(), RelTypes.PREFTAXCHILDOF);\n \t\t\t\t\t\tRelationship newrel2 = ncbirel.getStartNode().createRelationshipTo(ncbirel.getEndNode(), RelTypes.TAXCHILDOF);\n \t\t\t\t\t\tnewrel2.setProperty(\"source\", \"ottol\");\n \t\t\t\t\t}else{\n \t\t\t\t\t\tSystem.out.println(\"would make cycle from \"+ncbirel.getEndNode().getProperty(\"name\"));\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t}\n \t\t\t\tif(count % transaction_iter == 0)\n \t\t\t\t\tSystem.out.println(count);\n \t\t\t}\n \t\t\ttx.success();\n \t\t}finally{\n \t\t\ttx.finish();\n \t\t}\n \t}", "protected static List<Conflict> solve() {\n\t\tcleaned = false;\n\t\tif (curMIDI != null)\n\t\t\ttry {\n\t\t\t\tSolver greedy = new OOGreedySolver(setOfStrings);\n\t\t\t\tcurMIDI = TrackSplitter.split(curMIDI, setOfStrings.length, bassTrack);\n\t\t\t\tcurMIDI = greedy.solve(curMIDI);\n\t\t\t\tsetOfConflicts = Cleaner.getConflicts(curMIDI, setOfStrings);\n\n\t\t\t\t//serve users valid choices\n\t\t\t\t//receive users choice\n\t\t\t\t//call appropriate method\n\n\t\t\t\t// give the simulation the new midi\n\t\t\t\tcurMIDI = Cleaner.prePos(curMIDI, prepositionDelay, setOfStrings, prepositionLength);\n\t\t\t\tif (sim!=null) sim.setSequence(curMIDI);\n\t\t\t\treturn setOfConflicts;\n\t\t\t} catch (InvalidMidiDataException e) {\n\t\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "private void testDifferentJRangesForConstantK()\r\n\t{\r\n\t\tint minJ = energiesForCurrentK.entrySet().iterator().next().getKey();\r\n\t\tint maxJ = 0;\r\n\r\n\t\tfor (Map.Entry<Integer, Double> entry : energiesForCurrentK.entrySet()) {\r\n\t\t\tmaxJ = entry.getKey();\r\n\t\t}\r\n\r\n\t\tint shiftsOfJPossible = (maxJ - minJ) + inputBranchArray.size() - 1;\r\n\r\n\t\tfor (int i = 0; i < shiftsOfJPossible; i++) {\r\n\t\t\tresetArraysAndHeader();\r\n\t\t\tsetHeaderDisplayState(false);\r\n\t\t\tlowestJValue = maxJ - i;\r\n\t\t\thighestJValue = lowestJValue + inputBranchArray.size() - 1;\r\n\t\t\tassignJValuesToInputBranch();\r\n\t\t\tpublishResults();\r\n\t\t}\r\n\t}", "public void addAllJugglersToFirstCircuitChoice() {\n for (int currentJuggler = 0; currentJuggler < jugglers.size(); currentJuggler++) { // For each juggler who needs to be added to a circuit...\n int currentJugglerMostDesiredCircuitIndex = jugglers.get(currentJuggler).getDesiredCircuits().get(0);\n Circuit currentJugglerMostDesiredCircuit = circuits.get(currentJugglerMostDesiredCircuitIndex);\n currentJugglerMostDesiredCircuit // Get the current juggler's most desired circuit...\n .getJugglersInCircuit().add(currentJuggler); //... and add this juggler's number to the circuit\n\n // If we now have too many jugglers in the circuit:\n // 1) Identify the least-suitable juggler in this circuit (using dot-product)\n // 2) Remove him from this circuit\n // 3) Find his next-most-preferred circuit and put him in there\n // , remove the one least suited for this circuit and put him in his next-desired\n if (currentJugglerMostDesiredCircuit.getJugglersInCircuit().size() > MAX_JUGGLERS_PER_CIRCUIT) {\n int worstJugglerInCircuitNumber = currentJuggler; // This number corresponds to the juggler who is going to be kicked out of this circuit. Defaults to the juggler who just got in, because he has to prove himself first!\n // Check each juggler. If they are worse than the new juggler, they become the \"worst juggler in the circuit\", and will be kicked out.\n for (Integer jugglerNumber : currentJugglerMostDesiredCircuit.getJugglersInCircuit()) {\n if (jugglers.get(jugglerNumber).getDotProduct(currentJugglerMostDesiredCircuit) < jugglers.get(worstJugglerInCircuitNumber).getDotProduct(currentJugglerMostDesiredCircuit)) {\n worstJugglerInCircuitNumber = jugglerNumber;\n }\n }\n kickToLowerDesiredCircuit(worstJugglerInCircuitNumber, currentJugglerMostDesiredCircuitIndex); // Kicks this juggler from this circuit to his next one\n }\n }\n }", "private void updateSingles(Hierarchy con, ViolatedCandidate lCandidate, ViolatedCandidate tCandidate,\n double delta) {\n Multiset<Constraint> targetPreferringView = UpdateUtils.getViolatedByLearner(lCandidate, tCandidate);\n Multiset<Constraint> learnerPreferringView = UpdateUtils.getViolatedByTarget(lCandidate, tCandidate);\n Multiset<Constraint> learnerPreferringHigh = HashMultiset.create(learnerPreferringView.size());\n double promoteWeightedDelta = delta / targetPreferringView.size();\n double maxTPreferringRanking = Double.MIN_VALUE;\n for (Constraint constraint : targetPreferringView.elementSet()) {\n maxTPreferringRanking = Math.max(maxTPreferringRanking, con.getRanking(constraint));\n double multipliedDelta = (targetPreferringView.count(constraint) * promoteWeightedDelta);\n con.changeConstraintRanking(constraint, multipliedDelta);\n }\n\n for (Constraint constraint : learnerPreferringView.elementSet()) {\n double thisRanking = con.getRanking(constraint);\n if (thisRanking > maxTPreferringRanking) {\n int count = learnerPreferringView.count(constraint);\n learnerPreferringHigh.add(constraint, count);\n }\n }\n // If 'higher' set is empty, just add argMax to it\n if (learnerPreferringHigh.isEmpty()) {\n Constraint argMax = UpdateUtils.getMax(learnerPreferringView, con);\n learnerPreferringHigh.add(argMax);\n }\n\n Multiset<Constraint> toIterateOver = learnerPreferringHigh;\n\n double demoteWeightedDelta = -(delta / toIterateOver.size());\n for (Constraint constraint : toIterateOver.elementSet()) {\n double multipliedDelta = toIterateOver.count(constraint) * demoteWeightedDelta;\n con.changeConstraintRanking(constraint, multipliedDelta);\n // System.out.println(\"↓ Updating \" + constraint +\" by \" +\n // multipliedDelta);\n }\n }", "private static LinkedList<Integer> localSearchSimulatedAnnealing(File fileNameWithPath, int kNeighborHood ) throws Exception{\n\t\t\n\t\tString traceString = \"\";\n\t\tdouble bestCost = Double.POSITIVE_INFINITY;\n\t\tLinkedList<Integer> bestTspList = null;\n\t\tdouble bestCycleTime = Double.POSITIVE_INFINITY;\n\n\t\tif (Project.runId == -1 )\n\t\t\tProject.runId = 1;\n\n\t\t/* \n\t\t * read the file and build the cost table\n\t\t */\n parseEdges(fileNameWithPath);\n\n /*\n\t\t * time starts once you read the data\n */\n\t\tdouble baseTime = System.nanoTime();\n\n\t\t/*\n\t\t * invoking furthest insertion algorithm to get the tsp\n\t\t */\n\t\tlong startNodeSeed = (long)(1000.0*generator.nextDouble());\n\t\tLinkedList<Integer> currentTspList = FurthestInsertion.generateTSP(Project.sourceGTree,startNodeSeed);\n\t\t\n\t\tdouble currentTspCost = tspCost(currentTspList);\n\n\t\tbestTspList = currentTspList;\n\t\tbestCost = currentTspCost;\n\t\tbestCycleTime = System.nanoTime() - baseTime;\n\n\t\t/* print the trace file */\n\t\ttraceString = String.format(\"%.2f, %d\",Math.round(((System.nanoTime()-baseTime)/nanosecs)*100.0)/100.0,Math.round(bestCost));\n\t\tprintTrace(runId,traceString);\n\n\t\t/*\n\t\t * time starts now - start annealing\n\t\t */\n\t\tdouble annealingProbabilityThreshold = .2*generator.nextDouble(); // acceptance prob threshold for bad results\n\t\tdouble T = 100; // annealing temp\n\t\tdouble coolingRate = .00000001; // rate of cooling in each step\n\n\t\t/*\n\t\t * remove the last node as it matches the first\n\t\t */\n\t\tcurrentTspList.removeLast();\n\n\t\twhile ( T > 1 )\n\t\t{\n\t\t\t/*\n\t\t\t * reached cutoff time\n\t\t\t */\n\t\t\tif ( System.nanoTime()-baseTime >= Project.cutoffTimeSeconds*nanosecs ) {\n\t\t\t\ttimedOut=true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tdouble cycleStartTime = System.nanoTime();\n\n\t\t\tLinkedList<Integer> newTspList = currentTspList;\n\n\t\t\t/* do a 2 opt search in current k=5 neighborhood to get a newtsp */\n\t\t\t/* 1. Pick the first random element in the current tsp */\n\t\t\tint element2 = (int)((double)(newTspList.size()-1) * generator.nextDouble());\n\t\t\tint element1 = element2 - 1;\n\t\t\tif ( element1 == -1 ){\n\t\t\t\telement1 = newTspList.size()-1;\n\t\t\t}\n\t\t\t\n int delta;\n\n\t\t\t/*\n\t\t\t * search in the neighborhood specified\n * if not specified search all\n\t\t\t */\n if ( kNeighborHood != -1 ) {\n\t\t\t /* We want to search in the specified k=n neighborhoods of element1 */\n\t\t\t delta= (int)(2*kNeighborHood*generator.nextDouble()) - kNeighborHood;\n } else {\n\t\t\t delta= (int)((newTspList.size()-1)*generator.nextDouble()) - (int)(newTspList.size()/2);\n\t\t\t}\n\n\t\t\tif ( delta == 0 ) {\n\t\t\t\tdelta = 2;\n\t\t\t} else if ( delta == 1 ) {\n\t\t\t\tdelta = 2;\n\t\t\t} else if ( delta == -1) {\n\t\t\t\tdelta = -2; }\n\n\t\t\tint element4 = element2 + delta;\n\n\t\t\tif ( element4 < 0 ) {\n\t\t\t\telement4 = newTspList.size()+element4;\n\t\t\t}else if ( element4 >= newTspList.size() ) {\n\t\t\t\telement4 = element4-(newTspList.size()-1);\n\t\t\t}\n\n\t\t\tint element3 = element4 -1;\n\t\t\tif ( element3 == -1 ){\n\t\t\t\telement3 = newTspList.size()-1;\n\t\t\t}\n\n\n\t\t\t/* \n\t\t\t * the new tsp will have element2->element4.......element1->element3....\n\t\t\t */\n\t\t\tInteger vertex_3 = newTspList.get(element3);\n\t\t\tnewTspList.set(element3,newTspList.get(element2));\n\t\t\tnewTspList.set(element2,vertex_3);\n\n\t\t\t/*\n\t\t\t * from element2+1 to element3-1 swap to reverse their order\n\t\t\t */\n\t\t\twhile ( element2 < element3 ){\n\t\t\t\telement3 = element3-1;\n\t\t\t\tif ( element3 == -1 ) {\n\t\t\t\t\telement3 = newTspList.size()-1;\n\t\t\t\t}\n\n\t\t\t\telement2 = element2 + 1;\n\t\t\t\tif ( element2 == newTspList.size() ) {\n\t\t\t\t\telement3 = 0;\n\t\t\t\t}\n\n\t\t\t\tInteger tempVertex = newTspList.get(element2);\n\t\t\t\tnewTspList.set(element2,newTspList.get(element3));\n\t\t\t\tnewTspList.set(element3,tempVertex);\n\n\t\t\t}\n\n\t\t\tdouble newTspCost = tspCost(newTspList);\n\n\t\t\t/* if new local search solution is better than eariler take the search and continue search\n\t\t\t */\n\t\t\tif ( newTspCost <= currentTspCost ){\n\t\t\t\tcurrentTspList = newTspList;\n\t\t\t\tcurrentTspCost = newTspCost;\n\t\t\t} else {\n\t\t\t/* if new local search solution is not better than eariler \n\t\t\t * then check the difference and the probability at this stage of annealing\n\t\t\t * if probability is higher than threshold set, then keep new search ad continue, else discard \n\t\t\t */\n\t\t\t\tif ( Math.exp((currentTspCost - newTspCost) / T) > generator.nextDouble() ){\n\t\t\t\t\tcurrentTspList = newTspList;\n\t\t\t\t\tcurrentTspCost = newTspCost;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t//Subtract the start time from the finish time to get the actual algorithm running time; divide by 10e6 to convert to milliseconds\n\t\t\tdouble cycleTime = (System.nanoTime()-cycleStartTime);\n\n\t\t\t/* first improvement , take the best each time */\n\t\t\tif ( newTspCost < bestCost ) {\n\t\t\t\tbestCost = newTspCost;\n\t\t\t\tbestTspList = newTspList;\n\t\t\t\tbestCycleTime = cycleTime;\n\t\t\t\t/* print the trace file */\n\t\t\t\ttraceString = String.format(\"%.2f, %d\",Math.round(((System.nanoTime()-baseTime)/nanosecs)*100.0)/100.0,Math.round(bestCost));\n\t\t\t\tappendToTraceFile(runId,traceString);\n\n\t\t\t\tif ( bestCost <= optimalCost )\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t/* the cooling */\n\t\t\tT = T - T * coolingRate;\n\n\t\t}\n\n\t\t/* print the sol file */\n\t\tprintSol(runId,bestTspList,bestCost);\n\n\t\t/* print the tab results file */\n\t\tappendTabResults(runId,bestCycleTime,bestCost,bestTspList);\n\n\t\treturn bestTspList;\n\n\t}", "@Override\n public Matching stableMarriageGaleShapley_residentoptimal(Matching marriage) {\n\n int m = marriage.getHospitalCount();\n int n = marriage.getResidentCount();\n\n ArrayList<ArrayList<Integer>> hospital_preference = marriage.getHospitalPreference();\n ArrayList<ArrayList<Integer>> resident_preference = marriage.getResidentPreference();\n ArrayList<Integer> hospitalSlots = marriage.getHospitalSlots();\n ArrayList<Integer> residentMatching = new ArrayList<Integer>();\n arrlistInit(residentMatching, n, -1, false); //O(n)\n\n /*At first the resident can propose to all his list.\n Each time a proposal is made the hospital is removed from the list*/\n\n /*Trying to create a copy of the arraylist elements not copy of references*/\n ArrayList<ArrayList<Integer>> hospitalsToProposeTo = new ArrayList<ArrayList<Integer>>();\n for (int i = 0; i < n; i++) //O(n)\n hospitalsToProposeTo.add(new ArrayList<Integer>(resident_preference.get(i)));\n\n\n /*list of residents that still can propose(free and hasn't proposed to every hospital)*/\n ArrayList<Integer> proposing = new ArrayList<Integer>();\n arrlistInit(proposing, n, 0, true); //O(n)\n\n\n /*Keep track of each hospital matched residents*/\n ArrayList<ArrayList<Integer>> hospitalResidents = new ArrayList<ArrayList<Integer>>(0);\n for (int i = 0; i < m; i++)\n hospitalResidents.add(new ArrayList<Integer>(0)); //O(m)\n\n /*Array list that holds the value of the lowest matched resident rank in each hospital\n * so each time a resident propose to a full hospital, the resident is swapped with the least ranked rmatched resident */\n ArrayList<Integer> lowestMatchedResidentRank = new ArrayList<Integer>();\n arrlistInit(lowestMatchedResidentRank, m, -1, false); //O(m)\n\n /*we enter the loop as long as some residents aren't done proposing to all hospitals yet O(mn*maximum no of spots)*/\n while (!proposing.isEmpty()) {\n\n /*Get the head of the proposing list*/\n for (int residentIndex = 0; residentIndex < proposing.size(); residentIndex++) {\n int resident = proposing.get(0);\n int hospital = 0;\n int hospitalIndex;\n /*Get the first hospital in the resident list which he hasn't proposed to yet, breaks if he can't no longer propose if matched*/\n for (hospitalIndex = 0; hospitalIndex < hospitalsToProposeTo.get(resident).size() && proposing.contains(resident); hospitalIndex++) {\n hospital = hospitalsToProposeTo.get(resident).get(0);\n int residentRank = hospital_preference.get(hospital).indexOf(resident);\n\n /*hospital is full, loop through the matched residents and see if anyone can be kicked out*/\n if (hospitalResidents.get(hospital).size() == hospitalSlots.get(hospital)) {\n\n if (residentRank < lowestMatchedResidentRank.get(hospital)) {\n /*1.Replace in hospitalResidents\n * 2.Add/remove in resident-matching\n * 3.Remove resident from the proposing list\n * 4.Check if matched resident still has hospitals to propose to (if yes, add to proposing)\n */\n int lowestMatchedResident = hospital_preference.get(hospital).get(lowestMatchedResidentRank.get(hospital));\n\n hospitalResidents.get(hospital).set(hospitalResidents.get(hospital).indexOf(lowestMatchedResident), resident);\n residentMatching.set(lowestMatchedResident, -1);\n residentMatching.set(resident, hospital);\n proposing.remove(proposing.indexOf(resident));\n if (!hospitalsToProposeTo.get(lowestMatchedResident).isEmpty()) {\n proposing.add(lowestMatchedResident);\n }\n\n /*set the lowest rank\n * TODO make it O(1)*/\n int min = 0;\n for (int i = 0; i < hospitalResidents.get(hospital).size(); i++) {\n int tempRank = hospital_preference.get(hospital).indexOf(hospitalResidents.get(hospital).get(i));\n if (tempRank > min)\n min = tempRank;\n }\n lowestMatchedResidentRank.set(hospital, min);\n\n }\n }\n\n /*If there is available spot*/\n else {\n /*1.Add in hospitalResidents\n * 2.Add in resident-matching\n * 3.Set the lowest ranked resident\n * 4.Remove resident from proposing list\n */\n\n /*Update the lowest rank*/\n if (residentRank > lowestMatchedResidentRank.get(hospital))\n lowestMatchedResidentRank.set(hospital, residentRank);\n\n hospitalResidents.get(hospital).add(resident);\n residentMatching.set(resident, hospital);\n proposing.remove(proposing.indexOf(resident));\n }\n\n /*1. Remove hospital from resident's hospitalsToProposeTo\n *2. If resident is matched or proposed to every possible hospital, remove resident from proposing list\n */\n\n hospitalsToProposeTo.get(resident).remove(hospitalsToProposeTo.get(resident).indexOf(hospital));\n if (hospitalsToProposeTo.get(resident).size() == 0 && proposing.contains(resident))\n proposing.remove(proposing.indexOf(resident));\n }\n }\n }\n\n marriage.setResidentMatching(residentMatching);\n return marriage;\n\n }", "protected void optimize() {\n int[][] cutMemo = new int[dimX + 1][dimY + 1];\n Tuple[][] tupleMemo = new Tuple[dimX + 1][dimY + 1];\n Memo memo = new Memo(cutMemo,tupleMemo);\n\n //array is filled with -1 because -1 is used as a flag in the memo\n fillMemo(0, dimX, 0, dimY, cutMemo);\n\n //Calculates optimal value of cloth\n ArrayList<FittedPattern> answer = computeOptimal(dimX, dimY, pattern, memo, new ArrayList<>(), 0);\n coordinates = answer;\n finalValue = memo.getFittedPatternMemo()[dimX][dimY].getOptimalValue();\n\n }", "public ArrayList<String> mostInfluentialSubModular(int k)\n {\n if(k >= graphVertexHashMap.size()){\n return new ArrayList<String>(graphVertexHashMap.keySet());\n }\n if(k ==0) return new ArrayList<String>();\n double changling = (double)k/numVertices;\n\n// if(numVertices >= 900 && (numVertices - k <= 70 )\n// || numVertices >= 800 && (numVertices - k <= 56 )\n// || numVertices >= 700 && (numVertices - k <= 49 )\n// || numVertices >= 600 && (numVertices - k <= 40 )\n// || numVertices >= 500 && (numVertices - k <= 35 )\n// || numVertices >= 400 && (numVertices - k <= 28 )\n// || numVertices >= 300 && (numVertices - k <= 21 )\n// || numVertices >= 200 && (numVertices - k <= 14 )\n// ){\n// ArrayList<String> result = new ArrayList<>(graphVertexHashMap.keySet());\n// for(int i = graphVertexHashMap.size()-1; i >= (graphVertexHashMap.size() - (graphVertexHashMap.size() -k)) ; i--){\n// result.remove(i);\n// }\n// return result;\n// }\n// else if(changling >= 0.80 && numVertices >= 200 ){\n// approximate = true;\n// }\n\n ArrayList<String> orderedResult = new ArrayList<>();\n HashMap<String, Float> S = new HashMap();\n float currentModular = Integer.MIN_VALUE;\n\n for(int i =0; i < k; i++){\n String maxString = \"\";\n float maxValue = (float)Integer.MIN_VALUE;\n\n Iterator it = graphVertexHashMap.entrySet().iterator();\n while(it.hasNext()){\n ArrayList<String> vCopy = new ArrayList<>(S.keySet());\n\n Map.Entry entry = (Map.Entry)it.next();\n String compareString = (String)entry.getKey();\n\n if(S.containsKey(compareString)) continue;\n else{\n vCopy.add(compareString);\n float compareValue = influence(vCopy);\n float approximation = compareValue - currentModular;\n if(approximate && S.size() > 0 && maxValue > 0 && approximation >= ratio){\n maxValue = compareValue;\n maxString = compareString;\n break;\n }else if(compareValue > maxValue){\n maxValue = compareValue;\n maxString = compareString;\n }\n }\n }\n if(!S.containsKey(maxString)){\n S.put(maxString, maxValue);\n currentModular = influence(new ArrayList<>(S.keySet()));\n orderedResult.add(maxString);\n }\n\n if(S.size() >= k) break;\n// System.out.println(S.size());\n }\n return orderedResult;\n }", "private int find_bestSplit(KnowledgeBase kb, int attIndex, ArrayList<ArrayList<ArrayList<Integer>>> multiple_counters) {\r\n\t\tif(multiple_counters.size() >0){\r\n\t\t\tfloat best_Gini = calculImpurity2D(kb.getSamples().size(),multiple_counters.get(0));; // it's a minimum!!\r\n\t\t\tint index_Best_Gini =0;\r\n\t\t\tfloat tmp_gini;\r\n\t\t\tfor(int i=1;i<multiple_counters.size();i++){\r\n\t\t\t\ttmp_gini = calculImpurity2D(kb.getSamples().size(),multiple_counters.get(i));\r\n\t\t\t\tif(tmp_gini<best_Gini){\r\n\t\t\t\t\tbest_Gini = tmp_gini;\r\n\t\t\t\t\tindex_Best_Gini = i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn index_Best_Gini;\r\n\t\t}\r\n\t\treturn 0;\r\n\t\t\r\n\t\t\r\n\t}", "private static void BicingsimulatedAnnealingSearch(int num, int n_est, int nbicis, int nfurgo, int d1, int cas, String Cas, String H, String D, int s) {\n\n\n try {\n\n double MedT = 0;\n //double MedN = 0;\n //double MedB = 0;\n int iteraciones = 100;\n Estado Bicing = new Estado(n_est,nbicis,nfurgo,d1,s,1);\n Bicing.setList_cdesp(iteraciones);\n long StartTime = System.nanoTime();\n Problem problem = new Problem(Bicing, new sucesoresA(), new isGoal(), new Heuristic_Function());\n SimulatedAnnealingSearch search = new SimulatedAnnealingSearch(iteraciones, 1000, 125, 0.00001D);\n SearchAgent agent = new SearchAgent(problem, search);\n List L = search.getPathStates();\n Properties properties = agent.getInstrumentation();\n long EndTime = System.nanoTime();\n Estado E = (Estado) search.getGoalState();\n long time = ((EndTime - StartTime) / 1000000);\n MedT += time;\n //MedB += E.getganancia();\n // MedN += Integer.parseInt(properties.getProperty((String)properties.keySet().iterator().next()));\n // MedB /= num;\n // MedN /= num;\n // MedT /= num;\n //MedB = (Math.round(MedB*100.0)/100.0);\n Writer output;\n output = new BufferedWriter(new FileWriter(\"Estadisticas_\" + Cas + \"_D\" + D + \"_H\" + H + \"S.txt\", true));\n double [] vec = E.getearnings();\n for (int i = 0 ; i < iteraciones; ++i) {\n String S = \"\" + vec[i];\n S = S + '\\n';\n output.append(S);\n }\n output.close();\n\n /*for (int i = 0; i < E.getN_furgo(); ++i) {\n System.out.println(\"Recorrido por furgoneta \" + i + \" \" + E.getIFurgo(i).getLong_t());\n }*/\n //printEstado(E);\n //System.out.println();\n //System.out.println(E.getganancia());\n //printActions(agent.getActions());\n //printInstrumentation(agent.getInstrumentation());\n } catch (Exception var4) {\n var4.printStackTrace();\n }\n\n }", "public void affichageSolution() {\n\t\t//On commence par retirer toutes les traces pré-existantes du labyrinthe\n\t\tfor (int i = 0 ; i < this.laby.getHauteur() ; i++) {\n\t\t\tfor (int j = 0 ; j < this.laby.getLargeur() ; j++) {\n\t\t\t\tif (this.laby.getLabyrinthe()[i][j] instanceof Trace) {\n\t\t\t\t\tthis.laby.getLabyrinthe()[i][j] = new Case();\n\t\t\t\t\t((JLabel)grille.getComponents()[i*this.laby.getLargeur()+j]).setIcon(this.laby.getLabyrinthe()[i][j].imageCase(themeJeu));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//On parcourt toutes les cases du labyrinthe. Si on trouve un filon non extrait dont le chemin qui le sépare au mineur est plus petit que shortestPath, on enregistre la longueur du chemin ainsi que les coordonnees de ledit filon\n\t\tint shortestPath = Integer.MAX_VALUE;\n\t\tint[] coordsNearestFilon = {-1,-1};\n\t\tfor (int i=0 ; i < this.laby.getHauteur() ; i++) {\n\t\t\tfor (int j=0 ; j < this.laby.getLargeur() ; j++) {\n\t\t\t\tif (this.laby.getLabyrinthe()[i][j] instanceof Filon && ((Filon)this.laby.getLabyrinthe()[i][j]).getExtrait() == false) {\n\t\t\t\t\tif (this.laby.solve(j,i) != null) {\n\t\t\t\t\t\tint pathSize = this.laby.solve(j,i).size();\n\t\t\t\t\t\tif (pathSize < shortestPath) {\n\t\t\t\t\t\t\tshortestPath = pathSize;\n\t\t\t\t\t\t\tcoordsNearestFilon[0] = j;\n\t\t\t\t\t\t\tcoordsNearestFilon[1] = i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//Si il n'y a plus de filon non extrait atteignable, on cherche les coordonnes de la clef\n\t\tif (coordsNearestFilon[0] == -1) {\n\t\t\tcoordsNearestFilon = this.laby.getCoordsClef();\n\t\t\t//Si il n'y a plus de filon non extrait atteignable et que la clef a deja ouvert la porte, on cherche les coordonnes de la sortie\n\t\t\tif (coordsNearestFilon == null)\tcoordsNearestFilon = this.laby.getCoordsSortie();\n\t\t}\n\n\t\t//On cree une pile qui contient des couples de coordonnees qui correspondent a la solution, puis on depile car le dernier element est l'objectif vise\n\t\tStack<Integer[]> solution = this.laby.solve(coordsNearestFilon[0], coordsNearestFilon[1]);\n\t\tsolution.pop();\n\n\t\t//Tant que l'on n'arrive pas au premier element de la pile (cad la case ou se trouve le mineur), on depile tout en gardant l'element depile, qui contient les coordonnees d'une trace que l'on dessine en suivant dans la fenetre\n\t\twhile (solution.size() != 1) {\n\t\t\tInteger[] coordsTmp = solution.pop();\n\t\t\tTrace traceTmp = new Trace();\n\t\t\tthis.laby.getLabyrinthe()[coordsTmp[1]][coordsTmp[0]] = new Trace();\n\t\t\t((JLabel)grille.getComponents()[coordsTmp[1]*this.laby.getLargeur()+coordsTmp[0]]).setIcon(traceTmp.imageCase());\n\t\t}\n\t\tSystem.out.println(\"\\n========================================== SOLUTION =====================================\\n\");\n\t\tthis.affichageLabyrinthe();\n\t}", "private void findLargestNNIPointsIndexPair(float ratioInh, float ratioAct) {\n ArrayList<Point> pts0 = new ArrayList<Point>();\n ArrayList<Point> pts1 = new ArrayList<Point>();\n Dimension dim = layoutPanel.getLayoutSize();\n int height = dim.height;\n int width = dim.width;\n int size = height * width;\n int newNListSize;\n if (ratioInh > ratioAct) {\n newNListSize = (int) (size * ratioInh);\n pts0 = cnvIndexList2Points(layoutPanel.activeNList);\n pts1 = cnvIndexList2Points(layoutPanel.inhNList);\n } else {\n newNListSize = (int) (size * ratioAct);\n pts0 = cnvIndexList2Points(layoutPanel.inhNList);\n pts1 = cnvIndexList2Points(layoutPanel.activeNList);\n }\n double len = Math.sqrt((double) size / (double) newNListSize);\n\n ArrayList<Point> union = new ArrayList<Point>(pts0);\n union.addAll(pts1);\n double maxNNI = calcNearestNeighborIndex(union);\n ArrayList<Point> maxPts0 = pts0;\n ArrayList<Point> maxPts1 = pts1;\n for (int xShift = (int) Math.floor(-len / 2); xShift <= Math\n .ceil(len / 2); xShift++) {\n for (int yShift = (int) Math.floor(-len / 2); yShift <= Math\n .ceil(len / 2); yShift++) {\n if (xShift == 0 && yShift == 0) {\n continue;\n }\n int xShift0 = (int) Math.ceil((double) xShift / 2);\n int xShift1 = (int) Math.ceil((double) -xShift / 2);\n int yShift0 = (int) Math.ceil((double) yShift / 2);\n int yShift1 = (int) Math.ceil((double) -yShift / 2);\n // System.out.println(\"xShift = \" + xShift + \", xShift0 = \" +\n // xShift0 + \", xShift1 = \" + xShift1);\n ArrayList<Point> sftPts0 = getShiftedPoints(pts0, xShift0,\n yShift0);\n ArrayList<Point> sftPts1 = getShiftedPoints(pts1, xShift1,\n yShift1);\n union = new ArrayList<Point>(sftPts0);\n union.addAll(sftPts1);\n double nni = calcNearestNeighborIndex(union);\n if (nni > maxNNI) {\n maxNNI = nni;\n maxPts0 = sftPts0;\n maxPts1 = sftPts1;\n }\n }\n }\n\n if (ratioInh > ratioAct) {\n layoutPanel.activeNList = cnvPoints2IndexList(maxPts0);\n layoutPanel.inhNList = cnvPoints2IndexList(maxPts1);\n } else {\n layoutPanel.inhNList = cnvPoints2IndexList(maxPts0);\n layoutPanel.activeNList = cnvPoints2IndexList(maxPts1);\n }\n }", "public void pruneWithApriori(double startEpsilon, double epsilonMultiplier, double shrinkFactor, double maxApproximationSize, int numBuckets, int topK, long startMS){\n CB = new CorrelationBounding(HB.data, useEmpiricalBounds, parallel);\r\n HierarchicalBounding.CB = CB; // pass the corrbounding object to the hierarchbounding object to prevent double work\r\n\r\n // get clusters:\r\n long startClustering = System.currentTimeMillis();\r\n System.out.print(\"constructing hierarchical clustering...\");\r\n RecursiveClustering RC = new RecursiveClustering(HB.data, CB, HB.maxLevels, HB.defaultDesiredClusters, HB.useKMeans, HB.breakFirstKLevelsToMoreClusters, HB.clusteringRetries);\r\n RC.fitRecursiveClusters(startEpsilon, epsilonMultiplier);\r\n long stopClustering = System.currentTimeMillis();\r\n System.out.println(\" --> clustering finished, took \" + ((stopClustering-startClustering)/1000) + \" seconds\");\r\n this.allclusters = RC.allClusters;\r\n this.clustersPerLevel = RC.clustersPerLevel;\r\n this.globalClustID = RC.globalClustID;\r\n\r\n CB.initializeBoundsCache(globalClustID, useEmpiricalBounds);\r\n\r\n ArrayList<Cluster> topLevelClusters = this.clustersPerLevel.get(0);\r\n Cluster rootCluster = topLevelClusters.get(0);\r\n this.rootCluster = rootCluster;\r\n\r\n\r\n\r\n // progressive approximation class in order to get results quickly:\r\n ProgressiveApproximation PA = new ProgressiveApproximation(corrThreshold, useEmpiricalBounds, minJump, maxApproximationSize, header, CB);\r\n\r\n\r\n\r\n //multipoles root candidate:\r\n ArrayList<Cluster> firstClusterComb = new ArrayList<>(2);\r\n firstClusterComb.add(rootCluster);// firstClusterComb.add(rootCluster);\r\n// List<ClusterCombination> candidates = new ArrayList<>(1);\r\n// ClusterCombination rootcandidate = new MultipoleClusterCombination(firstClusterComb);\r\n// candidates.add(rootcandidate);\r\n\r\n\r\n\r\n //multipearson root candidate:\r\n// ArrayList<Cluster> rootLHS = new ArrayList<>(1); rootLHS.add(rootCluster);\r\n// ArrayList<Cluster> rootRHS = new ArrayList<>(1); rootRHS.add(rootCluster); //rootRHS.add(rootCluster); rootRHS.add(rootCluster);\r\n// ClusterCombination rootcandidate = new MultiPearsonClusterCombination(rootLHS, rootRHS);\r\n\r\n\r\n\r\n\r\n //progress overview:\r\n System.out.print(\"|\");\r\n for(int i = 0; i<100; i++){\r\n System.out.print(\".\");\r\n }\r\n System.out.print(\"|\");\r\n System.out.println();\r\n\r\n\r\n // level-wise evaluation of the candidates\r\n for(int p=2; p<=maxP; p++){\r\n firstClusterComb.add(rootCluster);\r\n ClusterCombination rootcandidate = new MultipoleClusterCombination(firstClusterComb);\r\n\r\n List<ClusterCombination> candidates = new ArrayList<>(1);\r\n candidates.add(rootcandidate);\r\n\r\n System.out.println(\"---------------start evaluating level: \"+ p + \" at time \" + LocalTime.now() +\". Number of positives so far: \" + this.positiveResultSet.size() +\". Runtime so far: \" + (System.currentTimeMillis() - startMS)/1000);\r\n\r\n Map<Boolean, List<ClusterCombination>> groupedDCCs = evaluateCandidates(candidates, shrinkFactor, maxApproximationSize, parallel);\r\n\r\n if(positiveDCCs.size() > topK){\r\n positiveDCCs = getStream(positiveDCCs, parallel)\r\n .sorted((cc1, cc2) -> Double.compare(cc2.getLB(), cc1.getLB()))\r\n .limit(topK)\r\n .collect(Collectors.toList());\r\n PA.corrThreshold = positiveDCCs.get(positiveDCCs.size()-1).getLB();\r\n corrThreshold = PA.corrThreshold;\r\n }\r\n\r\n\r\n //progressive approximation within this level p:\r\n List<ClusterCombination> approximatedCCs = getStream(groupedDCCs.get(false), parallel).filter(dcc -> dcc.getCriticalShrinkFactor() <= 1).collect(Collectors.toList());\r\n// PA.testApproximationQuality(approximatedCCs, numBuckets, p, parallel);\r\n this.positiveDCCs = PA.ApproximateProgressively(approximatedCCs, numBuckets, positiveDCCs, parallel, topK, startMS);\r\n corrThreshold = PA.corrThreshold; // for topK -> carry over the updated tau to next p\r\n this.positiveResultSet = PostProcessResults.removeDuplicatesAndToString(this.positiveDCCs, header, CB, parallel);\r\n\r\n // get the approximated candidates to generate the next-level candidates from. the advantage is that we get a head-start down the clustering tree and do not have to start from the top\r\n ArrayList<ClusterCombination> DCCs = new ArrayList<>(groupedDCCs.get(false).size() + groupedDCCs.get(true).size());\r\n DCCs.addAll(groupedDCCs.get(false)); DCCs.addAll(groupedDCCs.get(true));\r\n System.out.println(\"tau updated to \" + corrThreshold);\r\n\r\n\r\n\r\n// if(p<maxP){\r\n// System.out.println(\"level \" + p + \" finished at time \"+ LocalTime.now() + \". generating candidates for level \" + (p+1) +\". #DCCs: \" + DCCs.size() +\". positives so far: \" + this.positiveResultSet.size() + \". Runtime so far (s): \" + (System.currentTimeMillis()-startMS)/1000);\r\n//\r\n//\r\n//\r\n// if(DCCs.get(0).isMultipoleCandidate()){ // multipole pattern\r\n//\r\n// candidates = generateCandidates(DCCs, parallel);\r\n//\r\n// }else{ // multiPearson pattern -> make distinction on adding vectors to LHS or RHS. better performance: use HIerarchicalbounding without level generation.\r\n//\r\n//\r\n// candidates = new ArrayList<>();\r\n//\r\n//\r\n//\r\n// // first generate candidates by adding to RHS\r\n// if(parallel){\r\n// DCCs = (ArrayList<ClusterCombination>) DCCs.parallelStream()\r\n// .sorted(this::lexicographicalOrdering)\r\n// .collect(Collectors.toList());\r\n// }else{\r\n// DCCs.sort(this::lexicographicalOrdering);\r\n// }\r\n// List<ClusterCombination> partial = generateCandidates(DCCs, parallel);\r\n// if(partial!= null){\r\n// candidates.addAll(partial);\r\n// }\r\n//\r\n// //now by adding to LHS: (hack by swapping the LHS and RHS and calling the same methods\r\n// //note that we do not need to swap those in which the size of the LHS and RHS is the same\r\n// ArrayList<ClusterCombination> swappedDCCs;\r\n// if(parallel){\r\n// swappedDCCs = (ArrayList<ClusterCombination>) DCCs.parallelStream()\r\n// .filter(cc -> cc.getLHS().size() != cc.getRHS().size()) // ignore those where lhs and rhs are of the same size\r\n// .collect(Collectors.toList());\r\n// swappedDCCs.parallelStream()\r\n// .forEach(cc -> ((MultiPearsonClusterCombination) cc).swapLeftRightSide());\r\n//\r\n// swappedDCCs = (ArrayList<ClusterCombination>) swappedDCCs.parallelStream()\r\n// .sorted(this::lexicographicalOrdering)\r\n// .collect(Collectors.toList());\r\n// }else{\r\n// swappedDCCs = (ArrayList<ClusterCombination>) DCCs.stream()\r\n// .filter(cc -> cc.getLHS().size() != cc.getRHS().size()) // ignore those where lhs and rhs are of the same size\r\n// .collect(Collectors.toList());\r\n//\r\n// swappedDCCs.forEach(cc -> ((MultiPearsonClusterCombination) cc).swapLeftRightSide());\r\n// swappedDCCs.sort(this::lexicographicalOrdering);\r\n// }\r\n//\r\n// partial = generateCandidates(swappedDCCs, parallel);\r\n// if(partial!= null){\r\n// candidates.addAll(partial);\r\n// }\r\n//\r\n//\r\n// }\r\n//\r\n//\r\n// }\r\n }\r\n\r\n }", "public void visiualizeLastSearch(){\r\n\t\tint number=0;\r\n\t\tNode dummy;\r\n\t\tNode next;\r\n\t\tfor(int i=sl.height(); i>=0; i--){\r\n\t\t\tdummy = sl.getFrom(0,0);\r\n\t\t\tnext = sl.getFrom(i,0);\r\n\t\t\tString seperator=\"-\";\r\n\t\t\tfor(int j=0; j<(sl.size()+2); j++){\r\n\r\n\t\t\t\tnumber = next.getKey();\r\n\t\t\t\t\r\n\t\t\t\tif(i<sl.height() && sl.getVisited()[i+1].getKey()!=sl.getVisited()[i].getKey() && number>sl.getVisited()[i+1].getKey() && number<=sl.getVisited()[i].getKey())\r\n\t\t\t\t\tseperator = \"*\";\r\n\t\t\t\telse\r\n\t\t\t\t\tseperator = \"-\";\r\n\r\n\t\t\t\tif(number==dummy.getKey()){\r\n\r\n\t\t\t\t\tif(number==minf)\r\n\t\t\t\t\t\tSystem.out.print(\"-inf\");\r\n\t\t\t\t\telse if(number==inf)\r\n\t\t\t\t\t\tSystem.out.print(repeatStr(seperator,3)+\"inf\");\r\n\t\t\t\t\telse\r\n\t\t\t\t\tSystem.out.print(repeatStr(seperator,2)+number);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\tSystem.out.print(repeatStr(seperator,4));\r\n\t\t\t\t\r\n\t\t\t\tif(dummy.getKey()==number)\r\n\t\t\t\t\tnext = next.getRight();\r\n\t\t\t\t\r\n\t\t\t\tdummy = dummy.getRight();\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "private List<Pair<Integer, Integer>> getBestPath(Pair<Integer, Integer> curLocation, Pair<Integer, Integer> dest) {\n\t\tList<Pair<Integer, Integer>> path = new LinkedList<Pair<Integer, Integer>>();\n\t\t\n\t\t\n\t\tNode current = new Node(curLocation.getX(), curLocation.getY(), getHitProbability(curLocation.getX(), curLocation.getY()));\n\t\tNode target = new Node(dest.getX(), dest.getY(), getHitProbability(dest.getX(), dest.getY()));\n\t\tList<Node> openSet = new ArrayList<>();\n List<Node> closedSet = new ArrayList<>();\n \n \n while (true) {\n openSet.remove(current);\n List<Node> adjacent = getAdjacentNodes(current, closedSet, target);\n\n // Find the adjacent node with the lowest heuristic cost.\n for (Node neighbor : adjacent) {\n \tboolean inOpenset = false;\n \tList<Node> openSetCopy = new ArrayList<>(openSet);\n \tfor (Node node : openSetCopy) {\n \t\tif (neighbor.equals(node)) {\n \t\t\tinOpenset = true;\n \t\t\tif (neighbor.getAccumulatedCost() < node.getAccumulatedCost()) {\n \t\t\t\topenSet.remove(node);\n \t\t\t\topenSet.add(neighbor);\n \t\t\t}\n \t\t}\n \t}\n \t\n \tif (!inOpenset) {\n \t\topenSet.add(neighbor);\n \t}\n }\n\n // Exit search if done.\n if (openSet.isEmpty()) {\n System.out.printf(\"Target (%d, %d) is unreachable from position (%d, %d).\\n\",\n target.getX(), target.getY(), curLocation.getX(), curLocation.getY());\n return null;\n } else if (/*isAdjacent(current, target)*/ current.equals(target)) {\n break;\n }\n\n // This node has been explored now.\n closedSet.add(current);\n\n // Find the next open node with the lowest cost.\n Node next = openSet.get(0);\n for (Node node : openSet) {\n if (node.getCost(target) < next.getCost(target)) {\n next = node;\n }\n }\n// System.out.println(\"Moving to node: \" + current);\n current = next;\n }\n \n // Rebuild the path using the node parents\n path.add(new Pair<Integer, Integer>(curLocation.getX(), curLocation.getY()));\n while(current.getParent() != null) {\n \tcurrent = current.getParent();\n \tpath.add(0, new Pair<Integer, Integer>(current.getX(), current.getY()));\n }\n \n if (path.size() > 1) {\n \tpath.remove(0);\n }\n \n\t\treturn path;\n\t}", "@Override\n\tpublic BoardLocation findBestLocWhenStuck() {\n\t\treturn null;\n\t}", "public int state_regions_stranded(int rcount,HashMap<Integer,Integer> rmap,int chokepoint_path,int max_stranded) {\r\n\t\t\r\n\t\tHashMap<Integer,LinkedList<Integer>> regions=new HashMap<Integer,LinkedList<Integer>> ();\r\n\t\tfor(Integer nodeIndex:rmap.keySet()) {\r\n\t\t\tint region=rmap.get(nodeIndex);\r\n\t\t\tif(region!=-1) {\r\n\t\t\tif(regions.containsKey(region)) {\r\n\t\t\t\tLinkedList<Integer> l=regions.get(region);\r\n\t\t\t\tl.add(nodeIndex);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tLinkedList<Integer> l=new LinkedList<Integer>();\r\n\t\t\t\tl.add(nodeIndex);\r\n\t\t\t\tregions.put(region, l);\r\n\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tHashMap<Integer,LinkedList<Integer>> regionsNeighbor=new HashMap<Integer,LinkedList<Integer>> ();\r\n\t\t\r\n\t\tfor(Integer regionIndex:regions.keySet()) {\r\n\t\t\tLinkedList<Integer> regionNode=regions.get(regionIndex);\r\n\t\t\t\r\n\t\t\tLinkedList<Integer> regionNeighbor=new LinkedList<Integer>();\r\n\t\t\tfor(Integer nodeIndex:regionNode) {\r\n\t\t\t\tfor(Integer itsNeighbor:nowMap.get(nodeIndex)) {\r\n\t\t\t\t\tif(!regionNode.contains(itsNeighbor))\r\n\t\t\t\t\tif(!regionNeighbor.contains(itsNeighbor))\r\n\t\t\t\t\t\tregionNeighbor.add(itsNeighbor);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tregionsNeighbor.put(regionIndex, regionNeighbor);\r\n\t\t}\r\n\t\t\r\n\t\tboolean ok=false;;\r\n\r\n\t\tfor (Integer p : paths.keySet()) {\r\n\t\t\tif(!paths.get(p).peek().equals(EndPoint.get(p))) {\r\n\t\t\tok=false;\r\n\t\t\tint topIndex = paths.get(p).peek().index;\r\n\t\t\tfor (Integer regionIndex : regionsNeighbor.keySet()) {\r\n\t\t\t\tLinkedList<Integer> itsNeighbors = regionsNeighbor.get(regionIndex);\r\n\r\n\t\t\t\tif (itsNeighbors.contains(topIndex)&&itsNeighbors.contains(EndPoint.get(p).index)) {\r\n\t\t\t\t\tok=true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tif(!ok) {\r\n\t\t\t\t\r\n\t\t\t\tif(!nowMap.get(paths.get(p).peek().index).contains(EndPoint.get(p).index))\r\n\t\t\t\treturn p;\r\n\t\t\t}\r\n\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn 0;\r\n\t}", "private void lastResortFindPeer() {\n\t\tDecentLogger.write(\"Resolving peers from DNS (last resort)\");\n\t\tfor(String seed: DNS_SEEDS) {\n\t\t\tArrayList<InetAddress> hosts = DNSResolver.getARecords(seed);\n\t\t\tif(hosts != null) {\n\t\t\t\tcheckList(hosts);\n\t\t\t}\n\t\t}\n\t}", "void solve() throws IOException {\n int[] nk = ril(2);\n int n = nk[0];\n int k = nk[1];\n int[] p = ril(n);\n int[] b = ril(k);\n for (int i = 0; i < n; i++) p[i]--;\n for (int i = 0; i < k; i++) b[i]--;\n\n int[] numToIdx = new int[n];\n for (int i = 0; i < n; i++) numToIdx[p[i]] = i;\n\n boolean[] remove = new boolean[n];\n Arrays.fill(remove, true);\n for (int bi : b) remove[bi] = false;\n List<Integer> toRemove = new ArrayList<>(n - k);\n for (int i = 0; i < n; i++) if (remove[i]) toRemove.add(i);\n Collections.sort(toRemove);\n\n int[] prevSmaller = new int[n];\n prevSmaller[0] = -1;\n int prevIdx = remove[p[0]] ? -1 : 0;\n for (int i = 1; i < n; i++) {\n int j = prevIdx;\n while (j != -1 && p[i] < p[j]) j = prevSmaller[j];\n prevSmaller[i] = j;\n if (!remove[p[i]]) prevIdx = i;\n }\n int[] nextSmaller = new int[n];\n nextSmaller[n-1] = n;\n prevIdx = remove[p[n-1]] ? n : n-1;\n for (int i = n-2; i >= 0; i--) {\n int j = prevIdx;\n while (j != n && p[i] < p[j]) j = nextSmaller[j];\n nextSmaller[i] = j;\n if (!remove[p[i]]) prevIdx = i;\n }\n\n int[] init = new int[n];\n Arrays.fill(init, 1);\n SegmentTree st = new SegmentTree(init);\n long ans = 0;\n for (int x : toRemove) {\n int idx = numToIdx[x];\n int l = prevSmaller[idx] + 1;\n int r = nextSmaller[idx] - 1;\n ans += st.query(l, r+1);\n st.modify(idx, 0);\n }\n pw.println(ans);\n }", "public ModelParams optimize() throws Exception {\n\t\tint iterCount = 0;\n\t\tdivergence = KLDivergenceCalculator.calculate(cState, tState);\n\t\tSystem.out.println(\"KL Divergence : \" + divergence);\n\t\t// ((DivergenceChart) BeanFinder\n\t\t// .findBean(MetaConstants.BEAN_DIVERGENCE_CHART)).update(\n\t\t// iterCount, divergence);\n\t\tdouble delta[] = null;\n\t\tdouble theta[] = data.getParams().getParams();\n\t\tdouble newDivergence = 0.0d;\n\t\tdouble initialStep = data.getInitialStepSize();\n\t\tboolean optimized = false;\n\t\tdo {\n\t\t\tdelta = computeGradient(theta);\n\t\t\tfor (double step = initialStep; iterCount < data.getMaxIterations(); step /= 10) {\n\t\t\t\tSystem.out.println(\"Step size : \" + step);\n\t\t\t\tSystem.out.println(\"KL divergence before taking a step : \"\n\t\t\t\t\t\t+ KLDivergenceCalculator.calculate(cState, tState));\n\t\t\t\tfor (int i = 0; i < delta.length; i++) {\n\t\t\t\t\tif (Double.isNaN(delta[i]))\n\t\t\t\t\t\tSystem.out.print(\"delta is NAN!!\" + delta[i] + \", \");\n\t\t\t\t\ttheta[i] -= step * delta[i];\n\t\t\t\t\tSystem.out.print((theta[i]) + \", \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t\tgetNewState(theta);\n\t\t\t\titerCount++;\n\t\t\t\tnewDivergence = KLDivergenceCalculator\n\t\t\t\t\t\t.calculate(cState, tState);\n\t\t\t\tSystem.out.println(\"KL Divergence : \" + newDivergence);\n\t\t\t\t// ((DivergenceChart) BeanFinder\n\t\t\t\t// .findBean(MetaConstants.BEAN_DIVERGENCE_CHART)).update(\n\t\t\t\t// iterCount, newDivergence);\n\t\t\t\tif (newDivergence < divergence) {\n\t\t\t\t\tdivergence = newDivergence;\n\t\t\t\t\tinitialStep = step;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// before taking the next step size, reset theta to what it was\n\t\t\t\tfor (int i = 0; i < delta.length; i++)\n\t\t\t\t\ttheta[i] += step * delta[i];\n\t\t\t\tgetNewState(theta); // Added for checking. Not required.\n\t\t\t}\n\t\t\toptimized = optimized(theta);\n\t\t} while (!optimized && iterCount < data.getMaxIterations());\n\t\tModelParams optimParams = null;\n\t\tif (optimized) {\n\t\t\toptimParams = new ModelParams();\n\t\t\toptimParams.setParams(theta);\n\t\t}\n\t\treturn optimParams;\n\t}", "public void sync(){\n\t\tDHTNode myNode = dynamoRing.getNode(MY_ADDRESS);\n\t\tArrayList<DHTNode> dependentNodes = dynamoRing.getNPredecessors(myNode, REPLICATION_COUNT-1);\n\t\tdependentNodes.add(myNode);\n\t\tSparseArray<String> dependentNodeMap = new SparseArray<String>();\n\t\tHashMap<String, KeyVal> resultMap = new HashMap<String, KeyVal>();\n\t\tfor(int i=0;i<dependentNodes.size();i++)\t// Ideally it should contact only N-1 successors and N-1 predecessors\n\t\t\t\t\t\t\t\t\t\t\t\t\t// but for total node count = 5 and replica count = 2, this\n\t\t\t\t\t\t\t\t\t\t\t\t\t// number spans through all the nodes\n\t\t\tdependentNodeMap.put(dependentNodes.get(i).getAddress(), dependentNodes.get(i).getId());\n\t\t\n\t\tArrayList<DHTNode> nodeList = dynamoRing.getAllNodes();\n\t\tfor(int i=0;i<nodeList.size();i++){\n\t\t\tif(nodeList.get(i)==myNode)\n\t\t\t\tcontinue;\n\t\t\tArrayList<KeyVal> keyValList = readDHTAllFromNode(nodeList.get(i));\n\t\t\tfor(int j=0;j<keyValList.size();j++){\n\t\t\t\tKeyVal keyVal = keyValList.get(j);\n\t\t\t\tint responsibleNodeAddress = dynamoRing.getResponsibleNode(keyVal.getKey()).getAddress();\n\t\t\t\tif(dependentNodeMap.get(responsibleNodeAddress)==null)\n\t\t\t\t\tcontinue;\n\t\t\t\telse{\n\t\t\t\t\tif(resultMap.get(keyVal.getKey())==null){\n\t\t\t\t\t\tresultMap.put(keyVal.getKey(), keyVal);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tint oldVersion = Integer.parseInt(resultMap.get(keyVal.getKey()).getVersion());\n\t\t\t\t\t\tint newVersion = Integer.parseInt(keyVal.getVersion());\n\t\t\t\t\t\tif(newVersion > oldVersion)\n\t\t\t\t\t\t\tresultMap.put(keyVal.getKey(), keyVal);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tIterator<Entry<String, KeyVal>> resultIterator = resultMap.entrySet().iterator();\n\t\twhile(resultIterator.hasNext()){\n\t\t\tEntry<String, KeyVal> nextEntry = resultIterator.next();\n\t\t\tKeyVal keyVal = nextEntry.getValue();\n\t\t\twriteLocalKeyVal(keyVal.getKey(), keyVal.getVal(), keyVal.getVersion());\n\t\t}\n\t\t\n\t}", "public Map<Integer,List<Node>> getPrefixes(Map<Agent,Integer>budgetMap)\n {\n Map<Agent,Pair<Node,Node>> agent_goal_start = problem.getAgentsAndStartGoalNodes();\n Set<Agent> agents = agent_goal_start.keySet();\n pAgents = new PriorityQueue<>(new CompareAgentsPriority());\n //PriorityQueue<Agent> pAgents = new PriorityQueue<>(new CompareAgentsHeurstics());\n\n prefixes = new HashMap<>();\n pAgents.addAll(agents);\n int numOfNodesToDevelop;\n while(pAgents.size()>0)\n {\n Agent agent = pAgents.poll();\n\n /* if(agent.isDone())\n {\n\n List<Node> done = new ArrayList<>();\n done.add(agent.getGoal());\n prefixes.put(agent.getId(),done);\n // inhabitAgent(agent.getGoal().getId(),0);// TODO: 22/09/2019 remove\n\n }*/\n //else {\n numOfNodesToDevelop = budgetMap.get(agent);\n Node current = agent.getCurrent();\n List<Node> prefix;\n\n\n if(this instanceof BudgetOrientedMALRTA)\n prefix = calculatePrefix(current, agent.getGoal(), numOfNodesToDevelop, agent);\n else\n prefix = super.calculatePrefix(current, agent.getGoal(), numOfNodesToDevelop, agent);\n\n if (prefix == null) {\n System.out.println(\"No Solution agent \" + agent.getId()+\" can't move from \"+agent.getCurrent() + \" id = \"+agent.getCurrent().getId());\n prefixes.put(agent.getId(), prefix);\n return prefixes;\n\n }\n\n\n //Updating node\n for (int i = 0; i < prefix.size() - 1; i++) {\n updateNode(prefix.get(i).getId(), i);\n }\n inhabitAgent(prefix.get(prefix.size() - 1).getId(),prefix.size() - 1 );\n prefixes.put(agent.getId(), prefix);\n\n //}\n\n }\n\n // if(this instanceof BudgetOrientedMALRTA)\n // System.out.println(\"The amount of leftover after this round = \"+((BudgetOrientedMALRTA)this).getLeftover());\n\n return prefixes;\n }", "Vector selectBestSegPtsSet(Vector IterWiseSegPts){\n\t\tVector Vect = new Vector();\t\t\t// to return final set of segment pts\n\t\tVector TempVect = new Vector(); // to store temporary iteration results\n\t\tint index = -1;\n\t\t// if it consists of only common pts\n\t\tif(IterWiseSegPts.size() == 1) {\n\t\t\tindex = 0;\n\t\t}\n\t\t\n\t\t//if it consists of only two segment pt sets \n\t\telse if(IterWiseSegPts.size() == 2){\n\t\t\tTempVect = copyVectorIndex(IterWiseSegPts, TempVect, 0);\n\t\t\tdouble PrevError = (Double)TempVect.get(TempVect.size()-1);\n\t\t\tTempVect = clearVector(TempVect);\n\t\t\tTempVect = copyVectorIndex(IterWiseSegPts, TempVect, 1);\n\t\t\tdouble NewError = (Double)TempVect.get(TempVect.size()-1);\n\t\t\tTempVect = clearVector(TempVect);\n\t\t\t\n\t\t\tif((PrevError - NewError) > 100.0){ //selecting the second set if error reduction is > 100.0\n\t\t\t\tindex = 1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tindex = 0;\n\t\t\t}\n\t\t}\n\t\telse if(IterWiseSegPts.size() > 2){\n\t\t\tTempVect = copyVectorIndex(IterWiseSegPts, TempVect, 0);\n\t\t\tdouble PrevError = (Double)TempVect.get(TempVect.size()-1);\n\t\t\tTempVect = clearVector(TempVect);\n\t\t\t\n\t\t\tTempVect = copyVectorIndex(IterWiseSegPts, TempVect, 1);\n\t\t\tdouble NewError = (Double)TempVect.get(TempVect.size()-1);\n\t\t\tTempVect = clearVector(TempVect);\n\t\t\tdouble ChangeInPrevError = PrevError - NewError;\n\t\t\tdouble ChangeInNewError;\n\t\t\tPrevError = NewError;\n\t\t\tif(ChangeInPrevError < 15.0){ //selecting the first set if change in error is < 30.0\n\t\t\t\tindex = 0;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tint Iterator = 2;\n\t\t\t\tint Iterations = IterWiseSegPts.size();\n\t\t\t\twhile(Iterator < Iterations){\n\t\t\t\t\tTempVect = copyVectorIndex(IterWiseSegPts, TempVect, Iterator);\n\t\t\t\t\tNewError = (Double)TempVect.get(TempVect.size()-1);\n\t\t\t\t\tTempVect = clearVector(TempVect);\n\t\t\t\t\tChangeInNewError = PrevError - NewError;\n\t\t\t\t\t// if new iteration's error is less (or more) than prev itertion within 30.0 \n\t\t\t\t\t// or if previous change in segment pts Error > 3 times new change in segment pts error\n\t\t\t\t\tif( (ChangeInNewError < 30.0) && (NewError < 1000.0)){// (ChangeInPrevError > (3 * ChangeInNewError))\n\t\t\t\t\t\tindex = Iterator - 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tChangeInPrevError = ChangeInNewError;\n\t\t\t\t\tPrevError = NewError;\n\t\t\t\t\tIterator++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\n\t\t//}\n\t\tTempVect = clearVector(TempVect);\n\t\tTempVect = copyVectorIndex(IterWiseSegPts, TempVect, index);\n\t\t//TempVect = copyVectorIndex(IterWiseSegPts, TempVect, IterWiseSegPts.size() -1);\n\t\tindex = 0;\n\t\twhile(index < (TempVect.size()-1)){\n\t\t\tVect.add((Integer)TempVect.get(index++));\n\t\t}\n\t\treturn Vect;\n\t}", "@Override\n\tprotected double[] calculateNeighbourhoodBest(int i) {\n\t\t\t//System.out.println(\"Gbest particle from local typology!\");\n\t\t\tint indexBestParticle = i;\n\t\t\tint indexLeftNeighbour = (i > 0) ? i - 1 : swarmSize - 1;\n\t\t\tint indexRightNeighbour = (i < swarmSize - 1) ? i + 1 : 0;\t\t\n\t\t\t\t\t\n\t\t\tdouble nBestFitness = swarm.get(i).getPBestFitness();\n\t\t\tdouble leftNeighborParticlePBestFitness = swarm.get(indexLeftNeighbour).getPBestFitness();\n\t\t\tdouble rightNeighborParticlePBestFitness = swarm.get(indexRightNeighbour).getPBestFitness();\n\t\t\t\t\t\n\t\t\tif (leftNeighborParticlePBestFitness < nBestFitness) {\n\t\t\t\tindexBestParticle = indexLeftNeighbour;\n\t\t\t\tnBestFitness = leftNeighborParticlePBestFitness;\n\t\t\t}\n\t\t\tif (rightNeighborParticlePBestFitness < nBestFitness) {\n\t\t\t\tindexBestParticle = indexRightNeighbour;\n\t\t\t\tnBestFitness = rightNeighborParticlePBestFitness;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\treturn swarm.get(indexBestParticle).getPBest();\n\t\t\t//return swarm.get(indexBestParticle);\n\t\t\t\n\t}", "public Map<Integer, Driver> getDreamTeam(Integer k){\r\n\t\t\r\n\t\t// inizializzo qui il tasso di sconofitta perchè se rifaccio ricorsione da zero\r\n\t\t// e non trovo tasso migliore della ricorsione prec che non c'entra nulla\r\n\t\t// non riesco a trovare un nuovo best\r\n\t\tbestTassoSconfitta = Integer.MAX_VALUE;\r\n\t\t// VARIABILI PER LA RICORSIONE\r\n\t\tMap<Integer, Driver> parziale = new HashMap<Integer, Driver>();\r\n\t\tthis.bestTeam = new HashMap<Integer, Driver>();\r\n\r\n\t\tInteger tassoSconfitta = 0;\r\n\t\tcerca(parziale, 0, k, tassoSconfitta);\r\n\t\t\r\n\t\treturn this.bestTeam;\r\n\t\t\r\n\t}", "public SolutionType getBestSolution();", "void findInstantiations (final Buffers buffers)\n\t{\n\t\tbuffers.removeDecayedChunks();\n\n\t\tHashSet<Instantiation> set = new HashSet<Instantiation>();\n\t\tbuffers.sortGoals();\n\n\t\tif (buffers.numGoals() == 0)\n\t\t{\n for (Production p : productions.values()) {\n Instantiation inst = p.instantiate(buffers);\n if (inst != null) set.add(inst);\n }\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor (int i=0 ; set.isEmpty() && i<buffers.numGoals() ; i++)\n\t\t\t{\n\t\t\t\tbuffers.tryGoal (i);\n\t\t\t\tif (threadedCognitionTrace)\n\t\t\t\t\tmodel.output (\"*** (tct) trying goal \" + buffers.get(Symbol.goal));\n for (Production p : productions.values()) {\n Instantiation inst = p.instantiate(buffers);\n if (inst != null) set.add(inst);\n }\n\t\t\t}\n\t\t}\n\n\t\tif (threadedCognitionTrace)\n\t\t\tmodel.output (\"*** (tct) found \"+set.size()+\" match\"+(set.size()==1 ? \"\" : \"es\"));\n\n\t\tif (!set.isEmpty())\n\t\t{\n\t\t\tif (conflictSetTrace) model.output (\"Conflict Set:\");\n\t\t\tIterator<Instantiation> itInst = set.iterator();\n\t\t\tInstantiation highestU = itInst.next();\n\t\t\tif (conflictSetTrace) model.output (\"* (\" + String.format(\"%.3f\",highestU.getUtility()) + \") \" + highestU);\n\t\t\twhile (itInst.hasNext())\n\t\t\t{\n\t\t\t\tInstantiation inst = itInst.next();\n\t\t\t\tif (conflictSetTrace) model.output (\"* (\" + String.format(\"%.3f\",inst.getUtility()) + \") \" + inst);\n\t\t\t\tif (inst.getUtility() > highestU.getUtility()) highestU = inst;\n\t\t\t}\n\n\t\t\tfinal Instantiation finalInst = highestU;\n\t\t\tif (conflictSetTrace) model.output (\"-> (\" + String.format(\"%.3f\",finalInst.getUtility()) + \") \" + finalInst);\n\n\t\t\tif (finalInst.getProduction().isBreakPoint())\n\t\t\t{\n\t\t\t\tmodel.addEvent (new Event (model.getTime() + .049,\n\t\t\t\t\t\t\"procedural\", \"about to fire \" + finalInst.getProduction().getName().getString().toUpperCase())\n\t\t\t\t{\n\t\t\t\t\tpublic void action() {\n\t\t\t\t\t\tmodel.output (\"------\", \"break\");\n\t\t\t\t\t\tmodel.stop();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tString extra = \"\";\n\t\t\tif (buffers.numGoals() > 1)\n\t\t\t{\n\t\t\t\tChunk goal = buffers.get(Symbol.goal);\n\t\t\t\textra = \" [\" + ((goal!=null) ? goal.getName().getString() : \"nil\") + \"]\";\n\t\t\t}\n\n\t\t\tmodel.addEvent (new Event (model.getTime() + .050,\n\t\t\t\t\t\"procedural\", \"** \" + finalInst.getProduction().getName().getString().toUpperCase() + \" **\" + extra)\n\t\t\t{\n\t\t\t\tpublic void action() {\n\t\t\t\t\tfire (finalInst, buffers);\n\t\t\t\t\tfindInstantiations (buffers);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "private StepList selectBestSteps( int top )\n {\n int maxlen = 0;\n int mincom = MINCOMMONALITY;\n int candidates[] = new int[length];\n int p = 0;\n \n StepList res = new StepList( top );\n for( int i=1; i<length; i++ ){\n if( commonality[i]>=mincom ){\n \t\t// TODO: we should also consider pairs that\n \t\t// have too much overlap, but make it up in subsequent\n \t\t// entries. This does mean that we must create a new\n \t\t// candidate array for each new possibility, since we\n \t\t// may have to throw it away.\n int pos0 = indices[i-1];\n \t\tint pos1 = indices[i];\n \t\tint len = Math.min( Math.abs( pos1-pos0 ), commonality[i] );\n \n \t\tif( len>maxlen ){\n \t\t // This is a better candidate.\n \t\t candidates[0] = pos0;\n \t\t candidates[1] = pos1;\n \t\t p = 2;\n \n \t\t // Now search for non-overlapping substrings that \n \t\t // are equal for `len' characters. All possibilities\n \t\t // are the subsequent entries in the suffix array, up to\n // the first one with less than 'len' characters\n // commonality.\n \t\t // We must test each one for overlap with all\n \t\t // previously selected strings.\n // TODO: this fairly arbitrary way of gathering candidates\n // is not optimal, since a different subset of strings may\n // be larger.\n \t\t int j = i+1;\n \t\t while( j<length && commonality[j]>=len ){\n \t\t\tint posj = indices[j];\n \n \t\t\tif( !areOverlapping( candidates, p, posj, len ) ){\n \t\t\t candidates[p++] = posj;\n \t\t\t}\n \t\t\tj++;\n \t\t }\n \t\t maxlen = len;\n \t\t mincom = len;\n res.add( new Step( candidates, p, maxlen ) );\n \t\t}\n }\n }\n return res;\n }", "public void solve() {\n// BruteForceSolver bfs = new BruteForceSolver(pointList);\n// bfs.solve(); // prints the best polygon, its area, and time needed\n// System.out.println(\"-------------\");\n\n// StarshapedSolver ss = new StarshapedSolver(pointList);\n// foundPolygons = ss.solve();\n// System.out.println(\"-------------\");\n\n// RandomAddPointHeuristic ra = new RandomAddPointHeuristic(pointList);\n// foundPolygons = ra.solve(750);\n// System.out.println(\"-------------\");\n\n// GreedyAddPointHeuristic ga = new GreedyAddPointHeuristic(pointList,false);\n// foundPolygons = ga.solve(750);\n// System.out.println(\"-------------\");\n\n// long time = 4000;\n// GreedyAddPointHeuristic gaInit = new GreedyAddPointHeuristic(pointList,false);\n// Polygon2D initSolution = gaInit.solve(time*1/4).get(0);\n// System.out.println(initSolution.area);\n// System.out.println(initSolution);\n//\n// SimulatedAnnealing sa = new SimulatedAnnealing(pointList,initSolution,3);\n// foundPolygons.addAll(sa.solve(time-gaInit.timeInit,2,0.005,0.95));\n// System.out.println(sa.maxPolygon);\n// System.out.println(\"-------------\");\n\n// foundPolygons.addAll(findMultiplePolygonsStarshaped(8,0.6));\n\n }", "private String getCountryWithMostNumberOfBordersShared(HashSet<String> countriesConquered) {\r\n\t\tString weakestCountry = \"\";\r\n\t\tInteger maxNeighbours = Integer.MIN_VALUE;\r\n\t\t\r\n\t\tfor(String country : countriesConquered) {\r\n\t\t\tInteger enemyNeighbours = 0;\r\n\t\t\tfor(String adjacentCountry : this.gameData.gameMap.getAdjacentCountries(country)) {\r\n\t\t\t\tif(this.gameData.gameMap.getCountry(adjacentCountry).getCountryConquerorID() != this.playerID) {\r\n\t\t\t\t\tenemyNeighbours++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(enemyNeighbours > maxNeighbours) {\r\n\t\t\t\tmaxNeighbours = enemyNeighbours;\r\n\t\t\t\tweakestCountry = country;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\treturn weakestCountry;\r\n\t\t\r\n\t}", "public List<ScoredObject<Tree>> getKBestParses(int k);", "static void solveKTUtil(int x, int y, int movei,\n int sol[][], int xMove[],\n int yMove[], List<int[][]> result) {\n int k, next_x, next_y;\n if (movei == N * N){\n \tresult.add(copy(sol));\n return ;\n }\n\n /* Try all next moves from the current coordinate\n x, y */\n for (k = 0; k < 8; k++) {\n next_x = x + xMove[k];\n next_y = y + yMove[k];\n if (isSafe(next_x, next_y, sol)) {\n sol[next_x][next_y] = movei;\n solveKTUtil(next_x, next_y, movei + 1,\n sol, xMove, yMove, result);\n \n sol[next_x][next_y] = -1;// backtracking\n }\n }\n\n \n }", "public int[] mRtreeFromSource(int s,int k){\n double INFINITY = Double.MAX_VALUE;\n boolean[] SPT = new boolean[intersection];\n double[] d = new double[intersection];\n int[] parent = new int[intersection];\n\n for (int i = 0; i <intersection ; i++) {\n d[i] = INFINITY;\n parent[i] = -1;\n }\n\n d[s] = 0;\n parent[s]=s;\n\n MinHeap minHeap = new MinHeap(k);\n for (int i = 0; i <intersection ; i++) {\n minHeap.add(i,d[i]);\n }\n while(!minHeap.isEmpty()){\n\n int extractedVertex = minHeap.extractMin();\n\n if(d[extractedVertex]==INFINITY)\n break;\n\n SPT[extractedVertex] = true;\n\n LinkedList<Edge> list = g.adjacencylist[extractedVertex];\n for (int i = 0; i <list.size() ; i++) {\n Edge edge = list.get(i);\n int destination = edge.destination;\n if(SPT[destination]==false ) {\n\n double newKey = edge.weight ; //the different part with previous method\n double currentKey = d[destination];\n if(currentKey>=newKey){\n if(currentKey==newKey){\n if(extractedVertex<parent[destination]){\n minHeap.updateKey(newKey, destination, d[destination]);\n parent[destination] = extractedVertex;\n d[destination] = newKey;\n }\n }\n else {\n minHeap.updateKey(newKey, destination, d[destination]);\n parent[destination] = extractedVertex;\n d[destination] = newKey;\n }\n }\n }\n }\n }\n return parent;\n }", "Shapelet findBestSAX(int top_k) {\r\n\t\t// init the ArrayList with nulls.\r\n\t\tArrayList<Pair<Integer, Double>> Dist = new ArrayList<>();\r\n\t\tfor (int i = 0; i < num_obj; i++) {\r\n\t\t\tDist.add(null);\r\n\t\t}\r\n\r\n\t\tint word;\r\n\t\tdouble gain, dist_th, gap;\r\n\t\tint q_obj, q_pos;\r\n\t\tUSAX_elm_type usax;\r\n\t\tint label, kk, total_c_in, num_diff;\r\n\r\n\t\tShapelet sh = new Shapelet(), bsf_sh = new Shapelet();\r\n\r\n\t\tif (top_k > 0) {\r\n\t\t\tCollections.sort(Score_List, new ScoreComparator());\r\n\t\t}\r\n\t\ttop_k = Math.abs(top_k);\r\n\r\n\t\tfor (int k = 0; k < Math.min(top_k, Score_List.size()); k++) {\r\n\t\t\tword = Score_List.get(k).first;\r\n\t\t\tusax = USAX_Map.get(word);\r\n\t\t\tfor (kk = 0; kk < Math.min(usax.sax_id.size(), 1); kk++) {\r\n\t\t\t\tint[] c_in = new int[num_class];\r\n\t\t\t\tint[] c_out = new int[num_class];\r\n\t\t\t\t// init the array list with 0s\r\n\t\t\t\tdouble[] query = new double[subseq_len];\r\n\r\n\t\t\t\tq_obj = usax.sax_id.get(kk).first;\r\n\t\t\t\tq_pos = usax.sax_id.get(kk).second;\r\n\r\n\t\t\t\tfor (int i = 0; i < num_class; i++) {\r\n\t\t\t\t\tc_in[i] = 0;\r\n\t\t\t\t\tc_out[i] = Class_Freq[i];\r\n\t\t\t\t}\r\n\t\t\t\tfor (int i = 0; i < subseq_len; i++) {\r\n\t\t\t\t\tquery[i] = Data.get(q_obj).get(q_pos + i);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdouble dist;\r\n\t\t\t\tint m = query.length;\r\n\t\t\t\tdouble[] Q = new double[m];\r\n\t\t\t\tint[] order = new int[m];\r\n\t\t\t\tfor (int obj = 0; obj < num_obj; obj++) {\r\n\t\t\t\t\tdist = nn.nearestNeighborSearch(query, Data.get(obj), obj, Q, order);\r\n\t\t\t\t\tDist.set(obj, new Pair<>(obj, dist));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tCollections.sort(Dist, new DistComparator());\r\n\r\n\t\t\t\ttotal_c_in = 0;\r\n\t\t\t\tfor (int i = 0; i < Dist.size() - 1; i++) {\r\n\t\t\t\t\tPair<Integer, Double> pair_i = Dist.get(i);\r\n\t\t\t\t\tPair<Integer, Double> pair_ii = Dist.get(i + 1);\r\n\r\n\t\t\t\t\tdist_th = (pair_i.second + pair_ii.second) / 2.0;\r\n\t\t\t\t\t// gap = Dist[i+1].second - dist_th;\r\n\t\t\t\t\tgap = ((double) (pair_ii.second - dist_th)) / Math.sqrt(subseq_len);\r\n\t\t\t\t\tlabel = Label.get(pair_i.first);\r\n\t\t\t\t\tc_in[label]++;\r\n\t\t\t\t\tc_out[label]--;\r\n\t\t\t\t\ttotal_c_in++;\r\n\t\t\t\t\tnum_diff = Math.abs(num_obj - 2 * total_c_in);\r\n\t\t\t\t\t// gain = CalInfoGain1(c_in, c_out);\r\n\t\t\t\t\tgain = calcInfoGain2(c_in, c_out, total_c_in, num_obj - total_c_in);\r\n\r\n\t\t\t\t\tsh.setValueFew(gain, gap, dist_th);\r\n\t\t\t\t\tif (bsf_sh.lessThan(sh)) {\r\n\t\t\t\t\t\tbsf_sh.setValueAll(gain, gap, dist_th, q_obj, q_pos, subseq_len, num_diff, c_in, c_out);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn bsf_sh;\r\n\t}", "private String keyOfHardest (ArrayList<families> toSort) {\r\n \t//Initialize keyOfHardest\r\n \tString keyOfHardest = \"\";\r\n \t\r\n \t//HARD: Always default to first in difficulty-sorted array\r\n \tif(difficulty == HangmanDifficulty.HARD) { keyOfHardest = toSort.get(0).getKey(); }\r\n \t\r\n \t//MEDIUM: Every 4th time (using thisGuess) return 2nd hardest\r\n \tif(difficulty == HangmanDifficulty.MEDIUM) { \r\n \t\t//Check if this guess is divisible by 4 and more than 1 word is left\r\n \t\tif (thisGuess % 4 == 0 && toSort.size() > 1) {\r\n \t\t\t//Return 2nd hardest\r\n \t\t\tkeyOfHardest = toSort.get(1).getKey();\r\n \t\t//Otherwise return hardest\r\n \t\t} else {\r\n \t\t\tkeyOfHardest = toSort.get(0).getKey(); \r\n \t\t}\r\n \t}\r\n \t//EASY: Every 2nd time (using thisGuess) return 2nd hardest\r\n \tif(difficulty == HangmanDifficulty.EASY) {\r\n \t\t//Check if this guess is divisible by 2 and more than 1 word is left\r\n \t\tif (thisGuess % 2 == 0 && toSort.size() > 1) {\r\n \t\t\t//Return 2nd hardest\r\n \t\t\tkeyOfHardest = toSort.get(1).getKey();\r\n \t\t//Otherwise return hardest\r\n \t\t} else {\r\n \t\t\tkeyOfHardest = toSort.get(0).getKey(); \r\n \t\t}\r\n \t}\r\n \t//Return String corresponding to key of hardest\r\n \treturn keyOfHardest;\r\n }", "private LineString pickBestGrowthPossibility1(List<LineString> lookAheads) {\n\t\tif (lookAheads == null || lookAheads.size() == 0) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t//sort by:\n\t\t//1. is moving away?\n\t\t//2. number of coordinates in line\n\t\t//3. average elevation of line\n\t\tfinal AvgElevationSectionFitness sectionFitness = new AvgElevationSectionFitness(getTinEdges());\n\t\tComparator<LineString> lookAheadComparator = new Comparator<LineString>() {\n\t\t\tpublic int compare(LineString s1, LineString s2) {\n\t\t\t\t\n\t\t\t\tboolean m1 = LineGrowthHelpers.isMovingAway(s1, s1.getCoordinateN(s1.getNumPoints()-1));\n\t\t\t\tboolean m2 = LineGrowthHelpers.isMovingAway(s2, s2.getCoordinateN(s2.getNumPoints()-1));\n\t\t\t\tif (m1 != m2) {\n\t\t\t\t\treturn m1 ? -1 : 1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (s1.getNumPoints() == s2.getNumPoints()) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tdouble fit1 = sectionFitness.fitness(s1);\n\t\t\t\t\t\t\tdouble fit2 = sectionFitness.fitness(s2);\n\t\t\t\t\t\t\treturn fit1 > fit2 ? -1 \n\t\t\t\t\t\t\t\t\t : fit1 < fit2 ? 1 \n\t\t\t\t\t\t\t\t : 0;\n\t\t\t\t\t\t} \n\t\t\t\t\t\tcatch(IOException e) {\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\treturn s1.getNumPoints() > s2.getNumPoints() ? -1 \n\t\t\t\t\t\t\t\t : s1.getNumPoints() < s2.getNumPoints() ? 1 \n\t\t\t\t\t\t\t : 0; \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tlookAheads.sort(lookAheadComparator);\n\t\treturn lookAheads.get(0);\n\t}", "private void findPath2(List<Coordinate> path) {\n List<Integer> cost = new ArrayList<>(); // store the total cost of each path\n // store all possible sequences of way points\n ArrayList<List<Coordinate>> allSorts = new ArrayList<>();\n int[] index = new int[waypointCells.size()];\n for (int i = 0; i < index.length; i++) {// generate the index reference list\n index[i] = i;\n }\n permutation(index, 0, index.length - 1);\n for (Coordinate o1 : originCells) {\n for (Coordinate d1 : destCells) {\n for (int[] ints1 : allOrderSorts) {\n List<Coordinate> temp = getOneSort(ints1, waypointCells);\n temp.add(0, o1);\n temp.add(d1);\n int tempCost = 0;\n for (int i = 0; i < temp.size() - 1; i++) {\n Graph graph = new Graph(getEdge(map));\n Coordinate start = temp.get(i);\n graph.dijkstra(start);\n Coordinate end = temp.get(i + 1);\n graph.printPath(end);\n tempCost = tempCost + graph.getPathCost(end);\n if (graph.getPathCost(end) == Integer.MAX_VALUE) {\n tempCost = Integer.MAX_VALUE;\n break;\n }\n }\n cost.add(tempCost);\n allSorts.add(temp);\n }\n }\n }\n System.out.println(\"All sorts now have <\" + allSorts.size() + \"> items.\");\n List<Coordinate> best = allSorts.get(getMinIndex(cost));\n generatePath(best, path);\n setSuccess(path);\n }", "@Test void selectBestRegionsFern_larger() {\n\t\tTldDetection<GrayU8> alg = new TldDetection<>();\n\t\talg.config = new ConfigTld();\n\t\talg.config.maximumCascadeConsider = 20;\n\n\t\t// all 10 should be accepted\n\t\tfor( int i = 0; i < 30; i++ ) {\n\t\t\talg.fernInfo.grow();\n\t\t\talg.fernInfo.get(i).r = new ImageRectangle(i,i,i,i);\n\t\t\talg.fernInfo.get(i).sumP = 50-i;\n\t\t\talg.fernInfo.get(i).sumN = 6;\n\t\t}\n\t\talg.selectBestRegionsFern(200,200);\n\n\t\tassertEquals(20,alg.fernRegions.size());\n\t\t// should contain all the best ones\n\t\tfor( int i = 0; i < 20; i++ ) {\n\t\t\tassertTrue(alg.fernRegions.contains(alg.fernInfo.get(i).r));\n\t\t}\n\t}", "public long getBestSolutionTime();", "private static void findStrongestMMAFighter(int[] arr, int k)\n\t{\n\n\t\tDeque<Integer> dq = new LinkedList<Integer>();\n\t\t// Dequeue first element will be the largest one always\n\t\tint i = 0;\n\t\t// We have to process first k elements separately\n\t\tfor (; i < k; i++)\n\t\t{\n\t\t\twhile (!dq.isEmpty() && arr[i] >= arr[dq.peekLast()])\n\t\t\t{\n\t\t\t\tdq.removeLast();\n\t\t\t}\n\t\t\tdq.addLast(i);\n\n\t\t}\n\t\tfor (; i < arr.length; i++)\n\t\t{\n\n\t\t\t// First element will always be larger\n\t\t\tSystem.out.print(arr[dq.peekFirst()] + \" \");\n\n\t\t\t// remove elements which are not in current window\n\t\t\twhile (!dq.isEmpty() && dq.peekFirst() <= i - k)\n\t\t\t{\n\t\t\t\tdq.removeFirst();\n\t\t\t}\n\t\t\t// Remove unwanted elements\n\t\t\twhile (!dq.isEmpty() && arr[i] > arr[dq.peekLast()])\n\t\t\t{\n\t\t\t\tdq.removeLast();\n\t\t\t}\n\t\t\tdq.addLast(i);\n\t\t}\n\t\tif (!dq.isEmpty())\n\t\t\tSystem.out.print(arr[dq.peek()] + \" \");\n\n\t}", "void leastCostPaths() {\t\n\t\tfor( int k = 0; k < N; k++ )\n\t\t\tfor( int i = 0; i < N; i++ )\n\t\t\t\tif( defined[i][k] )\n\t\t\t\t\tfor( int j = 0; j < N; j++ )\n\t\t\t\t\t\tif( defined[k][j]\n\t\t\t\t\t\t\t\t&& (!defined[i][j] || c[i][j] > c[i][k]+c[k][j]) ) {\t\n\t\t\t\t\t\t\tpath[i][j] = path[i][k];\n\t\t\t\t\t\t\tc[i][j] = c[i][k]+c[k][j];\n\t\t\t\t\t\t\tdefined[i][j] = true;\n\t\t\t\t\t\t\tif( i == j && c[i][j] < 0 ) return; // stop on negative cycle\n\t\t\t\t\t\t}\n\t}", "public void findTrack() {\n for (Node n : start_node.getLinks()) {\n precedenti.put(n, start_node);\n valori.put(n, calculator.calcDistance(n, start_node));\n }\n while (!da_collegare.isEmpty()) {\n Node piu_vicino = null;\n double min = Double.MAX_VALUE;\n for (Node n : da_collegare) {\n double dist = valori.get(n);\n if (dist - min < THRESHOLD) {\n min = dist;\n piu_vicino = n;\n }\n }\n double dist = valori.get(piu_vicino);\n for (Node n : piu_vicino.getLinks()) {\n double ricalc = dist + calculator.calcDistance(n, piu_vicino);\n if (ricalc - valori.get(n) < THRESHOLD) {\n precedenti.put(n, piu_vicino);\n valori.put(n, ricalc);\n }\n }\n da_collegare.remove(piu_vicino);\n }\n }", "private void checkIsBetterSolution() {\n if (solution == null) {\n solution = generateSolution();\n //Si la solucion que propone esta iteracion es mejor que las anteriores la guardamos como mejor solucion\n } else if (getHealthFromAvailableWorkers(availableWorkersHours, errorPoints.size()) < solution.getHealth()) {\n solution = generateSolution();\n }\n }", "static long journey(int[] path, int k) {\n calculateSumRecursive(path,k,0,0);\n return maxSum;\n }", "public static void main(String[] args) throws IOException {\n util.importUtility();\n \n // Create a list of numbers for the players; values initialized\n // to zero. This is a strategy profile.\n ArrayList<Integer> moves = new ArrayList<>();\n for(int i = 0; i < util.getNumPlayers(); i++)\n moves.add(0);\n \n // This list of Strings will store newly found strategy profiles.\n ArrayList<String> strats = new ArrayList<>();\n String s;\n \n // Indexes for players.\n int p1 = 0;\n int p2 = 1;\n \n // Loop control.\n int i = 0;\n \n // Index of beginning and end of the sink equilibrium best response\n // cycle found by generating the the list of profiles.\n // Once we've found said cycle, it's as if there's a long string\n // of strategy profiles still attached to it. This index allows us\n // to *snip* it off.\n int index = 0;\n \n // BEGIN!!! Let's hope this works....\n while(i < 1000) {\n // The next two if statements check if a best response to the\n // current strategy profile for p1 or p2 can be found. If it can, then\n // we check if the new strategy profile *is already in* our list.\n // If not, we add it in. If so, we note the index of where the \n // matching profile is in our current list and throw it on top anyway\n // (it's a String that will be the last line of our results file).\n if (bestResponse(moves, p1)) {\n s = newVertex(moves);\n if(strats.indexOf(s) == -1)\n strats.add(s);\n else {\n index = strats.indexOf(s);\n strats.add(s);\n break;\n }\n }\n if (bestResponse(moves, p2)) {\n s = newVertex(moves);\n if(strats.indexOf(s) == -1)\n strats.add(s);\n else {\n index = strats.indexOf(s);\n strats.add(s);\n break;\n }\n }\n i++;\n \n // This is what happens if finding the solution is *a bit* less \n // trivial than we'd hope. Once we try looking for best responses \n // between the two players a thousand times, we reset the iterator;\n // clear the profiles list, and increment the p2 index... changing\n // the player with which p1 would like to play. Then we do it again.\n if (i == 1000) {\n i = 0;\n strats.clear();\n p2++;\n }\n \n // If p1 has tried trading moves back in forth with EVERY player in \n // the list, then the player at the next index can try doing so.\n if (p2 == 20) {\n p1++;\n p2 = 0;\n }\n }\n // This algorithm will continue until it finds a sink or every player \n // has traded blows with each other. Note that there's no mechanism in \n // place to reset p1's counter; so if it ever reached that point it \n // would completely fail. In that case, it may not really be all that\n // useful to reset it anyway.\n \n // This is where the *snipping* takes place as described above.\n for (int j = 0; j < index; j++) {\n strats.remove(0);\n }\n \n // Print the result. If we've found one, of course.\n strats.stream().forEach(System.out::println);\n \n }", "private void updateBest() {\n if (bestTourOrder == null) {\n bestTourOrder = ants.get(0).trail;\n bestTourLength = ants.get(0)\n .trailLength(graph);\n }\n for (Ant a : ants) {\n if (a.trailLength(graph) > bestTourLength) {\n bestTourLength = a.trailLength(graph);\n bestTourOrder = a.trail.clone();\n }\n }\n\n\n }", "public ArrayList<Action> findShortestPath(int startX, int startY, int endX, int endY, int numKeys, boolean toUnknown){\n\t\t\tHashSet<SearchNode> visited = new HashSet<SearchNode>();\n\t\t\tHashSet<SearchNode> work = new HashSet<SearchNode>();\n\t\t\t\n\t\t\tSearchNode start = new SearchNode();\n\t\t\tstart.posX = startX;\n\t\t\tstart.posY = startY;\n\t\t\tstart.gScore = 0;\n\t\t\tif (toUnknown)\n\t\t\t\tstart.fScore = 0;\n\t\t\telse\n\t\t\t\tstart.fScore = Math.abs(startX - endX) + Math.abs(startY - endY);\n\t\t\tstart.keysLeft = numKeys;\n\t\t\tstart.cameFrom = null;\n\t\t\twork.add(start);\n\t\t\t\n\t\t\twhile(work.size() > 0){\n\t\t\t\tSearchNode current = findFirstNode(work);\n\t\t\t\tif (!toUnknown && current.posX == endX && current.posY == endY){\n\t\t\t\t\t//We've found the end node, reconstruct the path\n\t\t\t\t\treturn recoverPath(current);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (toUnknown && getElement(current.posX, current.posY) == BoxContainer.Unkown){\n\t\t\t\t\treturn recoverPath(current);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\twork.remove(current);\n\t\t\t\tvisited.add(current);\n\t\t\t\t\n\t\t\t\tfor (int i = 0; i < 4; i++){\n\t\t\t\t\tint newX, newY;\n\t\t\t\t\tAction direction;\n\t\t\t\t\tif (i == 0){\n\t\t\t\t\t\tnewX = current.posX + 1;\n\t\t\t\t\t\tnewY = current.posY;\n\t\t\t\t\t\tdirection = Action.East;\n\t\t\t\t\t}\n\t\t\t\t\telse if (i == 1){\n\t\t\t\t\t\tnewX = current.posX;\n\t\t\t\t\t\tnewY = current.posY + 1;\n\t\t\t\t\t\tdirection = Action.North;\n\t\t\t\t\t}\n\t\t\t\t\telse if (i == 2){\n\t\t\t\t\t\tnewX = current.posX - 1;\n\t\t\t\t\t\tnewY = current.posY;\n\t\t\t\t\t\tdirection = Action.West;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tnewX = current.posX;\n\t\t\t\t\t\tnewY = current.posY - 1;\n\t\t\t\t\t\tdirection = Action.South;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//Check to make sure we can move into this node\n\t\t\t\t\tBoxContainer newBox = getElement(newX, newY);\n\t\t\t\t\tif (newBox == BoxContainer.Blocked || (!toUnknown && newBox == BoxContainer.Unkown))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\tif (newBox == BoxContainer.Door && current.keysLeft == 0){\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tint new_gScore = current.gScore + 1;\n\t\t\t\t\tif (newBox == BoxContainer.Door || newBox == BoxContainer.Key)\n\t\t\t\t\t\tnew_gScore++;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//try to find the node if we've already searched it, otherwise create it\n\t\t\t\t\tSearchNode newNode = findNodeWithCoords(visited, newX, newY);\n\t\t\t\t\tif (newNode == null){\n\t\t\t\t\t\tnewNode = findNodeWithCoords(work, newX, newY);\n\t\t\t\t\t\tif (newNode == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewNode = new SearchNode();\n\t\t\t\t\t\t\tnewNode.posX = newX;\n\t\t\t\t\t\t\tnewNode.posY = newY;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (visited.contains(newNode) && new_gScore >= newNode.gScore)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\tif (!work.contains(newNode) || new_gScore < newNode.gScore){\n\t\t\t\t\t\tnewNode.cameFrom = current;\n\t\t\t\t\t\tnewNode.direction = direction;\n\t\t\t\t\t\tnewNode.gScore = new_gScore;\n\t\t\t\t\t\tif (toUnknown)\n\t\t\t\t\t\t\tnewNode.fScore = newNode.gScore;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tnewNode.fScore = newNode.gScore + Math.abs(newNode.posX - endX) + Math.abs(newNode.posY - endY);\n\t\t\t\t\t\tnewNode.keysLeft = current.keysLeft;\n\t\t\t\t\t\tif (newBox == BoxContainer.Door)\n\t\t\t\t\t\t\tnewNode.keysLeft--;\n\t\t\t\t\t\tif (newBox == BoxContainer.Key)\n\t\t\t\t\t\t\tnewNode.keysLeft++;\n\t\t\t\t\t\tif (!work.contains(newNode))\n\t\t\t\t\t\t\twork.add(newNode);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn null;\n\t\t}", "private void recalcBestPath(int dest) {\n boolean changed;\n\n List<BGPPath> possList = this.inRib.get(dest);\n BGPPath currentBest = this.pathSelection(possList);\n BGPPath currentInstall = this.locRib.get(dest);\n\n /*\n * We need to handle advertisements in one of two cases a) we have found\n * a new best path and it's not the same as our current best path b) we\n * had a best path prior, but currently do not\n */\n changed = (currentBest != null && (currentInstall == null || !currentBest.equals(currentInstall)))\n || (currentBest == null && currentInstall != null);\n this.locRib.put(dest, currentBest);\n if (this.isWardenAS()) {\n if (currentBest == null) {\n this.routeStatusMap.put(dest, AS.RS_NULL);\n } else if (this.botSet == null) {\n this.routeStatusMap.put(dest, AS.RS_CLEAN);\n } else if (currentBest.containsAnyOf(this.botSet)) {\n this.routeStatusMap.put(dest, AS.RS_DIRTY);\n } else {\n this.routeStatusMap.put(dest, AS.RS_CLEAN);\n }\n }\n\n /*\n * If we have a new path, mark that we have a dirty destination\n */\n if (changed) {\n this.dirtyDest.add(dest);\n }\n }", "protected int bestDirection(int _y, int _x)\n {\n int sX = -1, sY = -1;\n for (int i = 0; i < m; i++) {\n boolean breakable = false;\n for (int j = 0; j < n; j++) {\n if (map[i][j] == 'p' || map[i][j] == '5') {\n sX = i;\n sY = j;\n breakable = true;\n break;\n }\n }\n if(breakable) break;\n sX =0; sY = 0;\n }\n Pair s = new Pair(sX, sY);\n Queue<Pair> queue = new Queue<Pair>();\n int[][] distance = new int[m][n];\n for (int i = 0; i < m; i++)\n for (int j = 0; j < n; j++)\n distance[i][j] = -1;\n distance[sX][sY] = 0;\n queue.add(s);\n /*\n System.out.println(\"DEBUG TIME!!!!\");\n for(int i = 0; i < m; i++)\n {\n for(int j = 0; j < n; j++)\n System.out.print(map[i][j]);\n System.out.println();\n }\n System.out.println();\n */\n while (!queue.isEmpty())\n {\n Pair u = queue.remove();\n for (int i = 0; i < 4; i++)\n {\n int x = u.getX() + hX[i];\n int y = u.getY() + hY[i];\n if (!validate(x, y)) continue;\n if (distance[x][y] != -1) continue;\n if (!canGo.get(map[x][y])) continue;\n distance[x][y] = distance[u.getX()][u.getY()] + 1;\n queue.add(new Pair(x, y));\n }\n }\n\n //slove if this enemy in danger\n //System.out.println(_x + \" \" + _y);\n if (inDanger[_x][_y])\n {\n int direction = -1;\n boolean canAlive = false;\n int curDistance = dangerDistance[_x][_y];\n int distanceToBomber = m * n;\n if (curDistance == -1) return 0;\n for (int i = 0; i < 4; i++)\n {\n int x = _x + hX[i];\n int y = _y + hY[i];\n if (!validate(x, y)) continue;\n if (dangerDistance[x][y] == -1) continue;\n if (dangerDistance[x][y] < curDistance)\n {\n curDistance = dangerDistance[x][y];\n direction = i;\n distanceToBomber = distance[x][y];\n } else if (dangerDistance[x][y] == curDistance)\n {\n if (distanceToBomber == -1 || distanceToBomber > distance[x][y])\n {\n direction = i;\n distanceToBomber = distance[x][y];\n }\n }\n }\n if (direction == -1) direction = random.nextInt(4);\n allowSpeedUp = true;\n return direction;\n }\n // or not, it will try to catch bomber\n else\n {\n /*\n System.out.println(\"x = \" + _x + \"y = \" + _y);\n for(int i = 0; i < n; i++) System.out.printf(\"%2d \",i);\n System.out.println();\n for(int i = 0; i < m; i++)\n {\n for(int j = 0; j < n; j++)\n System.out.printf(\"%2d \",distance[i][j]);\n System.out.println();\n }\n System.out.println();\n System.out.println();\n */\n int direction = -1;\n int[] die = new int[4];\n for (int i = 0; i < 4; i++)\n die[i] = 0;\n int curDistance = distance[_x][_y];\n for (int i = 0; i < 4; i++)\n {\n int x = _x + hX[i];\n int y = _y + hY[i];\n if (!validate(x, y))\n {\n die[i] = 1;\n continue;\n }\n ;\n if (inDanger[x][y])\n {\n die[i] = 2;\n continue;\n }\n if (distance[x][y] == -1) continue;\n if (distance[x][y] < curDistance)\n {\n curDistance = distance[x][y];\n direction = i;\n }\n }\n if(curDistance < 4) allowSpeedUp = true;\n else allowSpeedUp = false; //TODO: TEST :))\n if (direction == -1)\n {\n for (int i = 0; i < 4; i++)\n if (die[i] == 0) return i;\n for (int i = 0; i < 4; i++)\n if (die[i] == 1) return i;\n return 0;\n } else return direction;\n }\n }", "public String getSecondStrongestCountryConqueredByPlayer(HashMap<String, ArrayList<String>> potentialScenarios, String strongestCountry) {\r\n\t\t\r\n \tString secondStrongestCountry = null;\r\n \tInteger maxArmyCountEncountered = 1;\r\n \r\n // find second strongest country conquered by the player based on value passed in as strongest \r\n \tfor(String country: potentialScenarios.get(strongestCountry)) {\r\n \tInteger currentCountryArmyCount = gameData.gameMap.getCountry(country).getCountryArmyCount();\r\n \t// only countries with 2 or more armies on the ground qualify as suppliers\r\n \tif (currentCountryArmyCount > maxArmyCountEncountered) {\r\n \t\tsecondStrongestCountry = country;\r\n \t\tmaxArmyCountEncountered = currentCountryArmyCount;\r\n \t}\r\n }\r\n \r\n \treturn secondStrongestCountry;\r\n }", "public int conflicts() {\n int total = 0;\n int dist;\n if (!isValid()) return 0;\n for (int r = 0; r < Board.dim; r++) {\n int row = r*Board.dim; \n for (int i = row; i < row + Board.dim; i++)\n for (int j = i + 1; j < row + Board.dim; j++) \n if (Board.rowOf[state[i]] == r && \n Board.rowOf[state[j]] == r &&\n state[i] != 0 && state[j] != 0 &&\n state[i] > state[j])\n total = total + 1;\n }\n for (int col = 0; col < Board.dim; col++) \n for (int i = col; i < state.length - Board.dim; i+= Board.dim) {\n for (int j = i + Board.dim; j < state.length; j+= Board.dim) \n if (Board.colOf[state[i]] == col &&\n Board.colOf[state[j]] == col &&\n state[i] != 0 && state[j] != 0 &&\n state[i] > state[j])\n total = total + 1;\n } \n return total; \n }", "public void findCommunities() {\n\n\t\t// We copy the community of scale to scale+1\n\t\tfor (Object o : G) {\n\t\t\tNode i = (Node) o;\n\t\t\ti.addCommunity(scale + 1, i.getCommunity(scale));\n\t\t}\n\t\tscale++;\n\t\tG.setScaleMax(scale);\n\n\t\tString old_community;\n\t\tString current_community;\n\t\tString best_community = \"\";\n\t\tdouble dQ_max = 0;\n\t\tdouble dQ = 0;\n\t\t// double old_Q;\n\t\t// do {\n\t\t// old_Q = Q;\n\t\tfor (Object oi : G) {\n\t\t\tNode i = (Node) oi;\n\t\t\t// Node iH = (Node) nodesH.toArray()[k];\n\t\t\tdQ_max = 0;\n\t\t\tfor (Object oj : G) {\n\t\t\t\tNode j = (Node) oj;\n\t\t\t\tif (i != j && i.getCommunity(scale) != j.getCommunity(scale)) {\n\t\t\t\t\t// We put i into the community C of j\n\t\t\t\t\told_community = i.getCommunity(scale);\n\t\t\t\t\tcurrent_community = j.getCommunity(scale);\n\t\t\t\t\ti.editCommunity(scale, current_community);\n\t\t\t\t\t// We compute the modularity gain.\n\t\t\t\t\tdQ = computeModularityGain(i, current_community);\n\t\t\t\t\t// We keep the community with the highest gain.\n\t\t\t\t\tif (dQ > dQ_max) {\n\t\t\t\t\t\tdQ_max = dQ;\n\t\t\t\t\t\tbest_community = current_community;\n\t\t\t\t\t}\n\t\t\t\t\t// We put i back into its old community.\n\t\t\t\t\ti.editCommunity(scale, old_community);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// We put i into the best community.\n\t\t\tif (dQ_max > 0) {\n\t\t\t\ti.editCommunity(scale, best_community);\n\t\t\t\t// iH.editCommunity(scale, best_community);\n\t\t\t}\n\t\t}\n\t\tcomputeModularity();\n\t\t// } while (old_Q != Q);\n\t}", "private LinkedList<Node> reconstructPath(Map<Node, Node> cameFrom, Node current){\n LinkedList<Node> bestPath = new LinkedList<>();\n bestPath.add(current);\n\n while(cameFrom.containsKey(current)){\n current = cameFrom.get(current);\n bestPath.add(current);\n }\n return bestPath;\n }", "private static Population getBestPossibleParettoOfAGS(){\n int numberOfRounds = 10;\n Population allFrontsMembers = new Population();\n\n NSGAII nsgaii = new NSGAII();\n SPEA2 spea2 = new SPEA2();\n AEMMT aemmt = new AEMMT();\n AEMMD aemmd = new AEMMD();\n MOEAD moead = new MOEAD();\n\n ProblemKnapsackFromFile problem = new ProblemKnapsackFromFile(macPathGetProblemFrom);\n progressBar = new ProgressBar((double) numberOfRounds);\n\n for (int i = 0; i < numberOfRounds; i++) {\n\n Parameters.NUMBER_OF_GENERATIONS = problem.items.size() < 100? 100 : 200;\n\n System.out.println(\"NSGAII\");\n nsgaii.runAlgorithm(problem);\n allFrontsMembers.population.addAll(nsgaii.paretto.membersAtThisFront);\n\n System.out.println(\"SPEA2\");\n spea2.runAlgorithm(problem);\n allFrontsMembers.population.addAll(spea2.paretto.membersAtThisFront);\n\n //moead.runAlgorithm(problem);\n //allFrontsMembers.population.addAll( moead.pareto.membersAtThisFront);\n\n Parameters.NUMBER_OF_GENERATIONS = 15000;\n System.out.println(\"AEMMT\");\n aemmt.runAlgorithm(problem);\n allFrontsMembers.population.addAll(aemmt.paretto.membersAtThisFront);\n\n System.out.println(\"AEMMD\");\n aemmd.runAlgorithm(problem);\n allFrontsMembers.population.addAll(aemmd.paretto.membersAtThisFront);\n\n progressBar.addJobDone();\n\n allFrontsMembers.fastNonDominatedSort();\n Problem.removeSimilar(allFrontsMembers.fronts.allFronts.get(0),problem);\n allFrontsMembers.population = allFrontsMembers.fronts.allFronts.get(0).membersAtThisFront;\n }\n\n problem.printResolutionMessage();\n //Printer.printBinaryMembers(allFrontsMembers);\n System.out.println(\"ALL FRONTS SIZE: \"+allFrontsMembers.population.size());\n\n return allFrontsMembers;\n }", "public double[] dist2All(int s, int k){\n\n double INFINITY = Double.MAX_VALUE;\n boolean[] SPT = new boolean[intersection];\n\n double[] resultPath = new double[intersection];\n for (int i = 0; i <intersection ; i++) {\n resultPath[i] = INFINITY;\n }\n resultPath[s] = 0;\n MinHeap minHeap = new MinHeap(k);\n for (int i = 0; i <intersection ; i++) {\n minHeap.add(i,resultPath[i]);\n }\n while(!minHeap.isEmpty()){\n\n int extractedVertex = minHeap.extractMin();\n\n if(resultPath[extractedVertex]==INFINITY)\n break;\n\n SPT[extractedVertex] = true;\n\n LinkedList<Edge> list = g.adjacencylist[extractedVertex];\n for (int i = 0; i <list.size() ; i++) {\n Edge edge = list.get(i);\n int destination = edge.destination;\n if(SPT[destination]==false ) {\n double newKey = resultPath[extractedVertex] + edge.weight ;\n double currentKey = resultPath[destination];\n if(currentKey>newKey){\n minHeap.updateKey(newKey, destination,resultPath[destination]);\n resultPath[destination] = newKey;\n }\n }\n }\n }\n for(int i =0; i<resultPath.length;i++){\n if(SPT[i]==false)\n resultPath[i]=-1;\n }\n return resultPath;\n }", "@Override\r\n public ElementSet nextBestSet() {\r\n \r\n ElementSet bestSet = null; //initialze variables\r\n int countBest = 0;\r\n double bestScore = Double.MAX_VALUE; //arbitrarly large number CHECK ME\r\n int count = 0;\r\n double score = 0;\r\n \r\n for (ElementSet s : _copyModel.getElements()) { //go through all sets in the model\r\n count = 0; //reset count and score for each set\r\n score = 0;\r\n for (Integer i : s.getSet()) {\r\n if(_uncoveredElements.contains(i)) { //get number of covered elements\r\n count++;\r\n } \r\n }\r\n if (count != 0) { //if it contains an element\r\n score = s.getCost() / (double)count; //compute the ratio of cost per element covered\r\n if (score < bestScore) { //if score is better than best score \r\n countBest = count;\r\n bestScore = score;\r\n bestSet = s;\r\n }\r\n }\r\n }\r\n \r\n if (bestSet == null) //if no set was chosen return null\r\n return null;\r\n \r\n _copyModel.getElements().remove(bestSet); //remcoe the chosen set from the model\r\n GreedySolver.printChosenSet(bestSet); //print the chosen set\r\n \r\n return bestSet;\r\n }", "public Ruteo procedimientoIterativoGrasp(Auxiliar a){\n\t\t double time1= System.currentTimeMillis();\n\t\t\n\t\tDouble mejorCosto=9999999999999999.9;\n\t\tRuteo mejorRuteo=null;\n\t\tlistaSetCovering=new ArrayList<Ruta>();\n\t\tfor(int i=0;i<k;i++){\n\t\t\tHeuristicasTSPManagger h=new HeuristicasTSPManagger();\n\t\t\tList<Obra>tsp=h.CWJPC();\n\n\t\t\tList<Obra>tsp1=a.busquedaLocal(tsp);\n\t\t\n\t\t\tRuteo r2=a.split(tsp1);\n\t\t\tSystem.out.println(r2.rutas);\n\t\t\tlistaSetCovering.addAll(r2.rutas);\n\t\t\tif(mejorCosto>r2.costoTotal){\n\t\t\t\tmejorCosto=r2.costoTotal;\n\t\t\t\tmejorRuteo=r2;\n\t\t\t}\n\t\t}\n\t\t double time2= System.currentTimeMillis();\n\t\t tiempoComputacionalIterGrasp=(time2-time1)/(1000.0*k);\n\t\t tiempoComputacionalGrasp=(time2-time1)/(1000.0);\n\t\treturn mejorRuteo;\n\t}", "private void analyzeForObstacles() {\n \t\n \t\n \tStack<Rect> bestFound = new Stack<Rect>();//This is a stack as the algorithm moves along x linearly\n \tboolean[][] blackWhiteGrid = getBlackWhiteGrid();\n \tint[] cache = new int[grid.length];\n \t\n \twhile (true) {\n\t\t\tboolean noneFound = true;\n\t\t\t\n\t\t\tfor (int i = 0; i<cache.length; i++)\n\t\t\t\tcache[i] = 0;\n\t\t\tfor (int llx = grid.length -1; llx >= 0; llx--) {\n\t\t\t\tupdate_cache(blackWhiteGrid,cache, llx);\n\t\t\t\tfor (int lly = 0; lly < grid.length; lly++) {\n\t\t\t\t\tRect bestOfRound = new Rect(llx,lly,llx,lly);\n\t\t\t\t\tint y = lly;\n\t\t\t\t\tint x_max = 9999;\n\t\t\t\t\tint x = llx;\n\t\t\t\t\twhile (y+1<grid.length && blackWhiteGrid[llx][y]) {\n\t\t\t\t\t\ty++;\n\t\t\t\t\t\tx = Math.min(llx+cache[y]-1, x_max);\n\t\t\t\t\t\tx_max = x;\n\t\t\t\t\t\tRect tryRect = new Rect(llx,lly-1,x,y);\n\t\t\t\t\t\tif (tryRect.area() > bestOfRound.area()) {\n\t\t\t\t\t\t\tbestOfRound = tryRect;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (bestOfRound.area() > 40) {\n\t\t\t\t\t\tif (noneFound) {\n\t\t\t\t\t\t\tbestFound.push(bestOfRound);\n\t\t\t\t\t\t\tnoneFound = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tRect lastRect = bestFound.peek();\n\t\t\t\t\t\t\tif (lastRect.area() < bestOfRound.area()) {\n\t\t\t\t\t\t\t\tbestFound.pop();\n\t\t\t\t\t\t\t\tbestFound.push(bestOfRound);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (noneFound)\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tclearFoundRectangle(blackWhiteGrid, bestFound.peek());\n \t}\n \t\n \t//add found rectanlges\n \tobstacles.clear();\n \tobstacles.addAll(bestFound);\n \tSystem.out.println(\"Sweep done:\");\n \tfor (Rect r : bestFound){\n \t\tSystem.out.println(\"Rect: llx=\" + (r.llx-400) + \"\\tlly=\" + (r.lly-400) + \"\\turx=\" + (r.urx-400) + \"\\tury=\" + (r.ury-400));\n \t\tList<Point2D.Double> corners = new ArrayList<Point2D.Double>();\n \t\tcorners.add(new Point2D.Double((r.llx-400),(r.lly-400)));\n \t\tcorners.add(new Point2D.Double((r.llx-400),(r.ury-400)));\n \t\tcorners.add(new Point2D.Double((r.urx-400),(r.lly-400)));\n \t\tcorners.add(new Point2D.Double((r.urx-400),(r.ury-400)));\n \t\tobstaclesF.add(new Obstacle(corners));\n \t}\n \t\n \ttoExplore.clear();\n \tint i = 0;\n \tRandom rand = new Random();\n \twhile (toExplore.size() < 10 && i < 1000) {\n \t\tint x = rand.nextInt(grid.length);\n \t\tint y = rand.nextInt(grid.length);\n \t\tif (grid[x][y] == .5) {\n \t\t\ttoExplore.add(new Flag(\"blue\",x,y));\n \t\t}\n \t}\n }", "private void identifySuccessors(T node, T goal, Set<T> goals, Queue<T> open, Set<T> closed, Map<T, T> parentMap,\n Map<T, Double> fMap, Map<T, Double> gMap, Map<T, Double> hMap) {\n // get all neighbors to the current node\n Collection<T> neighbors = findNeighbors(node, parentMap);\n\n double d;\n double ng;\n for (T neighbor : neighbors) {\n // jump in the direction of our neighbor\n T jumpNode = jump(neighbor, node, goals);\n\n // don't add a node we have already gotten to quicker\n if (jumpNode == null || closed.contains(jumpNode)) continue;\n\n // determine the jumpNode's distance from the start along the current path\n d = graph.getDistance(jumpNode, node);\n ng = gMap.getOrDefault(node, 0d) + d;\n\n // if the node has already been opened and this is a shorter path, update it\n // if it hasn't been opened, mark as open and update it\n if (!open.contains(jumpNode) || ng < gMap.getOrDefault(jumpNode, 0d)) {\n gMap.put(jumpNode, ng);\n hMap.put(jumpNode, graph.getHeuristicDistance(jumpNode, goal));\n fMap.put(jumpNode, gMap.getOrDefault(jumpNode, 0d) + hMap.getOrDefault(jumpNode, 0d));\n //System.out.println(\"jumpNode: \" + jumpNode.x + \",\" + jumpNode.y + \" f: \" + fMap.get(jumpNode));\n parentMap.put(jumpNode, node);\n\n if (!open.contains(jumpNode)) {\n open.offer(jumpNode);\n }\n }\n }\n }", "public void retrace(){\n\t\t//look at the sPath stack\n\t\tPoint temp = sPath.peek();\n\t\t// find neighbor with lowest score\n\t\tPoint lNeighbor = backtrack(temp);\n\t\t// coordinates of lNeighbor\n\t\tint x = (int) lNeighbor.getX();\n\t\tint y = (int) lNeighbor.getY();\n\t\t// score of neighbor\n\t\tint score = topology[x][y];\n\t\t// if there is no more neighbor then lNeighbor = temp\n\t\t// then we reach the Start then\n\t\twhile(score!=0){\n\t\t\t// push that neighbor on the stack\n\t\t\tsPath.push(lNeighbor);\n\t\t\t// update temp and lNeighbor\n\t\t\ttemp = sPath.peek();\n\t\t\tlNeighbor = backtrack(temp);\n\t\t\t// coordinates of lNeighbor\n\t\t\tx = (int) lNeighbor.getX();\n\t\t\ty = (int) lNeighbor.getY();\n\t\t\t// score of neighbor\n\t\t\tscore = topology[x][y];\n\t\t}\n\t\t// we have to do that until we see the start with score 0\n\t\t// the last lNeighbor is the S with score = 0, push it to the stack\n\t\tsPath.push(lNeighbor);\n\t\twhile(!sPath.isEmpty()){\n\t\t\tPoint track = sPath.pop();\n\t\t\tSystem.out.println(\"(\"+(int)track.getX()+\",\"+(int)track.getY()+\")\");\n\t\t}\n\t}", "private void CreatingBeautyContentTopK() {\n\t\t\tConstraintsPlacement objConstraints= new ConstraintsPlacement(this);\r\n\t\t\t//Creating array with states\r\n\t\t\tArrayList<BlockNode> states = new ArrayList<BlockNode>();\r\n\t\t\t//Building the graph in a deph way\r\n\t \tGraphBuilder objGrapB= new GraphBuilder(1);\r\n\t \tint numElements=objElem.getNumberObjects();\r\n\t \tint numEnemies=objElem.getNumberObjectsEnemies();\r\n\t \tint globalControlSearch=0;\r\n\t \t//Beststates=objGrapB.basicDepthSearch(mediumStraight,height,numElements,numElements,states,objConstraints, objElem.getFinalList(),objElem);\r\n\t \tbestBranches=objGrapB.relativePositionDepthSearchTopK(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,-mediumStraight+1,mediumStraight-1,floorTileHeight,0,0,maxScreens,numEnemies,random,globalControlSearch);\r\n\t \t//Beststates=objGrapB.relativeTransPositionDepthSearch(mediumStraight,height,numElements,numElements,states,objConstraints, objElem.getFinalList(),objElem,-mediumStraight+1,mediumStraight-1,floorTileHeight,0,0,currentState,hTable);\r\n\t \r\n\t \tBranch objBranch=new Branch();\r\n\t \t//bestBranches=objBranch.sortBranches(bestBranches);\r\n\t \t\r\n\t \t//System.out.print( \"CounterStates\"+objGrapB.getCounterIDs() );\r\n\t \r\n\t //imprimiendo los estados visitados\r\n\t /*\r\n\t Iterator<BlockNode> nombreIterator = states.iterator();\r\n\t while(nombreIterator.hasNext()){\r\n\t \tBlockNode elemento = nombreIterator.next();\r\n\t \tSystem.out.print(elemento.getID()+\" / \");\r\n\t }*/\r\n\t \r\n\t //here we are painting as the best branches foundeded\r\n\t \r\n\t Iterator<Branch> nombreIterator = bestBranches.iterator();\r\n\t while(nombreIterator.hasNext()){\r\n\t \tBranch elemento = nombreIterator.next();\r\n\t \t//System.out.print(elemento.getHeuristicValue()+ \" / \");\r\n\t }\r\n\t \r\n\t \r\n\t //Here we will put the elements on the tile\r\n\t \t//Just here to implement the n screens!\r\n\t for(int i=0;i<maxScreens;i++)\r\n\t {//block from Lelis and Reis (>class GeradorDeFasses)\r\n/*\t \ttry {\r\n\t \t\tLevel levelScreen=PaintElements(((Branch)bestBranches.get(i)).getStates(),this.clone());\t\t\t\t\t\r\n\t\t\t\t\tScreen objScreen=new Screen();\r\n\t\t\t\t\tobjScreen.SaveScreen(levelScreen,odds,objElem);\r\n\t \t\tInformacoesTelas info = new InformacoesTelas();\r\n\t\t\t CopiaArquivos copiador = new CopiaArquivos();\r\n\t\t\t \r\n\t\t\t info = info.carregaInfoTela(\"infoTela\");\r\n\t\t\t\t\tinfo.setOutrasVariaveis(0, 0); // Salva outras informacoes da Tela\r\n\t\t\t\t\tinfo.salvaInfoTela(\"infoTela\", info);\t\t\t\t\t\r\n\t\t\t\t\tcopiador.copy(\"\" + i, \"Screens/\");\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (CloneNotSupportedException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t} catch (ClassNotFoundException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}*/\r\n\t }\r\n\t \r\n\t\t\t\r\n\t\t}", "public void conflict(Object arg0) {\n\n\t}", "public int noOfMPaths2Dest(int s,int t,int k){\n double INFINITY = Double.MAX_VALUE;\n boolean[] SPT = new boolean[intersection];\n double[] resultPath = new double[intersection];\n LinkedList<Integer>[] parent = new LinkedList[intersection]; //using linked list instead of array to store all the possible parent of an intersection\n\n for (int i = 0; i <intersection ; i++) {\n resultPath[i] = INFINITY;\n parent[i] = new LinkedList<>();\n }\n\n //decrease the distance for the first index\n resultPath[s] = 0;\n\n //add all the vertices to the MinHeap\n MinHeap minHeap = new MinHeap(k);\n for (int i = 0; i <intersection ; i++) {\n minHeap.add(i,resultPath[i]);\n }\n //while minHeap is not empty\n while(!minHeap.isEmpty()){\n //extract the min\n int extractedVertex = minHeap.extractMin();\n\n if(extractedVertex==t) {\n break;\n }\n SPT[extractedVertex] = true;\n\n LinkedList<Edge> list = g.adjacencylist[extractedVertex];\n for (int i = 0; i <list.size() ; i++) {\n Edge edge = list.get(i);\n int destination = edge.destination;\n if(SPT[destination]==false ) {\n\n double newKey = resultPath[extractedVertex] + edge.weight ;\n double currentKey = resultPath[destination];\n if(currentKey>=newKey){\n minHeap.updateKey(newKey, destination,resultPath[destination]);\n parent[destination].add(extractedVertex);\n resultPath[destination] = newKey;\n }\n }\n }\n }\n int numofPath =0;\n\n //calculate the number of path\n if(parent[t]!=null){\n boolean[] isVisited = new boolean[intersection];\n ArrayList<Integer> pathList = new ArrayList<>();\n pathList.add(t);\n numofPath = findAllPathsUtil(s, t, isVisited, pathList,numofPath,parent); //dfs\n\n }\n return numofPath;\n }" ]
[ "0.606467", "0.5997865", "0.5506397", "0.5497924", "0.5480012", "0.5439806", "0.5428522", "0.53820896", "0.5378801", "0.5334904", "0.5329491", "0.5325683", "0.5321939", "0.53028", "0.52919763", "0.52783275", "0.52646327", "0.525842", "0.5253377", "0.5236611", "0.52284735", "0.5182355", "0.51730037", "0.51688945", "0.5149906", "0.51482993", "0.51234", "0.51076514", "0.5107294", "0.5104929", "0.50991386", "0.50930536", "0.5092404", "0.50910753", "0.50907093", "0.5080948", "0.5076159", "0.5075672", "0.50756115", "0.50736374", "0.5070153", "0.5065428", "0.50571203", "0.50489914", "0.5046596", "0.5043604", "0.50190395", "0.49971277", "0.4988615", "0.49802092", "0.49732357", "0.49663615", "0.49624982", "0.49623942", "0.49534526", "0.49444938", "0.49434304", "0.4928268", "0.4920387", "0.4917724", "0.4917608", "0.49170822", "0.49104047", "0.48944137", "0.48909912", "0.48866686", "0.48746926", "0.4872915", "0.48693407", "0.48624146", "0.48616993", "0.48562154", "0.48533207", "0.4851593", "0.48449665", "0.48428756", "0.48426703", "0.48419666", "0.48341104", "0.48310435", "0.48303023", "0.48292565", "0.48261765", "0.48160583", "0.48133552", "0.48101526", "0.4798664", "0.47906774", "0.47864744", "0.47753277", "0.47704104", "0.47683096", "0.47635025", "0.47621727", "0.47589996", "0.4755596", "0.47496188", "0.4747212", "0.47460288", "0.47437376" ]
0.6220721
0
TODO: This isn't quite working correctly, fix it
public static void updateActions() { jEdit.removeActionSet(apiCommands); apiCommands.removeAllActions(); StringTokenizer tokenizer = new StringTokenizer( jEdit.getProperty("options.javadoc.path", ""), File.pathSeparator); while (tokenizer.hasMoreTokens()) { String token = tokenizer.nextToken(); try { apiCommands.addAction(ApiAction.create(token)); } catch (IllegalArgumentException e) { e.printStackTrace(); } } jEdit.addActionSet(apiCommands); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void strin() {\n\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "private void poetries() {\n\n\t}", "@Override\n\tprotected void interr() {\n\t}", "private void kk12() {\n\n\t}", "private stendhal() {\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "protected boolean func_70814_o() { return true; }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "private static void cajas() {\n\t\t\n\t}", "public void method_4270() {}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "private void m50366E() {\n }", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\n public int describeContents() { return 0; }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n public int retroceder() {\n return 0;\n }", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "public final void mo51373a() {\n }", "public void mo38117a() {\n }", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\tpublic void apply() {\n\t\t\n\t}", "@Override\n protected void getExras() {\n }", "public abstract void mo70713b();", "public void mo21877s() {\n }", "public void testEntrySetIteratorHasProperMappings() {\n return;\r\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "private void level7() {\n }", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "private void init() {\n\n\t}", "public abstract void mo56925d();", "public void skystonePos4() {\n }", "static void feladat4() {\n\t}", "static void feladat9() {\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "protected void mo6255a() {\n }", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}", "public void mo4359a() {\n }", "public void identify() {\n\n\t}", "public void smell() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "private Unescaper() {\n\n\t}", "@Override\n\tpublic void jugar() {}", "static void feladat7() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "protected boolean func_70041_e_() { return false; }", "protected MetadataUGWD() {/* intentionally empty block */}", "public void skystonePos6() {\n }", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n\tprotected void prepare() {\n\t\t\n\t}", "private Rekenhulp()\n\t{\n\t}", "@Override\n protected void init() {\n }", "static void feladat6() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n protected void prot() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void one() {\n\t\t\n\t}", "public abstract String mo9239aw();", "private void test() {\n\n\t}", "@Override\r\n\tvoid func04() {\n\t\t\r\n\t}", "@Override\n public void init() {\n\n }", "private void getStatus() {\n\t\t\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic int sub() {\n\t\treturn 0;\r\n\t}", "@Override\n\tpublic void dtd() {\n\t\t\n\t}" ]
[ "0.5486575", "0.54781866", "0.54389036", "0.5331759", "0.531981", "0.52878004", "0.5265696", "0.52620476", "0.525224", "0.52393687", "0.51752925", "0.51589763", "0.5149204", "0.5070705", "0.5062188", "0.5036297", "0.50121593", "0.50061184", "0.49948013", "0.49720284", "0.49718857", "0.49556857", "0.49549997", "0.495171", "0.49239707", "0.4913088", "0.49074253", "0.48937255", "0.4870878", "0.4870878", "0.48612377", "0.4859753", "0.48517436", "0.48358083", "0.4814052", "0.48070544", "0.48067132", "0.48048854", "0.48001498", "0.4798976", "0.4798976", "0.47888735", "0.47819442", "0.47809812", "0.47803095", "0.47544608", "0.47538096", "0.47489786", "0.47463366", "0.47439253", "0.47389522", "0.47344762", "0.47344762", "0.47344762", "0.47344762", "0.47344762", "0.473213", "0.47232866", "0.4722392", "0.47177526", "0.47128576", "0.47128576", "0.47128576", "0.47128576", "0.47128576", "0.47128576", "0.47110105", "0.4711008", "0.47083643", "0.4707593", "0.4707468", "0.47055882", "0.4702489", "0.470176", "0.46996638", "0.4699176", "0.4697038", "0.46970168", "0.4694241", "0.46912703", "0.46908665", "0.4688725", "0.4688605", "0.46877506", "0.46789628", "0.46789628", "0.46789628", "0.46789628", "0.46789628", "0.46789628", "0.46789628", "0.46789446", "0.46689332", "0.46686837", "0.466333", "0.4662694", "0.46622977", "0.46587119", "0.46587119", "0.46580458", "0.4652951" ]
0.0
-1
Searches the list for the given unqualified class name, displaying it in InfoViewer if found
public static void search(final View view, final String name) { view.getStatus().setMessage("Searching ... "); new Thread() { public void run() { String path = jEdit.getProperty("options.javadoc.path", ""); StringTokenizer tokenizer = new StringTokenizer(path, File.pathSeparator); ArrayList<String> pathList = new ArrayList<String>(); while (tokenizer.hasMoreTokens()) { String dir = tokenizer.nextToken(); Buffer packageList = jEdit.openTemporary(view, dir, "package-list", false); if (packageList == null || packageList.isNewFile()) { Log.log(Log.ERROR, JavadocPlugin.class, "Invalid API root: "+dir); continue; } for (int i = 0; i<packageList.getLineCount(); i++) { String pkg = packageList.getLineText(i).replace(".", File.separator); File pkgDir = new File(dir, pkg); File cls = new File(pkgDir, name+".html"); if (cls.exists()) { pathList.add(cls.getPath()); } } } if (pathList.size() == 0) { view.getStatus().setMessageAndClear("Class "+name+" not found"); return; } String chosenDoc = null; if (pathList.size() > 1) { chosenDoc = (String) JOptionPane.showInputDialog(view, jEdit.getProperty("msg.javadoc.resolve-class.message"), jEdit.getProperty("msg.javadoc.resolve-class.title"), JOptionPane.QUESTION_MESSAGE, null, pathList.toArray(), pathList.get(0)); } else { chosenDoc = pathList.get(0); } if (chosenDoc != null) { InfoViewerPlugin.openURL(view, new File(chosenDoc).toURI().toString()); } view.getStatus().setMessage(""); } }.start(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void cmdInfoClass(String classname) throws NoSystemException {\n MSystem system = system();\n MClass cls = system.model().getClass(classname);\n if (cls == null)\n Log.error(\"Class `\" + classname + \"' not found.\");\n else {\n MMVisitor v = new MMPrintVisitor(new PrintWriter(System.out, true));\n cls.processWithVisitor(v);\n int numObjects = system.state().objectsOfClass(cls).size();\n System.out.println(numObjects + \" object\"\n + ((numObjects == 1) ? \"\" : \"s\")\n + \" of this class in current state.\");\n }\n }", "public static void displayClassInfo(Class clazz, StringBuffer results)\n {\n // Print out some codebase info for the ProbeHome\n ClassLoader cl = clazz.getClassLoader();\n results.append(\"\\n\"+clazz.getName()+\".ClassLoader=\"+cl);\n ClassLoader parent = cl;\n while( parent != null )\n {\n results.append(\"\\n..\"+parent);\n URL[] urls = getClassLoaderURLs(parent);\n int length = urls != null ? urls.length : 0;\n for(int u = 0; u < length; u ++)\n {\n results.append(\"\\n....\"+urls[u]);\n }\n if( parent != null )\n parent = parent.getParent();\n }\n CodeSource clazzCS = clazz.getProtectionDomain().getCodeSource();\n if( clazzCS != null )\n results.append(\"\\n++++CodeSource: \"+clazzCS);\n else\n results.append(\"\\n++++Null CodeSource\");\n\n results.append(\"\\nImplemented Interfaces:\");\n Class[] ifaces = clazz.getInterfaces();\n for(int i = 0; i < ifaces.length; i ++)\n {\n results.append(\"\\n++\"+ifaces[i]);\n ClassLoader loader = ifaces[i].getClassLoader();\n results.append(\"\\n++++ClassLoader: \"+loader);\n ProtectionDomain pd = ifaces[i].getProtectionDomain();\n CodeSource cs = pd.getCodeSource();\n if( cs != null )\n results.append(\"\\n++++CodeSource: \"+cs);\n else\n results.append(\"\\n++++Null CodeSource\");\n }\n }", "public ClassItem SearchClass(String className) {\n\t\tfor(ClassItem classitem : classItem)\n\t\t{\n\t\t\tif(classitem.name==className)\n\t\t\t\treturn classitem;\n\t\t}\n\t\treturn null;\n\t}", "protected void showClass()\n {\n inspectorManager.getClassInspectorInstance(obj.getClassRef(), pkg, this);\n }", "@Override\n public ClassInfo findClass(String fqcn) {\n if (classLookup == null) {\n buildClassLookupMap();\n }\n return classLookup.get(fqcn);\n }", "private void onClassesFound(List<UMDClass> classes) {\n\t}", "public FindResult findClass(String className);", "public List<Models.Class> showClasses() {\n // Get from all levels\n List<Models.Class> results = em.createNativeQuery(\"select c.* from class c, classparticipant cpa, participant p where c.classid = cpa.classid and cpa.participantid = p.participantid and p.userid = ?\", Models.Class.class).setParameter(1, user.getUserid()).getResultList();\n\n // Display the output\n String output = \"\";\n\n output = addChat(results.size() + \" classes were found.\");\n\n for (Models.Class classroom : results) {\n output += \"<div class='result display' onclick=\\\"window.location.href='Class?id=\" + classroom.getClassid() + \"'\\\">\\n\"\n + \" <div class='top'>\\n\"\n + \" <img class='icon' src='https://www.flaticon.com/svg/static/icons/svg/717/717874.svg'>\\n\"\n + \" <div class='text'>\\n\"\n + \" <a class='type'>CLASS</a>\\n\"\n + \" <a class='name'>\" + classroom.getClasstitle() + \"</a>\\n\"\n + \" <a class='subname'>\" + classroom.getClassid() + \"</a>\\n\"\n + \" </div>\\n\"\n + \" </div>\\n\"\n + \" </div>\";\n }\n\n servlet.putInJsp(\"result\", output);\n return results;\n }", "private Class<?> findInternalClass(String name){\n Class<?> clazz = null;\n for (int i = 0; i < urls.length; i++) {\n String root = urls[i].getPath();\n clazz = realFindClass(root,name);\n if(clazz != null)\n break;\n }\n if(clazz != null) {\n classes.put(name,clazz);\n return clazz;\n }\n return null;\n }", "boolean hasClassname();", "protected Class< ? extends Object > findClass( String name ) throws ClassNotFoundException {\n\t\tfinal Class< ? extends Object > c = load_classes.get( name );\n\t\tif ( c == null ) throw new ClassNotFoundException();\n\t\treturn c;\n\t}", "public abstract List<String> scanAllClassNames();", "@Override\n public JavaClass findClass(final String className) {\n final SoftReference<JavaClass> ref = loadedClasses.get(className);\n if (ref == null) {\n return null;\n}\n return ref.get();\n }", "private Obj myFindForClass(String name, DesignatorIdent desIdent) {\n \tObj rez = findInMyScope(name); // provera da li je lokalna promenljiva trenutne funkcije\r\n \tif(rez!= Tab.noObj) {\r\n \t\treturn rez;\r\n \t}\r\n \t\r\n \tStruct classStruct = null;\r\n \tif(currentClass != null) {\r\n \t\tclassStruct = currentClass;\r\n \t}\r\n \telse {\r\n \t\tclassStruct = currentAbsClass;\r\n \t}\r\n \t\r\n \tObj resultObj = null;\r\n \tSymbolDataStructure members = Tab.currentScope().getOuter().getLocals(); // nisu dodati u classStruct, ali se nalaze u scope, vec su sig svi navedeni\r\n \t\r\n \twhile (classStruct != null) { // u sebi ga trazis ...ako si ga nasao pristupas preko implicitnog this!\r\n \t\tif (members != null) {\r\n \t\t\tresultObj = members.searchKey(name);\r\n \t\t\tif (resultObj != null) break;\r\n \t\t}\r\n \t\t\r\n \t\tclassStruct = classStruct.getElemType();\r\n \t\tif (classStruct != null) {\r\n \t\t\tmembers = classStruct.getMembersTable();\r\n \t\t}\r\n \t}\r\n \t\r\n \tif (resultObj != null) {\r\n \t\tStruct trenutna = null;\r\n \t\tif (currentClass != null)\r\n \t\t\ttrenutna = currentClass;\r\n \t\tif (currentAbsClass != null)\r\n \t\t\ttrenutna = currentAbsClass;\r\n// \t\tif (trenutna == null) // dal je moguce? ---> jeste u main-u npr ---> ovde nece moci jel sig zovem iz klase...\r\n// \t\t\treturn;\r\n \t\t// znaci polje sam klase \"klasa\" ; zovem se sa . nesto...sig sam polje ili metoda klase\r\n \t\tif (resultObj.getKind() == Obj.Fld || resultObj.getKind() == Obj.Meth) { \r\n \t\t\tif (resultObj.getFpPos() == 1 || resultObj.getFpPos() == -9) { // public\r\n \t\t\t\tif (resultObj.getKind() == Obj.Meth) {\r\n \t \t\t\treport_info(\"Detektovan poziv metoda unutrasnje klase: \" + desIdent.getName() + \" na liniji \" + desIdent.getLine(), desIdent);\r\n \t \t\t\tcallFunctionClassField = 1;\r\n \t \t\t}\r\n \t\t\t\treturn resultObj;\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\tif (resultObj.getFpPos() == 2 || resultObj.getFpPos() == -8) { // protected\r\n \t\t\t\tif (resultObj.getKind() == Obj.Meth) {\r\n \t \t\t\treport_info(\"Detektovan poziv metoda unutrasnje klase: \" + desIdent.getName() + \" na liniji \" + desIdent.getLine(), desIdent);\r\n \t \t\t\tcallFunctionClassField = 1;\r\n \t \t\t}\r\n \t\t\t\treturn resultObj;\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\tif (resultObj.getFpPos() == 3 || resultObj.getFpPos() == -7) { // private\r\n \t\t\t\tif (trenutna != classStruct) {\r\n \t\t\t\t\treport_error(\"Greska na liniji \" + desIdent.getLine()+ \" : polju \"+desIdent.getName()+\" se ne sme pristupati na ovom mestu, private je!\", null);\r\n \t\t\t\t}\r\n \t\t\t\telse {\r\n \t\t\t\t\tif (resultObj.getKind() == Obj.Meth) {\r\n \t\t \t\t\treport_info(\"Detektovan poziv metoda unutrasnje klase: \" + desIdent.getName() + \" na liniji \" + desIdent.getLine(), desIdent);\r\n \t\t \t\t\tcallFunctionClassField = 1;\r\n \t\t \t\t\treturn resultObj;\r\n \t\t \t\t}\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\t\r\n// \t\tif (resultObj.getKind() == Obj.Meth) {\r\n// \t\t\treport_info(\"Detektovan poziv metoda unutrasnje klase: \" + desIdent.getName() + \" na liniji \" + desIdent.getLine(), desIdent);\r\n// \t\t\tcallFunctionClassField = 1;\r\n// \t\t}\r\n \t\treturn resultObj;\r\n \t}\r\n \t\r\n \tObj meth = Tab.find(name); // ako je global...\r\n \tif (meth.getKind() == Obj.Meth) {\r\n \t\treport_info(\"Detektovan poziv globalne f-je: \" + desIdent.getName() + \" na liniji \" + desIdent.getLine(), desIdent);\r\n\t\t\tcallFunctionClassField = 0;\r\n \t}\r\n \t\r\n \treturn meth;\r\n\t}", "private boolean findClassInComponents(String name) {\n // we need to search the components of the path to see if we can find the\n // class we want.\n final String classname = name.replace('.', '/') + \".class\";\n final String[] list = classpath.list();\n boolean found = false;\n int i = 0;\n while (i < list.length && found == false) {\n final File pathComponent = (File)project.resolveFile(list[i]);\n found = this.contains(pathComponent, classname);\n i++;\n }\n return found;\n }", "String getInstanceOfClass();", "public void showClassPanel() {\r\n \t\tdialogFactory.getDialog(new jmodelClassesPanel(model, model), \"Manage User Classes\");\r\n \t}", "void displayInnnerClass() {\r\n\t\tNestedClass nestedClassObj = new NestedClass();\r\n\t\tnestedClassObj.displayPrint();\r\n\t}", "public void findByType(String type)\n {\n boolean found = false;\n for(KantoDex entry : entries)\n {\n if(entry.getTypes1().contains(type) && !type.equals(\"\"))\n {\n found = true;\n } \n }\n if(!found)\n {\n System.out.println(\"You have input a nonexistent type, or the type was not applicable to this entry.\"); \n }\n else\n {\n System.out.println(\"All Pokedex entries of type \" + type + \":\");\n for(KantoDex entry : entries)\n {\n if(entry.getType1().equals(type) || entry.getType2().equals(type))\n {\n entry.display();\n }\n }\n }\n }", "public ClassInfo getClassInfo(String fullClassName) {\r\n return classMap.get(fullClassName);\r\n }", "@Override\n protected Class \n findClass\n (\n String cname\n ) \n throws ClassNotFoundException\n {\n byte bs[] = pContents.get(cname);\n if(bs == null) \n throw new ClassNotFoundException\n\t(\"Unable to find class (\" + cname + \")!\");\n\n return defineClass(cname, bs, 0, bs.length);\n }", "String getClassName();", "String getClassName();", "String getClassName();", "public String getClassName();", "java.lang.String getClass_();", "java.lang.String getClass_();", "private void\r\n findMemberType(@Nullable String name, Collection<IClass> result) throws CompileException {\n IClass[] memberTypes = this.getDeclaredIClasses();\r\n if (name == null) {\r\n result.addAll(Arrays.asList(memberTypes));\r\n } else {\r\n String memberDescriptor = Descriptor.fromClassName(\r\n Descriptor.toClassName(this.getDescriptor())\r\n + '$'\r\n + name\r\n );\r\n for (final IClass mt : memberTypes) {\r\n if (mt.getDescriptor().equals(memberDescriptor)) {\r\n result.add(mt);\r\n return;\r\n }\r\n }\r\n }\r\n\r\n // Examine superclass.\r\n {\r\n IClass superclass = this.getSuperclass();\r\n if (superclass != null) superclass.findMemberType(name, result);\r\n }\r\n\r\n // Examine interfaces.\r\n for (IClass i : this.getInterfaces()) i.findMemberType(name, result);\r\n\r\n // Examine enclosing type declarations.\r\n {\r\n IClass declaringIClass = this.getDeclaringIClass();\r\n IClass outerIClass = this.getOuterIClass();\r\n if (declaringIClass != null) {\r\n declaringIClass.findMemberType(name, result);\r\n }\r\n if (outerIClass != null && outerIClass != declaringIClass) {\r\n outerIClass.findMemberType(name, result);\r\n }\r\n }\r\n }", "private Class loadClass(ClassInfo classInfo) {\n Class type = null;\n try {\n URLClassLoader classLoader = new URLClassLoader(new URL[]{\n new File(classInfo.getPath()).toURI().toURL()\n });\n type = classLoader.loadClass(classInfo.getName());\n } catch (MalformedURLException ex) {\n Logger.getLogger(CDIC.class.getName()).log(Level.SEVERE, \"Class url stimmt nicht. Ggf. hat der ClassIndexer einen falschen Pfad!\", ex);\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(CDIC.class.getName()).log(Level.SEVERE, \"Klasse konnte nicht gefunden werden!\", ex);\n }\n return type;\n }", "public void scanClasspath() {\n List<String> classNames = new ArrayList<>(Collections.list(dexFile.entries()));\n\n ClassLoader classLoader = org.upacreekrobotics.dashboard.ClasspathScanner.class.getClassLoader();\n\n for (String className : classNames) {\n if (filter.shouldProcessClass(className)) {\n try {\n Class klass = Class.forName(className, false, classLoader);\n\n filter.processClass(klass);\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n } catch (NoClassDefFoundError e) {\n e.printStackTrace();\n }\n }\n }\n }", "public <T extends Base> T findByName(Class<T> T, String name)\n\t\t\tthrows IOException, ClassNotFoundException {\n\t\tT result = null;\n\t\tfor (T t : list(T)) {\n\t\t\tif (t.getName().equals(name)) {\n\t\t\t\tresult = t;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "@Override\n\tprotected Class<?> findClass(String name) throws ClassNotFoundException {\n\t\tFile file = new File(getSimpleName(name) + \".class\");\n FileInputStream fis = null;\n Class<?> clazz = null;\n try {\n fis = new FileInputStream(file);\n int content = 0;\n int i = 0;\n byte[] data = new byte[fis.available()];\n while ((content = fis.read()) != -1) {\n // convert to char and display it\n data[i] = (byte) content;\n i++;\n }\n clazz = defineClass(name, data, 0, data.length);\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n if (fis != null)\n fis.close();\n } catch (IOException ex) {\n \t\tex.printStackTrace();\n \t}\n }\n return clazz;\n\t}", "public abstract Class getDescriptedClass();", "private void connectClasses(Header [] list)\r\n {\r\n Vector queue;\r\n Vector garbage = new Vector();\r\n\r\n Find.setCrossreference(list);\r\n\r\n for(int i = 0; list != null && i < list.length; i++)\r\n {\r\n queue = list[i].scopes;\r\n\r\n for(int j = 0; j < queue.size(); j++)\r\n for(Iterator iter = ((Scope)queue.get(j)).iterator(); iter.hasNext();)\r\n {\r\n Iterator a = null;\r\n Basic x = (Basic)iter.next();\r\n\r\n if (x instanceof ClassType)\r\n {\r\n ClassType y = (ClassType)x;\r\n ClassType [] z;\r\n boolean done = false;\r\n String st = null;\r\n\r\n if (y.extend != null && y.extend.name != null && y.extend.scope == null)\r\n { // look for superclass\r\n st = y.extend.name.string;\r\n for(a = y.unresolved.iterator(); a.hasNext();)\r\n {\r\n String s = (String)a.next();\r\n if (s.endsWith('.' + st))\r\n {\r\n st = s;\r\n break;\r\n }\r\n }\r\n\r\n z = Find.findClass(st, 0, y.scope);\r\n \r\n for(int k = 0; k < z.length; k++)\r\n if (z[k].scope.javaPath(\"\").endsWith(st) || z[k].scope.buildPath(\"\").endsWith(st))\r\n {\r\n y.extend = z[k];\r\n garbage.add(st);\r\n done = true;\r\n }\r\n }\r\n\r\n for(int k = 0; k < y.implement.length; k++)\r\n if (y.implement[k].name != null && y.implement[k].scope == null)\r\n { // look for interface\r\n st = y.implement[k].name.string;\r\n for(a = y.unresolved.iterator(); a.hasNext();)\r\n {\r\n String s = (String)a.next();\r\n if (s.endsWith('.' + st))\r\n {\r\n st = s;\r\n break;\r\n }\r\n }\r\n done = false;\r\n \r\n z = Find.findClass(st, 0, y.scope);\r\n \r\n for(int l = 0; l < z.length && !done; l++)\r\n if (z[l].scope.javaPath(\"\").endsWith(st) || z[l].scope.buildPath(\"\").endsWith(st))\r\n {\r\n y.implement[k] = z[l];\r\n garbage.add(st);\r\n done = true;\r\n break;\r\n }\r\n }\r\n\r\n a = null;\r\n while(garbage.size() > 0)\r\n {\r\n st = (String)garbage.get(0);\r\n garbage.remove(0);\r\n y.unresolved.remove(st);\r\n }\r\n }\r\n }\r\n }\r\n }", "public String getSearchClass() {\r\n return searchClass;\r\n }", "public static void getClassUsage(){\r\n ClassMeasurement classMeasurement = new ClassMeasurement();\r\n classUsageList.add(classMeasurement);\r\n //ClassMeasurement.printClassMeasurement(classMeasurement);\r\n }", "public void setSearchClass(String searchClass) {\r\n this.searchClass = searchClass;\r\n }", "void searchView(String name);", "@DSComment(\"From safe class list\")\n @DSSafe(DSCat.SAFE_LIST)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:56:09.367 -0500\", hash_original_method = \"4A1605B03FE1E22048A20B9E05E481A5\", hash_generated_method = \"4396D2BAEFB73347858E563F022F81BC\")\n \n@Override\n public String toString() {\n return getClass().getName() + '(' + getName() + ')';\n }", "public static String openClassSelectDialog(IJavaProject project, Control parent) {\r\n\t\ttry {\r\n\t\t\tShell shell = parent.getShell();\r\n\t\t\tSelectionDialog dialog = JavaUI.createTypeDialog(\r\n\t\t\t\t\tshell,new ProgressMonitorDialog(shell),\r\n\t\t\t\t\tSearchEngine.createJavaSearchScope(new IJavaElement[]{project}),\r\n\t\t\t\t\tIJavaElementSearchConstants.CONSIDER_CLASSES,false);\r\n\t\t\t\t\r\n\t\t\tif(dialog.open()==SelectionDialog.OK){\r\n\t\t\t\tObject[] result = dialog.getResult();\r\n\t\t\t\treturn ((IType)result[0]).getFullyQualifiedName();\r\n\t\t\t}\r\n\t\t} catch(Exception ex){\r\n\t\t\tHTMLPlugin.logException(ex);\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "java.lang.String getClassName();", "private static void printSupers(ClassContainer tempClass, ArrayList<String> whitelist, PrintWriter printFile) {\n\t\tArrowStorage extension = tempClass.getSupers();\n\t\tif (extension == null) {\n\t\t\treturn;\n\t\t}\n\t\tif (whitelist.contains(extension.getTargetType()) && extension.getTargetType().contains(\"_\")\n\t\t\t\t&& !extension.getTargetType().equals(tempClass.getClassName())) {\n\t\t\tprintFile.println(tempClass.getClassName() + \" -> \"\n\t\t\t\t\t+ tempClass.getSupers().getTargetType() + \" [\"\n\t\t\t\t\t+ extension.getColor() + \" \" + extension.getLabel()\n\t\t\t\t\t+ \"arrowhead=\\\"onormal\\\"];\");\n\t\t}\n\t}", "public abstract void displayInfo();", "public static boolean isThisClassRegistered(String classname){\n dbgLog.fine(\"********** within isThisClassRegistered **********\");\n dbgLog.fine(\"classname to be checked=\"+classname);\n Object singleton = map.get(classname);\n if (singleton != null){\n return true;\n } else {\n return false;\n }\n }", "public static LinkedList<String> constructorSearch(Class enteredClass){\n LinkedList<String> result = new LinkedList<>();//array with result\n Class classNoteBook = enteredClass;\n\n /* get amount of modifiers */\n int modifiers = classNoteBook.getModifiers();\n\n /* find modifiers for class */\n if (Modifier.isPublic(modifiers)) {\n result.add(\"Class is public\");\n }\n\n else if (Modifier.isAbstract(modifiers)) {\n MyWriter.show(\"Class is abstract\");\n }\n\n else if (Modifier.isFinal(modifiers)) {\n result.add(\"Class is final\");\n }\n\n /* get all constructors of class */\n Constructor[] allConstructors = classNoteBook.getDeclaredConstructors();\n\n for (Constructor constructor : allConstructors) {\n int number = 0;\n result.add(\"Constructor: \" + constructor.toGenericString());\n\n /* get all type of parameters of constructor */\n Class[] parameterTypes = constructor.getParameterTypes();\n\n for (Class param : parameterTypes) {\n result.add(\" GenericParameterType [\" + number++ + \"]: \" + param);\n }\n }\n return result;\n }", "private MyClassInfo findClass(List<MyClassInfo> cl, long cursor) {\n\t\tfor (MyClassInfo c : cl) {\n\t\t\tif (cursor > c.getStartPosition() && cursor < c.getEndPosition()) {\n\t\t\t\tList<MyClassInfo> nodes = c.getClassNodes();\n\t\t\t\tMyClassInfo c2 = findClass(nodes, cursor);\n\t\t\t\tif (c2 != null) {\n\t\t\t\t\treturn c2;\n\t\t\t\t} else {\n\t\t\t\t\treturn c;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public static IInterfaceDefinition searchType(String unresolvedTypeName,\n\t\t\tEnvironment env)\n\t{\n\t\tfor (IClassDefinition cd : env.getClasses())\n\t\t{\n\t\t\tif (env.isTreeNode(cd))\n\t\t\t{\n\t\t\t\tif (env.classToType.get(cd) == ClassType.Token\n\t\t\t\t\t\t&& checkName(cd, unresolvedTypeName, true, env))// c.rawName.equals(unresolvedTypeName))\n\t\t\t\t{\n\t\t\t\t\treturn cd;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Lookup in all root productions\n\t\tfor (IClassDefinition cd : env.getClasses())\n\t\t{\n\t\t\tif (env.isTreeNode(cd))\n\t\t\t{\n\t\t\t\tif (env.classToType.get(cd) == ClassType.Production\n\t\t\t\t\t\t&& checkName(cd, unresolvedTypeName, true, env))\n\t\t\t\t{\n\t\t\t\t\treturn cd;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Lookup in all sub productions\n\t\tfor (IClassDefinition cd : env.getClasses())\n\t\t{\n\t\t\tif (env.isTreeNode(cd))\n\t\t\t{\n\t\t\t\tif (env.classToType.get(cd) == ClassType.SubProduction\n\t\t\t\t\t\t&& checkName(cd, unresolvedTypeName, true, env))\n\t\t\t\t{\n\t\t\t\t\treturn cd;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Lookup in all alternatives\n\t\tfor (IClassDefinition cd : env.getClasses())\n\t\t{\n\t\t\tif (env.isTreeNode(cd))\n\t\t\t{\n\t\t\t\tif (env.classToType.get(cd) == ClassType.Alternative\n\t\t\t\t\t\t&& checkName(cd, unresolvedTypeName, true, env))\n\t\t\t\t{\n\t\t\t\t\treturn cd;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Lookup for all raw names no matter the type\n\t\tfor (IClassDefinition cd : env.getClasses())\n\t\t{\n\t\t\tif (env.isTreeNode(cd))\n\t\t\t{\n\t\t\t\tif (checkName(cd, unresolvedTypeName, true, env))\n\t\t\t\t{\n\t\t\t\t\treturn cd;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Lookup in all with not raw name\n\t\tfor (IClassDefinition cd : env.getClasses())\n\t\t{\n\t\t\tif (env.classToType.get(cd) == ClassType.Custom)\n\t\t\t{\n\t\t\t\tif (checkName(cd, unresolvedTypeName, false, env))\n\t\t\t\t{\n\t\t\t\t\treturn cd;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (IClassDefinition c : env.getClasses())\n\t\t{\n\t\t\tif (c.getName().equals(unresolvedTypeName))\n\t\t\t{\n\t\t\t\treturn c;\n\t\t\t}\n\t\t}\n\n\t\tfor (IClassDefinition c : env.getClasses())\n\t\t{\n\t\t\tif (c.getName().getTag().equals(unresolvedTypeName))\n\t\t\t{\n\t\t\t\treturn c;\n\t\t\t}\n\t\t}\n\n\t\tfor (IInterfaceDefinition i : env.getInterfaces())\n\t\t{\n\t\t\tif (i.getName().getName().equals(unresolvedTypeName))\n\t\t\t\treturn i;\n\t\t}\n\n\t\treturn null;// \"%\" + type;\n\n\t}", "private void searchRoutine() {\n String s = (String) JOptionPane.showInputDialog(\n this,\n \"Enter the name of the routine:\",\n \"Search\",\n JOptionPane.PLAIN_MESSAGE,\n null, null, null);\n\n if (s != null) {\n try {\n Routine r = collection.search(s);\n list.setSelectedValue(r, true);\n } catch (DoesNotExistException ee) {\n JOptionPane.showMessageDialog(this, \"Routine with given name does not exist.\");\n }\n }\n }", "List memberClasses();", "public static Class findClass(Object object, String simpleName) {\n \t\tClass clazz = object.getClass();\n \t\tdo {\n \t\t\tClass result = findClass(clazz, simpleName);\n \t\t\tif (result!=null)\n \t\t\t\treturn result;\n \t\t\tclazz = clazz.getSuperclass();\n \t\t}\n \t\twhile (clazz!=null);\n \t\ttry {\n \t\t\t// last resort: try the UI plugin, this is where the Messages class is defined\n \t\t\tBundle b = OSGIUtils.getDefault().getBundle(\"org.eclipse.bpmn2.modeler.ui\"); //$NON-NLS-1$\n \t\t\tclazz = b.loadClass(\"org.eclipse.bpmn2.modeler.ui.Messages\"); //$NON-NLS-1$\n \t\t\tClass result = findClass(clazz, simpleName);\n \t\t\tif (result!=null)\n \t\t\t\treturn result;\n \t\t} catch (Exception e) {\n \t\t}\n \t\treturn null;\n \t}", "public void printRegisteredClasses(String user) {\n\t\tfor (int i = 0; i < CourseManager.students.size(); i++) {\n\t\t\tif (CourseManager.students.get(i).getUsername().equals(user)) {\n\t\t\t\tfor (int j = 0; j < CourseManager.courses.size(); j++) {\n\t\t\t\t\tfor (int k = 0; k < CourseManager.courses.get(j).getStudlist().size(); k++) {\n\t\t\t\t\t\tif (CourseManager.courses.get(j).getStudlist().get(k).getUsername().equals(user)) {\n\t\t\t\t\t\t\tSystem.out.println(CourseManager.courses.get(j).getName());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "String printListSearch(String searchString);", "public String getClazzName();", "private void searchTV() {\n\t\tboolean flag = false;\r\n\t\tfor(int i=0; i<index; i++) {\r\n\t\t\tif(products[i] instanceof TV) {\r\n\t\t\t\tSystem.out.println(products[i].toString());\r\n\t\t\t\tflag = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(flag == false)\r\n\t\t\tSystem.out.println(\"TV가 없습니다.\");\r\n\t}", "public List<Models.Class> showClasses(String from) {\n // Get from all levels\n List<Models.Class> fromInstitution = em.createNativeQuery(\"select c.* from class c, course cr, programme pg, institution i, institutionparticipant ipa, participant p where c.coursecode = cr.coursecode and cr.programmecode = pg.programmecode and pg.institutioncode = i.institutioncode and ipa.institutioncode = i.institutioncode and ipa.participantid = p.participantid and p.userid = ? and i.institutioncode = ?\", Models.Class.class).setParameter(1, user.getUserid()).setParameter(2, from).getResultList();\n List<Models.Class> fromProgramme = em.createNativeQuery(\"select c.* from class c, course cr, programme pg,programmeparticipant ppa, participant p where c.coursecode = cr.coursecode and cr.programmecode = pg.programmecode and ppa.programmecode = pg.programmecode and ppa.participantid = p.participantid and p.userid = ? and pg.programmecode = ?\", Models.Class.class).setParameter(1, user.getUserid()).setParameter(2, from).getResultList();\n List<Models.Class> fromCourse = em.createNativeQuery(\"select c.* from class c, course cr, courseparticipant cpa, participant p where c.coursecode = cr.coursecode and cpa.coursecode = cr.coursecode and cpa.participantid = p.participantid and p.userid = ? and cpa.coursecode = ?\", Models.Class.class).setParameter(1, user.getUserid()).setParameter(2, from).getResultList();\n\n // Combine the results\n List<Models.Class> results = new ArrayList<Models.Class>();\n results.addAll(fromInstitution);\n results.addAll(fromProgramme);\n results.addAll(fromCourse);\n\n // Display the output\n String output = \"\";\n\n output = addChat(results.size() + \" classes were found.\");\n\n for (Models.Class classroom : results) {\n output += \"<div class='result display' onclick=\\\"window.location.href='Class?id=\" + classroom.getClassid() + \"'\\\">\\n\"\n + \" <div class='top'>\\n\"\n + \" <img class='icon' src='https://www.flaticon.com/svg/static/icons/svg/717/717874.svg'>\\n\"\n + \" <div class='text'>\\n\"\n + \" <a class='type'>CLASS</a>\\n\"\n + \" <a class='name'>\" + classroom.getClasstitle() + \"</a>\\n\"\n + \" <a class='subname'>\" + classroom.getClassid() + \"</a>\\n\"\n + \" </div>\\n\"\n + \" </div>\\n\"\n + \" </div>\";\n }\n\n servlet.putInJsp(\"result\", output);\n\n return results;\n }", "Object getClass_();", "Object getClass_();", "public boolean existsClass(String name)\r\n\t{\r\n\t\treturn obtainOntClass(name) != null;\r\n\t}", "private void print_class_ppt(ClassInfo cinfo, String name, DeclReader comp_info) {\n\n if (debug) {\n System.out.println(\"Enter print_class_ppt: \" + cinfo);\n }\n\n // reset dummy comparability value\n unique_compare_value = initial_compare_value;\n\n if (num_class_vars(cinfo) > 0) {\n\n outFile.println(\"ppt \" + escape(name));\n outFile.println(\"ppt-type class\");\n\n // Print out the static fields\n for (DaikonVariableInfo childOfRoot : RootInfo.getClassPpt(cinfo, Runtime.nesting_depth)) {\n if (debug) System.out.println(\"class var: \" + childOfRoot.getName());\n traverse_decl(\n null,\n false,\n null,\n childOfRoot,\n null,\n null,\n ((comp_info == null) ? null : comp_info.find_ppt(name)));\n }\n\n outFile.println();\n }\n\n if (debug) System.out.println(\"Exit print_class_ppt\");\n }", "public String getClassList(final WinRefEx hWnd) {\n\t\treturn (hWnd == null) ? null : getClassList(TitleBuilder.byHandle(hWnd));\n\t}", "private int getIndexOfClass(List list, Class cls) {\n for (int i = 0; i < list.size(); i++) {\n if (list.get(i).getClass().equals(cls)) {\n return i;\n }\n }\n return -1;\n }", "@Override\n\tvoid display() {\n\t\tif(nodeList == null || nodeList.size() == 0) {\n\t\t\tSystem.out.println(\"not found.\");\n\t\t\treturn;\n\t\t}\n for(Inode inode:nodeList) {\n\t\t\tSystem.out.println(inode.nodename);\n }\n\t}", "public Class<?> lookupClass(String name) throws ClassNotFoundException {\n return getClass().getClassLoader().loadClass(name);\n }", "private void showSponsorSearch(){\r\n String sponsorCode;\r\n// boolean replaceInfo = false;\r\n try{\r\n edu.mit.coeus.search.gui.CoeusSearch coeusSearch =\r\n new edu.mit.coeus.search.gui.CoeusSearch(dlgWindow,\r\n \"sponsorSearch\",1);\r\n coeusSearch.showSearchWindow();\r\n edu.mit.coeus.search.gui.SearchResultWindow resWindow =\r\n coeusSearch.getResultWindow();\r\n if (!coeusSearch.getSelectedValue().equals(null) ){\r\n txtSponsorCode.setText(coeusSearch.getSelectedValue());\r\n txtSponsorCode.requestFocusInWindow();\r\n sponsorCode = txtSponsorCode.getText();\r\n getSponsorInfo(sponsorCode);\r\n }\r\n }catch(Exception e) {\r\n }\r\n }", "private void scanClass(String scanPackage) {\n URL url = this.getClass().getClassLoader().getResource(\"/\" + scanPackage.replaceAll(\"\\\\.\", \"/\"));\n File dir = new File(url.getFile());\n for (File file : dir.listFiles()) {\n if (file.isDirectory()) {\n scanClass(scanPackage + \".\" + file.getName());\n } else {\n classNames.add(scanPackage + \".\" + file.getName().replaceAll(\".class\", \"\").trim());\n }\n }\n\n }", "private void searchShow() {\n ArrayList<Show> searchShows = new ArrayList<>();\n for (Show show : clientController.getUser().getShows()) {\n if (show.getName().toLowerCase().contains(getText().toLowerCase())) {\n searchShows.add(show);\n }\n// else {\n// JOptionPane.showMessageDialog(null, \"The search gave no result!\");\n// }\n\n }\n pnlShowList.removeAll();\n pnlShowList.setBackground(Color.decode(\"#6A86AA\"));\n draw(searchShows);\n }", "public List<Classinfo> list() {\n\t\treturn null;\r\n\t}", "public void printInstance(String name) {\n\t\tServiceReference[] refs;\n\t\ttry {\n\t\t\trefs = bundleContext.getServiceReferences(Architecture.class.getName(), null);\n\t\t\tout.println(\"iPOJO Instance\");\n\t\t\tout.println(\"-------------------\");\n\t\t\tfor (int i = 0; i < refs.length; i++) {\n\t\t\t\tArchitecture arch = (Architecture) bundleContext.getService(refs[i]);\n\t\t\t\tInstanceDescription instance = arch.getInstanceDescription();\n\t\t\t\tif (instance.getName().equalsIgnoreCase(name)) {\n\t\t\t\t\tString desc = instance.getDescription().toString();\n\t\t\t\t\tdesc = desc.replace(\"unresolved\", \"\\u001b[37;1m\" + \"unresolved\" + \"\\u001b[0m\");\n\t\t\t\t\tout.println(desc.replace(\"\\n\", \"\\r\\n\"));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tout.println(\"Instance \" + name + \" not found\");\n\t\t} catch (InvalidSyntaxException e) {\n\n\t\t}\n\t}", "public final static boolean isClassInPath(String classname, String info)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tClass.forName(classname);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\tif(info != null)\r\n\t\t\t{\r\n\t\t\t\tlog.info(info);\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "private String getClass( String format )\n {\n final Class clazz = StackIntrospector.getCallerClass( Logger.class );\n\n if( null == clazz )\n {\n return \"Unknown-class\";\n }\n else\n {\n // Found : the caller is the previous stack element\n String className = clazz.getName();\n\n // Handle optional format\n if( TYPE_CLASS_SHORT_STR.equalsIgnoreCase( format ) )\n {\n int pos = className.lastIndexOf( '.' );\n\n if( pos >= 0 )\n {\n className = className.substring( pos + 1 );\n }\n }\n\n return className;\n }\n }", "public String getClassList(final String title, final String text) {\n\t\tfinal int bufSize = WIN_GET_CLASS_LIST_BUF_SIZE;\n\t\tfinal CharBuffer retText = CharBuffer.allocate(bufSize);\n\t\tAutoItXImpl.autoItX.AU3_WinGetClassList(AutoItUtils.stringToWString(AutoItUtils.defaultString(title)),\n\t\t\t\tAutoItUtils.stringToWString(text), retText, bufSize);\n\n\t\treturn LocalInstances.autoItX.hasError() ? null : Native.toString(retText.array());\n\t}", "private void searchSponsor() {\r\n String sponsorCode=null;\r\n try {\r\n CoeusSearch coeusSearch =\r\n new CoeusSearch(mdiForm, \"SPONSORSEARCH\",\r\n CoeusSearch.TWO_TABS_WITH_MULTIPLE_SELECTION );\r\n coeusSearch.showSearchWindow();\r\n javax.swing.JTable tblResultsTable = coeusSearch.getSearchResTable();\r\n if(tblResultsTable == null) return;\r\n int row = tblResultsTable.getSelectedRow();\r\n if(row!=-1){\r\n sponsorCode = (String)tblResultsTable.getValueAt(row, 0);\r\n sponsorCode = sponsorCode+\":\"+(String)tblResultsTable.getValueAt(row, 1);\r\n }else{\r\n CoeusOptionPane.showErrorDialog(\"Please select a Sponsor\");\r\n }\r\n } catch (Exception exception) {\r\n exception.printStackTrace();\r\n }\r\n int startRow = 0;\r\n TreePath root = new TreePath(sponsorHierarchyTree.getModel().getRoot());\r\n // Find the path (regardless of visibility) that matches the\r\n // specified sequence of names\r\n TreePath path = findByName(sponsorHierarchyTree, sponsorCode);\r\n if(path == null) {\r\n CoeusOptionPane.showInfoDialog(\"The sponsor:\"+sponsorCode.substring(0,sponsorCode.indexOf(\":\"))+\" is not found in this hierarchy.\");\r\n sponsorHierarchyTree.collapsePath(root);\r\n sponsorHierarchyTree.setSelectionPath(root);\r\n return;\r\n }\r\n sponsorHierarchyTree.expandPath(root);\r\n sponsorHierarchyTree.expandPath(path);\r\n sponsorHierarchyTree.setSelectionPath(path);\r\n sponsorHierarchyTree.scrollRowToVisible(sponsorHierarchyTree.getRowForPath(path));\r\n }", "public static void main(String[] args) throws ClassNotFoundException {\n Class<Test.TestD> testDClass = Test.TestD.class;\n Class<Test.TestA> testAClass = Test.TestA.class;\n getClassHierarchy(testDClass);\n getClassHierarchyRecurs(testDClass, true);\n\n getClassInformation(testDClass);\n System.out.println();\n getClassInformation(testAClass);\n }", "protected void print_Ontology(String ontClass, ListBox box) {\n\t\tbox.addItem(ontClass);\n\t}", "private static void printUses(ClassContainer tempClass, ArrayList<String> whitelist, PrintWriter printFile) {\n\t\tfor (ArrowStorage types : tempClass.getUses()) {\n\t\t\tif (whitelist.contains(types.getTargetType()) && types.getTargetType().contains(\"_\")\n\t\t\t\t\t&& !types.getTargetType().equals(tempClass.getClassName())) {\n\t\t\t\tprintFile.println(tempClass.getClassName() + \" -> \"\n\t\t\t\t\t\t+ types.getTargetType() + \" [ \" + types.getColor()\n\t\t\t\t\t\t+ \" \" + types.getLabel()\n\t\t\t\t\t\t+ \"arrowhead=\\\"vee\\\", style=\\\"dashed\\\"];\");\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tpublic void findByname(List<Student> list, Scanner sc) {\n\t\tSystem.out.println(\"请输入要查询的学生姓名\");\r\n\t\tString name=sc.next();\r\n\t\tfor(Student i:list){\r\n\t\t\tif(name.equals(i.getName())){\r\n\t\t\t\ti.info();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void run() {\n\t\tISelection selection = _typesViewer.getSelection();\n\t\tObject obj = ((IStructuredSelection) selection).getFirstElement();\n\t\tif (obj instanceof EClass) {\n\t\t\t// TODO find the right one! \n\t\t\tEmfaticEditor editor = _tv.getActiveEmfaticEditor();\n\t\t\tif (editor != null) {\n\t\t\t\tEmfaticASTNode landingPlace = EmfaticHyperlinkDetector\n\t\t\t\t\t\t.getLandingPlace((EClass) obj, editor);\n\t\t\t\tif (landingPlace != null) {\n\t\t\t\t\teditor.setSelection(landingPlace, true);\n\t\t\t\t\teditor.setFocus();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected Class findClass(final String name)\n\t\tthrows ClassNotFoundException\n\t{\n\t\t/* Protect the namespace */\n\t\tif (name.startsWith(\"java.\") ||\n\t\t\tname.startsWith(\"org.postgresql.pljava\"))\n\t\t{\n\t\t\tthrow new ClassNotFoundException(name); \n\t\t}\n\n\t\t/* Look to see if we have already loaded the class */\n\t\tClass c = findLoadedClass(name);\n\t\tif (c != null)\n\t\t\treturn c;\n\n\t\t/* Check for the class within our jar */\n\t\tString path = name.replace('.', '/').concat(\".class\");\n\t\tbyte[] entryImg = (byte[]) m_entries.get(path);\n\t\t\n\t\t/* If not found, raise an exception */\n\t\tif (entryImg == null)\n\t\t\tthrow new ClassNotFoundException(name);\n\n\t\t/* create a package for the class */\n\t\tdefinePackage(name);\n\n\t\t/* otherwise convert the image to a class and return it */\n\t\treturn defineClass(name, entryImg, 0, entryImg.length);\n\t}", "private void searchDisplay()\r\n {\r\n System.out.println();\r\n System.out.println(\"------------ Search Menu ----------------\");\r\n System.out.println(\"(1) By Registration Number\");\r\n System.out.println(\"(2) By Car Make and Car Model\");\r\n System.out.println(\"(3) By Age\");\r\n System.out.println(\"(4) By Price (range)\");\r\n System.out.println(\"(5) Back to Main Menu\");\r\n }", "private <T extends Serializable>\r\n\t\t\tvoid captureTheWildcard(\r\n\t\t\t\t\tClass<? extends List</* ? extends */T>> listClass) {\r\n\r\n\t\t// Do something\r\n\t}", "private static PsiClass isReturnTypeExistedAsClass(PsiType _type, PsiClass _targetClass) {\r\n PsiFile file = _targetClass.getContainingFile();\r\n if (file == null) return null;\r\n\r\n List<PsiClass> classList = new ArrayList<>();\r\n for (PsiFile f : _targetClass.getContainingFile().getContainingDirectory().getFiles()) {\r\n if (f.equals(file)) continue;\r\n else {\r\n for (PsiClass c : ((PsiClassOwner) f).getClasses()) classList.add(c);\r\n }\r\n }\r\n\r\n for (PsiClass cls : classList) {\r\n if (_type.getPresentableText().equals(cls.getName()))\r\n return cls;\r\n }\r\n return null;\r\n }", "public String toString() {return classSimpleName+\"#\"+name;}", "public interface ClassesByNameProvider {\n\n List<ReferenceType> get(String s);\n\n static ClassesByNameProvider createCache(List<ReferenceType> allTypes) {\n return new Cache(allTypes);\n }\n\n /**\n * Caching implementation for name based class provider.\n */\n final class Cache implements ClassesByNameProvider {\n\n private final ConcurrentHashMap<String, ReferenceType> myCache;\n\n public Cache(List<ReferenceType> classes) {\n myCache = new ConcurrentHashMap<>();\n classes.forEach(t -> myCache.put(t.signature(), t));\n }\n\n @Override\n public List<ReferenceType> get(String s) {\n String signature = VirtualMachineProxyImpl.JNITypeParserReflect.typeNameToSignature(s);\n if (signature != null) {\n return (List<ReferenceType>) myCache.get(signature);\n }\n return Collections.emptyList();\n }\n }\n}", "IArenaClass getClass(final String name);", "public void displayClassesFold(View view){\n classList = (ListView) findViewById(R.id.foldList);\n\n\n // add all the items\n list = new ArrayList<>();\n for (int i = 0; i < bookingList.size(); i++) {\n // date time place type\n String toAdd = \"\";\n String start = String.valueOf(bookingList.get(i).getStartTime());\n String room = String.valueOf(bookingList.get(i).getBuilding()) + \" \" + String.valueOf(bookingList.get(i).getRoomNumber());\n String date = String.valueOf(bookingList.get(i).getDate());\n String type = String.valueOf(bookingList.get(i).getClassType());\n\n if(bookingList.get(i).getEndTime() != null)\n {\n toAdd += \"*\";\n }\n\n toAdd += date + \" | \" + start + \" | \" + type + \" | \" + room;\n\n list.add(toAdd);\n }\n\n if(list.size() > 0)\n {\n adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, list);\n\n classList.setAdapter(adapter);\n\n classList.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n @Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n ClassDetails.theBooking = bookingList.get(position);\n Intent i = new Intent(getBaseContext(), ClassDetails.class);\n //i.putExtra(\"classSelected\", ((TextView) view).getText());\n module_statistics.this.startActivity(i);\n }\n });\n\n\n // if there are no classes for that module, output a message\n }\n else\n {\n list.add(\"NO CLASSES FOR THIS MODULE\");\n\n adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, list);\n\n classList.setAdapter(adapter);\n\n classList.setOnItemClickListener(null); // shouldn't do anything when clicked\n }\n }", "public List<String> getClassList_(final WinRefEx hWnd) {\n\t\treturn (hWnd == null) ? null : getClassList_(TitleBuilder\n\t\t\t\t.byHandle(hWnd));\n\t}", "@Override\n\tpublic void searchByName() {\n\t\tcount = 0;\n\t\tif (UtilityClinic.patFile == null) {\n\t\t\ttry {\n\t\t\t\tutil.accessExistingPatJson();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tSystem.out.println(\"File not found\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tutil.readFromPatJson(UtilityClinic.patFile);\n\t\tSystem.out.println(\"Enter search.....\");\n\t\tString search = UtilityClinic.readString();\n\t\tSystem.out.println(\"Showing search result(s).......\");\n\t\tfor (int i = 0; i < UtilityClinic.patJson.size(); i++) {\n\t\t\tJSONObject jsnobj = (JSONObject) UtilityClinic.patJson.get(i);\n\t\t\tif (jsnobj.get(\"Patient's name\").toString().equals(search))\n\t\t\t\tSystem.out.print(\n\t\t\t\t\t\t++count + \" Name:\" + jsnobj.get(\"Patient's name\") + \" ID:\" + jsnobj.get(\"Patient's ID\")\n\t\t\t\t\t\t\t\t+ \" Mobile:\" + jsnobj.get(\"Mobile\") + \" Age:\" + jsnobj.get(\"Age\"));\n\t\t}\n\t\tif (count == 0) {\n\t\t\tSystem.out.println(\"No results found.....\");\n\t\t}\n\t}", "protected Content getNavLinkClassUse() {\n Content linkContent = getHyperLink(DocPaths.CLASS_USE.resolve(filename), useLabel);\n Content li = HtmlTree.LI(linkContent);\n return li;\n }", "@RequestMapping(value = \"/_search/hrClassInfos/{query}\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public List<HrClassInfo> searchHrClassInfos(@PathVariable String query) {\n log.debug(\"REST request to search HrClassInfos for query {}\", query);\n return StreamSupport\n .stream(hrClassInfoSearchRepository.search(queryStringQuery(query)).spliterator(), false)\n .collect(Collectors.toList());\n }", "protected Class<?> findClass(String paramString) throws ClassNotFoundException {\n/* 343 */ if (!paramString.startsWith(\"sun.reflect.misc.\")) {\n/* 344 */ throw new ClassNotFoundException(paramString);\n/* */ }\n/* 346 */ String str = paramString.replace('.', '/').concat(\".class\");\n/* 347 */ URL uRL = getResource(str);\n/* 348 */ if (uRL != null) {\n/* */ try {\n/* 350 */ return defineClass(paramString, uRL);\n/* 351 */ } catch (IOException iOException) {\n/* 352 */ throw new ClassNotFoundException(paramString, iOException);\n/* */ } \n/* */ }\n/* 355 */ throw new ClassNotFoundException(paramString);\n/* */ }", "public void loadClass(String name) throws InstantiationException, IllegalAccessException, ClassNotFoundException{\n\t\tSystem.out.println(\"Class object address \" + InspectClassLoader.class.hashCode());\n\t\tObject obj = getClass().getClassLoader().loadClass(\"InsideJVM.InspectClassLoader\").newInstance();\n\t\tSystem.out.println(\"Same class object: \" + (obj.getClass() == InspectClassLoader.class));\n\t\t\n\t\t// Class<?> object's class is ???\n\t\tClass<?> s = getClass().getClassLoader().loadClass(\"InsideJVM.InspectClassLoader\");\n\t\tSystem.out.println(s.getClass()); // output: java.land.Class\n\t\t\n\t\tSystem.out.println(\"class loader hashcode \" + getClass().getClassLoader().hashCode());\n\t}", "public static List<Critter> getInstances(String critter_class_name)\r\n throws InvalidCritterException {\r\n \t\r\n \t//get the class name of the critter\r\n \tString n = myPackage + \".\" + critter_class_name;\r\n \t\r\n \tList<Critter> critts = new ArrayList<Critter>();\r\n \tIterator<String> populationIter = population.keySet().iterator();\r\n\t\twhile (populationIter.hasNext()) { \r\n\t String position = populationIter.next();\r\n\t ArrayList<Critter> critterList = population.get(position);\r\n\t \r\n\t //get the instances of all critters that match the class name\r\n\t for(int j = 0; j < critterList.size(); j++) {\r\n\t \tCritter c = critterList.get(j);\r\n\t \tif(c.getClass().getName().equals(n)){\r\n\t \t\tcritts.add(c);\r\n\t \t}\r\n\t }\r\n\t\t}\r\n return critts;\r\n }", "public void searchClassMemberDeclarations(String name, SearchIdConsumer consumer);", "public abstract String getClassName();", "public String getClassName(String path);", "public String printToList() {\n\t\tif (hierarchy.equals(\"n\")) {\n\t\t\treturn \"<HTML>\" + visability + \" class \" + className\n\t\t\t\t\t+ \"{ <BR> <BR>\";\n\t\t} else if (isFinished == true) {\n\n\t\t\treturn \"}\";\n\t\t} else {\n\t\t\treturn \"<HTML>\" + visability + \" \" + hierarchy + \" class \"\n\t\t\t\t\t+ className + \"{ <BR> <BR>\";\n\t\t}\n\t}", "public void onScanClasses(Set<Class<?>> parentClasses, Class<?> clazz, Object instance);", "void registerInstantiating (ClassType c) {\r\n if (instantiating_classes == null) \r\n instantiating_classes = new ClassList ();\r\n else if (instantiating_classes.contains (c)) \r\n return;\r\n\r\n instantiating_classes.add (c);\r\n }", "public List<DsClasses> findByClassNameLike(String className) {\n throw new SwagBootCommonException(ExceptionConstants.errer1001.getCode(),ExceptionConstants.errer1001.getInfo());\n// return dsClassRepository.findByClassNameLike(className);\n }", "public static void printStructure(Class<?> someClass) {\n ClassVisitorUtils.Visitor visitor = new ClassVisitorUtils.Visitor();\n List<String> list = visitor.visit(someClass, true);\n for (String s : list) {\n System.out.println(s);\n }\n }" ]
[ "0.6010866", "0.5922186", "0.5857921", "0.58287317", "0.5791355", "0.5784733", "0.56219566", "0.5581239", "0.5526898", "0.5473631", "0.5411254", "0.5373969", "0.53597623", "0.532379", "0.5291808", "0.5245768", "0.52152526", "0.5202312", "0.51913244", "0.51734084", "0.51707244", "0.50779694", "0.50779694", "0.50779694", "0.50189584", "0.5012159", "0.5012159", "0.50045764", "0.50005746", "0.4992768", "0.4988443", "0.49824375", "0.49810565", "0.49753758", "0.49717617", "0.4966121", "0.49397475", "0.49277285", "0.49249575", "0.49156612", "0.49092793", "0.49090645", "0.4908396", "0.48987678", "0.48980796", "0.48977807", "0.48901832", "0.48868793", "0.48846012", "0.48824573", "0.4881911", "0.48806354", "0.487597", "0.48721588", "0.486946", "0.48656806", "0.48656806", "0.4855969", "0.4844986", "0.48363742", "0.48195583", "0.48129326", "0.48128033", "0.48119462", "0.480779", "0.48024294", "0.48002514", "0.47952253", "0.47903442", "0.47866917", "0.4783321", "0.47800952", "0.47784618", "0.4775837", "0.47741023", "0.47725374", "0.47712928", "0.47701347", "0.47682217", "0.4764", "0.4756347", "0.47524136", "0.47463092", "0.47452146", "0.4740466", "0.47373968", "0.47357276", "0.4721003", "0.4719115", "0.47127226", "0.4707989", "0.46980238", "0.46955156", "0.46923843", "0.46886802", "0.4687174", "0.46848696", "0.4682505", "0.46824232", "0.4680615" ]
0.56735605
6
Extracts the title of an api from its index.html file
public static String getApiName(String path) { Buffer buffer = jEdit.openTemporary(jEdit.getActiveView(), path, "index.html", false); if (buffer == null || buffer.isNewFile()) { return null; } int start = -1, end = -1; for (int i = 0; i<buffer.getLineCount(); i++) { String line = buffer.getLineText(i).toLowerCase(); int j = line.indexOf("<title>"); if (start == -1 && j != -1) { start = buffer.getLineStartOffset(i)+j+7; } j = line.indexOf("</title>"); if (start != -1 && end == -1 && j != -1) { end = buffer.getLineStartOffset(i)+j; } if (start != -1 && end != -1) { break; } } return buffer.getText(start, end-start).trim(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getTitle();", "String getTitle();", "String getTitle();", "String getTitle();", "String getTitle();", "String getTitle();", "String getTitle();", "String getTitle();", "String getTitle();", "String getTitle();", "String getTitle();", "String getTitle();", "String getTitle();", "String getTitle();", "String getTitle();", "java.lang.String getTitle();", "java.lang.String getTitle();", "java.lang.String getTitle();", "java.lang.String getTitle();", "java.lang.String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public String getTitle();", "public java.lang.String getTitle();", "String title();", "String title();", "public static String getTitle() {\r\n\t\tString titleStr = null;\r\n\t\ttry {\r\n\t\t\ttitleStr = driver.getTitle();\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(\"Unable to open the WebSite: \" + e);\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn titleStr;\r\n\t}", "String getNavigationBarTitle(String title, String url);", "public String getHomePageTitle() {\n\t\t//instantiate a web element and have the driver get it\n\t\t//WebElement homePageTitle = driver.findElement(By.xpath(\"//div[@id='bodyContent']//h1\"));\n\t\t//System.out.println(\"Home page title text \" + homePageTitle.getText());\n\t\tlogger.info(\"Home Page Title text is: \" + homePageTitle.getText());\n\t\treturn homePageTitle.getText();//homePageTitle is a PageFactory Element, see above. \n\t}", "public String getTitle() {\n return find(by.tagName(\"h1\")).getText();\n }", "@Override\r\n public String getServletInfo() {\r\n return TITLE;\r\n }", "public static String getPageTitle() {\n\t\tLOG.info(\"Reading current page title.\");\n\t\treturn Constants.driver.getTitle();\n\n\t}", "@NonNull\n String getTitle() throws Exception;", "public String getTitle() { return title; }", "@DISPID(-2147418043)\n @PropGet\n java.lang.String title();", "private String readTitle(XmlPullParser parser) throws IOException, XmlPullParserException {\n\t parser.require(XmlPullParser.START_TAG, ns, \"title\");\n\t String title = readText(parser);\n\t parser.require(XmlPullParser.END_TAG, ns, \"title\");\n\t return title;\n\t }", "public String getTitle(){\n\t\tlog.debug(\"Getting title of Cruises page\");\n\t\tString title = driver.getTitle();\n\t\tlog.info(\"Title of Cruises page is: \"+title);\n\t\treturn title;\n\t}", "public String findTitle(Text value) throws CharacterCodingException{\n\t\tint start = value.find(\"<title>\");\n\t\tint end = value.find(\"</title>\", start);\n\t\tstart+=7;\n\t\tString title = Text.decode(value.getBytes(), start, end-start);\n\t\t//if(title.contains(\":\") || title.contains(\"#\") || title.contains(\"/\") )\n\t\t\t//return null;\n\t\t//else\n\t\t\treturn title.replace(\" \", \"_\");\n\t}", "@Element \n public String getTitle() {\n return title;\n }", "protected String getTitle(String siteName) { \n return siteName;\n }", "public GHFrom getTitle() {\n return title;\n }", "@Test \n\tpublic void homePageTitleTest() {\n\t\tHomePage homePage = new HomePage(driver);\n\t\thomePage.OpenPage();\n\t\t\n\t\t//Fetch title \n\t\tString title = homePage.getTitle();\n\t\t\n\t\t//Assert title content \n\t\tAssert.assertTrue(title.equals(\"Lorem Ipsum - All the facts - Lipsum generator\"));\n\t}", "public String homePageTitle() {\n\t\tString title=driver.getTitle();\n\t\treturn title;\n\t}", "public final String getTitle() {\r\n return config.title;\r\n }", "String getApiName();", "String getPageName();", "public abstract String getTitle();", "public abstract String getTitle();", "public abstract String getTitle();", "public abstract String getTitle();", "public java.lang.String getTitle() {\n return title;\n }", "public String getCurrentPageTitle() {\n return webDriver.getTitle();\n }", "@Test(priority=1)\r\n\tpublic void getTitle() {\r\n\t\tString title=driver.getTitle();\r\n\t\tSystem.out.println(( title).toUpperCase());\r\n\t}", "String getTitle() {\r\n return title;\r\n }", "private String readTitle(XmlPullParser parser) throws IOException,\n XmlPullParserException {\n parser.require(XmlPullParser.START_TAG, null, \"title\");\n String title = readText(parser);\n parser.require(XmlPullParser.END_TAG, null, \"title\");\n return title;\n }", "public String getPageTitle() {\n return driver.get().getTitle();\n }", "public String getWatchListPageTitle() {\n waitForLoadingScreen();\n return findVisibleElement(otherPageTitle).getText();\n\n }", "public String getTitle() {\n \t\treturn getWebDriver().getTitle();\n \t}", "public String getTitle() {\n return bufTitle;\n }", "public String getTitle()\r\n {\r\n return getSemanticObject().getProperty(swb_title);\r\n }", "public java.lang.String getTitle() {\n return title;\n }", "public String getTitle() { return this.title; }", "public String getTitle()\r\n\t{\r\n\t\treturn TITLE;\r\n\t}", "public String getTitle() {\n\t\t\n\treturn driver.getTitle();\n\t\n\t}", "public String getWebTitle() {\n return mWebTitle;\n }", "public String getTitle() {\n return title;\n }", "public String getTitle() {\n return title;\n }", "public String getTitle() {\n return title;\n }", "public String getTitle() {\n return title;\n }", "public String getTitle() {\n return title;\n }", "public String getTitle(String pHtml) {\r\n String locTitle=\"\";\r\n int startTitle=pHtml.indexOf(\"<title>\");\r\n int stopTitle=pHtml.indexOf(\"</title>\");\r\n locTitle=pHtml.substring(startTitle, stopTitle);\r\n locTitle=locTitle.replace(\"&ndash; \", \"\");\r\n locTitle=locTitle.replace(\"<title>\", \"\");\r\n locTitle=locTitle.replace(\"RESULT\", \"\"); \r\n\r\n \r\n return locTitle;\r\n }", "public String getCurrentPageTitle() {\n return driver.getTitle();\n }", "@GetMapping(\"movie-info/{title}\")\n\t\tpublic String getInfo(@PathVariable(\"title\") String title) {\n\t\t\treturn repo.findByTitle(title);\n\t\t}", "public String getTitle()\n {\n return title;\n }", "public String getTitle()\r\n {\r\n return title;\r\n }", "public String getTitle()\r\n {\r\n return title;\r\n }", "private String getTitle() {\n return title;\n }", "public static String getStationTitle(Document dom) throws KvbException {\n String text = dom.select(\"body > div:nth-child(6) > div > h1 > span.red-text\").text();\n if(text.trim().isEmpty()) throw new KvbException(\"KVB station id invalid\");\n return text;\n }", "public java.lang.String getTitle() {\n return title;\n }", "public java.lang.String getTitle() {\n return title;\n }", "public java.lang.String getTitle() {\n return title;\n }", "@Override\r\n public String getTitle() {\n return title;\r\n }", "public String getPageTitle() {\n return driver.getTitle();\n }", "public java.lang.String getTitle() {\n java.lang.Object ref = title_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n title_ = s;\n }\n return s;\n }\n }", "@Override\r\n\tpublic String getTitle() {\n\t\treturn title;\r\n\t}" ]
[ "0.6394291", "0.6394291", "0.6394291", "0.6394291", "0.6394291", "0.6394291", "0.6394291", "0.6394291", "0.6394291", "0.6394291", "0.6394291", "0.6394291", "0.6394291", "0.6394291", "0.6394291", "0.63686657", "0.63686657", "0.63686657", "0.63686657", "0.63686657", "0.6116935", "0.6116935", "0.6116935", "0.6116935", "0.6116935", "0.6116935", "0.6116935", "0.6116935", "0.6116935", "0.6116935", "0.6116935", "0.6116935", "0.6116935", "0.6116935", "0.6116935", "0.6116935", "0.6116935", "0.6116935", "0.61157995", "0.6040903", "0.6040903", "0.6030875", "0.59723413", "0.5954514", "0.59175915", "0.5907168", "0.5865494", "0.58135056", "0.57836825", "0.5772171", "0.57709444", "0.57605195", "0.57576865", "0.57489353", "0.57479435", "0.5741773", "0.5740327", "0.5729844", "0.572506", "0.570525", "0.570162", "0.5700196", "0.5700196", "0.5700196", "0.5700196", "0.5685481", "0.56824595", "0.56792164", "0.5678651", "0.567865", "0.5675957", "0.5640613", "0.56338024", "0.563283", "0.56263036", "0.5624357", "0.5619392", "0.56188047", "0.5617567", "0.56104535", "0.5609424", "0.5609424", "0.5609424", "0.5609424", "0.5609424", "0.56008685", "0.55991817", "0.5597641", "0.55954325", "0.55916744", "0.55916744", "0.559006", "0.5586975", "0.55842793", "0.55842793", "0.55842793", "0.55806744", "0.557379", "0.55644757", "0.55634093" ]
0.78092515
0
Adds an api root to the list only if it is not already added
public static void addApi(String api) { String path = jEdit.getProperty("options.javadoc.path", ""); if (path.indexOf(api) != -1) { return; } if (path.length() > 0) { path += File.pathSeparator; } path += api; jEdit.setProperty("options.javadoc.path", path); jEdit.propertiesChanged(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void add(MockAPI mockAPI);", "public API addAPI(API api) throws APIManagementException {\n validateApiInfo(api);\n String tenantDomain = MultitenantUtils\n .getTenantDomain(APIUtil.replaceEmailDomainBack(api.getId().getProviderName()));\n validateResourceThrottlingTiers(api, tenantDomain);\n validateKeyManagers(api);\n String apiName = api.getId().getApiName();\n String provider = APIUtil.replaceEmailDomain(api.getId().getProviderName());\n\n if (api.isEndpointSecured() && StringUtils.isEmpty(api.getEndpointUTPassword())) {\n String errorMessage = \"Empty password is given for endpointSecurity when creating API \" + apiName;\n throw new APIManagementException(errorMessage);\n }\n //Validate Transports\n validateAndSetTransports(api);\n validateAndSetAPISecurity(api);\n\n //Set version timestamp to the API\n String latestTimestamp = calculateVersionTimestamp(provider, apiName,\n api.getId().getVersion(), api.getOrganization());\n api.setVersionTimestamp(latestTimestamp);\n\n // For Choreo-Connect gateway, gateway vendor type in the DB will be \"wso2/choreo-connect\".\n // This value is determined considering the gateway type comes with the request.\n api.setGatewayVendor(APIUtil.setGatewayVendorBeforeInsertion(\n api.getGatewayVendor(), api.getGatewayType()));\n try {\n PublisherAPI addedAPI = apiPersistenceInstance.addAPI(new Organization(api.getOrganization()),\n APIMapper.INSTANCE.toPublisherApi(api));\n api.setUuid(addedAPI.getId());\n api.setCreatedTime(addedAPI.getCreatedTime());\n } catch (APIPersistenceException e) {\n throw new APIManagementException(\"Error while persisting API \", e);\n }\n\n if (log.isDebugEnabled()) {\n log.debug(\"API details successfully added to the registry. API Name: \" + api.getId().getApiName()\n + \", API Version : \" + api.getId().getVersion() + \", API context : \" + api.getContext());\n }\n int tenantId = APIUtil.getInternalOrganizationId(api.getOrganization());\n addAPI(api, tenantId);\n\n JSONObject apiLogObject = new JSONObject();\n apiLogObject.put(APIConstants.AuditLogConstants.NAME, api.getId().getApiName());\n apiLogObject.put(APIConstants.AuditLogConstants.CONTEXT, api.getContext());\n apiLogObject.put(APIConstants.AuditLogConstants.VERSION, api.getId().getVersion());\n apiLogObject.put(APIConstants.AuditLogConstants.PROVIDER, api.getId().getProviderName());\n\n APIUtil.logAuditMessage(APIConstants.AuditLogConstants.API, apiLogObject.toString(),\n APIConstants.AuditLogConstants.CREATED, this.username);\n\n if (log.isDebugEnabled()) {\n log.debug(\"API details successfully added to the API Manager Database. API Name: \" + api.getId()\n .getApiName() + \", API Version : \" + api.getId().getVersion() + \", API context : \" + api\n .getContext());\n }\n\n if (APIUtil.isAPIManagementEnabled()) {\n Cache contextCache = APIUtil.getAPIContextCache();\n Boolean apiContext = null;\n\n Object cachedObject = contextCache.get(api.getContext());\n if (cachedObject != null) {\n apiContext = Boolean.valueOf(cachedObject.toString());\n }\n if (apiContext == null) {\n contextCache.put(api.getContext(), Boolean.TRUE);\n }\n }\n\n if (\"null\".equals(api.getAccessControlRoles())) {\n api.setAccessControlRoles(null);\n }\n //notify key manager with API addition\n registerOrUpdateResourceInKeyManager(api, tenantDomain);\n return api;\n\n }", "@Override\n public boolean updateAPIsInExternalAPIStores(API api, Set<APIStore> apiStoreSet, boolean apiOlderVersionExist)\n throws APIManagementException {\n Set<APIStore> publishedStores = getPublishedExternalAPIStores(api.getUuid());\n Set<APIStore> notPublishedAPIStores = new HashSet<APIStore>();\n Set<APIStore> updateApiStores = new HashSet<APIStore>();\n Set<APIStore> removedApiStores = new HashSet<APIStore>();\n StringBuilder errorStatus = new StringBuilder(\"Failed to update External Stores : \");\n boolean failure = false;\n if (publishedStores != null) {\n removedApiStores.addAll(publishedStores);\n removedApiStores.removeAll(apiStoreSet);\n }\n for (APIStore apiStore : apiStoreSet) {\n boolean publishedToStore = false;\n if (publishedStores != null) {\n for (APIStore store : publishedStores) { //If selected external store in edit page is already saved in db\n if (store.equals(apiStore)) { //Check if there's a modification happened in config file external store definition\n try {\n if (!isAPIAvailableInExternalAPIStore(api, apiStore)) {\n // API is not available\n continue;\n }\n } catch (APIManagementException e) {\n failure = true;\n log.error(e);\n errorStatus.append(store.getDisplayName()).append(',');\n }\n publishedToStore = true; //Already the API has published to external APIStore\n\n //In this case,the API is already added to external APIStore,thus we don't need to publish it again.\n //We need to update the API in external Store.\n //Include to update API in external APIStore\n updateApiStores.add(APIUtil.getExternalAPIStore(store.getName(), tenantId));\n }\n }\n }\n if (!publishedToStore) { //If the API has not yet published to selected external APIStore\n notPublishedAPIStores.add(APIUtil.getExternalAPIStore(apiStore.getName(), tenantId));\n }\n }\n //Publish API to external APIStore which are not yet published\n try {\n publishToExternalAPIStores(api, notPublishedAPIStores, apiOlderVersionExist);\n } catch (APIManagementException e) {\n handleException(\"Failed to publish API to external Store. \", e);\n }\n //Update the APIs which are already exist in the external APIStore\n updateAPIInExternalAPIStores(api, updateApiStores);\n //Update database saved published APIStore details\n updateExternalAPIStoresDetails(api.getUuid(), updateApiStores);\n\n deleteFromExternalAPIStores(api, removedApiStores);\n if (failure) {\n throw new APIManagementException(errorStatus.substring(0, errorStatus.length() - 2));\n }\n return true;\n }", "private void addAPI(API api, int tenantId) throws APIManagementException {\n int apiId = apiMgtDAO.addAPI(api, tenantId, api.getOrganization());\n addLocalScopes(api.getId().getApiName(), api.getUriTemplates(), api.getOrganization());\n String tenantDomain = MultitenantUtils\n .getTenantDomain(APIUtil.replaceEmailDomainBack(api.getId().getProviderName()));\n addURITemplates(apiId, api, tenantId);\n addAPIPolicies(api, tenantDomain);\n APIEvent apiEvent = new APIEvent(UUID.randomUUID().toString(), System.currentTimeMillis(),\n APIConstants.EventType.API_CREATE.name(), tenantId, api.getOrganization(), api.getId().getApiName(),\n apiId, api.getUuid(), api.getId().getVersion(), api.getType(), api.getContext(),\n APIUtil.replaceEmailDomainBack(api.getId().getProviderName()), api.getStatus());\n APIUtil.sendNotification(apiEvent, APIConstants.NotifierType.API.name());\n }", "@Override\n public synchronized Response getRootDoc(final UriInfo uriInfo) {\n final ResourceList rootDoc;\n if (isNew(uriInfo)) {\n rootDoc = apiDocGeneratorRFC8040.getResourceListing(uriInfo);\n } else {\n rootDoc = apiDocGeneratorDraft02.getResourceListing(uriInfo);\n }\n\n return Response.ok(rootDoc).build();\n }", "amdocs.iam.pd.webservices.productrelations.checkproducteligibilityoutput.CheckProductEligibilityOutput addNewROOT();", "@Override\n public boolean publishToExternalAPIStores(API api, List<String> externalStoreIds) throws APIManagementException {\n\n Set<APIStore> inputStores = new HashSet<>();\n boolean apiOlderVersionExist = false;\n APIIdentifier apiIdentifier = api.getId();\n for (String store : externalStoreIds) {\n if (StringUtils.isNotEmpty(store)) {\n APIStore inputStore = APIUtil.getExternalAPIStore(store,\n APIUtil.getTenantIdFromTenantDomain(tenantDomain));\n if (inputStore == null) {\n String errorMessage = \"Error while publishing to external stores. Invalid External Store Id: \"\n + store;\n log.error(errorMessage);\n ExceptionCodes exceptionCode = ExceptionCodes.EXTERNAL_STORE_ID_NOT_FOUND;\n throw new APIManagementException(errorMessage,\n new ErrorItem(exceptionCode.getErrorMessage(), errorMessage, exceptionCode.getErrorCode(),\n exceptionCode.getHttpStatusCode()));\n }\n inputStores.add(inputStore);\n }\n }\n Set<String> versions = getAPIVersions(apiIdentifier.getProviderName(),\n apiIdentifier.getName(), api.getOrganization());\n APIVersionStringComparator comparator = new APIVersionStringComparator();\n for (String tempVersion : versions) {\n if (comparator.compare(tempVersion, apiIdentifier.getVersion()) < 0) {\n apiOlderVersionExist = true;\n break;\n }\n }\n return updateAPIsInExternalAPIStores(api, inputStores, apiOlderVersionExist);\n }", "API createAPI();", "@Test\n public void shouldListExpectedApi() {\n OrgApisListPage theApiPage = open(OrgApisListPage.class, organization.getName());\n theApiPage.entriesContainer().shouldHave(text(api.getName()));\n }", "void addId(String root);", "public void appendToRoot( Item item ) {\r\n\t\tadd(item);\r\n//\t\tthis.lastAddedItem = item;\r\n\t}", "boolean hasApiUrl();", "@Override\n public void publishToExternalAPIStores(API api, Set<APIStore> apiStoreSet, boolean apiOlderVersionExist)\n throws APIManagementException {\n\n Set<APIStore> publishedStores = new HashSet<APIStore>();\n StringBuilder errorStatus = new StringBuilder(\"Failure to publish to External Stores : \");\n boolean failure = false;\n\n for (APIStore store : apiStoreSet) {\n APIPublisher publisher = store.getPublisher();\n\n try {\n // First trying to publish the API to external APIStore\n boolean published;\n String version = ApiMgtDAO.getInstance().getLastPublishedAPIVersionFromAPIStore(api.getId(),\n store.getName());\n\n if (apiOlderVersionExist && version != null && !(publisher instanceof WSO2APIPublisher)) {\n published = publisher.createVersionedAPIToStore(api, store, version);\n publisher.updateToStore(api, store);\n } else {\n published = publisher.publishToStore(api, store);\n }\n\n if (published) { // If published,then save to database.\n publishedStores.add(store);\n }\n } catch (APIManagementException e) {\n failure = true;\n log.error(e);\n errorStatus.append(store.getDisplayName()).append(',');\n }\n }\n if (!publishedStores.isEmpty()) {\n addExternalAPIStoresDetails(api.getUuid(), publishedStores);\n }\n\n if (failure) {\n throw new APIManagementException(errorStatus.substring(0, errorStatus.length() - 2));\n }\n\n }", "private Node<E> add(E item, Node<E> root){\n\t\t/** found a place to store the item */\n\t\tif(root == null){\n\t\t\taddReturn = true;\n\t\t\troot = new Node<E>(item);\n\t\t\treturn root;\n\t\t}\n\t\t\n\t\tint comparison = item.compareTo(root.item);\n\t\t\n\t\t/** item to add already exists in the tree */\n\t\tif(comparison == 0){\n\t\t\taddReturn = false;\n\t\t\treturn root;\n\t\t}\n\t\t/** item is less -> add to the left of the root */\n\t\telse if(comparison < 0){\n\t\t\troot.left = add(item, root.left);\n\t\t\treturn root;\n\t\t}\n\t\t/** item is greater -> add to the right of the root */\n\t\telse{\n\t\t\troot.right = add(item, root.right);\n\t\t\treturn root;\n\t\t}\n\t}", "public void add (K key) {\n\t\tthis.root = this.addRecursively(root,key);\n\t}", "amdocs.iam.pd.webservices.quotation.getquoteinput.GetQuoteInput addNewROOT();", "public abstract Set<RootServiceResponse> getRootServices(RootServiceRequest request) throws AmbariException;", "private void updateAPIInExternalAPIStores(API api, Set<APIStore> apiStoreSet)\n throws APIManagementException {\n if (apiStoreSet != null && !apiStoreSet.isEmpty()) {\n StringBuilder errorStatus = new StringBuilder(\"Failed to update External Stores : \");\n boolean failure = false;\n for (APIStore store : apiStoreSet) {\n try {\n APIPublisher publisher = store.getPublisher();\n publisher.updateToStore(api, store);\n } catch (APIManagementException e) {\n failure = true;\n log.error(e);\n errorStatus.append(store.getDisplayName()).append(',');\n }\n }\n\n if (failure) {\n throw new APIManagementException(errorStatus.substring(0, errorStatus.length() - 2));\n }\n }\n\n\n }", "private void addFolder(){\n }", "public synchronized void addAp(JSONObject ap)\n\t{\n\t\tString apUrl;\n\t\ttry\n\t\t{\n\t\t\tapUrl = ap.getString(\"uri\");\n\t\t\tthis.mApList.put(apUrl, ap);\n\t\t\tLog.i(LTAG, \"Added AP: \" + apUrl);\n\t\t} catch (JSONException e)\n\t\t{\n\t\t\tLog.e(LTAG, \"Error while adding AP to model.\");\n\t\t}\n\t}", "public interface ApiInterface {\n\n //Account API\n String ping(OkHttpClient client);\n\n String obtainAuthToken(OkHttpClient client, String username, String password);\n\n JSONObject checkAccountInfo(OkHttpClient client, String token);\n\n JSONObject getServerInformation(OkHttpClient client);\n\n //Starred File API\n List<StarredFile> listStarredFiles(OkHttpClient client, String token);\n\n //Library API\n List<Library> listLibraries(OkHttpClient client, String token);\n\n Library getLibraryInfo(OkHttpClient client, String token, String repo_id);\n\n List<LibraryHistory> getLibraryHistory(OkHttpClient client, String token, String repo_id);\n\n JSONObject createNewLibrary(OkHttpClient client, String token, String libName, String desc, String password);\n\n boolean deleteLibrary(OkHttpClient client, String token, String repo_id);\n\n //File API\n String getFileDownloadLink(OkHttpClient client, String token, String repo_id, String p, boolean reuse);\n\n FileDetail getFileDetail(OkHttpClient client, String token, String repo_id, String p);\n\n List<FileCommit> getFileHistory(OkHttpClient client, String token, String repo_id, String p);\n\n boolean createFile(OkHttpClient client, String token, String repo_id, String p);\n\n boolean renameFile(OkHttpClient client, String token, String repo_id, String p, String newName);\n\n boolean moveFile(OkHttpClient client, String token, String repo_id, String p, String dst_repo, String dst_dir);\n\n boolean revertFile(OkHttpClient client, String token, String repo_id, String p, String commit_id);\n\n boolean deleteFile(OkHttpClient client, String token, String repo_id, String p);\n\n String getUploadLink(OkHttpClient client, String token, String repo_id, String p);\n\n List<UploadFileRes> uploadFile(OkHttpClient client, String token, String uploadLink, String parent_dir, String relative_path, File... files);\n\n String getUpdateLink(OkHttpClient client, String token, String repo_id, String p);\n\n boolean updateFile(OkHttpClient client, String token, String updataLink, File file, String target_file);\n\n //Directory API\n List<DirectoryEntry> listDirEntriesByP(OkHttpClient client, String token, String repo_id, String p);\n\n// List<DirectoryEntry> listDirectoryEntriesByID(OkHttpClient client,String token,String repo_id,String id);\n\n List<DirectoryEntry> listAllDirEntries(OkHttpClient client, String token, String repo_id);\n\n boolean createNewDir(OkHttpClient client, String token, String repo_id, String p);\n\n boolean renameDir(OkHttpClient client, String token, String repo_id, String p, String newName);\n\n boolean deleteDir(OkHttpClient client, String token, String repo_id, String p);\n\n String getDirDownloadToken(OkHttpClient client, String token, String repo_id, String parent_dir, String dirents);\n\n boolean queryZipProgress(OkHttpClient client, String token, String dirDownloadToken);\n\n String getDirDownloadLink(OkHttpClient client, String token, String dirDownloadToken);\n}", "private static List<OperationPolicy> extractAndDropAPILevelPoliciesFromAPI(API api) {\n List<OperationPolicy> policies = new ArrayList<>();\n if (api.getApiPolicies() != null && !api.getApiPolicies().isEmpty()) {\n policies = api.getApiPolicies();\n api.setApiPolicies(null);\n }\n return policies;\n }", "public void addKeyValue(String apiName, Object value)\n\t{\n\t\t this.keyValues.put(apiName, value);\n\n\t\t this.keyModified.put(apiName, 1);\n\n\t}", "public void initApiService() {\n apiService = ApiUtils.getAPIService();\n }", "private void populateAPILevelPolicies(API api) throws APIManagementException {\n List<OperationPolicy> apiPolicyMapping = apiMgtDAO.getAPIPolicyMapping(api.getUuid(), null);\n if (!apiPolicyMapping.isEmpty()) {\n api.setApiPolicies(apiPolicyMapping);\n }\n }", "protected void setUpRoot(VitroRequest vreq, Map<String, Object> root) {\n \n root.put(\"tabMenu\", getTabMenu(vreq));\n \n Portal portal = vreq.getPortal();\n \n ApplicationBean appBean = vreq.getAppBean();\n PortalWebUtil.populateSearchOptions(portal, appBean, vreq.getWebappDaoFactory().getPortalDao());\n PortalWebUtil.populateNavigationChoices(portal, vreq, appBean, vreq.getWebappDaoFactory().getPortalDao()); \n \n addLoginInfo(vreq, root); \n \n root.put(\"copyright\", getCopyrightInfo(portal));\n \n root.put(\"siteTagline\", portal.getShortHand());\n root.put(\"breadcrumbs\", BreadCrumbsUtil.getBreadCrumbsDiv(vreq));\n \n String themeDir = getThemeDir(portal);\n \n // This value is used only in stylesheets.ftl and already contains the context path.\n root.put(\"stylesheetPath\", UrlBuilder.getUrl(themeDir + \"/css\")); \n \n String bannerImage = portal.getBannerImage(); \n if ( ! StringUtils.isEmpty(bannerImage)) {\n root.put(\"bannerImage\", UrlBuilder.getUrl(themeDir + \"site_icons/\" + bannerImage));\n }\n \n }", "@Override\n public boolean add(T parent, T child) {\n boolean result = false;\n if (this.root == null) {\n this.root = new Node<>(parent);\n this.root.add(new Node<>(child));\n result = true;\n this.modCount++;\n } else if (findBy(parent).isPresent()) {\n findBy(parent).get().add(new Node<>(child));\n result = true;\n this.modCount++;\n }\n return result;\n }", "public static void updateAPISwaggerDocs(String apiDocJson, String[] docResourcePaths,\n Registry registry) throws ParseException, RegistryException {\n\n JSONParser parser = new JSONParser();\n JSONObject apiDoc11 = (JSONObject) parser.parse(apiDocJson);\n\n Map<String, JSONArray> allParameters = ResourceUtil.getAllParametersForResources(apiDoc11);\n Map<String, JSONObject> allOperations = ResourceUtil.getAllOperationsForResources(apiDoc11);\n Map<String, JSONObject> apisByPath = ResourceUtil.getAllAPIsByResourcePath(apiDoc11);\n\n //this collection holds description given for each resource against the resource name.\n //descriptions added resources in an api in AM 1.7 are stored in api-doc 1.1. this desciption\n //is showed in am 1.7 api console in the store applicatoin. AM 1.8 uses descriptions in\n // api-doc in 1.2 resource folder. following map collects this value from api-doc 1.1 and\n // store it to add to api-doc 1.2\n Map<String, String> descriptionsForResource = new HashMap<String, String>();\n\n String basePath = (String) apiDoc11.get(Constants.API_DOC_11_BASE_PATH);\n String resourcePath = (String) apiDoc11.get(Constants.API_DOC_11_RESOURCE_PATH);\n String apiVersion = (String) apiDoc11.get(Constants.API_DOC_11_API_VERSION);\n\n resourcePath = resourcePath.endsWith(\"/\") ? resourcePath : resourcePath + \"/\";\n String basePathForResource = basePath + resourcePath + apiVersion;\n\n String apidoc12path = \"\";\n\n //update each resource in the 1.2 folder except the api-doc resource\n for (String docResourcePath : docResourcePaths) {\n String resourceName = docResourcePath.substring(docResourcePath.lastIndexOf(\"/\"));\n\n if (resourceName.equals(APIConstants.API_DOC_1_2_RESOURCE_NAME)) {\n //store api-doc in 1.2 folder for future use\n apidoc12path = docResourcePath;\n continue;\n }\n\n Resource resource = registry.get(docResourcePath);\n JSONObject apiDoc =\n (JSONObject) parser.parse(new String((byte[]) resource.getContent()));\n\n\n String description = \"\";\n //generate the key to query the descriptionsForResource map\n JSONArray apisInResource = (JSONArray) apiDoc.get(Constants.API_DOC_12_APIS);\n JSONObject apiTemp = (JSONObject) apisInResource.get(0);\n String path = (String) apiTemp.get(Constants.API_DOC_12_PATH);\n\n String key = \"\";\n if (path.equals(\"/*\")) {\n key = basePathForResource;\n } else {\n key = basePathForResource + path;\n }\n\n\n //get the description for that resource. query the api list generated using api-doc 1.1\n if (apisByPath.containsKey(key)) {\n JSONObject apiInfo = apisByPath.get(key);\n description = (String) apiInfo.get(\"description\");\n descriptionsForResource.put(resourceName, description);\n }\n\n String updatedJson =\n ResourceUtil.getUpdatedSwagger12Resource(apiDoc, allParameters, allOperations,\n basePathForResource);\n log.info(\"\\t update \" + resourceName.substring(1));\n Resource res = registry.get(docResourcePath);\n res.setContent(updatedJson);\n //update the registry\n registry.put(docResourcePath, res);\n }\n\n //update the api-doc. add the descriptions to each api resource\n ResourceUtil.updateSwagger12APIdoc(apidoc12path, descriptionsForResource, registry, parser);\n }", "protected boolean dispatchToAPI(Collection<API> apiSet, MessageContext synCtx) {\n List<API> defaultStrategyApiSet = new ArrayList<API>(apiSet);\n API defaultAPI = null;\n\n Object apiObject = synCtx.getProperty(RESTConstants.PROCESSED_API);\n if (apiObject != null) {\n if (identifyAPI((API) apiObject, synCtx, defaultStrategyApiSet)) {\n return true;\n }\n } else {\n //To avoid apiSet being modified concurrently\n List<API> duplicateApiSet = new ArrayList<API>(apiSet);\n for (API api : duplicateApiSet) {\n if (identifyAPI(api, synCtx, defaultStrategyApiSet)) {\n return true;\n }\n }\n }\n\n for (API api : defaultStrategyApiSet) {\n api.setLogSetterValue();\n if (api.canProcess(synCtx)) {\n if (log.isDebugEnabled()) {\n log.debug(\"Located specific API: \" + api.getName() + \" for processing message\");\n }\n apiProcess(synCtx, api);\n return true;\n }\n }\n\n if (defaultAPI != null && defaultAPI.canProcess(synCtx)) {\n defaultAPI.setLogSetterValue();\n apiProcess(synCtx, defaultAPI);\n return true;\n }\n\n return false;\n }", "@Override\n public Set<APIStore> getExternalAPIStores(String apiId)\n throws APIManagementException {\n if (APIUtil.isAPIsPublishToExternalAPIStores(tenantId)) {\n SortedSet<APIStore> sortedApiStores = new TreeSet<APIStore>(new APIStoreNameComparator());\n Set<APIStore> publishedStores = apiMgtDAO.getExternalAPIStoresDetails(apiId);\n sortedApiStores.addAll(publishedStores);\n return APIUtil.getExternalAPIStores(sortedApiStores, tenantId);\n } else {\n return null;\n }\n }", "private void registerOrUpdateResourceInKeyManager(API api, String tenantDomain) throws APIManagementException {\n //get new key manager instance for resource registration.\n Map<String, KeyManagerDto> tenantKeyManagers = KeyManagerHolder.getTenantKeyManagers(tenantDomain);\n for (Map.Entry<String, KeyManagerDto> keyManagerDtoEntry : tenantKeyManagers.entrySet()) {\n KeyManager keyManager = keyManagerDtoEntry.getValue().getKeyManager();\n if (keyManager != null) {\n try {\n Map registeredResource = keyManager.getResourceByApiId(api.getId().toString());\n if (registeredResource == null) {\n boolean isNewResourceRegistered = keyManager.registerNewResource(api, null);\n if (!isNewResourceRegistered) {\n log.warn(\"APIResource registration is failed while adding the API- \" +\n api.getId().getApiName()\n + \"-\" + api.getId().getVersion() + \" into Key Manager : \" +\n keyManagerDtoEntry.getKey());\n }\n } else {\n //update APIResource.\n String resourceId = (String) registeredResource.get(\"resourceId\");\n if (resourceId == null) {\n handleException(\"APIResource update is failed because of empty resourceID.\");\n }\n keyManager.updateRegisteredResource(api, registeredResource);\n }\n } catch (APIManagementException e) {\n log.error(\"API Resource Registration failed in Key Manager \" + keyManagerDtoEntry.getKey(), e);\n }\n }\n }\n }", "private void updateAPIResources(API api, int tenantId) throws APIManagementException {\n\n String tenantDomain = APIUtil.getTenantDomainFromTenantId(tenantId);\n APIIdentifier apiIdentifier = api.getId();\n // Get the new URI templates for the API\n Set<URITemplate> uriTemplates = api.getUriTemplates();\n // Get the existing local scope keys attached for the API\n Set<String> oldLocalScopeKeys = apiMgtDAO.getAllLocalScopeKeysForAPI(api.getUuid(), tenantId);\n // Get the existing URI templates for the API\n Set<URITemplate> oldURITemplates = apiMgtDAO.getURITemplatesOfAPI(api.getUuid());\n // Get the new local scope keys from URI templates\n Set<Scope> newLocalScopes = getScopesToRegisterFromURITemplates(api.getId().getApiName(), api.getOrganization(), uriTemplates);\n Set<String> newLocalScopeKeys = newLocalScopes.stream().map(Scope::getKey).collect(Collectors.toSet());\n // Get the existing versioned local scope keys attached for the API\n Set<String> oldVersionedLocalScopeKeys = apiMgtDAO.getVersionedLocalScopeKeysForAPI(api.getUuid(), tenantId);\n // Get the existing versioned local scope keys which needs to be removed (not updated) from the current updating\n // API and remove them from the oldLocalScopeKeys set before sending to KM, so that they will not be removed\n // from KM and can be still used by other versioned APIs.\n Iterator oldLocalScopesItr = oldLocalScopeKeys.iterator();\n while (oldLocalScopesItr.hasNext()) {\n String oldLocalScopeKey = (String) oldLocalScopesItr.next();\n // if the scope is used in versioned APIs and it is not in new local scope key set\n if (oldVersionedLocalScopeKeys.contains(oldLocalScopeKey)\n && !newLocalScopeKeys.contains(oldLocalScopeKey)) {\n //remove from old local scope key set which will be send to KM\n oldLocalScopesItr.remove();\n }\n }\n validateAndUpdateURITemplates(api, tenantId);\n apiMgtDAO.updateURITemplates(api, tenantId);\n if (log.isDebugEnabled()) {\n log.debug(\"Successfully updated the URI templates of API: \" + apiIdentifier + \" in the database\");\n }\n // Update the resource scopes of the API in KM.\n // Need to remove the old local scopes and register new local scopes and, update the resource scope mappings\n // using the updated URI templates of the API.\n deleteScopes(oldLocalScopeKeys, tenantId);\n addScopes(newLocalScopes, tenantId);\n Map<String, KeyManagerDto> tenantKeyManagers = KeyManagerHolder.getTenantKeyManagers(tenantDomain);\n for (Map.Entry<String, KeyManagerDto> keyManagerDtoEntry : tenantKeyManagers.entrySet()) {\n KeyManager keyManager = keyManagerDtoEntry.getValue().getKeyManager();\n if (keyManager != null) {\n try {\n keyManager.updateResourceScopes(api, oldLocalScopeKeys, newLocalScopes, oldURITemplates,\n uriTemplates);\n if (log.isDebugEnabled()) {\n log.debug(\"Successfully updated the resource scopes of API: \" + apiIdentifier +\n \" in Key Manager \"+ keyManagerDtoEntry.getKey()+\" .\");\n }\n } catch (APIManagementException e) {\n log.error(\"Error while updating resource to scope attachment in Key Manager \" +\n keyManagerDtoEntry.getKey(), e);\n }\n }\n }\n }", "private void addURITemplates(int apiId, API api, int tenantId) throws APIManagementException {\n\n String tenantDomain = APIUtil.getTenantDomainFromTenantId(tenantId);\n validateAndUpdateURITemplates(api, tenantId);\n apiMgtDAO.addURITemplates(apiId, api, tenantId);\n Map<String, KeyManagerDto> tenantKeyManagers = KeyManagerHolder.getTenantKeyManagers(tenantDomain);\n for (Map.Entry<String, KeyManagerDto> keyManagerDtoEntry : tenantKeyManagers.entrySet()) {\n KeyManager keyManager = keyManagerDtoEntry.getValue().getKeyManager();\n if (keyManager != null) {\n try {\n keyManager.attachResourceScopes(api, api.getUriTemplates());\n } catch (APIManagementException e) {\n log.error(\"Error while Attaching Resource to scope in Key Manager \" + keyManagerDtoEntry.getKey(),\n e);\n }\n }\n }\n }", "private void addAPIPolicies(API api, String tenantDomain) throws APIManagementException {\n // Validate API level and operation level policies\n validateAPIPolicyParameters(api, tenantDomain);\n // Add API level and operation level policies\n apiMgtDAO.addAPIPoliciesMapping(api.getUuid(), api.getUriTemplates(), api.getApiPolicies(), tenantDomain);\n }", "private void addPackageDirFiles(WebFile aDir, List aList)\n{\n boolean hasNonPkgFile = false;\n for(WebFile child : aDir.getFiles())\n if(child.isDir() && child.getType().length()==0)\n addPackageDirFiles(child, aList);\n else hasNonPkgFile = true;\n if(hasNonPkgFile || aDir.getFileCount()==0) aList.add(aDir);\n}", "public boolean add(E item){\n\t\troot = add(item, root);\n\t\treturn addReturn;\n\t}", "private void addToRoot(String line) {\r\n String[] components = line.split(\"\\\",\\\"\"); //get all components of line, that are [word, type, meaning]\r\n removeSpaces(components); //remove space and extra symbol from all components\r\n\r\n if (components.length == 3) { //if the components are valid\r\n\r\n boolean[] status = dict.addWord(components[0], components[1], components[2], 'a'); //try adding in add mode\r\n\r\n if (status[1]) { // if word already exists but have other meaning so need to append the meaning\r\n dict.addWord(components[0], components[1], components[2], 'u'); //add in update mdoe\r\n }\r\n }\r\n\r\n //System.out.println(\"Added word : \" + components[0]);\r\n }", "public Builder addApiGroups(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureApiGroupsIsMutable();\n apiGroups_.add(value);\n onChanged();\n return this;\n }", "private void addGetWithRoot() {\n\t\tGMethod getWithRoot = this.rootBindingClass.getMethod(\"getWithRoot\").argument(this.name.get(), \"root\")\n\t\t\t\t.returnType(this.name.get());\n\t\tgetWithRoot.body.line(\"return root;\");\n\t}", "private void addLocalScopes(String apiName, Set<URITemplate> uriTemplates, String organization)\n throws APIManagementException {\n\n int tenantId = APIUtil.getInternalOrganizationId(organization);\n String tenantDomain = APIUtil.getTenantDomainFromTenantId(tenantId);\n Map<String, KeyManagerDto> tenantKeyManagers = KeyManagerHolder.getTenantKeyManagers(tenantDomain);\n //Get the local scopes set to register for the API from URI templates\n Set<Scope> scopesToRegister = getScopesToRegisterFromURITemplates(apiName, organization, uriTemplates);\n //Register scopes\n for (Scope scope : scopesToRegister) {\n for (Map.Entry<String, KeyManagerDto> keyManagerDtoEntry : tenantKeyManagers.entrySet()) {\n KeyManager keyManager = keyManagerDtoEntry.getValue().getKeyManager();\n if (keyManager != null) {\n String scopeKey = scope.getKey();\n try {\n // Check if key already registered in KM. Scope Key may be already registered for a different\n // version.\n if (!keyManager.isScopeExists(scopeKey)) {\n //register scope in KM\n keyManager.registerScope(scope);\n } else {\n if (log.isDebugEnabled()) {\n log.debug(\"Scope: \" + scopeKey +\n \" already registered in KM. Skipping registering scope.\");\n }\n }\n } catch (APIManagementException e) {\n log.error(\"Error while registering Scope \" + scopeKey + \"in Key Manager \" +\n keyManagerDtoEntry.getKey(), e);\n }\n\n }\n }\n }\n addScopes(scopesToRegister, tenantId);\n }", "private Node<E> add(Node<E> localRoot, E item) {\n if (localRoot == null) {\n addReturn = true;\n return new Node<E>(item);\n } else if (item.compareTo(localRoot.data) == 0) {\n addReturn = false;\n return localRoot;\n } else if (item.compareTo(localRoot.data) < 0) {\n localRoot.left = add(localRoot.left, item);\n return localRoot;\n } else {\n localRoot.right = add(localRoot.right, item);\n return localRoot;\n }\n }", "@GetMapping(\"/api\")\r\n public RepresentationModel<?> root() {\r\n RepresentationModel<?> rootResource = new RepresentationModel<>();\r\n rootResource.add(\r\n linkTo(methodOn(BandController.class).getAllBands()).withRel(\"bands\"),\r\n linkTo(methodOn(MusicianController.class).getAllMusicians()).withRel(\"musicians\"),\r\n linkTo(methodOn(RootController.class).root()).withSelfRel());\r\n return rootResource;\r\n }", "public static void removeApi(String api) {\r\n\t\tString path = jEdit.getProperty(\"options.javadoc.path\", \"\");\r\n\t\tint index;\r\n\t\tif ((index = path.indexOf(api)) == -1) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tString sep = File.pathSeparator;\r\n\t\tpath = path.substring(0, index)+path.substring(index+api.length());\r\n\t\tpath = path.replace(sep+sep, sep);\r\n\t\tjEdit.setProperty(\"options.javadoc.path\", path);\r\n\t\tjEdit.propertiesChanged();\r\n\t}", "public boolean add(Object value)\r\n {\r\n if (contains(value))\r\n return false;\r\n root = add(root, value);\r\n return true;\r\n }", "private void updateAppsFromAPI(ApiResponse apiResponse) {\n List<Entry> api_entries = apiResponse.getFeed().getEntry();\n\n List<Artist> db_artists = new ArrayList<>();\n List<Category> db_Categories = new ArrayList<>();\n List<App> db_Apps = new ArrayList<>();\n List<AppImage> db_AppImages = new ArrayList<>();\n\n for (Entry e : api_entries) {\n Artist artist = new Artist();\n artist.setHref(e.getImArtist().getAttributes().getHref());\n artist.setName(e.getImArtist().getLabel());\n db_artists.add(artist);\n\n Category category = new Category();\n category.setId(e.getCategory().getAttributes().getImId());\n category.setLabel(e.getCategory().getAttributes().getLabel());\n category.setScheme(e.getCategory().getAttributes().getScheme());\n category.setTerm(e.getCategory().getAttributes().getTerm());\n db_Categories.add(category);\n\n App appEntry = new App();\n appEntry.setArtist(artist);\n appEntry.setCategory(category);\n appEntry.setCurrency(e.getImPrice().getAttributes().getAmount());\n appEntry.setCurrencyType(e.getImPrice().getAttributes().getCurrency());\n appEntry.setId(e.getId().getAttributes().getImId());\n appEntry.setId_package(e.getId().getAttributes().getImBundleId());\n appEntry.setName(e.getImName().getLabel());\n appEntry.setReleaseDate(e.getImReleaseDate().getAttributes().getLabel());\n appEntry.setReleaseTimestamp(e.getImReleaseDate().getLabel());\n appEntry.setRights(e.getRights().getLabel());\n appEntry.setSummary(e.getSummary().getLabel());\n appEntry.setTitle(e.getTitle().getLabel());\n appEntry.setWeb_link(e.getLink().getAttributes().getHref());\n appEntry.setMain_image(e.getImImage().get(2).getLabel());\n db_Apps.add(appEntry);\n\n for (ImImage imImage : e.getImImage()) {\n AppImage image = new AppImage();\n image.setApp(appEntry);\n image.setHeight(imImage.getAttributes().getHeight());\n image.setSource(imImage.getLabel());\n db_AppImages.add(image);\n }\n }\n\n // Indicador de actualizaciones completadas en la BD (Se Limpian)\n for (int i = 0; i < updates.length; i++) {\n updates[i] = false;\n }\n\n //Construccion de las sentencias de actualizacion asincronas\n DatabaseDefinition database = FlowManager.getDatabase(AppsCatalogDatabase.class);\n\n ProcessModelTransaction<Artist> artistProcessModelTransaction =\n new ProcessModelTransaction.Builder<>(new ProcessModelTransaction.ProcessModel<Artist>() {\n @Override\n public void processModel(Artist artist, DatabaseWrapper wrapper) {\n if (!artist.exists(wrapper)) {\n artist.save(wrapper);\n }\n }\n }).addAll(db_artists).build();\n\n ProcessModelTransaction<Category> categoryProcessModelTransaction =\n new ProcessModelTransaction.Builder<>(new ProcessModelTransaction.ProcessModel<Category>() {\n @Override\n public void processModel(Category category, DatabaseWrapper wrapper) {\n if (!category.exists(wrapper)) {\n category.save(wrapper);\n }\n }\n }).addAll(db_Categories).build();\n\n ProcessModelTransaction<App> appProcessModelTransaction =\n new ProcessModelTransaction.Builder<>(new ProcessModelTransaction.ProcessModel<App>() {\n @Override\n public void processModel(App app, DatabaseWrapper wrapper) {\n if (!app.exists()) {\n app.save(wrapper);\n }\n }\n }).addAll(db_Apps).build();\n\n ProcessModelTransaction<AppImage> imageProcessModelTransaction =\n new ProcessModelTransaction.Builder<>(new ProcessModelTransaction.ProcessModel<AppImage>() {\n @Override\n public void processModel(AppImage image, DatabaseWrapper wrapper) {\n if (!image.exists()) {\n image.save(wrapper);\n }\n }\n }).addAll(db_AppImages).build();\n\n // Definicion de Callbacks para actualizaciones cuando sean exitosas y cuando hayan errores\n Transaction t1 = database.beginTransactionAsync(artistProcessModelTransaction)\n .success(new Transaction.Success() {\n @Override\n public void onSuccess(Transaction transaction) {\n updates[0] = true;\n verifyCompleteUpdate(updates);\n }\n }).error(new Transaction.Error() {\n @Override\n public void onError(Transaction transaction, Throwable error) {\n error.printStackTrace();\n post(error.getLocalizedMessage(), AppslistEvent.UPDATE_APPLIST_EVENT);\n }\n }).build();\n\n Transaction t2 = database.beginTransactionAsync(categoryProcessModelTransaction)\n .success(new Transaction.Success() {\n @Override\n public void onSuccess(Transaction transaction) {\n updates[1] = true;\n verifyCompleteUpdate(updates);\n }\n }).error(new Transaction.Error() {\n @Override\n public void onError(Transaction transaction, Throwable error) {\n error.printStackTrace();\n post(error.getLocalizedMessage(), AppslistEvent.UPDATE_APPLIST_EVENT);\n }\n }).build();\n Transaction t3 = database.beginTransactionAsync(appProcessModelTransaction)\n .success(new Transaction.Success() {\n @Override\n public void onSuccess(Transaction transaction) {\n updates[2] = true;\n verifyCompleteUpdate(updates);\n }\n }).error(new Transaction.Error() {\n @Override\n public void onError(Transaction transaction, Throwable error) {\n error.printStackTrace();\n post(error.getLocalizedMessage(), AppslistEvent.UPDATE_APPLIST_EVENT);\n }\n }).build();\n Transaction t4 = database.beginTransactionAsync(imageProcessModelTransaction)\n .success(new Transaction.Success() {\n @Override\n public void onSuccess(Transaction transaction) {\n updates[3] = true;\n verifyCompleteUpdate(updates);\n }\n }).error(new Transaction.Error() {\n @Override\n public void onError(Transaction transaction, Throwable error) {\n error.printStackTrace();\n post(error.getLocalizedMessage(), AppslistEvent.UPDATE_APPLIST_EVENT);\n }\n }).build();\n\n // Ejecutar\n t1.execute();\n t2.execute();\n t3.execute();\n t4.execute();\n\n }", "private List<JsonObject> addResourceDocsToRegistry(JsonObject swaggerDocObject, String sourceUrl,\n\t String swaggerDocPath) throws RegistryException {\n\n\t\tif (sourceUrl == null) {\n\t\t\tlog.debug(CommonConstants.EMPTY_URL);\n\t\t\tlog.warn(\"Resource paths cannot be read. Creating the REST service might fail.\");\n\t\t\treturn null;\n\t\t} else if (sourceUrl.startsWith(\"file\")) {\n\t\t\tsourceUrl = sourceUrl.substring(0,sourceUrl.lastIndexOf(\"/\"));\n\t\t}\n\n\t\tList<JsonObject> resourceObjects = new ArrayList<>();\n\t\t//Adding Resource documents to registry.\n\t\tJsonArray pathResources = swaggerDocObject.get(SwaggerConstants.APIS).getAsJsonArray();\n\t\tByteArrayOutputStream resourceContentStream = null;\n\t\tInputStream resourceInputStream = null;\n\t\tString path;\n\n\t\t/*\n\t\tLoops through apis array of the swagger 1.2 api-doc and reads all the resource documents and saves them in to\n\t\tthe registry.\n\t\t */\n\t\tfor (JsonElement pathResource : pathResources) {\n\t\t\tJsonObject resourceObj = pathResource.getAsJsonObject();\n\t\t\tpath = resourceObj.get(SwaggerConstants.PATH).getAsString();\n\t\t\ttry {\n\t\t\t\tresourceInputStream = new URL(sourceUrl + path).openStream();\n\t\t\t} catch (IOException e) {\n\t\t\t\tthrow new RegistryException(\"The URL \" + sourceUrl + path + \" is incorrect.\", e);\n\t\t\t}\n\t\t\tresourceContentStream = CommonUtil.readSourceContent(resourceInputStream);\n\t\t\tJsonObject resourceObject = parser.parse(resourceContentStream.toString()).getAsJsonObject();\n\t\t\tresourceObjects.add(resourceObject);\n\t\t\tif (endpointElement == null) {\n\t\t\t\tcreateEndpointElement(resourceObject, SwaggerConstants.SWAGGER_VERSION_12);\n\t\t\t}\n\t\t\t//path = swaggerResourcesPath + path;\n path = path.replace(\"/\",\"\");\n path = CommonUtil.replaceExpressionOfPath(swaggerResourcesPath, \"name\", path);\n path = RegistryUtils.getAbsolutePath(registry.getRegistryContext(),path);\n\t\t\t//Save Resource document to registry\n\t\t\tif(addSwaggerDocumentToRegistry(resourceContentStream, path, documentVersion)) {\n //Adding an dependency to API_DOC\n registry.addAssociation(swaggerDocPath, path, CommonConstants.DEPENDS);\n }\n\t\t}\n\n\t\tCommonUtil.closeOutputStream(resourceContentStream);\n\t\tCommonUtil.closeInputStream(resourceInputStream);\n\t\treturn resourceObjects;\n\t}", "@Override\n public String addAPIRevision(APIRevision apiRevision, String organization) throws APIManagementException {\n int revisionCountPerAPI = apiMgtDAO.getRevisionCountByAPI(apiRevision.getApiUUID());\n int maxRevisionCount = getMaxRevisionCount(organization);\n if (revisionCountPerAPI >= maxRevisionCount) {\n String errorMessage = \"Maximum number of revisions per API has reached. \" +\n \"Need to remove stale revision to create a new Revision for API with API UUID:\"\n + apiRevision.getApiUUID();\n throw new APIManagementException(errorMessage, ExceptionCodes.from(ExceptionCodes.MAXIMUM_REVISIONS_REACHED,\n apiRevision.getApiUUID()));\n }\n\n int revisionId = apiMgtDAO.getMostRecentRevisionId(apiRevision.getApiUUID()) + 1;\n apiRevision.setId(revisionId);\n APIIdentifier apiId = APIUtil.getAPIIdentifierFromUUID(apiRevision.getApiUUID());\n if (apiId == null) {\n throw new APIMgtResourceNotFoundException(\"Couldn't retrieve existing API with API UUID: \"\n + apiRevision.getApiUUID(), ExceptionCodes.from(ExceptionCodes.API_NOT_FOUND,\n apiRevision.getApiUUID()));\n }\n apiId.setUuid(apiRevision.getApiUUID());\n String revisionUUID;\n try {\n revisionUUID = apiPersistenceInstance.addAPIRevision(new Organization(organization),\n apiId.getUUID(), revisionId);\n } catch (APIPersistenceException e) {\n String errorMessage = \"Failed to add revision registry artifacts\";\n throw new APIManagementException(errorMessage, ExceptionCodes.from(ExceptionCodes.\n ERROR_CREATING_API_REVISION, apiRevision.getApiUUID()));\n }\n if (StringUtils.isEmpty(revisionUUID)) {\n String errorMessage = \"Failed to retrieve revision uuid\";\n throw new APIManagementException(errorMessage,\n ExceptionCodes.from(ExceptionCodes.API_REVISION_UUID_NOT_FOUND));\n }\n apiRevision.setRevisionUUID(revisionUUID);\n apiMgtDAO.addAPIRevision(apiRevision);\n if (importExportAPI != null) {\n try {\n File artifact = importExportAPI\n .exportAPI(apiRevision.getApiUUID(), revisionUUID, true, ExportFormat.JSON, false, true,\n organization);\n // Keeping the organization as tenant domain since MG does not support organization-wise deployment\n // Artifacts will be deployed in ST for all organizations\n gatewayArtifactsMgtDAO.addGatewayAPIArtifactAndMetaData(apiRevision.getApiUUID(), apiId.getApiName(),\n apiId.getVersion(), apiRevision.getRevisionUUID(), organization, APIConstants.HTTP_PROTOCOL,\n artifact);\n if (artifactSaver != null) {\n // Keeping the organization as tenant domain since MG does not support organization-wise deployment\n // Artifacts will be deployed in ST for all organizations\n artifactSaver.saveArtifact(apiRevision.getApiUUID(), apiId.getApiName(), apiId.getVersion(),\n apiRevision.getRevisionUUID(), organization, artifact);\n }\n } catch (APIImportExportException | ArtifactSynchronizerException e) {\n throw new APIManagementException(\"Error while Store the Revision Artifact\",\n ExceptionCodes.from(ExceptionCodes.API_REVISION_UUID_NOT_FOUND));\n }\n }\n return revisionUUID;\n }", "protected void setApi(T api) {\n mApi = api;\n }", "@Override\n public Set<APIStore> getPublishedExternalAPIStores(String apiId) throws APIManagementException {\n Set<APIStore> storesSet;\n SortedSet<APIStore> configuredAPIStores = new TreeSet<>(new APIStoreNameComparator());\n configuredAPIStores.addAll(APIUtil.getExternalStores(tenantId));\n if (APIUtil.isAPIsPublishToExternalAPIStores(tenantId)) {\n storesSet = apiMgtDAO.getExternalAPIStoresDetails(apiId);\n //Retains only the stores that contained in configuration\n storesSet.retainAll(configuredAPIStores);\n return storesSet;\n }\n return null;\n }", "@Override\n public boolean registerNewResource(API api, Map resourceAttributes) throws APIManagementException {\n\n return true;\n }", "private static void inOrdPutList(Node root, List<Integer> arLi)\n {\n if(root == null)\n return;\n \n inOrdPutList(root.left, arLi); arLi.add(root.data); inOrdPutList(root.right,arLi);\n }", "public void analyseRoot(Resource root) {\n\t\tserTypes.put(root, new SerialziationTypeRefs());\r\n\t}", "@Path(\"/master\")\n@Consumes(MediaType.APPLICATION_JSON)\n@Produces(MediaType.APPLICATION_JSON)\npublic interface MasterRootResource extends CommonUpdateResource {\n\n /**\n * @return the list of registered minions indexed by their name\n */\n @GET\n @Path(\"/minions\")\n public Map<String, MinionStatusDto> getNodes();\n\n /**\n * @param name the name of the minion to add.\n * @param minion the minion configuration for the minion to add.\n */\n @PUT\n @Path(\"/minions/{name}\")\n public void addNode(@PathParam(\"name\") String name, RemoteService minion);\n\n /**\n * @param name the name of the minion to add.\n * @param minion the configuration of a server which is currently STANDALONE or MANAGED. It will be migrated to a node.\n */\n @PUT\n @Path(\"/minions/{name}/migrate\")\n public void convertNode(@PathParam(\"name\") String name, RemoteService minion);\n\n /**\n * @param name the name of the minion to edit.\n * @param minion the updated minion configuration for the minion.\n */\n @POST\n @Path(\"/minions/{name}\")\n public void editNode(@PathParam(\"name\") String name, RemoteService minion);\n\n /**\n * @param name the name of the minion to edit.\n * @param minion the updated minion configuration for the minion.\n */\n @POST\n @Path(\"/minions/{name}/replace\")\n public void replaceNode(@PathParam(\"name\") String name, RemoteService minion);\n\n /**\n * @param name the name of the minion to remove.\n */\n @DELETE\n @Path(\"/minions/{name}\")\n public void removeNode(@PathParam(\"name\") String name);\n\n /**\n * @param name a single node to update\n * @param version the update to install\n * @param clean whether to clean up old versions\n */\n @POST\n @Path(\"/minions/{name}/update\")\n public void updateNode(@PathParam(\"name\") String name, Manifest.Key version, @QueryParam(\"clean\") boolean clean);\n\n /**\n * @param name the name of the node to check.\n */\n @POST\n @Path(\"/minions/{name}/fsck\")\n @RequiredPermission(permission = Permission.ADMIN)\n public Map<String, String> fsckNode(@PathParam(\"name\") String name);\n\n /**\n * @param name the name of the node to prune.\n */\n @POST\n @Path(\"/minions/{name}/prune\")\n @RequiredPermission(permission = Permission.ADMIN)\n public long pruneNode(@PathParam(\"name\") String name);\n\n /**\n * Request the master that is responsible for the given named Hive.\n * <p>\n * Use {@link CommonRootResource#addInstanceGroup(InstanceGroupConfiguration, String)} to create new instance groups.\n *\n * @param name the name of a named hive.\n * @return the resource used to manage a certain namespace on the master\n */\n @Path(\"{name}\")\n public MasterNamedResource getNamedMaster(@PathParam(\"name\") String name);\n\n}", "private List<KZRestfulApi> parseXmlConfigFile(String xmlFilePath) throws ParserConfigurationException, SAXException, IOException {\n\t\tFile inputFile = new File(xmlFilePath);\n\t\t// build DOM tree from file\n DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();\n DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();\n Document doc = dBuilder.parse(inputFile);\n doc.getDocumentElement().normalize();\n // create KZRestfulApi list based on api nodes\n List<KZRestfulApi> kzApiList = new ArrayList<KZRestfulApi>();\n // parse nodes from DOM\n NodeList nodeApiList = doc.getElementsByTagName(\"api\");\n for (int i = 0; i < nodeApiList.getLength(); i++) {\n \tElement nodeApi = (Element) nodeApiList.item(i); // api node\n \tKZRestfulApi kzApi = new KZRestfulApi();\n \t// name node of this api\n \tNode nodeName = nodeApi.getElementsByTagName(\"name\").item(0);\n \tif (nodeName != null)\n \t\tkzApi.name = nodeName.getTextContent().trim();\n \t// output node of this api\n \tNode nodeOutput = nodeApi.getElementsByTagName(\"output\").item(0);\n \tif (nodeOutput != null)\n \t\tkzApi.output = nodeOutput.getTextContent().trim();\n \t// script node of this api\n \tNode nodeScript = nodeApi.getElementsByTagName(\"script\").item(0);\n \tif (nodeScript != null)\n \t\tkzApi.script = nodeScript.getTextContent().trim();\n \t// inputs node of this api\n \tkzApi.inputs = new HashMap<>();\n \tNodeList nodeInputsList = nodeApi.getElementsByTagName(\"input\");\n \tfor (int j = 0; j < nodeInputsList.getLength(); j++) {\n\t\t\t\tElement nodeInput = (Element) nodeInputsList.item(j);\n\t\t\t\tkzApi.inputs.put(nodeInput.getAttribute(\"key\"), nodeInput.getTextContent().trim());\n\t\t\t}\n \t// add kzApi to api list\n \tkzApiList.add(kzApi);\n }\n return kzApiList;\n\t}", "public void setRootItem(Object newItem);", "private void validateAndSetAPISecurity(API api) {\n String apiSecurity = APIConstants.DEFAULT_API_SECURITY_OAUTH2;\n String security = api.getApiSecurity();\n if (security!= null) {\n apiSecurity = security;\n ArrayList<String> securityLevels = selectSecurityLevels(apiSecurity);\n apiSecurity = String.join(\",\", securityLevels);\n }\n if (log.isDebugEnabled()) {\n log.debug(\"API \" + api.getId() + \" has following enabled protocols : \" + apiSecurity);\n }\n\n api.setApiSecurity(apiSecurity);\n }", "public static IItem registerItems(URL itemURL, IRepositoryRoot root, Database db) {\n\t\tfinal List<ItemHandler> itemHandlerList = Container.getComponents(ItemHandler.class);\r\n\r\n\t\tfor (ItemHandler handler : itemHandlerList) {\r\n\t\t\tfinal IItem item = handler.acceptItem(itemURL, root, db);\r\n\r\n\t\t\tif (item != null) {\r\n\t\t\t\treturn item;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "private Node<K, D> add(K key, D data, Node<K, D> root) {\n if (root == null)\n return new Node<K, D>(key, data);\n int c = key.compareTo(root.key);\n if (c <= 0) {\n root.left = add(key, data, root.left);\n return root;\n } else { // c > 0\n root.right = add(key, data, root.right);\n return root;\n }\n }", "public void add(int value) {\n overallRoot = add(overallRoot, value);\n }", "@RequestMapping(value=\"/\", method=RequestMethod.GET)\r\n\tpublic ResponseEntity<ResourceSupport> root() {\r\n\t\tResourceSupport resourceSupport = new ResourceSupport();\r\n\t\tresourceSupport.add(linkTo(methodOn(RootResource.class).root()).withSelfRel());\r\n\t\tresourceSupport.add(linkTo(methodOn(CompanyResource.class).getAllCompanies()).withRel(\"companies\"));\r\n\t\treturn ResponseEntity.ok(resourceSupport);\r\n\t}", "protected boolean loadRoot(Root root, boolean loadAll) {\n\t\tif(this.monitor != null && this.monitor.isCanceled()) return false;\n\t\tConnection conn = getConnection();\n\t\tPreparedStatement stmtSelect = null;\n\t\tResultSet rs = null;\n\t\tboolean isLoad = false;\n\t\ttry {\n\t\t\t// Se obtienen los hijos de tipo ATProject.\n\t\t\t// Se ha desahbilitado la consulta del campo descripción porque\n\t\t\t// se ha cambiado su nombre en la tabla de Categorías. \n\t\t\tStringBuilder sbSelect = new StringBuilder(SELECT)\n\t\t\t\t.append(projectIdColumnName).append(COMMA)\n\t\t\t\t.append(projectNameColumnName)\n\t\t\t\t.append(FROM)\n\t\t\t\t.append(projectTableName);\n\t\t\t\n\t\t\tstmtSelect = conn.prepareStatement(sbSelect.toString());\n\t\t\trs = stmtSelect.executeQuery();\n\t\t\t\n\t\t\t// Se añaden a la lista\n\t\t\twhile (rs.next()) {\n\t\t\t\tIATElement atElement = ATElementFactory.createITreeComponent(projectType);\n\t\t\t\tatElement.setId(rs.getInt(1));\n\t\t\t\tatElement.setName(rs.getString(2));\n\t\t\t\t\n\t\t\t\troot.add(atElement);\n\t\t\t}\n\t\t\t\n\t\t\tisLoad = true;\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\tthrow new DAOException(e);\n\t\t\t\n\t\t} finally {\n\t\t\tDbUtils.closeQuietly(conn);\n\t\t\tDbUtils.closeQuietly(stmtSelect);\n\t\t\tDbUtils.closeQuietly(rs);\n\t\t}\n\t\treturn isLoad;\n\t}", "public boolean add(E item) {\r\n\t\troot = add(root, item);\r\n\t\treturn addReturn;\r\n\t}", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof OcApi)) {\n return false;\n }\n OcApi other = (OcApi) object;\n if ((this.apiId == null && other.apiId != null) || (this.apiId != null && !this.apiId.equals(other.apiId))) {\n return false;\n }\n return true;\n }", "public boolean add(T x) {\t// taken from AVLTree\n\t\tEntry<T> newElement = new Entry<T>(x, null, null);\n\n\t\tif (root == null) {\n\t\t\troot = newElement;\n\t\t\tnewElement.parent = null;\n\t\t\t//size++;\n\t\t}\n\n\t\tEntry<T> t = getSplay(find(x));\n\t\tif (t.element.compareTo(x) == 0) {\n\t\t\tt.element = x;\n\t\t\treturn false;\n\t\t} else if (x.compareTo(t.element) < 0) {\n\t\t\tt.left = newElement;\n\t\t\tnewElement.parent = t;\n\n\t\t} else {\n\t\t\tt.right = newElement;\n\t\t\tnewElement.parent = t;\n\t\t}\n\n\t\t//size++;\n\t\tsplay(newElement);\n\t\treturn true;\n\t}", "public api() {}", "private void inorder(TreeNode<E> root) {\n if (root == null) {\n return;\n }\n inorder(root.left);\n list.add(root.element);\n inorder(root.right);\n }", "@Test\n public void addAppTest() throws ApiException {\n Boolean naked = null;\n Application body = null;\n // Application response = api.addApp(naked, body);\n\n // TODO: test validations\n }", "public static void addRootCommand(String name) {\n\t\tcommands.put(name, new ArrayList<String>());\n\t\thandler.put(name, new HashMap<String, Handler>());\n\t\thelp.put(name, new HashMap<String,String>());\n\t\thelpargs.put(name, new HashMap<String,String>());\n\t\tpermissions.put(name, new HashMap<String,String>());\n\t}", "@Override\n public void addDeployedAPIRevision(String apiId, String apiRevisionUUID,\n List<DeployedAPIRevision> deployedAPIRevisionList)\n throws APIManagementException {\n\n List<DeployedAPIRevision> currentDeployedApiRevisionList =\n apiMgtDAO.getDeployedAPIRevisionByApiUUID(apiId);\n Set<DeployedAPIRevision> environmentsToRemove = new HashSet<>();\n\n // Deployments to add\n List<DeployedAPIRevision> environmentsToAdd = new ArrayList<>();\n\n List<String> envNames = new ArrayList<>();\n\n for (DeployedAPIRevision deployedAPIRevision : deployedAPIRevisionList) {\n // Remove duplicate entries for same revision uuid and env from incoming list\n if (!envNames.contains(deployedAPIRevision.getDeployment())) {\n envNames.add(deployedAPIRevision.getDeployment());\n environmentsToAdd.add(deployedAPIRevision);\n // Remove old deployed-revision entries of same env and apiid from existing db records\n for (DeployedAPIRevision currentapiRevisionDeployment : currentDeployedApiRevisionList) {\n if (StringUtils.equalsIgnoreCase(currentapiRevisionDeployment.getDeployment(),\n deployedAPIRevision.getDeployment())) {\n environmentsToRemove.add(currentapiRevisionDeployment);\n }\n }\n }\n }\n // Discard old deployment info\n if (environmentsToRemove.size() > 0) {\n apiMgtDAO.removeDeployedAPIRevision(apiId, environmentsToRemove);\n }\n // Add new deployed revision update to db\n if (deployedAPIRevisionList.size() > 0) {\n apiMgtDAO.addDeployedAPIRevision(apiRevisionUUID, environmentsToAdd);\n }\n }", "public boolean add(URL url) {\n return super.add(normalize(url));\n }", "private void inorder(TreeNode<E> root) {\r\n\t\t\tif (root == null)\r\n\t\t\t\treturn;\r\n\t\t\tinorder(root.left);\r\n\t\t\tlist.add(root.element);\r\n\t\t\tinorder(root.right);\r\n\t\t}", "protected void addStructureTreeRoot() {\n\t\tif (doc.getDocumentCatalog().getStructureTreeRoot() == null) {\n\t\t\tdoc.getDocumentCatalog().setStructureTreeRoot(new PDStructureTreeRoot());\n\t\t}\n\t}", "public boolean addNode(Node root, Node node) throws ISO19139CHEtoGM03.FlattenerException {\n // extents should not be removed because of reusable objects. A real corner case but possible\n if (node.getNodeName().equals(\"GM03_2Core.Core.EX_Extent\")) return false;\n if (node.getNodeName().equals(\"GM03_2_1Core.Core.CI_Contact\")) return false;\n if (node.getNodeName().equals(\"GM03_2_1Core.Core.CI_Address\")) return false;\n\n int hash = computeNodeHash(node);\n List<Node> curSlot = nodesByHash.get(hash);\n if (curSlot == null) {\n final ArrayList<Node> newSlot = new ArrayList<Node>(1);\n newSlot.add(node);\n nodesByHash.put(hash, newSlot);\n return false;\n } else {\n for (int i = 0; i < curSlot.size(); i++) {\n Node orig = curSlot.get(i);\n if (equals(node, orig)) {\n String nodeTid = node.getAttributes().getNamedItem(\"TID\").getTextContent();\n String origTid = orig.getAttributes().getNamedItem(\"TID\").getTextContent();\n root.removeChild(node);\n translations.put(nodeTid, origTid);\n return true;\n }\n }\n curSlot.add(node);\n return false;\n }\n }", "@Test\n public void testAddWordToList() throws Exception {\n System.out.println(\"addWordToList\");\n String permalink = testList.getPermalink();\n WordListApi.addWordToList(token, permalink, \"test\");\n }", "public void add (int item)\n\t{\n\t\tadd(this.root,item);\n\t}", "@Test\n public void testAddWordsToList() throws Exception {\n System.out.println(\"addWordsToList\");\n String permalink = testList.getPermalink();\n\n WordListApi.addWordsToList(token, permalink, testWordList);\n }", "public boolean routerExist(int id){\n for (Router r : routers){\n if (r.getID() == id){\n return true;\n }\n }\n // Otherwise make the new Router and add it to the arrayList\n Router newRouter = new Router(id);\n routers.add(newRouter);\n if (id > size){\n size = id;\n }\n return false;\n }", "public void addDirectories( File base ) {\n if( base.isDirectory() ) {\n repository.add( base );\n File[] files = base.listFiles();\n\n for( int i = 0; i < files.length; i++ ) {\n addDirectories( files[i] );\n }\n }\n }", "@Test\r\n\tpublic void test() {\n\t\tString serverUrl = \"https://openapi.kaola.com/router\";\r\n\t\tString accessToken = \"a2d50342-d6c9-4bff-9329-ab289904cf68\";\r\n\t\tString appKey = \"3526616f2ecf2beeceac7f7a940dce41\";\r\n\t\tString appSecret = \"afab22a1e6124bbd93179adb37188fe5a9cdbc5d78dc1631be2d6a4efc896c83\";\r\n\t\tDefaultKaolaClient client = new DefaultKaolaClient(serverUrl, accessToken, appKey, appSecret);\r\n\r\n\t\tItemAddRequest request = (ItemAddRequest) ObjectFieldManager.pushValues(new ItemAddRequest(), createAddItemRequest());\r\n\t\tSystem.out.println(JsonUtils.toJson(request));\r\n\t\tItemAddResponse response = client.execute(request);\r\n\t\tSystem.out.println(JsonUtils.toJson(response));\r\n\t}", "public boolean add(T value) {\n NodePair<T> spl = split(root, value);\n\n if (spl.second != null && getLeft(spl.second).value.compareTo(value) == 0) {\n root = merge(spl.first, spl.second);\n return false;\n }\n\n root = merge(spl.first, merge(makeNode(value), spl.second));\n return true;\n }", "public boolean addToRoot(View view) {\n Preconditions.checkNotNull(view);\n View rootView = view.getRootView();\n if (rootView == null || !(rootView instanceof ViewGroup)) {\n return false;\n }\n setVisibility(0);\n setMeasuredDimension(rootView.getWidth(), rootView.getHeight());\n ((ViewGroup) rootView).addView(this);\n forceLayout();\n return true;\n }", "public static Retrofit getApiManagerMain() {\n if (retrofitmain == null) {\n retrofitmain = new Retrofit.Builder()\n .baseUrl(MainBaseApiURL)\n .addConverterFactory(GsonConverterFactory.create())\n // .client(okHttpClient)\n .build();\n }\n return retrofitmain;\n }", "public boolean addApiForTenant(String apiProviderName, String apiName, String version, String apiConfig,\n String tenantDomain) throws AxisFault {\n RESTAPIAdminClient restClient = getRestapiAdminClient();\n return restClient.addApi(apiConfig, tenantDomain);\n }", "@Override\n\tpublic void addRecurso(Recurso recurso) {\n\t\t\n\t}", "public void addURLTemplatesForWSAPIs(int apiId) throws APIMigrationException {\n if (apiId == -1) {\n return;\n }\n try (Connection conn = APIMgtDBUtil.getConnection()) {\n conn.setAutoCommit(false);\n try (PreparedStatement ps = conn.prepareStatement(INSERT_URL_MAPPINGS_FOR_WS_APIS)) {\n for (String httpVerb: Constants.HTTP_DEFAULT_METHODS) {\n ps.setInt(1, apiId);\n ps.setString(2, httpVerb);\n ps.setString(3, Constants.AUTH_APPLICATION_OR_USER_LEVEL_TOKEN);\n ps.setString(4, Constants.API_DEFAULT_URI_TEMPLATE);\n ps.addBatch();\n }\n ps.executeBatch();\n conn.commit();\n } catch (SQLException e) {\n conn.rollback();\n throw new APIMigrationException(\"Error while adding URL template(s) to the database \" + e);\n }\n } catch (SQLException e) {\n throw new APIMigrationException(\"Error while adding URL template(s) to the database \" + e);\n }\n }", "public void add(NODE node) {\n root = root == null ? node : root.add(node);\n }", "public boolean AddAPICall(TCSAPICallDefinition call, String callType)\n {\n if(apiCallDefinitions==null)\n apiCallDefinitions = new HashMap<>();\n\n if(apiCallDefinitions.containsKey(callType))\n return false;\n\n apiCallDefinitions.put(callType, call);\n\n return true;\n }", "private ObjectNode makeRequest(final String api) {\n ObjectNode req = JSON.objectNode();\n req.put(\"api\", api);\n return req;\n }", "void addRootXML(String namespaceURI, String localName) {\n if (rootXML == null) {\n rootXML = new ArrayList<>();\n }\n rootXML.add(new RootXML(this, namespaceURI, localName));\n }", "public void addItem(int value) {\n if (root == null) {\n root = new Node(value);\n } else {\n addToNode(root, value);\n }\n }", "public int addBlock(Directory root, String name, String type, int rootIndex) {\n\t\tint freeBlock = freeBlock(); // #1\n\t\tif(freeBlock != Constants.NEGATIVE) {\n\t\t\tint dirList = root.checkDirListing();\n\t\t\tif(dirList != Constants.NEGATIVE) {\n\t\t\t\tcreateFiOrDi(root, type, freeBlock);\n\t\t\t\troot.makeDirListEntry(type, name, freeBlock, Constants.EMPTY_FILE, dirList);\n\t\t\t\treturn freeBlock;\n\t\t\t} else {//Current directory Directory_listing is exhausted so we need to create new directory and set OldDirectory-FRWD pointer to point to new Directory(if FRWD pointer of current directory is zero).\n\t\t\t\tif(root.getFrwd() != 0) {//Then check in the directory pointed by FRWD\n\t\t\t\t\treturn addBlock((Directory)sector.get(root.getFrwd()), name, type, root.getFrwd());\n\t\t\t\t} else {\n\t\t\t\t\tsector.put(freeBlock, new Directory());\n\t\t\t\t\tDirectory newRoot = (Directory) sector.get(freeBlock);\n\t\t\t\t\troot.setFrwd(freeBlock);\n\t\t\t\t\tnewRoot.setBack(rootIndex);\n\t\t\t\t\t\n\t\t\t\t\t//As we have already used freeBlock got in #1 so we are going to get new freeBlock if any.\n\t\t\t\t\tfreeBlock = freeBlock();\n\t\t\t\t\tdirList = newRoot.checkDirListing();\n\t\t\t\t\tif(freeBlock != Constants.NEGATIVE) {\n\t\t\t\t\t\tcreateFiOrDi(newRoot, type, freeBlock);\n\t\t\t\t\t\tnewRoot.makeDirListEntry(type, name, freeBlock, Constants.EMPTY_FILE, dirList);\n\t\t\t\t\t\treturn freeBlock;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn ErrorType.SECTOR_FULL.getErrorId();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//return ErrorType.DIRECTORY_LISTING_FULL.getErrorId();\n\t\t\t\t\n\t\t\t}\n\t\t} else {\n\t\t\treturn ErrorType.SECTOR_FULL.getErrorId();\n\t\t}\n\t}", "public void setRootItem(KeyedItem rootItem){\r\n\t\troot = rootItem;\r\n\t}", "boolean hasAddMountPoint();", "private Set<RestModel> getArchiveNodes(RestModel root) {\n return ((ArchiveTreeNode) root).getChildren();\n }", "private void addNodes(TreeNode root, int l, List<Integer> res) {\r\n if (l < 0 || root == null) return;\r\n\r\n if (l == 0) {\r\n res.add(root.val);\r\n return;\r\n }\r\n\r\n // l > 0\r\n addNodes(root.left, l - 1, res);\r\n addNodes(root.right, l - 1, res);\r\n return;\r\n }", "@Test\n\tpublic void testAddWrong() throws ApiException {\n\t\t\n\t\t\n\n\n\t\tOrderItemPojo order_item = getWrongOrderItemPojo(products.get(0));\n\t\tList<OrderItemPojo> lis = new ArrayList<OrderItemPojo>();\n\t\tlis.add(order_item);\n\n\t\ttry {\n\t\t\torder_service.add(lis);\n\t\t\tfail(\"ApiException did not occur\");\n\t\t} catch (ApiException e) {\n\t\t\tassertEquals(e.getMessage(), \"Quantity must be positive\");\n\t\t}\n\n\t}", "@Override\n public boolean shouldContinueSwitchedRootFound() {\n return false;\n }", "public com.walgreens.rxit.ch.cda.POCDMT000040InfrastructureRootTypeId addNewTypeId()\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.walgreens.rxit.ch.cda.POCDMT000040InfrastructureRootTypeId target = null;\n target = (com.walgreens.rxit.ch.cda.POCDMT000040InfrastructureRootTypeId)get_store().add_element_user(TYPEID$2);\n return target;\n }\n }", "private int helper(List<List<Integer>> res, TreeNode root) {\n if (root == null) return -1;\n int left = helper(res, root.left);\n int right = helper(res, root.right);\n int curr = Math.max(left, right) + 1;\n if (res.size() == curr) res.add(new ArrayList<>());\n res.get(curr).add(root.val);\n return curr;\n }", "@Override\r\n public List<ResourceProvider> getAspectsAPI() {\n return ResourceProvider.getResourcesFromEnum(\r\n Arrays.asList(LaraAPIResources.class, LaraCommonLanguageApiResource.class, KadabraAPIResources.class,\r\n LaraCoreApiResource.class,\r\n LaraWeaverApiResource.class));\r\n\r\n // return ResourceProvider.getResources(LaraAPIResources.class);\r\n }" ]
[ "0.57344973", "0.5680629", "0.5402149", "0.52780384", "0.5270391", "0.5215971", "0.5165126", "0.5085126", "0.50109136", "0.50022346", "0.49852368", "0.49655905", "0.49377394", "0.49288", "0.4921596", "0.49128735", "0.49042353", "0.4896888", "0.48832503", "0.488034", "0.48503876", "0.48363578", "0.48287752", "0.48280835", "0.48229185", "0.48218256", "0.48001996", "0.47990856", "0.47720575", "0.4764141", "0.47636515", "0.4759591", "0.4727503", "0.47273523", "0.4717063", "0.47126275", "0.47106975", "0.47106266", "0.4708018", "0.4707716", "0.47036391", "0.47017178", "0.47010162", "0.46973938", "0.46962982", "0.46904367", "0.4686403", "0.46770376", "0.46736106", "0.4672869", "0.46669796", "0.4661946", "0.46434617", "0.46333173", "0.4627699", "0.4615656", "0.46111706", "0.46099108", "0.459516", "0.45870966", "0.45797208", "0.45655078", "0.45490015", "0.45412847", "0.45412713", "0.4540515", "0.45375827", "0.45267576", "0.45161366", "0.45149374", "0.4512323", "0.45095623", "0.44970325", "0.4496282", "0.44862297", "0.44790187", "0.44761184", "0.44757706", "0.4464133", "0.44596434", "0.44588187", "0.44583204", "0.44393063", "0.4437655", "0.442964", "0.4422876", "0.4420212", "0.44175082", "0.44168207", "0.44046363", "0.44039756", "0.44038254", "0.44036102", "0.43991104", "0.43903553", "0.438439", "0.4383113", "0.43826464", "0.43823832", "0.4381235" ]
0.5723216
1
Removes an api root from the list
public static void removeApi(String api) { String path = jEdit.getProperty("options.javadoc.path", ""); int index; if ((index = path.indexOf(api)) == -1) { return; } String sep = File.pathSeparator; path = path.substring(0, index)+path.substring(index+api.length()); path = path.replace(sep+sep, sep); jEdit.setProperty("options.javadoc.path", path); jEdit.propertiesChanged(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void deleteAPIFromDB(API api) throws APIManagementException {\n\n APIIdentifier apiIdentifier = api.getId();\n int tenantId = APIUtil.getTenantId(APIUtil.replaceEmailDomainBack(apiIdentifier.getProviderName()));\n String tenantDomain = APIUtil.getTenantDomainFromTenantId(tenantId);\n // Get local scopes for the given API which are not already assigned for different versions of the same API\n Set<String> localScopeKeysToDelete = apiMgtDAO.getUnversionedLocalScopeKeysForAPI(api.getUuid(), tenantId);\n // Get the URI Templates for the given API to detach the resources scopes from\n Set<URITemplate> uriTemplates = apiMgtDAO.getURITemplatesOfAPI(api.getUuid());\n // Detach all the resource scopes from the API resources in KM\n Map<String, KeyManagerDto> tenantKeyManagers = KeyManagerHolder.getTenantKeyManagers(tenantDomain);\n for (Map.Entry<String, KeyManagerDto> keyManagerDtoEntry : tenantKeyManagers.entrySet()) {\n KeyManager keyManager = keyManagerDtoEntry.getValue().getKeyManager();\n if (keyManager != null) {\n try {\n keyManager.detachResourceScopes(api, uriTemplates);\n if (log.isDebugEnabled()) {\n log.debug(\"Resource scopes are successfully detached for the API : \" + apiIdentifier\n + \" from Key Manager :\" + keyManagerDtoEntry.getKey() + \".\");\n }\n // remove the local scopes from the KM\n for (String localScope : localScopeKeysToDelete) {\n keyManager.deleteScope(localScope);\n }\n if (log.isDebugEnabled()) {\n log.debug(\"Local scopes are successfully deleted for the API : \" + apiIdentifier\n + \" from Key Manager : \" + keyManagerDtoEntry.getKey() + \".\");\n }\n } catch (APIManagementException e) {\n log.error(\"Error while Detach and Delete Scope from Key Manager \" + keyManagerDtoEntry.getKey(), e);\n }\n }\n }\n deleteScopes(localScopeKeysToDelete, tenantId);\n apiMgtDAO.deleteAPI(api.getUuid());\n if (log.isDebugEnabled()) {\n log.debug(\"API : \" + apiIdentifier + \" is successfully deleted from the database and Key Manager.\");\n }\n }", "@PostMapping(\"/deleteApi\")\r\n\tpublic void deleteAPI(@RequestBody ApiDto api) {\r\n\r\n\t\tpersistenceService.deleteApi(api.getId());\r\n\t\ttenantAPIService.deleteByUrl(api.getApiUrl());\r\n\t}", "public void remove( AnyType x )\r\n\t{\r\n\t\troot = remove( x, root );\r\n\t}", "public void remove(AnyType x) {\n\t\troot = remove(x, root);\n\t}", "public void removeFromRoot(){\n Main.getRootPlayGround().getChildren().remove(imageView);\n }", "private void deleteTree(tnode root){\n if (root != null)\n root = null;\n }", "static public void unregisterAllRoot()\n {\n java.lang.SecurityManager sm = System.getSecurityManager();\n if( sm != null )\n {\n sm.checkPermission( new RuntimePermission( \"modifyRepository\" ) );\n }\n\n rootMap.clear();\n }", "public static void clearAppList() {\n }", "static public void unregisterRoot(DataCollection<?> dataCollection)\n {\n java.lang.SecurityManager sm = System.getSecurityManager();\n if( sm != null )\n {\n sm.checkPermission( new RuntimePermission( \"modifyRepository\" ) );\n }\n\n rootMap.remove( dataCollection.getName() );\n }", "@HTTP(\n method = \"DELETE\",\n path = \"/apis/config.openshift.io/v1/apiservers\"\n )\n @Headers({ \n \"Accept: */*\"\n })\n KubernetesCall<Status> deleteCollectionAPIServer();", "@Override\r\n public void clear(){\r\n root = null;\r\n }", "private static List<OperationPolicy> extractAndDropAPILevelPoliciesFromAPI(API api) {\n List<OperationPolicy> policies = new ArrayList<>();\n if (api.getApiPolicies() != null && !api.getApiPolicies().isEmpty()) {\n policies = api.getApiPolicies();\n api.setApiPolicies(null);\n }\n return policies;\n }", "@Override\n public void clear() {\n root = null;\n }", "private static void delTree(BoardTree root) {\n if (root.children == null) return;\n for (BoardTree child : root.children) {\n delTree(child);\n }\n root.children.clear();\n root = null;\n }", "public void delete() {\n this.root = null;\n }", "@Test\n public void remove_BST_0_CaseRootOneChildren()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(20);\n bst.insert(null, root);\n bst.insert(root, new No(10));\n //bst.printTree();\n //System.err.println(); // Print[ERR] Devido a prioridade do buffer de impressao (out, err)\n \n assertEquals(root, bst.remove(root));\n assertEquals(new Integer(1), bst.size());\n //bst.printTree();\n }", "public void remove(AnyType x) {\n LinkedListIterator<AnyType> p = findPrevious(x);\n\n if (p.current.next != null) {\n p.current.next = p.current.next.next; // Bypass deleted node\n }\n }", "public Builder clearApiGroups() {\n apiGroups_ = com.google.protobuf.LazyStringArrayList.EMPTY;\n bitField0_ = (bitField0_ & ~0x00000002);\n onChanged();\n return this;\n }", "public void clear() {\n root = null;\n }", "public void clear() {\n root = null;\n }", "@Test\n public void testDeleteWordFromList() throws Exception {\n System.out.println(\"deleteWordFromList\");\n\n String permalink = testList.getPermalink();\n String word = \"test\";\n WordListApi.deleteWordFromList(token, permalink, word);\n\n // check that the list is now empty\n List<WordListWord> result = WordListApi.getWordsFromList(token, permalink);\n KnickerLogger.getLogger().log(\"****************************************\");\n KnickerLogger.getLogger().log(result.toString());\n KnickerLogger.getLogger().log(\"****************************************\");\n\n assertEquals(result.size(), 0);\n }", "public void removeAlgorithmOldRootTx(String rootTxId);", "@Test\n public void remove_BST_0_CaseRoot()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(6);\n bst.insert(null, root);\n bst.insert(root, new No(2));\n bst.insert(root, new No(9));\n //bst.printTree();\n //System.err.println(); // Print[ERR] Devido a prioridade do buffer de impressao (out, err)\n \n assertEquals(root, bst.remove(root));\n assertEquals(new Integer(2), bst.size());\n //bst.printTree();\n }", "public void removeMin() {\n\t\troot = removeMin(root);\n\t}", "public void clearPaymentGatewayApi() {\n genClient.clear(CacheKey.paymentGatewayApi);\n }", "private void clearOneTest() {\n corpus.clear();\n Factory.deleteResource(corpus);\n Factory.deleteResource(learningApi);\n controller.remove(learningApi);\n controller.cleanup();\n Factory.deleteResource(controller);\n }", "public TreeNode pruneTree(TreeNode root) {\n if (containsOne(root) == false) {\n return null;\n } else {\n return root;\n }\n }", "@Override\n public synchronized Response getRootDoc(final UriInfo uriInfo) {\n final ResourceList rootDoc;\n if (isNew(uriInfo)) {\n rootDoc = apiDocGeneratorRFC8040.getResourceListing(uriInfo);\n } else {\n rootDoc = apiDocGeneratorDraft02.getResourceListing(uriInfo);\n }\n\n return Response.ok(rootDoc).build();\n }", "@Test\n public void testDeleteList() throws Exception {\n System.out.println(\"deleteList\");\n String permalink = testList.getPermalink();\n\n WordListApi.deleteList(token, permalink);\n }", "public static void removeFromPaneById(AnchorPane ap, String id) {\n\t\tfor(int i = 0; i < ap.getChildren().size(); i++) {\n\t\t\tif (ap.getChildren().get(i).getId() != null \n\t\t\t\t\t&& ap.getChildren().get(i).getId().equals(id)) {\n\t\t\t\tap.getChildren().remove(i);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public void remove(Key key) {\n root = remove(root, key);\n }", "void removePathItem(String name);", "private void RemoveRootNode() {\n\t\t\n\t\troot_map.remove(this);\n\t\tis_node_set = false;\n\t\tif(left_ptr == null && right_ptr == null) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tleft_ptr.RemoveRootNode();\n\t\tright_ptr.RemoveRootNode();\n\t}", "public void removeMaster() {\n master = null;\n }", "@Test\n public void removeAll_with_workflow_204() throws Exception {\n\n // PREPARE THE DATABASE\n // Fill in the workflow db\n addWfToDb(0);\n addMOToDb(1);\n addMOToDb(2);\n addMOToDb(3);\n\n // PREPARE THE TEST\n // Nothing to do\n\n // DO THE TEST\n Response response = callAPI(VERB.DELETE, \"/mo/\", null);\n\n // CHECK RESULTS\n int status = response.getStatus();\n assertEquals(204, status);\n\n String body = response.readEntity(String.class);\n assertEquals(\"\", body);\n\n response = callAPI(VERB.GET, \"/wf/\", null);\n status = response.getStatus();\n assertEquals(200, status);\n\n List<Workflow> readWorkflowList = response.readEntity(new GenericType<List<Workflow>>() {\n });\n assertEquals(1, readWorkflowList.size());\n }", "void delistResource(ExoResource xares) throws RollbackException, SystemException;", "Object unlink(Node x) {\n final Object element = x.item;\n final Node next = x.next;\n final Node prev = x.pre;\n\n //当前节点为first节点\n if (prev == null) {\n //删除这个节点时,要将next节点赋值为first节点\n first = next;\n } else {\n prev.next = next;\n x.pre = null;\n }\n\n //最后一个节点\n if (next == null) {\n last = prev;\n } else {\n next.pre = prev;\n x.next = null;\n }\n\n x.item = null;\n size--;\n return element;\n }", "void removeNodeFirst(ANode<T> a) {\n this.next.removeNode(a);\n }", "public void deleteMin() {\n root = deleteMin(root);\n }", "public void deleteMin() {\n root = deleteMin(root);\n }", "@Test\n public void remove_BST_0_CaseRootLeafRight()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(2);\n No no = new No(3);\n \n bst.insert(root, root);\n //bst.printTree();\n \n bst.insert(root, no);\n //bst.printTree();\n //System.err.println(); // Print[ERR] Devido a prioridade do buffer de impressao (out, err)\n \n assertEquals(new Integer(2), bst.size());\n assertEquals(no, bst.remove(no));\n assertEquals(new Integer(1), bst.size());\n //bst.printTree();\n }", "void removeNode(ANode<T> a) {\n return;\n }", "private void removeWord(Node root,String word,int index){\n if(index == word.length()){ //not word.length()-1 because starts from empty root\n //visiting the last Node to Remove\n //but need to remove later when com back to its paren root.removeChild(ch);\n //cause need to check weather node has children or not\n System.out.println(root.value);\n root.isEndOfWord = false; //CARE can only physically 'E' but CAR Node R has E children so R.isEndOfWord =false\n return;\n }\n\n //1st get the 'ch' at the index of th word\n var ch = word.charAt(index);\n\n //get the child Node of ch in root/children\n var child = root.getChild(ch);\n\n //if word doesn't exist/ no any Characters\n if(child == null) return;\n\n //post order traversal visiting child 1st\n removeWord(child,word,index+1); //recursively remove/ go to the next indexes of the word\n\n //then visit root to remove last index\n System.out.println(root.value);\n // if the child doesn't have any children\n // or no any characters related to end of the removing word\n //ex: cant remove word 'CAT' cause 'CATEGORY' exist.\n //if doesnt have any children and it's not the end of another word, physically remove it\n if(!child.hasChildren() && !child.isEndOfWord)\n root.removeChild(ch); //CARE can only physically 'E' but CAR Node R has E children\n\n }", "public void unregisterApplication(String internalAppId){\n\t\tString webServiceUrl = serviceProfile.getServiceApiUrl()+\"/\"+internalAppId;\n\t\tlogger.info(\"unregistering application \"+ webServiceUrl);\n\t\t\n\t\tResponseEntity<Void> response = restTemplate.exchange(webServiceUrl, HttpMethod.DELETE,\n null, Void.class);\n\t\tVoid body = response.getBody();\n\t}", "public void clear(){\n root = null;\n count = 0;\n }", "private void removeNodeById(Integer id)\n {\n if (allNodes.size() == 0)\n {\n return;\n }\n nodeIds.remove(id);\n CommunicationLink removedNode = allNodes.remove(id);\n removedNode.close();\n }", "@Override\r\n\tpublic ServerResponse2 deleteById(Integer id) {\n\t\tint flag = folderMapper.deleteById(id,0);\r\n\t\tif(flag>0) {\r\n\t\t\treturn ServerResponse2.createBySuccess();\r\n\t\t}else {\r\n\t\t\treturn ServerResponse2.createByError();\r\n\t\t}\r\n\t}", "@Test\n public void testDeleteWordsFromList() throws Exception {\n System.out.println(\"deleteWordsFromList\");\n\n String permalink = testList.getPermalink();\n WordListApi.deleteWordsFromList(token, permalink, testWordList);\n\n // check that the list is now empty\n List<WordListWord> result = WordListApi.getWordsFromList(token, permalink);\n assertEquals(result.size(), 0);\n }", "public void makeEmpty(){\n deleteAll(root);\n root = null;\n numItems = 0;\n }", "@Test\n public void normal_recursive_delete_EngineService_collection() {\n String collectionName = \"deleteEngineSvcCollection\";\n String srcFileName = \"srcFile.js\";\n\n try {\n // Create collection.\n DavResourceUtils.createServiceCollection(Setup.BEARER_MASTER_TOKEN, HttpStatus.SC_CREATED,\n Setup.TEST_CELL1, Setup.TEST_BOX1, collectionName);\n // Create dav file.\n DavResourceUtils.createServiceCollectionSource(Setup.TEST_CELL1, Setup.TEST_BOX1, collectionName,\n srcFileName, \"text/javascript\", TOKEN, \"foobar\", HttpStatus.SC_CREATED);\n // Recursive delete collection.\n deleteRecursive(collectionName, \"true\", HttpStatus.SC_NO_CONTENT);\n } finally {\n deleteRecursive(collectionName, \"true\", -1);\n }\n }", "@Test\n public void remove_BST_0_CaseRootLeafLeft()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(2);\n No no = new No(1);\n \n bst.insert(root, root);\n //bst.printTree();\n \n bst.insert(root, no);\n //bst.printTree();\n //System.err.println(); // Print[ERR] Devido a prioridade do buffer de impressao (out, err)\n \n assertEquals(new Integer(2), bst.size());\n assertEquals(no, bst.remove(no));\n assertEquals(new Integer(1), bst.size());\n //bst.printTree();\n }", "public void removeAllPackages() {\r\n myPackages.clear();\r\n }", "public void clear(Pane root) {\n root.getChildren().clear();\n this.blocks.clear();\n //this.connections.clear();\n next_id = 0;\n this.queue.clear();\n this.queue_set = false;\n }", "@Test\n public void removeAll_204() throws Exception {\n\n // PREPARE THE DATABASE\n // Fill in the workflow db\n addMOToDb(1);\n addMOToDb(2);\n addMOToDb(3);\n\n // PREPARE THE TEST\n // Nothing to do\n\n // DO THE TEST\n Response response = callAPI(VERB.DELETE, \"/mo/\", null);\n\n // CHECK RESULTS\n int status = response.getStatus();\n assertEquals(204, status);\n\n String body = response.readEntity(String.class);\n assertEquals(\"\", body);\n }", "@Headers({\n \t\"Content-Type:application/vnd.api+json\" \n })\n @DELETE(\"api/v2/sub_organizations/{id}.json_api\")\n Call<Meta> delete(\n @retrofit2.http.Path(\"id\") Integer id\n );", "public synchronized void clear()\n\t{\n\t\tthis.mApList.clear();\n\t}", "public TreeNode<T> delete(TreeNode<T> root, T info) {\n\t\tif(null == root || info == null) {\n\t\t\treturn root;\n\t\t} else {\n\t\t\treturn deleteNode(root, info);\n\t\t}\t\t\n\t}", "public void removeResourceCollection()\r\n {\r\n getSemanticObject().removeProperty(swb_resourceCollectionInv);\r\n }", "public void removeAPI(String apiGUID,\n String qualifiedName) throws InvalidParameterException,\n UserNotAuthorizedException,\n PropertyServerException\n {\n apiManagerClient.removeAPI(userId, apiManagerGUID, apiManagerName, apiGUID, qualifiedName);\n }", "private void clearRootFrame() { rootFrame_ = null;\n bitField0_ = (bitField0_ & ~0x00000001);\n }", "public void deleteWholeList()\n {\n head = null;\n }", "public void removeElement(int id) {\n for (int i = 0; i < data.size(); i++) {\n if (data.get(i).id == id) {\n data.remove(data.get(i));\n }\n }\n System.out.println(\"there are \" + data.size() + \" balls left from the server\");\n }", "@RequestMapping(method=RequestMethod.DELETE, value = \"/item\", produces = \"application/json\")\n public void clearItems()\n {\n this.itemRepository.clearItems();\n }", "public static void cleanOldTemp(String rootOutput){\r\n\t\tif(new File(rootOutput).exists()){\r\n\t\t\tLog.log(\"cleanOldTemp \"+rootOutput);\r\n\t\t\tPath pathToBeDeleted = Paths.get(rootOutput);\r\n\t\t\ttry {\r\n\t\t\t\tFiles.walk(pathToBeDeleted)\r\n\t\t\t\t .sorted(Comparator.reverseOrder())\r\n\t\t\t\t .map(Path::toFile)\r\n\t\t\t\t .forEach(File::delete);\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tLog.error(e);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n public <L> void resourcesRemoved(InventoryEvent<L> event) {\n List<Resource<L>> removedResources = event.getPayload();\n for (Resource<L> removedResource : removedResources) {\n if (removedResource.getParent() == null) {\n try {\n log.debugf(\"Removing root resource: %s\", removedResource);\n\n MonitoredEndpoint<EndpointConfiguration> endpoint = event.getSamplingService()\n .getMonitoredEndpoint();\n String endpointTenantId = endpoint.getEndpointConfiguration().getTenantId();\n String tenantIdToUse = (endpointTenantId != null) ? endpointTenantId : config.getTenantId();\n\n // The final URL should be in the form: entity/<resource_canonical_path>\n // for example: entity/t;hawkular/f;myfeed/r;resource_id\n\n CanonicalPath resourceCanonicalPath = CanonicalPath.of()\n .tenant(tenantIdToUse)\n .feed(feedId)\n .resource(removedResource.getID().getIDString())\n .get();\n\n StringBuilder deleteUrl = Util.getContextUrlString(config.getUrl(), config.getInventoryContext());\n deleteUrl.append(\"entity\")\n .append(resourceCanonicalPath.toString());\n\n Request request = httpClientBuilder.buildJsonDeleteRequest(deleteUrl.toString(),\n getTenantHeader(tenantIdToUse));\n\n long start = System.currentTimeMillis(); // we don't store this time in our diagnostics\n Response response = httpClientBuilder.getHttpClient().newCall(request).execute();\n\n try {\n final long duration = System.currentTimeMillis() - start;\n\n if (response.code() != 204 && response.code() != 404) {\n // 204 means successfully deleted, 404 means it didn't exist in the first place.\n // In either case, the resource no longer exists which is what we want;\n // any other response code means it is an error and we didn't remove the resource.\n throw new Exception(\"status-code=[\" + response.code() + \"], reason=[\"\n + response.message() + \"], url=[\" + request.urlString() + \"]\");\n }\n\n log.debugf(\"Took [%d]ms to remove root resource [%s]\", duration, removedResource);\n } finally {\n response.body().close();\n }\n } catch (InterruptedException ie) {\n log.errorFailedToStoreInventoryData(ie);\n Thread.currentThread().interrupt(); // preserve interrupt\n } catch (Exception e) {\n log.errorFailedToStoreInventoryData(e);\n diagnostics.getStorageErrorRate().mark(1);\n }\n\n }\n }\n return;\n }", "@HTTP(\n method = \"DELETE\",\n path = \"/apis/config.openshift.io/v1/infrastructures\"\n )\n @Headers({ \n \"Accept: */*\"\n })\n KubernetesCall<Status> deleteCollectionInfrastructure();", "public void remove(){\n Api.worldRemover(getWorld().getWorldFolder());\n }", "private void updateAPIResources(API api, int tenantId) throws APIManagementException {\n\n String tenantDomain = APIUtil.getTenantDomainFromTenantId(tenantId);\n APIIdentifier apiIdentifier = api.getId();\n // Get the new URI templates for the API\n Set<URITemplate> uriTemplates = api.getUriTemplates();\n // Get the existing local scope keys attached for the API\n Set<String> oldLocalScopeKeys = apiMgtDAO.getAllLocalScopeKeysForAPI(api.getUuid(), tenantId);\n // Get the existing URI templates for the API\n Set<URITemplate> oldURITemplates = apiMgtDAO.getURITemplatesOfAPI(api.getUuid());\n // Get the new local scope keys from URI templates\n Set<Scope> newLocalScopes = getScopesToRegisterFromURITemplates(api.getId().getApiName(), api.getOrganization(), uriTemplates);\n Set<String> newLocalScopeKeys = newLocalScopes.stream().map(Scope::getKey).collect(Collectors.toSet());\n // Get the existing versioned local scope keys attached for the API\n Set<String> oldVersionedLocalScopeKeys = apiMgtDAO.getVersionedLocalScopeKeysForAPI(api.getUuid(), tenantId);\n // Get the existing versioned local scope keys which needs to be removed (not updated) from the current updating\n // API and remove them from the oldLocalScopeKeys set before sending to KM, so that they will not be removed\n // from KM and can be still used by other versioned APIs.\n Iterator oldLocalScopesItr = oldLocalScopeKeys.iterator();\n while (oldLocalScopesItr.hasNext()) {\n String oldLocalScopeKey = (String) oldLocalScopesItr.next();\n // if the scope is used in versioned APIs and it is not in new local scope key set\n if (oldVersionedLocalScopeKeys.contains(oldLocalScopeKey)\n && !newLocalScopeKeys.contains(oldLocalScopeKey)) {\n //remove from old local scope key set which will be send to KM\n oldLocalScopesItr.remove();\n }\n }\n validateAndUpdateURITemplates(api, tenantId);\n apiMgtDAO.updateURITemplates(api, tenantId);\n if (log.isDebugEnabled()) {\n log.debug(\"Successfully updated the URI templates of API: \" + apiIdentifier + \" in the database\");\n }\n // Update the resource scopes of the API in KM.\n // Need to remove the old local scopes and register new local scopes and, update the resource scope mappings\n // using the updated URI templates of the API.\n deleteScopes(oldLocalScopeKeys, tenantId);\n addScopes(newLocalScopes, tenantId);\n Map<String, KeyManagerDto> tenantKeyManagers = KeyManagerHolder.getTenantKeyManagers(tenantDomain);\n for (Map.Entry<String, KeyManagerDto> keyManagerDtoEntry : tenantKeyManagers.entrySet()) {\n KeyManager keyManager = keyManagerDtoEntry.getValue().getKeyManager();\n if (keyManager != null) {\n try {\n keyManager.updateResourceScopes(api, oldLocalScopeKeys, newLocalScopes, oldURITemplates,\n uriTemplates);\n if (log.isDebugEnabled()) {\n log.debug(\"Successfully updated the resource scopes of API: \" + apiIdentifier +\n \" in Key Manager \"+ keyManagerDtoEntry.getKey()+\" .\");\n }\n } catch (APIManagementException e) {\n log.error(\"Error while updating resource to scope attachment in Key Manager \" +\n keyManagerDtoEntry.getKey(), e);\n }\n }\n }\n }", "public static void removeEmptyPathsOnClient() {\r\n\t\tfinal File libRoot = JSurePreferencesUtility.getJSureXMLDirectory();\r\n\t\tif (libRoot != null) {\r\n\t\t\tFileUtility.deleteEmptySubDirectories(libRoot);\r\n\t\t}\r\n\t}", "public void removePushToken() {\n }", "public abstract Set<RootServiceResponse> getRootServices(RootServiceRequest request) throws AmbariException;", "public void restProcessList() {\n listOfProcess.clear();\n }", "@Path(\"/remove/{id}\")\n @GET\n @ProduceMime(\"application/xml\")\n public String remove(@PathParam(\"id\") String id) {\n if (id == null || \"\".equals(id.trim()))\n return xStream.toXML(null);\n boolean result = daoForum.remove(daoForum.get(new Long(id)));\n return xStream.toXML(result);\n }", "public void removeOddSubtrees () {\n\t\t// TODO\n\t\tif (root == null) return; \n if (root.key % 2 != 0) {\n root = null;\n }\n removeOddSubtrees(root);\n }", "@Test\n public void normal_recursive_delete_WebDAV_collection() {\n String collectionName = \"deleteDavCollection\";\n String davFileName = \"davFile.txt\";\n\n try {\n // Create collection.\n DavResourceUtils.createWebDAVCollection(Setup.TEST_CELL1, Setup.TEST_BOX1, collectionName,\n Setup.BEARER_MASTER_TOKEN, HttpStatus.SC_CREATED);\n // Create dav file.\n DavResourceUtils.createWebDAVFile(Setup.TEST_CELL1, Setup.TEST_BOX1, collectionName + \"/\" + davFileName,\n \"text/html\", TOKEN, \"foobar\", HttpStatus.SC_CREATED);\n // Recursive delete collection.\n deleteRecursive(collectionName, \"true\", HttpStatus.SC_NO_CONTENT);\n } finally {\n deleteRecursive(collectionName, \"true\", -1);\n }\n }", "public T remove(T x) {\n\t\tEntry<T> node = getSplay(find(x));\n\t\tT result;\n\t\tresult = node.element;\n\t\tif(node == null)\n\t\t\treturn null;\n\t\tsplay(node);\n\t\tif(node.left != null && node.right != null) {\n\t\t\tEntry<T> tmp = getSplay(node.left);\n\t\t\twhile(tmp.right != null)\n\t\t\t\ttmp = getSplay(tmp.right);\n\t\t\t\n\t\t\ttmp.right = node.right;\n\t\t\tgetSplay(node.right).parent = tmp;\n\t\t\tgetSplay(node.left).parent = null;\n\t\t\troot = node.right;\n\t\t\t \n\t\t}\n\t\telse if(node.right != null) {\n\t\t\tgetSplay(node.right).parent = null;\n\t\t\troot = node.right;\n\t\t}\n\t\telse if(node.left != null) {\n\t\t\tgetSplay(node.left).parent = null;\n\t\t\troot = node.left;\n\t\t}\n\t\telse {\n\t\t\troot = null;\n\t\t}\n\t\tnode.parent = null;\n node.left = null;\n node.right = null;\n node = null;\n return result;\n\t}", "private void removeAlbumFromCollection() {\n //\n }", "private BinaryNode<AnyType> remove( AnyType x, BinaryNode<AnyType> t )\r\n\t{\r\n\t\tif( t == null )\r\n\t\t\treturn t; // Item not found; do nothing\r\n\r\n\t\tint compareResult = x.compareTo( t.element );\r\n\r\n\t\tif( compareResult < 0 )\r\n\t\t\tt.left = remove( x, t.left );\r\n\t\telse if( compareResult > 0 )\r\n\t\t\tt.right = remove( x, t.right );\r\n\t\telse if( t.left != null && t.right != null ) // Two children\r\n\t\t{\r\n\t\t\tt.element = findMin( t.right ).element;\r\n\t\t\tt.right = remove( t.element, t.right );\r\n\t\t}\r\n\t\telse\r\n\t\t\tt = ( t.left != null ) ? t.left : t.right;\r\n\t\treturn t;\r\n\t}", "public RemoteLibrary removeLibrary(String path);", "@Test\n public void deletion() {\n repo.addDocument(\"test1\", \"{\\\"test\\\":1}\", \"arthur\", \"test version 1\", false);\n repo.addDocument(\"test1\", \"{\\\"test\\\":2}\", \"arthur\", \"this is version 2\", false);\n repo.removeDocument(\"test1\", \"arthur\", \"removal\");\n\n String result = repo.getDocument(\"test1\");\n assertTrue(result == null);\n\n }", "public void deleteMax() {\n root = deleteMax(root);\n }", "public void deleteMax() {\n root = deleteMax(root);\n }", "protected BinaryNode<AnyType> remove(AnyType x, BinaryNode<AnyType> t) {\n\t\tif (t == null)\n\t\t\tthrow new ItemNotFoundException(x.toString());\n\t\tif (x.compareTo(t.element) < 0)\n\t\t\tt.left = remove(x, t.left);\n\t\telse if (x.compareTo(t.element) > 0)\n\t\t\tt.right = remove(x, t.right);\n\t\telse if (t.duplicate.size() != 0) {\n\t\t\tt.duplicate.remove(0);\n\t\t} else if (t.left != null && t.right != null) // Two children\n\t\t{\n\t\t\tt.element = findMin(t.right).element;\n\t\t\tt.right = removeMin(t.right);\n\t\t} else\n\t\t\tt = (t.left != null) ? t.left : t.right;\n\t\treturn t;\n\t}", "public void remove () {}", "public void unsetExtLst()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(EXTLST$28, 0);\n }\n }", "void unsetListOfServiceElements();", "@DELETE\n @Path(\"{id}\")\n @Produces(MediaType.APPLICATION_XML)\n public void deleteShoppingList(@PathParam(\"id\") Long id) throws WebApplicationException {\n boolean b = sls.deleteShoppingList(id);\n if (b == false) {\n throw new WebApplicationException(Response.Status.NOT_FOUND);\n }\n\n }", "public void delete(Comparable<T> item)\r\n {\r\n root = delete(root,item);\r\n }", "private List<MutateOperation> removeAll() {\n return removeDescendantsAndFilter(rootResourceName);\n }", "public void remove( Object x )\n {\n LinkedListItr p = findPrevious( x );\n\n if( p.current.next != null )\n p.current.next = p.current.next.next; // Bypass deleted node\n }", "@GetMapping(\"/api\")\r\n public RepresentationModel<?> root() {\r\n RepresentationModel<?> rootResource = new RepresentationModel<>();\r\n rootResource.add(\r\n linkTo(methodOn(BandController.class).getAllBands()).withRel(\"bands\"),\r\n linkTo(methodOn(MusicianController.class).getAllMusicians()).withRel(\"musicians\"),\r\n linkTo(methodOn(RootController.class).root()).withSelfRel());\r\n return rootResource;\r\n }", "private Node<K, D> removeRightMost(Node<K, D> root) {\n if(root.right.right == null) {\n if(root.right.left != null) {\n Node<K,D> temp = root.right;\n root.right = root.right.left;\n return temp;\n }\n Node<K,D> temp = root.right;\n root.right = null;\n return temp;\n }\n else {\n return removeRightMost(root.right);\n }\n }", "public Response deleteWithoutPayload(String url) {\r\n\t\treturn RestAssured.given()\r\n\t\t\t\t.header(\"Authorization\", \"Bearer \" + accessToken)\r\n\t\t\t\t.header(\"Content-Type\", \"application/json\")\r\n\t\t\t\t.delete(url);\r\n\t}", "public void remove(int k) throws IOException {\n root = removeHelper(root, k);\r\n }", "private void refreshList() {\n\t\t\t\tlist.clear();\n\t\t\t\tGetChildrenBuilder childrenBuilder = client.getChildren();\n\t\t\t\ttry {\n\t\t\t\t\tList<String> listdir = childrenBuilder.forPath(servicezoopath);\n\t\t\t\t\tfor (String string : listdir) {\n\t\t\t\t\t\tbyte[] data = client.getData().forPath(servicezoopath + \"/\" + string);\n\t\t\t\t\t\tlist.add(new String(data));\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}", "private static Document removeIDfromList(Document doc, String id) {\n NodeList participantsList = doc.getElementsByTagName(\"participant\");\n for (int x = 0; x < participantsList.getLength(); x++) {\n Element participant = (Element) participantsList.item(x);\n String idValue = participant.getAttribute(\"id\");\n if (idValue.equalsIgnoreCase(id)) {\n System.out.println(\"Id \" + participant.getAttribute(\"id\") + \" will be removed\");\n MessageDialog.getInstance().addLine(\"Id \" + participant.getAttribute(\"id\") + \" will be removed\");\n participant.getParentNode().removeChild(participant);\n doc.normalize();\n return doc; //No need to go further\n }\n }\n return doc;\n }", "void removeNode(ANode<T> a) {\n if (this.equals(a)) {\n this.remove();\n }\n else {\n this.next.removeNode(a);\n }\n }", "public void unsetExtLst()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(EXTLST$14, 0);\n }\n }", "void removeChild(Object child);", "@Test\n public void delete() {\n System.out.println(\"\\n--- delete Singer by id=2 ---\");\n\n restTemplate.delete(\"http://localhost:9082/restful-ws/singer/{id}\", 2);\n\n printAllSingers();\n }" ]
[ "0.5842663", "0.56422967", "0.56210226", "0.55404323", "0.5386737", "0.53554773", "0.52969956", "0.5260641", "0.52572453", "0.5191444", "0.5191202", "0.5174363", "0.5161104", "0.5135001", "0.511257", "0.50964785", "0.50724643", "0.5071274", "0.5046286", "0.5046286", "0.50270575", "0.4986588", "0.49613842", "0.4950699", "0.4946889", "0.49323776", "0.49313813", "0.49095398", "0.4904922", "0.48949832", "0.48872527", "0.48553815", "0.48521352", "0.48461106", "0.48454282", "0.4842822", "0.48384222", "0.48377287", "0.48302618", "0.48302618", "0.47970545", "0.4778004", "0.477797", "0.47738785", "0.47713628", "0.47698966", "0.4764475", "0.4761597", "0.47536197", "0.47444862", "0.47414276", "0.47387117", "0.4735238", "0.4727444", "0.46979696", "0.46950895", "0.46949133", "0.4692036", "0.46870318", "0.46839613", "0.46799192", "0.46704802", "0.46584985", "0.46542612", "0.4652608", "0.46480384", "0.4647135", "0.4646725", "0.4638592", "0.46289134", "0.4627749", "0.46248448", "0.461843", "0.46141645", "0.46127114", "0.46080056", "0.46056077", "0.46037236", "0.45972326", "0.45970842", "0.45943534", "0.45943534", "0.45933178", "0.45915183", "0.45867366", "0.45852754", "0.4584137", "0.4581957", "0.45812893", "0.45718184", "0.45714998", "0.45709047", "0.45705894", "0.45705518", "0.45677572", "0.4566059", "0.45653978", "0.4563725", "0.45523813", "0.45488003" ]
0.6275631
0
Gets the first available itinerary pricing info.
protected ItineraryPricingInfoData getFirstAvailableItineraryPricingInfo(final PricedItineraryData pricedItinerary) { for (final ItineraryPricingInfoData itineraryPricingInfoData : pricedItinerary.getItineraryPricingInfos()) { if (itineraryPricingInfoData.isAvailable()) { final boolean isAvailable = itineraryPricingInfoData.getBundleTemplates().stream() .allMatch(TravelBundleTemplateData::isAvailable); if (isAvailable) { return itineraryPricingInfoData; } } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Pricing getPricingForId(int productId);", "public PricingModel getPricingModel()\r\n\t{\r\n\t\treturn pricingModel;\r\n\t}", "String getPrice();", "public double getPrice() {\n double price = BASE_PRICE;\n for (Topping topping : toppings) {\n if (topping.isPremium()) {\n price += 1.25;\n } else {\n price += 0.75;\n }\n }\n return price;\n }", "@Override\n\tpublic java.lang.String getAskingPrice() {\n\t\treturn _buySellProducts.getAskingPrice();\n\t}", "Price getPrice() throws Exception;", "public String getCurrentPrice() {\n\t\treturn currPrice;\n\t}", "double getPrice();", "double getPrice();", "double getPrice();", "public java.lang.String getDefault_price() {\n return default_price;\n }", "@Override\n\tpublic double getPrice() {\n\t\treturn constantPO.getPrice();\n\t}", "public String getPricePro() {\n return pricePro;\n }", "int getPrice();", "public double getPrice();", "List<PriceInformation> getPriceForProduct(ProductModel product);", "public float getItemPriceInvoice()\n\t{\n\t\treturn itemPriceInvoice;\n\t}", "public Double getPrice();", "@Override\n\tpublic double getPrice() {\n\t\t\n\t\treturn 2000;\n\t}", "public static Optional<Integer> getPrice(int id){\n Optional<Integer> price = Optional.empty();\n\n try {\n URL url = new URL(\"http://services.runescape.com/m=itemdb_oldschool/Cowhide/viewitem?obj=\" + id);\n URLConnection con = url.openConnection();\n con.setRequestProperty(\"User-Agent\", \"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36\");\n con.setUseCaches(true);\n BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream()));\n String data;\n while ((data = br.readLine()) != null) {\n if(data.contains(\"Current Guide Price\")) {\n int firstIndex = data.indexOf(\"title=\\'\");\n int lastIndex = data.lastIndexOf(\"\\'\");\n price = Optional.of(Integer.parseInt(data.substring(firstIndex + 7, lastIndex)));\n }\n }\n br.close();\n } catch(Exception e){\n e.printStackTrace();\n }\n return price;\n }", "@Override\r\n\tpublic double getPrice() {\n\t\treturn price;\r\n\t}", "@Override\n\tpublic Double getPrice() {\n\t\treturn null;\n\t}", "public void getPrice() {\n\t System.out.println(\"Price: $\" + price);\n }", "public interface PriceProvider {\n /**\n * Get the current price.\n *\n * @return current price as a decimal string\n */\n String getPrice();\n }", "@Override\n public double getPrice(){\n \n return currentPrice; \n }", "@GetMapping(\"/{id}\")\n public ResponseEntity<Pricing> getPricing(@PathVariable(\"id\") long id) {\n\tOptional<Pricing> returnedPricing = pricingService.get(id);\n\tPricing pricing = returnedPricing.orElseThrow(() -> new HTTP404Exception(\"Resource Not Found\"));\n\n\tPricingEvent retrievedCreatedEvent = new PricingEvent(this, \"PricingRetrievedEvent\", pricing);\n\teventPublisher.publishEvent(retrievedCreatedEvent);\n\treturn ResponseEntity.ok().body(pricing);\n }", "@Override\n\tpublic double getPrice() {\n\t\treturn 4.0;\n\t}", "@Override\n\tpublic int getPrice() {\n\t\treturn product.getPrice();\n\t}", "public BigDecimal getCurrentCostPrice () \n\t{\n\t\tBigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_CurrentCostPrice);\n\t\tif (bd == null)\n\t\t\t return Env.ZERO;\n\t\treturn bd;\n\t}", "public java.lang.Integer getPrice()\n {\n return price;\n }", "public double price() {\n return price;\n }", "public BigDecimal\tgetPrice();", "public float getPrices(Integer id);", "public void getPrice(){\n System.out.println(\"Price: $\" + price); \n }", "protected float getPrice() {\n\t\t\treturn price;\n\t\t}", "public double getPrice(){\r\n\t\ttry {\r\n\t\t\treturn this.workerobj.getDouble(WorkerController.PRICE);\r\n\t\t} catch (JSONException e) {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t}", "public PriceFactory getCurrentPriceFactory()\r\n\t{\n\t\treturn OrderManager.getInstance().getPriceFactory();\r\n\t}", "@Override\r\n\tpublic Pricer getPricer() {\n\t\treturn null;\r\n\t}", "public java.lang.String getExternalPricingPer() {\n return externalPricingPer;\n }", "public String getSellingPriceonCartPage() throws InterruptedException\n\t{\n\t\tThread.sleep(2000);\n\t\twaitForVisibility(sellingPrice);\n\t\treturn sellingPrice.getText();\n\t}", "public Double getProductPrice(String product){\n return services.get(product);\n }", "public int getInitCost(){\n\t\treturn price;\n\t}", "public int getPrice();", "public Number getPrice() {\n return (Number)getAttributeInternal(PRICE);\n }", "public double getPrice()\r\n\t{\r\n\t\tif(isSpecial())\r\n\t\t{\r\n\t\t\treturn price * .5;\r\n\t\t}\r\n\t\treturn price;\r\n\t}", "long getPrice();", "@Override\r\n\t\t\tpublic String getPrice() {\n\t\t\t\treturn this.getName();\r\n\t\t\t}", "public String getStandardPriceFromGeneralTab(){\r\n\t\t\r\n\t\treturn McsElement.getElementByAttributeValueAndParentElement(driver, \"div\", \"@class\", PURCHASING_PRODUCT_WINDOW_CLASS, \"input\", \"@name\", \"standardPrice\", true, true).getAttribute(\"value\");\r\n\t\t\r\n\t}", "BigDecimal getLowPrice();", "public double getCost() {\n return price;\n }", "public ArmCurrency getPrice() {\n return (getPrice(true));\n }", "public String getBSCA_PrintPrice2();", "public double getPrice()\n {\n \treturn price;\n }", "public double getPrice() {\n return price_;\n }", "abstract public double getPrice();", "public double getPrice()\r\n {\r\n return price;\r\n }", "@Override\n public float getPriceCard() {\n return database.getPriceCard();\n }", "public Optional<List<SalesOrderHeaderPrElement>> getPricingElementOrNull() {\r\n return Optional.fromNullable(toPricingElement);\r\n }", "public double getPurchasePrice()\n {\n return purchasePrice;\n }", "protected int queryPrice(int id, String key) {\n Trace.info(\"RM::queryCarsPrice(\" + id + \", \" + key + \") called\" );\n ReservableItem curObj = (ReservableItem) readData( id, key);\n int value = 0; \n if ( curObj != null ) {\n value = curObj.getPrice();\n } // else\n Trace.info(\"RM::queryCarsPrice(\" + id + \", \" + key + \") returns cost=$\" + value );\n return value; \n }", "@Override\n\tpublic double getPrice() {\n\t\treturn 10;\n\t}", "@Override\n\tpublic double getPrice() {\n\t\treturn 10;\n\t}", "public static int getPrice() {\n return PRICE_TO_BUY;\n }", "public interface PriceRetriever {\n String getPrice(String upc);\n}", "public java.lang.String getPrice() {\n return price;\n }", "public double getPrice() \n\t{\n\t\treturn price;\n\t}", "public double getPrice() \n\t{\n\t\treturn price;\n\t}", "BigDecimal getPrice();", "public Integer getPrice() {\r\n return price;\r\n }", "public Integer getPrice() {\r\n return price;\r\n }", "public static Map<String,String> getPrice() throws MalformedURLException, IOException {\n Map<String,String>priceMap = new HashMap();\n String price;\n URL url = new URL(\"https://api.independentreserve.com/Public/GetMarketSummary?primaryCurrencyCode=xbt&secondaryCurrencyCode=aud\");\n try (InputStream is = url.openStream();\n JsonParser parser = Json.createParser(is)) {\n while (parser.hasNext()) {\n JsonParser.Event e = parser.next();\n if (e == JsonParser.Event.KEY_NAME) {\n switch (parser.getString()) {\n case \"DayHighestPrice\":\n parser.next();\n price=parser.getString();\n priceMap.put(\"DayHighestPrice\",price);\n break;\n case \"DayLowestPrice\":\n parser.next();\n System.out.print(\"DayLowestPrice: \");\n price=parser.getString();\n System.out.println(price);\n System.out.println(\"---------\");\n priceMap.put(\"DayLowestPrice\", price);\n break;\n case \"CurrentLowestOfferPrice\":\n parser.next();\n System.out.print(\"CurrentLowestOfferPrice: \");\n price=parser.getString();\n System.out.println(price);\n System.out.println(\"---------\");\n priceMap.put(\"CurrentLowestOfferPrice\", price);\n break;\n case \"CurrentHighestBidPrice\":\n parser.next();\n price=parser.getString();\n System.out.print(\"CurrentHighestBidPrice: \");\n System.out.println(price);\n priceMap.put(\"CurrentHighestBidPrice\", price);\n break;\n case \"LastPrice\":\n parser.next();\n System.out.print(\"LastPrice: \");\n price=parser.getString();\n System.out.println(price);\n System.out.println(\"---------\");\n priceMap.put(\"LastPrice\", price);\n break;\n }\n }\n }\n }\n \n return priceMap; \n}", "public double getPrice() {\r\n return price;\r\n }", "public double getPrice() {\r\n return price;\r\n }", "public double getPrice() {\r\n return price;\r\n }", "public double getPrice() {\r\n return price;\r\n }", "@Override\r\n\tpublic double getPrice() {\n\t\treturn 60000;\r\n\t}", "@Override\n public double getPrice() {\n return souvenir.getPrice() + 20;\n }", "public double getPrice()\n {\n return this.price;\n }", "public double getPrice() {\n return price;\n }", "public Integer getPrice() {\n return price;\n }", "public Integer getPrice() {\n return price;\n }", "public Integer getPrice() {\n return price;\n }", "public Integer getPrice() {\n return price;\n }", "public double getPrice()\n {\n return price;\n }", "public String getPrice() {\n return price;\n }", "public String getPrice() {\n return price;\n }", "Price getTradePrice();", "public String getIndividualProductPrice(String itemName)\n\t{\n\n\t\tString fixedString = fixString(itemName);\n\t\tString price = NO_PRICE_FOUND;\n\t\ttry {\n\t\t\tScanner scanner = getScanner(fixedString);\n\t\t\tprice = getPriceFromScanner(scanner);\n\n\t\t}catch ( Exception ex ) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t\treturn price;\n\t}", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price_;\n }" ]
[ "0.6373123", "0.6075667", "0.603325", "0.59958726", "0.5817294", "0.58155", "0.580836", "0.5734114", "0.5734114", "0.5734114", "0.5666113", "0.56507486", "0.5650464", "0.5650084", "0.56328654", "0.5631699", "0.5629045", "0.55982494", "0.55848956", "0.5578759", "0.5568804", "0.556442", "0.5558018", "0.5556314", "0.5553177", "0.55520874", "0.55509174", "0.5539285", "0.5535577", "0.55231905", "0.55189866", "0.5514478", "0.55106425", "0.5501407", "0.54965204", "0.5495752", "0.5489698", "0.54873276", "0.5486176", "0.54856396", "0.5475373", "0.5471465", "0.54639053", "0.54618245", "0.5455226", "0.54380447", "0.5437583", "0.54347473", "0.5433541", "0.5430658", "0.54267204", "0.54197305", "0.5418701", "0.5413507", "0.5413025", "0.54105926", "0.5404215", "0.54002416", "0.53977346", "0.5393751", "0.5391993", "0.5391993", "0.5389307", "0.5383872", "0.53809386", "0.53788847", "0.53788847", "0.537631", "0.5376243", "0.5376243", "0.53709954", "0.5370092", "0.5370092", "0.5370092", "0.5370092", "0.5358619", "0.53502995", "0.53486836", "0.534815", "0.5347264", "0.5347264", "0.5347264", "0.5347264", "0.53445816", "0.53388214", "0.53388214", "0.53387725", "0.5337755", "0.5335464", "0.5335464", "0.5335464", "0.5335464", "0.5335464", "0.5335464", "0.5335464", "0.5335464", "0.5335464", "0.5335464", "0.5335464", "0.5335009" ]
0.69588566
0
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_main, menu); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.actions, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tgetMenuInflater().inflate(R.menu.actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.actions_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main_actions, menu);\n\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n\t\tinflater.inflate(R.menu.action_bar_menu, menu);\r\n\t\tmMenu = menu;\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.act_bar_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_actions, menu);\r\n\t\treturn true;\r\n //return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\r\n\t inflater.inflate(R.menu.action_bar_all, menu);\r\n\t return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\t super.onCreateOptionsMenu(menu);\n\t\tMenuInflater muu= getMenuInflater();\n\t\tmuu.inflate(R.menu.cool_menu, menu);\n\t\treturn true;\n\t\t\n\t\t\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.adventure_archive, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.archive_menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n \tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n \t\tinflater.inflate(R.menu.main, menu);\n \t\tsuper.onCreateOptionsMenu(menu, inflater);\n \t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.action_menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater bow=getMenuInflater();\n\t\tbow.inflate(R.menu.menu, menu);\n\t\treturn true;\n\t\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.action_menu, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\t\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\t\t\n\t\t/* Inflate the menu; this adds items to the action bar if it is present */\n\t\tgetMenuInflater().inflate(R.menu.act_main, menu);\t\t\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflate = getMenuInflater();\n inflate.inflate(R.menu.menu, ApplicationData.amvMenu.getMenu());\n return true;\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.menu, menu);\n\t\t\treturn true; \n\t\t\t\t\t\n\t\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.main, menu);\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) \n {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_bar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_item, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.menu, menu);\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t \n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\t//menu.clear();\n\t\tinflater.inflate(R.menu.soon_to_be, menu);\n\t\t//getActivity().getActionBar().show();\n\t\t//getActivity().getActionBar().setBackgroundDrawable(\n\t\t\t\t//new ColorDrawable(Color.rgb(223, 160, 23)));\n\t\t//return true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n this.getMenuInflater().inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.main, menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu( Menu menu, MenuInflater inflater )\n\t{\n\t\tsuper.onCreateOptionsMenu( menu, inflater );\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\r\n \t// We must call through to the base implementation.\r\n \tsuper.onCreateOptionsMenu(menu);\r\n \t\r\n MenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_menu, menu);\r\n\r\n return true;\r\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.inter_main, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.action, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu (Menu menu){\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.custom_action_bar, menu);\n\t\treturn true;\n\t}", "public void initMenubar() {\n\t\tremoveAll();\n\n\t\t// \"File\"\n\t\tfileMenu = new FileMenuD(app);\n\t\tadd(fileMenu);\n\n\t\t// \"Edit\"\n\t\teditMenu = new EditMenuD(app);\n\t\tadd(editMenu);\n\n\t\t// \"View\"\n\t\t// #3711 viewMenu = app.isApplet()? new ViewMenu(app, layout) : new\n\t\t// ViewMenuApplicationD(app, layout);\n\t\tviewMenu = new ViewMenuApplicationD(app, layout);\n\t\tadd(viewMenu);\n\n\t\t// \"Perspectives\"\n\t\t// if(!app.isApplet()) {\n\t\t// perspectivesMenu = new PerspectivesMenu(app, layout);\n\t\t// add(perspectivesMenu);\n\t\t// }\n\n\t\t// \"Options\"\n\t\toptionsMenu = new OptionsMenuD(app);\n\t\tadd(optionsMenu);\n\n\t\t// \"Tools\"\n\t\ttoolsMenu = new ToolsMenuD(app);\n\t\tadd(toolsMenu);\n\n\t\t// \"Window\"\n\t\twindowMenu = new WindowMenuD(app);\n\n\t\tadd(windowMenu);\n\n\t\t// \"Help\"\n\t\thelpMenu = new HelpMenuD(app);\n\t\tadd(helpMenu);\n\n\t\t// support for right-to-left languages\n\t\tapp.setComponentOrientation(this);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp=getMenuInflater();\n\t\tblowUp.inflate(R.menu.welcome_menu, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.item, menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.resource, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu,menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.home_action_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.template, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n Log.d(\"onCreateOptionsMenu\", \"create menu\");\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.socket_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_menu, menu);//Menu Resource, Menu\n\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actionbar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(toolbar_res, menu);\n updateMenuItemsVisibility(menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t// \n\t\tMenuInflater mi = getMenuInflater();\n\t\tmi.inflate(R.menu.thumb_actv_menu, menu);\n\t\t\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.swag_list_activity_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\n\t\treturn true;\n\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.jarvi, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {\n menuInflater.inflate(R.menu.main, menu);\n\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.add__listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actmain, menu);\r\n return true;\r\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.buat_menu, menu);\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.layout.menu, menu);\n\t\treturn true;\n\t}", "@Override\npublic boolean onCreateOptionsMenu(Menu menu) {\n\n\t\n\t\n\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\n\treturn super.onCreateOptionsMenu(menu);\n}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ichat, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater)\n\t{\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\tinflater.inflate(R.menu.expenses_menu, menu);\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.action_bar, menu);\n return true;\n }", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp = getMenuInflater();\n\t\tblowUp.inflate(R.menu.status, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ui_main, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_activity_actions, menu);\n return true;\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }" ]
[ "0.72461367", "0.7201596", "0.7195268", "0.7177002", "0.71069986", "0.7039653", "0.70384306", "0.70115715", "0.7010647", "0.69803435", "0.6945406", "0.69389313", "0.6933442", "0.69172275", "0.69172275", "0.6890826", "0.6883689", "0.687515", "0.6874831", "0.68615955", "0.68615955", "0.68615955", "0.68615955", "0.68522274", "0.6846375", "0.68189865", "0.68165565", "0.68124795", "0.6812267", "0.6812267", "0.68056566", "0.6800461", "0.6797465", "0.6790805", "0.6789039", "0.6787885", "0.6782993", "0.67597246", "0.67570525", "0.6747535", "0.6743268", "0.6743268", "0.6740546", "0.67395175", "0.67256093", "0.6723954", "0.6722248", "0.6722248", "0.6720444", "0.67118156", "0.6706721", "0.6704184", "0.66993994", "0.66988564", "0.669681", "0.66943884", "0.66860807", "0.668306", "0.668306", "0.6682587", "0.668012", "0.6678661", "0.6676379", "0.6668044", "0.66669863", "0.66628903", "0.6657356", "0.6657356", "0.6657356", "0.66565585", "0.665397", "0.665397", "0.665397", "0.66525495", "0.66518986", "0.66496557", "0.6648199", "0.6646489", "0.66462386", "0.6646177", "0.6645531", "0.66453475", "0.66446036", "0.66438025", "0.6642411", "0.6641632", "0.6638948", "0.6634394", "0.66336566", "0.6632082", "0.66315377", "0.66315377", "0.66315377", "0.6628936", "0.6627818", "0.6627061", "0.66256744", "0.6623986", "0.661993", "0.6618369", "0.6618369" ]
0.0
-1
Handle action bar item clicks here. The action bar will automatically handle clicks on the Home/Up button, so long as you specify a parent activity in AndroidManifest.xml.
@Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onOptionsItemSelected(MenuItem item) { Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n\n //\n // HANDLE BACK BUTTON\n //\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // Back button clicked\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // app icon in action bar clicked; goto parent activity.\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n switch (id) {\r\n case android.R.id.home:\r\n // app icon in action bar clicked; go home\r\n this.finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // app icon in action bar clicked; go home\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n Log.e(\"clik\", \"action bar clicked\");\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n\t public boolean onOptionsItemSelected(MenuItem item) {\n\t int id = item.getItemId();\n\t \n\t\t\tif (id == android.R.id.home) {\n\t\t\t\t// Respond to the action bar's Up/Home button\n\t\t\t\t// NavUtils.navigateUpFromSameTask(this);\n\t\t\t\tonBackPressed();\n\t\t\t\treturn true;\n\t\t\t}\n\t \n\t \n\t return super.onOptionsItemSelected(item);\n\t }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n // Respond to the action bar's Up/Home button\r\n case android.R.id.home:\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle presses on the action bar items\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n case R.id.action_clear:\n return true;\n case R.id.action_done:\n\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onActionHomePressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId())\n {\n case android.R.id.home :\n super.onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId ()) {\n case android.R.id.home:\n onBackPressed ();\n return true;\n\n default:\n break;\n }\n return super.onOptionsItemSelected ( item );\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t switch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\t// app icon in action bar clicked; go home \n\t\t\tIntent intent = new Intent(this, Kelutral.class); \n\t\t\tintent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); \n\t\t\tstartActivity(intent); \n\t\t\treturn true;\t\t\n\t case R.id.Search:\n\t \treturn onSearchRequested();\n\t\tcase R.id.AppInfo:\n\t\t\t// Place holder menu item\n\t\t\tIntent newIntent = new Intent(Intent.ACTION_VIEW,\n\t\t\t\t\tUri.parse(\"http://forum.learnnavi.org/mobile-apps/\"));\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\n\t\tcase R.id.Preferences:\n\t\t\tnewIntent = new Intent(getBaseContext(), Preferences.class);\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\t\n\t }\n\t return false;\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n onBackPressed();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // Intent homeIntent = new Intent(this, MainActivity.class);\n // homeIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n // startActivity(homeIntent);\n finish();\n return true;\n default:\n return (super.onOptionsItemSelected(item));\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // setResult and close the activity when Action Bar Up Button clicked.\n if (item.getItemId() == android.R.id.home) {\n setResult(RESULT_CANCELED);\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // This ID represents the Home or Up button. In the case of this\n // activity, the Up button is shown. Use NavUtils to allow users\n // to navigate up one level in the application structure. For\n // more details, see the Navigation pattern on Android Design:\n //\n // http://developer.android.com/design/patterns/navigation.html#up-vs-back\n //\n \tgetActionBar().setDisplayHomeAsUpEnabled(false);\n \tgetFragmentManager().popBackStack();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if(id == android.R.id.home){\n onBackPressed();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@RequiresApi(api = Build.VERSION_CODES.M)\n @Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif(item.getItemId()==android.R.id.home)\r\n\t\t{\r\n\t\t\tgetActivity().onBackPressed();\r\n\t\t}\r\n\t\treturn super.onOptionsItemSelected(item);\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if(item.getItemId()==android.R.id.home){\n super.onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n return false;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n //Back arrow\n case android.R.id.home:\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // android.R.id.home是Android内置home按钮的id\n finish();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n this.onBackPressed();\n return false;\n }\n return false;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n int id = item.getItemId();\n\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n\r\n case android.R.id.home:\r\n /*Intent i= new Intent(getApplication(), MainActivity.class);\r\n i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n startActivity(i);*/\r\n onBackPressed();\r\n finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case android.R.id.home:\n this.finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Pass the event to ActionBarDrawerToggle, if it returns\n // true, then it has handled the app icon touch event\n if (mDrawerToggle.onOptionsItemSelected(item)) {\n return true;\n }\n\n // Handle your other action bar items...\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n NavUtils.navigateUpFromSameTask(getActivity());\n return true;\n case R.id.action_settings:\n Intent i = new Intent(getActivity(), SettingsActivity.class);\n startActivity(i);\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n //Fixes the Up Button\n if(id == android.R.id.home) {\n BuildRoute.this.finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()){\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return true;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if (id == android.R.id.home) {\n NavUtils.navigateUpFromSameTask(this);\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n break;\r\n }\r\n return true;\r\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif (item.getItemId() == android.R.id.home) {\n\t\t\tfinish();\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if ( id == android.R.id.home ) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n onBackPressed();\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.home) {\r\n NavUtils.navigateUpFromSameTask(this);\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_about) {\r\n AboutDialog();\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_exit) {\r\n finish();\r\n return true;\r\n }\r\n\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n//noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n// finish the activity\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item)\n {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if( id == android.R.id.home ) // Back button of the actionbar\n {\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\t\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\t\tswitch (item.getItemId()) {\r\n\t\t\tcase android.R.id.home:\r\n\t\t\t\tfinish();\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\treturn super.onOptionsItemSelected(item);\r\n\t\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n return true;\n }\n return false;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if(id == android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\r\n\t\tcase android.R.id.home:\r\n\t\t\tsetResult(RESULT_OK, getIntent());\r\n\t\t\tfinish();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n if (item.getItemId() == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n\n case android.R.id.home:\n this.finish();\n return true;\n }\n return true;\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tint id = item.getItemId();\n\t\tif (id == android.R.id.home) {\n\t\t\tfinish();\n\t\t\treturn true;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if (id == android.R.id.home) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n //NavUtils.navigateUpFromSameTask(this);\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // todo: goto back activity from here\n finish();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n // Handle item selection\r\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n return true;\r\n\r\n case me.cchiang.lookforthings.R.id.action_sample:\r\n// Snackbar.make(parent_view, item.getTitle() + \" Clicked \", Snackbar.LENGTH_SHORT).show();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tcase R.id.scan_menu:\n\t\t\tonScan();\n\t\t\tbreak;\n\t\tcase R.id.opt_about:\n\t\t\t//onAbout();\n\t\t\tbreak;\n\t\tcase R.id.opt_exit:\n\t\t\tfinish();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t\treturn true;\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n super.onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(@NonNull MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n finish();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if(id==android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\r\n\t switch (item.getItemId()) {\r\n\t \t// back to previous page\r\n\t case android.R.id.home:\r\n\t finish();\r\n\t return true;\r\n\t }\r\n\t return super.onOptionsItemSelected(item);\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId())\n {\n case android.R.id.home:\n this.finish();\n return (true);\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case R.id.home:{\n NavUtils.navigateUpFromSameTask(this);\n return true;\n }\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n switch(item.getItemId())\n {\n case android.R.id.home:\n super.onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\treturn true;\n\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n\r\n int id = item.getItemId();\r\n if(id==android.R.id.home){\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }" ]
[ "0.79042757", "0.7805287", "0.7766401", "0.7727273", "0.7631789", "0.76227075", "0.75850916", "0.75309587", "0.74881005", "0.74574566", "0.74574566", "0.7438689", "0.74217546", "0.7403555", "0.73919356", "0.738709", "0.7379311", "0.73706394", "0.73631936", "0.7356187", "0.7345765", "0.73425454", "0.73304135", "0.73285425", "0.7325551", "0.73193544", "0.73170114", "0.7313763", "0.7304262", "0.7304262", "0.73016006", "0.7298295", "0.72936976", "0.7287051", "0.72835594", "0.7280915", "0.7278735", "0.7260228", "0.7259963", "0.7259963", "0.7259963", "0.7259532", "0.72500527", "0.7225106", "0.7219787", "0.72181183", "0.72050196", "0.7200268", "0.72000635", "0.719394", "0.71856725", "0.71783334", "0.7168997", "0.7167865", "0.7154361", "0.715409", "0.7136464", "0.71354663", "0.71354663", "0.71303326", "0.7129188", "0.71245664", "0.71237016", "0.71235603", "0.7122907", "0.71177214", "0.7117509", "0.7117236", "0.7117236", "0.7117236", "0.7117236", "0.7116619", "0.71152025", "0.7112939", "0.71100503", "0.71093804", "0.71064043", "0.70999765", "0.7098476", "0.70958054", "0.7094259", "0.7094259", "0.70869505", "0.708348", "0.7081001", "0.7080677", "0.70734984", "0.7068878", "0.70622814", "0.70608747", "0.7060793", "0.70519054", "0.7037856", "0.7037856", "0.7036377", "0.70360506", "0.70360506", "0.70331967", "0.7030844", "0.7029912", "0.70200884" ]
0.0
-1
12/16 and 3/15, you should return "Winter 3/16 and 6/15, you should return "Spring 6/16 and 9/15, you should return"Summer 9/16 and 12/15, you should return "Fall gets month and day then returns season
public static void season(int month, int day) { if (month >= 12 && month <= 3 && day <= 16 && day <= 15) { System.out.println("Winter"); } if (month >= 3 && month <= 6 && day <= 16 && day <= 15) { System.out.println("Spring"); } if (month >= 6 && month <= 9 && day <= 16 && day <= 15) { System.out.println("Summer"); } if (month >= 9 && month <= 12 && day <= 16 && day <= 15) { System.out.println("Fall"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String season(int month, int day) {\r\n\r\n//\tInitialize return String as empty\r\n\t\t\r\n\t String sea=\"\";\r\n\t \r\n//\tIf/Else-if statement to analyze date and month ints. Due to the requirements\r\n//\tof the day being mid-month for the cut off between seasons, each IF has\r\n//\t3 conditions, separated with the OR operator:\r\n//\t --One to check if the date is in the latter half of the specific overlapping month,\r\n//\t --One to check if the month is completely in the season where all dates qualify,\r\n//\t --One to check if the date is in the first half of the specific overlapping month.\r\n//\tOnce one of the if statements conditions are met, the \"sea\" variable is set with the \r\n//\tappropriate season.\r\n\t \r\n\t if ((month == 12 && day > 15) || (month < 3) || (month == 3 && day < 16)) {\r\n\t sea = \"Winter\"; \r\n\t } // End if\r\n\t else if ((month == 3 && day > 15) || (month > 3 && month < 6) || (month == 6 && day < 16)) {\r\n\t sea = \"Spring\"; \r\n\t } // End else if\r\n\t else if ((month == 6 && day > 15) || (month > 6 && month < 9) || (month == 9 && day < 16)) {\r\n\t sea = \"Summer\"; \r\n\t } // End else if\r\n\t else if ((month == 9 && day > 15) || (month > 9) || (month == 12 && day < 16)) {\r\n\t sea = \"Fall\"; \r\n\t } // End else if\r\n\t \r\n//\tPrint out the result with the entered ints and the season String output\r\n\t \r\n\t System.out.println(\"(\" + month + \", \" + day + \") = \" + sea);\r\n\t \r\n//\tReturns the sea String, per the method\r\n\t return sea;\r\n\t \r\n\t\t}", "public static String season(int month, int day) {\n\t\tString term = \"\";\n\t\tif (month >= 1 && month <= 2) {\n\t\t\tterm = \"winter\";\n\t\t}if (month == 3 && day <= 15) {\n\t\t\tterm = \"winter\";\n\t\t}if (month == 3 && day >= 16) {\n\t\t\tterm = \"spring\";\n\t\t}if (month >= 4 && month <= 5) {\n\t\t\tterm = \"spring\";\n\t\t}if (month == 6 && day <= 15) {\n\t\t\tterm = \"spring\";\n\t\t}if (month == 6 && day >= 16) {\n\t\t\tterm = \"summer\";\n\t\t}if (month >= 7 && month <= 8) {\n\t\t\tterm = \"summer\";\n\t\t}if (month == 9 && day <=15) {\n\t\t\tterm = \"summer\";\n\t\t}if (month == 9 && day >= 16) {\n\t\t\tterm = \"fall\";\n\t\t}if (month >= 10 && month <= 11) {\n\t\t\tterm = \"fall\";\n\t\t}if (month == 12 && day <= 15) {\n\t\t\tterm = \"fall\";\n\t\t}if (month == 12 && day >= 16) {\n\t\t\tterm = \"winter\";\n\t\t}\n\t\treturn term;\n\t}", "public static void season(int month, int day) {\n if (day >= 16 || day <= 15) {\r\n if (month >= 12 || month <= 3) {\r\n System.out.println(\"The season is winter\");\r\n }\r\n }\r\n // If day/month falls in 3/16 to 6/15 it is spring\r\n if (day >= 16 || day <= 15) {\r\n if (month >= 3 || month <= 6) {\r\n System.out.println(\"The season is spring\");\r\n }\r\n }\r\n // If day/month falls in 6/16 to 9/15 it is summer\r\n if (day >= 16 || day <= 15) {\r\n if (month >= 6 || month <= 9) {\r\n System.out.println(\"The season is summer\");\r\n }\r\n }\r\n // If day/month falls in 9/16 to 1/15 it is fall\r\n if (day >= 16 || day <= 15) {\r\n if (month >= 9 || month <= 1) {\r\n System.out.println(\"The season is fall\");\r\n }\r\n }\r\n }", "public String printActivityPatternsSeason()\n\t{\n\t\tStringBuilder toReturn = new StringBuilder();\n\n\t\ttoReturn.append(\"ACTIVITY PATTERNS BY SEASON\\n\");\n\t\ttoReturn.append(\" Activity in one-hour segments by season\\n\");\n\n\t\tint[][] seasons = new int[][]\n\t\t{\n\t\t\t\t{ 11, 0, 1 }, // 1\n\t\t\t\t{ 2, 3, 4 }, // 2\n\t\t\t\t{ 5, 6, 7 }, // 3\n\t\t\t\t{ 8, 9, 10 } }; // 4\n\n\t\tint[] lengthPerSeason = new int[4];\n\t\tint[] monthlyTotals = new int[12];\n\t\tfor (Location location : analysis.getAllImageLocations())\n\t\t{\n\t\t\tList<ImageEntry> withLocation = new ImageQuery().locationOnly(location).query(images);\n\t\t\tLocalDateTime firstDate = analysis.getFirstImageInList(withLocation).getDateTaken();\n\t\t\tLocalDateTime lastDate = analysis.getLastImageInList(withLocation).getDateTaken();\n\t\t\tInteger firstMonth = firstDate.getMonthValue();\n\t\t\tInteger lastMonth = lastDate.getMonthValue();\n\t\t\tInteger firstDay = firstDate.getDayOfMonth();\n\t\t\tInteger lastDay = lastDate.getDayOfMonth();\n\t\t\ttoReturn.append(String.format(\"%-28s\", location.getName()));\n\t\t\tint monthTotal = 0;\n\t\t\tfor (int i = 0; i < 12; i++)\n\t\t\t{\n\t\t\t\tint monthValue = 0;\n\t\t\t\tif (firstMonth == lastMonth && firstMonth == i)\n\t\t\t\t\tmonthValue = lastDay - firstDay + 1;\n\t\t\t\telse if (firstMonth == i)\n\t\t\t\t\tmonthValue = 31 - firstDay + 1;\n\t\t\t\telse if (lastMonth == i)\n\t\t\t\t\tmonthValue = lastDay;\n\t\t\t\telse if (firstMonth < i && lastMonth > i)\n\t\t\t\t\tmonthValue = 31;\n\n\t\t\t\ttoReturn.append(String.format(\" %2d \", monthValue));\n\t\t\t\tmonthTotal = monthTotal + monthValue;\n\t\t\t\tmonthlyTotals[i] = monthlyTotals[i] + monthValue;\n\t\t\t}\n\t\t\ttoReturn.append(monthTotal).append(\"\\n\");\n\t\t}\n\n\t\tfor (int[] season : seasons)\n\t\t\tfor (int month : season)\n\t\t\t\tlengthPerSeason[ArrayUtils.indexOf(seasons, season)] = lengthPerSeason[ArrayUtils.indexOf(seasons, season)] + monthlyTotals[month];\n\n\t\tfor (Species species : analysis.getAllImageSpecies())\n\t\t{\n\t\t\tList<ImageEntry> withSpecies = new ImageQuery().speciesOnly(species).query(analysis.getImagesSortedByDate());\n\n\t\t\ttoReturn.append(species.getName()).append(\"\\n\");\n\t\t\ttoReturn.append(\" Dec-Jan-Feb Mar-Apr-May Jun-Jul-Aug Sep-Oct-Nov\\n\");\n\t\t\ttoReturn.append(\"Camera trap days \");\n\n\t\t\tfor (Integer length : lengthPerSeason)\n\t\t\t\ttoReturn.append(String.format(\"%7d \", length));\n\t\t\ttoReturn.append(\"\\n\");\n\n\t\t\ttoReturn.append(\"Number of pictures \");\n\t\t\tint[] imagesPerSeason = new int[4];\n\t\t\tfor (int i = 0; i < 4; i++)\n\t\t\t{\n\t\t\t\tList<ImageEntry> seasonWithSpecies = new ImageQuery().monthOnly(seasons[i]).query(withSpecies);\n\t\t\t\tInteger activity = analysis.activityForImageList(seasonWithSpecies);\n\t\t\t\ttoReturn.append(String.format(\"%7d \", activity));\n\t\t\t\timagesPerSeason[i] = activity;\n\t\t\t}\n\t\t\ttoReturn.append(\"\\n\");\n\t\t\ttoReturn.append(\"Pictures/Effort \");\n\t\t\tdouble total = 0;\n\t\t\tdouble ratios[] = new double[4];\n\t\t\tfor (int i = 0; i < 4; i++)\n\t\t\t{\n\t\t\t\tdouble currentRatio = 0;\n\t\t\t\tif (lengthPerSeason[i] != 0)\n\t\t\t\t\tcurrentRatio = (double) imagesPerSeason[i] / lengthPerSeason[i];\n\t\t\t\ttoReturn.append(String.format(\"%5.4f \", currentRatio));\n\t\t\t\tratios[i] = currentRatio;\n\t\t\t\ttotal = total + currentRatio;\n\t\t\t}\n\t\t\ttoReturn.append(\"\\n\");\n\t\t\ttoReturn.append(\"Visitation proportion \");\n\t\t\tfor (int i = 0; i < 4; i++)\n\t\t\t{\n\t\t\t\tif (total != 0)\n\t\t\t\t\ttoReturn.append(String.format(\"%5.4f \", ratios[i] / total));\n\t\t\t\telse\n\t\t\t\t\ttoReturn.append(String.format(\"%5.4f \", 0f));\n\t\t\t}\n\n\t\t\ttoReturn.append(\"\\n\");\n\n\t\t\tStringBuilder toAdd = new StringBuilder();\n\n\t\t\ttoAdd.append(\" Hour Number Freq Number Freq Number Freq Number Freq\\n\");\n\n\t\t\tint[] hourlyTotals = new int[4];\n\n\t\t\t// 24 hrs\n\t\t\tfor (int j = 0; j < 24; j++)\n\t\t\t{\n\t\t\t\tList<ImageEntry> withSpeciesAtTime = new ImageQuery().timeFrame(j, j + 1).query(withSpecies);\n\n\t\t\t\ttoAdd.append(String.format(\" %02d:00-%02d:00 \", j, j + 1));\n\n\t\t\t\t// 4 seasons\n\t\t\t\tfor (int i = 0; i < 4; i++)\n\t\t\t\t{\n\t\t\t\t\tList<ImageEntry> withSpeciesAtTimeInSeason = new ImageQuery().monthOnly(seasons[i]).query(withSpeciesAtTime);\n\t\t\t\t\tList<ImageEntry> withSpeciesInSeason = new ImageQuery().monthOnly(seasons[i]).query(withSpecies);\n\t\t\t\t\tInteger numPics = analysis.activityForImageList(withSpeciesAtTimeInSeason);\n\t\t\t\t\tInteger totalPics = analysis.activityForImageList(withSpeciesInSeason);\n\t\t\t\t\tdouble frequency;\n\t\t\t\t\tif (totalPics != 0)\n\t\t\t\t\t\tfrequency = (double) numPics / totalPics;\n\t\t\t\t\telse\n\t\t\t\t\t\tfrequency = 0;\n\n\t\t\t\t\thourlyTotals[i] = hourlyTotals[i] + numPics;\n\n\t\t\t\t\ttoAdd.append(String.format(\"%5d %5.3f \", numPics, frequency));\n\t\t\t\t}\n\n\t\t\t\ttoAdd.append(\"\\n\");\n\t\t\t}\n\n\t\t\ttoAdd.append(\" Hourly pics \");\n\t\t\tfor (int hourlyTotal : hourlyTotals) toAdd.append(String.format(\"%7d \", hourlyTotal));\n\n\t\t\ttoAdd.append(\"\\n\");\n\n\t\t\ttoReturn.append(toAdd).append(\"\\n\");\n\t\t}\n\n\t\treturn toReturn.toString();\n\t}", "public static String formatDateWithSeason(Calendar calendar) {\n return String.format(\"%2$d%1$ty%1$tm%1$td\", calendar, isUTC(calendar) ? 2 : isSummerTime(calendar) ? 1 : 0);\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tseason(12, 16); // returns Winter\r\n\t\tseason(1, 1); // returns Winter\r\n\t\tseason(3, 15); // returns Winter\r\n\t\tseason(3, 16); // returns Spring\r\n\t\tseason(5, 1); // returns Spring\r\n\t\tseason(6, 15); // returns Spring\r\n\t\tseason(6, 16); // returns Summer\r\n\t\tseason(8, 1); // returns Summer\r\n\t\tseason(9, 15); // returns Summer\r\n\t\tseason(9, 16); // returns Fall\r\n\t\tseason(11, 30); // returns Fall\r\n\t\tseason(12, 15); // returns Fall\r\n\t\t\r\n\t}", "public String getStringDate(){\n String finalDate = \"\";\n Locale usersLocale = Locale.getDefault();\n DateFormatSymbols dfs = new DateFormatSymbols(usersLocale);\n String weekdays[] = dfs.getWeekdays();\n int day = date.get(Calendar.DAY_OF_WEEK);\n String nameOfDay = weekdays[day];\n\n finalDate += nameOfDay + \" \" + date.get(Calendar.DAY_OF_MONTH) + \", \";\n\n String months[] = dfs.getMonths();\n int month = date.get(Calendar.MONTH);\n String nameOfMonth = months[month];\n\n finalDate += nameOfMonth + \", \" + date.get(Calendar.YEAR);\n\n return finalDate;\n }", "public String getSeason() {\n return season;\n }", "public static String formatDateTimeWithSeason(Calendar calendar) {\n return String.format(\"%2$d%1$ty%1$tm%1$td%1$tH%1$tM%1$tS\", calendar, isUTC(calendar) ? 2 : isSummerTime(calendar) ? 1 : 0);\n }", "public String getBookReturningDate(int possibleDayCount){\n boolean leapYear=false;\n int dayLimit=0;\n int lastDayOfMonth=0;\n String d=\"\";\n String m=\"\";\n String y=\"\";\n String returningDate=\"\";\n if ((year%4==0&&year%100==0)||year%400==0){\n leapYear=true;\n }\n\n switch (month){\n //in the case of february if it's a leap year lastDayOf month will be changed\n case 2:\n if (leapYear==true){\n lastDayOfMonth=29;\n\n }\n else{\n lastDayOfMonth=28;\n }\n break;\n\n case 4: case 6:case 9:case 11:\n lastDayOfMonth=30;\n break;\n\n case 1: case 3: case 5: case 7: case 8: case 10: case 12:\n lastDayOfMonth=31;\n break;\n\n default:returningDate=\"invalid inputs\";\n }\n\n\n dayLimit=lastDayOfMonth-possibleDayCount;\n\n if(day<=dayLimit){\n d=String.valueOf(day+possibleDayCount);\n m=String.valueOf(month);\n y=String.valueOf(year);\n\n }\n\n //if any day exceeding dayLimit, will go to next month with a new day\n else{\n if(month==12) {\n //if it is december month will be 1 and year will be next year\n int newDay = possibleDayCount - (lastDayOfMonth - day);\n d = String.valueOf(newDay);\n m = \"1\";\n y=String.valueOf(year+1);\n }\n else{\n int newDay = possibleDayCount - (lastDayOfMonth - day);\n d = String.valueOf(newDay);\n m = String.valueOf(month + 1);\n y=String.valueOf(year);\n }\n\n }\n\n returningDate=(d+\"/\"+m+\"/\"+y);\n\n return returningDate;\n }", "public static String monthToString(int month){\r\n\r\n if(month == 1) {return \"jan\"}\r\n else if(month == 2) {return \"feb\"}\r\n else if(month == 3) {return \"mar\"}\r\n else if(month == 4) {return \"apl\"}\r\n else if(month == 5) {return \"may\"}\r\n else if(month == 6) {return \"jun\"}\r\n else if(month == 7) {return \"jul\"}\r\n else if(month == 8) {return \"aug\"}\r\n else if(month == 9) {return \"sep\"}\r\n else if(month == 10) {return \"oct\"}\r\n else if(month == 11) {return \"nov\"}\r\n else if (month == 12) {return \"dec\"}\r\n else {}\r\n return \"broken\";\r\n\r\n}", "public static String getFriendlyDayString(Context context, String dateStr) {\n\n // The day string for forecast uses the following logic:\n // For today: \"Today, June 8\"\n // For tomorrow: \"Tomorrow\"\n // For the next 5 days: \"Wednesday\" (just the day name)\n // For all days after that: \"Mon Jun 8\"\n\n Date todayDate = new Date();\n String todayStr = WeatherContract.getDbDateString(todayDate);\n Date inputDate = WeatherContract.getDateFromDb(dateStr);\n\n // If the date we're building the String for is today's date, the format\n // is \"Today, June 24\"\n\n if (todayStr.equals(dateStr)) {\n\n String today = context.getString(R.string.today);\n\n return context.getString(\n R.string.format_full_friendly_date,\n today,\n getFormattedMonthDay(dateStr));\n } else {\n Calendar cal = Calendar.getInstance();\n cal.setTime(todayDate);\n cal.add(Calendar.DATE, 7);\n String weekFutureString = WeatherContract.getDbDateString(cal.getTime());\n\n if (dateStr.compareTo(weekFutureString) < 0) {\n // If the input date is less than a week in the future, just return the day name.\n return getDayName(context, dateStr);\n } else {\n\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd\", Locale.ENGLISH);\n String stringDate = dateFormat.format(inputDate);\n\n if (Locale.getDefault().getLanguage().equals(\"en\")) {\n dateFormat = new SimpleDateFormat(\"MMM dd\", Locale.ENGLISH);\n stringDate = dateFormat.format(inputDate);\n return stringDate;\n }\n\n return currentDate.getdateWithMonthLetters(\n GenerateDates.getyourDate(stringDate));\n\n\n }\n }\n\n }", "static String dayOfProgrammer(int year) {\n\t\tHashMap<Integer, Integer> map = new HashMap<Integer, Integer>();\n\t\tmap.put(1984, 12);\n\t\tmap.put(1783, 13);\n\t\tmap.put(1800, 12);\n\t\tmap.put(1918, 26);\n\t\tmap.put(2400, 12);\n\t\tmap.put(2000, 12);\n\t\tmap.put(2016, 12);\n\t\tmap.put(2017, 13);\n\t\tmap.put(2700, 13);\n\t\tmap.put(2600, 13);\n\t\tmap.put(2100, 13);\n\n\t\tint div = 4;\n\t\tint hundred = 100;\n\t\tint d = 0;\n\n\t\tSystem.out.println(year % div);\n\t\tSystem.out.println(year % hundred);\n\n\t\tString result = \"\";\n\n\t\tif (year > 1918) {\n\n\t\t\tif (year % div == 0 && year % hundred != 0) {\n\t\t\t\td = 12;\n\t\t\t\tresult = \"12.09.\".concat(new Integer(year).toString());\n\t\t\t} else {\n\t\t\t\td = 13;\n\t\t\t\tresult = \"13.09.\".concat(new Integer(year).toString());\n\t\t\t}\n\t\t} else {\n\n\t\t\tif (year <= 1918 && year % div != 0) {\n\t\t\t\td = 26;\n\t\t\t\tresult = \"26.09.\".concat(new Integer(year).toString());\n\t\t\t} else {\n\n\t\t\t\tif (year % div == 0) {\n\t\t\t\t\td = 12;\n\t\t\t\t\tresult = \"12.09.\".concat(new Integer(year).toString());\n\t\t\t\t} else {\n\t\t\t\t\td = 13;\n\t\t\t\t\tresult = \"13.09.\".concat(new Integer(year).toString());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (map.get(year) == d) {\n\t\t\tSystem.out.println(\"SUCCESS\");\n\t\t\tSystem.out.println(\"EXPECTED \" + map.get(year) + \" GOT: \" + d);\n\t\t\tSystem.out.println(\"Year: \" + year + \" = \" + result);\n\t\t} else {\n\t\t\tSystem.out.println(\"ERROR\");\n\t\t\tSystem.out.println(\"EXPECTED \" + map.get(year) + \" GOT: \" + d);\n\t\t\tSystem.out.println(\"Year: \" + year + \" = \" + result);\n\t\t}\n\t\treturn result;\n\t}", "public String GetDate(int semaine, int jour) {\n\t\tCalendar cal = Calendar.getInstance();\n\t\t\n\t\tcal.setWeekDate(2020, semaine, jour);\n\t\tjava.util.Date date = cal.getTime();\n\t\tString day = new SimpleDateFormat(\"dd\").format(date); \n\t\tString month = new SimpleDateFormat(\"MM\").format(date);\n\t\tString resultatString = new String();\n\t\tresultatString = (day + \"/\" +month);\n\t\treturn resultatString;\n\t}", "public String getMonth(String x){\n\n if(x.contains(\"Apr\")){\n return \"April\";\n }\n else if(x.contains(\"Mar\")){\n return \"March\";\n }\n else if(x.contains(\"Jan\")){\n return \"January\";\n }\n else if(x.contains(\"Feb\")){\n return \"February\";\n }\n else if(x.contains(\"May\")){\n return \"May\";\n }\n else if(x.contains(\"Jun\")){\n return \"June\";\n }\n else if(x.contains(\"Jul\")){\n return \"July\";\n }\n else if(x.contains(\"Aug\")){\n return \"August\";\n }\n else if(x.contains(\"Sep\")){\n return \"September\";}\n else if(x.contains(\"Oct\")){\n return \"October\";}\n else if(x.contains(\"Nov\")){\n return \"November\";}\n else{\n return \"December\";}\n }", "public static String getFormattedMonthDay(String dateStr){\n\n Pattern fixDate = Pattern.compile(\"(\\\\d{4})(\\\\d{1,2})(\\\\d{1,2})\");\n Matcher correctDate = fixDate.matcher(dateStr);\n correctDate.find();\n\n String Nowiscorrect = String.format(\"%s/%s/%s\",\n correctDate.group(1),\n correctDate.group(2),\n correctDate.group(3));\n\n String MonthAndDay = currentDate.getdateWithMonthLetters(Nowiscorrect);\n\n\n Pattern rtl_CHARACTERS = Pattern.compile(\"^[۱-۹]+\");\n Matcher findTheYear = rtl_CHARACTERS.matcher(MonthAndDay);\n boolean isDone = findTheYear.find();\n\n return isDone ? findTheYear.replaceAll(\"\") : \"\";\n\n }", "private String formatDate(String date)\n\t{\n\t\tif(date == null || date.isEmpty())\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tString[] dateSplit = date.split(\"/\");\n\t\t\tif(dateSplit.length != 3)\n\t\t\t{\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn getMonthName(dateSplit[0]) + \" \"+ dateSplit[1]+\", \"+ dateSplit[2];\n\t\t\t}\n\t\t}\n\t}", "public static String formatTimeWithSeason(Calendar calendar) {\n return String.format(\"%2$d%1$tH%1$tM%1$tS\", calendar, isUTC(calendar) ? 2 : isSummerTime(calendar) ? 1 : 0);\n }", "@Test public void Month_name_1__day__year__guess()\t\t\t\t{tst_date_(\"02 Mar 01\"\t\t\t\t, \"2001-03-02\");}", "java.lang.String getFoundingDate();", "private static String getDay(int year) {\n if (year == 1918)\n return \"\";\n return \"\";\n }", "public static void main(String[] args) {\n\t\t\n\t\tString month;\n\t\tString season;\n\t\t\n\t\tScanner abdil=new Scanner(System.in);\n\t\tSystem.out.println(\"Please enter the month you born\");\n\t\t\n\t\tmonth=abdil.nextLine();\n\t\t\n\t\t\n\t\tif(month.equals(\"January\")||month.equals(\"February\")||month.equals(\"December\")) {\n\t\t\t\n\t\t\tseason=\"winter\";\n\t\t\n\t\t\n\t\t}else if (month.equals(\"March\")||month.equals(\"April\")||month.equals(\"May\")) {\n\t\t\t\t\n\t\t\t\tseason=\"Spring\";\n\t\n\t\t\t\t\n\t\t}else if (month.equals(\"June\")||month.equals(\"July\")||month.equals(\"August\")) {\n\t\t\t\t\t\n\t\t\t\t\tseason=\"Summer\";\n\t\t\t\t\n\t\t}else if(month.equals(\"September\")||month.equals(\"October\")||month.equals(\"November\")) {\n\t\t\t\n\t\t\tseason=\"fall\";\n\t\t\n\t\t}else {\n\t\t\tseason=\"unknow\";\n\t\t\t\n\t\t}\n\t\t\n\t\tSystem.out.println(\"You were in \" +month);\n\t\tSystem.out.println(season);\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tScanner sc=new Scanner (System.in);\r\n\t\tSystem.out.println(\"Enter month between 1-12\");\r\n\t\tString month=sc.nextLine();\r\n\t\tScanner sc1=new Scanner (System.in);\r\n\t\tSystem.out.println(\"Enter year between\");\r\n\t\tString year=sc1.nextLine();\r\n\t\tswitch(month)\r\n\t\t{\r\n\t\tcase \"1\":\r\n\t\t\tSystem.out.println(\"jan\" + year +\" has 30 days\");\r\n\t\t\r\n case \"2\":\r\n\t\t\tSystem.out.println(\"feb\" + year +\" has 28 days\");\r\n\r\n\t\tcase \"3\":\r\n\t\t\tSystem.out.println(\"march\" + year +\" has 31 days\");\r\n\r\n\t\tcase \"4\":\r\n\t\t\tSystem.out.println(\"April \" + year +\" has 30 days\");\r\n\r\n\r\n\t\tcase \"5\":\r\n\t\t\tSystem.out.println(\"may\" + month + year +\" has 31 days\");\r\n break;\r\n\r\n\t\tcase \"6\":\r\n\t\t\tSystem.out.println(\"june \" + year + \" has 30 days\");\r\n\t\t\tbreak;\r\n\r\n\r\n\t\tcase \"7\":\r\n\t\t\tSystem.out.println(\"jully\" + year +\" has 31 days\");\r\n\t\t\tbreak;\r\n\r\n\r\n\r\n\t\tcase \"8\":\r\n\t\t\tSystem.out.println(\"aug\" + year +\" has 31 days\");\r\n\t\t\tbreak;\r\n\r\n\r\n\r\n\t\tcase \"9\":\r\n\t\t\tSystem.out.println(\"sept\" + year +\" 30 days\");\r\n\t\t\tbreak;\r\n\r\n\r\n\r\n\t\tcase \"10\":\r\n\t\t\tSystem.out.println(\"oct\" + year +\"31 days\");\r\n\t\t\tbreak;\r\n\r\n\r\n\r\n\t\tcase \"11\":\r\n\t\t\tSystem.out.println(\"nov\" + year +\" has 30 days\");\r\n\t\t\tbreak;\r\n\r\n\r\n\r\n\t\tcase \"12\":\r\n\t\t\tSystem.out.println(\"dec\" + year +\" has 31 days\");\r\n\t\t\tbreak;\r\n\r\n\r\n\r\n\t\t\r\n\r\n\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\t}\r\n\r\n\r\n\r\n\t\t\r\n\r\n\t}", "public static String formatDateTimeShortWithSeason(Calendar calendar) {\n return String.format(\"%2$d%1$ty%1$tm%1$td%1$tH%1$tM\", calendar, isUTC(calendar) ? 2 : isSummerTime(calendar) ? 1 : 0);\n }", "public static Map<String, String> getSeasonInfoList(){\n\t\tMap<String, String> rs = new LinkedHashMap<String, String>();\n\t\trs.put(\"-1\", \"---please select---\");\n\t\trs.put(\"SP\", \"Spring\");\n\t\trs.put(\"SU\", \"Summer\");\n\t\trs.put(\"AU\", \"Autumn\");\n\t\trs.put(\"WI\", \"Winter\");\n\t\t\n\t\treturn rs;\n\t}", "java.lang.String getDatesEmployedText();", "private String getDateText(LocalDateTime currentTime, LocalDateTime dateTime) {\n if (isYesterday(currentTime, dateTime)) {\n return WORD_YESTERDAY;\n } else if (isTonight(currentTime, dateTime)) {\n return WORD_TONIGHT;\n } else if (isToday(currentTime, dateTime)) {\n return WORD_TODAY;\n } else if (isTomorrow(currentTime, dateTime)) {\n return WORD_TOMORROW;\n } else if (isSameYear(currentTime, dateTime)) {\n return dateTime.format(DateTimeFormatter.ofPattern(FORMAT_DATE_NO_YEAR));\n } else {\n return dateTime.format(DateTimeFormatter.ofPattern(FORMAT_DATE_WITH_YEAR));\n }\n }", "private static String getDate() {\n Scanner input = new Scanner(System.in);\n\n String monthName = input.next();\n int month = monthNum(monthName);\n int day = input.nextInt();\n String date = \"'2010-\" + month + \"-\" + day + \"'\";\n return date;\n }", "public static String englishStringOf(LocalDate date) {\n String[] dateStrings = date.toString().split(\"-\");\n String dateString = dateStrings[1] + \"/\" + dateStrings[2] + \"/\" + dateStrings[0];\n return dateString;\n }", "String formatDateCondition(Date date);", "@Override\r\n\tpublic String getDailyStudy() {\n\t\treturn \"Practice Expilliarmus and Work on the patronus charm\";\r\n\t}", "public String getDate(){\n String d=\"\";\n String m=\"\";\n if(day<10){\n d=0+(String.valueOf(day));\n }\n else{\n d=String.valueOf(day);\n }\n\n if(month<10){\n m=0+(String.valueOf(month));\n }\n else{\n m=String.valueOf(month);\n }\n //returning day/month/year\n return (d+\"/\"+m+\"/\"+String.valueOf(year));\n }", "static String solve(int year){\n int beforeYear=1919, specialYear=1918, specialDay=28, sumDay=0, programmerDay=256;\n boolean leapYear=false;\n String result = null;\n if (year < beforeYear) {\n leapYear = year%4 == 0 ? true:false;\n } else {\n leapYear = (year%400 == 0 || (year%4 == 0 && year%100 != 0)) ? true : false;\n }\n for(int i=1; i < 13; i++) {\n int temp = i;\n\n if ((temp&=0x1) == 1 || i==8) {\n sumDay = sumDay + 31;\n } else {\n if (i == 2) {\n if (year == specialYear) {\n sumDay = sumDay + 15;\n } else {\n sumDay = sumDay + (leapYear ? specialDay + 1 : specialDay);\n }\n } else {\n sumDay = sumDay + 30;\n }\n }\n if ((programmerDay - sumDay) <= 30) {\n\n result = (programmerDay - sumDay) +\".\" + \"0\" + (i+1) + \".\"+ year;\n\n// try {\n// Date date = targetFmt.parse(temp1);\n//\n// return targetFmt2.parse(String.valueOf(date)).toString();\n// } catch (ParseException e) {\n// e.printStackTrace();\n// }\n return result;\n }\n }\n return result;\n }", "boolean checkSemester (String semester){\r\n // If the semester is either spring or summer or winter, then return true\r\n if (semester.equalsIgnoreCase(\"spring\") \r\n || semester.equalsIgnoreCase(\"summer\") \r\n || semester.equalsIgnoreCase(\"winter\"))\r\n return true;\r\n // Else if it is not, return false\r\n else return false;\r\n \r\n }", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"Month of born\");\n\t\tString month = scan.nextLine();\n\t\t\n\t\tString season;\n\t\t\n\t\tif (month.equals(\"January\") || month.equals(\"February\") || month.equals(\"December\")){\n\t\t\tseason=\"Winter\";\n\t\t\t\n\t\t}else if(month.equals(\"March\") || month.equals(\"April\") || month.equals(\"May\")){\n\t\t\tseason=\"Spring\";\n\t\t\n\t\t}else if(month.equals(\"Jun\") || month.equals(\"July\") || month.equals(\"August\")){\n\t\t\t\tseason=\"Summer\";\n\t\t}else if(month.equals(\"September\") || month.equals(\"October\") || month.equals(\"November\")){\n\t\t\tseason=\"fall\";\n\t\t\n\t\t}else {\n\t\t\tseason=\"unknown\"\n\t\t}\n\t\t\n\t\t\tSystem.out.println(\"You were born in \" + season);\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public static String FormatDate(int day, int month, int year) {\r\n String jour = Integer.toString(day);\r\n String mois = Integer.toString(month + 1);\r\n if (jour.length() == 1) {\r\n jour = \"0\" + jour;\r\n }\r\n\r\n if (mois.length() == 1) {\r\n mois = \"0\" + mois;\r\n }\r\n return jour + \"/\" + mois + \"/\" + Integer.toString(year);\r\n }", "public static String formatTimeShortWithSeason(Calendar calendar) {\n return String.format(\"%2$d%1$tH%1$tM\", calendar, isUTC(calendar) ? 2 : isSummerTime(calendar) ? 1 : 0);\n }", "public static void main (String[] args) {\n String day = \"Wednesday\";\n int date = 17;\n String month = \"February\";\n int year = 1999;\n\n System.out.println (\"American format:\");\n System.out.println (day + \", \" + month + \" \" + date + \", \" + year);\n\n System.out.println (\"European format:\");\n System.out.println (day + \" \" + date + \" \" + month + \", \" + year);\n }", "public static String getTaskScheduleMonths(long taskScheduleMonts){\r\n\t\tString\ttaskScheduleMontsSt = \"\";\r\n\t\ttaskScheduleMontsSt = \"\";\r\n\t\tif(taskScheduleMonts == -1 || ((taskScheduleMonts & MONTH_OF_YEAR.EVERY_MONTH.getMont()) == MONTH_OF_YEAR.EVERY_MONTH.getMont())) taskScheduleMontsSt+=\" EVERY_MONTH\";\r\n\t\telse{\r\n\t\t\tif((taskScheduleMonts & MONTH_OF_YEAR.JANUARY.getMont()) != 0) taskScheduleMontsSt+=\" JANUARY\";\r\n\t\t if((taskScheduleMonts & MONTH_OF_YEAR.FEBRUARY.getMont()) != 0) taskScheduleMontsSt+=\" FEBRUARY\";\r\n\t\t\tif((taskScheduleMonts & MONTH_OF_YEAR.MARCH.getMont()) != 0) taskScheduleMontsSt+=\" MARCH\";\r\n\t\t\tif((taskScheduleMonts & MONTH_OF_YEAR.APRIL.getMont()) != 0) taskScheduleMontsSt+=\" APRIL\";\r\n\t\t\tif((taskScheduleMonts & MONTH_OF_YEAR.MAY.getMont()) != 0) taskScheduleMontsSt+=\" MAY\";\r\n\t\t\tif((taskScheduleMonts & MONTH_OF_YEAR.JUNE.getMont()) != 0) taskScheduleMontsSt+=\" JUNE\";\r\n\t\t\tif((taskScheduleMonts & MONTH_OF_YEAR.JULY.getMont()) != 0) taskScheduleMontsSt+=\" JULY\";\r\n\t\t\tif((taskScheduleMonts & MONTH_OF_YEAR.AUGUST.getMont()) != 0) taskScheduleMontsSt+=\" AUGUST\";\r\n\t\t\tif((taskScheduleMonts & MONTH_OF_YEAR.SEPTEMBER.getMont()) != 0) taskScheduleMontsSt+=\" SEPTEMBER\";\r\n\t\t\tif((taskScheduleMonts & MONTH_OF_YEAR.OCTOBER.getMont()) != 0) taskScheduleMontsSt+=\" OCTOBER\";\r\n\t\t\tif((taskScheduleMonts & MONTH_OF_YEAR.NOVEMBER.getMont()) != 0) taskScheduleMontsSt+=\" NOVEMBER\";\r\n\t\t\tif((taskScheduleMonts & MONTH_OF_YEAR.DECEMBER.getMont()) != 0) taskScheduleMontsSt+=\" DECEMBER\";\r\n\t\t}\r\n\t\treturn taskScheduleMontsSt;\r\n\t}", "public static void main(String[] args) {\n int currentSeason = 0;\n\n switch (currentSeason) {\n case 1: // ga wandelen in de natuur\n System.out.println(\"Lente!\");\n break;\n case 2: // ga liggen op het strand\n System.out.println(\"Zomer!\");\n break;\n case 3: // ga steden bezoeken\n System.out.println(\"Herfst!\");\n break;\n default: // het is winter, ga op wintersport\n System.out.println(\"Winter!\");\n break;\n }\n\n // what if currentSeason is 6, we only have 4 seasons: We make an if statement around the switch statement.\n // we have additional conditions: if anotherSeason is greater than or equal to 0 AND less than 5, then you may execute the switch statement\n int anotherSeason = 3;\n\n if (anotherSeason >= 0 && anotherSeason < 5) {\n switch (anotherSeason) {\n case 1: // ga wandelen in de natuur\n System.out.println(\"Lente!\");\n break;\n case 2: // ga liggen op het strand\n System.out.println(\"Zomer!\");\n break;\n case 3: // ga steden bezoeken\n System.out.println(\"Herfst!\");\n break;\n default: // het is winter, ga op wintersport\n System.out.println(\"Winter!\");\n break;\n }\n }\n\n // switch statement switchValue\n // don't forget the break!\n int switchValue = 3;\n\n switch (switchValue) {\n case 1:\n System.out.println(\"Value was 1\");\n break;\n case 2:\n System.out.println(\"Value was 2\");\n break;\n case 3:\n case 4:\n case 5:\n System.out.println(\"Value was a 3, or a 4, or a 5\");\n System.out.println(\"Actually it was a \" + switchValue);\n break;\n default:\n System.out.println(\"Was not 1, 2, 3, 4 or 5\");\n break;\n }\n\n // switch statement toUppercase()\n String month = \"JuNE\";\n\n switch (month.toUpperCase()) {\n case \"JANUARY\":\n System.out.println(\"January\");\n break;\n case \"JUNE\":\n System.out.println(\"June\");\n break;\n default:\n System.out.println(\"Not sure\");\n }\n }", "void getSearchSeasonData();", "public static void main (String[] args) {\n\t\t\n\t\tString month;\n\t\tScanner scanner= new Scanner(System.in);\n\t\tSystem.out.println(\"Month of born\");\n\t\tmonth = scanner.nextLine();\n\t\tscanner.close();\n\t\tString season;\n\t\t\n\t\tif (month.equals(\"January\") || month.equals(\"February\") || month.equals(\"December\")) {\n\t\t\tseason = \"Winter\";\n\t\t} else if (month.equals(\"March\") || month.equals(\"April\") || month.equals(\"May\")) {\n\t\t\tseason = \"Spring\";\n\t\t} else if (month.equals(\"June\") || month.equals(\"July\") || month.equals(\"August\")) {\n\t\t\tseason = \"Summer\";\n\t\t} else if (month.equals(\"September\") || month.equals(\"October\") || month.equals(\"November\")) {\n\t\t\tseason = \"Fall\";\n\t\t} else\n\t\t\tseason = (\"Unknown\");\n\t\t\n\t\tSystem.out.println(\"You were born in \"+season);\n\t\t}", "public String dayOfWeek()\n {\n\n int m;\n int y;\n\n if (month == 1)\n {\n m = 13;\n y = year - 1;\n }\n else if (month == 2)\n {\n m = 14;\n y = year - 1;\n }\n else\n {\n m = month;\n y = year;\n }\n int k = y % 100;\n int j = y / 100;\n int a = 13 * (m + 1);\n\n if ((day + a / 5 + k + k / 4 + j / 4 + 5 * j) % 7 == 0)\n return \"Saturday\";\n else if ((day + a / 5 + k + k / 4 + j / 4 + 5 * j) % 7 == 1)\n return \"Sunday\";\n else if ((day + a / 5 + k + k / 4 + j / 4 + 5 * j) % 7 == 2)\n return \"Monday\";\n else if ((day + a / 5 + k + k / 4 + j / 4 + 5 * j) % 7 == 3)\n return \"Tuesday\";\n else if ((day + a / 5 + k + k / 4 + j / 4 + 5 * j) % 7 == 4)\n return \"Wednesday\";\n else if ((day + a / 5 + k + k / 4 + j / 4 + 5 * j) % 7 == 5)\n return \"Thursday\";\n else if ((day + a / 5 + k + k / 4 + j / 4 + 5 * j) % 7 == 6)\n return \"Friday\";\n else\n return \"ERROR\";\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tint []month_Days={31,28 ,31,30,31,30,31,31,30,31,30,31};\r\n\t\t\r\n\t\t System.out.println(\"enter the year month date\");\r\n\t\t Scanner scan=new Scanner(System.in);\r\n\t\t int year=scan.nextInt();\r\n\t\t int month1=scan.nextInt();\r\n\t\t int date1=scan.nextInt();\r\n\t\t \r\n\t\t int new_year=year%400;\r\n\t\t int odd_days=(new_year/100)*5;\r\n\t\t new_year=(new_year-1)%100;\r\n\t\t int normal_year=new_year-new_year/4;\r\n\t\t odd_days=odd_days+(new_year/4)*2+normal_year;\r\n\t\t odd_days=odd_days%7;\r\n\t\t \r\n\t\t \r\n\t\t int sum_of_days=0;\r\n\t\t for(int i=0;i<(month1-1);i++){\r\n\t\t \tsum_of_days=sum_of_days+month_Days[i];\r\n\t\t }\r\n\t\t if(year%4==0&&year%100!=0||year%400==0&&month1>2){\r\n\t\t \tsum_of_days=sum_of_days+1;\r\n\t\t }\r\n\t\t sum_of_days=sum_of_days+date1;\r\n\t\t odd_days=(odd_days+sum_of_days%7)%7;\r\n\t\t String day=\"\";\r\n\t\t switch(odd_days){\r\n\t\t case 0:\r\n\t\t\t day=\"Sunday\";\r\n\t\t\t break;\r\n\t\t case 1:\r\n\t\t\t day=\"Monday\";\r\n\t\t\t break;\r\n\t\t case 2:\r\n\t\t\t day=\"Tuesday\";\r\n\t\t\t break;\r\n\t\t\t \r\n\t\t case 3:\r\n\t\t\t day=\"WednesDay\";\r\n\t\t\t break;\r\n\t\t case 4:\r\n\t\t\t day=\"Thursday\";\r\n\t\t\t break;\r\n\t\t case 5:\r\n\t\t\t day=\"Friday\";\r\n\t\t\t break;\r\n\t\t case 6:\r\n\t\t\t day=\"Saturday\";\r\n\t\t\t break;\r\n\t\t \r\n\t\t }\r\n\t\t System.out.println(day);\r\n\t}", "String getDayOfMonthSuffix(final int n) {\n if (n >= 11 && n <= 13) {\n return \"th\";\n }\n switch (n % 10) {\n case 1:\n return \"st\";\n case 2:\n return \"nd\";\n case 3:\n return \"rd\";\n default:\n return \"th\";\n }\n }", "@Test public void Year_2__month__day()\t\t\t\t\t\t\t{tst_date_(\"03/31/2001\"\t\t\t\t, \"2001-03-31\");}", "public String getSeasonName() {\n return seasonName;\n }", "public String[] getDayMonth(String webinarDate) {\r\n\t\tString[] webinarDateDetails = new String[2];\r\n\t\t\r\n\t\tString pattern = \"(^[A-Z][a-z][a-z])(,\\\\s)([A-Z][a-z][a-z])(\\\\s)([0-9]+)\";\r\n\t\t// Create a Pattern object\r\n\t\tPattern r = Pattern.compile(pattern);\r\n\t\t// Now create matcher object.\r\n\t\tMatcher m = r.matcher(webinarDate);\r\n\t\twhile (m.find()) {\r\n\t\t\twebinarDateDetails[0] = m.group(3);\r\n\t\t\twebinarDateDetails[1] = m.group(5);\r\n\t\t}\r\n\t\treturn webinarDateDetails;\r\n\t}", "public static void main(String[] args) {\n\t\tint month = 1;\r\n\t\t\r\n\t\tif (month == 1) \t// if (condition) statement;\r\n\t\t\tSystem.out.println(\"Jan\");\r\n\t\telse\r\n\t\tif (month == 2) \t// if (condition) statement;\r\n\t\t\tSystem.out.println(\"Feb\");\r\n\t\telse\r\n\t\tif (month == 3) \t// if (condition) statement;\r\n\t\t\tSystem.out.println(\"Mar\");\r\n\t\telse\r\n\t\tif (month == 4) \t// if (condition) statement;\r\n\t\t\tSystem.out.println(\"Apr\");\r\n\t\telse\r\n\t\tif (month == 5) \t// if (condition) statement;\r\n\t\t\tSystem.out.println(\"May\");\r\n\t\telse\r\n\t\tif (month == 6) \t// if (condition) statement;\r\n\t\t\tSystem.out.println(\"Jun\");\r\n\t\telse\r\n\t\tif (month == 7) \t// if (condition) statement;\r\n\t\t\tSystem.out.println(\"Jul\");\r\n\t\telse\r\n\t\tif (month == 8) \t// if (condition) statement;\r\n\t\t\tSystem.out.println(\"Aug\");\r\n\t\telse\r\n\t\tif (month == 9) \t// if (condition) statement;\r\n\t\t\tSystem.out.println(\"Sep\");\r\n\t\telse\r\n\t\tif (month == 10) \t// if (condition) statement;\r\n\t\t\tSystem.out.println(\"Oct\");\r\n\t\telse\r\n\t\tif (month == 11) \t// if (condition) statement;\r\n\t\t\tSystem.out.println(\"Nov\");\r\n\t\telse\r\n\t\tif (month == 12) \t// if (condition) statement;\r\n\t\t\tSystem.out.println(\"Dec\");\r\n\t\t\r\n\t\tboolean IsHappy = true;\r\n\t\t\r\n\t\tif(IsHappy == true)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Let's go to movie\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Let's have a drink!\");\r\n\t\t}\r\n\t\t\r\n\t\tint day = 1; //1 - Monday , 7 - Sunday;\r\n\t\tif(day == 6) // Saturday\r\n\t\t\tSystem.out.println(\"Learn Java programing!\");\r\n\t\telse\r\n\t\tif(day == 7) // Sunday\r\n\t\t\tSystem.out.println(\"Learn ReactJS!\");\r\n\t\telse\r\n\t\t\tSystem.out.println(\"Do daily home execercies!\");\r\n}", "public static String getDateSuffix(int date)\r\n\t{\r\n\t\tswitch(date)\r\n\t\t{\r\n\t\tcase 1:\r\n\t\tcase 21:\r\n\t\tcase 31:\r\n\t\t\treturn \"st\";\r\n\t\tcase 2:\r\n\t\tcase 22:\r\n\t\t\treturn \"nd\";\r\n\t\tcase 3:\r\n\t\tcase 23:\r\n\t\t\treturn \"rd\";\r\n\t\t}\r\n\t\treturn \"th\"; //if none of the above\r\n\t\t\t\t\t\r\n\t}", "public static String dateStr(String input ){\n String mm = input.substring(0,2);\n String dd = input.substring(3,5);\n String yyyy = input.substring(6,10);\n return dd + \" - \" + mm + \" - \" + yyyy;\n }", "@Test\n\tpublic void testPrintingDayName() throws Exception {\n\t DateTime oneSunnyWednesday = new DateTime(2014, 10, 15, 0, 0);\n\t DateTimeFormatter format = DateTimeFormat.forPattern(\"EEEE d/M/y\");\n\t String dayNameAndDate = format.print(oneSunnyWednesday);\n\t \n\t assertEquals(\"Wednesday 15/10/2014\", dayNameAndDate);\n\t}", "private String getDate(int year, int month, int day) {\n return new StringBuilder().append(month).append(\"/\")\n .append(day).append(\"/\").append(year).toString();\n }", "public String format (Date date , String dateFormat) ;", "@Override\t\r\n\tpublic String getDailyWorkout() {\n\t\treturn \"practice 30 hrs daily\";\r\n\t}", "private String dayName() {\n int arrayDay = (day + month + year + (year/4) + (year/100) % 4) % 7;\n return dayName[arrayDay];\n }", "java.lang.String getStartDateYYYYMMDD();", "@Test\n public void test_getMonth_by_full_string() throws AppException {\n assertEquals(getMonth(\"January\"),1);\n assertEquals(getMonth(\"October\"),10);\n assertEquals(getMonth(\"SePtember\"),9);\n assertEquals(getMonth(\"february\"),2);\n }", "String getDayofservice();", "public static void main(String[] args) {\n\t\tString season = \"falltime\";\r\n\t\tswitch(season) {\r\n\t\t\r\n\t\tcase \"springtime\":\r\n\t\t\tSystem.out.println(\"springtime\");\r\n\t\t\tbreak;\r\n\t\tcase \"summertime\":\r\n\t\t\tSystem.out.println(\"summertime\");\r\n\t\t\tbreak;\r\n\t\tcase \"falltime\":\r\n\t\t\tSystem.out.println(\"falltime\");\r\n\t\t\tbreak;\r\n\t\tcase \"wintertime\":\r\n\t\t\tSystem.out.println(\"wintertime\");\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\t\tSystem.out.println(\"no\");\r\n\t\t\t\t\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n Scanner myScanner;\n myScanner = new Scanner(System.in);\n \n // prompt the user to enter the course number\n System.out.print (\"Enter a six digit number giving the course semester- \");\n int coursenumber = myScanner.nextInt();\n int year = (int) (coursenumber / 100);\n int semester = coursenumber - year * 100;\n \n // start of if (year is within rage)\n if (year >= 1865 && year <= 2014) {\n \n // start of if (semester is legitimate)\n if (semester == 10 || semester == 20 || semester == 30 || semester == 40) {\n \n // start of if (spring semester)\n if (semester == 10) {\n System.out.println (\"The course was offered in the Spring semester of \" + year);\n } // end of if (spring semester)\n \n // start of else if (summer 1 semester)\n else if (semester == 20) {\n System.out.println (\"The course was offered in Summer 1 semester of \" + year);\n } // end of else if (summer 1 semester)\n \n // start of if (summer 2 semester)\n else if (semester == 30) {\n System.out.println (\"The course was offered in the Summer 2 semester of \" + year);\n } // end of else if (summer 2 semester)\n \n // start of else (fall semester)\n else {\n System.out.println (\"The course was offered in the Fall semester of \" + year);\n } // end of else (Fall semester)\n \n } // end of if (semester is legitimate)\n \n // start of else (semester is not legitimate)\n else {\n System.out.println (semester + \" is not a legitimate semester\");\n return;\n } // end of else (semester is not legitimate)\n\n } // end of if (year is within rage)\n \n // start of else (year is outside the range)\n else {\n System.out.println (\"The number was outside the range [186510,201440]\");\n } // end of else (year is outside the range)\n \n }", "Season(String months)\n {\n span = months;\n }", "@Test public void Month_name_1__day__year()\t\t\t\t\t{tst_date_(\"2 Mar 2001\"\t\t\t\t, \"2001-03-02\");}", "public static String frenchStringOf(LocalDate date) {\n String[] dateStrings = date.toString().split(\"-\");\n String dateString = dateStrings[2] + \"/\" + dateStrings[1] + \"/\" + dateStrings[0];\n return dateString;\n }", "public static String getDayName(Context context, String dateStr) {\n SimpleDateFormat dbDateFormat = new SimpleDateFormat(Utility.DATE_FORMAT,Locale.ENGLISH);\n try {\n Date inputDate = dbDateFormat.parse(dateStr);\n Date todayDate = new Date();\n\n // If the date is today, return the localized version of \"Today\" instead of the actual\n // day name.\n\n if (WeatherContract.getDbDateString(todayDate).equals(dateStr)) {\n return context.getString(R.string.today);\n } else {\n // If the date is set for tomorrow, the format is \"Tomorrow\".\n Calendar cal = Calendar.getInstance();\n cal.setTime(todayDate);\n cal.add(Calendar.DATE, 1);\n Date tomorrowDate = cal.getTime();\n if (WeatherContract.getDbDateString(tomorrowDate).equals(\n dateStr)) {\n return context.getString(R.string.tomorrow);\n } else {\n // Otherwise, the format is just the day of the week (e.g \"Wednesday\".\n SimpleDateFormat dayFormat = new SimpleDateFormat(\"EEEE\",Locale.ENGLISH);\n return dayFormat.format(inputDate);\n }\n }\n } catch (ParseException e) {\n Log.e(Utility.class.getSimpleName(),\n \"Date invalid exception ! \", e);\n // Couldn't process the date correctly.\n return dateStr;\n }\n }", "@Test public void Month_name_1__year__day()\t\t\t\t\t{tst_date_(\"2001 Mar 02\"\t\t\t, \"2001-03-02\");}", "public String displayEaster(){\n\n if (month == 3){\n Month = \"März\";\n }\n if (month == 4){\n Month = \"April\";\n }\n\n System.out.printf(\"\\nEaster:%s %d, %d \",Month,day,year);\n return String.format(\"Easter: %d. %s %d\",day, Month, year);\n }", "public static String getDateString(int year, int month, int day_of_month) {\r\n String dateString;\r\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\r\n dateString = LocalDate.of(year, month, day_of_month).toString();\r\n } else {\r\n Calendar calendar = Calendar.getInstance();\r\n calendar.set(year, month + 1, day_of_month);\r\n dateString = DATE_FORMATTER_ISO_8601.format(calendar.getTime());\r\n }\r\n return dateString;\r\n }", "private String formatDate(String dateString) {\n DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(\"LLL dd, yyyy\");\n LocalDate localDate = LocalDate.parse(dateString.substring(0, 10));\n return dateTimeFormatter.format(localDate);\n }", "protected void guessDateFormat(String dateStr) {\n if (log4j.isDebugEnabled()) {log4j.debug(BaseMessages.getString(PKG, \"MVSFileParser.DEBUG.Guess.Date\"));} //$NON-NLS-1$\n String[] dateSplit = dateStr.split(\"/\"); //$NON-NLS-1$\n String yrFmt = null;\n int yrPos = -1;\n int dayPos = -1;\n // quick look for either yyyy/xx/xx or xx/xx/yyyy\n for (int i=0; i<dateSplit.length; i++) {\n int aDigit = Integer.parseInt(dateSplit[i]); \n if (dateSplit[i].length() == 4) {\n yrFmt = \"yyyy\"; //$NON-NLS-1$\n yrPos = i;\n } else if (aDigit>31) {\n // found 2-digit year\n yrFmt = \"yy\"; //$NON-NLS-1$\n yrPos = i;\n } else if (aDigit > 12) {\n // definitely found a # <=31,\n dayPos = i;\n }\n }\n if (yrFmt != null) {\n StringBuffer fmt = new StringBuffer();\n if (dayPos >=0) {\n // OK, we know everything.\n String[] tmp = new String[3];\n tmp[yrPos] = yrFmt;\n tmp[dayPos] = \"dd\"; //$NON-NLS-1$\n for (int i=0; i<tmp.length; i++) {\n fmt.append(i>0?\"/\":\"\"); //$NON-NLS-1$ //$NON-NLS-2$\n fmt.append(tmp[i] == null ? \"MM\":tmp[i]); //$NON-NLS-1$\n }\n if (log4j.isDebugEnabled()) {log4j.debug(BaseMessages.getString(PKG, \"MVSFileParser.DEBUG.Guess.Date.Obvious\"));} //$NON-NLS-1$\n } else {\n // OK, we have something like 2010/01/01 - I can't\n // tell month from day. So, we'll guess. If it doesn't work on a later\n // date, we'll flip it (the alternate).\n \n StringBuffer altFmt = new StringBuffer();\n if (yrPos == 0) {\n fmt.append(yrFmt).append(\"/MM/dd\"); //$NON-NLS-1$\n altFmt.append(yrFmt).append(\"/dd/MM\"); //$NON-NLS-1$\n } else {\n fmt.append(\"MM/dd/\").append(yrFmt); //$NON-NLS-1$\n altFmt.append(\"dd/MM/\").append(yrFmt); //$NON-NLS-1$\n }\n this.alternateFormatString = altFmt.toString();\n if (log4j.isDebugEnabled()) {log4j.debug(BaseMessages.getString(PKG, \"MVSFileParser.DEBUG.Guess.Date.Ambiguous\"));} //$NON-NLS-1$\n }\n this.dateFormatString = fmt.toString();\n this.dateFormat = new SimpleDateFormat(dateFormatString);\n if (log4j.isDebugEnabled()) {log4j.debug(BaseMessages.getString(PKG, \"MVSFileParser.DEBUG.Guess.Date.Decided\", this.dateFormatString));} //$NON-NLS-1$\n try {\n dateFormat.parse(dateStr);\n } catch (ParseException ex) {\n if (log4j.isDebugEnabled()) {log4j.debug(BaseMessages.getString(PKG, \"MVSFileParser.DEBUG.Guess.Date.Unparsable\", dateStr));} //$NON-NLS-1$\n }\n } else {\n // looks ilke something like 01/02/05 - where's the year?\n if (log4j.isDebugEnabled()) {log4j.debug(BaseMessages.getString(PKG, \"MVSFileParser.DEBUG.Guess.Date.Year.Ambiguous\"));} //$NON-NLS-1$\n return;\n }\n \n }", "public static String getDate(String year, String month) {\n\t\treturn \"t.posted = \\\"\" + year + \"-\" + month + \"-01 00:00:00\\\" or\\r\\n\" + \n\t\t\t\t\"t.posted = \\\"\" + year + \"-\" + month + \"-02 00:00:00\\\" or\\r\\n\" + \n\t\t\t\t\"t.posted = \\\"\" + year + \"-\" + month + \"-03 00:00:00\\\" or\\r\\n\" + \n\t\t\t\t\"t.posted = \\\"\" + year + \"-\" + month + \"-04 00:00:00\\\" or\\r\\n\" + \n\t\t\t\t\"t.posted = \\\"\" + year + \"-\" + month + \"-05 00:00:00\\\" or\\r\\n\" + \n\t\t\t\t\"t.posted = \\\"\" + year + \"-\" + month + \"-06 00:00:00\\\" or\\r\\n\" + \n\t\t\t\t\"t.posted = \\\"\" + year + \"-\" + month + \"-07 00:00:00\\\" or\\r\\n\" + \n\t\t\t\t\"t.posted = \\\"\" + year + \"-\" + month + \"-08 00:00:00\\\" or\\r\\n\" + \n\t\t\t\t\"t.posted = \\\"\" + year + \"-\" + month + \"-09 00:00:00\\\" or\\r\\n\" + \n\t\t\t\t\"t.posted = \\\"\" + year + \"-\" + month + \"-10 00:00:00\\\" or\\r\\n\" + \n\t\t\t\t\"t.posted = \\\"\" + year + \"-\" + month + \"-11 00:00:00\\\" or\\r\\n\" + \n\t\t\t\t\"t.posted = \\\"\" + year + \"-\" + month + \"-12 00:00:00\\\" or\\r\\n\" + \n\t\t\t\t\"t.posted = \\\"\" + year + \"-\" + month + \"-13 00:00:00\\\" or\\r\\n\" + \n\t\t\t\t\"t.posted = \\\"\" + year + \"-\" + month + \"-14 00:00:00\\\" or\\r\\n\" + \n\t\t\t\t\"t.posted = \\\"\" + year + \"-\" + month + \"-15 00:00:00\\\" or\\r\\n\" + \n\t\t\t\t\"t.posted = \\\"\" + year + \"-\" + month + \"-16 00:00:00\\\" or\\r\\n\" + \n\t\t\t\t\"t.posted = \\\"\" + year + \"-\" + month + \"-17 00:00:00\\\" or\\r\\n\" + \n\t\t\t\t\"t.posted = \\\"\" + year + \"-\" + month + \"-18 00:00:00\\\" or\\r\\n\" + \n\t\t\t\t\"t.posted = \\\"\" + year + \"-\" + month + \"-19 00:00:00\\\" or\\r\\n\" + \n\t\t\t\t\"t.posted = \\\"\" + year + \"-\" + month + \"-20 00:00:00\\\" or\\r\\n\" + \n\t\t\t\t\"t.posted = \\\"\" + year + \"-\" + month + \"-21 00:00:00\\\" or\\r\\n\" + \n\t\t\t\t\"t.posted = \\\"\" + year + \"-\" + month + \"-22 00:00:00\\\" or\\r\\n\" + \n\t\t\t\t\"t.posted = \\\"\" + year + \"-\" + month + \"-23 00:00:00\\\" or\\r\\n\" + \n\t\t\t\t\"t.posted = \\\"\" + year + \"-\" + month + \"-24 00:00:00\\\" or\\r\\n\" + \n\t\t\t\t\"t.posted = \\\"\" + year + \"-\" + month + \"-25 00:00:00\\\" or\\r\\n\" + \n\t\t\t\t\"t.posted = \\\"\" + year + \"-\" + month + \"-26 00:00:00\\\" or\\r\\n\" + \n\t\t\t\t\"t.posted = \\\"\" + year + \"-\" + month + \"-27 00:00:00\\\" or\\r\\n\" + \n\t\t\t\t\"t.posted = \\\"\" + year + \"-\" + month + \"-28 00:00:00\\\" or\\r\\n\" + \n\t\t\t\t\"t.posted = \\\"\" + year + \"-\" + month + \"-29 00:00:00\\\" or\\r\\n\" + \n\t\t\t\t\"t.posted = \\\"\" + year + \"-\" + month + \"-30 00:00:00\\\" or\\r\\n\" + \n\t\t\t\t\"t.posted = \\\"\" + year + \"-\" + month + \"-31 00:00:00\\\" \\r\\n\";\n\t}", "public abstract String reportLeapYear(int year);", "@Test\n void generateBalanceSheetHeadingWithLocalDate() {\n assertEquals(\"2017\",\n datesHelper.generateBalanceSheetHeading(LocalDate.parse(\"2016-01-01\"), LocalDate.parse(\"2017-01-14\"), false));\n\n // Test 381 days shows month (more than 12 month period)\n assertEquals(\"13 months to 16 February 2016\",\n datesHelper.generateBalanceSheetHeading(LocalDate.parse(\"2015-02-01\"), LocalDate.parse(\"2016-02-16\"), false));\n\n // Test 349 days shows month (less than 12 month period)\n assertEquals(\"11 months to 1 January 2017\",\n datesHelper.generateBalanceSheetHeading(LocalDate.parse(\"2016-01-19\"), LocalDate.parse(\"2017-01-01\"), false));\n\n // Test exactly 381 days shows months leap year\n assertEquals(\"13 months to 16 February 2015\",\n datesHelper.generateBalanceSheetHeading(LocalDate.parse(\"2014-02-01\"), LocalDate.parse(\"2015-02-16\"), false));\n\n // Test 336 days shows 'month' rather than 'months'\n assertEquals(\"1 month to 1 April 2015\",\n datesHelper.generateBalanceSheetHeading(LocalDate.parse(\"2015-03-07\"), LocalDate.parse(\"2015-04-01\"), false));\n\n // Test that 0 month result shows correctly as '1 month'\n assertEquals(\"1 month to 31 March 2010\",\n datesHelper.generateBalanceSheetHeading(LocalDate.parse(\"2010-03-18\"), LocalDate.parse(\"2010-03-31\"), false));\n\n // \"Test exactly 351 days show yyyy\"\n assertEquals(\"2015\",\n datesHelper.generateBalanceSheetHeading(LocalDate.parse(\"2014-04-01\"), LocalDate.parse(\"2015-03-16\"), false));\n\n // Test exactly 351 days show years leap year\n assertEquals(\"2016\",\n datesHelper.generateBalanceSheetHeading(LocalDate.parse(\"2015-04-01\"), LocalDate.parse(\"2016-03-16\"), false));\n\n // Test 1st year filing within 15 days either side of 1 year period with same\n // year is just year\n assertEquals(\"30 June 2015\",\n datesHelper.generateBalanceSheetHeading(LocalDate.parse(\"2014-06-01\"), LocalDate.parse(\"2015-06-30\"), true));\n }", "private String formatDate(final Date date) {\r\n\t\tfinal Calendar calendar = Calendar.getInstance();\r\n\t\tcalendar.setTime(date);\r\n\r\n\t\tfinal String dayOfMonth = formatDayOfMonth(calendar);\r\n\t\tfinal String month = formatMonth(calendar);\r\n\t\tfinal String year = String.valueOf(calendar.get(Calendar.YEAR));\r\n\r\n\t\treturn String.format(\"%s/%s/%s\", year, month, dayOfMonth);\r\n\t}", "protected static int getSeason(String dateTime) {\n return Integer.parseInt(dateTime.substring(0, 1));\n }", "public static String getddmmyyDate(String dt) {\n String dd = \"\", mm = \"\", yy = \"\";\n int i = 0;\n try {\n for (String retval : dt.split(\"-\")) {\n if (i == 0)\n yy = retval;\n else if (i == 1)\n mm = retval;\n else\n dd = retval;\n\n i++;\n }\n return (yy + \"-\" + mm + \"-\" + dd).toString();\n } catch (Exception e) {\n e.printStackTrace();\n return \"\";\n }\n }", "public Season getSeason() {\n return season;\n }", "public static void date(int num) {\n String date = \"\";\n // Tests for what day of the week it is by using modulus to allign with a day.\n if (num%7==0) {\n date = \"Saturday\";\n } else if (num%7 == 1) {\n date = \"Sunday\";\n } else if (num%7 == 2) {\n date = \"Monday\";\n } else if (num%7 == 3) {\n date = \"Tuesday\";\n } else if (num%7 == 4) {\n date = \"Wednesday\";\n } else if (num%7 == 5) {\n date = \"Thursday\";\n } else if (num%7 == 6) {\n date = \"Friday\";\n }\n // Prints name of day inputted date falls on.\n System.out.println(\"That day is a \"+date);\n }", "public static void print(int startDay, int year, int month) {\n //call the method getNumberOfdaysInMonth to find out the number of the days in the month \n //use a for loop to print spaces up to the start day for each month\n //use another for loop to print the rest of the days in the calender\n //if the month is November calculate the thanksgiving day and output }\n int amount = getNumberOfDaysInMonth(year,month);\n for(int e = 0; e < startDay; e++){//this print outs the spaces for the months and aligns the dates together\n System.out.print(\" \");//use a for loop to print spaces up to the start day for each month\n }\n for(int e = 1; e <= amount; e++){//use another for loop to print the rest of the days in the calender\n if(e < 10){\n System.out.print(\" \" + e + \" \");//for the spaces\n }\n else{\n System.out.print(\" \" + e + \" \");\n }\n if((startDay + e) % 7 == 0){ \n System.out.println();\n }\n }\n thanks(startDay, month);//call the method thanks so it can work correctly\n }", "public static void main(String[] args) {\n\n\t\tScanner input = new Scanner(System.in);\n\t\tSystem.out.print(\"Enter a year: \");\n\t\tint year = input.nextInt();\n\t\t\n\t\tSystem.out.print(\"Enter a month: \");\n\t\tString s = input.next();\n\t\tchar temp = s.charAt(0);\n\t\t\n\t\tif (s.length() != 3 || Character.isUpperCase(temp) != true) {\n\t\t\tSystem.out.println(s + \" is not a correct month name\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\t\n\t\tint isleap = 0;\n\t\t//إذ¶دتا·ٌتابٍؤê\n\t\tif ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n\t\t\tisleap = 1;\n\t\t}\n\t\t\n\t\tint days = 0;\n\t\t\n\t\tswitch(temp) {\n\t\tcase 'J':\n\t\t\tif(s.equals(\"Jan\")) {\n\t\t\t\tdays = 31;\n\t\t\t}\n\t\t\tif(s.equals(\"Jun\")) {\n\t\t\t\tdays = 30;\n\t\t\t}\n\t\t\tif(s.equals(\"Jul\")) {\n\t\t\t\tdays = 31;\n\t\t\t}\n\t\tbreak;\n\t\tcase 'F':\n\t\t\tif(isleap == 1) {\n\t\t\t\tdays = 29;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdays = 28;\n\t\t\t};\n\t\tcase 'M':days = 31;break;\n\t\tcase 'A':\n\t\t\tif(s.equals(\"Apr\")) {\n\t\t\t\tdays = 30;\n\t\t\t}\n\t\t\tif(s.equals(\"Aug\")) {\n\t\t\t\tdays = 31;\n\t\t\t}\n\t\tcase 'S':days = 30;break;\n\t\tcase 'O':days = 31;break;\n\t\tcase 'N':days = 30;break;\n\t\tcase 'D':days = 31;break;\n\t\t}\n\t\t\n\t\tSystem.out.println(s + \" \" + year + \" has \" + days + \" days\");\n\t}", "private String getDayDescription(Event event) {\n int day = event.getDay();\n String dayDescription = Integer.toString(event.getDay());\n assert day < 32;\n assert day > 0;\n switch (day) {\n case 1:\n case 21:\n case 31:\n dayDescription += \"st\";\n break;\n case 2:\n case 22:\n dayDescription += \"nd\";\n break;\n case 3:\n case 23:\n dayDescription += \"rd\";\n break;\n default:\n dayDescription += \"th\";\n }\n return dayDescription;\n }", "public static String getMonthTitle(int year, int month) {\n String result = \"\";\n result += \" \" + getMonthName(month) + \" \" + year + \"\\n\";\n result += \"---------------------------------------------\" + \"\\n\";\n result += \" Sun Mon Tue Wed Thu Fri Sat\" + \"\\n\";\n return result;\n }", "@Test\n\tpublic void testPrintingDayNameShortForm() throws Exception {\n\t DateTime oneSunnyWednesday = new DateTime(2014, 10, 15, 0, 0);\n DateTimeFormatter format = DateTimeFormat.forPattern(\"E, d MMM y\");\n String dayNameAndDate = format.print(oneSunnyWednesday);\n \n assertEquals(\"Wed, 15 Oct 2014\", dayNameAndDate);\n\t}", "public String getValueFromDay(Student student){\n monday = studentDAO.getValueFromDay(student, \"monday\");\n tuesday = studentDAO.getValueFromDay(student, \"tuesday\");\n wednesday = studentDAO.getValueFromDay(student, \"wednesday\");\n thursday = studentDAO.getValueFromDay(student, \"thursday\");\n friday = studentDAO.getValueFromDay(student, \"friday\");\n int largest = Math.max(monday,Math.max(tuesday,Math.max(wednesday,Math.max(thursday,friday))));\n if (largest == monday){\n return \"Monday\";\n } else if (largest == tuesday) {\n return \"Tuesday\";\n } else if (largest == wednesday){\n return \"Wednesday\";\n } else if (largest == thursday){\n return \"Thursday\";\n } else if (largest == friday){\n return \"Friday\";\n } else {\n return \"No absence, ggwp ;)\";\n }\n }", "public void getCurrentDate(){\n Date now = new Date(); //get todays date \n \n SimpleDateFormat formatter = new SimpleDateFormat( \"MM/dd/yyyy\" ); \n System.out.println ( \"The current date is: \" + formatter.format( now ) ); \n \n month = (String) formatter.format( now ).subSequence(0, 2);\n day = (String) formatter.format( now ).subSequence(3, 5);\n year = (String) formatter.format( now ).subSequence(6, 10);\n \n System.out.println(\"month: \" + month);\n System.out.println(\"day: \" + day);\n System.out.println(\"year: \" + year);\n \n }", "public String toString() {\n\treturn String.format(\"%d/%d/%d\", year, month, day);\t\r\n\t}", "private String makeDateString(int day, int month, int year) {\n String str_month = \"\" + month;\n String str_day = \"\" + day;\n if (month < 10) {\n str_month = \"0\" + month;\n }\n if (day < 10) {\n str_day = \"0\" + day;\n }\n return year + \"-\" + str_month + \"-\" + str_day;\n }", "String getFolderName(Date date);", "private String getDateString(Calendar cal) {\n Calendar current = Calendar.getInstance();\n String date = \"\";\n if (cal.get(Calendar.DAY_OF_YEAR) == current.get(Calendar.DAY_OF_YEAR)) {\n date = getResources().getString(R.string.content_today) + String.format(\" %02d:%02d\", cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE));\n } else if ((cal.get(Calendar.DAY_OF_YEAR) - 1) == current.get(Calendar.DAY_OF_YEAR)) {\n date = getResources().getString(R.string.content_yesterday) + String.format(\" %02d:%02d\", cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE));\n } else if ((cal.get(Calendar.DAY_OF_YEAR) - 2) == current.get(Calendar.DAY_OF_YEAR)\n && getResources().getConfiguration().locale.equals(new Locale(\"vn\"))) {\n date = getResources().getString(R.string.content_before_yesterday) + String.format(\" %02d:%02d\", cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE));\n } else {\n date = String.format(\"%02d-%02d-%02d %02d:%02d\", mCal.get(Calendar.DAY_OF_MONTH), mCal.get(Calendar.MONTH) + 1, mCal.get(Calendar.YEAR), cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE));\n }\n\n return date;\n }", "public static String findDay(int month, int day, int year) {\n Calendar cal = Calendar.getInstance();\n cal.set(year, month-1, day);\n int val = cal.get(Calendar.DAY_OF_WEEK)-1;\n String[] days = {\"SUNDAY\", \"MONDAY\", \"TUESDAY\",\n \"WEDNESDAY\", \"THURSDAY\", \"FRIDAY\", \"SATURDAY\"};\n return(days[val]);\n }", "public String toString() { //toString method\n String startDateString2= \"\"; //Initialize\n try{\n Date date1 = new SimpleDateFormat(\"yyyyMMdd\").parse(full_Date);\n DateFormat df2 = new SimpleDateFormat(\"MMM dd, yyyy\");\n startDateString2 = df2.format(date1);\n \n return startDateString2;\n }catch(ParseException e){\n e.printStackTrace();\n }\n return startDateString2;\n \n}", "private String getSeriePageUrlWithSeason(String seriePageUrl, int season) {\n\t\tif (seriePageUrl == null || seriePageUrl.equals(\"\")) {\n\t\t\treturn null;\n\t\t}\n\t\tint pos = seriePageUrl.lastIndexOf(\".\");\n\t\tif (pos == -1) {\n\t\t\treturn seriePageUrl;\n\t\t}\n\t\telse {\t\t\t\n\t\t\treturn seriePageUrl.substring(0, pos) + \"-\" + season + seriePageUrl.substring(pos);\n\t\t}\n\t}", "public String getActualRegisterDate(String inputDate) {\n\t\tString finalDate=\"\";\r\n\t\ttry{\r\n\t\t\tCalendar cal = Calendar.getInstance();\r\n\t\t\t\r\n\t\t\tint month = cal.get(Calendar.MONTH)+1;\r\n\t\t\tint year = cal.get(Calendar.YEAR);\r\n//\t\t\tSystem.out.println(\"year: \"+year+\" and moth\"+month);\r\n\t\t\tStringTokenizer st = new StringTokenizer(inputDate,\"/-\");\r\n\t\t\tMap<Integer,Integer> monthMap=new HashMap<Integer,Integer>();\r\n\t\t\tint key=0;\r\n\t\t while (st.hasMoreElements()) {\r\n\t\t int token = Integer.parseInt(st.nextToken());\r\n\t\t //System.out.println(\"token = \" + token);\r\n\t\t monthMap.put(key, token);\r\n\t\t key++;\r\n\t\t }//loop ends\r\n\t\t int monthCompare=0;\r\n\t\t int date=0;\r\n\t\t for (Map.Entry<Integer, Integer> map : monthMap.entrySet()){\r\n\t\t \tif(map.getKey()==0){\r\n\t\t \tmonthCompare=map.getValue();\r\n//\t\t \tSystem.out.println(monthCompare);\r\n\t\t \tif(monthCompare<month){\r\n\t\t \t\tyear=year+1;\r\n\t\t \t}\r\n\t\t \t}\r\n\t\t \tif(map.getKey()==1){\r\n\t\t \t\tdate=map.getValue();\r\n\t\t \t}\r\n\t\t \t\r\n\t\t }\r\n\t\t finalDate=year+\"-\"+String.format(\"%02d\",monthCompare)+\"-\"+String.format(\"%02d\",date);\r\n\t\t return finalDate;\r\n\t\t}catch(Exception e){\r\n\t\t\t//System.out.println(\"Exception is: \"+e.getMessage());\r\n\t\t\tlogger.info(\"Exception in actual register date\"+e.getMessage());\r\n\t\t\t\r\n\t\t}\r\n\t\treturn finalDate;\r\n\t}", "public static String findDay(int month, int day, int year) {\n LocalDate localDate = LocalDate.of(year, month, day);\n DayOfWeek dayOfWeek = localDate.getDayOfWeek();\n return dayOfWeek.toString();\n }", "private void monthFormat() {\n\t\ttry {\n\t\t\tString currentMonth = monthFormat.format(new Date()); //Get current month\n\t\t\tstartDate = monthFormat.parse(currentMonth); //Parse to first of the month\n\t\t\tString[] splitCurrent = currentMonth.split(\"-\");\n\t\t\tint month = Integer.parseInt(splitCurrent[0]) + 1; //Increase the month\n\t\t\tif (month == 13) { //If moving to next year\n\t\t\t\tint year = Integer.parseInt(splitCurrent[1]) + 1;\n\t\t\t\tendDate = monthFormat.parse(\"01-\" + year);\n\t\t\t} else {\n\t\t\t\tendDate = monthFormat.parse(month + \"-\" + splitCurrent[1]);\n\t\t\t}\n\t\t\t//Create SQL times\n\t\t\tstartDateSQL = new java.sql.Date(startDate.getTime());\n\t\t\tendDateSQL = new java.sql.Date(endDate.getTime());\n\t\t\tmonthString = new SimpleDateFormat(\"MMMM\").format(startDate);\n\t\t} catch (ParseException e) {\n\t\t\t_.log(Level.SEVERE, GameMode.Sonic, \"Failed to parse dates. Monthly leaderboard disabled.\");\n\t\t}\n\t}", "public String far(Date date){\n Date d2 = new Date();\n// 两个日期相减\n long cha = d2.getTime() - date.getTime();\n// 拆分天数,小时,分钟\n long day = cha / (24 * 60 * 60 * 1000);\n long hour = (cha / (60 * 60 * 1000) - day * 24);\n long min = ((cha / (60 * 1000)) - day * 24 * 60 - hour * 60);\n String time = \"出错\";\n int a = 0;\n //显示天\n if (day > 0) {\n a = (int) day;\n time = a + \"天前\";\n } else if (day == 0) {\n// 显示小时\n if (hour > 0) {\n a = (int) hour;\n time = a + \"小时前\";\n }\n //显示分钟\n else if (hour == 0) {\n if (min > 0) {\n a = (int) min;\n time = a + \"分钟前\";\n }\n if(min==0){\n time = \"1分钟前\";\n }\n }\n }\n return time;\n }", "public static void main(String[] args) {\n\t\tScanner sc=new Scanner(System.in);\r\n\t\tSystem.out.println(\"Enter a date\");\r\n\t\tint date=sc.nextInt();\r\n\t\tif(date<1 || date>31)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Date is wrong\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tswitch(date%10)\r\n\t\t\t{\r\n\t\t\tcase 1:\r\n\t\t\t\tif(((date/10)%10)==1)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(date+\"th\");\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(date+\"st\");\r\n\t\t\t\t}break;\r\n\t\t\tcase 2:\r\n\t\t\t\tif(((date/10)%10)==1)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(date+\"th\");\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(date+\"nd\");\r\n\t\t\t\t}break;\r\n\t\t\tcase 3:\r\n\t\t\t\tif(((date/10)%10)==1)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(date+\"th\");\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(date+\"rd\");\r\n\t\t\t\t}break;\r\n\t\t\tdefault:\r\n\t\t\t\tSystem.out.println(date+\"th\");\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t}\r\n\t}", "private String getDateWordUsed(String source, List<DateGroup> dateGroups) {\n int startPosition = source.length();\n int endPosition = 0;\n for (DateGroup dateGroup : dateGroups) {\n int position = dateGroup.getPosition();\n int length = dateGroup.getText().length();\n startPosition = Math.min(startPosition, position);\n endPosition = Math.max(position + length, endPosition);\n }\n\n String dateText = source.substring(startPosition, endPosition);\n\n return dateText;\n }", "public static String dateDisplay(Calendar cal) {\n\t\tLONGDAYS[] arrayOfDays = LONGDAYS.values();\n\t\tString toReturn = cal.get(Calendar.MONTH)+1 + \"/\" + cal.get(Calendar.DAY_OF_MONTH);\n\t\ttoReturn = arrayOfDays[cal.get(Calendar.DAY_OF_WEEK)-1] + \" \" + toReturn;\n\t\treturn toReturn;\n\t}", "public String getYear(){\n return rssData.getDate().split(\"/\")[2];\n }" ]
[ "0.7655565", "0.7211569", "0.67672503", "0.61081666", "0.60641205", "0.5794692", "0.56441164", "0.56143063", "0.5607019", "0.5561227", "0.5548002", "0.5543026", "0.551675", "0.5510733", "0.54876554", "0.5473736", "0.54500234", "0.54475754", "0.5444624", "0.5420178", "0.54127413", "0.54102296", "0.5405502", "0.5372783", "0.5363003", "0.5317302", "0.52924454", "0.5267369", "0.5262359", "0.52613497", "0.52561766", "0.5252431", "0.5249322", "0.5225842", "0.5222279", "0.5219012", "0.5212456", "0.52003765", "0.5198588", "0.51958966", "0.5182064", "0.5180598", "0.5174662", "0.51571465", "0.5156149", "0.51550496", "0.51447576", "0.51399964", "0.51387817", "0.51381975", "0.5137733", "0.5112683", "0.5088558", "0.50592834", "0.50572664", "0.50559354", "0.50515825", "0.50476915", "0.50173765", "0.5006012", "0.5005896", "0.5004731", "0.49920213", "0.49901488", "0.49860552", "0.49845833", "0.4984323", "0.49832746", "0.49823406", "0.4969846", "0.4954067", "0.49514493", "0.49361104", "0.49303374", "0.49233097", "0.4923268", "0.49214858", "0.49213994", "0.4918629", "0.49117935", "0.4903799", "0.4899973", "0.48980644", "0.4883255", "0.48789266", "0.48739836", "0.4869998", "0.4867128", "0.48608354", "0.48589236", "0.48574188", "0.4852279", "0.4842893", "0.48380834", "0.48380527", "0.48364377", "0.48341337", "0.48313874", "0.48248363", "0.48207557" ]
0.69412535
2
Instantiates a new customer. A customerId is assigned from the CustomerIdServer.
public Customer(String name, String address, String phoneNumber) { super(name, address, phoneNumber); super.setId(CUSTOMER_STRING + (IdServer.instance().getId())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CustomerNew (\n\t\t Long in_id\n ) {\n\t\tthis.setId(in_id);\n }", "private Customer createCustomerInstanceWithId(String name, String email, String phoneNumber) {\n Customer customer = new Customer();\n customer.setId(1000L);\n customer.setName(name);\n customer.setEmail(email);\n customer.setPhoneNumber(phoneNumber);\n return customer;\n }", "Customer createCustomer();", "Customer createCustomer();", "Customer createCustomer();", "Customer createCustomer();", "public Customer createCustomer() {\n return new Customer(nameNested, surNameNested, ageNested, streetNested);\n }", "public Customer createCustomer() {\r\n\t\ttry {\r\n\t\t\treturn manager.createCustomer();\t\t\t\r\n\t\t}catch(SQLException e) {\r\n\t\t\tJOptionPane.showMessageDialog(null, \"The manager was unable to create a new customer\");\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "Customer() \n\t{\n\t}", "public CustomerNew () {\n\t\tsuper();\n\t}", "public static void CreateCustomer() \r\n\t{\n\t\t\r\n\t}", "public static Customer createNewCustomer(String fullName, Integer branchID )\n {\n return new Customer(fullName, branchID);\n }", "public Customer(int id) {\n\t\tthis.id = id;\n\t}", "SerialResponse createCustomer(PinCustomerPost pinCustomerPost);", "private Customer createCustomerInstance(String name, String email, String phoneNumber) {\n Customer customer = new Customer();\n customer.setName(name);\n customer.setEmail(email);\n customer.setPhoneNumber(phoneNumber);\n return customer;\n }", "public Customer(int custNum) \n\t{\n\t\t// stores the randomly assigned task where 1 is buying stamps, 2 is mailing a letter, and 3 is mailing a package\n\t\ttask = (int)(Math.random()*3 )+ 1; // randomly generates a number from 1 to 3\n\t\tcustomerNumber = custNum; // keeps track of which customer this is\n\t}", "Customer() {\n }", "Customer(){}", "public Customer(int id, String surname, String name, String patronymic, String address, int creditCardNumber, int bankAccountNumber) {\n this.id = id;\n this.surname = surname;\n this.name = name;\n this.patronymic = patronymic;\n this.address = address;\n this.creditCardNumber = creditCardNumber;\n this.bankAccountNumber = bankAccountNumber;\n }", "public Customer() {\r\n\t\tthis.name = \"\";\r\n\t\tthis.parcelID = \"\";\r\n\t\tthis.seqNo = 0;\r\n\t}", "public boolean newCustomer(int id, int cid)\n throws RemoteException, DeadlockException;", "private Customer createCustomerData() {\n int id = -1;\n Timestamp createDate = DateTime.getUTCTimestampNow();\n String createdBy = session.getUsername();\n\n if (action.equals(Constants.UPDATE)) {\n id = existingCustomer.getCustomerID();\n createDate = existingCustomer.getCreateDate();\n createdBy = existingCustomer.getCreatedBy();\n }\n\n String name = nameField.getText();\n String address = addressField.getText() + \", \" + cityField.getText();\n System.out.println(address);\n String postal = postalField.getText();\n String phone = phoneField.getText();\n Timestamp lastUpdate = DateTime.getUTCTimestampNow();\n String lastUpdatedBy = session.getUsername();\n\n FirstLevelDivision division = divisionComboBox.getSelectionModel().getSelectedItem();\n int divisionID = division.getDivisionID();\n\n return new Customer(id, name, address, postal, phone, createDate, createdBy, lastUpdate, lastUpdatedBy, divisionID);\n }", "public Customer() {\n\t\tsuper();\n\t}", "public Customers(int customerId, String customerName, String customerAddress, String customerPostalCode,\n String customerPhone, int divisionId, String divisionName, int countryId, String countryName) {\n this.customerId = customerId;\n this.customerName = customerName;\n this.customerAddress = customerAddress;\n this.customerPostalCode = customerPostalCode;\n this.customerPhone = customerPhone;\n this.divisionId = divisionId;\n this.divisionName = divisionName;\n this.countryId = countryId;\n this.countryName = countryName;\n }", "public Customer (String customerName, String address,\n String telephoneNumber){\n this.customerName = customerName;\n this.address = address;\n this.telephoneNumber = telephoneNumber;\n }", "public Customer(){}", "public Customer(int customer_ID, String customer_Name, String address, String postalCode, String phone, String createdDate, String createdBy, String lastUpdate, String lastUpdatedBy, int divisionID) {\n this.customer_ID = customer_ID;\n this.customer_Name = customer_Name;\n this.address = address;\n this.postalCode = postalCode;\n this.phone = phone;\n this.createdDate = createdDate;\n this.createdBy = createdBy;\n this.lastUpdate = lastUpdate;\n this.lastUpdatedBy = lastUpdatedBy;\n this.divisionID = divisionID;\n }", "public Customer(String newUserId, String newPassword) {\r\n this.userId = newUserId;\r\n this.password = newPassword;\r\n }", "public Customer() { }", "public Customer() {\r\n }", "public void addCustomer(){\n Customer customer = new Customer();\n customer.setId(data.numberOfCustomer());\n customer.setFirstName(GetChoiceFromUser.getStringFromUser(\"Enter First Name: \"));\n customer.setLastName(GetChoiceFromUser.getStringFromUser(\"Enter Last Name: \"));\n data.addCustomer(customer,data.getBranch(data.getBranchEmployee(ID).getBranchID()));\n System.out.println(\"Customer has added Successfully!\");\n }", "public Customer (\n\t\t Integer in_customerId\n\t\t) {\n\t\tsuper (\n\t\t in_customerId\n\t\t);\n\t}", "public Customer() {\n\t}", "public Customer() {\n\t}", "Customers createCustomers();", "public Customer()\n {\n\n }", "public Customer(int customerID, String name, String address, String email){\n\t\t\n\t\tthis.customerID = customerID;\n\t\tthis.name = name;\n\t\tthis.address = address;\n\t\tthis.email = email;\n\t}", "public Customer(String firstName, String lastName, LocalDateTime dob, String emailAddress, int customerID,\n String temporaryCustomerID, boolean loyaltyMember, boolean joinLoyaltyScheme,\n int loyaltyPointsNumber, String password, String username) {\n super(firstName, lastName, dob, emailAddress);\n this.customerID = customerID;\n this.temporaryCustomerID = temporaryCustomerID;\n this.loyaltyMember = loyaltyMember;\n this.joinLoyaltyScheme = joinLoyaltyScheme;\n this.loyaltyPointsNumber = loyaltyPointsNumber;\n this.password = password;\n this.username = username;\n }", "public Customer() {\n name = \"N.A.\";\n surname = \"N.A.\";\n address = \"N.A.\";\n email = \"N.A.\";\n }", "public void createCustomerTransaction(String customerId, TransactionData transData) {\n \t\n \tTransaction transEntity = new Transaction();\n \t\n \tBeanUtils.copyProperties(transData, transEntity);\n \ttransEntity.setCustomerId(customerId.trim().toUpperCase());\n \t//Save and flush\n \ttransactionRepository.saveAndFlush(transEntity);\n }", "static Customer getCustomerWithId(int id){ return new Customer();}", "public Customer(Long id, String firstname, String lastname, Date dob, String username, String password) {\n\t\tsuper();\n\t\tthis.id = id;\n\t\tthis.firstname = firstname;\n\t\tthis.lastname = lastname;\n\t\tthis.dob = dob;\n\t\tthis.username = username;\n\t\tthis.password = password;\n\t}", "public Customer() {\n }", "public Customer() {\n }", "public Customer () {\n\t\tsuper();\n\t}", "public au.gov.asic.types.AccountIdentifierType addNewCustomer()\n {\n synchronized (monitor())\n {\n check_orphaned();\n au.gov.asic.types.AccountIdentifierType target = null;\n target = (au.gov.asic.types.AccountIdentifierType)get_store().add_element_user(CUSTOMER$0);\n return target;\n }\n }", "public Customer(){\n\t \n }", "public Customer() {\n\n }", "public void create(Customer c){\n Connection conn = ConnectionFactory.getConnection();\n PreparedStatement ppst = null;\n try {\n ppst = conn.prepareCall(\"INSERT INTO customer (name, id, phone) VALUES (?, ?, ?)\");\n ppst.setString(1, c.getName());\n ppst.setString(2, c.getId());\n ppst.setString(3, c.getPhone());\n ppst.executeUpdate();\n System.out.println(\"Customer created.\");\n } catch (SQLException e) {\n throw new RuntimeException(\"Creation error: \", e);\n } finally {\n ConnectionFactory.closeConnection(conn, ppst);\n }\n }", "@Override\n\tpublic void create(Customer t) {\n\n\t}", "public Customer(int id, String name, int age, String address) {\r\n super(id, name, age, address);\r\n }", "@Test\n\tpublic void create() {\n\t\t// Given\n\t\tString name = \"Mark\";\n\t\tString address = \"Auckland\";\n\t\tString telephoneNumber = \"0211616447\";\n\n\t\t// When\n\t\tICustomer customer = customerController.create(name, address, telephoneNumber);\n\n\t\t// Then\n\t\tAssert.assertNotNull(customer);\n\t}", "public MyCustomer(CustomerAgent cmr, int num){\n\t this.cmr = cmr;\n\t tableNum = num;\n\t state = CustomerState.NO_ACTION;\n\t}", "public Customer(int id, String name, String email, String password, Calendar joinDate)\n {\n this.id=id;\n this.name=name;\n setPassword(password);\n setEmail(email);\n this.joinDate=joinDate;\n }", "public CustomerService() {\n\n Customer c1 = new Customer(\"Brian May\", \"45 Dalcassian\", \"[email protected]\", 123);\n Customer c2 = new Customer(\"Roger Taylor\", \"40 Connaught Street\", \"[email protected]\", 123);\n Customer c3 = new Customer(\"John Deacon\", \"2 Santry Avenue\", \"[email protected]\", 123);\n Customer c4 = new Customer(\"Paul McCartney\", \"5 Melville Cove\", \"[email protected]\", 123);\n\n c1.setIdentifier(1);\n c2.setIdentifier(2);\n c3.setIdentifier(3);\n c4.setIdentifier(4);\n customers.add(c1);\n customers.add(c2);\n customers.add(c3);\n customers.add(c4);\n\n c1.addAccount(new Account(101));\n c2.addAccount(new Account(102));\n c2.addAccount(new Account(102));\n c3.addAccount(new Account(103));\n c3.addAccount(new Account(103));\n c3.addAccount(new Account(103));\n c4.addAccount(new Account(104));\n\n }", "public Customer(){\n\n }", "private Customer parseNewCustomer(HttpServletRequest request, int cust_id){\n\t\t//parse new customer from request\n\t\tCustomer cust = new Customer();\n\t\tcust.setID(cust_id);\n\t\tcust.setFirstName(request.getParameter(\"first_name\"));\n\t\tcust.setLastName(request.getParameter(\"last_name\"));\n\t\tcust.setAddress(request.getParameter(\"address\"));\n\t\tcust.setCity(request.getParameter(\"city\"));\n\t\tcust.setState(request.getParameter(\"state\"));\n\t\tcust.setPhoneNumber(request.getParameter(\"phone\"));\n\t\treturn cust;\n\t}", "@Override\n\tpublic Customers create(Customers newcust) {\n\t\tif (newcust.getId()!=null)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\tCustomers savecust = CustRepo.save(newcust);\n\t\treturn savecust;\n\t}", "public Customer() {\n\t\tcustref++;\n\t}", "public static void createCustomer() throws IOException {\n\t\tString ssn = randomSSN();\n\t\twhile(SSNmap.containsKey(ssn)) {\n\t\t\tssn = randomSSN();\n\t\t}\n\t\tSSNmap.put(ssn, 1);\n\t\t\n\t\tString name = names[random(50)] + \" \" + names[random(50)];\n\t\tString address = randomNumber() + \" \" + streets[random(50)];\n\t\tString phone = randomPhone();\n\t\t\n\t\twriter.write(\"INSERT INTO Customer (Id, SSN, Name, Address, Phone) Values (\" + custId++ +\", '\" + ssn + \"', '\" \n\t\t\t\t+ name + \"', '\" + address + \"', '\" + phone +\"'\" + line);\n\t\twriter.flush();\n\t}", "private CustomerDetails initCustomerDetails() {\n CustomerDetails mCustomerDetails = new CustomerDetails();\n mCustomerDetails.setPhone(\"085310102020\");\n mCustomerDetails.setFirstName(\"user fullname\");\n mCustomerDetails.setEmail(\"[email protected]\");\n return mCustomerDetails;\n }", "void createACustomer() {\r\n\t\tSystem.out.println(\"\\nCreating a customer:\");\r\n\t\tEntityManager em = emf.createEntityManager();\r\n\t\tEntityTransaction tx = em.getTransaction();\r\n\t\tCustomer2 c1 = new Customer2(\"Ali\", \"Telli\");\r\n\t\ttx.begin();\r\n\t\tem.persist(c1);\r\n\t\ttx.commit();\r\n\t\tem.close();\r\n\t}", "private PersonCtr createCustomer()\n {\n\n // String name, String addres, int phone, int customerID\n PersonCtr c = new PersonCtr();\n String name = jTextField3.getText();\n String address = jTextPane1.getText();\n int phone = Integer.parseInt(jTextField2.getText());\n int customerID = phone;\n Customer cu = new Customer();\n cu = c.addCustomer(name, address, phone, customerID);\n JOptionPane.showMessageDialog(null, cu.getName() + \", \" + cu.getAddress()\n + \", tlf.nr.: \" + cu.getPhone() + \" er oprettet med ID nummer: \" + cu.getCustomerID()\n , \"Kunde opretttet\", JOptionPane.INFORMATION_MESSAGE);\n return c;\n\n\n }", "public Customer(String FirstName, String LastName, String Address, String Nationality, String eMail, int phoneNumber) {\n\t\tthis.FirstName = FirstName ;\n\t\tthis.LastName = LastName ;\n this.Address = Address;\n this.Nationality = Nationality;\n this.eMail = eMail;\n this.phoneNumber = phoneNumber;\n\t}", "public Customer(int custId, String name, String email, String password, double amount, LocalDate regDate) {\r\n\t\tsuper();\r\n\t\tthis.custId = custId;\r\n\t\tthis.name = name;\r\n\t\tthis.email = email;\r\n\t\tthis.password = password;\r\n\t\tthis.amount = amount;\r\n\t\tthis.regDate = regDate;\r\n\t}", "@Override\n\tpublic void createCustomer(Customer customer) throws Exception {\n\t\tConnection con = pool.getConnection();\n\t\ttry {\n\t\t\t\n\t\t\tStatement st = con.createStatement();\n\t\t\tString create = String.format(\"insert into customer values('%s', '%s')\", customer.getCustName(),\n\t\t\t\t\tcustomer.getPassword());\n\t\t\tst.executeUpdate(create);\n\t\t\tSystem.out.println(\"Customer added successfully\");\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(e.getMessage() + \"Unable to add A customer, Try Again! \");\n\t\t} finally {\n\t\t\tpool.returnConnection(con);\n\t\t}\n\t}", "public Customer(int id, String name, int age, String address, boolean authenticated) {\r\n super(id, name, age, address, authenticated);\r\n }", "void createAndManageCustomer() {\r\n\t\tSystem.out.println(\"\\nCreating and managing a customer:\");\r\n\r\n\t\tEntityManager em = emf.createEntityManager();\r\n\t\tEntityTransaction tx = em.getTransaction();\r\n\t\tCustomer2 c = new Customer2(\"Sami\", \"Cemil\");\r\n\t\ttx.begin();\r\n\t\tem.persist(c);\r\n\t\ttx.commit();\r\n\t\tSystem.out.println(c);\r\n\t\t\r\n\t\ttx = em.getTransaction();\r\n\t\ttx.begin();\r\n\t\tc.setLastName(\"Kamil\");\r\n\t\ttx.commit();\r\n\t\tSystem.out.println(c);\r\n\t\tem.close();\r\n\t}", "public ResponseEntity<?> createCustomer(customer.controller.Customer customer);", "@Test\n public void testCreateCustomer() {\n System.out.println(\"createCustomer\");\n String name = \"Gert Hansen\";\n String address = \"Grønnegade 12\";\n String phone = \"98352010\";\n CustomerCtr instance = new CustomerCtr();\n int customerID = instance.createCustomer(name, address, phone);\n Customer result = instance.getCustomer(customerID);\n assertEquals(\"Gert Hansen\", result.getName());\n assertEquals(\"Grønnegade 12\", result.getAddress());\n assertEquals(\"98352010\", result.getPhone());\n // TODO review the generated test code and remove the default call to fail.\n// fail(\"The test case is a prototype.\");\n }", "public Customer(String name, String email, String password, double amount, LocalDate regDate) {\r\n\t\tthis.custId = idCounter++;\r\n\t\tthis.name = name;\r\n\t\tthis.email = email;\r\n\t\tthis.password = password;\r\n\t\tthis.amount = amount;\r\n\t\tthis.regDate = regDate;\r\n\t}", "@Transactional\n\t@Override\n\tpublic Customer createCustomer(String name) {\n\t\t\n\t\tvalidateName(name);\n\t\tLocalDateTime now = LocalDateTime.now();\n\t\tAccount account = new Account(5000.0, now);\n\t\taccountRepository.save(account);\n\t\tSet<Item> set = new HashSet<>();\n\t\tCustomer customer = new Customer(name, account,set);\n\t\tcustRepository.save(customer);\n\t\treturn customer;\n\t\t\n\t}", "private void createCustomer(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n String customerName = request.getParameter(\"CustomerName\");\n System.out.println(\"them mới id\"+ customerName);\n String customerBir = request.getParameter(\"CustomerBir\");\n String gender = request.getParameter(\"Gender\");\n int cusIdNum =Integer.parseInt(request.getParameter(\"CusIdNum\"));\n int cusTelNum = Integer.parseInt(request.getParameter(\"CusTelNum\"));\n String cusEmail = request.getParameter(\"CusEmail\");\n String address = request.getParameter(\"Address\");\n String customerTypeId = request.getParameter(\"CustomerTypeId\");\n System.out.println(\"them mới id\"+ customerName);\n Customer customer = new Customer(customerName,customerBir,gender,cusIdNum,cusTelNum,cusEmail,address, new CustomerType(customerTypeId));\n customerService.save(customer);\n showCustomerList(request,response);\n System.out.println(\"them mới\"+ customer);\n }", "public static void createCustomer() throws IOException\r\n\t{\r\n\t\tclearScreen();\r\n\t\t\r\n\t\tSystem.out.println(\"[CUSTOMER CREATOR]\\n\");\r\n\t\tSystem.out.println(\"Enter the name of the customer you would like to create:\");\r\n\t\t\r\n\t\t// create a new customer with a user-defined name\r\n\t\tCustomer c = new Customer(inputString(false));\r\n\t\t// add the customer to the ArrayList\r\n\t\tcustomers.add(c);\r\n\t\t// display the edit screen for the customer\r\n\t\teditCustomer(c);\r\n\t}", "public SolidAutoTellerMachine(int customerId) {\n deAuthenticate();\n User selectCustomer = DatabaseSelectHelper.getUserDetails(customerId);\n if (selectCustomer instanceof Customer) {\n currentCustomer = (Customer) selectCustomer;\n }\n }", "public Customer(String customerName, String mobileNo, String email, Address address, String role) {\n\t\tsuper();\n\t\tthis.customerName = customerName;\n\t\tthis.mobileNo = mobileNo;\n\t\tthis.email = email;\n\t\tthis.address = address;\n\t\tthis.role = role;\n\t}", "public Customer(String name) {\n this.name = name;\n }", "public org.oep.usermgt.model.Citizen create(long citizenId);", "public CustomerController() {\n\t\tsuper();\n\n\t}", "public CustomerAccount(int newAccountNo, String newCustName, String newCustAddr)\r\n\t{\r\n\t\t// Constructor chaining to simplify code\r\n\t\tthis(newAccountNo, newCustName, newCustAddr, DEFAULT_CREDIT_LIMIT);\r\n\t\t\r\n\t}", "public String createCustomer(Map<String, Object> tokenParams, Map<String, Object> customerParams){\n Stripe.apiKey = stripeKey;\n\n String stripeCustomerId = null;\n try{\n Token token = Token.create(tokenParams);\n customerParams.put(\"source\", token.getId());\n Customer customer = Customer.create(customerParams);\n stripeCustomerId = customer.getId();\n }catch(AuthenticationException e){\n LOG.error(\"An authentication error occurred while creating a stripe customer\", e);\n throw new com.springfullstackcloudapp.exceptions.StripeException();\n }catch(InvalidRequestException e){\n LOG.error(\"An invalid request exception occurred while creating a stripe customer\", e);\n throw new com.springfullstackcloudapp.exceptions.StripeException();\n }catch(APIConnectionException e){\n LOG.error(\"An API Connection exception occurred while creating a stripe customer\", e);\n throw new com.springfullstackcloudapp.exceptions.StripeException();\n }catch(CardException e){\n LOG.error(\"A credit card exception occurred while creating a stripe customer\", e);\n throw new com.springfullstackcloudapp.exceptions.StripeException();\n }catch(APIException e){\n LOG.error(\"An API exception occurred while creating a stripe customer\", e);\n throw new com.springfullstackcloudapp.exceptions.StripeException();\n }\n return stripeCustomerId;\n }", "public Customer() // default constructor to initialize data\r\n\t{\r\n\t\tthis.address = null;\r\n\t\tthis.name = null;\r\n\t\tthis.phoneNumber = null;\r\n\t\t// intializes the data\r\n\t}", "TypicalCustomer() {\n super();\n }", "public MessageResponseCustomerDto createCustomer(CustomerDto customer);", "public Customer(String username, String firstname, String lastname, String password) {\n this.username = username;\n this.firstname = firstname;\n this.lastname = lastname;\n this.password = password;\n }", "public Customer loadCustomerFromId(int customerId) {\n ResultSet rs = database.getCustomer(customerId);\n Customer newCustomer = null;\n try {\n if (rs.next()) {\n newCustomer = new Customer(rs.getString(\"name\"), rs.getString(\"address\"), rs.getString(\"email\"), \"toBeLoaded\", rs.getDate(\"birthday\"), rs.getInt(\"phonenumber\"));\n newCustomer.setPassword(Customer.fromBase64(rs.getString(\"password\")));\n newCustomer.setSalt(Customer.fromBase64(rs.getString(\"passwordsalt\")));\n // newCustomer.setCurrentOrder(loadOrderFromId(rs.getInt(\"currentorderid\")));\n newCustomer.setCustomerID(customerId);\n } else {\n throw new NoSuchCustomerException(customerId);\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n if (newCustomer == null) {\n throw new NoSuchCustomerException(customerId);\n }\n return newCustomer;\n }", "@PostMapping(value = \"/customers\", consumes = MediaType.APPLICATION_JSON_VALUE)\n\tpublic void createCustomer(@RequestBody CustomerDTO custDTO) {\n\t\tlogger.info(\"Creation request for customer {}\", custDTO);\n\t\tcustService.createCustomer(custDTO);\n\t}", "public Customer(String name, String surname, String address, String email, long tel) {\n this.name = name;\n this.surname = surname;\n this.address = address;\n this.email = email;\n this.tel = tel;\n }", "public boolean createCustomer(String customerJSON);", "public Customer(String name) {\n this.name=name;\n }", "private Customer addCustomer(String title, String firstName, String lastName, String phone, String email, String addressLine1, String addressLine2, String city, String state, String postCode, String country) {\r\n out.print(title);\r\n out.print(firstName);\r\n out.print(lastName);\r\n out.print(phone);\r\n out.print(email);\r\n out.print(addressLine1);\r\n out.print(addressLine2);\r\n out.print(city);\r\n out.print(state);\r\n out.print(postCode);\r\n out.print(country);\r\n\r\n Customer customer = new Customer();\r\n customer.setCustomerTitle(title);\r\n customer.setCustomerFirstName(firstName);\r\n customer.setCustomerLastName(lastName);\r\n customer.setCustomerPhone(phone);\r\n customer.setCustomerEmail(email);\r\n customer.setCustomerAddressLine1(addressLine1);\r\n customer.setCustomerAddressLine2(addressLine2);\r\n customer.setCustomerCity(city);\r\n customer.setCustomerState(state);\r\n customer.setCustomerPostCode(postCode);\r\n customer.setCustomerCountry(country);\r\n\r\n em.persist(customer);\r\n return customer;\r\n }", "public SolidAutoTellerMachine(int customerId, String password) {\n this(customerId);\n }", "public Customer(String address, String name, String phoneNumber) {\r\n\t\tsuper();\r\n\t\tthis.address = address;\r\n\t\tthis.name = name;\r\n\t\tthis.phoneNumber = phoneNumber;\r\n\t}", "@Test\n public void testCustomerFactoryCreate() {\n CustomerController customerController = customerFactory.getCustomerController();\n customerController.addCustomer(CUSTOMER_NAME, CUSTOMER_CONTACT, false);\n assertEquals(1, customerController.getCustomerList().size());\n }", "public Customer(String name, String address, String phone) {\n\t\tthis.customerID = generateID(6);\n\t\tthis.name = name;\n\t\tthis.address = address;\n\t\tthis.phone = phone;\n\t}", "public au.gov.asic.types.MessageIdentifierType.CustomerIdentifier addNewCustomerIdentifier()\n {\n synchronized (monitor())\n {\n check_orphaned();\n au.gov.asic.types.MessageIdentifierType.CustomerIdentifier target = null;\n target = (au.gov.asic.types.MessageIdentifierType.CustomerIdentifier)get_store().add_element_user(CUSTOMERIDENTIFIER$2);\n return target;\n }\n }", "public Customer(String name, String pass, String email, String state, String city, String number) {\n\t\tsuper(name, pass, email, state, city, number);\n\t\tcart = new Cart();\n\t}", "public Account(String customerName, String customerEmail, String customerPhone) {\n this(\"99999\", 100.55, customerName, customerEmail, customerPhone);\n // created from IntelliJ's Generate - but we used them inside of the constructor above, using \"this\"\n// this.customerName = customerName;\n// this.customerEmail = customerEmail;\n// this.customerPhone = customerPhone;\n }", "public Customer(String name, double initialAmount) { //constructor for our customer class\r\n this.name = name;\r\n addId++;\r\n this.custId=addId;\r\n this.transactions = new ArrayList<>();\r\n balance=initialAmount;\r\n transactions.add(initialAmount);\r\n }", "public Customer(String CustomerDetails) throws CustomException \n {\n if(CustomerDetails.trim().length()==0)\n {\n throw new CustomException(\"Empty customer Details are not allowed.\");\n }\n\n String[] CustomerDetail = CustomerDetails.split(\", \");\n setCustomerId(Integer.parseInt(CustomerDetail[0]));\n setCustomerName(CustomerDetail[1]);\n setCustomerType(CustomerDetail[2]);\n }" ]
[ "0.7072647", "0.693424", "0.6931106", "0.6931106", "0.6931106", "0.6931106", "0.68226296", "0.6792855", "0.6729079", "0.6705097", "0.6674054", "0.6645948", "0.6584689", "0.6584017", "0.6517943", "0.6502102", "0.64876914", "0.64636135", "0.6462136", "0.6457149", "0.64166766", "0.641277", "0.6394059", "0.6373101", "0.63639396", "0.63336945", "0.62774", "0.6274463", "0.6263672", "0.62621874", "0.62573713", "0.62539095", "0.62420595", "0.62420595", "0.6240838", "0.6232018", "0.6226964", "0.6222398", "0.6208768", "0.6201366", "0.61998534", "0.6196605", "0.6190746", "0.6190746", "0.6180431", "0.6178541", "0.61635613", "0.6158036", "0.61532366", "0.6151853", "0.6136687", "0.613165", "0.611773", "0.6112203", "0.6107315", "0.61003023", "0.6081998", "0.60666275", "0.6063567", "0.60622865", "0.60538936", "0.60299927", "0.60245436", "0.6015662", "0.601499", "0.60112214", "0.60009485", "0.5988351", "0.5959636", "0.59364045", "0.5922713", "0.59132624", "0.58845544", "0.5883887", "0.5855807", "0.5846655", "0.5846493", "0.58376557", "0.5836926", "0.5828985", "0.58183134", "0.58153725", "0.5810968", "0.5807411", "0.5806303", "0.580479", "0.5804396", "0.5803291", "0.579906", "0.5797316", "0.5785037", "0.57820296", "0.5767206", "0.5759392", "0.5757189", "0.5752014", "0.57447046", "0.574219", "0.57374173", "0.57345045" ]
0.6677523
10
Gets the customer id.
public String getCustomerId() { return getId(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getCustomerId();", "java.lang.String getCustomerId();", "public final String getCustomerId() {\n\t\treturn customerId;\n\t}", "public long getCustomerId() {\n\t\treturn customerId;\n\t}", "public String getCustomerId()\n\t{\n\t\treturn customerId;\n\t}", "public Number getCustomerId() {\n return (Number)getAttributeInternal(CUSTOMERID);\n }", "public String getCustomerId() {\n\t\treturn customerId;\n\t}", "public long getCustomerId() {\n return customerId;\n }", "public long getCustomerId() {\n return customerId;\n }", "public String getCustomerId() {\n return customerId;\n }", "public String getCustomerId() {\n return customerId;\n }", "public int getCustomerId() {\n\t\treturn customerId;\n\t}", "protected String getCustomerID() {\n\t\treturn this.clientUI.getCustomerID();\n\t}", "public int getCustomerID()\r\n\t{\r\n\t\treturn customerID;\r\n\t}", "public Long getCustomerId() {\n return customerId;\n }", "String getCustomerID();", "public int getCustomer_id() {\r\n\t\treturn customer_id;\r\n\t}", "public int getCustomerID() {\n\t\treturn customerID;\n\t}", "public Integer getCustomerId()\n {\n return customerId;\n }", "public int getCustomerId() {\n return customerId;\n }", "public int getCustomerId() {\n return customerId;\n }", "public String getCustomerid() {\n return customerid;\n }", "public Integer getCustomerID() {\n return customerID;\n }", "public int getCustomerID() {\n\t\treturn 0;\n\t}", "public int getCustomerID() {\n return customerID;\n }", "public String getCustId() {\n return custId;\n }", "public Long getCustId() {\n\t\treturn custId;\n\t}", "public Long getCustId() {\n\t\treturn custId;\n\t}", "public Long getCustId() {\n return custId;\n }", "public int currentCustomerId() {\n if (this.currentCustomerAuthenticated()) {\n return this.currentCustomer.getId();\n }\n return 0;\n }", "com.google.protobuf.ByteString\n getCustomerIdBytes();", "com.google.protobuf.ByteString\n getCustomerIdBytes();", "public String getCustID()\n\t{\n\t\treturn custID;\n\t}", "public String getCust_id() {\r\n\t\treturn cust_id;\r\n\t}", "public int toInt(){\n\t\treturn CustomerId;\n\t}", "public au.gov.asic.types.MessageIdentifierType.CustomerIdentifier getCustomerIdentifier()\n {\n synchronized (monitor())\n {\n check_orphaned();\n au.gov.asic.types.MessageIdentifierType.CustomerIdentifier target = null;\n target = (au.gov.asic.types.MessageIdentifierType.CustomerIdentifier)get_store().find_element_user(CUSTOMERIDENTIFIER$2, 0);\n if (target == null)\n {\n return null;\n }\n return target;\n }\n }", "public int getCustomerId() \n {\n return customerId;\n }", "public Long getExternalCustomerId() {\r\n return externalCustomerId;\r\n }", "public void getCustomerID (){\n\t\t//gets the selected row \n\t\tint selectedRowIndex = listOfAccounts.getSelectedRow();\n\t\t//gets the value of the first element of the row which is the \n\t\t//customerID\n\t\tcustomerID = (String) listOfAccounts.getModel().getValueAt(selectedRowIndex, 0);\n\t\tcustomerName = (String) listOfAccounts.getModel().getValueAt(selectedRowIndex, 1);\n\t}", "@Override\n public int getClientId() {\n return _entityCustomer.getClientId();\n }", "public int getCustomerID(int customer_id) {\n int id = 0;\n try {\n checkCustomerID.setInt(1, customer_id);\n ResultSet resultset = checkCustomerID.executeQuery();\n while (resultset.next()) {\n id = resultset.getInt(\"customer_id\");\n System.out.println(\"Customer ID: \" + id);\n }\n try {\n resultset.close();\n }\n catch (SQLException exception) {\n System.out.println(\"Cannot close resultset!\");\n }\n }\n catch (SQLException exception) {\n System.out.println(\"Invalid Input!\");\n }\n return id;\n }", "public int getCustNumber()\n\t{\n\t\treturn customerNumber;\n\t}", "public static String generateCustomerID() {\n\tcustomerID++;\n\treturn String.valueOf(customerID);\n }", "public Number getBudgetCustomerId() {\n return (Number) getAttributeInternal(BUDGETCUSTOMERID);\n }", "public int getCustId(){\n return this.custId;\r\n }", "public Integer getCustomer() {\n return customer;\n }", "public int getCustomerNo() {\n\t\treturn this.customerNo;\r\n\t}", "public String getCustomerId(int k) {\n\t\treturn prescriptionList.get(k).getCustomerId();\n\t}", "public int getNextCustomerId() {\n return database.getNextCustomerId();\n }", "private String getCustomerId(String xmlResponse) {\r\n\t\t\r\n\t\tString customerId = \"\";\r\n\t\tElement root;\r\n\t\t\r\n\t\ttry {\r\n\t\t\troot = DOMUtils.openDocument(new ByteArrayInputStream(xmlResponse.getBytes()));\r\n\t\t\tElement element = DOMUtils.getElement(root, \"data\", true);\r\n\t\t\t\r\n\t\t\telement = DOMUtils.getElement(element, \"customer\", true);\r\n\t\t\t\r\n\t\t\telement = DOMUtils.getElement(element, \"id\", true);\r\n\t\t\t\r\n\t\t\tcustomerId = DOMUtils.getText(element).toString();\r\n\t\t\t\r\n\t\t} catch(Exception e) {\r\n\t\t\tlog.error(\"Erro encontrado no XML de resposta do Infobus.\", e);\r\n\t\t\tthrow new ErrorMessageException(\"Erro encontrado no XML de resposta do Infobus.\", e);\r\n\t\t}\r\n\t\t\r\n\t\treturn customerId;\r\n\t\t\r\n\t}", "@Override\n public int getPrimaryKey() {\n return _entityCustomer.getPrimaryKey();\n }", "public au.gov.asic.types.AccountIdentifierType getCustomer()\n {\n synchronized (monitor())\n {\n check_orphaned();\n au.gov.asic.types.AccountIdentifierType target = null;\n target = (au.gov.asic.types.AccountIdentifierType)get_store().find_element_user(CUSTOMER$0, 0);\n if (target == null)\n {\n return null;\n }\n return target;\n }\n }", "public String getCustomer() {\n return customer;\n }", "public String getGlobalCustomerNumberID()\n\t{\n\t\treturn globalCustomerNumberID;\n\t}", "public int getCustomerref() {\n\t\treturn custref;\n\t}", "private String getCustomerId(String xmlResponse) {\r\n\t\t\r\n\t\tString customerId = \"\"; \r\n\t\tElement root;\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\troot = DOMUtils.openDocument(new ByteArrayInputStream(xmlResponse.getBytes()));\r\n\t\t\tElement data = DOMUtils.getElement(root, \"data\", true);\r\n\t\t\t\r\n\t\t\t//sets the subscriber name\r\n\t\t\tElement customerInfo = DOMUtils.getElement(data, \"customer\", true);\r\n\t\t\tcustomerInfo = DOMUtils.getElement(customerInfo, \"id\", true);\r\n\t\t\r\n\t\t\tcustomerId = DOMUtils.getText(customerInfo).toString();\r\n\t\t\t\r\n\t\t} catch(Exception e) {\r\n\t\t\tlog.error(\"Erro encontrado no XML de resposta do Infobus.\", e);\r\n\t\t\tthrow new ErrorMessageException(\"Erro encontrado no XML de resposta do Infobus.\", e);\r\n\t\t}\t\r\n\t\t\r\n\t\treturn customerId;\r\n\t\t\r\n\t}", "public String generateCustomer_Id() {\n\t\tString customer_Id = \"C\" + String.valueOf(rand.genRandomDigits(7));\n\t\twhile (registerDao.checkCustomerIdIfExist(customer_Id)) {\n\t\t\tcustomer_Id = \"C\" + String.valueOf(rand.genRandomDigits(7));\n\t\t}\n\t\treturn customer_Id;\n\t}", "public String getCustomerCode() {\n\t\treturn customerCode;\n\t}", "Customer getCustomerById(final Long id);", "public Long getCustPid() {\n\t\treturn custPid;\n\t}", "public String getAmazonCustomerId(final SessionContext ctx, final Customer item)\n\t{\n\t\treturn (String)item.getProperty( ctx, AmazoncoreConstants.Attributes.Customer.AMAZONCUSTOMERID);\n\t}", "public void setCustomerId(long value) {\n this.customerId = value;\n }", "public java.lang.Integer getReqCustid() {\n return req_custid;\n }", "public Long getRelCustId() {\n return relCustId;\n }", "@Override\r\n\tpublic Customer getCustomer(int customerID) {\n\t\treturn null;\r\n\t}", "public java.lang.Integer getReqCustid() {\n return req_custid;\n }", "public String getCustomer(String custId);", "public String getCustomerCode()\n\t{\n\t\treturn getColumn(OFF_CUSTOMER_CODE, LEN_CUSTOMER_CODE) ;\n\t}", "public String getAmazonCustomerId(final Customer item)\n\t{\n\t\treturn getAmazonCustomerId( getSession().getSessionContext(), item );\n\t}", "public java.lang.String getCustNo() {\n return custNo;\n }", "public static int getCustomerId(String customer) throws SQLException {\n query = \"SELECT * FROM customer WHERE customerName = ?\";\n model.DBQueryPrepared.setPreparedStatement(CONN, query);\n ps = DBQueryPrepared.getPreparedStatement();\n \n ps.setString(1, customer);\n ps.execute();\n rs = ps.getResultSet();\n \n // rs.first() will return true if it found the value, false if it didn't\n if(rs.first())\n return rs.getInt(\"customerId\");\n else {\n return 0;\n }\n }", "public String getCustomerReference() {\n return customerReference;\n }", "public String getJob_customer_addresses_id() {\n return job_customer_addresses_id;\n }", "@Override\n\tpublic Customer getCustomerById(long customerId) {\n\t\treturn null;\n\t}", "String getCustomerNameById(int customerId);", "public int getAgentCustomers(int agent_id) {\n int id = 0;\n try {\n checkAgentCustomers.setInt(1, agent_id);\n ResultSet resultset = checkAgentCustomers.executeQuery();\n while (resultset.next()) {\n id = resultset.getInt(\"customer_id\");\n System.out.println(\"Customer ID is: \" + id + \"\\n\");\n }\n resultset.close();\n }\n catch (SQLException exception) {\n System.out.println(\"Agent Doesn't Manage Any Customers Yet!\");\n }\n return id;\n }", "@Override\n public String provideCustomerConnectionId( )\n {\n return _signaleur.getGuid( );\n }", "public de.htwg_konstanz.ebus.framework.wholesaler.vo.Customer getCustomer () {\r\n\t\treturn customer;\r\n\t}", "@Override\n\tpublic Customer getCustomer(Integer id) {\n\t\treturn customerDao.findById(id);\n\t}", "public Customer getCustomer(int id) {\r\n\t\treturn manager.getCustomer(id);\r\n\t}", "com.google.ads.googleads.v6.resources.Customer getCustomer();", "public org.tempuri.Customers getCustomer() {\r\n return customer;\r\n }", "@Override\r\n\tpublic int getCustomerIdCustomerDistribution(int CostomerorId) {\n\t\tList<?> resultList = null;\r\n\t\tString sql1= \"SELECT DISTINCT company_id FROM companiesusers where user_id='\"+CostomerorId+\"'\";\r\n\t\tresultList= dao.executeSQLQuery(sql1);\r\n\t\tObject l = resultList.get(0);\r\n\t\tint Customer_ID = Integer.valueOf(String.valueOf(l));\t\r\n\t\t\r\n\t\t\r\n\t\treturn Customer_ID;\r\n\t}", "@Override\n public String getCustomer() {\n return this.customerName;\n }", "public void setCustomerId(Long customerId) {\n this.customerId = customerId;\n }", "Customer getCustomerById(int customerId);", "public void setCustomer_id(int customer_id){\n this.customer_id = customer_id;\n }", "public Customer getCustomer() {\r\n\t\treturn this.customer;\r\n\t}", "public Customer getCustomer() {\r\n\t\treturn customer;\r\n\t}", "public Customer getCustomer() {\r\n\t\treturn customer;\r\n\t}", "public Customer getCustomer() {\n\t\treturn customer;\n\t}", "public java.lang.String getCustIdNbr() {\n return custIdNbr;\n }", "public void setCustomerId(int customerId) \n {\n this.customerId = customerId;\n }", "public io.opencannabis.schema.commerce.OrderCustomer.Customer getCustomer() {\n return customer_ == null ? io.opencannabis.schema.commerce.OrderCustomer.Customer.getDefaultInstance() : customer_;\n }", "public static int getCustomerId(String customerName)\n {\n int customerID = 0;\n try {\n Statement statement = DBConnection.getConnection().createStatement();\n String customerIdQuery = \"SELECT Customer_ID FROM customers WHERE Customer_Name='\" + customerName + \"'\";\n PreparedStatement ps = DBConnection.getConnection().prepareStatement(customerIdQuery);\n ResultSet rs = ps.executeQuery();\n\n while(rs.next()) {\n customerID = rs.getInt(\"Customer_ID\");\n return customerID;\n }\n } catch (SQLException e) {\n System.out.println(\"SQLException: \" + e.getMessage());\n }\n return customerID;\n }", "public void setCustomerId(String customerId) {\n this.customerId = customerId;\n }", "public void setCustomerId(String customerId) {\n this.customerId = customerId;\n }", "@Override\n\tpublic Customer getCustomer(int theId) {\n\t\tSession currentSession = sessionFactory.getCurrentSession();\n\n\t\t// now retrieve/read from database using the primary key\n\t\tCustomer theCustomer = currentSession.get(Customer.class, theId);\n\n\t\treturn theCustomer;\n\t}", "@Override\n\tpublic Customer getCustomer(int theId) {\n\t\tSession currentSession = sessionFactory.getCurrentSession();\n\t\t\n\t\t// now retrieve/read from database using the primary key\n\t\tCustomer theCustomer = currentSession.get(Customer.class, theId);\n\t\t\n\t\treturn theCustomer;\n\t}", "@Override\n public java.lang.String getDealerId() {\n return _entityCustomer.getDealerId();\n }" ]
[ "0.8864921", "0.8864921", "0.8738213", "0.85787255", "0.85650635", "0.8548407", "0.8469353", "0.8456901", "0.8456901", "0.8401053", "0.8401053", "0.83955944", "0.8352961", "0.83431536", "0.8332763", "0.83272725", "0.8281025", "0.8275612", "0.8259888", "0.81980133", "0.81980133", "0.8140639", "0.80907106", "0.79993296", "0.79895467", "0.7937168", "0.79250723", "0.79250723", "0.79043484", "0.7842443", "0.7833123", "0.7833123", "0.7795032", "0.77451855", "0.75635886", "0.7561599", "0.7450588", "0.7441357", "0.7406136", "0.74059623", "0.73770905", "0.73577464", "0.73325676", "0.7302549", "0.72887236", "0.7223217", "0.72060114", "0.7160777", "0.7113133", "0.7052842", "0.70429385", "0.7020631", "0.6960935", "0.69413465", "0.6938859", "0.6921458", "0.6911099", "0.69002616", "0.68785477", "0.685809", "0.68473005", "0.6842941", "0.682491", "0.67965746", "0.6796527", "0.67943305", "0.6754635", "0.6751039", "0.67489207", "0.67062896", "0.6684946", "0.66752195", "0.6644485", "0.6634529", "0.66298765", "0.6573866", "0.65456456", "0.65441215", "0.6538142", "0.65375227", "0.65229", "0.65203196", "0.65188926", "0.65180403", "0.6512013", "0.6508314", "0.6503112", "0.6496905", "0.6490958", "0.6490958", "0.6487414", "0.6481742", "0.64777595", "0.6474399", "0.6468718", "0.64598656", "0.64598656", "0.64570916", "0.6455151", "0.64538354" ]
0.8689196
3
Adds the credit card.
public void addCreditCard(CreditCard creditCard) { creditCards.add(creditCard); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic String addNewCreditCard(CreditCard creditCard) {\n\t\t\n\t\tCreditCard newCreditCard = new CreditCard();\n\t\tnewCreditCard.setCardNumber(creditCard.getCardNumber());\n\t\tnewCreditCard.setAccountHolderName(creditCard.getAccountHolderName());\n\t\tnewCreditCard.setCreditLimit(creditCard.getCreditLimit());\n\t\tnewCreditCard.setBalance(CreditCardValidationMessages.DEFAULT_BALANCE);\n\t\t\n\t\tcreditCardDao.save(newCreditCard);\n\t\treturn CreditCardValidationMessages.SUCCESS;\n\t\t\n\t\t\n\t}", "public void addPartnerCard(Card card);", "public void addCard(Card card) {\r\n SQLiteDatabase db = this.getWritableDatabase();\r\n \r\n ContentValues values = new ContentValues();\r\n values.put(COL_ACCOUNT, card.getAccount()); \r\n values.put(COL_USERNAME, card.getUsername()); \r\n values.put(COL_PASSWORD, card.getPassword()); \r\n values.put(COL_URL, card.getUrl()); \r\n values.put(COL_DELETED, card.getDeleted()); \r\n values.put(COL_HIDE_PWD, card.getHidePwd()); \r\n values.put(COL_REMIND_ME, card.getRemindMe()); \r\n values.put(COL_UPDATED_ON, card.getUpdatedOn()); \r\n values.put(COL_COLOR, String.valueOf(card.getColor()));\r\n values.put(COL_REMIND_ME_DAYS, card.getRemindMeDays());\r\n \r\n db.insert(TABLE_CARDS, null, values);\r\n db.close(); \r\n }", "CarPaymentMethod creditCardNumber(String cardNumber);", "@Override\n\tpublic String addCard(String name, String cpasswd, int vid, double cmoney) {\n\t\treturn cb.addCard(name, cpasswd, vid, cmoney);\n\t}", "void addCard(Card card) {\n\t\t_hand.addCard(card);\n\t}", "public void addCard(Card c){\n cards.add(c);\n }", "public void creditCard() {\n\t\tSystem.out.println(\"hsbc --- credit card\");\n\t\t\n\t}", "public void addCard(Card c)\n {\n cards.add(c);\n }", "private void addCard() {\n Intent intent = new Intent(this, NewCard.class);\n intent.putExtra(\"cardSetId\", cardSetId);\n startActivity(intent);\n }", "public void addCard(Card card) {\r\n\t\tcards.add(card);\r\n\t}", "public void addCc(String cc, String key) throws CreditCardAPIException;", "public void add(Card card) {\n this.cards.add(card);\n }", "public void addCard(Card card) {\r\n\t\tthis.cards.add(card);\r\n\t}", "public void addCard(Card cardToAdd) {\n storageCards.add(cardToAdd);\n }", "public void addChargeCard(ChargeCard chargeCard) {\r\n chargeCards.add(chargeCard);\r\n }", "public void addCard(Card card) {\n\t\tthis.content.add(card);\n\t}", "public abstract void addCard();", "public void addCard(Card card) {\n this.deck.push(card);\n }", "public CreditCard addCreditCard(int donorId, String creditCardNumber, int donationAmount) {\n CreditCard creditCard = new CreditCard(donorId, creditCardNumber, donationAmount);\n creditCardNumbers.add(creditCard);\n return creditCard;\n }", "public int addCard(int userID) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn CreditCardDA.addCard(userID, number, expirationDate, type, csc);\r\n\t}", "public void addCard(Card c) {\n\t\tthis.hand.addCard(c);\n\t}", "public void addCard(Card card) {\n personHand.add(card);\n }", "public void credit(double amount) {\n this.balance += amount;\n }", "void addCustomerCard(CardDto cardDto, String name) throws EOTException;", "public CardView addCard(Card card) {\n return addCard(card, false);\n\n }", "public void addCard(Card c)\n {\n hand.add(c);\n }", "public void addCard(Card c) {\r\n\t\thand.add(c);\r\n\t}", "public void credit() {\n\t\tSystem.out.println(\"HSBC Credit\");\n\t}", "private void credit(APDU apdu) {\n\n // access authentication\n if ( ! pin.isValidated() )\n ISOException.throwIt(\n SW_PIN_VERIFICATION_REQUIRED);\n\n byte[] buffer = apdu.getBuffer();\n\n // Lc byte denotes the number of bytes in the\n // data field of the command APDU\n byte numBytes = buffer[ISO7816.OFFSET_LC];\n\n // indicate that this APDU has incoming data\n // and receive data starting from the offset\n // ISO7816.OFFSET_CDATA following the 5 header\n // bytes.\n byte byteRead =\n (byte)(apdu.setIncomingAndReceive());\n\n // it is an error if the number of data bytes\n // read does not match the number in Lc byte\n if ( ( numBytes != 1 ) || (byteRead != 1) )\n ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);\n\n // get the credit amount\n byte creditAmount =\n buffer[ISO7816.OFFSET_CDATA];\n\n // check the credit amount\n if ( ( creditAmount > MAX_TRANSACTION_AMOUNT)\n || ( creditAmount < 0 ) )\n ISOException.throwIt\n (SW_INVALID_TRANSACTION_AMOUNT);\n\n // check the new balance\n if ( (short)( balance + creditAmount) > MAX_BALANCE )\n ISOException.throwIt\n (SW_EXCEED_MAXIMUM_BALANCE);\n\n // credit the amount\n balance = (short)(balance + creditAmount);\n\n }", "public void addAccount() {\n\t\t\n\t\ttry {\n\t\t\tlog.log(Level.INFO, \"Please enter name\");\n String custName = scan.next();\n validate.checkName(custName);\n \t\tlog.log(Level.INFO, \"Select Account Type: \\n 1 for Savings \\n 2 for Current \\n 3 for FD \\n 4 for DEMAT\");\n\t\t\tint bankAccType = Integer.parseInt(scan.next());\n\t\t\tvalidate.checkAccType(bankAccType);\n\t\t\tlog.log(Level.INFO, \"Please Enter your Aadar Card Number\");\n\t\t\tString aadarNumber = scan.next();\n\t\t\tlog.log(Level.INFO, \"Please Enter Phone Number: \");\n\t\t\tString custMobileNo = scan.next();\n\t\t\tvalidate.checkPhoneNum(custMobileNo);\n\t\t\tlog.log(Level.INFO, \"Please Enter Customer Email Id: \");\n\t\t\tString custEmail = scan.next();\n\t\t\tvalidate.checkEmail(custEmail);\n\t\t\tbankop.add(accountNumber, custName, bankAccType, custMobileNo, custEmail, aadarNumber);\n\t\t\taccountNumber();\n\t\t\n\t\t} catch (AccountDetailsException message) {\n\t\t\tlog.log(Level.INFO, message.getMessage()); \n }\n\n\t}", "private void addCardToDeck(Card card) {\n\t\tdeck.add(card);\n\t}", "public void addCard(Card card) {\n myCards.add(card);\n cardNumber = myCards.size();// reset the number of cards\n }", "@Override\n\tpublic boolean addCard(UnoCard card){\n\t\treturn this.cardList.add(card);\n\t}", "public void creditcard() {\n\t\tBy cd=By.xpath(\"//input[@name='creditCard']\");\r\n\t\tWebElement W_cd=wt.WaitForElement(cd, 10);\r\n\t\tW_cd.sendKeys(\"5462897859858\");\r\n\t\t\r\n\t\t}", "public void setCreditCardAccount(CreditCardAccount newCreditCard) {\n this.creditCardAccount = newCreditCard;\n }", "public void addCard(Card card){\n\t\tthis.pile.add(0, card);\n\t}", "public int addCreditAccount(long pNr) throws SQLException {\r\n\t\tint accountId = -1;\r\n\r\n\t\t_db.connect();\r\n\r\n\t\tCustomer _cust = _db.findCustomer(pNr);\r\n\t\tif (_cust != null) {\r\n\t\t\tAccount _ac = new CreditAccount(0, 0.5, 7, 5000);\r\n\t\t\taccountId = _db.addAccount(_ac, pNr);\r\n\t\t}\r\n\r\n\t\t_db.disconnect();\r\n\r\n\t\treturn accountId;\r\n\t}", "public void AddCard(Card card) {\n mCard[mCardCount++] = card;\n SetCardPosition(mCardCount - 1);\n }", "public void addCard(Card card)\n {\n if (card1 == null)\n {\n card1 = card;\n }\n else if (card2 == null)\n {\n card2 = card;\n }\n }", "public void addCard(Card e) {\n\t\tthis.deck.add((T) e);\n\t}", "CarPaymentMethod processCreditCard();", "public void addDealerCard() {\r\n dealerHand.addCard(cardDeck.rCard());\r\n }", "public void addCard(Cards card, boolean canUse) {\n \t\tif (canUse) {\n \t\t\tcards[card.ordinal()] += 1;\n \t\t\tusedCard = false;\n \t\t} else {\n \t\t\tnewCards.add(card);\n \t\t}\n \t}", "public void addCard(Deck deck, Card card) {\n deck.cards.add(card);\n }", "public ResultMessage addCreditRecord(CreditRecordPO po) throws RemoteException {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic void add(CreditCard ...t) {\n\t\tfor(CreditCard card:t)\r\n\t\t this.cardList.add(card);\r\n\t}", "public void addCard(Card card)\n\t{\n\t\t\n\t\t// Add the new Card to the list\n\t\tcards.add(card);\n\t\t\n\t\t// Remove and re-add all cards\n\t\tsyncCardsWithViews();\n\t\t\n\t}", "public int addCard(Card card) {\n\t\thand.add(card);\n\t\tif(!isDealer) {\n\t\t\tSystem.out.println(\"Dealt a \" + card);\n\t\t}\n\t\treturn handValue();\n\t}", "private void addCard(){\n WebDriverHelper.clickElement(addCard);\n }", "public void AddCredits(int credits)\n {\n this.credits += credits;\n }", "private void setUpCreditCardViews() {\n\n mSingleLineCardEntry = (SingleLineCardEntryView) mView.findViewById(R.id.credit_card_number);\n\n\n mAddCreditCard = (Button) mView.findViewById(R.id.add_card);\n mAddCreditCard.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n\n AnalyticsHelper.getInstance(getActivity()).logEvent(\"Added Credit Card\");\n\n if (mSingleLineCardEntry.isValid()){\n progressDialog = new TapFitProgressDialog(getActivity());\n progressDialog.setMessage(\"Adding Credit Card...\");\n progressDialog.show();\n UserRequest.addPaymentMethod(getActivity(), BraintreePayments.encryptPayment(mSingleLineCardEntry.getCardDetails()), addCardCallback);\n }\n }\n });\n\n //mSingleLineCardEntry.getCardDetails().\n /*mExpirationDate = (EditText) mView.findViewById(R.id.expiration_date);\n mExpirationDate.addTextChangedListener(expirationListener);\n\n mExpirationDate.setNextFocusDownId(R.id.cvv);\n\n mPostalCode = (EditText) mView.findViewById(R.id.postal_code);\n mSecurityCode = (EditText) mView.findViewById(R.id.cvv);\n\n mSecurityCode.setNextFocusDownId(R.id.postal_code);*/\n }", "public void setPaymentInfoInCart(CreditCard cc);", "public void credit() {\n\t\tSystem.out.println(\"HSBC---credit\");\n\t}", "public void credit() {\n\t\tSystem.out.println(\"HSBC---credit\");\n\t}", "@Override\n\tpublic void payCreditCard() {\n System.out.println(\"creditcard payed\");\t\t\n\t}", "@Override\n public void onClick(View view) {\n addCredit();\n }", "public void setCreditcard(CreditCard creditcard) {\n\t\tthis.creditcard = creditcard;\n\t}", "public void setCreditCard(String creditCard)\n\t{\n\t\tm_creditCard = creditCard;\n\t}", "public void credit(){\n\t\tSystem.out.println(\"HSBC BANK :: CREDIT\");\n\t}", "public void add (Card newCard)\n {\n firstLink = new Link(newCard, firstLink);\n }", "public void addCard(String cardName) {\n if(isInDeck(cardName)==false){\n cards.add(new Card(cardName));\n System.out.println(\"Added\");\n }else{\n System.out.println(\"Its already in deck\");\n }\n }", "public CreditCard(int pin, String number, String holder, Date expiryDate, int cvc){\r\n this.pin = pin;\r\n this.number = number;\r\n this.holder = holder;\r\n this.expiryDate = expiryDate;\r\n this.cvc = cvc;\r\n}", "public void drawCard(Card card) {\n hand.addCard(card);\n }", "public com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.creditcard.v1.CreditCard getCreditCardReq(CreditCard creditCard){\n\t\tcom.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.creditcard.v1.CreditCard creditCardReq = \n\t\t\tnew com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.creditcard.v1.CreditCard();\n\t\t\n\t\tcreditCardReq.setStreet( creditCard.getStreet() );\n\t\tcreditCardReq.setCity( creditCard.getCity() );\n\t\tcreditCardReq.setState( creditCard.getState() );\n\t\tcreditCardReq.setPostalCode( creditCard.getPostalCode() );\n\t\tcreditCardReq.setDistrict( creditCard.getDistrict() );\n\t\tcreditCardReq.setCountryCode( creditCard.getCountryCode() );\n\t\tcreditCardReq.setTelephone( creditCard.getTelephone() );\n\t\tcreditCardReq.setAmountUSD( new Double(creditCard.getAmountUSD()) );\n\t\tcreditCardReq.setPassengerId( creditCard.getPassengerId() );\n\t\tcreditCardReq.setCVVCode( creditCard.getCVVCode() );\n\t\tcreditCardReq.setDescription( creditCard.getDescription() );\n\t\tcreditCardReq.setUseSameCard( Character.toString(creditCard.getUseSameCard()) );\n\t\tcreditCardReq.setOtherCardHolderFlag( Character.toString(creditCard.getOtherCardHolderFlag()) );\n\t\tcreditCardReq.setOtherCardHolderEmail( creditCard.getOtherCardHolderEmail() );\n\t\tcreditCardReq.setCardType( creditCard.getCardType() );\n\t\tcreditCardReq.setName( creditCard.getName() );\n\t\tcreditCardReq.setCardNo( creditCard.getCardNo() );\n\t\tcreditCardReq.setExpiryMonth( creditCard.getExpiryMonth() );\n\t\tcreditCardReq.setExpiryYear( creditCard.getExpiryYear() );\n\t\tcreditCardReq.setAmount( new Double(creditCard.getAmount()) );\n\t\tcreditCardReq.setLastName( creditCard.getLastName() );\n\t\tcreditCardReq.setFirstName( creditCard.getFirstName() );\n\t\tcreditCardReq.setPaymentDate( creditCard.getPaymentDate() );\n\t\t\n\t\treturn creditCardReq;\n\t}", "public void addToUse(int card) {\r\n\t\tthis.toUse.add(card);\r\n\t}", "public boolean addCard(VentraCard card){\n \tboolean isExist = true;\n \t\n \tfor(int i=0; i<allCards.size(); i++ ) {\n \t\tif(card.getCardNumber() == allCards.get(i).getCardNumber()\n \t \t&& card.getPhoneNumber().equals(allCards.get(i).getPhoneNumber())) {\n \t\t\tisExist = false;\n \t\t}\t\n \t}\n \tif(isExist == true) { // if(isExist)\n \t\tallCards.add(card);\t\n \t\treturn true;\n \t}\n \t\n return false;\n }", "public boolean rulesForAddingCard(Card card)\n\t{\n\t\treturn true;\n\t}", "public void add(CarerAccount acc) {\n CarerAccounts.add(acc);\n }", "public void setCreditCard(eBLBaseComponents.apis.ebay.CreditCardDetailsType creditCard) {\r\n this.creditCard = creditCard;\r\n }", "private void saveNewCreditCard(String name, String cardNumber, String month, String year) {\n inputData(nameOnCardInputLocator, name);\n inputData(cardNumberInputLocator, cardNumber);\n setJsDropDownOption(expirationMonthDropDownLocator, month);\n setJsDropDownOption(expirationYearDropDownLocator, year);\n clickElement(addYourCardButtonLocator);\n }", "public void addCardToHand(final Card card) {\n\t\tcahActivity.runOnUiThread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tcahActivity.addCardToHand(card);\n\t\t\t}\n\t\t});\n\t}", "public void addToDeck(Card card) {\n\t\tcards.add(card);\n\t}", "public void credit(){\n\t\tSystem.out.println(\"hdfcbank credited\");\n\t\t\n\t}", "public void credit(){\n\t\tSystem.out.println(\"hsbc --- credit\");\n\t}", "public void add(Card card){\n if (numCards < deckSize - 1) {\n this.deck[numCards] = card;\n numCards++;\n }else {\n System.out.println(\"Deck is full!\");\n }\n }", "public void credit() {\n \tSystem.out.println(\"HSBC--Credit--from US Bank\");\n }", "public void addCard(Card newcard)\n\t{\n\t\thand[numCards++] = newcard;\n\t\tscore += newcard.getValue();\n\t}", "@Override\n\tpublic void pay() {\n\t\tcreditCard.makePayment();\n\n\t}", "public void addCard(PlayingCard aCard);", "private void fireCreditCardTokenCreation() {\n Card creditCard = binding.creditCardInputWidget.getCard();\n\n Stripe stripe = new Stripe(this, Utils.STRIPE_PUBLISHABLE_KEY);\n stripe.createToken(\n creditCard,\n new TokenCallback() {\n public void onSuccess(Token token) {\n // Credit card token has been successfully created\n // Update order object in database\n placeOrder(token);\n\n progressDialog.dismiss();\n\n // Proceed to confirmation activity\n proceedToConfirmation();\n }\n public void onError(Exception error) {\n // Show localized error message\n Toast.makeText(PaymentActivity.this, error.getLocalizedMessage(), Toast.LENGTH_LONG)\n .show();\n }\n });\n }", "@Override\r\n\tpublic void buyCard() {\n\t\t\r\n\t}", "public void credit(float amount){\n\t\taccount.credit(amount);\n\t\tSystem.out.println(\"\\t+ \"+ this + \" account is credited with \" + amount + \" euros; its balance is now \" + account );\n\t}", "@Test\n\tpublic void testAddMoney() {\n\t\tcard.addMoney(200);\n\t\tassertEquals(300.0, card.getBalance());\n\t}", "public void addToDeck(Card c)\r\n\t{\r\n\t\tdeck.add(c);\r\n\t}", "public void takeACard(Card card){\n hand.add(card);\n }", "public void setPaymentMethodCode_CreditCard() {\n setPaymentMethodCodeAsPaymentMethod(AppCDef.PaymentMethod.CreditCard);\n }", "public CreditCardAccount getCreditCardAccount() {\n return this.creditCardAccount;\n }", "public int getCreditCardNumber() {\n return creditCardNumber;\n }", "private void credit(String name, int amount) {\n\t\ttry {\n\t\t\tif (clients.containsKey(name)) {\n\t\t\t\tProfile p = clients.get(name);\n\t\t\t\tp.deductBalance(amount);\n\t\t\t\tsynchronized (CreditCardProcess.class) {\n\t\t\t\t\tclients.put(name, p);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Throwable e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}", "public void registerCard(String alias, int card_nr, String Bank_name) {\n }", "public void credit() {\n\t System.out.println(\"HSBC--Credit\");\t\t\n\t}", "public void addCompositeAmount(ArmCurrency compositeAmount) {\n try {\n this.compositeAmount = this.compositeAmount.add(compositeAmount);\n } catch (CurrencyException ex) {\n System.out.println(\"currency excpetion: \" + ex);\n }\n }", "@Override\n\tpublic void credit() {\n\t\t// TODO Auto-generated method stub\n\t\tSystem.out.println(\"hsbc credit\");\n\t}", "public void addResourceCard(HexType type){\n \n }", "public void add(Cards cs) {\r\n\t\tfor (int i = 0; i < cs.getSize(); i++) {\r\n\t\t\tcards.addCard(cs.getCard(i));\r\n\t\t}\r\n\t\tseedCards.add(cs);\r\n\t}", "public void add(Card c) {\n cards.add(c);\n orginalOrder.add(c);\n cardsPerSuit[c.getSuit().ordinal()]++;\n calculateValue();\n\n }", "void registerIDCard(IDCard idCard) {\n registeredIDCardList.add(idCard);\n }", "public void clickadd_card() \n\t{\n\t\n\t\tdriver.findElement(add_card).click();\n\n }", "private void addCard() { \n\t\tint sic_idHolder; // declares sic_idHolder\n\t\tString titleHolder; // declares titleHolder\n\t\tString authorHolder; // declares authorHolder\n\t\tdouble priceHolder; // declares priceHolder\n\t\tint quantityHolder; // declares quantityHolder\n\t\t\n\t\t\n\t\tSystem.out.println(\"Making a new card:\\nPlease enter the new SIC-ID: \");\n\t\tsic_idHolder = scan.nextInt(); // prompts user to input the ID\n\t\tscan.nextLine();\n\t\t\n\t\tif(inventoryObject.cardExists(sic_idHolder) != true) {\n\t\t\tSystem.out.println(\"Please enter the title of the book: \");\n\t\t\ttitleHolder = scan.next(); // prompts user to input the title\n\t\t\tscan.nextLine();\n\t\t\tSystem.out.println(\"Please enter the author of the book\");\n\t\t\tauthorHolder = scan.next(); // prompts user to input the author\n\t\t\tscan.nextLine();\n\t\t\tSystem.out.println(\"Please enter the price of the book\");\n\t\t\tpriceHolder = scan.nextDouble(); // prompts user to input the price\n\t\t\tscan.nextLine();\n\t\t\n\t\t\tif(priceHolder < 0) { // checks to make sure priceHolder is positive\n\t\t\t\tSystem.out.println(\"ERROR! Price must be greater than or equal to 0:\");\n\t\t\t\tgetUserInfo();\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Please enter the number of books in invetory\");\n\t\tquantityHolder = scan.nextInt(); // prompts user to input the quantity\n\t\tscan.nextLine();\n\t\t\n\t\tif(quantityHolder <= 0) { // checks to make sure quantity isn't less than 1\n\t\t\tSystem.out.println(\"Error! Quantity must be greater than 0\\n\"); \n\t\t\tgetUserInfo();\n\t\t}\n\t\tinventoryObject.addStockIndexCard(sic_idHolder, titleHolder, authorHolder, priceHolder, quantityHolder); // calls addStockIndexCard from InventoryManagement\n\t\tgetUserInfo();\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"ERROR: The ID you entered is already in the system\\n\");\n\t\t\tgetUserInfo();\n\t\t}\n\t}" ]
[ "0.7154", "0.70711917", "0.70017266", "0.6910564", "0.69089293", "0.6773439", "0.6721009", "0.6718366", "0.666996", "0.6629028", "0.6617708", "0.6609613", "0.66049755", "0.65911674", "0.6583996", "0.6566925", "0.6559688", "0.65542024", "0.65379286", "0.64850575", "0.6472452", "0.6471345", "0.6448143", "0.6430843", "0.64290875", "0.63903105", "0.6389406", "0.6375665", "0.63721335", "0.63703954", "0.63678116", "0.63011885", "0.6297589", "0.6285136", "0.62842304", "0.6279182", "0.6277899", "0.62769735", "0.62583834", "0.6254919", "0.6231338", "0.6230588", "0.622767", "0.62171745", "0.62128913", "0.6202113", "0.62012964", "0.6194205", "0.6186036", "0.6179501", "0.6178701", "0.6168022", "0.616127", "0.6149876", "0.6149876", "0.61098707", "0.6097206", "0.6093927", "0.6091851", "0.60838115", "0.60823756", "0.6077578", "0.6073922", "0.60333884", "0.60187685", "0.60157585", "0.60133946", "0.6003905", "0.60012895", "0.59918153", "0.59917563", "0.5989534", "0.59891903", "0.598069", "0.5977412", "0.59603703", "0.59602463", "0.5954547", "0.59489244", "0.5928518", "0.5918783", "0.591409", "0.59043384", "0.5900634", "0.5899008", "0.58900344", "0.5881997", "0.58782756", "0.5873521", "0.5860189", "0.5850677", "0.58503824", "0.584906", "0.5831857", "0.5830396", "0.5828456", "0.58162636", "0.58122826", "0.5811558", "0.581014" ]
0.795205
0
Removes the credit card. If a customer only has one credit card, it will not be removed.
public void removeCreditCard(String cardNumber) { if (searchCard(cardNumber) == null) { System.out.println("The card number entered does not exist for the customer " + getCustomerId()); } else { if (creditCards.size() == 1) { System.out.println("This is the only card associated with this account and cannot be removed. "); } else { CreditCard creditCard = searchCard(cardNumber); creditCards.remove(creditCard); System.out.println("The credit card: " + creditCard.cardNumberFormatter(creditCard.getCardNumber()) + " has been removed from customer " + getCustomerId()); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int deleteCard() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn CreditCardDA.deleteCard(id);\r\n\t}", "public void removePresentCard() {\n storageCards.remove();\n }", "public void removeCustomer(){\n String message = \"Choose one of the Customer to remove it\";\n if (printData.checkAndPrintCustomer(message)){\n subChoice = GetChoiceFromUser.getSubChoice(data.numberOfCustomer());\n if (subChoice!=0){\n data.removeCustomer(data.getCustomer(subChoice-1),data.getBranch(data.getBranchEmployee(ID).getBranchID()));\n System.out.println(\"Customer has removed Successfully!\");\n }\n }\n }", "public static void removeBankAccount(Customer customer) {\r\n\t\tcustomerBankAccountList.remove(customer);\t\r\n\t}", "void removeCustomer(Customer customer);", "public void findAndRemoveCard(Card c){\n\t\tboolean b = myCards.remove(c);\n//\t\tSystem.out.println(\"mycards size\" + myCards.size() + \"and removed was \" + b);\n\t\treturn;\n\t}", "private void removeCard() {\n\t\tint sic_idHolder; // declares sic_idHolder\n\t\t\n\t\tSystem.out.println(\"Please enter the SIC ID number you'd like to remove:\");\n\t\tsic_idHolder = scan.nextInt(); // prompts user to input sic_idHolder\n\t\tscan.nextLine();\n\t\t\n\t\tinventoryObject.removeStockIndexCard(sic_idHolder); //calls removeStockIndexCard from InventoryManagement\n\t\tgetUserInfo();\n\t}", "BrainTreeCustomerResult removeCustomer(BrainTreeCustomerRequest request);", "@Override\r\n\tpublic void removeCustomer() {\n\t\t\r\n\t}", "public void remove(Card card) {\r\n\t\tcards.remove(card);\r\n\t}", "@Override\n\tpublic String deleteCard(int cid) {\n\t\treturn cb.deleteCard(cid);\n\t}", "public void removeCard(UnoCard cardToRemove){\n for (UnoCard c : this.cards){\n if (c.getName().equals(cardToRemove.getName())){\n Log.d(\"Removed Card:\", c.getName());\n this.cards.remove(c);\n break;\n }\n }\n }", "public void cancelCard(String cardNumber) {}", "public boolean delete(String cardid);", "public void deleteCc(String cc, String key) throws CreditCardAPIException;", "public CreditCard removeCreditCard(int donorID, String ccNumber) {\n CreditCard cc = search(donorID, ccNumber);\n if (cc == null) {\n return null;\n } else {\n creditCardNumbers.remove(cc);\n return cc;\n }\n }", "public Boolean removeCustomer() {\r\n boolean ok = false;\r\n\t\t//Input customer phone.\r\n\t\tString phone = readString(\"Input the customer phone: \");\r\n\t\tCustomer f = my.findByPhone(phone);\r\n\t\tif (f != null) {\r\n ok = my.remove(f);\r\n\t\t\t\r\n\t\t}\r\n\t\telse alert(\"Customer not found\\n\");\t\r\n return ok;\r\n\t}", "@Override\n\tpublic String deletecard(String phonum) {\n\t\treturn this.vd.deletecard(phonum)?\"删除成功\":\"删除失败\";\n\t}", "public void deleteCard(Card card)\n\t{\n\t\tcards.remove(card);\n\t\t\n\t\t// Remove and re-add all cards\n\t\tsyncCardsWithViews();\n\t\t\n\t}", "@WebMethod public void removePaymentMethod(Account user,String card);", "@Override\n\tpublic void removeCustomer(Customer customer) throws Exception {\n\t\tConnection con = pool.getConnection();\n\t\t\n\t\tCustomer custCheck = getCustomer(customer.getId());\n\t\tif(custCheck.getCustName() == null)\n\t\t\tthrow new Exception(\"No Such customer Exists.\");\n\t\t\n\t\tif(custCheck.getCustName().equalsIgnoreCase(customer.getCustName()) && customer.getId() == custCheck.getId()) {\n\t\t\ttry {\n\t\t\t\t\tStatement st = con.createStatement();\n\t\t\t\t\tString remove = String.format(\"delete from customer where id in('%d')\", \n\t\t\t\t\t\tcustomer.getId());\n\t\t\t\t\tst.executeUpdate(remove);\n\t\t\t\t\tSystem.out.println(\"Customer removed successfully\");\n\t\t\t} catch (SQLException e) {\n\t\t\t\tSystem.out.println(e.getMessage() + \" Could not retrieve data from DB\");\n\t\t\t}finally {\n\t\t\t\ttry {\n\t\t\t\t\tConnectionPool.getInstance().returnConnection(con);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@PreRemove\n public void removeCouponFromCustomer(){\n for (Customer customer: purchases){\n customer.getCoupons().remove(this);\n }\n }", "for (Card ca : deck) {\n\t\tif (ca.suit == 'c') {\n\t\t\tdeck.remove(ca);\n\t\t}\n\t}", "public Card removeFirstCard()\n {\n return cards.remove(0);\n }", "public void remove(Card c) {\n\t\t\t// TODO. \n\t\t\t// No loops allowed!\n\t\t\t// Make sure to test invariant!\n\t\t\tassert wellFormed() : \"invariant false on entry to remove()\";\n\n\t\t\tif(c.group != this) throw new IllegalArgumentException(\"Card is not part of group\");\n\n\t\t\tif(c == this.first) {\n\t\t\t\tif(this.first.next != null) {\n\t\t\t\t\tthis.first = this.first.next;\n\t\t\t\t\tthis.first.prev = null;\n\t\t\t\t}else {\n\t\t\t\t\tthis.first = null;\n\t\t\t\t\tthis.last = null;\n\t\t\t\t}\n\n\t\t\t}else if(c == this.last) {\n\t\t\t\tthis.last = this.last.prev;\n\t\t\t\tthis.last.next = null;\n\t\t\t}else {\n\n\t\t\t\tc.prev.next = c.next;\n\t\t\t\tc.next.prev = c.prev;\n\n\t\t\t}\n\n\t\t\tc.group = null;\n\t\t\tc.next = null;\n\t\t\tc.prev = null;\n\n\t\t\t--this.size;\n\n\t\t\tassert wellFormed() : \"invariant false on return to remove()\";\n\n\t\t}", "public void removeCard(int index) {\n cards.remove(index);\n }", "public void deleteCard(String user_id, String card_id) throws IOException {\n\t\t\n\t\tBasicDBObject document = new BasicDBObject();\n\t\tdocument.put(\"card_id\", card_id);\n\t\tcoll2.remove(document);\n\t\t\n\t\t\t\t\n\t}", "public void showCreditCardByCustomerName(String string) {\n\t\tSystem.out.println(\"Mostrant credit cards del customer \" + string);\n\n\t\tObjectSet<Customer> customers = db.query(new Predicate<Customer>() {\n\t\t\tpublic boolean match(Customer customer) {\n\t\t\t\treturn customer.getName().equalsIgnoreCase(string);\n\t\t\t}\n\t\t});\n\t\tcustomers.stream()\n\t\t\t\t.peek(System.out::println)\n\t\t\t\t.forEach(c -> System.out.println(c.getCreditCard()));\n\t}", "public void removeUser(Customer user) {}", "public void deleteCard(int cardId)\n {\n dbObj=new dbFlashCards(uid);\n dbObj.deleteCard(cardId, packId);\n \n \n }", "public void RemoveCardFromComputer(int value){\n handComputer.remove(value);\n }", "public Customer removeCustomer(){\n Customer removed = customerArray[outIndex];\n outIndex++;\n if(outIndex== cMaxCustomerQueue) outIndex=0;\n numCustomers--;\n return removed;\n }", "void removeCustomer(String code) throws CustomerCodeNotExistsException;", "public void removeCard(Card rCard, int id)\n\t{\n\t\tfor (int x = 0; x < hands[id].size(); x++) //look at each card in hand\n\t\t{\n\t\t\tCard cCard = hands[id].getCardAtSlot(x);\n\t\t\tif (rCard.getCardID() == cCard.getCardID())\n\t\t\t{\n\t\t\t\thands[id].remove(cCard);\n\t\t\t}\n\t\t}\n\t}", "public void RemoveCardFromDeck(int value){\n deck.remove(value);\n }", "public void discardCard(int player, Card card) {\r\n\t\tplayers.get(player).removeCard(card);\r\n\t\tdiscardPile.addCard(card);\r\n\t}", "@Secured( { \"ROLE_ADMIN\",\"ROLE_PUBLISH\",\"ROLE_WRITE\" })\n\tpublic void delete (Credit credit);", "@Override\n\tpublic void removeCustomer(Session session){\n\t\ttry{\n\t\t\tSystem.out.print(\"*--------------Remove Customers here--------------*\\n\");\n\t\t\t//scanner class allows the admin to enter his/her input\n\t\t\tScanner scanner = new Scanner(System.in);\n\t\t\t//read input customer id\n\t\t\tSystem.out.print(\"Enter Customer Id to delete the customer: \");\n\t\t\tint customerId = scanner.nextInt();\n\n\t\t\t//pass these input items to client controller\n\t\t\tsamp=mvc.removeCustomer(session,customerId);\n\t\t\tSystem.out.println(samp);\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tSystem.out.println(\"Online Market App- Remove Customer Exception: \" +e.getMessage());\n\t\t}\n\t}", "public Card remove() {\n return (this.cards.size() > 0) ? this.cards.remove(0) : null;\n }", "public void remove(Card card) {\n if (!myTurn()) {\n return;\n }\n if (handPile.contains(card)) {\n //history.add(new CardAction(card, \"Remove: \" + card.getName()));\n handPile.remove(card);\n }\n }", "public TrainCard usedCard(){\n TrainCard removedCard = cardDeck.remove(0);\n return removedCard;\n }", "public void deAuthenticateCustomer() {\n this.currentCustomerAuthenticated = false;\n this.currentCustomer = null;\n }", "public void RemoveCredits(long credits)\n {\n this.credits -= credits;\n }", "public void discard(Card card) {\n if (!myTurn()) {\n return;\n }\n // CardAction cardAct = new CardAction(card, \"Discard: \" + card.getName());\n // history.add(cardAct);\n\n if (handPile.contains(card)) {\n tmpDiscardPile.add(card);\n handPile.remove(card);\n } else {\n tmpDiscardPile.add(card);\n }\n }", "protected void removeChosenCard(Board gameBoard, Card chosenCard) {\n Iterator<Card> it = myCards.iterator();\n Card tempgroundCard= gameBoard.getGroundCard();\n while (it.hasNext()) {\n Card tempCard = it.next();\n if (tempCard.equals(chosenCard)) {\n it.remove();\n // Card tempgroundCard=gameBoard.getGroundCard;\n if (tempgroundCard instanceof WildDrawCard\n || tempgroundCard instanceof ColorChangeCard) {// if the last ground card was Wild set\n // it black again\n gameBoard.getGroundCard().setColor(0);\n }\n gameBoard.setGroundCard(tempCard);\n gameBoard.addToStorage(tempCard);\n if (!(tempCard instanceof DrawCard) && !(tempCard instanceof WildDrawCard)) { // if the Card was't Draw\n gameBoard.resetDraw();\n }\n cardNumber = myCards.size();\n break;\n }\n }\n }", "public boolean removeCustomer(int deleteId) {\n\t\tCallableStatement stmt = null;\n\t\tboolean flag = true;\n\t\tCustomer ck= findCustomer(deleteId);\n\t\tif(ck==null){\n\t\t\tSystem.out.println(\"Cutomer ID not present in inventory.\");\n\t\t\treturn false;\n\t\t}\n\t\t\t\n\t\telse\n\t\t{\n\t\t\tString query = \"{call deleteCustomer(?)}\";\n\t\t\ttry {\n\t\t\t\tstmt = con.prepareCall(query);\n\t\t\t\tstmt.setInt(1, deleteId);\n\t\t\t\tflag=stmt.execute();\n\t\t\t\t//System.out.println(flag);\n\t\t\t} catch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\tSystem.out.println(\"Error in database operation. Try agian!!\");\n\t\t\t\t//e.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\treturn flag;\n\t\t\t\n\t\t}\n\t\t\n\t}", "public void discard(Card card) {\n discardPile.add(card);\n }", "public void remove(Card card)\n {\n deck.remove(card);\n //Add listener to check if the deck is empty (then refill it) or not\n }", "public void cancelCard() {}", "void deleteCustomerDDPayById(int id);", "public void removeACustomer(long id) {\r\n\t\tSystem.out.println(\"\\nRemoving the customer: \" + id);\r\n\t\tEntityManager em = emf.createEntityManager();\r\n\t\tEntityTransaction tx = em.getTransaction();\r\n\t\ttx.begin();\r\n\t\tCustomer2 customer = em.find(Customer2.class, id);\r\n\t\tif(customer == null){\r\n\t\t\tSystem.out.println(\"\\nNo such customer with id: \" + id);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tSystem.out.println(\"\\nCustomer info: \" + customer);\r\n\t\tem.remove(customer);\r\n\t\ttx.commit();\r\n\t\tem.close();\r\n\t}", "public boolean remove(Card c) {\n if (cards.remove(c)) {\n orginalOrder.remove(c);\n cardsPerSuit[c.getSuit().ordinal()]--;\n calculateValue();\n return true;\n }\n return false;\n }", "CarPaymentMethod creditCardNumber(String cardNumber);", "public void removeCard(CardView cardView) {\n removeCard(cardView, false);\n }", "@Override\n\tpublic Candidate removeByIdentityCardNo(String identityCardNo)\n\t\tthrows NoSuchCandidateException, SystemException {\n\t\tCandidate candidate = findByIdentityCardNo(identityCardNo);\n\n\t\treturn remove(candidate);\n\t}", "public void deleteCard(final int id) {\n\t\tif (LOGGER.isDebugEnabled()) {\n\t\t\tLOGGER.debug(\"Start: ERetailCardTypeServiceImpl.deleteCard()\");\n\t\t}\n\t\tCardTypeServiceClient.deleteCard(id);\n\t\tif (LOGGER.isDebugEnabled()) {\n\t\t\tLOGGER.debug(\"End: ERetailCardTypeServiceImpl.deleteCard()\");\n\t\t}\n\n\t}", "public boolean removeCard(Card card) {\n //Iterate through the deck to find the card.\n for (int i = 0; i < this.cards.length; i++)\n if (this.cards[i].equals(card)) {\n //If the card is found, then remove it from the deck.\n //replace it with the topCard\n this.cards[i] = new Card(this.cards[topCard - 1]);\n this.topCard--;\n return true;\n }\n return false;\n }", "public void deleteCustomer(Customer customer) {\n\n\t\tcustomers.remove(customer);\n\n\t\tString sql = \"UPDATE customer SET active = 0 WHERE customerId = ?\";\n\n\t\ttry ( Connection conn = DriverManager.getConnection(URL, USER_NAME, PASSWORD);\n\t\t\t\tPreparedStatement prepstmt = conn.prepareStatement(sql); ) {\n\n\t\t\tint customerId = Customer.getCustomerId(customer);\n\t\t\tprepstmt.setInt(1, customerId);\n\t\t\tprepstmt.executeUpdate();\n\n\t\t} catch (SQLException e){\n\t\t\tSystem.out.println(\"SQLException: \" + e.getMessage());\n\t\t\tSystem.out.println(\"SQLState: \" + e.getSQLState());\n\t\t\tSystem.out.println(\"VendorError: \" + e.getErrorCode());\n\t\t}\n\t}", "@Override\r\n\tpublic Customer removeCustomer(String custId) {\r\n\r\n\t\tOptional<Customer> optionalCustomer = customerRepository.findById(custId);\r\n\t\tCustomer customer = null;\r\n\t\tif (optionalCustomer.isPresent()) {\r\n\t\t\tcustomer = optionalCustomer.get();\r\n\t\t\tcustomerRepository.deleteById(custId);\r\n\t\t\treturn customer;\r\n\t\t} else {\r\n\t\t\tthrow new EntityDeletionException(\"Customer With Id \" + custId + \" does Not Exist.\");\r\n\t\t}\r\n\r\n\t}", "public void chargeCreditCard(Customer c, int amount) {\r\n\t\tc.setavailableAmountInCreditCard(c.getAvailableCreditAmount() - amount);\r\n\t}", "@Override\r\n\tpublic int delete(Integer bankcardid) {\n\t\treturn bankcardMapper.deleteByPrimaryKey(bankcardid);\r\n\t}", "public void removerDebitoCobrado(Conta conta)\n\t\t\tthrows ErroRepositorioException;", "public void dealCard(Player player){\n TrainCard removedCard = draw();\n player.addTrainCard(removedCard);\n }", "private void removeToken(String customerId, String token) {\n // TODO remove the token\n }", "private void clearCreditCardFields() {\r\n\t\tmCardNoValue1.setText(\"\");\r\n\t\tmCardNoValue1.setHint(\"-\");\r\n\t\tmCardNoValue2.setText(\"\");\r\n\t\tmCardNoValue2.setHint(\"-\");\r\n\t\tmCardNoValue3.setText(\"\");\r\n\t\tmCardNoValue3.setHint(\"-\");\r\n\t\tmCardNoValue4.setText(\"\");\r\n\t\tmCardNoValue4.setHint(\"-\");\r\n\t\tmCardNoValue1.requestFocus();\r\n\t}", "public void remove(Customer c) {\n customers.remove(c);\n\n fireTableDataChanged();\n }", "public void removeCustomer(int id) {\r\n for (int i = 0; i < customers.length; i++) {\r\n if (customers[i] != null && customers[i].getID() == id) {\r\n customers[i] = null;\r\n return;\r\n }\r\n }\r\n System.err.println(\"Could not find a customer with id: \" + id);\r\n }", "public void discard(){\n for(int i = 1 ; i <= 110 ; i++) cardDeck.remove(i);\n }", "public boolean removeContestPayment(long contestPaymentId) throws ContestManagementException {\n return false;\r\n }", "public boolean removeContestPayment(long contestPaymentId) throws ContestManagementException {\n return false;\r\n }", "private void removeCard(CardView cardView, boolean silent) {\n cardSet.removeCard(cardView.getCard());\n getChildren().remove(cardView);\n cardViews.remove(cardView);\n\n if (!silent) {\n fireEvent(cardView, CardEvent.CARD_REMOVED);\n }\n\n markValidity();\n }", "@Override\r\n\t@Transactional\r\n\tpublic boolean disapproveCreditCard(BigInteger cardNumber) throws IBSExceptions {\n\t\tboolean result = false;\r\n\t\tif (bankRepresentativeDAO.decliningCreditCardDetails(cardNumber)) {\r\n\t\t\tresult = true;\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "@Override\n public void removeCard(int i) {\n this.cards.remove(i);\n }", "public void setCreditcard(CreditCard creditcard) {\n\t\tthis.creditcard = creditcard;\n\t}", "boolean canBeRemoved(int cardIndex);", "public Card removeCard(){\n Card temp = pile[0]; //removes top card. putting placement card to avoid null pointer\n for(int i = 0; i < pilePlace; i++){ //shifts cards\n pile[i] = pile[i+1];\n }\n pilePlace--;\n return temp;\n\n }", "public void delete(Integer id) {\n\t\t\t\t\n\t\tSession session = sessionFactory.getCurrentSession();\n\t\t\n\t\tPerson person=(Person)session.get(Person.class, id);\n\t\t\n\t\tSet<CreditCard> creditCards =person.getCreditCards();\n\t\t\n\t\t// Delete person\n\t\tsession.delete(person);\n\t\t\n\t\t// Delete associated credit cards\n\t\tfor (CreditCard creditCard: creditCards) {\n\t\t\tsession.delete(creditCard);\n\t\t}\n\t}", "public boolean deleteCustomer(String custId);", "public boolean removeContact(Contact c);", "public void deleteSalerCustomer(int uid) {\n\t\tthis.salerCustomerMapper.deleteSalerCustomer(uid);\n\t}", "Customer removeCustomer()\r\n {\r\n // If queue is empty, return NULL.\r\n if (this.first == null)\r\n return null;\r\n \r\n // Store previous first and move first one node ahead\r\n Customer temp = this.first;\r\n \r\n this.first = this.first.next;\r\n \r\n // If first becomes NULL, then change rear also as NULL\r\n if (this.first == null)\r\n this.last = null;\r\n return temp;\r\n }", "public void removeCustomerCoupon(Coupon coupon) throws DbException;", "public boolean removeCustomer(String c){\n\t\tif(containsCustomer(c)){\n\t\t\tfor (int i = 0; i < list.size(); i++) {\n\t\t\t\tif( c.equals(list.get(i).getUsername()) ){\n\t\t\t\t\tlist.remove(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "void deleteCustomerById(int customerId);", "public void delete(Customer customer) {\n\t\tcustRepo.delete(customer);\n\t}", "public void removeCard(Player player, AbstractCard card) { //throws exception\n\n for (Hand hand : hands)\n if (hand.getHandOwner().equals(player))\n hand.removeCard(card);\n\n }", "public Optional<Card> dealOneCard() {\n if (cards.size() > 0) {\n return Optional.of(cards.remove(0));\n } else {\n return Optional.empty();\n }\n }", "public void setCreditCard(String creditCard)\n\t{\n\t\tm_creditCard = creditCard;\n\t}", "public void discardLeaderCard(Player player, int leaderCardAtIndex, InformationCallback informationCallback){\n player.getPersonalBoard().getLeaderCards().remove(leaderCardAtIndex);\n CouncilPrivilege councilPrivilege = new CouncilPrivilege(1);\n councilPrivilege.chooseCouncilPrivilege(player, informationCallback);\n }", "@Override\n\tpublic void removeByCreditAppId(long creditAppId) throws SystemException {\n\t\tfor (CreditAppBankReference creditAppBankReference : findByCreditAppId(\n\t\t\t\tcreditAppId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {\n\t\t\tremove(creditAppBankReference);\n\t\t}\n\t}", "public static DAO RemoveCustomer(Customer customer) throws IllegalStateException\r\n\t{\r\n\t\treturn instance.removeCustomer(customer);\r\n\t}", "public int removeCustomer(long id) {\n return model.deleteCustomer(id);\n }", "public void creditCard() {\n\t\tSystem.out.println(\"hsbc --- credit card\");\n\t\t\n\t}", "public void removeFromMDC()\n\t{\n\t\tMDC.remove(USER_ID);\n\t\tMDC.remove(HOST_IP);\n\t\tMDC.remove(REQUEST_ID);\n\t}", "public void removeCustomerCoupon(Company company) throws DbException;", "@Override\r\n\tpublic boolean deletePostPaidAccount(int customerID, long mobileNo) {\n\t\treturn false;\r\n\t}", "public void removetuple(String cid) throws SQLException\n {\n StringBuffer tpremove=new StringBuffer();\n tpremove.append(\" DELETE FROM Credit \");\n tpremove.append(\" WHERE CID = \");\n tpremove.append(cid);\n Statement statement =null;\n System.out.println(\"Removing record....\");\n\n try {\n statement = this.getConnection().createStatement();\n statement.executeUpdate (tpremove.toString());\n }catch (SQLException e){\n throw e;\n }finally{\n statement.close();\n }\n }", "@RequestMapping(value = \"/customer/{id}\",method=RequestMethod.DELETE)\n @ResponseStatus(HttpStatus.NO_CONTENT)\n public void removeCustomer(@PathVariable(\"id\") int id){\n //simply remove the customer using the id. If it does not exist, nothing will happen anyways\n service.removeCustomer(id);\n }", "public void deleteCustomer(Customer customer){\n _db.delete(\"Customer\", \"customer_name = ?\", new String[]{customer.getName()});\n }", "public Card drawCard() {\n Card c = cards.get(0);//get a card\n cards.remove(0);//remove the card form the deck that's given out\n discard.add(c);//so the card given out is added to the discard list\n return c;//return a card object\n\n }" ]
[ "0.67274755", "0.663868", "0.65881544", "0.64882296", "0.64221036", "0.6397054", "0.6381519", "0.62916875", "0.6266102", "0.6245316", "0.6225305", "0.62199277", "0.61707205", "0.61673504", "0.61524457", "0.6138137", "0.6129098", "0.60931516", "0.6062215", "0.6048515", "0.60384536", "0.60304564", "0.60292566", "0.60233426", "0.6004881", "0.60007393", "0.59816587", "0.5965014", "0.59051317", "0.5894744", "0.5871704", "0.58593243", "0.5857595", "0.58573234", "0.5854535", "0.5851156", "0.5824485", "0.5814743", "0.57966083", "0.5780754", "0.57700187", "0.5754111", "0.5750446", "0.57392794", "0.57375765", "0.5727891", "0.5724178", "0.572412", "0.5705285", "0.5692739", "0.5692064", "0.56796867", "0.5678376", "0.567455", "0.5672196", "0.5669153", "0.5662763", "0.56606084", "0.56488115", "0.56369233", "0.56346524", "0.5619983", "0.5613892", "0.5604338", "0.5603439", "0.56011856", "0.55867225", "0.55837035", "0.5583335", "0.5583335", "0.5582524", "0.5562097", "0.55573297", "0.555654", "0.5553595", "0.5545242", "0.5524967", "0.5521568", "0.55179816", "0.55158335", "0.55023766", "0.54967076", "0.54913956", "0.5487003", "0.5485832", "0.5485535", "0.54782003", "0.54569894", "0.54494524", "0.54476345", "0.54402936", "0.5430309", "0.54191995", "0.541399", "0.5412336", "0.5408783", "0.5401721", "0.5398839", "0.53950477", "0.5364007" ]
0.72662735
0
Search for a credit card.
public CreditCard searchCard(String cardNumber) { for (Iterator<CreditCard> iterator = creditCards.iterator(); iterator.hasNext();) { CreditCard creditCard = iterator.next(); if ((creditCard.getCardNumber()).equals(cardNumber)) { return creditCard; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CreditCard search(int donorID, String ccNumber) {\n for (Object creditCardObject : creditCardNumbers) {\n CreditCard creditCard = (CreditCard) creditCardObject;\n if (creditCard.getCreditCardId().equals(ccNumber) && creditCard.getDonorId()==donorID) {\n return creditCard;\n }\n }\n return null;\n }", "List<Card> search(String searchString) throws PersistenceCoreException;", "List<Card> search(String searchString, long userId) throws PersistenceCoreException;", "int search(ICard toFind);", "public void searchByAccount() {\n\t\t\n\t\tlog.log(Level.INFO, \"Please Enter the account number you want to search: \");\n\t\tint searchAccountNumber = scan.nextInt();\n\t\tbankop.search(searchAccountNumber);\n\n\t}", "CarPaymentMethod creditCardNumber(String cardNumber);", "private void scanCard() {\n\n Intent intent = new ScanCardIntent.Builder(getActivity()).build();\n startActivityForResult(intent, Constant.REQUEST_CODE_SCAN_CARD);\n }", "Customer search(String login);", "public void creditcard() {\n\t\tBy cd=By.xpath(\"//input[@name='creditCard']\");\r\n\t\tWebElement W_cd=wt.WaitForElement(cd, 10);\r\n\t\tW_cd.sendKeys(\"5462897859858\");\r\n\t\t\r\n\t\t}", "private void searchSpecificCar() {\n\t\tSystem.out.print(\"Enter Registration Number: \");\n\t\tSystem.out.println(application.displaySpecificCar(console.nextLine()));\n\t}", "CompletableFuture<BonusCustomer> findByCard(int cardNumber, int goodThruMonth, int goodThruYear);", "boolean contains(Card c);", "private RoomCard findRoomCard(String search) {\n for (RoomCard card : this.getRoomCards()) {\n if (card.getName().toLowerCase().equals(search.toLowerCase())) {\n return card;\n }\n }\n return null;\n }", "public Customer searchCustomerByPhone() {\r\n\t\t//Input customer phone.\r\n\t\tString phone = readString(\"Input the customer phone: \");\r\n\t\tCustomer f = my.findByPhone(phone);\r\n\t\treturn f;\r\n\t}", "Card findByCardData(String number, long userId) throws PersistenceCoreException;", "public Account searchAccount(String account_no)\n {\n Account account=null;\n \n try\n {\n String query=\"select * from account where account_no=\"+account_no;\n PreparedStatement ps=this.conn.prepareStatement(query);\n \n ResultSet rs=ps.executeQuery();\n \n if(rs.next())\n {\n account=new Account();\n \n account.setAccount_no(rs.getString(\"account_no\"));\n account.setAadhar_id(rs.getString(\"aadhar_no\"));\n account.setAccount_type(rs.getString(\"ac_type\"));\n account.setInterest_rate(rs.getString(\"interest\"));\n account.setBalance(rs.getString(\"balance\"));\n account.setAccount_status(rs.getString(\"ac_status\"));\n account.setName(rs.getString(\"name\"));\n }\n \n }catch(Exception e)\n {\n JOptionPane.showMessageDialog(null,e);\n }\n return account;\n }", "public void showCreditCardByCustomerName(String string) {\n\t\tSystem.out.println(\"Mostrant credit cards del customer \" + string);\n\n\t\tObjectSet<Customer> customers = db.query(new Predicate<Customer>() {\n\t\t\tpublic boolean match(Customer customer) {\n\t\t\t\treturn customer.getName().equalsIgnoreCase(string);\n\t\t\t}\n\t\t});\n\t\tcustomers.stream()\n\t\t\t\t.peek(System.out::println)\n\t\t\t\t.forEach(c -> System.out.println(c.getCreditCard()));\n\t}", "List<Cemetery> search(String query);", "public List<Card> getcardbyuser(String user_id);", "@Override\r\n\tpublic List<CreditCard> findAll() {\n\t\treturn this.cardList;\r\n\t\t\r\n\t}", "Card selectByPrimaryKey(String card);", "public void victoryCardFind();", "public abstract List<CustomerType> findCustomerTypebyCustomerTypeNumber(String searchString);", "boolean search(String acn) {\r\n if (regno.equals(acn)) {\r\n show();\r\n return (true);\r\n }\r\n return (false);\r\n }", "Card getCard(UUID cardId);", "public CarerAccount getAccountWithID(int search){\n\t\tCarerAccount item = null;\n\n\t\tint count = 0;\n for (int i = 0; i < CarerAccounts.size(); ++i) {\n if (CarerAccounts.get(i).getID() == search){\n\t\t\t\tcount++;\n item = CarerAccounts.get(i);\n\t\t\t}\n\t\t}\n\t\treturn item;\n\t}", "public Card selectCardById(int cno) {\n\t\treturn this.caDao.selectCardById(cno);\n\t}", "public Cursor get_reciever_credits(String Reciever_accountno){\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor data = db.rawQuery(\"select * from credit_table where accountno='\"+Reciever_accountno+\"'\",null);\n return data;\n }", "public CreditCard(int pin, String number, String holder, Date expiryDate, int cvc){\r\n this.pin = pin;\r\n this.number = number;\r\n this.holder = holder;\r\n this.expiryDate = expiryDate;\r\n this.cvc = cvc;\r\n}", "CarPaymentMethod processCreditCard();", "public void findContact(){\n EtecsaDB database = new EtecsaDB(this.getContext());\n if (!database.hasDatabase()){\n Toast.makeText(this.getContext(), R.string.no_database, Toast.LENGTH_SHORT).show();\n }\n else //buscar contacto\n new Search(this.getActivity()).execute(advancedSearch);\n }", "@Override\n @Transactional(readOnly = true)\n public Card getByCardNumber(String cardNumber) {\n logger.info(\"find one card by \" + cardNumber);\n Card card = cardRepository.findByCardNumber(cardNumber);\n if (card != null) {\n return card;\n }\n throw new EmptyResultDataAccessException(\"card is empty.\", 1);\n }", "Symbol getActiveCard();", "public void checkCreditCard() throws BusinessException;", "public FacturaCompra pagoCreditCard(String userName,TipoMoneda tipoMoneda);", "public com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.creditcard.v1.CreditCard getCreditCardReq(CreditCard creditCard){\n\t\tcom.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.creditcard.v1.CreditCard creditCardReq = \n\t\t\tnew com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.creditcard.v1.CreditCard();\n\t\t\n\t\tcreditCardReq.setStreet( creditCard.getStreet() );\n\t\tcreditCardReq.setCity( creditCard.getCity() );\n\t\tcreditCardReq.setState( creditCard.getState() );\n\t\tcreditCardReq.setPostalCode( creditCard.getPostalCode() );\n\t\tcreditCardReq.setDistrict( creditCard.getDistrict() );\n\t\tcreditCardReq.setCountryCode( creditCard.getCountryCode() );\n\t\tcreditCardReq.setTelephone( creditCard.getTelephone() );\n\t\tcreditCardReq.setAmountUSD( new Double(creditCard.getAmountUSD()) );\n\t\tcreditCardReq.setPassengerId( creditCard.getPassengerId() );\n\t\tcreditCardReq.setCVVCode( creditCard.getCVVCode() );\n\t\tcreditCardReq.setDescription( creditCard.getDescription() );\n\t\tcreditCardReq.setUseSameCard( Character.toString(creditCard.getUseSameCard()) );\n\t\tcreditCardReq.setOtherCardHolderFlag( Character.toString(creditCard.getOtherCardHolderFlag()) );\n\t\tcreditCardReq.setOtherCardHolderEmail( creditCard.getOtherCardHolderEmail() );\n\t\tcreditCardReq.setCardType( creditCard.getCardType() );\n\t\tcreditCardReq.setName( creditCard.getName() );\n\t\tcreditCardReq.setCardNo( creditCard.getCardNo() );\n\t\tcreditCardReq.setExpiryMonth( creditCard.getExpiryMonth() );\n\t\tcreditCardReq.setExpiryYear( creditCard.getExpiryYear() );\n\t\tcreditCardReq.setAmount( new Double(creditCard.getAmount()) );\n\t\tcreditCardReq.setLastName( creditCard.getLastName() );\n\t\tcreditCardReq.setFirstName( creditCard.getFirstName() );\n\t\tcreditCardReq.setPaymentDate( creditCard.getPaymentDate() );\n\t\t\n\t\treturn creditCardReq;\n\t}", "public List<Card> findAllCards();", "public Cardholder(String name, String address, int cardNumber){\n this.name = name;\n this.address = address;\n this.cardNumber = cardNumber;\n }", "ICard getCard(int cardIndex) throws IllegalArgumentException;", "@Override\n\tpublic List<Card> findAllCard() {\n\t\treturn cb.findAllCard();\n\t}", "public static Customer find(String key) throws NotFoundException\r\n\t{\n\t\taCustomer = null;\r\n\t\t// define the SQL query statement using the phone number key\r\n\t\tString sqlQuery = \"SELECT CustomerName, Address, PhoneNo, \" +\r\n\t\t\t\t\t\t\t\t\t\t\t\" StateRegistrationNo, BoatLength, \" +\r\n\t\t\t\t\t\t\t\t\t\t\t\" Manufacturer, Year\" +\r\n\t\t\t\t\t\t\t\t\t\t\t\" FROM CustomerTable, BoatTable \" +\r\n\t\t\t\t\t\t\t\t\t\t\t\" WHERE PhoneNo = CustomerPhoneNo\" +\r\n\t\t\t\t\t\t\t\t\t\t\t\" AND PhoneNo = '\" + key +\"'\" ;\r\n\r\n\t \t// execute the SQL query statement\r\n\t\ttry\r\n \t\t{\r\n\t \tResultSet rs = aStatement.executeQuery(sqlQuery);\r\n\t\t\t// next method sets cursor & returns true if there is data\r\n\t\t\tboolean gotIt = rs.next();\r\n\t \tif (gotIt)\r\n\t \t\t{\t// extract the data\r\n\t\t\t\t\tname = rs.getString(1);\r\n\t\t\t\t\taddress = rs.getString(2);\r\n\t\t\t\t\tphoneNumber = rs.getString(3);\r\n\t\t\t\t\tstateRegistrationNo = rs.getString(4);\r\n \t\t\t\t\tlength = rs.getDouble(5);\r\n\t\t\t\t\tmanufacturer = rs.getString(6);\r\n\t\t\t\t\tyear = rs.getInt(7);\r\n\r\n\t\t\t\t\t// create Customer & Boat instance\r\n\t\t\t\t\taCustomer = new Customer(name, address, phoneNumber);\r\n\t\t\t\t\taBoat = new Boat(stateRegistrationNo, length, manufacturer, year);\r\n\t\t\t\t\taBoat.assignBoatToCustomer(aCustomer);\r\n\t\t\t\t}\r\n\t\t\telse\t// nothing was retrieved\r\n\t\t\t\t{throw (new NotFoundException(\"not found \"));}\r\n\t\t\trs.close();\r\n\t \t}\r\n\t\tcatch (SQLException e)\r\n\t\t{ System.out.println(e);}\r\n\t\treturn aCustomer;\r\n\t}", "private void searchCharacter(String query) {\n String filter = this.characterFilter.getValue();\n String sort = this.sort.getValue();\n \n // Get the user defined comparator\n Comparator<Character> c = getCharacterComparator(filter, sort);\n\n // Create a character used for comparison\n Character character = createCharacterForQuery(filter, query);\n \n // Find all matches\n GenericList<Character> results = DashboardController.library.getCharacterTable().findAll(character, c);\n\n // Cast results to an array\n Character[] characterResults = characterResultsToArray(results, c);\n\n // Load the results in a new scene\n this.loadCharacterResultsView(characterResults);\n }", "public static void main(String[] args) {\n\t\tScanner k = new Scanner(System.in);\r\n\t\tCharge c1 = new Charge();\r\n\t\t\r\n\t\tint input;\r\n\t\t\r\n\t\t//do while loop that determines if the account number is present in the array\r\n\t\tdo{\r\n\t\tSystem.out.println(\"Enter your charge account number: \");\r\n\t\tinput = k.nextInt();\r\n\t\tif(c1.sequentialSearch(input) == -1){;\r\n\t\tSystem.out.println(\"The account number is not present.\");\r\n\t\t}else{\r\n\t\t\tSystem.out.println(\"The charge account number exists.\");\r\n\t\t}\r\n\t\t}while(input != 9999999);\r\n\t\t\r\n\t\r\n\t}", "public void searchPerson() {\n\t\tSystem.out.println(\"*****Search a person*****\");\n\t\tSystem.out.println(\"Enter Phone Number to search: \");\n\t\tlong PhoneSearch = sc.nextLong();\n\t\tfor (int i = 0; i < details.length; i++) {\n\t\t\tif (details[i] != null && details[i].getPhoneNo() == PhoneSearch) {\n\t\t\t\tSystem.out.print(\"Firstname \\tLastname \\tAddress \\t\\tCity \\t\\tState \\t\\t\\tZIP \\t\\tPhone \\n\");\n\t\t\t\tSystem.out.println(details[i]);\n\t\t\t}\n\t\t}\n\t}", "void showCreditCardForm() {\n Intent intent = new Intent(this, CreditCardActivity.class);\n intent.putExtra(CreditCardActivity.EXTRA_PKEY, getString(R.string.omise_pkey));\n startActivityForResult(intent, REQUEST_CC);\n }", "public boolean validateCard(int accountNum) {\n\t\tint index; //loop control variable\n\t\tboolean found; //flag indicating search results\n\t\t\n\t\t//element 0 is the starting point of the search\n\t\tindex = 0;\n\t\t\n\t\t//if the charge number is never found, this value will not be changed\n\t\tfound = false;\n\t\t\n\t\t//now we'll search the array\n\t\twhile(!found && index < chargeCard.length) {\n\t\t\tif(chargeCard[index] == accountNum) {\n\t\t\t\tfound = true;\n\t\t\t}\n\t\t\tindex++;\n\t\t}\n\t\treturn found;\n\t}", "public CarerAccount getAccountWithUsername(String search){\n\t\tCarerAccount item = null;\n\n\t\tint count = 0;\n for (int i = 0; i < CarerAccounts.size(); ++i) {\n if (CarerAccounts.get(i).getUsername().equals(search)){\n\t\t\t\tcount++;\n item = CarerAccounts.get(i);\n\t\t\t}\n\t\t}\n\t\treturn item;\n\t}", "public HotelCard searchHotel() {\n System.out.println(ANSI() + \"Here is your hotel card list:\" + ANSI_RESET);\n // Presentation of player's hotel card list\n for (HotelCard hc : hotel_list) {\n System.out.print(ANSI() + \"Hotel Name: \" + hc.getName() + ANSI_RESET);\n System.out.print(ANSI() + \", Hotel ID: \" + hc.getID() + ANSI_RESET);\n System.out.println(ANSI() + \", Hotel Ranking: \" + hc.getRank() + ANSI_RESET);\n }\n System.out.println(ANSI() + \"Please type the id of the hotel you choose\" + ANSI_RESET);\n boolean answer = false;\n while (answer == false) {\n Scanner s = new Scanner(System.in);\n String str = s.nextLine();\n int ID;\n try { \n ID = Integer.parseInt(str);\n // Search for the hotel card with user's given ID \n for (HotelCard hc : hotel_list) \n if (hc.getID() == ID) return hc; \n System.out.println(ANSI() + \"Please type a valid Hotel ID from the above Hotels shown\" + ANSI_RESET); \n } catch (Exception e) {\n System.out.println(ANSI() + \"Please type a valid ID\" + ANSI_RESET);\n }\n }\n // Junk \n return null;\n }", "CarPaymentMethod cardHolder(String firstName, String lastName);", "private boolean containCreditCard(ArrayList<CreditCard> card){\n\t\tfor (CreditCard creditCard : creditCards){\n\t\t\tfor (CreditCard creditCard1 : card){\n\t\t\t\tif(creditCard.equals(creditCard1))return true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public CreditCard getCreditCard(com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.creditcard.v1.CreditCard res){\n\t\tCreditCard creditCard = new CreditCard();\n\t\t\n\t\tcreditCard.setCardType( res.getCardType() );\n\t\tcreditCard.setName( res.getName() );\n\t\tcreditCard.setCardNo( res.getCardNo() );\n\t\tcreditCard.setExpiryMonth( res.getExpiryMonth() );\n\t\tcreditCard.setExpiryYear( res.getExpiryYear() );\n\t\tcreditCard.setLastName( res.getLastName() );\n\t\tcreditCard.setFirstName( res.getFirstName() );\n\t\tcreditCard.setPaymentDate( res.getPaymentDate() );\n\t\tcreditCard.setStreet( res.getStreet() );\n\t\tcreditCard.setCity( res.getCity() );\n\t\tcreditCard.setState( res.getState() );\n\t\tcreditCard.setPostalCode( res.getPostalCode() ); \n\t\tcreditCard.setDistrict( res.getDistrict() );\n\t\tcreditCard.setCountryCode( res.getCountryCode() );\n\t\tcreditCard.setTelephone( res.getTelephone() );\n\t\tcreditCard.setPassengerId( res.getPassengerId() );\n\t\tcreditCard.setCVVCode( res.getCVVCode() );\n\t\tcreditCard.setDescription( res.getDescription() );\n\t\tcreditCard.setOtherCardHolderEmail( res.getOtherCardHolderEmail() );\n\t\tif( res.getUseSameCard() != null ){\n\t\t\tcreditCard.setUseSameCard( res.getUseSameCard().charAt(0) );\n\t\t}\n\t\tif( res.getOtherCardHolderFlag() != null ){\n\t\t\tcreditCard.setOtherCardHolderFlag( res.getOtherCardHolderFlag().charAt(0) );\n\t\t}\n\t\tif( res.getAmountUSD() != null ){\n\t\t\tcreditCard.setAmountUSD( res.getAmountUSD().doubleValue() );\n\t\t}\n\t\tif( res.getAmount() != null ){\n\t\t\tcreditCard.setAmount( res.getAmount().doubleValue() );\n\t\t}\n\t\t\n\t\treturn creditCard;\n\t}", "@Override\n\tpublic Candidate fetchByIdentityCardNo(String identityCardNo,\n\t\tboolean retrieveFromCache) throws SystemException {\n\t\tObject[] finderArgs = new Object[] { identityCardNo };\n\n\t\tObject result = null;\n\n\t\tif (retrieveFromCache) {\n\t\t\tresult = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_IDENTITYCARDNO,\n\t\t\t\t\tfinderArgs, this);\n\t\t}\n\n\t\tif (result instanceof Candidate) {\n\t\t\tCandidate candidate = (Candidate)result;\n\n\t\t\tif (!Validator.equals(identityCardNo, candidate.getIdentityCardNo())) {\n\t\t\t\tresult = null;\n\t\t\t}\n\t\t}\n\n\t\tif (result == null) {\n\t\t\tStringBundler query = new StringBundler(3);\n\n\t\t\tquery.append(_SQL_SELECT_CANDIDATE_WHERE);\n\n\t\t\tboolean bindIdentityCardNo = false;\n\n\t\t\tif (identityCardNo == null) {\n\t\t\t\tquery.append(_FINDER_COLUMN_IDENTITYCARDNO_IDENTITYCARDNO_1);\n\t\t\t}\n\t\t\telse if (identityCardNo.equals(StringPool.BLANK)) {\n\t\t\t\tquery.append(_FINDER_COLUMN_IDENTITYCARDNO_IDENTITYCARDNO_3);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tbindIdentityCardNo = true;\n\n\t\t\t\tquery.append(_FINDER_COLUMN_IDENTITYCARDNO_IDENTITYCARDNO_2);\n\t\t\t}\n\n\t\t\tString sql = query.toString();\n\n\t\t\tSession session = null;\n\n\t\t\ttry {\n\t\t\t\tsession = openSession();\n\n\t\t\t\tQuery q = session.createQuery(sql);\n\n\t\t\t\tQueryPos qPos = QueryPos.getInstance(q);\n\n\t\t\t\tif (bindIdentityCardNo) {\n\t\t\t\t\tqPos.add(identityCardNo);\n\t\t\t\t}\n\n\t\t\t\tList<Candidate> list = q.list();\n\n\t\t\t\tif (list.isEmpty()) {\n\t\t\t\t\tFinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_IDENTITYCARDNO,\n\t\t\t\t\t\tfinderArgs, list);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif ((list.size() > 1) && _log.isWarnEnabled()) {\n\t\t\t\t\t\t_log.warn(\n\t\t\t\t\t\t\t\"CandidatePersistenceImpl.fetchByIdentityCardNo(String, boolean) with parameters (\" +\n\t\t\t\t\t\t\tStringUtil.merge(finderArgs) +\n\t\t\t\t\t\t\t\") yields a result set with more than 1 result. This violates the logical unique restriction. There is no order guarantee on which result is returned by this finder.\");\n\t\t\t\t\t}\n\n\t\t\t\t\tCandidate candidate = list.get(0);\n\n\t\t\t\t\tresult = candidate;\n\n\t\t\t\t\tcacheResult(candidate);\n\n\t\t\t\t\tif ((candidate.getIdentityCardNo() == null) ||\n\t\t\t\t\t\t\t!candidate.getIdentityCardNo().equals(identityCardNo)) {\n\t\t\t\t\t\tFinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_IDENTITYCARDNO,\n\t\t\t\t\t\t\tfinderArgs, candidate);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tFinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_IDENTITYCARDNO,\n\t\t\t\t\tfinderArgs);\n\n\t\t\t\tthrow processException(e);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tcloseSession(session);\n\t\t\t}\n\t\t}\n\n\t\tif (result instanceof List<?>) {\n\t\t\treturn null;\n\t\t}\n\t\telse {\n\t\t\treturn (Candidate)result;\n\t\t}\n\t}", "public void creditCard() {\n\t\tSystem.out.println(\"hsbc --- credit card\");\n\t\t\n\t}", "private static Card getCard(String bank, String number, Date date) throws InvalidBankException {\n \n Card card = new Card(bank, number, date);\n \n if (HSBCCA.equalsName(bank)) {\n card.setComponents(new SixteenDigitsWithDashes(),\n new ShowFirstTwoMasker());\n } else if (RBC.equalsName(bank)) {\n card.setComponents(new SixteenDigitsWithDashes(),\n new ShowFirstFourMasker());\n } else if (AMEX.equalsName(bank)) {\n card.setComponents(new FifteenDigitsWithDashesValidator(),\n new ShowLastThreeMasker());\n } else {\n throw new InvalidBankException(\"Bank \" + bank + \" is not a valid bank name\");\n }\n \n return card;\n }", "public static String getCompany(String _card){\r\n\t\t\tString _errorLength = \"Invalid number of digits.\";\r\n\t\t\tString _errorInvalid = \"Invalid credit card number.\";\r\n\t\t\t\r\n\t\t\tif (_card.length() >= 13 && _card.length() <=16){\r\n\t\t\t\tif (_card.charAt(0) == '4'){\r\n\t\t\t\t\treturn \"Visa\";\r\n\t\t\t\t}else if (_card.charAt(0) == '5'){\r\n\t\t\t\t\treturn \"Mastercard\";\r\n\t\t\t\t}else if (_card.charAt(0) == '6'){\r\n\t\t\t\t\treturn \"Discover\";\r\n\t\t\t\t}else if (_card.charAt(0) == '3' && _card.charAt(1) == '7'){\r\n\t\t\t\t\treturn \"American Express\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn _errorInvalid;\r\n\t\t\t\t}\r\n\t\t\t}else {\r\n\t\t\t\treturn _errorLength;\r\n\t\t\t}\r\n\t}", "@Override\n public List<ReaderDTO> searchByIdOrCardNumberOrNameOrSurname(Integer id, Integer cardNumber, String name, String surname) {\n Reader readerExample = new Reader();\n readerExample.setId(id);\n readerExample.setCardNumber(cardNumber);\n readerExample.setName(name);\n readerExample.setSurname(surname);\n\n ExampleMatcher matcher = ExampleMatcher.matching()\n .withMatcher(\"name\", nome -> nome.ignoreCase().contains())\n .withMatcher(\"surname\", cognome -> cognome.ignoreCase().contains());\n\n List<Reader> readers = readerRepository.findAll(Example.of(readerExample, matcher));\n List<ReaderDTO> readerDTOs = new ArrayList<>();\n\n readerDTOs = readers.stream()\n .map(ReaderConverter::convert)\n .collect(Collectors.toList());\n\n return readerDTOs;\n }", "public int searchCard(int index){\n for(int i = 0; i < cards.size(); ++i){//loop to go through the cards\n if(cards.get(i).toString().equalsIgnoreCase(playable.get(index).toString())){//checks the index\n return i;//returns the index\n }\n }\n return index;\n }", "private void searchCourse()\r\n {\r\n \ttry\r\n \t{\r\n \tString courseFaculty = this.getClientIn().readLine();\r\n \tString courseNumberStr = this.getClientIn().readLine();\r\n\r\n \tint courseNumber = Integer.parseInt(courseNumberStr);\r\n \tCourse foundCourse = this.getDBManager().searchCourse(courseFaculty, courseNumber);\r\n \tif(foundCourse == null)\r\n \t{\r\n \t\tthis.getClientOut().printf(\"ERROR\\nCourse Not Found.\\n\");\r\n \t\treturn;\r\n \t}\r\n \tthis.getClientOut().printf(\"SUCCESS\\n%s\\n\", foundCourse.toString());\r\n \t}\r\n\t\tcatch(NumberFormatException e)\r\n\t\t{\r\n\t\t\tthis.getClientOut().printf(\"ERROR\\nPlease check the Course Number. It must be an integer.\\n\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tcatch (IOException e)\r\n\t\t{\r\n\t\t\tthis.getClientOut().printf(\"ERROR\\nIOException while getting data from user\\n\");\r\n\t\t\treturn;\r\n\t\t}\r\n \tfinally\r\n \t{\r\n \t\tthis.getClientOut().flush();\r\n \t}\r\n }", "void search();", "void search();", "public void search(String plateNumber) {\n regSearch.sendKeys(plateNumber);\n btnContinue.click();\n }", "List<Card> selectByExample(CardExample example);", "public interface CardRepository extends JpaRepository<HouseAccountCreditCardAccount,String> {\r\n HouseAccountCreditCardAccount findByBuyerIdAndServiceAccountNumberAndSourceSystem(String buyerId, Long serviceAccountNumber, String sourceSystem);\r\n}", "List<Corretor> search(String query);", "@Nullable\n private Food searchBarcode() {\n HttpsURLConnection anURLConnection = null;\n BufferedReader bufferedReader = null;\n\n /* The JSON query response is returned as a String, which will require conversion\n to a Food object. We also need to describe the URL for the query - as a\n RESTFUL API part of the URL changes when the method is called.\n */\n String jsonResponse;\n String queryPrefix = \"https://world.openfoodfacts.org/api/v0/product/\";\n String querySuffix = \".json\";\n String jsonQuery = queryPrefix + queryBarcode + querySuffix;\n\n /* The search requires us to:\n (1) create a connection to the RESTFUL API\n (2) read the response\n (3) parse the response.\n */\n try {\n /* Create and open a connection using the HTTP GET method. If no connection,\n we return null - design by contract.\n */\n URL anUrl = new URL(jsonQuery);\n try {\n anURLConnection = (HttpsURLConnection) anUrl.openConnection();\n anURLConnection.setRequestMethod(\"GET\");\n anURLConnection.connect();\n } catch (ConnectException e) {\n return (null);\n } catch (Exception e) {\n return (null);\n }\n\n /* (2) Read the response\n */\n try {\n InputStream inputStream = anURLConnection.getInputStream();\n StringBuilder stringBuffer = new StringBuilder();\n bufferedReader = new BufferedReader((new InputStreamReader(inputStream)));\n String line;\n while ((line = bufferedReader.readLine()) != null) {\n stringBuffer.append(line).append(\"\\n\");\n }\n jsonResponse = stringBuffer.toString();\n } catch (Exception e) {\n jsonResponse = null;\n }\n\n /* (3) Parse the response\n */\n if (jsonResponse != null) {\n try {\n /* The complete JSON response contains four JSON objects - we're\n interested in one - \"product\". So we create a new JSONobject for all\n the data then another for the \"product\" tag.\n */\n JSONObject everything = new JSONObject(jsonResponse);\n JSONObject product = everything.getJSONObject(\"product\");\n\n String barcode = product.getString(\"id\");\n String productName = product.getString(\"product_name\");\n /* Bit of a fudge - the JSON returns a string where we really\n need an integer so we'll remove the \" g\" - annoyingly some\n products don't have the leading space.\n */\n String quantity = product.getString(\"quantity\");\n if (quantity.endsWith(\" g\")) {\n quantity = product.getString(\"quantity\").substring(0,\n product.getString(\"quantity\").length() - 2);\n }\n if (quantity.endsWith(\"g\")) {\n quantity = product.getString(\"quantity\").substring(0,\n product.getString(\"quantity\").length() - 1);\n }\n String brand = product.getString(\"brands\");\n\n /* Now we require a JSONobject to parse the contents of the nutrition\n information...\n */\n JSONObject nutrition = product.getJSONObject(\"nutriments\");\n\n Date today = new Date();\n SimpleDateFormat yearMonthDay = new SimpleDateFormat(\"yyyy-MM-dd\", Locale.getDefault());\n String todayString = yearMonthDay.format(today);\n\n return new Food.Builder(\n todayString,\n productName,\n Float.valueOf(quantity),\n Float.valueOf(nutrition.getString(\"energy_100g\").trim()))\n .barcode(barcode)\n .brand(brand)\n .salt(Float.valueOf(nutrition.getString(\"salt_100g\")))\n .carbohydrate(Float.valueOf(nutrition.getString(\"carbohydrates_100g\")))\n .protein(Float.valueOf((nutrition.getString(\"proteins_100g\"))))\n .fat(Float.valueOf((nutrition.getString(\"saturated-fat_100g\"))))\n .fibre(Float.valueOf((nutrition.getString(\"fiber_100g\"))))\n .sugar(Float.valueOf((nutrition.getString(\"sugars_100g\"))))\n .build();\n } catch (JSONException e) {\n Log.d(\"EXCEPTION\", \"Parsing the JSON response in searchBarcode()\", e);\n }\n }\n return null;\n } catch (IOException e) {\n Log.d(\"EXCEPTION\", \"IOException in searchBarcode()\", e);\n } finally {\n if (anURLConnection != null) {\n try {\n if(bufferedReader!=null) {\n bufferedReader.close();\n }\n } catch (IOException e) {\n Log.d(\"EXCEPTION\", \"IOException in searchBarcode()\", e);\n }\n }\n }\n return null;\n }", "@Override\r\n\tpublic CreditCard findByID(int id) {\n\t\treturn null;\r\n\t}", "private synchronized int search(Card card)\n {\n int i = cards.lastIndexOf(card);\n \n if (i >= 0)\n return cards.size() - i;\n else\n return -1;\n }", "private void searchAvailableCar() throws Exception {\t\n\t\tString type;\n\t\tSystem.out.print(\"Enter Type (SD/SS): \");\n\t\ttype = console.nextLine().toUpperCase();\n\t\t\n\t\tif (!type.equals(\"SD\") && !type.equals(\"SS\")) {\n\t\t\tthrow new InvalidServiceTypeException(\"Error: Service Type is invalid.\");\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Enter Date: \");\n\t\tString dateEntered = console.nextLine();\n\t\tDateRegex dateChecker = new DateRegex(dateEntered);\n\t\tint day = Integer.parseInt(dateEntered.substring(0, 2));\n\t\tint month = Integer.parseInt(dateEntered.substring(3, 5));\n\t\tint year = Integer.parseInt(dateEntered.substring(6));\n\t\tDateTime dateRequired = new DateTime(day, month, year);\n\t\tapplication.book(dateRequired, type);\n//\t\tfor (int i = 0; i < availableCars.length; i++) {\n//\t\t\tSystem.out.println(availableCars[i]);\n//\t\t}\n\t}", "@Override\r\n\tpublic Customer search(String name) {\n\t\treturn null;\r\n\t}", "public List<Contact> searchContacts(Map<SearchTerm,String> criteria);", "public SuspectCard findSuspectCard(String search) {\n for (SuspectCard card : this.getSuspectCards()) {\n if (card.getName().toLowerCase().equals(search.toLowerCase())) {\n return card;\n }\n }\n return null;\n }", "@Override\n\tpublic void searchByMobile() {\n\t\tcount = 0;\n\t\tif (UtilityClinic.patFile == null) {\n\t\t\ttry {\n\t\t\t\tutil.accessExistingPatJson();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tSystem.out.println(\"File not found\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tutil.readFromPatJson(UtilityClinic.patFile);\n\t\tSystem.out.println(\"Enter search.....\");\n\t\tString search = UtilityClinic.readString();\n\t\tSystem.out.println(\"Showing search result(s).......\");\n\t\tfor (int i = 0; i < UtilityClinic.patJson.size(); i++) {\n\t\t\tJSONObject jsnobj = (JSONObject) UtilityClinic.patJson.get(i);\n\t\t\tif (jsnobj.get(\"Mobile\").toString().equals(search)) {\n\t\t\t\tpMob = jsnobj.get(\"Mobile\").toString();\n\t\t\t\tpName = jsnobj.get(\"Patient's name\").toString();\n\t\t\t\tpId = jsnobj.get(\"Patient's ID\").toString();\n\t\t\t\tSystem.out.print(++count + \" Name:\" + pName + \" ID:\" + pId + \" Mobile:\" + pMob + \" Age:\"\n\t\t\t\t\t\t+ jsnobj.get(\"Age\") + \"\\n\\n\");\n\t\t\t}\n\t\t}\n\t\tif (count == 0) {\n\t\t\tSystem.out.println(\"No results found.....\");\n\t\t}\n\t\tSystem.out.println();\n\t}", "public interface CreditCardStore\r\n{\r\n /**\r\n * This method should add the credit card number to the store given a pass key.\r\n *\r\n * @param cc The credit card number.\r\n * @param key The pass key.\r\n * @throws CreditCardAPIException if an error occurs.\r\n */\r\n public void addCc(String cc, String key) throws CreditCardAPIException;\r\n \r\n /**\r\n * This method should edit the credit card number in the store given a pass key.\r\n *\r\n * @param cc The credit card number.\r\n * @param key The pass key.\r\n * @throws CreditCardAPIException if an error occurs.\r\n */\r\n public void editCc(String cc, String key) throws CreditCardAPIException;\r\n \r\n /**\r\n * This method should delete the credit card number to the store given a pass key.\r\n *\r\n * @param cc The credit card number.\r\n * @param key The pass key.\r\n * @throws CreditCardAPIException if an error occurs.\r\n */\r\n public void deleteCc(String cc, String key) throws CreditCardAPIException;\r\n \r\n /**\r\n * This method should return the credit card number from the store given a pass key.\r\n *\r\n * @param key The pass key.\r\n * @return String\r\n * @throws CreditCardAPIException if an error occurs.\r\n */\r\n public String getCc(String key) throws CreditCardAPIException;\r\n}", "public Boolean isPrimaryCreditCard();", "public Contact findContactByNumber(String number){\n SQLiteDatabase db = this.getReadableDatabase();\n\n // prevent for prefix number\n String number2 = number;\n String number3 = \"+\" + number;\n String number4 = number;\n if(number.length()>=3){\n number4 = \"0\" + number.substring(2);\n if(number.contains(\"+\")){\n number2 = \"0\" + number.substring(3);\n }\n }\n\n Log.d(\"db\", number2);\n\n Cursor cur;\n cur = db.rawQuery(\n \"SELECT DISTINCT c.* FROM \"\n + TABLE_CONTACTS + \" c,\"\n + TABLE_NUMBERS + \" n \"\n + \"WHERE c.\" + _ID + \" = n.\" + C_ID\n + \" AND ( n.\" + PHONE_NUMBER + \" = ? OR\"\n +\" n.\" + PHONE_NUMBER + \" = ? OR\"\n +\" n.\" + PHONE_NUMBER + \" = ? OR\"\n +\" n.\" + PHONE_NUMBER + \" = ? )\", new String[]{number, number2, number3, number4 });\n List<Contact> ctxs = getContactObjct(db, cur, number);\n Contact c ;\n if(ctxs.size()>0){\n c = ctxs.get(0);\n }else{\n c = new Contact(-1, null, number);\n }\n\n db.close();\n return c;\n }", "@Override\r\n\tpublic List<Citizen> SearchCitizen(int cin) {\n\r\n\t\treturn em.createNativeQuery(\r\n\t\t\t\t\"SELECT * FROM Citizen WHERE CIN like '\" + cin + \"%';\",\r\n\t\t\t\tCitizen.class).getResultList();\r\n\r\n\t}", "@Override\n public List<MemCard> autoQueryCard(IRequest request, Long memberId) {\n List<MemCard> cards = cardMapper.selectByMemberId(memberId);\n for (MemCard card : cards) {\n StringBuffer sb = new StringBuffer();\n sb.append(card.getBankCode() == null ? \"\" : card.getBankCode());\n sb.append(MemberConstants.MM_LEFT_BRACKET);\n sb.append(card.getMaskedCardNumber().substring(card.getMaskedCardNumber().length() - 4,\n card.getMaskedCardNumber().length()));\n sb.append(MemberConstants.MM_RIGHT_BRACKET);\n card.setBankCode(sb.toString());\n }\n return cards;\n }", "@Override\n public Mono<CreditCard> findById(String s) {\n return repository.findById(s);\n }", "@Override\n\tpublic List<Contact> search(String str) {\n\t\treturn null;\n\t}", "List<CGcontractCredit> selectByExample(CGcontractCreditExample example);", "public Currency findCurrencyByCode(String currency);", "private CreditCardAccount selectCreditcardAccount (final String sharedSecret,\r\n final String accountNumber,\r\n final List<CreditCardAccount> accountList) {\r\n\r\n for (CreditCardAccount account : accountList) {\r\n String decryptAccount = securityEncryptionUtil.decrypt( account.getEncryptedAccountNumber(), sharedSecret);\r\n if (accountNumber.equals(decryptAccount)) {\r\n return account;\r\n }\r\n\r\n final List<CreditCardMemberAccount> memberList = account.getCreditCardMemberAccountList();\r\n if (memberList != null && !memberList.isEmpty()){\r\n for (CreditCardMemberAccount member : memberList) {\r\n String decryptMember = securityEncryptionUtil.decrypt( member.getEncryptedAccountNumber(), sharedSecret);\r\n if (accountNumber.equals(decryptMember)) { return account; }\r\n }\r\n }\r\n }\r\n return null;\r\n }", "@Override\n public Account findByAccountNumber(String accountNumber) {\n Query findByAccNum = new Query();\n findByAccNum.addCriteria(Criteria.where(\"accountNumber\").is(accountNumber));\n Account found = operations.findOne(findByAccNum, Account.class);\n return found;\n }", "public UnoCard getCardByName(String cardName){\n Drawable color_change_plus4 = this.appContext.getResources().getDrawable(R.drawable.color_change_plus4);\n Drawable card_back = this.appContext.getResources().getDrawable(R.drawable.card_back);\n UnoCard card = new UnoCard(this.appContext, deckPos, new Point(20, 20), color_change_plus4, card_back, \"Color Change Plus 4\", \"\", \"COLOR CHANGE PLUS 4\", \"COLOR CHANGE PLUS 4\");\n for (UnoCard c : this.cards){\n if (c.getName().equals(cardName)){\n card = c;\n break;\n }\n }\n return card;\n }", "@Override\r\n\tpublic Account findByNumber(String number) {\n\t\tString jpaQuery = \"SELECT a FROM Account a WHERE a.number = :number\";\r\n\t\tTypedQuery<Account> query = entityManager.createQuery(jpaQuery, Account.class);\r\n\t\tquery.setParameter(\"number\", number);\r\n\t\treturn getFirstResult(query);\r\n\t}", "List<CardTypeDTO> lookupCardTypes();", "public List getCreditCards(int donorID) {\n List creditCardList = new LinkedList();\n for (Object creditCardObject : creditCardNumbers) {\n CreditCard creditCard = (CreditCard) creditCardObject;\n if (creditCard.getDonorId()==(donorID)) {\n creditCardList.add(creditCard);\n }\n }\n return creditCardList;\n }", "public interface CreditCard {\n\t// Getter Methods\n\tpublic Long getId();\n\tpublic CreditCardType getCreditCardType();\n\tpublic String getAccountNumber();\n\t/**\n\t * CVV number is the three-digit number on the back of a Discover, Visa or MasterCard;\n\t * or the four-digit number on the front of the American Express card.\n\t * @return\n\t */\n\tpublic String getCvvNumber();\n\tpublic String getCardHolderFirstName();\n\tpublic String getCardHolderLastName();\n\tpublic String getExpirationMonth();\n\tpublic String getExpirationYear();\n\tpublic String getBillingAddress();\n\tpublic String getBillingAddress2();\n\tpublic String getBillingCity();\n\tpublic States getBillingState();\n\tpublic String getBillingZipcode();\n\tpublic User getCreditCardHolder();\n\tpublic Boolean getPrimaryCreditCard();\n\tpublic Boolean getActive();\n\tpublic Date getCreationDate();\n\tpublic Date getModifiedDate();\n\tpublic Date getDeactivationDate();\n\t\n\t// Setter Methods\n\tpublic void setId(Long id);\n\tpublic void setCreditCardType(CreditCardType creditCardType);\n\tpublic void setAccountNumber(String accountNumber);\n\tpublic void setCvvNumber(String cvvNumber);\n\tpublic void setCardHolderFirstName(String cardHolderFirstName);\n\tpublic void setCardHolderLastName(String cardHolderLastName);\n\tpublic void setExpirationMonth(String expirationMonth);\n\tpublic void setExpirationYear(String expirationYear);\n\tpublic void setBillingAddress(String billingAddress);\n\tpublic void setBillingAddress2(String billAddress2);\n\tpublic void setBillingCity(String billingCity);\n\tpublic void setBillingState(States billingState);\n\tpublic void setBillingZipcode(String billingZipcode);\n\tpublic void setCreditCardHolder(User creditCardHolder);\n\tpublic void setPrimaryCreditCard(Boolean primaryCreditCard);\n\tpublic void setActive(Boolean active);\n\tpublic void setCreationDate(Date creationDate);\n\tpublic void setModifiedDate(Date modifiedDate);\n\tpublic void setDeactivationDate(Date deactivationDate);\n\n\t// Check to see if this card is active.\n\tpublic Boolean isActive();\n\t\n\t// Check to see if this card is the primary one for the account\n\tpublic Boolean isPrimaryCreditCard();\n\t\n\t// See if the card has expired.\n\tpublic Boolean hasCardExpired(Date currentDate);\n}", "List<Codebadge> search(String query);", "boolean similarCard(Card c);", "public void onActivityResult(int reqCode, int resultCode, Intent data) {\n super.onActivityResult(reqCode, resultCode, data);\n if (reqCode != Activity.RESULT_OK && data != null) {\n Uri contactUri = data.getData();\n String[] rcontact = {ContactsContract.CommonDataKinds.Phone.NUMBER, ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME};\n Cursor c = getContentResolver()\n .query(contactUri, rcontact, null, null, null);\n c.moveToFirst();\n int contact_name = c.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER);\n int contact_number = c.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME);\n String contact_number1 = c.getString(contact_number);\n String contact_name1 = c.getString(contact_name);\n input_msg.setText(\"Number: \" + contact_number1 + \" Name:\" + contact_name1);\n Toast.makeText(this, contact_name1 + \" has number \" + contact_number1, Toast.LENGTH_LONG).show();\n }\n else{\n Toast.makeText(this, \" This Device has no Contacs \", Toast.LENGTH_LONG).show();\n finish();\n }\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n jTextField7 = new javax.swing.JTextField();\n jButton1 = new javax.swing.JButton();\n jLabel6 = new javax.swing.JLabel();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTextArea1 = new javax.swing.JTextArea();\n jButton2 = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n\n jLabel1.setText(\"Enter credit card type:\");\n\n jButton1.setText(\"Search\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n jLabel6.setFont(new java.awt.Font(\"Dialog\", 1, 18)); // NOI18N\n jLabel6.setText(\"Search for credit card\");\n\n jTextArea1.setColumns(20);\n jTextArea1.setRows(5);\n jScrollPane1.setViewportView(jTextArea1);\n\n jButton2.setText(\"Back\");\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, 167, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel6))\n .addGap(100, 100, 100))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(18, 18, 18)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 362, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGap(134, 134, 134)\n .addComponent(jLabel1))\n .addGroup(layout.createSequentialGroup()\n .addGap(156, 156, 156)\n .addComponent(jButton1)))\n .addGap(0, 20, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(18, 18, 18)\n .addComponent(jLabel6))\n .addComponent(jButton2))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 26, Short.MAX_VALUE)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(20, 20, 20))\n );\n\n pack();\n }", "CardDto getCustomerCardDetails(Long cardId) throws EOTException;", "public static CreditCardType lookup(String ccNumber)\r\n\t{\r\n\t\tif (!SharedStringUtil.isEmpty(ccNumber))\r\n\t\t{\r\n\t\t\tfor (CreditCardType type: CreditCardType.values())\r\n\t\t\t{\r\n\t\t\t\tif (type.isValid(ccNumber))\r\n\t\t\t\t{\r\n\t\t\t\t\treturn type;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}", "private void searchExec(){\r\n\t\tString key=jComboBox1.getSelectedItem().toString();\r\n\t\tkey=NameConverter.convertViewName2PhysicName(\"Discount\", key);\r\n\t\tString valueLike=searchTxtArea.getText();\r\n\t\tList<DiscountBean>searchResult=discountService.searchDiscountByKey(key, valueLike);\r\n\t\tjTable1.setModel(ViewUtil.transferBeanList2DefaultTableModel(searchResult,\"Discount\"));\r\n\t}", "String search(int key);", "public void search() {\n boolean validate = true;\n code = \"\";\n Node<Product> p = null;\n System.out.print(\"Product code to search: \");\n while (validate) {\n code = s.nextLine();\n if (Validation.validateString(code)) {\n p = tree.search(code);\n validate = false;\n } else {\n System.err.println(\"Code must be required!\");\n System.err.print(\"Enter product code again: \");\n\n }\n }\n if (p != null) {\n System.out.println(\"Information of product code \" + p.info.getCode());\n tree.visit(p);\n } else {\n System.err.println(\"The product code \" + code + \" is not exist!\");\n }\n }", "public CardInformationExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public DebitCard(String n, int c, int p, Date e, Customer h, Provider p) {}", "@SuppressWarnings(\"unchecked\")\r\n\tpublic List<CardIssue> SSCgetCardDetails(String customerName,String SchemeName){\r\n\t\tObject[] param = {customerName,SchemeName};\r\n\t\treturn (List<CardIssue>) getHibernateTemplate().find(\"SELECT cardNo from CardIssue where customerName = ? and schemeName = ? and (status='Active' or status='Matured')\",param);\r\n\t}" ]
[ "0.712283", "0.71188897", "0.66834134", "0.6614198", "0.6584979", "0.62899476", "0.61743367", "0.59824836", "0.59551024", "0.5879975", "0.57998645", "0.57896864", "0.5758934", "0.57419115", "0.5721543", "0.57016855", "0.56614935", "0.5657727", "0.56471145", "0.5620198", "0.56060994", "0.5598311", "0.5588153", "0.5548134", "0.5533786", "0.5525129", "0.5490987", "0.54866666", "0.5481529", "0.54689497", "0.5456162", "0.5448164", "0.54441684", "0.543552", "0.5427716", "0.54181725", "0.53878975", "0.53823406", "0.5382284", "0.5370222", "0.5334818", "0.53110486", "0.5296755", "0.528608", "0.5284669", "0.5282904", "0.5270754", "0.52680796", "0.52648395", "0.5262393", "0.5256866", "0.5241154", "0.5237818", "0.52339154", "0.5198252", "0.5194839", "0.5182838", "0.5182359", "0.5161835", "0.5161835", "0.5161214", "0.5160143", "0.51502913", "0.5147963", "0.5142413", "0.5130749", "0.51222575", "0.5119793", "0.51144284", "0.5112018", "0.5105902", "0.5099468", "0.5098631", "0.5082525", "0.5076167", "0.50694394", "0.5065505", "0.5059177", "0.50584537", "0.5058039", "0.5044249", "0.501386", "0.5011963", "0.50109184", "0.5010724", "0.50080776", "0.5005452", "0.5004958", "0.50014967", "0.4983024", "0.4975814", "0.49713045", "0.49694225", "0.49678543", "0.4961711", "0.49603164", "0.49562556", "0.49406686", "0.49384478", "0.49317363" ]
0.6726925
2
Displays information about the customer.
public String toString() { return super.display() + "\n" + listAllCards() + "Purchased tickets: \n" + listAllTickets() + "___________________________________________"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void printCustomerDetails()\r\n {\r\n System.out.println(title + \" \" + firstName + \" \" \r\n + lastName + \"\\n\" +getAddress() \r\n + \"\\nCard Number: \" + cardNumber \r\n + \"\\nPoints available: \" + points);\r\n }", "@Override\n public void showCustomerDetails() {\n System.out.println(customerLoggedIn);\n }", "public static void viewCustomerInfo() {\n\t\tSystem.out.println(\"Please enter customer name\");\n\t\tString firstName=scan.nextLine();\n\t\tCustomer c=Bank.findCustomerByName(firstName);\n\t\tFind find=new Find();\n\t\tfind.viewCustomerDetails(c);\n\n\t\tSystem.out.println(\"Customer: \" + c.getFirstName() + \" \" + c.getLastName() + \" \"+ c.getUserName() + \" \"+ c.getPassword() \n\t\t+ \" \" + c.getDriverLicense() + \" \" + c.getAccountType() + \" \"+ c.getInitialDeposit() + \" \" + \"was viewed\");\n\t\tLogThis.LogIt(\"info\", c.getFirstName() + \" \" + c.getLastName()+ \" was viewed!\");\n\n\t\tSystem.out.println(\"Would you like to find another customer?\");\n\n\t\tSystem.out.println(\"\\t[y]es\");\n\t\tSystem.out.println(\"\\t[n]o\");\n\t\tSystem.out.println(\"\\t[l]og Out\");\n\n\n\t\tString option = scan.nextLine();\n\t\tswitch(option.toLowerCase()) {\n\t\tcase \"y\":\n\t\t\tviewCustomerInfo();\n\t\t\tbreak;\n\t\tcase \"n\":\n\t\t\tstartMenu();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tSystem.out.println(\"Invalid input. Redirecting to main menu\");\n\t\t\tstartMenu();\n\n\t\t}\n\t}", "public void displayCustomerDetails(){\n\t\tStringBuffer fullname = new StringBuffer();//Creates new string buffer\n\t\tStringBuffer fulladdress = new StringBuffer();//Creates new string buffer\n\t\tfullname.append(\"Full Name: \" + fname + \" \" + lname);\n\t\tfulladdress.append(\"Full Address: \" + address1 + \", \" + address2 + \", \" + postcode);\n\t\tSystem.out.println(fullname);\n\t\tSystem.out.println(fulladdress);\n\t\tSystem.out.println(\"Account No: \" + linkedacc);\n\t\tSystem.out.println(\"Customer Ref: \" + custref);\n\t}", "public void display()\r\n {\r\n System.out.println(\"Description: \" +description);\r\n if(!customersName.equals(\"\")) {\r\n System.out.println(\"Customer Name: \" +customersName);\r\n }\r\n }", "public Customer displayCustomer(int cid);", "private void showCustomerInfoDialog(Customer customer) {\n\t\ttry {\n\t\t\t// set up the root for the customer information dialog\n\t\t\tFXMLLoader loader = new FXMLLoader();\n\t\t\tloader.setLocation(C195Application.class.getResource(\"view/AddCustomer.fxml\"));\n\t\t\tloader.setResources(lang);\n\t\t\tAnchorPane customerInfoRoot = (AnchorPane) loader.load();\n\n\t\t\t// set up the stage for the customer information dialog\n\t\t\tStage customerInfoStage = new Stage();\n\t\t\tcustomerInfoStage.setTitle(\"\");\n\t\t\tcustomerInfoStage.initModality(Modality.WINDOW_MODAL);\n\t\t\tcustomerInfoStage.initOwner(stage);\n\n\t\t\t// add a new scene with the root to the stage\n\t\t\tScene scene = new Scene(customerInfoRoot);\n\t\t\tcustomerInfoStage.setScene(scene);\n\n\t\t\t// get the controller for the dialog and pass a reference \n\t\t\t// the customer info dialog stage, and a customer, if one was selected\n\t\t\tAddCustomerController controller = loader.getController();\n\t\t\tcontroller.setupDialog(customerInfoStage, customer);\n\n\t\t\t// show the customer information dialog\n\t\t\tcustomerInfoStage.showAndWait();\n\n\t\t\t// refresh the customer list after an update\n\t\t\tCustomer newCustomer = controller.getNewCustomer();\n\t\t\tif (newCustomer == null) return;\n\n\t\t\tif(customer == null) {\n\t\t\t\tcustomers.add(newCustomer);\n\t\t\t} else {\n\t\t\t\tcustomers.set(customers.indexOf(customer), newCustomer);\n\t\t\t}\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n\tpublic void viewCustomers(Session session){\n\t\ttry{\n\t\t\tSystem.out.print(\"*----*****-------List of Customers-------*****----*\\n\");\n\t\t\t\n\t\t\t//pass these input items to client controller\n\t\t\tviewCustomers=mvc.viewCustomers(session);\n\n\t\t\tSystem.out.println(\"CustomerId\"+\" \"+\"UserName\");\n\t\t\tfor(int i = 0; i < viewCustomers.size(); i++) {\n\t System.out.println(viewCustomers.get(i)+\"\\t\"+\"\\t\");\n\t }\n\t System.out.println(\"<------------------------------------------------>\");\n\t\t\t//System.out.println(viewCustomers);\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tSystem.out.println(\"Online Market App- Remove Customer Exception: \" +e.getMessage());\n\t\t}\n\t}", "public void Display(){\n System.out.println(\"************************************************************\");\n System.out.println(\"Customer Account Number: \"+getAccountNo());\n System.out.println(\"Customer Account Id: \"+getAccountId());\n System.out.println(\"Customer Type: \"+getAccountType());\n System.out.println(\"Customer Balance: $\"+getAccountBal());\n System.out.println(\"Thank you for banking with us!\");\n System.out.println(\"************************************************************\");\n }", "public void showCustomers() {\r\n List<String> customerList = new ArrayList<>();\r\n for (int i = 0; i < customersTable.getItems().size(); i++) {\r\n Customer customer = customersTable.getItems().get(i);\r\n LocalDate date = LocalDate.parse(customer.getDate());\r\n if (date.plusMonths(1).isBefore(LocalDate.now())) {\r\n customerList.add(customer.getFirstName() + \" \" + customer.getLastName());\r\n }\r\n }\r\n String message = \"\";\r\n for (String customer : customerList) {\r\n message += customer + \"\\n\";\r\n }\r\n if (message.equals(\"\")) {\r\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\r\n alert.setTitle(\"The following customers need to be contacted this week\");\r\n alert.setHeaderText(null);\r\n alert.setContentText(\"No customers to be contacted today\");\r\n alert.showAndWait();\r\n } else {\r\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\r\n alert.setTitle(\"The following customers need to be contacted this week\");\r\n alert.setHeaderText(null);\r\n alert.setContentText(message);\r\n alert.showAndWait();\r\n }\r\n }", "public String getName()\n {\n return customer;\n }", "public void updateCustomerInfo(){\n nameLabel.setText(customer.getName());\n productWantedLabel.setText(customer.getWantedItem());\n serviceManager.getTotalPrice().updateNode();\n }", "private void printCustomerDetails(CustomerService customerService) \n\t\t\t\t\t\tthrows DBOperationException\n\t{\n\t\tCustomer customer = customerService.getCustomerDetails();\n\t\tif(customer == null)\n\t\t{\n\t\t\tSystem.out.print(customerService.getClientMsg());\n\t\t\treturn;\n\t\t}\n\t\tSystem.out.println(customer);\n\t}", "public void listCustomers() {\r\n\t\tSystem.out.println(store.listCustomers());\r\n\t}", "public CustomerDetailsView displayDetailsView(char mode, Customer customer) { \r\n\r\n\t\tif(customerDetailsView == null) {\r\n\t\t\tcustomerDetailsView = new CustomerDetailsView() {\r\n\t\t\t\tpublic void cancelAction() {\r\n\t\t\t\t\tif(validateScreenBeforeClose()) {\r\n\t\t\t\t\t\tdisposeDetailsView();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\tApplicationMaster.addScreen(customerDetailsView);\r\n\t\t}\r\n\r\n\t\tcustomerDetailsView.setTitle(getValue(\"TTLscrxxxxx001CustomerDetailsScreen\"));\r\n\t\tcustomerDetailsView.setScreenMode(mode);\r\n\t\tcustomerDetailsView.setController(this);\r\n\r\n\t\tif(mode != CustomerDetailsView.ADD && customer != null) {\r\n\t\t\tcustomerDetailsView.populateScreen(customer);\r\n\t\t}\r\n\r\n\t\tif(customerSearchView != null && customerSearchView.isVisible()) {\r\n\t\t\tcustomerSearchView.setVisible(false);\r\n\t\t}\r\n\r\n\t\tcustomerDetailsView.setVisible(true);\r\n\t\treturn customerDetailsView;\r\n\t}", "@Override\n\tpublic Iterable<Customer> displayCust() {\n\t\treturn customerRepository.findAll();\n\t}", "public static void printCustomerInformation(Employee [] employee) {\n\t\tif (Customer.getCustomerQuantity() == 0) {\n\t\t\tJOptionPane.showMessageDialog(null, \"There is no customer!\");\n\t\t} else {\n\t\t\tfor (int i = 0; i < Customer.getCustomerQuantity(); i++) {\n\t\t\t\tJOptionPane.showMessageDialog(null, \"-------List of Customers-------\\n\"\n\t\t\t\t\t\t+ (i+1) + \": \"+ employee[i+1].getVehicle().getCustomer().getName() + \"\\n\");\n\t\t\t\tbreak;\n\t\t\t}\t\t\t\n\t\t}\n\t}", "public String getCustomer() {\n return customer;\n }", "public void readCustomerDetails()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tScanner reader = new Scanner(new FileReader(\"customersWhoPurchased.txt\"));\r\n\t\t\twhile (reader.hasNext())\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(reader.nextLine());\r\n\t\t\t}\r\n\t\t\treader.close();\r\n\t\t}\r\n\t\tcatch(FileNotFoundException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"FileNotFoundException\");\r\n\t\t}\r\n\t}", "@Action(value = \"showCustomAccountInfo\", results = { @Result(name = \"success\", location = \"/view/card/card/cardCharge/displayCustomerDepositCharge.jsp\"), })\n\tpublic String showCustomAccountInfo() {\n\t\tlog.info(\"Starting to show Customer Account info\");\n\t\tboolean flag = false;\n\t\ttry {\n\t\t\tthis.customerChargeBeanList = this.customerChargeServiceImpl\n\t\t\t\t\t.findCustomAccountRecordsByCriteria(this.customerChargeBean);\n\t\t\tif (this.customerChargeBeanList.size() > 0) {\n\t\t\t\tthis.customerChargeBean = this.customerChargeBeanList.get(0);\n\t\t\t\tlog.info(\"Successfully get the customer account info\");\n\t\t\t} else {\n\t\t\t\tthis.customerChargeBean = null;\n\t\t\t\tlog.info(\"can not get the customer account info\");\n\t\t\t}\n\t\t\tflag = true;\n\t\t} catch (Exception e) {\n\t\t\tlog.info(\"execute findCustomAccountRecordsByCriteria occured error, please references the detail log\\n \" + \"[\" + e\n\t\t\t\t\t+ \"]\\n\" + ErrorLogUtil.printInfo(e));\n\t\t\treturn ERROR;\n\t\t}\n\t\tif (flag) {\n\t\t\treturn SUCCESS;\n\t\t}\n\t\treturn ERROR;\n\t}", "@GetMapping(\"/{id}\")\n public String show(@PathVariable(\"id\") long id,\n Model model) {\n Customer customer = customerService.showCustomerById(id);\n model.addAttribute(CUSTOMER, customer);\n model.addAttribute(ACTUAL_ADDRESS, customer.getActualAddress());\n model.addAttribute(REGISTERED_ADDRESS, customer.getRegisteredAddress());\n return CUSTOMERS_CUSTOMER;\n }", "public void listCustomers() {\n\t\tSystem.out.println(\"\\nCustomers llegits desde la base de dades\");\n\n\t\tObjectSet<Customer> customers = db.query(Customer.class);\n\t\tcustomers.stream()\n\t\t\t.forEach(System.out::println);\n\n\t}", "public void showInfo()\n\t{\n\t\tSystem.out.println(\"Account Number : \"+getAccountNumber());\n\t\tSystem.out.println(\"Balance : \"+getBalance());\n\t\tSystem.out.println(\"Tenure Year : \"+tenureYear);\n\t}", "private void updateScreenCustomerDetails(Customer c) {\n // - update main title with customers full name\n tvCustomerMainTitle.setText(customer.toString());\n\n // - update screen with customer ID\n textViewID.setText(customer.getCustomerID());\n\n // - update screen with customer email\n tvCustomerEmail.setText(customer.getEmail());\n\n // - update screen with customer VIP status\n tvCustomerVipStatus.setText(customer.vipStatusToString());\n\n // - update avctive game and lane fields\n }", "@PreAuthorize(\"hasRole('ROLE_ADMIN')\")\n\t@RequestMapping(value = \"/{id}\", method = RequestMethod.GET) \n\tpublic String show(@PathVariable(\"id\") Long id, Model uiModel) {\n\t\t\n\t\tCustomer customer = customerService.findById(id); \n\t\t\n\t\tuiModel.addAttribute(\"customer\", customer); \n\t\t\n\t\treturn \"customers/show\";\n\t\t}", "public void printAllCustomerNames() {\r\n for (Customer customer : customers) {\r\n if (customer != null) {\r\n System.out.format(\"Customer with id[%s] is named %s\\n\", customer.getID(), customer.getName());\r\n }\r\n }\r\n }", "@Override\n public String getCustomer() {\n return this.customerName;\n }", "public String viewCustomerAttribute() throws Exception {\n\t\tactionStartTime = new Date();\n\t\tif (promotionId != null && promotionId != 0) {\n\t\t\ttry {\n\t\t\t\tlstPromotionCustAttrVO = promotionProgramMgr.getListPromotionCustAttrVOCanBeSet(null, promotionId);\n\t\t\t\t//listPromotionCustAttrVOAlreadySet = promotionProgramMgr.getListPromotionCustAttrVOAlreadySet(null, promotionId);\n\t\t\t} catch (Exception ex) {\n\t\t\t\tLogUtility.logErrorStandard(ex, R.getResource(\"web.log.message.error\", \"vnm.web.action.program.PromotionCatalogAction.viewCustomerAttribute\"), createLogErrorStandard(actionStartTime));\n\t\t\t\terrMsg = ValidateUtil.getErrorMsg(ConstantManager.ERR_SYSTEM);\n\t\t\t\tresult.put(\"errMsg\", errMsg);\n\t\t\t\tisError = true;\n\t\t\t\tresult.put(ERROR, isError);\n\t\t\t}\n\t\t}\n\t\treturn SUCCESS;\n\t}", "@Override\n\tpublic String getName(){\n\t\treturn customer.getName();\n\t}", "public void view() {\n\t\t\t\n\t\t\tSystem.out.println(\"Poping up window to show each order of customer @ AdminSaleController\");\n\t\t\tCustomerOrderMain vo = new CustomerOrderMain();\n\t\t vo.start(ps);\n\t\t\t\n\t\t}", "public String getCustomer_Name() {\n return customer_Name;\n }", "public String getCustomerName()\n {\n return customerName;\n }", "public void showCustomerOrders() {\n\t\ttextArea.setText(\"\");\n\t\tfor (int i = 0; i < driver.getOrderDB().getCustomerOrderList().size(); i++) {\n\t\t\tOrder order = (driver.getOrderDB().getCustomerOrderList().get(i));\n\t\t\ttextArea.append(\"Order \" + order.getId() + \" was created by \"\n\t\t\t\t\t+ order.getCurrentlyLoggedInStaff().getName() + \"\\nCustomer ID : \"\n\t\t\t\t\t+ ((Customer) order.getPerson()).getId() + \"\\nItems in this order :\");\n\t\t\tfor (int j = 0; j < order.getOrderEntryList().size(); j++) {\n\t\t\t\tStockItem stockItem = order.getOrderEntryList().get(j);\n\t\t\t\ttextArea.append(\"\\n \" + stockItem.getQuantity() + \" \"\n\t\t\t\t\t\t+ stockItem.getProduct().getProductName() + \" \"\n\t\t\t\t\t\t+ (stockItem.getProduct().getRetailPrice() * stockItem.getQuantity()));\n\t\t\t}\n\t\t\ttextArea.append(\"\\nThe total order value is \" + order.getGrandTotalOfOrder() + \"\\n\\n\\n\");\n\t\t}\n\t}", "public String getCustomerName() \n {\n return customerName;\n }", "public String getCustomerName() {\n return customerName;\n }", "public String getCustomerName() {\n return customerName;\n }", "@Override\n public String toString() {\n return \"Customer{\" +\n \"name='\" + name + '\\'' +\n \", surname='\" + surname + '\\'' +\n \", address='\" + address + '\\'' +\n \", email='\" + email + '\\'' +\n \", tel=\" + tel +\n '}';\n }", "@GetMapping(value = \"/addCustomer\")\n\tpublic String getCustomer(Model model) {\n\t\t// Create object and add to model for form\n\t\tCustomer customer = new Customer();\n\t\tmodel.addAttribute(\"Customer\", customer);\n\t\t// Returns showCustomers.jsp (see webapp/jsp folder)\n\t\treturn \"addCustomer\";\n\t}", "public void showCustomerInvoices()\n\t{\n\t\ttry {\n\t\t\tcon=DriverManager.getConnection(\"jdbc:mysql://localhost:3306/MundheElectronics1\",\"root\",\"vishakha\");\n\t\t\tString sql=\"select * from CustomerData order by Customer_Name asc\";\n\t\t\tps=con.prepareStatement(sql);\n\t\t\trs=ps.executeQuery();\n\t\t\ttblCustomer.setModel(DbUtils.resultSetToTableModel(rs));\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void displayDetails() {\r\n\t\tSystem.out.println(\"*******************Profile Details*********************\");\r\n\t\tSystem.out.println(\"\\tUsername :\\t\" + uName);\r\n\t\tSystem.out.println(\"\\tFull Name :\\t\" + fullName);\r\n\t\tSystem.out.println(\"\\tPhone :\\t\" + phone);\r\n\t\tSystem.out.println(\"\\tE-Mail :\\t\" + email);\r\n\t}", "public String getCustomerName()\n\t{\n\t\treturn name;\n\t}", "@GetMapping(\"/customerdetails\")\n\tpublic String listOfCustomer(Model model) {\n\t\tList<Customer> customerDetails = customerService.findByIsEnable();\n\t\tmodel.addAttribute(\"customerDetails\", customerDetails);\n\t\treturn \"customer-details\";\n\t}", "private void displayContactDetails() {\n System.out.println(\"displaying contact details :\");\n for (int i = 0; i < contactList.size(); i++) {\n System.out.println(\"contact no\" + (i + 1));\n Contact con = contactList.get(i);\n System.out.println(\"first name is :\" + con.getFirstName());\n\n System.out.println(\" last name is :\" + con.getLastName());\n\n System.out.println(\" address is :\" + con.getAddress());\n\n System.out.println(\" city name is :\" + con.getCity());\n\n System.out.println(\" state name is :\" + con.getState());\n\n System.out.println(\" zip code is :\" + con.getZip());\n\n System.out.println(\" phone number is :\" + con.getPhone());\n\n System.out.println(\" email address is :\" + con.getEmail());\n }\n }", "public String showDetails() {\n\t\treturn \"Person Name is : \" + name + \"\\n\" + \"Person Address is : \" + address;\n\t}", "public void showInfo() {\n\t\tsuper.showInfo();\n\t\tSystem.out.println(\n\t\t\t\t\" Your Savings Account Features: \" +\n\t\t\t\t\"\\n debitCardNumber: \" + debitCardNumber + \n\t\t\t\t\"\\n debitCardPIN: \" + debitCardPIN);\n\t}", "public void setCustomer(String customer) {\n this.customer = customer;\n }", "@Override\n\tpublic String toString() {\n\t\treturn \"Customer [id=\" + id + \", firstname=\" + firstname + \", lastname=\" + lastname + \", dob=\" + dob\n\t\t\t\t+ \", username=\" + username + \", password=\" + password + \"]\";\n\t}", "@Override\n\tpublic String getName() {\n\t\treturn customerName;\n\t}", "@Override\n\tpublic Customer viewCustomer(int customerId) {\n\t\t// TODO Auto-generated method stub\n\t\tCustomer cust = repository.findById(customerId)\n\t\t\t\t.orElseThrow(() -> new EntityNotFoundException(\"Currently No Customer is available with this id\"));\n\t\treturn cust;\n\t}", "@RequestMapping(\"/showForm\")\n\tpublic String showForm(Model theModel) {\n\t\tCustomer customer = new Customer();\n\n\t\t// add Customer object to the model\n\t\ttheModel.addAttribute(\"customer\", customer);\n\t\t\n\t\treturn \"customer-form\";\n\t}", "String getName() {\n\t\treturn customer.getName();\n\t}", "public static void showPersonDetails (int customerId, Database db)\r\n\t{\r\n\t\twhile(true) {\r\n\t\t\ttry {\r\n\t\t\t\tCustomer details = db.getCustomer(customerId);\r\n\r\n\t\t\t\tSystem.out.println(\"Customer \" + details.customerId + \": \" + details.name + \", \" + details.address + \", \" + details.phone + \", \" + details.sex + \", \" + details.dob);\r\n\t\t\t\tif (!details.AccountList.isEmpty()) {\r\n\t\t\t\t\tfor (int account : details.AccountList) {\r\n\t\t\t\t\t\tSystem.out.printf(\"Account %d: %5.2f EUR.\\n\", account, Account.getBalance(account, db));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t} catch (NullPointerException e) {\r\n\t\t\t\tSystem.out.println(\"Not a valid account.\");\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "static String serve(Customer customer) {\r\n\t\tString serviceReport = String.format(\r\n\t\t\t\"%d: %s %s arrived at %s to %s $%.2f and spoke to teller %d. Current balance: $%.2f\",\r\n\t\t\tcustomer.customerId,\r\n\t\t\tcustomer.firstName,\r\n\t\t\tcustomer.lastName,\r\n\t\t\tCustomerFunctions.getTime(customer.arrivalTime),\r\n\t\t\tCustomerFunctions.transactionTypeString(customer.transactionType),\r\n\t\t\tcustomer.transactionAmount,\r\n\t\t\tcustomer.tellerNo,\r\n\t\t\tcustomer.balance\r\n\t\t\t);\r\n\r\n\t\t// Perform deposit / withdrawl on customer account\r\n\t\tif (customer.transactionType == 'D') customer.balance += customer.transactionAmount;\r\n\t\telse customer.balance -= customer.transactionAmount;\r\n\r\n\t\tserviceReport += String.format(\r\n\t\t\t\", New balance: $%.2f, Wait time: %d minutes%n%n\",\r\n\t\t\tcustomer.balance,\r\n\t\t\tcustomer.serviceTime\r\n\t\t\t);\r\n\r\n\t\t// Add to teller totals\r\n\t\ttellerCount[customer.tellerNo - 1] += 1;\r\n\t\tif (customer.transactionType == 'D') tellerDeposits[customer.tellerNo - 1] += customer.transactionAmount;\r\n\t\telse tellerWithdrawls[customer.tellerNo-1] += customer.transactionAmount;\r\n\r\n\t\treturn serviceReport;\r\n\t}", "@Override\n //Override method to the to-string for the concatenation of the customer name and ID\n public String toString() {\n return customerName + \" [\" + customerId + \"]\";\n }", "public void showInfo() {\n\t\t\n\t\tsuper.showInfo();\n\t\tSystem.out.println(\"Your Checking Account features: \"\n\t\t\t\t+ \"\\nDebit Card Number: \" + debitCardNumber\n\t\t\t\t+ \"\\nDebit Card PIN: \" + debitCardPin\n\t\t\t\t+ \"\\n****************\"\n\t\t\t\t);\n\t\t\n\t}", "@GetMapping(value = \"/showCustomers\")\n\tpublic String getAllCustomers(Model model) {\n\t\t// AllCustomers model attribute iterated over to display Customers in table on\n\t\t// JSP page\n\t\tmodel.addAttribute(\"AllCustomers\", customerService.getCustomers());\n\t\t// Returns showCustomers.jsp (see webapp/jsp folder)\n\t\treturn \"showCustomers\";\n\t}", "public void setCustomer(String Cus){\n\n this.customer = Cus;\n }", "public void showEditCustomerScene(Customer customer) throws IOException {\n this.showEditCustomerScene(customer,null);\r\n }", "public void setCustomer_Name(String customer_Name) {\n this.customer_Name = customer_Name;\n }", "public String getCustomersName()\r\n {\r\n return customersName;\r\n }", "public void listAllCustomers() {\n List<Customer> list = model.findAllCustomers();\n if(list != null){\n if(list.isEmpty())\n view.showMessage(not_found_error);\n else\n view.showTable(list);\n }\n else\n view.showMessage(retrieving_data_error); \n }", "public void setCustomerName(String customerName) \n {\n this.customerName = customerName;\n }", "@GetMapping(\"/api/customer\")\n\tpublic ResponseEntity<List<CustomerDetails>> getAllCustomerDetails() {\n\n\t\tList<CustomerDetails> customerDetaillist = customerService.getAllCustomerDetails();\n\n\t\treturn ResponseEntity.ok().body(customerDetaillist);\n\n\t}", "public void showInfo(){\n\t\tfor (int i = 0; i < this.cd.size(); i++) {\n\t\t\tthis.cd.get(i).showInfo();\n\t\t}\n\t\tSystem.out.println(\"\\tToatl amount: \" + calTotalAmount());\n\t}", "public String getCustomerName(){\n return customerName;\n }", "public String getCustomerName() {\r\n return name.getName();\r\n }", "@GetMapping(\"/customer/{id}\")\r\n\tpublic Customer viewCustomerbyId(@PathVariable(\"id\") int customerId){\r\n\t\tif(custService.viewCustomerbyId(customerId)==null) {\r\n\t\t\tthrow new CustomerNotFoundException(\"Customer not found with this id\" +customerId);\r\n\t\t}\r\n\t\treturn custService.viewCustomerbyId(customerId);\r\n\t\t\r\n\t}", "public void setCustomerName(String customerName) {\n this.customerName = customerName;\n }", "public String getCustomerName() {\n\t\treturn customerName;\n\t}", "public String getCustomerName() {\n\t\treturn customerName;\n\t}", "public de.htwg_konstanz.ebus.framework.wholesaler.vo.Customer getCustomer () {\r\n\t\treturn customer;\r\n\t}", "@Override\n public String toString() {\n return super.toString() + String.format(\": Customer %d arrives\",\n this.customer.getId());\n }", "public org.tempuri.Customers getCustomer() {\r\n return customer;\r\n }", "public Customer getCustomer() {\r\n\t\treturn customer;\r\n\t}", "public Customer getCustomer() {\r\n\t\treturn customer;\r\n\t}", "public Customer getCustomer() {\n return this.customer;\n }", "public void displayLable() {\n\t\tSystem.out.println(\"Name of Company :\"+name+ \" Address :\"+address);\r\n\t}", "@Override\n public JSONObject viewCustomerById(long id) {\n\n return in_salescustdao.viewSLCustomerByID(id);\n }", "public void setCustomerName(String name) {\r\n this.name.setText(name);\r\n }", "public void printDetails()\n {\n System.out.println(\"Name: \" + foreName + \" \"\n + lastName + \"\\nEmail: \" + emailAddress);\n }", "public CekCustomer() {\n initComponents();\n serviceCekCustomer = new CekCustomerServiceImp();\n setLocationRelativeTo(null);\n this.view();\n }", "public String getCustomerid() {\n return customerid;\n }", "@GetMapping(\"/showForm\")\n public String showFormForAdd(Model theModel) {\n Customer theCustomer = new Customer();\n theModel.addAttribute(\"customer\", theCustomer);\n return \"customer-form\";\n }", "public String getCustName() \r\n\t{\r\n\t\t\r\n\t\treturn custName;\r\n\t\t\r\n\t}", "public Customer getCustomer() {\r\n\t\treturn this.customer;\r\n\t}", "private void displayCusInterface() {\n\t\t// Display menu options\n\t\tSystem.out.println(\n\t\t\t\"\\nAVAILABLE CUSTOMER COMMANDS:\" +\n\t\t\t\"\\n1: Add customer\" +\n\t\t\t\"\\n2: Show customer info, given customer name\" +\n\t\t\t\"\\n3: Find price for flights between two cities\" +\n\t\t\t\"\\n4: Find all routes between two cities\" +\n\t\t\t\"\\n5: Find all routes between two cities of a given airline\" +\n\t\t\t\"\\n6: Find all routes with available seats between two cities on given day\" +\n\t\t\t\"\\n7: For a given airline, find all routes with available seats between two cities on given day\" +\n\t\t\t\"\\n8: Add reservation\" +\n\t\t\t\"\\n9: Show reservation info, given reservation number\" +\n\t\t\t\"\\n10: Buy ticket from existing reservation\" +\n\t\t\t\"\\n11: Quit\\n\");\n\n\t\t// Get user input\n\t\tSystem.out.print(\"Enter command number: \");\n\t\tinputString = scan.nextLine();\n\t\t// Convert input to integer, if not convertable, set to 0 (invalid)\n\t\ttry { choice = Integer.parseInt(inputString);\n\t\t} catch(NumberFormatException e) {choice = 0;}\n\n\t\t// Handle user choices\n\t\tif(choice == 1) {\n\t\t\tSystem.out.print(\"Please enter Salutation (Mr/Mrs/Ms): \");\n\t\t\tString salutation = scan.nextLine();\n\t\t\tSystem.out.print(\"Please enter First Name: \");\n\t\t\tString first = scan.nextLine();\n\t\t\tSystem.out.print(\"Please enter Last Name: \");\n\t\t\tString last = scan.nextLine();\n\t\t\ttry { // Check if customer already exists\n\t\t\t\tquery = \"select * from CUSTOMER where first_name = ? and last_name = ?\";\n\t\t\t\tPreparedStatement updateStatement = connection.prepareStatement(query);\n\t\t\t\tupdateStatement.setString(1,first);\n\t\t\t\tupdateStatement.setString(2,last);\n\t\t\t\tupdateStatement.executeUpdate();\n\t\t\t\tresultSet = updateStatement.executeQuery(query);\n\t\t\t\t// If name doesn't exist, continue and get additional user input\n\t\t\t\tif(!resultSet.next()) {\n\t\t\t\t\tSystem.out.print(\"Please enter Street Address: \");\n\t\t\t\t\tString street = scan.nextLine();\n\t\t\t\t\tSystem.out.print(\"Please enter City: \");\n\t\t\t\t\tString city = scan.nextLine();\n\t\t\t\t\tSystem.out.print(\"Please enter State (2 letter): \");\n\t\t\t\t\tString state = scan.nextLine();\n\t\t\t\t\tSystem.out.print(\"Please enter Phone Number: \");\n\t\t\t\t\tString phone = scan.nextLine();\n\t\t\t\t\tSystem.out.print(\"Please enter Email address: \");\n\t\t\t\t\tString email = scan.nextLine();\n\t\t\t\t\tSystem.out.print(\"Please enter Credit Card Number: \");\n\t\t\t\t\tString cardNum = scan.nextLine();\n\t\t\t\t\tSystem.out.print(\"Please enter Credit Card Expiration Date (MM/YYYY): \");\n\t\t\t\t\tString expire = scan.nextLine();\n\t\t\t\t\tcus1(salutation, first, last, street, city, state, phone, email, cardNum, expire);\n\t\t\t\t} else System.out.println(\"ERROR: Customer already exists!\");\n\t\t\t} catch(SQLException Ex) {System.out.println(\"Error running the sample queries. Machine Error: \" + Ex.toString());}\n\t\t}\n\t\telse if(choice == 2) {\n\t\t\tSystem.out.print(\"Please enter Customer First Name: \");\n\t\t\tString first = scan.nextLine();\n\t\t\tSystem.out.print(\"Please enter Last Name: \");\n\t\t\tString last = scan.nextLine();\n\t\t\tcus2(first, last);\n\t\t}\n\t\telse if(choice == 3) {\n\t\t\tSystem.out.print(\"Please enter City One (3 letter): \");\n\t\t\tString one = scan.nextLine();\n\t\t\tSystem.out.print(\"Please enter City Two (3 letter): \");\n\t\t\tString two = scan.nextLine();\n\t\t\tcus3(one, two);\n\t\t}\n\t\telse if(choice == 4) {\n\t\t\tSystem.out.print(\"Please enter Departure City (3 letter): \");\n\t\t\tString depart = scan.nextLine();\n\t\t\tSystem.out.print(\"Please enter Arrival City (3 letter): \");\n\t\t\tString arrive = scan.nextLine();\n\t\t\tcus4(depart, arrive);\n\t\t}\n\t\telse if(choice == 5) {\n\t\t\tSystem.out.print(\"Please enter Departure City (3 letter): \");\n\t\t\tString depart = scan.nextLine();\n\t\t\tSystem.out.print(\"Please enter Arrival City (3 letter): \");\n\t\t\tString arrive = scan.nextLine();\n\t\t\tSystem.out.print(\"Please enter Airline name (full name): \");\n\t\t\tString airline = scan.nextLine();\n\t\t\tcus5(depart, arrive, airline);\n\t\t}\n\t\telse if(choice == 6) {\n\t\t\tSystem.out.print(\"Please enter Departure City (3 letter): \");\n\t\t\tString depart = scan.nextLine();\n\t\t\tSystem.out.print(\"Please enter Arrival City (3 letter): \");\n\t\t\tString arrive = scan.nextLine();\n\t\t\tSystem.out.print(\"Please enter Date (MM/DD/YYYY): \");\n\t\t\tString date = scan.nextLine();\n\t\t\tcus6(depart, arrive, date);\n\t\t}\n\t\telse if(choice == 7) {\n\t\t\tSystem.out.print(\"Please enter Departure City (3 letter): \");\n\t\t\tString depart = scan.nextLine();\n\t\t\tSystem.out.print(\"Please enter Arrival City (3 letter): \");\n\t\t\tString arrive = scan.nextLine();\n\t\t\tSystem.out.print(\"Please enter Date (MM/DD/YYYY): \");\n\t\t\tString date = scan.nextLine();\n\t\t\tSystem.out.print(\"Please enter Airline name (full name): \");\n\t\t\tString airline = scan.nextLine();\n\t\t\tcus7(depart, arrive, date, airline);\n\t\t}\n\t\telse if(choice == 8) {\n\t\t\t// Flight numbers\n\t\t\tString flight1 = null, flight2 = null, flight3 = null, flight4 = null;\n\t\t\t// Flight dates\n\t\t\tString dateN1 = null, dateN2 = null, dateN3 = null, dateN4 = null;\n\t\t\t// Booleans for if flight is available or wasn't entered\n\t\t\tboolean flight1A = false, flight2A = false, flight3A = false, flight4A = false;\n\t\t\tSystem.out.println(\"ADDING RESERVATION:\\nAdd first flight:\");\n\t\t\t// Get first leg (required)\n\t\t\tSystem.out.print(\" Flight Number: \");\n\t\t\tflight1 = scan.nextLine();\n\t\t\tSystem.out.print(\" Departure Date (MM/DD/YYYY): \");\n\t\t\tdateN1 = scan.nextLine();\n\t\t\t// Get second leg (optional)\n\t\t\tSystem.out.print(\"Add another leg in this direction? (Y/N): \");\n\t\t\tinputString = scan.nextLine();\n\t\t\tif(inputString.equals(\"Y\") || inputString.equals(\"y\")) {\n\t\t\t\tSystem.out.print(\" Flight Number: \");\n\t\t\t\tflight2 = scan.nextLine();\n\t\t\t\tSystem.out.print(\" Departure Date (MM/DD/YYYY): \");\n\t\t\t\tdateN2 = scan.nextLine();\n\t\t\t}\n\t\t\t// Get return trip first leg (optional)\n\t\t\tSystem.out.print(\"Add return trip? (Y/N): \");\n\t\t\tinputString = scan.nextLine();\n\t\t\tif(inputString.equals(\"Y\") || inputString.equals(\"y\")) {\n\t\t\t\tSystem.out.print(\" Flight Number: \");\n\t\t\t\tflight3 = scan.nextLine();\n\t\t\t\tSystem.out.print(\" Departure Date (MM/DD/YYYY): \");\n\t\t\t\tdateN3 = scan.nextLine();\n\t\t\t\t// Get return trip second leg (optional, requires return trip first leg)\n\t\t\t\tSystem.out.print(\"Add another leg in this direction? (Y/N): \");\n\t\t\t\tinputString = scan.nextLine();\n\t\t\t\tif(inputString.equals(\"Y\") || inputString.equals(\"y\")) {\n\t\t\t\t\tSystem.out.print(\" Flight Number: \");\n\t\t\t\t\tflight4 = scan.nextLine();\n\t\t\t\t\tSystem.out.print(\" Departure Date (MM/DD/YYYY): \");\n\t\t\t\t\tdateN4 = scan.nextLine();\n\t\t\t\t}\n\t\t\t}\n\t\t\ttry { // Check if seats are available in non-null flights\n\t\t\t\tPreparedStatement updateStatement;\n\t\t\t\tif(flight2 != null && !flight1.isEmpty()) { // Check if flight1 seat is available\n\t\t\t\t\tquery = \"select flight_number from flight f1, plane where f1.flight_number = ? AND plane.plane_capacity > (select count(D.flight_number) from DETAIL D where D.flight_number = ?)\";\n\t\t\t\t\tupdateStatement = connection.prepareStatement(query);\n\t\t\t\t\tupdateStatement.setString(1,flight1);\n\t\t\t\t\tupdateStatement.setString(2,flight1);\n\t\t\t\t\tupdateStatement.executeUpdate();\n\t\t\t\t\tresultSet = updateStatement.executeQuery(query);\n\t\t\t\t\tif(resultSet.next())\n\t\t\t\t\t\tflight1A = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tflight1A = true;\n\t\t\t\tif(flight2 != null && !flight2.isEmpty()) { // Check if flight2 seat is available\n\t\t\t\t\tquery = \"select flight_number from flight f1, plane where f1.flight_number = ? AND plane.plane_capacity > (select count(D.flight_number) from DETAIL D where D.flight_number = ?)\";\n\t\t\t\t\tupdateStatement = connection.prepareStatement(query);\n\t\t\t\t\tupdateStatement.setString(1,flight2);\n\t\t\t\t\tupdateStatement.setString(2,flight2);\n\t\t\t\t\tupdateStatement.executeUpdate();\n\t\t\t\t\tresultSet = updateStatement.executeQuery(query);\n\t\t\t\t\tif(resultSet.next())\n\t\t\t\t\t\tflight2A = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tflight2A = true;\n\t\t\t\tif(flight3 != null && !flight3.isEmpty()) { // Check if flight3 seat is available\n\t\t\t\t\tquery = \"select flight_number from flight f1, plane where f1.flight_number = ? AND plane.plane_capacity > (select count(D.flight_number) from DETAIL D where D.flight_number = ?)\";\n\t\t\t\t\tupdateStatement = connection.prepareStatement(query);\n\t\t\t\t\tupdateStatement.setString(1,flight3);\n\t\t\t\t\tupdateStatement.setString(2,flight3);\n\t\t\t\t\tupdateStatement.executeUpdate();\n\t\t\t\t\tresultSet = updateStatement.executeQuery(query);\n\t\t\t\t\tif(resultSet.next())\n\t\t\t\t\t\tflight3A = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tflight3A = true;\n\t\t\t\tif(flight4 != null && !flight4.isEmpty()) { // Check if flight4 seat is available\n\t\t\t\t\tquery = \"select flight_number from flight f1, plane where f1.flight_number = ? AND plane.plane_capacity > (select count(D.flight_number) from DETAIL D where D.flight_number = ?)\";\n\t\t\t\t\tupdateStatement = connection.prepareStatement(query);\n\t\t\t\t\tupdateStatement.setString(1,flight4);\n\t\t\t\t\tupdateStatement.setString(2,flight4);\n\t\t\t\t\tupdateStatement.executeUpdate();\n\t\t\t\t\tresultSet = updateStatement.executeQuery(query);\n\t\t\t\t\tif(resultSet.next())\n\t\t\t\t\t\tflight4A = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tflight4A = true;\n\t\t\t\t// If all non-null flights are available, get cid and call cus8 to gather data and make reservation\n\t\t\t\tif(flight1A && flight2A && flight3A && flight4A) {\n\t\t\t\t\t// Get customer CID\n\t\t\t\t\tSystem.out.print(\"Seating available!\\n Please enter CID: \");\n\t\t\t\t\tString cid = scan.nextLine();\n\t\t\t\t\tcus8(flight1, flight2, flight3, flight4, dateN1, dateN2, dateN3, dateN4, cid);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tSystem.out.println(\"SEATING UNAVAILABLE ON ONE OR MORE FLIGHTS\");\n\t\t\t} catch(SQLException Ex) {System.out.println(\"Error running the sample queries. Machine Error: \" + Ex.toString());}\n\t\t}\n\t\telse if(choice == 9) {\n\t\t\tSystem.out.print(\"Please enter reservation number: \");\n\t\t\tString num = scan.nextLine();\n\t\t\tcus9(num);\n\t\t}\n\t\telse if(choice == 10) {\n\t\t\tSystem.out.print(\"Please enter reservation number: \");\n\t\t\tString num = scan.nextLine();\n\t\t\tcus10(num);\n\t\t}\n\t\telse if(choice == 11) exit = true;\n\t\telse System.out.println(\"INVALID CHOICE\");\n\n\t\tif(!exit) { // Exiting will ignore loop and drop to main to exit properly\n\t\t\t// Repeat menu after user controlled pause\n\t\t\tSystem.out.print(\"Press Enter to Continue... \");\n\t\t\tscan.nextLine();\n\t\t\tdisplayCusInterface();\n\t\t}\n\t}", "public Customer getCustomer() {\n\t\treturn customer;\n\t}", "public void addCustomer() {\r\n\t\tdo {\r\n\t\t\tString name = getToken(\"Enter the customer's name: \");\r\n\t\t\tString phoneNumber = getToken(\"Enter the phone number: \");\r\n\t\t\tCustomer customer = store.addCustomer(name, phoneNumber);\r\n\t\t\tif (customer == null) {\r\n\t\t\t\tSystem.out.println(\"Could not add customer.\");\r\n\t\t\t}\r\n\t\t\tSystem.out.println(customer);\r\n\t\t} while (yesOrNo(\"Would you like to add another Customer?\"));\r\n\t}", "@GetMapping(\"/customer/{id}\")\n\tpublic ResponseEntity<Object> getCustomerDetailed(@PathVariable(\"id\") Integer id, HttpServletRequest request){\n\t\tif(service.findByEmail(SessionManager.getInstance().getSessionEmail(request.getSession())) == null) {\n\t\t\tSessionManager.getInstance().delete(request.getSession());\n\t\t\treturn new ResponseEntity<>(HttpStatus.UNAUTHORIZED); \n\t\t}else {\n\t\t\tCustomer cus = cService.findById(id);\n\t\t\tif(cus == null) return new ResponseEntity<>(HttpStatus.NOT_FOUND);\n\t\t\tMappingJacksonValue mappedCustomer = new MappingJacksonValue(cus);\n\t\t\tmappedCustomer.setFilters(new SimpleFilterProvider().addFilter(Customer.FILTER, SimpleBeanPropertyFilter.serializeAll()));\n\t\t\treturn new ResponseEntity<>(mappedCustomer, HttpStatus.OK);\n\t\t}\n\t}", "public void displayCharacterInfo(CharacterDTO myCharacter){\n \n view.display(myCharacter.getName() + \":\" + myCharacter.getAge() + \":\" + myCharacter.getHairColor() + \":\" + myCharacter.getRank() + \"\");\n }", "public String getCustomerName() {\n\t\treturn this.customer.getCustomerName();\n\t}", "@ApiModelProperty(value = \"Name of the customer\")\n public String getCustomerName() {\n return customerName;\n }", "private void showCreateCustomer(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n request.setAttribute(\"customerTypes\",customerTypeService.findAll());\n RequestDispatcher dispatcher= request.getRequestDispatcher(\"/customer/create.jsp\");\n dispatcher.forward(request,response);\n System.out.println(\"customerTypes\" + customerTypeService.findAll());\n }", "public void getInfo(){\n System.out.println(\"Name: \" + name + \"\\n\" + \"Address: \" + address);\n }", "public Customer getCustomer() {\r\n return customer;\r\n }", "public void display()\n\t{\n\t\tSystem.out.println(\"Bike No.\\t\"+\n\t\t\t\t\"Phone no.\\t\"+\n\t\t\t\t\"Name\\t\"+\n\t\t\t\t\"No. of days\\t\"+\n\t\t\t\t\"Charge\");\n\t\tSystem.out.println(bno+\n\t\t\t\t\"\\t\"+phno+\n\t\t\t\t\"\\t\"+name+\n\t\t\t\t\"\\t\"+days+\n\t\t\t\t\"\\t\"+charge);\n\t}", "public void info() {\r\n System.out.println(\" Name: \" + name + \" Facility: \" + facility + \" Floor: \" + floor + \" Covid: \"\r\n + positive + \" Age: \" + age + \" ID: \" + id);\r\n }", "public void writeCustomerDetails (String firstName, String lastName, int mobile, String email, String deliveryAddressNumber, String deliveryAddress)\r\n\t{\r\n\t\ttry \r\n\t\t{\r\n\t\t\tPrintWriter out = new PrintWriter(new FileWriter(\"customersWhoPurchased.txt\", true));\r\n\t\t\tout.println(\"First Name: \" +firstName);\t\t\t\r\n\t\t\tout.println(\"Last Name: \" +lastName);\r\n\t\t\tout.println(\"Mobile number: \" +mobile);\r\n\t\t\tout.println(\"Email: \" +email);\r\n\t\t\tout.println(\"Devliery address: \" +deliveryAddressNumber+ \" \" +deliveryAddress);\r\n\t\t\tout.println(\" \");\r\n\t\t\tout.close();\r\n\t\t}\r\n\t\tcatch(FileNotFoundException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Error: Cannot open file for writing\");\r\n\t\t}\r\n\t\tcatch(IOException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Error: Cannot write to file\");\r\n\t\t}\r\n\t}", "public String getCustName() {\n\t\treturn custName;\n\t}", "public String getCustName() {\n\t\treturn custName;\n\t}", "public CustomerViewDetails() {\n initComponents();\n Toolkit tk = Toolkit.getDefaultToolkit();\n int x = (int) tk.getScreenSize().getWidth();\n int y = (int) tk.getScreenSize().getHeight();\n this.setSize(x, y);\n }" ]
[ "0.78255105", "0.78009003", "0.7797142", "0.77256966", "0.7671319", "0.7167723", "0.7140272", "0.7115539", "0.68262047", "0.6809014", "0.6775935", "0.6773554", "0.675795", "0.6753867", "0.6723381", "0.6708607", "0.6700111", "0.66716814", "0.6658632", "0.66559845", "0.6639602", "0.66162336", "0.66145957", "0.65826684", "0.65694886", "0.6568149", "0.65573525", "0.6547465", "0.65324235", "0.65141803", "0.6510016", "0.64820987", "0.6479643", "0.64530325", "0.6452897", "0.6452897", "0.6445786", "0.64380586", "0.6424713", "0.6423948", "0.6417937", "0.6401616", "0.63910156", "0.6378877", "0.6378369", "0.6375904", "0.63416404", "0.6341612", "0.6339899", "0.63322383", "0.6332159", "0.63202894", "0.6318525", "0.63149995", "0.63070637", "0.62992334", "0.62924063", "0.6290393", "0.6277971", "0.6274803", "0.62728876", "0.62726986", "0.6271687", "0.62700766", "0.6251371", "0.62317425", "0.62299865", "0.6227628", "0.62014765", "0.62014765", "0.618491", "0.6170381", "0.61636645", "0.6162016", "0.6162016", "0.6148198", "0.61459404", "0.6142925", "0.61383605", "0.61370134", "0.61367065", "0.6130892", "0.6120369", "0.6103933", "0.6103879", "0.60888517", "0.6080433", "0.60794747", "0.6078018", "0.6066591", "0.6063198", "0.60569376", "0.60339487", "0.60234904", "0.59943956", "0.5983632", "0.5983507", "0.598335", "0.59755135", "0.59755135", "0.5973936" ]
0.0
-1
TODO Autogenerated method stub
public List<NameValuePair> userCreationObject(String phone_number,String company_name,String latitude,String longitude,String locationVal,String fullAddress,String active_status,String download_status,String user_name) { List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); try { nameValuePairs.add(new BasicNameValuePair("phone_number",phone_number)); nameValuePairs.add(new BasicNameValuePair("Name",user_name)); nameValuePairs.add(new BasicNameValuePair("company_name",company_name)); nameValuePairs.add(new BasicNameValuePair("latitude",latitude)); nameValuePairs.add(new BasicNameValuePair("longitude",longitude)); nameValuePairs.add(new BasicNameValuePair("location",locationVal)); nameValuePairs.add(new BasicNameValuePair("fullAddress",fullAddress)); nameValuePairs.add(new BasicNameValuePair("is_active",active_status)); nameValuePairs.add(new BasicNameValuePair("app_download_status",download_status)); } catch (Exception e) { //TODO e.printStackTrace(); } return nameValuePairs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
public List<NameValuePair> addDriverPhone(String driver_phone_number,String owner_phone_number) { List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); try { nameValuePairs.add(new BasicNameValuePair("driver_phone_number",driver_phone_number)); nameValuePairs.add(new BasicNameValuePair("vehicle_owner_phone_number",owner_phone_number)); } catch (Exception e) { //TODO e.printStackTrace(); } return nameValuePairs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
public List<NameValuePair> SaveTripId(String trip_id ,String owner_phone_number) { List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); try { nameValuePairs.add(new BasicNameValuePair("vehicleTripId",trip_id)); nameValuePairs.add(new BasicNameValuePair("phone_number",owner_phone_number)); } catch (Exception e) { //TODO e.printStackTrace(); } return nameValuePairs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
public List<NameValuePair> getDriverPhone(String owner_phone_number) { List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); try { nameValuePairs.add(new BasicNameValuePair("vehicle_owner_phone_number",owner_phone_number)); } catch (Exception e) { //TODO e.printStackTrace(); } return nameValuePairs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "private stendhal() {\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.66708666", "0.65675074", "0.65229905", "0.6481001", "0.64770633", "0.64584893", "0.6413091", "0.63764185", "0.6275735", "0.62541914", "0.6236919", "0.6223816", "0.62017626", "0.61944294", "0.61944294", "0.61920846", "0.61867654", "0.6173323", "0.61328775", "0.61276996", "0.6080555", "0.6076938", "0.6041293", "0.6024541", "0.6019185", "0.5998426", "0.5967487", "0.5967487", "0.5964935", "0.59489644", "0.59404725", "0.5922823", "0.5908894", "0.5903041", "0.5893847", "0.5885641", "0.5883141", "0.586924", "0.5856793", "0.58503157", "0.58464456", "0.5823378", "0.5809384", "0.58089525", "0.58065355", "0.58065355", "0.5800514", "0.57912874", "0.57912874", "0.57912874", "0.57912874", "0.57912874", "0.57912874", "0.57896614", "0.5789486", "0.5786597", "0.5783299", "0.5783299", "0.5773351", "0.5773351", "0.5773351", "0.5773351", "0.5773351", "0.5760369", "0.5758614", "0.5758614", "0.574912", "0.574912", "0.574912", "0.57482654", "0.5732775", "0.5732775", "0.5732775", "0.57207066", "0.57149917", "0.5714821", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57115865", "0.57045746", "0.5699", "0.5696016", "0.5687285", "0.5677473", "0.5673346", "0.56716853", "0.56688815", "0.5661065", "0.5657898", "0.5654782", "0.5654782", "0.5654782", "0.5654563", "0.56536144", "0.5652585", "0.5649566" ]
0.0
-1