Difference between revisions of "Tutorial Project. Release 12"

From wiki.visual-prolog.com

m
m
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{spbCopyright}}
{{PolylineTemplateEn
 
|goal= The Release 11 projects family had the game dimension problem - the overloading of the call stack on some values of the multiplication '''TheSizeOfTheBoard*AmountOfRounds''' and appropriate breakdown of the application.
The programs listed below are part of the [[Tutorial Project Evolutions]] article.
The purpose of the Release 12 is to solve the game dimension problem.
 
|goalContent=
[[PolyLine Game Rules|Game Rules ...]]
|code=
 
==Purpose==
The purpose of the Release 12 is to solve the game dimension problem.
The Release 11 projects family had the game dimension problem - the overloading of the call stack on some values of the multiplication '''TheSizeOfTheBoard*AmountOfRounds''' and appropriate breakdown of the application.
==Specialties of the Release 12==
*'''The set of projects'''
*'''The set of projects'''
**The only projects ObjectConsole and  ObjectWin presented in the Release12. The set of projects doesn't contain projects Console, ConsoleLib, ObjectConsoleLib. These projects will not be supported in the future.  
**The only projects ObjectConsole and  ObjectWin presented in the Release12. The set of projects doesn't contain projects Console, ConsoleLib, ObjectConsoleLib. These projects will not be supported in the future.  
**Project ObjectWin contains now three variants ObjectWin0, ObjectWin1, ObjectWin2 (the Personal Edition contains the only projects ObjectWinLibX, where the UI is presented as the library). These variants show the phases of the modification of the code.  
**The Project ObjectWin contains now three variants ObjectWin0, ObjectWin1, ObjectWin2. These variants show the phases of the modification of the code.
**The Projects ObjectWinLibX correspond to projects ObjectWinX, but the HumanInterface is represented as library.  
**The project ObjectConsole contains the only final solutions. The purpose of the project ObjectConsole is testing and compatibility check.  
**The project ObjectConsole contains the only final solutions. The purpose of the project ObjectConsole is testing and compatibility check.  
*'''The same functionality'''
**The test model of the player added
The behavior of applications of the Release 12 is the same as the behavior of applications of the Release 11
*'''The test model of the player added'''
The only purpose of the creation of the model of the player '''Computer00''' is to simulate the behavior of the application on the large amount of moves, which players make.  
The only purpose of the creation of the model of the player '''Computer00''' is to simulate the behavior of the application on the large amount of moves, which players make.  
Some Explanations
{| cellspacing="0" border="1"
|-
!Project
!Description
|-
| ObjectWin0/Polyline12_ObjWindows
| The code of the class SeniourJudge is modified to make it clear the of the interaction of players and the class '''JuniourJudge'''. The player model '''Computer00''' added. The Player '''Computer00''' makes always the same special move. The class JuniourJudge recognizes this special move, doesn't show it on the board and informs the SeniourJudge about move occurrence. Thus the next move may be done. The maximal amount of moves is defined by the constant '''playLimit_C''' in the class JuniourJudge. The problem appears when '''playLimit_C'''=10000.
|-
|ObjectWin1/Polyline12_ObjWindows
| The first step of the modification of the code to solve the problem. The recursive mechanism of the organization of moves is replaced by the iterative mechanism. The application works stable when '''playLimit_C'''=100000. The multigame mode and the interruption process is not modified correctly.
|-
| ObjectWin2/Polyline12_ObjWindows
| The final version. All modes can run correctly. Test player '''Computer00''' can play, when '''playLimit_C'''=100000.
|}


==Download and Install==
Some Explanations:
To install and run the set of projects of the Release 12:
{{Polyline12CodeExplanation}}
*Download archives
 
**'''SpbVipSDK_73_PE_Examples_Polyline12_Classes.zip'''  
|functionality=
**'''SpbSVipDK_73_PE_Examples_Polyline12_Programs.zip''',
No Changes
|install=
If you have '''VipSpbSDK''', then you will find all projects in the directory '''Examples\Polyline\Polyline12\Programs'''
 
{{PolylineInstall}}


using the PDC forum page [http://discuss.visual-prolog.com/viewtopic.php?p=31296&sid=b2208e8e3ec2a4480bffd4e7ecc61290#31296 VIP-Tools and Examples]
|open=
*Extract archives listed above to the same directory. You should have in mind, that each of the archives creates the structure of the folders with the root PdcSpbSDK. Repetitions are possible. The result the structure of the Release 12 should look like:
==Building==
[[Polyline Version Reference|'''Please, see first your version specialty''']]


[[Image:Polyline12Structure.jpg]]
Open and build projects:
*Programs\ObjectConsole\Polyline12_ObjConsole.prj6
*Programs\ObjectWin0\Polyline12_ObjWindows.prj6
*Programs\ObjectWin1\Polyline12_ObjWindows.prj6
*ProgramsDir\ObjectWin2\Polyline12_ObjWindows.prj6


==Run==
Run command file Programs\BuildHumanInterfaceLib.cmd
Open, build and run (using '''VIP 7.3'''):
*Programs/ObjectWinLib0/Polyline12_ObjWindows.prj
*Programs/ObjectWinLib1/Polyline12_ObjWindows.prj
*Programs/ObjectWinLib2/Polyline12_ObjWindows.prj
*Programs/ObjectConsole/Polyline12_ObjectConsole.prj


As before to build projects of the Polyline11 release the IDE variable SpbSolutions must be set to the SpbVipSDK directory.
Open and build projects (if needed):
*Programs\ObjectWinLib0\Polyline12_ObjWindows.prj6
*Programs\ObjectWinLib1\Polyline12_ObjWindows.prj6
*Programs\ObjectWinLib2\Polyline12_ObjWindows.prj6


Player '''Computer00''' may be involved as the single player and must be assigned as the Starter.
{{PolylineBuildCMD}}


The language of the application, if supported, may be defined in the command line by the language identifier:
|run=
*en - English
*Player Computer00 may be involved as the single player and must be assigned as the Starter.
*ru - Russian


{{PolylineRun7_X}}
|rusver=
[[ru:Учебный Проект. Релиз 12]]
[[ru:Учебный Проект. Релиз 12]]
[[Category:Tutorial Project Evolutions]]
}}

Latest revision as of 17:00, 10 April 2011

Written by Victor Yukhtenko. Email: victor@pdc.spb.su

The programs listed below are part of the Evolutions Tutorial Project article.

Game Rules ...

Goal

The Release 11 projects family had the game dimension problem - the overloading of the call stack on some values of the multiplication TheSizeOfTheBoard*AmountOfRounds and appropriate breakdown of the application. The purpose of the Release 12 is to solve the game dimension problem.

Functionality

No Changes

Code

  • Tested with Visual Prolog 7.3 build 7302.
  • The set of projects
    • The only projects ObjectConsole and ObjectWin presented in the Release12. The set of projects doesn't contain projects Console, ConsoleLib, ObjectConsoleLib. These projects will not be supported in the future.
    • The Project ObjectWin contains now three variants ObjectWin0, ObjectWin1, ObjectWin2. These variants show the phases of the modification of the code.
    • The Projects ObjectWinLibX correspond to projects ObjectWinX, but the HumanInterface is represented as library.
    • The project ObjectConsole contains the only final solutions. The purpose of the project ObjectConsole is testing and compatibility check.
    • The test model of the player added

The only purpose of the creation of the model of the player Computer00 is to simulate the behavior of the application on the large amount of moves, which players make.

Some Explanations:

Project Description
ObjectWin0/Polyline12_ObjWindows The code of the class SeniourJudge is modified to make it clear the of the interaction of players and the class JuniourJudge. The player model Computer00 added. The Player Computer00 makes always the same special move. The class JuniourJudge recognizes this special move, doesn't show it on the board and informs the SeniourJudge about move occurrence. Thus the next move may be done. The maximal amount of moves is defined by the constant playLimit_C in the class JuniourJudge. The problem appears when playLimit_C=10000.
ObjectWin1/Polyline12_ObjWindows The first step of the modification of the code to solve the problem. The recursive mechanism of the organization of moves is replaced by the iterative mechanism. The application works stable when playLimit_C=100000. The multigame mode and the interruption process is not modified correctly.
ObjectWin2/Polyline12_ObjWindows The final version. All modes can run correctly. Test player Computer00 can play, when playLimit_C=100000.

Install

If you have VipSpbSDK, then you will find all projects in the directory Examples\Polyline\Polyline12\Programs

To get the full set of projects of the series of the Polyline projects, please download archives using links at PDC forum:

  • VipSpbSDK_PE_73_Examples_Polyline_1_14.zip
  • VipSpbSDK_PE_73_Tools_Polyline_1_14.zip]

to any convenient directory. The directory named VipSpbSDK will be created automatically.

Building

Please, see first your version specialty

Open and build projects:

  • Programs\ObjectConsole\Polyline12_ObjConsole.prj6
  • Programs\ObjectWin0\Polyline12_ObjWindows.prj6
  • Programs\ObjectWin1\Polyline12_ObjWindows.prj6
  • ProgramsDir\ObjectWin2\Polyline12_ObjWindows.prj6

Run command file Programs\BuildHumanInterfaceLib.cmd

Open and build projects (if needed):

  • Programs\ObjectWinLib0\Polyline12_ObjWindows.prj6
  • Programs\ObjectWinLib1\Polyline12_ObjWindows.prj6
  • Programs\ObjectWinLib2\Polyline12_ObjWindows.prj6

To build projects the IDE variable SpbSolutions must be set to the VipSpbSDK directory.

The complex building

To simplify the settings and initial building of applicaions the Build.cmd command file included (BuildPersonal.cmd - please see details in Polyline Version Reference or in Examples\Polyline\VersionReference.html).

The use of Build.cmd file:

  • sets the SpbSolutions IDE variable, which refers to the VipSpb SDK directory;
  • "knows" where Visual Prolog is installed and uses VipBuilder.exe;
  • builds all projects containing in the subfolders;
  • builds all needed libraries;
  • registers all pzl-Components (if needed);
  • informs regarding the result of each building operation;
  • Build.cmd file may be used together with the Visual Prolog CE only (please see details in Polyline Version Reference or in Examples\Polyline\VersionReference.html).

Run

  • Player Computer00 may be involved as the single player and must be assigned as the Starter.
  • Run the application using the E of the IDE or run the executable at the directory EXE.
  • The language of the application may be defined in the command line by the language identifier:
    • en - English
    • ru - Russian
  • When running the program from the IDE, the parameter of the language must be placed to the field "Project Settings"\Run Options\Run Arguments, available from menu Project\Settings...