B2B hybris模块gen不起作用(B2B hybris module gen does not work)
在使用b2b_acc配方后,我想要做模块生成。 喜欢:
ant modulegen -Dinput.module=accelerator -Dinput.name=qqq -Dinput.package=com.fffff.sampa -Dinput.template=develop
但它会给出错误
hybris "java.util.regex.PatternSyntaxException": Illegal repetition near index 0 ${YMODULE_TOKEN}(.*)
并没有关于如何为b2b做的信息。
我能做什么? 我需要开发一个B2B网站。 我应该使用extgen吗?
现在它给出了这个:
java.lang.IllegalArgumentException:由于重复属性'ConsignmentProcess.done(java.lang.Boolean):((fulfilmentprocess)):: YAttributeDescriptor [fulfilmentprocess-items.xml:无法将名称空间((fulfilmentprocess))合并到(() 18(AttributeTagListener)] [PROPERTY]'vs'ConsignmentProcess.done(java.lang.Boolean):((yacceleratorfulfilmentprocess)):: YAttributeDescriptor [yacceleratorfulfilmentprocess-items.xml:18(AttributeTagListener)] [PROPERTY]'
AFter using b2b_acc recipe, i want to do module gen. like:
ant modulegen -Dinput.module=accelerator -Dinput.name=qqq -Dinput.package=com.fffff.sampa -Dinput.template=develop
but it gives error of
hybris "java.util.regex.PatternSyntaxException": Illegal repetition near index 0 ${YMODULE_TOKEN}(.*)
And there is no information about how to do for b2b.
What can i do? I need to develop a b2b website. Should i use extgen?
Now it gives this:
java.lang.IllegalArgumentException: cannot merge namespace ((fulfilmentprocess)) into (()) due to duplicate attribute 'ConsignmentProcess.done(java.lang.Boolean):((fulfilmentprocess))::YAttributeDescriptor[fulfilmentprocess-items.xml:18(AttributeTagListener)][PROPERTY]' vs 'ConsignmentProcess.done(java.lang.Boolean):((yacceleratorfulfilmentprocess))::YAttributeDescriptor[yacceleratorfulfilmentprocess-items.xml:18(AttributeTagListener)][PROPERTY]'
原文:https://stackoverflow.com/questions/50233675
最满意答案
我同意Calumn:DFS是最简单的方法。 这是一个类似python的伪代码的简单解决方案。 它会将解决方案打印为“L”,“R”,“U”,“D”的序列,以指示向左,向右,向上或向下。
def flood(x,y,story): if (visited[x][y] or map[x][y]=='0'): return; visited[x][y]=True; if (map[x][y]=='3'): print 'done. The path is: '+story return if (x<len(a[0])): flood(x+1,y,story+'R') if (y<len(a)): flood(x,y+1,story+'D') if (x>0): flood(x-1,y,story+'L') if (y>0): flood(x,y-1,story+'U') def solve(map): visited = array_of_false_of_same_size_as(map) x,y = find_the_two(map) flood(x,y,'')
一旦找到解决方案就使其停止的优化作为练习留给读者(你可以使洪水返回一个布尔值来指示它是否找到了什么,或使用全局标志)。
(ps我做了这个回答社区维基,因为我只是澄清了Calumn的答案。我不能说太多的功劳)
广度优先搜索版本,也在Python中
对于它的价值而言,只是为了表明广度优先搜索并不复杂,Python中的实际可运行程序:
def find(grid, xstart=0, ystart=0): # Maps (xi,yi) to (x(i-1), y(i-1)) prev = {(xstart, ystart):None} # Prepare for the breadth-first search queue = [(xstart, ystart)] qpos = 0 # Possibly enqueue a trial coordinate def enqueue(prevxy, dx, dy): x = prevxy[0] + dx y = prevxy[1] + dy xy = (x, y) # Check that it hasn't been visited and the coordinates # are valid and the grid position is not a 0 if (xy not in prev and x >= 0 and x < len(grid) and y >= 0 and y < len(grid[x]) and grid[x][y] != 0): # Record the history (and the fact that we've been here) prev[xy] = prevxy # If we found the target, signal success if grid[x][y] == 3: return xy # Otherwise, queue the new coordinates else: queue.append(xy) return None # The actual breadth-first search while qpos < len(queue): xy = queue[qpos] qpos += 1 found = ( enqueue(xy, 1, 0) or enqueue(xy, 0, 1) or enqueue(xy, -1, 0) or enqueue(xy, 0, -1)) if found: break # Recover the path path = [] while found: path.append(found) found = prev[found] path.reverse() return path # Test run grid = [ [2,1,1,1,1,1,1,1,1,0,0,0,0,0] , [0,0,0,0,0,0,1,1,0,0,0,0,0,0] , [0,0,0,0,1,1,1,1,1,1,1,1,1,1] , [0,0,0,0,1,1,1,1,1,0,0,1,1,1] , [0,0,0,0,1,1,1,0,0,0,0,1,0,1] , [0,0,0,0,1,1,1,1,1,0,0,1,1,3] ] for x, y in find(grid): grid[x][y]='*' print '\n'.join(''.join(str(p) for p in line) for line in grid)
输出:
*******1100000 000000*1000000 000011******11 00001111100*11 00001110000*01 00001111100***
I agree with Calumn: DFS is the simplest approach here. Here is a simple solution in python-like pseudocode. It will print the solution as a sequence of 'L','R',U','D' to indicate left,right,up, or down.
def flood(x,y,story): if (visited[x][y] or map[x][y]=='0'): return; visited[x][y]=True; if (map[x][y]=='3'): print 'done. The path is: '+story return if (x<len(a[0])): flood(x+1,y,story+'R') if (y<len(a)): flood(x,y+1,story+'D') if (x>0): flood(x-1,y,story+'L') if (y>0): flood(x,y-1,story+'U') def solve(map): visited = array_of_false_of_same_size_as(map) x,y = find_the_two(map) flood(x,y,'')
The optimization of making it stop as soon as it finds a solution is left as an exercise to the reader (you could make flood return a boolean to indicate if it found something, or use a global flag).
(p.s. I made this answer community wiki since I'm just clarifying Calumn's answer. I can't claim much credit)
Breadth-First Search version, also in Python
For what it's worth, and just to show that breadth-first search is not that complicated, an actual runnable program in Python:
def find(grid, xstart=0, ystart=0): # Maps (xi,yi) to (x(i-1), y(i-1)) prev = {(xstart, ystart):None} # Prepare for the breadth-first search queue = [(xstart, ystart)] qpos = 0 # Possibly enqueue a trial coordinate def enqueue(prevxy, dx, dy): x = prevxy[0] + dx y = prevxy[1] + dy xy = (x, y) # Check that it hasn't been visited and the coordinates # are valid and the grid position is not a 0 if (xy not in prev and x >= 0 and x < len(grid) and y >= 0 and y < len(grid[x]) and grid[x][y] != 0): # Record the history (and the fact that we've been here) prev[xy] = prevxy # If we found the target, signal success if grid[x][y] == 3: return xy # Otherwise, queue the new coordinates else: queue.append(xy) return None # The actual breadth-first search while qpos < len(queue): xy = queue[qpos] qpos += 1 found = ( enqueue(xy, 1, 0) or enqueue(xy, 0, 1) or enqueue(xy, -1, 0) or enqueue(xy, 0, -1)) if found: break # Recover the path path = [] while found: path.append(found) found = prev[found] path.reverse() return path # Test run grid = [ [2,1,1,1,1,1,1,1,1,0,0,0,0,0] , [0,0,0,0,0,0,1,1,0,0,0,0,0,0] , [0,0,0,0,1,1,1,1,1,1,1,1,1,1] , [0,0,0,0,1,1,1,1,1,0,0,1,1,1] , [0,0,0,0,1,1,1,0,0,0,0,1,0,1] , [0,0,0,0,1,1,1,1,1,0,0,1,1,3] ] for x, y in find(grid): grid[x][y]='*' print '\n'.join(''.join(str(p) for p in line) for line in grid)
Output:
*******1100000 000000*1000000 000011******11 00001111100*11 00001110000*01 00001111100***
相关问答
更多-
查找当前用户的路径(Finding the path of the current user)[2022-02-21]
可以通过检索用户的主目录 String userHomeDir = System.getProperty("user.home"); 请参阅系统属性 The user's home directory can be retrieved via String userHomeDir = System.getProperty("user.home"); See System Properties -
使用算法A *查找路径(Finding path using algorithm A*)[2022-04-17]
也许你不需要push position.push(_e.target); ,只需将光标放到最后,光标没有更多目标后,可以将光标初始化回第一个节点,不要忘记你访问的每个节点都必须设置为true maybe you don't need push position.push(_e.target); , just let the cursor in to the end , after the cursor hasn't more target , you can initial the cursor to ba ... -
我将从有向图开始,每个节点代表你的数字加上额外的自由度(由于约束)。 例如,您可以将此视为另一个数字添加到您的号码中,代表“数字最后更改”。 例如,您以1001[0]并且此节点连接到 1001[0] -> 2001[1] 1001[0] -> 0001[1] 1001[0] -> 1101[2] 1001[0] -> 1011[3] 1001[0] -> 1002[4] 1001[0] -> 0000[4] 或2001[1]至 2001[1] -> 2101[2] 2001[1] -> 2011[3] 2 ...
-
递归路径查找问题(Recursive path finding issue)[2022-03-30]
也许我疯了,但每当我看到涉及断开的连续区域的问题时,我认为不相交的集合 。 不相交集是为非常有效的合并而设计的集合,如果你试图找到#的许多区域是否连接,那么合并就是你做的很多。 将地图上的每个位置放入其自己的不相交集中。 包含位置的任何集合最终都将包含您可以从中移动的所有位置。 怎么样? 我们在地图上走动,任何时候我们可以从一个地方移动到另一个地方,我们合并集合。 你应该采取什么顺序采取这些步骤? 从某个地方洪水填充整个地图 - 从每个位置进行洪水填充,再到您不是来自的任何邻居。 如果X与Y在同一设置中,则 ... -
寻找路径的算法(Algorithm for finding path to point)[2023-06-23]
听起来你只是想要一个线性变换。 喜欢 Xt = (((X'-X)/T)*t)+X, Yt = (((Y'-Y)/T)*t)+Y 或者在英语中,时间t处的图块的坐标是沿着其路径的t / total_frames长度。 如果你不想避开障碍,A *就是矫枉过正。 It sounds like you just want a linear transformation. Like Xt = (((X'-X)/T)*t)+X, Yt = (((Y'-Y)/T)*t)+Y Or in English the coo ... -
我同意Calumn:DFS是最简单的方法。 这是一个类似python的伪代码的简单解决方案。 它会将解决方案打印为“L”,“R”,“U”,“D”的序列,以指示向左,向右,向上或向下。 def flood(x,y,story): if (visited[x][y] or map[x][y]=='0'): return; visited[x][y]=True; if (map[x][y]=='3'): print 'done. The path is: '+story return ...
-
这是一个粗略的方法: 让入口成为最初的起点。 选择一个尚未到达的目标。 执行广度优先(或深度优先)搜索以找到该目标的路径,并标记沿该路径遇到的任何其他目标。 如果已找到所有目标,则停止。 让所选目标所在的房间成为下一个起点。 转到(2)。 根据我的理解,加入所有细分市场所形成的道路将满足您的要求。 Here's a crude approach: Let the entrance be the initial starting point. Select one target not yet reached ...
-
8方向路径寻找算法(8-direction path finding algorithm)[2022-04-08]
我会把音调分成10x10像素网格。 您的路由不必像系统的其他部分那样精细,它会使算法占用更少的内存。 正如克里斯所说,选择合适的启发式算法是让算法正常运行的关键。 I would break the pitch down into 10x10 pixel grid. Your routing does not have to be as finely grained as the rest of your system and it makes the algorithm take up far less ... -
如何在使用可变宽度笔划绘制时使绘制路径平滑(How to make draw path smooth while drawing with variable width stroke)[2023-09-16]
当您检测到更改时,您可以设置目标并插入目标直到达到它,而不是立即跳到新的笔触宽度。 你的mStrokes需要是Float而不是Integer 。 private static final float STROKE_DELTA = 0.0001f; // for float comparison private static final float STROKE_INCREMENT = 0.01f; // amount to interpolate private float currentStroke = ... -
在你的问题中,在A *中,当你访问一个点(x,y线)时,你不会再次访问同一点。 原因是在您的问题中,状态是网格中的位置,并且每个门的状态(打开或关闭)。 所以在开始时,在您的示例中,初始状态为(3,1,{false})。 (错误表示门已关闭)。 当你到达'!' 位置,新状态将是(1,1,{true})所以现在当你到达门时,你将通过门。 In your problem, it is not true that in A* when you visit a point (x,y cord) you won't ...