16,019,132 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by NeatNet (Top 10 by date)
NeatNet
24-Feb-21 10:10am
View
Sorry, I forgot to post my code before. Now the question has it
NeatNet
24-Feb-21 10:08am
View
I just updated my question and added my code
NeatNet
24-Feb-21 10:02am
View
Deleted
volume(9,5).
program(A,B,W):-
volume(VA,VB),
A>=0,
A=<va,
b="">=0,
B=<vb,
change(a,b,[[a,b]],w),
="" write1(w).
=""
write1([]).
write1([x|l]):-
="" writeln(x),
="" write1(l).
element(a,b,w,w1):-
="" not(member([a,b],w)),
="" add1([a,b],w,w2),
="" change(a,b,w2,w1).
=""
change(3,_,w,w).
change(_,3,w,w).
change(a,b,w,w1):-
="" volume(va,_),
="" b="">0,
C is VA-A,
C>0,
min(B,C,Min),
A1 is A+Min,
B1 is B-Min,
element(A1,B1,W,W1).
change(A,B,W,W1):-
volume(_,VB),
A>0,
C is VB-B,
C>0,
min(A,C,Min),
B1 is B+Min,
A1 is A-Min,
element(A1,B1,W,W1).
change(A,B,W,W1):-
volume(VA,_),
A=VA,
B>0,
element(0,B,W,W1).
change(A,B,W,W1):-
volume(_,VB),
A>0,
B=VB,
element(A,0,W,W1).
change(A,B,W,W1):-
volume(VA,_),
A=0,
element(VA,B,W,W1).
change(A,B,W,W1):-
volume(_,VB),
B=0,
element(A,VB,W,W1).
min(A,B,A):- A=<b.
min(a,b,b):-a>B.
add(X,L,[X|L]).
add1(X,[],[X]).
add1(X,[X1|L],[X1|L1]):-
add1(X,L,L1).
NeatNet
12-Jan-21 17:10pm
View
Thanks. I will try your code
NeatNet
10-Jan-21 17:38pm
View
I did exactly that in my code and it didn't help. Local search cannot give out another correct state without knowing previous states. I think that this task has no solution, as any incorrect relocation of a ball will lead to deadend
NeatNet
9-Jan-21 20:31pm
View
Thanks a lot. But how about when balls have IDs and the initial state is: [B1, B2, B3, B4, 0, W1, W2, W3] and the final state is: [W1, W2, W3, 0, B1, B2, B3, B4]? What is the optimizing function then would be?
NeatNet
7-Jan-21 17:16pm
View
Ok, so when I generate only a single ulong number and divide it by ulong.MaxValue, will it be a truly secure generator with equal probability of all cases??
NeatNet
22-Mar-19 17:51pm
View
Thanks! About these lines - If you use your abstract class of Function to serve as base for both NonDeterministic and Deterministic functions you are exposing implementation that only concerns one side of those functions (Ex: deterministic classes would be able to see/implement nondeterministic methods (potentially) if you use the abstract Function class for both types of deterministic functions).
But I put deterministic logic strictly to the [DeterministicFunction] class and the non-deterministic logic to [NonDeterministicFunction] - they will not intersect, I mean their interactions will not meet. As for interface [IFunction] - yes, I thought about it - that looks neat in terms of clean interface
NeatNet
5-Nov-17 22:51pm
View
It's just to fit the constructor of the Task class cause it accepts only Action and Action<t> delegates
NeatNet
10-Nov-16 7:36am
View
Thanks. But is it correct to convert from interface to class? Or in this case it has no issues? I see now
Show More