设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12063|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 ~. n/ n2 d7 C5 [/ ?3 i' s0 z
- g2 s* Q! y: {% w6 a) z我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。; j! h% z; a$ r1 i: X7 ^
$ w5 ~4 f: T$ M. k9 K& O, s' U
begin P_read arriving; x2 g( b# k; B
    while 1=1 do begin
" {/ a$ ^. E! A        read A_tote from "data.txt" with delimiter "\n") B% u  E0 I/ w/ u1 f
        read A_time from "data.txt" with delimiter "\n"5 [+ K2 i- \* g
        read A_leave from "data.txt" with delimiter "\n"3 U# h9 Q) ^1 s7 }
        read A_picks from "data.txt" with delimiter "\n"5 }9 |& y" B$ S" R; s4 ^
        set load type to A_tote$ }. y: \, O! y, }/ n6 n8 t
        if A_tote="tote 1" then set A_induct to 1- Y, L* f6 o* W$ u" G0 @
        else if A_tote="tote 2" then set A_induct to 2
6 E+ w' {& G- x            else set A_induct to 3   
0 k5 M. V6 T: X' D* j        set A_i to 04 W1 T! b5 _7 u8 J
        clone 1 load to P_induction
% t: W+ P* t  l* S' z3 I        wait for A_time sec# K7 G2 I% ^: ^
    end! q8 f3 B7 }  f6 v; W
end$ b" O  ~* a. z! {

# ^1 e/ s; g# `4 y; Vbegin P_induction arriving
! n) Z  D! W3 k" W    if A_induct=1 then clone 1 load to P_pick1: m' f3 O0 n; u$ B2 }1 b: k
    else if A_induct=2 then clone 1 load to P_pick28 X+ L5 r$ r* \( @: u8 X" K
        else clone 1 load to P_pick3' g/ p. {6 C% y' _" S) A
end
  R% r' G! o9 a  n! ?7 `; U% |- [' s5 W. _9 w. N6 J0 P( F
begin P_pick1 arriving0 X' S8 }9 H7 S% a
    set A_i to 1/ d1 a  ~% u6 |) ~' h+ G
    move into Q_induct1
5 ]' U3 _2 k4 |3 p) E$ ^    move into pickaisle.induct1
& s% G% f  j) y6 j2 [0 p    while A_i<=30 do begin3 ^# o) M: F7 _1 |
        travel to pickaisle.con(A_i)3 t8 \9 F: p% ^! h: W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 S2 t! t" Y5 _4 S: m
        else wait for 10 sec9 E; X5 F% d& P  j+ U. m" g, _3 H% [
        if A_i=A_leave then send to die# e; G2 [5 P6 L
        else inc A_i by 1
8 J2 e  ~  O# d    end: C* x: Q7 J8 D) L* A! ?4 q
end' g5 g4 o' V' u1 I, j+ m+ E, P
  y, V0 C: V$ d2 \$ E+ D. s
begin P_pick2 arriving$ b- s- q7 Z' \" Z
    set A_i to 116 k$ F+ p! G# |5 Y4 M: ~
    move into Q_induct2
2 M! U7 |, i' b! o& V2 p6 r    move into pickaisle.induct25 v3 k& o1 j# \' B1 E+ M, M1 a/ ]
    while A_i<=30 do begin
; Z7 K) n. d2 A+ g; y& |        travel to pickaisle.con(A_i)% ]5 g) A/ ^' S) q% H6 p
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& |& Q( n" @" v) {
        else wait for 10 sec
# G3 t! @0 O1 R: a* G        if A_i=A_leave then send to die
- j) d, r, A) u. L4 D  H& _        else inc A_i by 1
7 k2 N9 M3 T3 [    end
5 W+ Q1 D$ r& w3 G' X  ^3 dend9 p1 `! Q5 B9 R1 Y1 a2 \; @' ]7 F2 F
7 E- i! d! J8 Y9 X9 M
begin P_pick3 arriving
) n" X( h7 M; u7 w+ W    set A_i to 21
1 Q1 e) q# m, ^3 C    move into Q_induct3
5 h- y8 c7 R$ }; U( q* k    move into pickaisle.induct3
* ?, o) P6 X4 Y6 U4 F, N" v2 s    while A_i<=30 do begin
9 Y" o) s, H* x9 g$ ]        travel to pickaisle.con(A_i)5 S: x9 Z. K+ H. z9 f+ [1 X
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! X* b, f, E/ n+ v6 F0 S
        else wait for 10 sec( W7 S6 a/ I# ^/ N0 E' R
        if A_i=A_leave then send to die) t! y8 I  _& o0 _/ {4 Z6 w, w
        else inc A_i by 1/ j1 w; t7 e/ q7 g
    end
. E& b7 }- _6 qend

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?( M4 q: |! Y7 V- C( ?
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?( X; x& C+ X0 @; ]0 {; o

1 S# R# @6 o2 s) v/ qAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。! G# Y8 G1 _& ~& d
5 G0 Q0 p$ Z$ _) c: g* e/ Z4 j
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:6 b1 D, k( G3 |. `1 n; h
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;5 n1 N2 U8 L; @. W+ K4 B) `2 `
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
4 g8 D) M$ a6 C7 K$ J2 J3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
8 s, ~8 N' u; E0 a6 C! Q' Wbegin P_induction arriving
& p( R( v* N5 g, ]    clone 1 load to P_pick(A_induct)" {% @6 ]1 w, \) S* R2 U% Z+ P, [
end最大的系
( R1 L  e' X2 X" ^# I6 f. {" {- h4 X
  y' {9 K8 Y0 t) gbegin P_pick arriving
3 @8 f/ ~( D2 U( |- F8 @; {    set A_i to procindex * 10 + 1
+ I0 M( v2 \3 c8 o/ v    move into Q_induct(procindex): t# H( O. X2 ]0 |" o
    move into pickaisle.induct(procindex)
' U  P7 b, q4 l1 P; C' T' t    /*check the type of pickaisle.induct(i), for your last problem.*/4 C7 _4 [8 t, G* p" e8 r$ x
+ O/ @& b& v3 ^  `
    while A_i<=30 do begin
% K) t* d; J! F8 Z) r. ?        travel to pickaisle.con(A_i)5 J- a$ ?& o6 O1 T2 q# Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ \) J/ g/ a# l8 M  g' Q. n
        else wait for 10 sec
( ~+ B' P/ |0 k7 x- @0 x+ b, i% _3 I        if A_i=A_leave then send to die  k0 X0 Q2 \4 M" ]) [; a
        else inc A_i by 1! p% K2 O7 L3 B% }
    end
3 _$ `. B8 Q! n$ w! Gend
( Q, `, ?3 }# Y1 b) @
' Q9 N% }- A# w! s& y* @6 ?3 G其中的procindex为整形,代表当前process的序号。" m4 f7 n) d8 e  ]) N! V! i# g2 G
station和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2025-12-24 19:29 , Processed in 0.018758 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表