设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11531|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, B$ |3 B- T* c! m5 M9 l7 y2 F  U% G, e; w$ j
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
4 X; F% y! N: e- x+ s9 l
% O6 N& ^/ ?% k; }( \begin P_read arriving8 x& X2 T6 q( g% s1 k9 M
    while 1=1 do begin$ _( g- G) Q, w( c7 w1 u" {$ J
        read A_tote from "data.txt" with delimiter "\n"
' C% a9 d  g# y; C$ D        read A_time from "data.txt" with delimiter "\n"; v5 {4 T! N. J/ p( @) B( r+ ^/ }
        read A_leave from "data.txt" with delimiter "\n"
: U8 u8 B; Q  J5 b; n        read A_picks from "data.txt" with delimiter "\n"
; O' t- `; F1 G) g  X  \, {        set load type to A_tote% e* J3 U$ W* Y, V6 s7 Z
        if A_tote="tote 1" then set A_induct to 1
6 G+ S9 r4 g: o* `        else if A_tote="tote 2" then set A_induct to 2) ]3 \( Z9 F7 d; N
            else set A_induct to 3   
. M% m  K6 U7 B* M& j        set A_i to 0$ k8 l0 K4 O- g- k8 p. W: i2 o; s" d
        clone 1 load to P_induction( U% d7 y3 C  Q+ T6 x: A! B9 v' [
        wait for A_time sec) A% \3 D( i" F1 L" v! K  ~# J
    end
# X& v" p9 k/ V( c& Cend
7 G% {/ \9 L7 `- }2 O2 L6 a0 b* N' F! s7 T
begin P_induction arriving
- v! F$ V0 P2 K    if A_induct=1 then clone 1 load to P_pick1* d0 P9 I" E  g& G5 w
    else if A_induct=2 then clone 1 load to P_pick2
& o; I; f8 U2 e: v3 g2 o$ t        else clone 1 load to P_pick3- `3 T' T5 M. u2 V# M
end( I5 V! X7 p* R3 h, k  [' @
+ i# Z& T2 Y) d7 j1 Z
begin P_pick1 arriving$ u6 u- n6 x0 A$ \: i
    set A_i to 1/ e  j2 a& n6 R4 v; b3 E
    move into Q_induct1
. k' ~9 |6 M* F; u3 V8 _    move into pickaisle.induct1
/ Y) I% V% `. _2 o" d    while A_i<=30 do begin. C: g9 o+ }3 i% |* p% s6 a
        travel to pickaisle.con(A_i)
* }$ ?7 S3 ?, Y* y% O; i5 @5 V% B        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" B1 ?" S- F1 U# [! B4 j- F
        else wait for 10 sec
! i) I. r& c8 o  G5 n: g        if A_i=A_leave then send to die
$ M2 J% d, e9 X  Q; w* Q3 d0 j% @, K1 t        else inc A_i by 1
7 G, [+ m0 x5 W! M5 ~2 w2 K+ a    end/ Q& h1 d; _. W, z2 G
end; t7 H( c$ B' r$ z
* z9 I& v2 G) N* W' u  I8 u/ W* c1 J
begin P_pick2 arriving0 T' R6 |- {8 P5 ?8 X
    set A_i to 118 t8 ?0 ^8 c, Q0 n) Q) }* Q6 n
    move into Q_induct2. a- M' [; ^$ R  t
    move into pickaisle.induct2  N6 q$ _) P  A7 m: O0 }0 t
    while A_i<=30 do begin
6 v/ v; t- P  y$ P! i4 E! O        travel to pickaisle.con(A_i)1 u2 P, N/ g7 a* c' b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 M2 \4 c9 X2 p& k& F$ F4 ?; l3 U/ S4 C        else wait for 10 sec
/ y7 [, `( D1 \- M        if A_i=A_leave then send to die
, A7 {: ]4 B$ r# }3 R        else inc A_i by 1
7 q* u: [' J0 Z1 d3 M0 l) c& P* a    end% h1 `' b+ f1 u) Y: M" D4 s
end
0 @5 ~+ l# D- Q# D" }' ^7 A
5 }! V' f; [/ l- Y* i4 `5 fbegin P_pick3 arriving
3 O; q4 m+ J/ O! u6 A' P7 E6 L5 p    set A_i to 21
9 Q. B  H6 _2 k+ B! h0 n- M$ @    move into Q_induct32 J" i4 c; s/ Y* {1 v% t6 d7 `7 v
    move into pickaisle.induct3% t, o& e4 Y  N7 h$ l5 U* g
    while A_i<=30 do begin4 O$ p, K8 \5 }8 f- N/ v
        travel to pickaisle.con(A_i)
/ Q% ~2 Q4 w: E8 ]) j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( g2 x9 J$ k, e# ~2 {        else wait for 10 sec
/ \) `9 k: m! O& n& t/ c  g        if A_i=A_leave then send to die
! f7 Y6 ]- L. B2 c+ S        else inc A_i by 1$ |3 [4 n* f, ~2 y, {/ w' Q
    end* s: k3 w, {2 P
end

最佳答案

查看完整内容

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是个什么东东?
' H- a& h: d2 _2 _. ^move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
' }) U3 b' \/ f, P. s2 K% G- \( ^! m/ ~9 S6 ^, e
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。5 T% m- T9 {3 T! C2 E* Z  s5 o

( y+ O& n) K4 E/ O% @% U另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
' x+ d# @$ y! `$ @1 ~+ K: _" i; q1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;5 Y; W% i0 k# K" {0 c
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
# [/ Y/ B8 [; M* g$ z9 U3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
) i, W, t7 P) E9 w) Obegin P_induction arriving
  {6 c! h" ?/ V    clone 1 load to P_pick(A_induct)
5 d2 |0 e. ]- F3 b& Nend最大的系
8 G8 s. }6 }+ s6 ?2 I
  S+ d: u; P% }/ o, Nbegin P_pick arriving  G  F) H8 i" z5 a' P) H- c! J, H
    set A_i to procindex * 10 + 1
# C: b' a  w" ^( h    move into Q_induct(procindex)
8 A( O: k& x3 v7 [, U0 R    move into pickaisle.induct(procindex)6 k8 n6 k. U# u4 r! w
    /*check the type of pickaisle.induct(i), for your last problem.*/
) j2 {5 Z+ s6 S  v0 u
) w7 e- Y6 Y  f6 f    while A_i<=30 do begin
, t7 M- b1 n. [$ H  o) a) ]' F        travel to pickaisle.con(A_i)
3 f) @1 o" T; j5 A* O+ X4 _        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 L6 |$ y3 V, g0 v6 n' l. Q
        else wait for 10 sec
- m0 K. w5 Z7 ~, D* q: H+ y" `        if A_i=A_leave then send to die
$ O9 C& x. f# G9 ]" d        else inc A_i by 1+ t7 W3 ~  S: R- q
    end2 v0 i1 a1 e. W" t4 e
end
/ o7 v) X- i) r) U/ u8 H
4 L9 F9 h. ?' e. N, b- b% Y7 @其中的procindex为整形,代表当前process的序号。8 M# e6 x; _* c& u, z
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-11-18 16:41 , Processed in 0.030202 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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