Coding for the technology model and its editor is all but complete. I have had some problems coding the technology level change as a function of helpers and RPs. The formulae do not seem to be all that stable and have not been summarized recently. It is taking time to get a coherent picture.
The I and E parameters seem to be floating around - I don't know what to do with them. In passing, the symbol E is used for at least three different things in the model.
The final provisional draft definitive idea for the technology interface is:
To use this:
1. For each technology owner, get an interface:
TechnologyInterface parisTech = Technology.newInstance("Paris");
If you need to find an existing interface, use:
TechnologyInterface londonTech = Technology.getInstance("London")
2. To get rid of an interface (when London burns, for example), use
londonInterface.remove();
3. If Paris splits into two different communes with the same tech levels, use
TechnologyInterface newParisTech = parisTech.copy("New Paris");
4. Then, when they reunite:
parisTech.merge("New Paris");
newParisTech.remove();
5. To get the tech level for a particular technology, use
float londonBottlers = londonTech.getLevel("Bottle washing theory");
6. To set the tech level for a particular technology, use
londonTech.setLevel("Bottle washing theory", 87.43);
7. For applications, to see if London can build an automatic washing machine, use
londonTech.isBuildable("Automatic washing machine");
8. To get the effectiveness of said application, use
float washerbility = londonTech.getEffect("Automatic washing machine");
9. To add some research to an activity, use
addToResearch("Cleanliness", 32.2);
10. To update all the technology levels in the game at the end of a turn, use
Technology.update()
I have also added a couple of diffusion knoledge methods which I will discuss later:
public void setDiffusionFrom(String neighbour, float effect);
public void setDiffusionFrom(TechnologyInterface neighbour, float effect);
That's enough for one post.
Cheers
The I and E parameters seem to be floating around - I don't know what to do with them. In passing, the symbol E is used for at least three different things in the model.
The final provisional draft definitive idea for the technology interface is:
Code:
/** * Title: TechnologyActivity * Description: Technology specific aspects of activities * Copyright 2001, the Clash of Civilizations Development Group * * @author Gary Thomas and Mark Everson * @version 0.1, Date: March 27, 2001 */ /** * The general interface for all connections to the technology model. * * The calls are grouped according to their context. * * Definition: * [b]owner[/b] or [b]Technology owner[/b]: * any entity (civilization, province, map square, city, scientific genius * character - the Einstein effect) that has a technology level profile. * The system keeps a list of owners, and they can interact. * * In addition to this interface there are three static calls: * * Create a new Technology object for a new technology owner *TechnologyInterface Technology.newInstance(String owner)
* * Find a Technology object for a technology owner *TechnologyInterface Technology.getInstance(String owner)
* * Update the technology levels for all owners *void Technology.update()
*/ public interface TechnologyInterface { //---------------------- Affecting the interface itself ------------------- /** * Remove this technology. * * This does not destroy the interface object, it just removes the owner * from the owner's list. To get rid of the object, set it o null. */ public void remove(); //---------------------------- Other Technology --------------------------- /** * Clone this technology (the owner has split into two parts). * * The new interface will be a copy of the old one, with all the same * levels * @param newOwner the owner's name for the new interface */ public TechnologyInterface copy(String newOwner); /** * Merge this technology (two owners have merged) * * Note that this does not remove the (now) redundant owner. * @param merging the name of the other owner */ public void merge(String merging); //-------------------------- Technology levels ---------------------------- /** * Get the level of a particular technology for this civilization * * @param name name of the technology * @return the technology level for this technology */ public float getLevel(String name); /** * Set the level of a particular technology for this civilization * * @param name name of the technology * @param level the technology level to be set */ public void setLevel(String name, float level); //----------------------------- Applications ------------------------------ /** * Application, method to determine whether an application is buildable * * @param name name of the application * @return true if the application can be built */ public boolean isBuildable(String name); /** * Application, get the effect of an application from its name * @param name name of the application * @return the effect of technology on the application */ public float getEffect(String name); //-------------------------- Research effects ---------------------------- /** * Set the research effect related to an activity * * @param activityData the activity data */ public void addToResearch(String name, float value); //--------------------------- Diffusion ----------------------------------- /** * Set diffusion from neighbour * @param neighbour name of neighbour * @param effect the effect (0.0 - 1.0) of the diffusion */ public void setDiffusionFrom(String neighbour, float effect); /** * Set diffusion from neighbour * @param neighbour TechnologyInterface of neighbour * @param effect the effect (0.0 - 1.0) of the diffusion */ public void setDiffusionFrom(TechnologyInterface neighbour, float effect); }
1. For each technology owner, get an interface:
TechnologyInterface parisTech = Technology.newInstance("Paris");
If you need to find an existing interface, use:
TechnologyInterface londonTech = Technology.getInstance("London")
2. To get rid of an interface (when London burns, for example), use
londonInterface.remove();
3. If Paris splits into two different communes with the same tech levels, use
TechnologyInterface newParisTech = parisTech.copy("New Paris");
4. Then, when they reunite:
parisTech.merge("New Paris");
newParisTech.remove();
5. To get the tech level for a particular technology, use
float londonBottlers = londonTech.getLevel("Bottle washing theory");
6. To set the tech level for a particular technology, use
londonTech.setLevel("Bottle washing theory", 87.43);
7. For applications, to see if London can build an automatic washing machine, use
londonTech.isBuildable("Automatic washing machine");
8. To get the effectiveness of said application, use
float washerbility = londonTech.getEffect("Automatic washing machine");
9. To add some research to an activity, use
addToResearch("Cleanliness", 32.2);
10. To update all the technology levels in the game at the end of a turn, use
Technology.update()
I have also added a couple of diffusion knoledge methods which I will discuss later:
public void setDiffusionFrom(String neighbour, float effect);
public void setDiffusionFrom(TechnologyInterface neighbour, float effect);
That's enough for one post.
Cheers
Comment