中兴捧月杯 数字配对

“中兴捧月”杯 校园赛事嘉年华 | 程序设计大赛(初赛)

数字化婚姻配对尝试

题目:

建立一个模型,来模拟推导社会男女择偶过程。为了模型简化,一个人的特性指标有三个,这里假设为财富、样貌、品格,每个指标均可取值1-100之间任意数字。同样也对这3项指标有自己的需求。这3个需求值取值范围都在1-98间,当然三者的和必须为100.所以任意一个人可以用以下数组来表述:G(A、B、C、A1、B1、C1)G代表男,M代表女。举例G11(80、50、40、10、30、60),表示男11号,拥有财富80、样貌50、品格40,对异性品格的偏好为:财富在乎程度百分之10、样貌在乎程度百分之30、品格在乎程度百分之60。同样为了模型简化,假设信息是完全对称的,即是说,每个人都能一眼就能看清楚任意一个人的财富、样貌、品格。
还是为了模型简化,我建模所用样本为男女各100个,即男女人数相同。
每个人对异性的满意度将如下定义:每个偏好指标与异性的对应的禀赋指标相乘,三个指标的乘积再相加,即他(她)对某个异性的满意度。
举例G11(80、50、40、10、30、60)对M(50、60、80、40、10、50)的满意度为:(10*50+30*60+60*80)= 7100分相对的 MM 对 GG的满意度则为40*80+10*50+50*40) = 5700分好了,配对活动开始,设计的配对法则如下:
1、100个男方,顺序,轮流从0号到99号女方中挑选自己最满意的一位,然后向她发出配对邀请。
2、接受邀请最多的女方开始行动,对这些邀请的男性中,选择最满意的一位。
3、那么这两位配对成功,剔除出样本,剩下的99对继续这样配对。
4、循环该配对法则,直到最后一对男女配对成功。
三、初赛阶段要求:
1、编程语言为java,C++或C语言任意一种;运行环境windows。
2、能让用户输入自己的参数以及对各项数值的偏好,然后随机生成100位男性100位女性(包括用户在内。如果用为男性则为99男100女),数值全部随机但需满足题设限制。按照上述规则给出一个匹配结果呈现给用户。

3、若采用c/c++,要输出可执行程序;若采用java,给出jar和bat。
4、在匹配时,如果发现有多个满意度相同的对象,要求自身三个属性(财富,外貌,品格)总和大的优先,如果再相同则id小的优先。如果有2位女士的选票相同,优先级规则同上。请把主角的id置为最小值,以便在前2个条件相同情况下,主角可以优先选择。
5、程序读取指定的配置文件,获取样本,然后根据指定的输入,输出结果。同时会给出一组源数据和标准答案给学生自测。最后再让学生根据不同的,指定的输入,给出考试答案。
  请点击下载配置文件附件。附件中,male.txt,female.txt,players.txt 分别是男士样本、女士样本和主角样本各 100位。 男女样本中,每行都代表一位男士或女士的基本属性,从左到右依次是ID, 样貌,品格,财富 , 期望样貌,期望品格,期望财富,没有加入性别,需要在解析时手动添加,每个txt文本的性别都是一样的,请注意。另外,主角样本中没有ID属性,换成了性别属性,其中 0表示女性,1表示男性,其余属性依次为样貌,品格,财富,期望样貌 ,期望品格,期望财富。建议把主角的id都设置为
-1,以便满足优先选择的条件。
给出标准答案2组,用于考生自测:
1号主角(文本第一行),选择的对象属性为(6,18,82,87,3,10)
2号主角(文本第二行),选择的对象属性为(27,74,22,22,58,20)
同时要求考生输出9号主角(0,72,55,53,8,87,5),19号主角(0,11,4,63,22,60,18),47号主角(1,19,8,21,1,53,46),83号主角(1,23,11,17,58,31,11),99号主角(1,26,66,1,78,11,11)以及100号主角(0,68,28,19,43,11,46)的选择结果。

界面:

package jins.start;
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import java.sql.*;
public class DengLu extends JFrame {

	public JLabel name = new JLabel("用户名");
	public JLabel pass = new JLabel("密 码");
	public JTextField userName = new JTextField();
	public JPasswordField passWord = new JPasswordField();
	public Button bok = new Button("登陆");
	public Button bexit = new Button("取消");
	public DengLu() {
		this.setContentPane(new MyPanel());
		setTitle("欢迎使用数字配对系统");
		setLayout(null);
		setSize(500, 400);
		setResizable(false);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		Dimension scr = Toolkit.getDefaultToolkit().getScreenSize();
		Dimension frm = this.getSize();
		setLocation( (scr.width - frm.width) / 2,
				(scr.height - frm.height) / 2 - 18);
		name.setBounds(70, 260, 120, 20);
		userName.setBounds(120, 260, 120, 27);
		pass.setBounds(70, 300, 120, 20);
		passWord.setBounds(120, 300, 120, 27);
		passWord.setEchoChar('*');
		bok.setBounds(340, 260, 100, 28);
		bexit.setBounds(340, 300, 100, 28);
		add(name);
		add(userName);
		add(pass);
		add(passWord);
		add(bok);
		add(bexit);
		setVisible(true);
		bexit.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				System.exit(0);
			}
		});
		bok.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				if (userName.getText().equals("")) {
					JOptionPane.showMessageDialog(null, "用户名不能为空!");
				} else if (passWord.getText().equals("")) {
					JOptionPane.showMessageDialog(null, "密码不能为空!");
				} else {
					if (userName.getText().equals("admin") &&
							passWord.getText().equals("admin")) {
						dispose();
						Activity activity = new Activity();
						activity.init();
						Frame frame = new Frame(activity);
						frame.show();
					} else {
						JOptionPane.showMessageDialog(null, "密码错误");
						userName.setText(null);
						passWord.setText(null);
					}
				}
			}
		});
	}
	private class MyPanel extends JPanel {
		public void paintComponent(Graphics g) {
			Graphics2D g2 = (Graphics2D)g;
			super.paintComponent(g);
			Image img = Toolkit.getDefaultToolkit().getImage("bg.jpg");
			g2.drawImage(img, 0, 0, this.getWidth(), this.getHeight(), this);
		}
	}
}
package jins.start;
import jins.start.Activity;
import jins.start.Person;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.NumberFormat;
import javax.swing.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import java.sql.*;
public class Frame
{
	private JFrame frame;
	private JTextArea infoArea;
	private Activity activity;
	public Frame(Activity activity)
	{
		this.activity = activity;
	}
	public void show()
	{
		frame = new JFrame();
		frame.setTitle("数字化配对");
		frame.setDefaultCloseOperation(3);
		int width = Toolkit.getDefaultToolkit().getScreenSize().width;
		int height = Toolkit.getDefaultToolkit().getScreenSize().height;
		frame.setLocation(width / 2 - 200, height / 2 - 150);
		init();
		frame.pack();
		frame.setVisible(true);
		frame.setResizable(false);
		frame.setSize(800, 400);
	}
	private void init()
	{
		InputVerifier verifier = new InputVerifier() {
			final Frame this$0;
			public boolean verify(JComponent input)
			{
				JFormattedTextField field = (JFormattedTextField)input;
				if (field.isEditValid())
				{
					if (field.getText() == null || field.getText().trim().equals(""))
					{
						infoArea.append((new StringBuilder(String.valueOf(field.getName()))).append("输入错误,请输入1~98数字 \n").toString());
						return false;
					}
					int value = Integer.parseInt(field.getText());
					if (value >= 1 && value <= 98)
					{
						return true;
					} else
					{
						infoArea.append((new StringBuilder(String.valueOf(field.getName()))).append("输入错误,请输入1~98数字 \n").toString());
						return false;
					}
				} else
				{
					infoArea.append((new StringBuilder(String.valueOf(field.getName()))).append("输入错误,请输入1~98数字 \n").toString());
					return false;
				}
			}

			{
				this$0 = Frame.this;
				//super();
			}
		};
		JPanel mainPanel = new JPanel();
		mainPanel.setLayout(new BorderLayout());
		JTabbedPane westPanel = new JTabbedPane();
		JPanel manulPanel = new JPanel();
		Box mainBox = Box.createVerticalBox();
		Box genderBox = Box.createHorizontalBox();
		JLabel genderLabel = new JLabel("性别:");
		ButtonGroup group = new ButtonGroup();
		final JRadioButton maleButton = new JRadioButton("男", true);
		group.add(maleButton);
		JRadioButton femaleButton = new JRadioButton("女", false);
		group.add(femaleButton);
		genderBox.add(genderLabel);
		genderBox.add(Box.createHorizontalStrut(10));
		genderBox.add(maleButton);
		genderBox.add(Box.createHorizontalStrut(10));
		genderBox.add(femaleButton);
		Box attributeBox = Box.createHorizontalBox();
		Box personalBox = Box.createVerticalBox();
		JLabel personalLabel = new JLabel("个人属性");
		Box fortuneBox = Box.createHorizontalBox();
		JLabel fortuneLabel = new JLabel("财富:");
		final JFormattedTextField fortuneField = new JFormattedTextField(NumberFormat.getInstance());
		fortuneField.setName("个人属性(财富)");
		fortuneField.setSize(100, 100);
		fortuneField.setInputVerifier(verifier);
		fortuneBox.add(fortuneLabel);
		fortuneBox.add(Box.createHorizontalStrut(10));
		fortuneBox.add(fortuneField);
		Box appearanceBox = Box.createHorizontalBox();
		JLabel appearanceLabel = new JLabel("外貌:");
		final JFormattedTextField appearanceField = new JFormattedTextField(NumberFormat.getInstance());
		appearanceField.setName("个人属性(外貌)");
		appearanceField.setInputVerifier(verifier);
		appearanceBox.add(appearanceLabel);
		appearanceBox.add(Box.createHorizontalStrut(10));
		appearanceBox.add(appearanceField);
		Box charactoreBox = Box.createHorizontalBox();
		JLabel charactorLabel = new JLabel("品格:");
		final JFormattedTextField charactorField = new JFormattedTextField(NumberFormat.getInstance());
		charactorField.setName("个人属性(品格)");
		charactorField.setInputVerifier(verifier);
		charactoreBox.add(charactorLabel);
		charactoreBox.add(Box.createHorizontalStrut(10));
		charactoreBox.add(charactorField);
		personalBox.add(personalLabel);
		personalBox.add(Box.createVerticalStrut(20));
		personalBox.add(fortuneBox);
		personalBox.add(Box.createVerticalStrut(20));
		personalBox.add(appearanceBox);
		personalBox.add(Box.createVerticalStrut(20));
		personalBox.add(charactoreBox);
		Box requireBox = Box.createVerticalBox();
		JLabel requireLabel = new JLabel("需求属性");
		Box requireFortuneBox = Box.createHorizontalBox();
		JLabel requireFortuneLabel = new JLabel("财富:");
		final JFormattedTextField requireFortuneField = new JFormattedTextField(NumberFormat.getInstance());
		requireFortuneField.setName("需求属性(财富)");
		requireFortuneField.setInputVerifier(verifier);
		requireFortuneBox.add(requireFortuneLabel);
		requireFortuneBox.add(Box.createHorizontalStrut(10));
		requireFortuneBox.add(requireFortuneField);
		Box requireAppearanceBox = Box.createHorizontalBox();
		JLabel requireAppearanceLabel = new JLabel("外貌:");
		final JFormattedTextField requireAppearanceField = new JFormattedTextField(NumberFormat.getInstance());
		requireAppearanceField.setName("需求属性(外貌)");
		requireAppearanceField.setInputVerifier(verifier);
		requireAppearanceBox.add(requireAppearanceLabel);
		requireAppearanceBox.add(Box.createHorizontalStrut(10));
		requireAppearanceBox.add(requireAppearanceField);
		Box requireCharactoreBox = Box.createHorizontalBox();
		JLabel requireCharactorLabel = new JLabel("品格:");
		final JFormattedTextField requireCharactorField = new JFormattedTextField(NumberFormat.getInstance());
		requireCharactorField.setName("需求属性(品格)");
		requireCharactorField.setInputVerifier(verifier);
		requireCharactoreBox.add(requireCharactorLabel);
		requireCharactoreBox.add(Box.createHorizontalStrut(10));
		requireCharactoreBox.add(requireCharactorField);
		requireBox.add(requireLabel);
		requireBox.add(Box.createVerticalStrut(20));
		requireBox.add(requireFortuneBox);
		requireBox.add(Box.createVerticalStrut(20));
		requireBox.add(requireAppearanceBox);
		requireBox.add(Box.createVerticalStrut(20));
		requireBox.add(requireCharactoreBox);
		attributeBox.add(personalBox);
		attributeBox.add(Box.createHorizontalStrut(40));
		attributeBox.add(requireBox);
		Box buttonBox = Box.createHorizontalBox();
		JButton confirm = new JButton("确定");
		confirm.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub
				if (!fortuneField.isEditValid() || fortuneField.getText().equals(""))
				{
					infoArea.append((new StringBuilder(String.valueOf(fortuneField.getName()))).append("输入错误,请输入1~98数字 \n").toString());
					return;
				}
				if (!appearanceField.isEditValid() || appearanceField.getText().equals(""))
				{
					infoArea.append((new StringBuilder(String.valueOf(appearanceField.getName()))).append("输入错误,请输入1~98数字 \n").toString());
					return;
				}
				if (!charactorField.isEditValid() || charactorField.getText().equals(""))
				{
					infoArea.append((new StringBuilder(String.valueOf(charactorField.getName()))).append("输入错误,请输入1~98数字 \n").toString());
					return;
				}
				int requireFortune = -200;
				int requireAppearance = -200;
				int requireCharactor = -200;
				if (!requireFortuneField.isEditValid() || requireFortuneField.getText().equals(""))
				{
					infoArea.append((new StringBuilder(String.valueOf(requireFortuneField.getName()))).append("输入错误,请输入1~98数字 \n").toString());
					return;
				}
				requireFortune = Integer.parseInt(requireFortuneField.getText());
				if (!requireAppearanceField.isEditValid() || requireAppearanceField.getText().equals(""))
				{
					infoArea.append((new StringBuilder(String.valueOf(requireAppearanceField.getName()))).append("输入错误,请输入1~98数字 \n").toString());
					return;
				}
				requireAppearance = Integer.parseInt(requireAppearanceField.getText());
				if (!requireCharactorField.isEditValid() || requireCharactorField.getText().equals(""))
				{
					infoArea.append((new StringBuilder(String.valueOf(requireCharactorField.getName()))).append("输入错误,请输入1~98数字 \n").toString());
					return;
				}
				requireCharactor = Integer.parseInt(requireCharactorField.getText());
				if (requireFortune + requireAppearance + requireCharactor != 100)
				{
					infoArea.append("需求属性之和(财富+外貌+品格)必须为100 \n");
				} else
				{
					int gender = maleButton.isSelected() ? 1 : 0;
					infoArea.append("产生随机样本... \n");
					infoArea.append(activity.generate(gender));
					infoArea.append("样本生成完毕 \n");
					infoArea.append("匹配结果: \n");
					infoArea.append(activity.join(new Person(-1, gender, Integer.parseInt(fortuneField.getText()), Integer.parseInt(appearanceField.getText()), Integer.parseInt(charactorField.getText()), requireFortune, requireAppearance, requireCharactor)));
					infoArea.append(" \n");
				}
			}
		});
		JButton clear1 = new JButton("清空信息");
		clear1.addActionListener(new ActionListener() {

			final Frame this$0;

			public void actionPerformed(ActionEvent arg0)
			{
				infoArea.setText("");
			}

			{
				this$0 = Frame.this;
				//super();
			}
		});
		buttonBox.add(confirm);
		buttonBox.add(Box.createHorizontalStrut(40));
		buttonBox.add(clear1);
		mainBox.add(genderBox);
		mainBox.add(Box.createVerticalStrut(20));
		mainBox.add(attributeBox);
		mainBox.add(Box.createVerticalStrut(20));
		mainBox.add(buttonBox);
		manulPanel.add(mainBox);
		JScrollPane manulPane = new JScrollPane(mainBox);
		westPanel.add("手动输入演示", manulPane);
		JPanel autoPanel = new JPanel();
		autoPanel.setLayout(new FlowLayout());
		JButton start = new JButton("开始");
		start.addActionListener(new ActionListener() {

			final Frame this$0;

			public void actionPerformed(ActionEvent arg0)
			{
				infoArea.append("100位主角匹配结果如下: \n");
				infoArea.append(activity.play());
			}

			{
				this$0 = Frame.this;
				//super();
			}
		});
		autoPanel.add(start);
		JButton clear2 = new JButton("清空信息");
		clear2.addActionListener(new ActionListener() {

			final Frame this$0;

			public void actionPerformed(ActionEvent arg0)
			{
				infoArea.setText("");
			}

			{
				this$0 = Frame.this;
				//super();
			}
		});
		autoPanel.add(clear2);
		westPanel.add("载入样本演示", autoPanel);
		infoArea = new JTextArea(20, 35);
		infoArea.setLineWrap(true);
		infoArea.setEditable(false);
		JScrollPane eastPanel = new JScrollPane(infoArea);
		mainPanel.add(westPanel, "West");
		mainPanel.add(eastPanel, "East");
		frame.add(mainPanel);
	}
	private class MyPanel extends JPanel {
		public void paintComponent(Graphics g) {
			Graphics2D g2 = (Graphics2D)g;
			super.paintComponent(g);
			Image img = Toolkit.getDefaultToolkit().getImage("bg.jpg");
			g2.drawImage(img, 0, 0, this.getWidth(), this.getHeight(), this);
		}
	}

}
载入文件:
package jins.start;

import jins.start.Person;
import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;

public class Loader
{
	public Loader()
	{
	}
	public static ArrayList loadPlayerList(String path)
	{
		ArrayList list;
		BufferedReader reader;
		list = new ArrayList();
		reader = null;
		try {
			reader = new BufferedReader(new FileReader(path));
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		try {
			for (String line = ""; (line = reader.readLine()) != null;)
			{
				String array[] = line.split(",");
				list.add(new Person(-1, Integer.parseInt(array[0]), Integer.parseInt(array[1]), Integer.parseInt(array[2]), Integer.parseInt(array[3]), Integer.parseInt(array[4]), Integer.parseInt(array[5]), Integer.parseInt(array[6])));
			}
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		if (reader != null)
		{
			try
			{
				reader.close();
			}
			catch (IOException e1)
			{
				e1.printStackTrace();
			}
			reader = null;
		}

		//e;

		return list;
	}

	public static HashMap loadSampleMap(String path, int gender)
	{
		HashMap map;
		BufferedReader reader;
		map = new HashMap();
		reader = null;
		try {
			reader = new BufferedReader(new FileReader(path));
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		try {
			for (String line = ""; (line = reader.readLine()) != null;)
			{
				String array[] = line.split(",");
				int id = Integer.parseInt(array[0]);
				map.put(Integer.valueOf(id), new Person(id, gender, Integer.parseInt(array[1]), Integer.parseInt(array[2]), Integer.parseInt(array[3]), Integer.parseInt(array[4]), Integer.parseInt(array[5]), Integer.parseInt(array[6])));
			}
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		try {
			reader.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return map;
	}
}
模拟投票:
package jins.start;

import java.util.ArrayList;

//Referenced classes of package cn.gucas.dsp.pengf.mg.model:
//			Person

public class Vote
{

	private int id;
	private ArrayList voters;

	public Vote()
	{
		voters = new ArrayList();
	}

	public void addVoter(Person person)
	{
		voters.add(person);
	}

	public int getId()
	{
		return id;
	}

	public void setId(int id)
	{
		this.id = id;
	}

	public ArrayList getVoters()
	{
		return voters;
	}

	public void setVoters(ArrayList voters)
	{
		this.voters = voters;
	}
}
条件筛选:
package jins.start;

public class Satisfaction implements Comparable
{

	private Person person;
	private int satisfaction;

	public Satisfaction()
	{
	}

	public Person getPerson()
	{
		return person;
	}

	public void setPerson(Person person)
	{
		this.person = person;
	}

	public int getSatisfaction()
	{
		return satisfaction;
	}

	public void setSatisfaction(int satisfaction)
	{
		this.satisfaction = satisfaction;
	}

	public int compareTo(Satisfaction other)
	{
		if (satisfaction > other.satisfaction)
			return -1;
		if (satisfaction < other.satisfaction)
			return 1;
		if (person.getTotalQuality() > other.person.getTotalQuality())
			return -1;
		if (person.getTotalQuality() < other.person.getTotalQuality())
			return 1;
		return person.getId() >= other.person.getId() ? 1 : -1;
	}

	public int compareTo(Object obj)
	{
		return compareTo((Satisfaction)obj);
	}
}
任务属性:
package jins.start;

import java.util.Iterator;
import java.util.PriorityQueue;

// Referenced classes of package cn.gucas.dsp.pengf.mg.model:
//			Satisfaction

public class Person
{

	private int id;
	private int gender;
	private int fortune;
	private int appearance;
	private int character;
	private int requireFortune;
	private int requireAppearance;
	private int requireCharacter;
	private PriorityQueue satisfactionQueue;
	private PriorityQueue backupSatisfactionQueue;

	public Person(int id, int gender, int fortune, int appearance, int character, int requireFortune, int requireAppearance,
			int requireCharacter)
	{
		satisfactionQueue = new PriorityQueue();
		backupSatisfactionQueue = new PriorityQueue();
		this.id = id;
		this.gender = gender;
		this.fortune = fortune;
		this.appearance = appearance;
		this.character = character;
		this.requireFortune = requireFortune;
		this.requireAppearance = requireAppearance;
		this.requireCharacter = requireCharacter;
	}

	private int getSatisfaction(Person person)
	{
		return requireFortune * person.fortune + requireAppearance * person.appearance + requireCharacter * person.character;
	}

	public void judgePerson(Person person)
	{
		Satisfaction satisfaction = new Satisfaction();
		satisfaction.setPerson(person);
		satisfaction.setSatisfaction(getSatisfaction(person));
		satisfactionQueue.add(satisfaction);
	}

	public void buildBackupPriorityQueue()
	{
		backupSatisfactionQueue.clear();
		Satisfaction satisfaction;
		for (Iterator iterator = satisfactionQueue.iterator(); iterator.hasNext(); backupSatisfactionQueue.add(satisfaction))
			satisfaction = (Satisfaction)iterator.next();

	}

	public void changePlayer(Person person)
	{
		buildBackupPriorityQueue();
		Satisfaction satisfaction = new Satisfaction();
		satisfaction.setPerson(person);
		satisfaction.setSatisfaction(getSatisfaction(person));
		backupSatisfactionQueue.add(satisfaction);
	}

	public int getTotalQuality()
	{
		return fortune + appearance + character;
	}

	public int peekGod()
	{
		return ((Satisfaction)backupSatisfactionQueue.peek()).getPerson().getId();
	}

	public int pollGod()
	{
		return ((Satisfaction)backupSatisfactionQueue.poll()).getPerson().getId();
	}

	public int getId()
	{
		return id;
	}

	public void setId(int id)
	{
		this.id = id;
	}

	public int getGender()
	{
		return gender;
	}

	public void setGender(int gender)
	{
		this.gender = gender;
	}

	public int getFortune()
	{
		return fortune;
	}

	public void setFortune(int fortune)
	{
		this.fortune = fortune;
	}

	public int getAppearance()
	{
		return appearance;
	}

	public void setAppearance(int appearance)
	{
		this.appearance = appearance;
	}

	public int getCharacter()
	{
		return character;
	}

	public void setCharacter(int character)
	{
		this.character = character;
	}

	public int getRequireFortune()
	{
		return requireFortune;
	}

	public void setRequireFortune(int requireFortune)
	{
		this.requireFortune = requireFortune;
	}

	public int getRequireAppearance()
	{
		return requireAppearance;
	}

	public void setRequireAppearance(int requireAppearance)
	{
		this.requireAppearance = requireAppearance;
	}

	public int getRequireCharacter()
	{
		return requireCharacter;
	}

	public void setRequireCharacter(int requireCharacter)
	{
		this.requireCharacter = requireCharacter;
	}

	public String toString()
	{
		return (new StringBuilder("[")).append(id).append(":").append(fortune).append(",").append(appearance).append(",").append(character).append(",").append(requireFortune).append(",").append(requireAppearance).append(",").append(requireCharacter).append("]").toString();
	}
}
必要的常量:
package jins.start;

public class Constants
{

	public static final String FEMALE_SAMPLE_PATH = "./conf/female.txt";
	public static final String MALE_SAMPLE_PATH = "./conf/male.txt";
	public static final String PLAYERS_PATH = "./conf/players.txt";
	public static final int FEMALE = 0;
	public static final int MALE = 1;
	public static final int PLAYER_ID = -1;
	public static final int N = 100;

	public Constants()
	{
	}
}
下面就是逻辑类了:

package jins.start;

import jins.start.Person;
import jins.start.Vote;
import jins.start.Loader;
import java.util.*;

public class Activity
{

	private HashMap femaleMap;
	private HashMap maleMap;
	private ArrayList playerList;
	private HashMap randomFemaleMap;
	private HashMap randomMaleMap;

	public Activity()
	{
	}

	public void init()
	{
		femaleMap = Loader.loadSampleMap("./conf/female.txt", 0);
		maleMap = Loader.loadSampleMap("./conf/male.txt", 1);
		playerList = Loader.loadPlayerList("./conf/players.txt");
	}

	public String generate(int gender)
	{
		randomFemaleMap = new HashMap();
		randomMaleMap = new HashMap();
		StringBuilder sb = new StringBuilder();
		sb.append("男生                           \t女生 \n");
		for (int i = 0; i < 99; i++)
		{
			int fortune = (int)(Math.random() * 98D + 1.0D);
			int appearance = (int)(Math.random() * 98D + 1.0D);
			int charactor = (int)(Math.random() * 98D + 1.0D);
			int requireFortune = (int)(Math.random() * 98D + 1.0D);
			int requireAppearance = (int)(Math.random() * 98D + 1.0D);
			int requireCharactor = 100 - requireFortune - requireAppearance;
			Person male = new Person(i + 1, 1, fortune, appearance, charactor, requireFortune, requireAppearance, requireCharactor);
			randomMaleMap.put(Integer.valueOf(i + 1), male);
			sb.append((new StringBuilder()).append(male).append("\t").toString());
			fortune = (int)(Math.random() * 98D + 1.0D);
			appearance = (int)(Math.random() * 98D + 1.0D);
			charactor = (int)(Math.random() * 98D + 1.0D);
			requireFortune = (int)(Math.random() * 98D + 1.0D);
			requireAppearance = (int)(Math.random() * 98D + 1.0D);
			requireCharactor = 100 - requireFortune - requireAppearance;
			Person female = new Person(i + 1, 0, fortune, appearance, charactor, requireFortune, requireAppearance, requireCharactor);
			randomFemaleMap.put(Integer.valueOf(i + 1), female);
			sb.append((new StringBuilder()).append(female).append("\n").toString());
		}

		if (gender == 1)
		{
			int fortune = (int)(Math.random() * 98D + 1.0D);
			int appearance = (int)(Math.random() * 98D + 1.0D);
			int charactor = (int)(Math.random() * 98D + 1.0D);
			int requireFortune = (int)(Math.random() * 98D + 1.0D);
			int requireAppearance = (int)(Math.random() * 98D + 1.0D);
			int requireCharactor = 100 - requireFortune - requireAppearance;
			Person female = new Person(100, 0, fortune, appearance, charactor, requireFortune, requireAppearance, requireCharactor);
			randomFemaleMap.put(Integer.valueOf(100), female);
			sb.append((new StringBuilder("              \t       \t")).append(female).append("\n").toString());
		} else
		{
			int fortune = (int)(Math.random() * 98D + 1.0D);
			int appearance = (int)(Math.random() * 98D + 1.0D);
			int charactor = (int)(Math.random() * 98D + 1.0D);
			int requireFortune = (int)(Math.random() * 98D + 1.0D);
			int requireAppearance = (int)(Math.random() * 98D + 1.0D);
			int requireCharactor = 100 - requireFortune - requireAppearance;
			Person male = new Person(100, 1, fortune, appearance, charactor, requireFortune, requireAppearance, requireCharactor);
			randomMaleMap.put(Integer.valueOf(100), male);
			sb.append((new StringBuilder()).append(male).append("\n").toString());
		}
		return sb.toString();
	}

	public String join(Person player)
	{
		StringBuilder sb = new StringBuilder();
		for (Iterator iterator = randomMaleMap.keySet().iterator(); iterator.hasNext();)
		{
			Integer maleId = (Integer)iterator.next();
			Person male = (Person)randomMaleMap.get(maleId);
			Person female;
			for (Iterator iterator5 = randomFemaleMap.keySet().iterator(); iterator5.hasNext(); female.judgePerson(male))
			{
				Integer femaleId = (Integer)iterator5.next();
				female = (Person)randomFemaleMap.get(femaleId);
				male.judgePerson(female);
			}

		}

		HashSet maleGodSet;
		HashSet femaleGodSet;
		HashMap votes;
		if (player.getGender() == 1)
		{
			randomMaleMap.put(Integer.valueOf(player.getId()), player);
			maleGodSet = new HashSet();
			femaleGodSet = new HashSet();
			Person female;
			for (Iterator iterator1 = randomFemaleMap.keySet().iterator(); iterator1.hasNext(); female.changePlayer(player))
			{
				Integer femaleId = (Integer)iterator1.next();
				female = (Person)randomFemaleMap.get(femaleId);
				player.judgePerson(female);
			}

			Person male;
			for (Iterator iterator2 = randomMaleMap.keySet().iterator(); iterator2.hasNext(); male.buildBackupPriorityQueue())
			{
				Integer maleId = (Integer)iterator2.next();
				male = (Person)randomMaleMap.get(maleId);
			}

			votes = new HashMap();
			for (Iterator iterator6 = randomMaleMap.keySet().iterator(); iterator6.hasNext();)
			{
				Integer maleId = (Integer)iterator6.next();
				Person male1 = (Person)randomMaleMap.get(maleId);
				int femaleGodId = male1.peekGod();
				if (votes.containsKey(Integer.valueOf(femaleGodId)))
				{
					Vote vote = (Vote)votes.get(Integer.valueOf(femaleGodId));
					vote.addVoter(male1);
				} else
				{
					Vote vote = new Vote();
					vote.setId(femaleGodId);
					vote.addVoter(male1);
					votes.put(Integer.valueOf(femaleGodId), vote);
				}
			}

			do
			{
				int maxVote = 0x80000000;
				int femaleGodId = 0x80000000;
				for (Iterator iterator8 = votes.keySet().iterator(); iterator8.hasNext();)
				{
					Integer key = (Integer)iterator8.next();
					int voteNum = ((Vote)votes.get(key)).getVoters().size();
					if (voteNum > maxVote)
					{
						maxVote = voteNum;
						femaleGodId = key.intValue();
					} else
					if (voteNum == maxVote)
					{
						int competitorQuality = ((Person)randomFemaleMap.get(key)).getTotalQuality();
						int femaleGodQuality = ((Person)randomFemaleMap.get(Integer.valueOf(femaleGodId))).getTotalQuality();
						if (competitorQuality > femaleGodQuality)
						{
							maxVote = voteNum;
							femaleGodId = key.intValue();
						} else
						if (competitorQuality == femaleGodQuality && key.intValue() < femaleGodId)
						{
							maxVote = voteNum;
							femaleGodId = key.intValue();
						}
					}
				}

				femaleGodSet.add(Integer.valueOf(femaleGodId));
				Person femaleGod = (Person)randomFemaleMap.get(Integer.valueOf(femaleGodId));
				int maleGodId;
				for (maleGodId = femaleGod.pollGod(); maleGodSet.contains(Integer.valueOf(maleGodId)) || ((Person)randomMaleMap.get(Integer.valueOf(maleGodId))).peekGod() != femaleGodId; maleGodId = femaleGod.pollGod());
				maleGodSet.add(Integer.valueOf(maleGodId));
				if (maleGodId == -1)
				{
					sb.append((new StringBuilder()).append(randomMaleMap.get(Integer.valueOf(maleGodId))).append(" <--> ").append(randomFemaleMap.get(Integer.valueOf(femaleGodId))).append("\n").toString());
					return sb.toString();
				}
				ArrayList voters = ((Vote)votes.get(Integer.valueOf(femaleGodId))).getVoters();
				for (Iterator iterator10 = voters.iterator(); iterator10.hasNext();)
				{
					Person voter = (Person)iterator10.next();
					if (voter.getId() != maleGodId)
					{
						voter.pollGod();
						int nextGodId;
						for (nextGodId = voter.peekGod(); femaleGodSet.contains(Integer.valueOf(nextGodId)); nextGodId = voter.peekGod())
							voter.pollGod();

						if (votes.containsKey(Integer.valueOf(nextGodId)))
						{
							Vote vote = (Vote)votes.get(Integer.valueOf(nextGodId));
							vote.addVoter(voter);
						} else
						{
							Vote vote = new Vote();
							vote.setId(nextGodId);
							vote.addVoter(voter);
							votes.put(Integer.valueOf(nextGodId), vote);
						}
					}
				}

				votes.remove(Integer.valueOf(femaleGodId));
			} while (true);
		}
		randomFemaleMap.put(Integer.valueOf(player.getId()), player);
		maleGodSet = new HashSet();
		femaleGodSet = new HashSet();
		Person male;
		for (Iterator iterator3 = randomMaleMap.keySet().iterator(); iterator3.hasNext(); male.changePlayer(player))
		{
			Integer maleId = (Integer)iterator3.next();
			male = (Person)randomMaleMap.get(maleId);
			player.judgePerson(male);
		}

		Person female;
		for (Iterator iterator4 = randomFemaleMap.keySet().iterator(); iterator4.hasNext(); female.buildBackupPriorityQueue())
		{
			Integer femaleId = (Integer)iterator4.next();
			female = (Person)randomFemaleMap.get(femaleId);
		}

		HashMap femaleId = new HashMap();
		for (Iterator iterator7 = randomMaleMap.keySet().iterator(); iterator7.hasNext();)
		{
			Integer maleId = (Integer)iterator7.next();
			Person male1 = (Person)randomMaleMap.get(maleId);
			int femaleGodId = male1.peekGod();
			if (femaleId.containsKey(Integer.valueOf(femaleGodId)))
			{
				Vote vote = (Vote)femaleId.get(Integer.valueOf(femaleGodId));
				vote.addVoter(male1);
			} else
			{
				Vote vote = new Vote();
				vote.setId(femaleGodId);
				vote.addVoter(male1);
				femaleId.put(Integer.valueOf(femaleGodId), vote);
			}
		}

		do
		{
			int maxVote = 0x80000000;
			int femaleGodId = 0x80000000;
			for (Iterator iterator9 = femaleId.keySet().iterator(); iterator9.hasNext();)
			{
				Integer key = (Integer)iterator9.next();
				int voteNum = ((Vote)femaleId.get(key)).getVoters().size();
				if (voteNum > maxVote)
				{
					maxVote = voteNum;
					femaleGodId = key.intValue();
				} else
				if (voteNum == maxVote)
				{
					int competiorQuality = ((Person)randomFemaleMap.get(key)).getTotalQuality();
					int femaleGodQuality = ((Person)randomFemaleMap.get(Integer.valueOf(femaleGodId))).getTotalQuality();
					if (competiorQuality > femaleGodQuality)
					{
						maxVote = voteNum;
						femaleGodId = key.intValue();
					} else
					if (competiorQuality == femaleGodQuality && key.intValue() < femaleGodId)
					{
						maxVote = voteNum;
						femaleGodId = key.intValue();
					}
				}
			}

			femaleGodSet.add(Integer.valueOf(femaleGodId));
			Person god = (Person)randomFemaleMap.get(Integer.valueOf(femaleGodId));
			int maleGodId;
			for (maleGodId = god.pollGod(); maleGodSet.contains(Integer.valueOf(maleGodId)) || ((Person)randomMaleMap.get(Integer.valueOf(maleGodId))).peekGod() != femaleGodId; maleGodId = god.pollGod());
			maleGodSet.add(Integer.valueOf(maleGodId));
			if (femaleGodId == -1)
			{
				sb.append((new StringBuilder()).append(randomMaleMap.get(Integer.valueOf(maleGodId))).append(" <--> ").append(randomFemaleMap.get(Integer.valueOf(femaleGodId))).append("\n").toString());
				return sb.toString();
			}
			ArrayList voters = ((Vote)femaleId.get(Integer.valueOf(femaleGodId))).getVoters();
			for (Iterator iterator11 = voters.iterator(); iterator11.hasNext();)
			{
				Person voter = (Person)iterator11.next();
				if (voter.getId() != maleGodId)
				{
					voter.pollGod();
					int nextGodId;
					for (nextGodId = voter.peekGod(); femaleGodSet.contains(Integer.valueOf(nextGodId)); nextGodId = voter.peekGod())
						voter.pollGod();

					if (femaleId.containsKey(Integer.valueOf(nextGodId)))
					{
						Vote vote = (Vote)femaleId.get(Integer.valueOf(nextGodId));
						vote.addVoter(voter);
					} else
					{
						Vote vote = new Vote();
						vote.setId(nextGodId);
						vote.addVoter(voter);
						femaleId.put(Integer.valueOf(nextGodId), vote);
					}
				}
			}

			femaleId.remove(Integer.valueOf(femaleGodId));
		} while (true);
	}

	public String play()
	{
		StringBuilder sb = new StringBuilder();
		for (Iterator iterator = maleMap.keySet().iterator(); iterator.hasNext();)
		{
			Integer maleId = (Integer)iterator.next();
			Person male = (Person)maleMap.get(maleId);
			Person female;
			for (Iterator iterator2 = femaleMap.keySet().iterator(); iterator2.hasNext(); female.judgePerson(male))
			{
				Integer femaleId = (Integer)iterator2.next();
				female = (Person)femaleMap.get(femaleId);
				male.judgePerson(female);
			}

		}

		int num = 1;
		for (Iterator iterator1 = playerList.iterator(); iterator1.hasNext();)
		{
			Person player = (Person)iterator1.next();
			if (player.getGender() == 1)
			{
				maleMap.put(Integer.valueOf(player.getId()), player);
				HashSet maleGodSet = new HashSet();
				HashSet femaleGodSet = new HashSet();
				Person female;
				for (Iterator iterator3 = femaleMap.keySet().iterator(); iterator3.hasNext(); female.changePlayer(player))
				{
					Integer femaleId = (Integer)iterator3.next();
					female = (Person)femaleMap.get(femaleId);
					player.judgePerson(female);
				}

				Person male;
				for (Iterator iterator4 = maleMap.keySet().iterator(); iterator4.hasNext(); male.buildBackupPriorityQueue())
				{
					Integer maleId = (Integer)iterator4.next();
					male = (Person)maleMap.get(maleId);
				}

				HashMap votes = new HashMap();
				for (Iterator iterator7 = maleMap.keySet().iterator(); iterator7.hasNext();)
				{
					Integer maleId = (Integer)iterator7.next();
					Person male1 = (Person)maleMap.get(maleId);
					int femaleGodId = male1.peekGod();
					if (votes.containsKey(Integer.valueOf(femaleGodId)))
					{
						Vote vote = (Vote)votes.get(Integer.valueOf(femaleGodId));
						vote.addVoter(male1);
					} else
					{
						Vote vote = new Vote();
						vote.setId(femaleGodId);
						vote.addVoter(male1);
						votes.put(Integer.valueOf(femaleGodId), vote);
					}
				}

				do
				{
					int maxVote = 0x80000000;
					int femaleGodId = 0x80000000;
					for (Iterator iterator9 = votes.keySet().iterator(); iterator9.hasNext();)
					{
						Integer key = (Integer)iterator9.next();
						int voteNum = ((Vote)votes.get(key)).getVoters().size();
						if (voteNum > maxVote)
						{
							maxVote = voteNum;
							femaleGodId = key.intValue();
						} else
						if (voteNum == maxVote)
						{
							int competitorQuality = ((Person)femaleMap.get(key)).getTotalQuality();
							int femaleGodQuality = ((Person)femaleMap.get(Integer.valueOf(femaleGodId))).getTotalQuality();
							if (competitorQuality > femaleGodQuality)
							{
								maxVote = voteNum;
								femaleGodId = key.intValue();
							} else
							if (competitorQuality == femaleGodQuality && key.intValue() < femaleGodId)
							{
								maxVote = voteNum;
								femaleGodId = key.intValue();
							}
						}
					}

					femaleGodSet.add(Integer.valueOf(femaleGodId));
					Person femaleGod = (Person)femaleMap.get(Integer.valueOf(femaleGodId));
					int maleGodId;
					for (maleGodId = femaleGod.pollGod(); maleGodSet.contains(Integer.valueOf(maleGodId)) || ((Person)maleMap.get(Integer.valueOf(maleGodId))).peekGod() != femaleGodId; maleGodId = femaleGod.pollGod());
					maleGodSet.add(Integer.valueOf(maleGodId));
					if (maleGodId == -1)
					{
						sb.append((new StringBuilder("[")).append(num++).append("] ").append(maleMap.get(Integer.valueOf(maleGodId))).append(" <--> ").append(femaleMap.get(Integer.valueOf(femaleGodId))).append("\n").toString());
						break;
					}
					if (maleGodSet.size() >= 100)
					{
						sb.append((new StringBuilder("[")).append(num++).append("] ").append("配对失败").append("\n").toString());
						break;
					}
					ArrayList voters = ((Vote)votes.get(Integer.valueOf(femaleGodId))).getVoters();
					for (Iterator iterator11 = voters.iterator(); iterator11.hasNext();)
					{
						Person voter = (Person)iterator11.next();
						if (voter.getId() != maleGodId)
						{
							voter.pollGod();
							int nextGodId;
							for (nextGodId = voter.peekGod(); femaleGodSet.contains(Integer.valueOf(nextGodId)); nextGodId = voter.peekGod())
								voter.pollGod();

							if (votes.containsKey(Integer.valueOf(nextGodId)))
							{
								Vote vote = (Vote)votes.get(Integer.valueOf(nextGodId));
								vote.addVoter(voter);
							} else
							{
								Vote vote = new Vote();
								vote.setId(nextGodId);
								vote.addVoter(voter);
								votes.put(Integer.valueOf(nextGodId), vote);
							}
						}
					}

					votes.remove(Integer.valueOf(femaleGodId));
				} while (true);
				maleMap.remove(Integer.valueOf(player.getId()));
			} else
			{
				femaleMap.put(Integer.valueOf(player.getId()), player);
				HashSet maleGodSet = new HashSet();
				HashSet femaleGodSet = new HashSet();
				Person male;
				for (Iterator iterator5 = maleMap.keySet().iterator(); iterator5.hasNext(); male.changePlayer(player))
				{
					Integer maleId = (Integer)iterator5.next();
					male = (Person)maleMap.get(maleId);
					player.judgePerson(male);
				}

				Person female;
				for (Iterator iterator6 = femaleMap.keySet().iterator(); iterator6.hasNext(); female.buildBackupPriorityQueue())
				{
					Integer femaleId = (Integer)iterator6.next();
					female = (Person)femaleMap.get(femaleId);
				}

				HashMap votes = new HashMap();
				for (Iterator iterator8 = maleMap.keySet().iterator(); iterator8.hasNext();)
				{
					Integer maleId = (Integer)iterator8.next();
					Person male1 = (Person)maleMap.get(maleId);
					int femaleGodId = male1.peekGod();
					if (votes.containsKey(Integer.valueOf(femaleGodId)))
					{
						Vote vote = (Vote)votes.get(Integer.valueOf(femaleGodId));
						vote.addVoter(male1);
					} else
					{
						Vote vote = new Vote();
						vote.setId(femaleGodId);
						vote.addVoter(male1);
						votes.put(Integer.valueOf(femaleGodId), vote);
					}
				}

				do
				{
					int maxVote = 0x80000000;
					int femaleGodId = 0x80000000;
					for (Iterator iterator10 = votes.keySet().iterator(); iterator10.hasNext();)
					{
						Integer key = (Integer)iterator10.next();
						int voteNum = ((Vote)votes.get(key)).getVoters().size();
						if (voteNum > maxVote)
						{
							maxVote = voteNum;
							femaleGodId = key.intValue();
						} else
						if (voteNum == maxVote)
						{
							int competiorQuality = ((Person)femaleMap.get(key)).getTotalQuality();
							int femaleGodQuality = ((Person)femaleMap.get(Integer.valueOf(femaleGodId))).getTotalQuality();
							if (competiorQuality > femaleGodQuality)
							{
								maxVote = voteNum;
								femaleGodId = key.intValue();
							} else
							if (competiorQuality == femaleGodQuality && key.intValue() < femaleGodId)
							{
								maxVote = voteNum;
								femaleGodId = key.intValue();
							}
						}
					}

					femaleGodSet.add(Integer.valueOf(femaleGodId));
					Person god = (Person)femaleMap.get(Integer.valueOf(femaleGodId));
					int maleGodId;
					for (maleGodId = god.pollGod(); maleGodSet.contains(Integer.valueOf(maleGodId)) || ((Person)maleMap.get(Integer.valueOf(maleGodId))).peekGod() != femaleGodId; maleGodId = god.pollGod());
					maleGodSet.add(Integer.valueOf(maleGodId));
					if (femaleGodId == -1)
					{
						sb.append((new StringBuilder("[")).append(num++).append("] ").append(maleMap.get(Integer.valueOf(maleGodId))).append(" <--> ").append(femaleMap.get(Integer.valueOf(femaleGodId))).append("\n").toString());
						break;
					}
					if (maleGodSet.size() >= 100)
					{
						sb.append((new StringBuilder("[")).append(num++).append("] ").append("配对失败").append("\n").toString());
						break;
					}
					ArrayList voters = ((Vote)votes.get(Integer.valueOf(femaleGodId))).getVoters();
					for (Iterator iterator12 = voters.iterator(); iterator12.hasNext();)
					{
						Person voter = (Person)iterator12.next();
						if (voter.getId() != maleGodId)
						{
							voter.pollGod();
							int nextGodId;
							for (nextGodId = voter.peekGod(); femaleGodSet.contains(Integer.valueOf(nextGodId)); nextGodId = voter.peekGod())
								voter.pollGod();

							if (votes.containsKey(Integer.valueOf(nextGodId)))
							{
								Vote vote = (Vote)votes.get(Integer.valueOf(nextGodId));
								vote.addVoter(voter);
							} else
							{
								Vote vote = new Vote();
								vote.setId(nextGodId);
								vote.addVoter(voter);
								votes.put(Integer.valueOf(nextGodId), vote);
							}
						}
					}

					votes.remove(Integer.valueOf(femaleGodId));
				} while (true);
				femaleMap.remove(Integer.valueOf(player.getId()));
			}
		}

		return sb.toString();
	}
}
主类:
package jins.start;

public class MatchGame
{

	public MatchGame()
	{
	}

	public static void main(String args[])
	{
		new DengLu();
	}
}
时间: 2024-10-06 12:44:10

中兴捧月杯 数字配对的相关文章

当当已于2015年1月启动数字业务的正式剥离

摘要: 2月9日上午消息, 当当网 发布微博称,当当已于2015年1月启动数字业务(电子书和内容创意工厂等)的正式剥离,并正与有战略资源的投资合作方接洽.当当网方面随后对腾讯科技表示称 2月9日上午消息,当当网发布微博称,当当已于2015年1月启动数字业务(电子书和内容创意工厂等)的正式剥离,并正与有战略资源的投资合作方接洽.当当网方面随后对腾讯科技表示称,微博中的"剥离"一词并不准确,更准确的说法是独立运营,并已将上午微博撤下.同时当当网对腾讯科技表示,融资的传闻暂时没有具体消息,进

数字Server:2012年5月服务器数字发布

[天极网服务器频道<数字Server>--"用数字见证奇迹" ] 言简意赅,网罗每月与数字有关的业界资讯,给你数字世界视觉震撼,2012年5月数字发布时间到! 40度 NEC发布Express5800新服务器产品,该服务器内置最新至强E5-2400处理器,拥有三个基本型号:R120d-2E.R120d-1E和T120d.新服务器Express5800能够运行于40度高温环境. [编辑观点]NEC最新推出的Express5800新服务器产品整体设计旨在强化服务器产品的高智能节

数字Server:2012年3月服务器数字发布

[天极网服务器频道<数字Server>--"用数字见证奇迹" ] 言简意赅,网罗每月与数字有关的业界资讯,给你数字世界视觉震撼,2012年3月数字发布时间到! 202% 大服务器重生了?三月,工信部国家电子信息产业发展研究院赛迪顾问(CCID)正式发布的<2011-2012年度中国服务器市场研究报告>显示,4路以上大服务器成为2011服务器市场高速增长的核心点,增长率达到202%.大服务器浪潮在2011年回归很大程度上是来自不断膨胀的数据处理需求.企业业务虚拟化

移动应用亟待蜕变 “手机屏媒”新商业模式摘星捧月

 智能手机和3G网络的普及,降低了用户进入移动互联网的门槛,手机终端用户与日俱增,让移动互联网在过去一年呈现爆发性增长,从而刺激了投资商.开发商.运营商的掘金热情,掀起一股移动互联网应用热潮. 两年前,随着IOS和Andriod平台的兴起,APP产业借势爆发.两年之后,APP市场正如想象那般呈现了井喷式的发展,各类APP应用层出不穷.移动互联网的人均上网时长首次超过了PC互联网,且这一趋势正在扩大.无论是在网民的数量,还是上网时长方面,移动互联网都完成了对传统互联网的彻底超越. 然而,经过市场的

遏制竞争对手“掠夺式招聘”进校园

刘琼 不仅有同学情,还有同事谊,研究生毕业那年上海交大焊接专业的鲁华益,"因为专业比较对口",和他的11个同学一起被招进了宝钢,这几乎占到当时整个研究生班的1/5."金属焊接专业的高端人才现在还是比较稀缺的."鲁华益说. 像鲁华益一样,类似成建制被"招兵买马"的状况并不少见,有消息称,2000年重庆邮电大学电信专业一个40余人的毕业班,39人被华为招走.东南大学无线电专业当年30余人毕业,有25人进了华为.这种招人的盛况,自1996年华为进入大发

首个国际奥林匹克日,国奥集团推出数字体育体验月活动

TOM体育讯今天(6月23日),北京奥运后的首个国际奥林匹克日来临之际,国家体育总局.北京市体育局等相关政府部门将在北京奥运中心区开展声势浩大的"国际奥林匹克日"宣传活动,将掀起2009中国全民健身群众体育运动新高潮.作为活动的重要组成部分,国奥集团将在国家体育馆隆重推出数字体育体验月暨数字体育进驻国奥村推广活动. 为配合国家体育总局全民健身计划推动群众健身运动,以创新数字科技为深入持久地开展群众体育运动提供技术手段,在总局群众体育司等单位支持大力支持下,迎接6月23日"国际

一个数字运动王国:耐克NIKE+掘金大揭秘

提到耐克,你 首先想到的是什么?篮球?运动鞋?还是乔丹? 如果你的反应还是这些,那你实在需要重新认识这家公司了. 刚刚结束的2012年可以称为耐克的运动数字化元年,它的数字运动平台Nike+迎来了全面爆发.短短1年时间内,多款重量级产品相继问世,Nike+线上社区的注册用户数量也从年初的500万迅速增加到1000万以上的规模. 耐克的财报显示,2013年第1财季(即2012年第3季度),耐克在北美的营收达到27亿美元,同比增长达到了23%,这个数字远高于过去几年的平均增长率(2011年同期的增长

有些广告运营商使用机器人来模拟真实用户对数字广告进行点击

这一欺诈做法预计将在2015年使广告行业损失63亿美元.据最新研究显示,这种自动化的虚假点击占据视频广告点击次数的比例接近四分之一,占整个互联网显示广告的比例超过十分之一.这一研究由全国广告商协会(Association of National Advertisers)和在线安全公司White Ops联合展开.近几个月,数字广告欺诈行径愈演愈烈,而且这种机器人程序侵入的不仅仅是简单的或新近上线的网站,而且还有一些颇有声望的生活和新闻媒体平台."令人惊讶的是这种欺诈行径几乎无处不在,"全

comScore:8月全美网络视频观看量为250亿次

北京时间9月29日早间消息,据国外媒体报道,美国互联网流量监测机构comScore周一公布的数据显示,今年8月,全美网络视频观看总量达250亿次,YouTube仍然位居首位. comScore的数据显示,谷歌旗下各大网站8月份来自美国的观看总量达到100亿次,其中YouTube占到99%.谷歌的视频观看总量占全美视频观看总量的39.6%. 从数据上看,仍然没有任何对手能够对谷歌构成实质性的威胁.微软旗下各大网站虽然排名第二,但当月视频观看总量仅为5.46亿次,市场份额仅为2.2%.专业视频网站H