设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14706|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% m! S# T9 b; M- _
7 D8 s: C8 l' d: @, H1 e# l" [
我的问题是,在每个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中的数值,不知道会不会有什么不妥。) F  X( |! U5 }
2 c! r/ n4 W3 y% R
begin P_read arriving: n! t3 e! {- D
    while 1=1 do begin9 e! a& u3 E/ f1 v
        read A_tote from "data.txt" with delimiter "\n"4 A7 T$ h2 ?* k7 @2 u
        read A_time from "data.txt" with delimiter "\n"$ ?  h7 [0 I, ]% _
        read A_leave from "data.txt" with delimiter "\n"
! [1 X3 u9 m( H5 L/ X9 O        read A_picks from "data.txt" with delimiter "\n") D) \8 B9 E, \% W' `1 c6 U+ i
        set load type to A_tote
; ^0 e' a7 q1 [$ C- ^/ t5 L* E        if A_tote="tote 1" then set A_induct to 1
! j  T5 f5 G/ O2 O        else if A_tote="tote 2" then set A_induct to 24 T) I2 d- n- G* L* Q- E
            else set A_induct to 3   
6 B+ a/ {5 d- T; f        set A_i to 0
8 z0 D2 Q- ^* v' W0 w! i  S# w" m        clone 1 load to P_induction
7 U; Y1 F/ C5 `" ?( V: o        wait for A_time sec
! P. f6 I6 K; B4 L- [/ H    end2 L) d& t$ y' u$ b4 a& M; p6 g( c
end) n; L6 m" n4 b( S/ q

2 B/ {2 a( ?1 ?0 Qbegin P_induction arriving
( h6 d6 \2 [3 H7 b    if A_induct=1 then clone 1 load to P_pick1* N8 Q2 J6 `+ q5 o
    else if A_induct=2 then clone 1 load to P_pick2+ D/ Q0 l2 p% H, ^& _' w2 F- w
        else clone 1 load to P_pick3% Q+ O' `+ M0 \0 [
end
* G& r- A, _( [, ^3 k; l  W" O, m% Q9 H5 c( K. B
begin P_pick1 arriving& o+ e7 r: q. }8 t2 y
    set A_i to 17 ^4 Y& ]4 x3 n" L6 B7 g
    move into Q_induct1
* W; p9 Y2 J* z# [5 n    move into pickaisle.induct1
$ g. q7 s5 @1 G    while A_i<=30 do begin
8 A2 Y; Y* n' R1 l7 d# t        travel to pickaisle.con(A_i)% i5 N& J6 a2 [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 [2 i. ]' }  i6 f( ?9 U
        else wait for 10 sec& q) U  {* N& C, H2 `  F& \
        if A_i=A_leave then send to die
1 o3 z8 g$ T: P/ |7 G        else inc A_i by 19 u, [6 ^" G% y: j! a* h6 j7 @
    end
4 Q9 z9 M* {. g. @+ {end" h, y, x8 f- B7 J# v( e1 l7 d7 `
' T) {0 c* m2 K" n5 ^
begin P_pick2 arriving
) P  A. S. F7 }' v( H    set A_i to 11' M; @, v" \- C# j: s6 x( J
    move into Q_induct2
8 L1 t, w6 F( ?( }  Z7 D* d    move into pickaisle.induct2
2 d& G0 y+ N9 }# U' x5 f4 G$ a  J    while A_i<=30 do begin4 ~6 a; S( a2 X3 f7 l6 D  l
        travel to pickaisle.con(A_i)
4 _* o! u3 H& ]$ m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* P+ Q/ }1 j) l# x) ^! d
        else wait for 10 sec
4 ^! r/ Q. l% H1 P7 M! s% I        if A_i=A_leave then send to die& x' v! j: X% U  V% U8 ]7 H
        else inc A_i by 1
+ h. Q2 l9 U# v7 I0 x- a8 Q! Y, D    end
# s5 ?+ G, R; `' U) w" K7 S* d# Aend1 T# C: X* n1 {
7 ^- t( A: H$ H+ [) M; h3 u
begin P_pick3 arriving
/ t7 w" n2 H7 B+ [    set A_i to 21
# B3 {' |! D0 Z' j    move into Q_induct3
% j" U0 I7 `; I, t( ^) r' D. f    move into pickaisle.induct3
+ S" g, e' F0 h7 Z' X    while A_i<=30 do begin
$ ~3 Q: D, V: k4 v+ D% b0 h        travel to pickaisle.con(A_i)
/ ?3 g' m  i" J7 N! z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ K7 u7 [3 B* c9 s2 ]8 f& F2 ^; E0 m        else wait for 10 sec! w1 p- @! H; r7 V9 r8 o
        if A_i=A_leave then send to die2 \& ]# t( [' \, }
        else inc A_i by 1
% {# S( M$ U& L( b5 y/ I    end1 p7 d5 f7 P( O2 \( b9 d' R* a
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是个什么东东?: F' \8 c' o4 P5 x, B
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
$ x% Z) d; w7 D: P" }* _) [2 J- Z5 ?( }: d* j/ s5 K
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。1 S: `5 L" `6 j- ]: z
" L+ o# L6 z1 o  o" ^5 ^1 E
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
! w3 `+ y! a+ A% J8 R  I1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
/ A0 ?  q" L% N8 j2 P% w" v5 G: z2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
* v0 x6 K9 @, k9 b9 v' E( ^$ `: [3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
$ \% g# |. V$ f1 }" zbegin P_induction arriving
! K: s- Y1 U9 J% p4 _5 e    clone 1 load to P_pick(A_induct)
% [/ n" o: L( e1 G& s; yend最大的系! J6 u% N* R6 P5 B3 g3 s

' y8 v# K) j& u: g0 k2 Mbegin P_pick arriving
. f2 K& R/ d# c5 j+ g. Z    set A_i to procindex * 10 + 15 K$ B/ s/ k- a. ]  s# N
    move into Q_induct(procindex)2 F* u/ K+ `3 [; W9 N
    move into pickaisle.induct(procindex), `" C4 D! T, W0 Z% _
    /*check the type of pickaisle.induct(i), for your last problem.*/
% N# ], T) D: c& y) V1 \6 C) C- Y& E5 N# r4 F. H. b  J
    while A_i<=30 do begin2 K+ h1 `/ \# i9 @
        travel to pickaisle.con(A_i)2 s0 E. O+ V; a# E
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ z# S* `" n. q% B        else wait for 10 sec/ z2 r8 s$ f, J* q2 u, q& c" b# B
        if A_i=A_leave then send to die* K7 _$ N9 k2 W! H8 ~
        else inc A_i by 1+ A+ J; L! C" X) s
    end
+ K# \0 f: I/ f2 m+ \4 z% bend& j1 y8 O( b1 Y. @- I0 B! i
. {: g0 G: {4 }* t& A  O
其中的procindex为整形,代表当前process的序号。
3 y; x: [* R+ G9 }2 T+ Y3 Qstation和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, 2026-7-22 09:10 , Processed in 0.015915 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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