我们必须解决一个难题,我们需要从系统中检查来自多个源的许多复杂规则,以确定系统是否满足这些规则或如何更改以满足它们.
我们最初开始使用Constraint Satisfaction Problems算法(使用Choco)来尝试解决它,但由于规则和变量的数量会比预期的要小,我们希望在数据库上构建所有可能配置的列表并使用多个请求关于过滤此列表的规则并以这种方式找到解决方案.
与将CSP求解器算法用于合理数量的规则和变量相比,进行系统搜索有限制或缺点吗?它会显着影响性能吗?它会减少我们可以实施的约束吗?
例如:
你必须想象它有更多的变量,更大的定义域(但总是离散的)和更多的规则(和一些更复杂的)但不是将问题描述为:
x in (1,6,9)
y in (2,7)
z in (1,6)
y = x + 1
z = x if x < 5 OR z = y if x > 5
Run Code Online (Sandbox Code Playgroud)
把它交给求解器我们会建一个表:
X | Y | Z
1 2 1
6 2 1
9 2 1
1 7 1
6 7 1
9 7 1
1 2 6
6 2 6
9 2 6
1 7 6
6 7 6
9 7 …Run Code Online (Sandbox Code Playgroud) 我有一个项目,其中包含许多使用 @Configuration 类(Spring Integration 和 Spring Batch 的东西)定义 bean 的小库,我经常遇到问题,因为这两个库都有一个同名的 bean。
可以:
我需要在应用程序的日志中提供请求和响应,但Apache CXF发送的请求在FastInfoset(Content-Type:application/fastinfoset)中,这导致请求和响应的日志不可读(因为它是二进制的) ).有没有办法解决这个问题,以便我保留FastInfoset消息(出于性能原因)但是我在日志中得到了正确的XML?
这是我现在拥有的CXF配置,如果有帮助的话:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cxf="http://cxf.apache.org/core"
xsi:schemaLocation="
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<bean id="logInbound" class="org.apache.cxf.interceptor.LoggingInInterceptor" />
<bean id="logOutbound" class="org.apache.cxf.interceptor.LoggingOutInterceptor" />
<cxf:bus>
<cxf:inInterceptors>
<ref bean="logInbound" />
</cxf:inInterceptors>
<cxf:outInterceptors>
<ref bean="logOutbound" />
</cxf:outInterceptors>
<cxf:outFaultInterceptors>
<ref bean="logOutbound" />
</cxf:outFaultInterceptors>
<cxf:inFaultInterceptors>
<ref bean="logInbound" />
</cxf:inFaultInterceptors>
</cxf:bus>
</beans>
Run Code Online (Sandbox Code Playgroud)
预先感谢您的任何帮助.
algorithm ×1
cxf ×1
fastinfoset ×1
java ×1
jax-ws ×1
search ×1
spring ×1
spring-boot ×1
web-services ×1