设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11114|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, W$ \% c* k" E* @7 r$ g/ @; I  T8 z* ~8 F
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
/ R# n- T5 l' V6 s5 G% O% q+ B, `& z7 y8 l6 ^9 ^; J5 Q% s. u, Z. T
begin P_read arriving
5 }/ U# \% l1 K' f    while 1=1 do begin: H6 T* l) V; m) E+ N( A: T
        read A_tote from "data.txt" with delimiter "\n"
4 k6 m: t, k8 e6 t        read A_time from "data.txt" with delimiter "\n"
: J* a, F7 n$ f' y4 K- {6 X        read A_leave from "data.txt" with delimiter "\n"
1 K7 R. ]2 n/ O: L        read A_picks from "data.txt" with delimiter "\n"5 S  \- S- z$ a' c
        set load type to A_tote
, t* s& r" P, |' l/ }. D9 I! Y% _& Y        if A_tote="tote 1" then set A_induct to 15 q" d: m3 m0 ^$ `8 ?; s0 W1 D7 t6 G
        else if A_tote="tote 2" then set A_induct to 2
6 P. \" U% c; S9 q9 R: \            else set A_induct to 3    7 L7 X! ^$ p( O1 P& _3 {
        set A_i to 0$ P5 q+ k3 M8 S2 |# T2 k2 r" u
        clone 1 load to P_induction6 v1 }- i( }% u
        wait for A_time sec' N8 D8 E. J7 s
    end! L! [1 Z0 @/ ^* k, A
end* |5 H# O: E9 a1 I1 a! ~$ U
7 Z4 e, z; }& Q8 H# u
begin P_induction arriving. s* \6 K$ s; K) ?# i0 }
    if A_induct=1 then clone 1 load to P_pick1
* W9 }) P% X  o; d: l    else if A_induct=2 then clone 1 load to P_pick2
. ~9 @. i$ ^2 e" h        else clone 1 load to P_pick3& }4 \3 w/ H" ^- B
end
1 \: s0 b- P9 u+ [* f* [/ y$ w% C6 `2 j
begin P_pick1 arriving
' M" q( P6 C: e5 U  |& J& W    set A_i to 1
  O. Q, j' T9 f: w# [; b/ o7 h. {  w) w4 t    move into Q_induct1
# U+ ?9 m. m2 r7 m) J    move into pickaisle.induct1) f# c4 J) D5 ^, ]4 r& l
    while A_i<=30 do begin
2 r8 m8 |/ o' l6 ]4 L        travel to pickaisle.con(A_i)
7 y# l# Q& o( A: p/ Q9 q2 \! |        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( c* A* H" P0 l: z- q4 o- d        else wait for 10 sec* S8 _, T; N; H, q, ]# ?. I, a
        if A_i=A_leave then send to die
$ i: `! ~9 {3 {- g        else inc A_i by 13 k! n4 L1 s( A% {* H, Q% a
    end
4 N: P" z( l9 F+ v1 H- O* Xend
6 \7 m+ w8 a, b. ^" }
. H( F  F$ \. K8 m/ R9 ~begin P_pick2 arriving$ F% D2 K. w( q0 n
    set A_i to 11% o# n. b0 n6 q& T
    move into Q_induct2
! H# t( I4 B3 C* o" H2 D9 j8 F    move into pickaisle.induct21 e; D6 F! Q7 h9 |, z# E5 _
    while A_i<=30 do begin# s$ e3 w1 J' O+ Q
        travel to pickaisle.con(A_i)
2 x$ {, v' t9 L* _( V' E        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" |2 G- J# ~# y- P% Q' M        else wait for 10 sec
1 N! F" J$ `5 o        if A_i=A_leave then send to die
7 A0 A; q5 Z, z, k# t4 ~5 }$ F        else inc A_i by 11 M0 P  p1 D' F: C
    end
& s& y/ s6 n: i$ ~end
. i$ }  d! H3 S8 ^  T! m! Z$ b
begin P_pick3 arriving
- g5 e8 s# P: H2 I2 L6 q8 o    set A_i to 215 W" v) E. x( j  z
    move into Q_induct3, b- u5 `6 Y! W0 Y! Y9 i# S: q
    move into pickaisle.induct3
# I3 z0 z9 H1 u, L) v% t+ j    while A_i<=30 do begin: N1 x& K: F, ~1 D" ]
        travel to pickaisle.con(A_i)
4 M) K! s0 R- k1 H5 ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 P) [" ^5 y. m
        else wait for 10 sec+ ~' n2 {% j) G8 R/ p- J
        if A_i=A_leave then send to die
7 E6 V2 m' F3 B! ?- N- R        else inc A_i by 17 l6 C  Z4 F3 z* G3 R
    end* }! x- d/ O  D7 _& C
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是个什么东东?8 N: k9 x' V# n- Y
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?# O/ R) L4 B9 ~% A

4 B1 L1 O$ z9 _, V" GAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
% }/ k+ a. R8 ~
1 Y1 y* P, \  w% {另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:  L8 `2 U* k" Q7 l
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;" F- D6 N5 d7 k* s
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
7 J$ a( W1 }! i6 |3 _, E; o3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
/ O" A  n! V+ Sbegin P_induction arriving
& O9 L! l; F2 M+ ^; l    clone 1 load to P_pick(A_induct)& \8 R, f6 Y& L8 P4 K' N0 l* t
end最大的系
" Z* H: O! K, @) o
" Q+ H& n& E/ o. wbegin P_pick arriving7 |* \& Y: Z9 ?! F1 C
    set A_i to procindex * 10 + 1, T4 i: y2 ^3 H9 h
    move into Q_induct(procindex)- w8 ?% Q7 F' d* H/ y2 \3 a& T
    move into pickaisle.induct(procindex)
6 m/ M3 L, P$ `5 K1 d# X    /*check the type of pickaisle.induct(i), for your last problem.*/
& R& s" L& k2 A2 s+ y. t( g8 q
7 p: J5 q+ ?( _# t* D0 g2 l. b0 y    while A_i<=30 do begin
: J7 ^6 G( ?7 O  q+ T: I0 V        travel to pickaisle.con(A_i)
! M. Y+ r5 B1 x8 t. l4 j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ ^' B/ ]( Z( {8 k/ o+ F        else wait for 10 sec
: n3 r8 j' _/ N  h        if A_i=A_leave then send to die
/ @1 R  D4 v; T        else inc A_i by 1
) g& K; H% O; L& W* z! ]    end
7 V% F5 B5 W( A& n, _end
, q5 a3 [; h' u+ k/ K  T2 @
" k& }( g; E5 n$ i* l其中的procindex为整形,代表当前process的序号。
6 x3 }. B9 T2 }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-10-25 10:02 , Processed in 0.015796 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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